APCPRPS ; IHS/TUCSON/LAB - PCC Operational Summary AUGUST 14, 1992 ; [ 09/08/99 7:40 AM ]
;;2.0;IHS PCC DATA EXTRACTION SYSTEM;**1,3**;APR 03, 1998
;IHS/CMI/LAB - changed TMP to XTMP
;
START ;
W:$D(IOF) @IOF
W !,"********** PCC DATA TRANSMISSION REPORT **********",!
W !!,"This report will list all visits that did not generate",!,"a statistical record to be sent to the data center.",!! ;IHS/CMI/LAB
LOG ;
S APCPRPS("LOG")=""
K DIC S DIC="^APCPLOG(",DIC(0)="AEQM" D ^DIC I Y<0 G XIT
S APCPRPS("LOG")=+Y
I '$D(^APCPLOG(APCPRPS("LOG"),21)) W !!,"Visit data has already been purged!!" G LOG
S X=^APCPLOG(APCPRPS("LOG"),0),APCPRPS("RUN BEGIN")=$P(X,U),APCPRPS("RUN END")=$P(X,U,2),APCPRPS("COUNT")=$P(X,U,6),APCPRPS("ORIG TX DATE")=$P($P(X,U,3),".")
S Y=APCPRPS("RUN BEGIN") X ^DD("DD") S APCPRPS("PRINT BEGIN")=Y
S Y=APCPRPS("RUN END") X ^DD("DD") S APCPRPS("PRINT END")=Y
S APCPRPS("VISITS")=$P(^APCPLOG(APCPRPS("LOG"),21,0),U,4)
W !!,"Log entry ",APCPRPS("LOG"),", was for date range ",APCPRPS("PRINT BEGIN")," through",!,APCPRPS("PRINT END")," and generated ",APCPRPS("COUNT")," transactions from ",APCPRPS("VISITS")," visits."
W !!
ZIS ;
S XBRC="PROCESS^APCPRPS",XBRP="^APCPRPS1",XBRX="XIT^APCPRPS",XBNS="APCP"
D ^XBDBQUE
D XIT
Q
PROCESS ; Entry point for Taskman
S APCPJOB=$J,APCPBTH=$H
K ^XTMP("APCPRPS",APCPJOB,APCPBTH)
S ^XTMP("APCPRPS",0)=$$FMADD^XLFDT(DT,14)_"^"_DT_"^"_"PCC DATA TRANS REPORT"
V ;
S APCPRPS("V")=0 F S APCPRPS("V")=$O(^APCPLOG(APCPRPS("LOG"),21,APCPRPS("V"))) Q:APCPRPS("V")'=+APCPRPS("V") D PROC
Q
PROC ;
Q:$P(^APCPLOG(APCPRPS("LOG"),21,APCPRPS("V"),0),U,5) ;quit if main tx generated
Q:'$D(^AUPNVSIT(APCPRPS("V"))) ;quit if no visit record
S ^("TOTAL")=$S($D(^XTMP("APCPRPS",APCPJOB,APCPBTH,"GEN","TOTAL")):(+^("TOTAL")+1),1:1)
S ^XTMP("APCPRPS",APCPJOB,APCPBTH,"VISITS",APCPRPS("V"))=""
Q
XIT ;
K DA,DIE,DIC,DIR
K APCPRPS,APCPS,APCDOVRR,APCPJOB,APCPBTH
Q
APCPRPS ; IHS/TUCSON/LAB - PCC Operational Summary AUGUST 14, 1992 ; [ 09/08/99 7:40 AM ]
+1 ;;2.0;IHS PCC DATA EXTRACTION SYSTEM;**1,3**;APR 03, 1998
+2 ;IHS/CMI/LAB - changed TMP to XTMP
+3 ;
START ;
+1 IF $DATA(IOF)
WRITE @IOF
+2 WRITE !,"********** PCC DATA TRANSMISSION REPORT **********",!
+3 ;IHS/CMI/LAB
WRITE !!,"This report will list all visits that did not generate",!,"a statistical record to be sent to the data center.",!!
LOG ;
+1 SET APCPRPS("LOG")=""
+2 KILL DIC
SET DIC="^APCPLOG("
SET DIC(0)="AEQM"
DO ^DIC
IF Y<0
GOTO XIT
+3 SET APCPRPS("LOG")=+Y
+4 IF '$DATA(^APCPLOG(APCPRPS("LOG"),21))
WRITE !!,"Visit data has already been purged!!"
GOTO LOG
+5 SET X=^APCPLOG(APCPRPS("LOG"),0)
SET APCPRPS("RUN BEGIN")=$PIECE(X,U)
SET APCPRPS("RUN END")=$PIECE(X,U,2)
SET APCPRPS("COUNT")=$PIECE(X,U,6)
SET APCPRPS("ORIG TX DATE")=$PIECE($PIECE(X,U,3),".")
+6 SET Y=APCPRPS("RUN BEGIN")
XECUTE ^DD("DD")
SET APCPRPS("PRINT BEGIN")=Y
+7 SET Y=APCPRPS("RUN END")
XECUTE ^DD("DD")
SET APCPRPS("PRINT END")=Y
+8 SET APCPRPS("VISITS")=$PIECE(^APCPLOG(APCPRPS("LOG"),21,0),U,4)
+9 WRITE !!,"Log entry ",APCPRPS("LOG"),", was for date range ",APCPRPS("PRINT BEGIN")," through",!,APCPRPS("PRINT END")," and generated ",APCPRPS("COUNT")," transactions from ",APCPRPS("VISITS")," visits."
+10 WRITE !!
ZIS ;
+1 SET XBRC="PROCESS^APCPRPS"
SET XBRP="^APCPRPS1"
SET XBRX="XIT^APCPRPS"
SET XBNS="APCP"
+2 DO ^XBDBQUE
+3 DO XIT
+4 QUIT
PROCESS ; Entry point for Taskman
+1 SET APCPJOB=$JOB
SET APCPBTH=$HOROLOG
+2 KILL ^XTMP("APCPRPS",APCPJOB,APCPBTH)
+3 SET ^XTMP("APCPRPS",0)=$$FMADD^XLFDT(DT,14)_"^"_DT_"^"_"PCC DATA TRANS REPORT"
V ;
+1 SET APCPRPS("V")=0
FOR
SET APCPRPS("V")=$ORDER(^APCPLOG(APCPRPS("LOG"),21,APCPRPS("V")))
IF APCPRPS("V")'=+APCPRPS("V")
QUIT
DO PROC
+2 QUIT
PROC ;
+1 ;quit if main tx generated
IF $PIECE(^APCPLOG(APCPRPS("LOG"),21,APCPRPS("V"),0),U,5)
QUIT
+2 ;quit if no visit record
IF '$DATA(^AUPNVSIT(APCPRPS("V")))
QUIT
+3 SET ^("TOTAL")=$SELECT($DATA(^XTMP("APCPRPS",APCPJOB,APCPBTH,"GEN","TOTAL")):(+^("TOTAL")+1),1:1)
+4 SET ^XTMP("APCPRPS",APCPJOB,APCPBTH,"VISITS",APCPRPS("V"))=""
+5 QUIT
XIT ;
+1 KILL DA,DIE,DIC,DIR
+2 KILL APCPRPS,APCPS,APCDOVRR,APCPJOB,APCPBTH
+3 QUIT