APCPRPV ; IHS/TUCSON/LAB - PCC Operational Summary AUGUST 14, 1992 ; [ 04/07/99 11:46 AM ]
;;2.0;IHS PCC DATA EXTRACTION SYSTEM;**1**;APR 03, 1998
;IHS/CMI/LAB - XTMP
;
START ;
W:$D(IOF) @IOF
W !,"********** PCC DATA TRANSMISSION SUMMARY REPORT **********",!
W !!,"This report will list all visits that were exported during a PCC export.",!!,"WARNING: This report can be very long!!!",!!
LOG ;
S APCPRPV("LOG")=""
K DIC S DIC="^APCPLOG(",DIC(0)="AEQM" D ^DIC I Y<0 G XIT
S APCPRPV("LOG")=+Y
I '$D(^APCPLOG(APCPRPV("LOG"),21)) W !!,"Visit data has already been purged!!" G LOG
S X=^APCPLOG(APCPRPV("LOG"),0),APCPRPV("RUN BEGIN")=$P(X,U),APCPRPV("RUN END")=$P(X,U,2),APCPRPV("COUNT")=$P(X,U,6),APCPRPV("ORIG TX DATE")=$P($P(X,U,3),".")
S Y=APCPRPV("RUN BEGIN") X ^DD("DD") S APCPRPV("PRINT BEGIN")=Y
S Y=APCPRPV("RUN END") X ^DD("DD") S APCPRPV("PRINT END")=Y
S APCPRPV("VISITS")=$P(^APCPLOG(APCPRPV("LOG"),21,0),U,4)
W !!,"Log entry ",APCPRPV("LOG"),", was for date range ",APCPRPV("PRINT BEGIN")," through",!,APCPRPV("PRINT END")," and generated ",APCPRPV("COUNT")," transactions from ",APCPRPV("VISITS")," visits.",!!
ZIS ;
S Y=DT D DD^%DT S APCPRPV("DTP")=Y
S XBRC="PROCESS^APCPRPV",XBRP="^APCPRPV1",XBRX="XIT^APCPRPV",XBNS="APCP"
D ^XBDBQUE
D XIT
Q
PROCESS ; Entry point for Taskman
S APCPJOB=$J,APCPBTH=$H
K ^XTMP("APCPRPV",APCPJOB,APCPBTH)
S ^XTMP("APCPRPV",0)=$$FMADD^XLFDT(DT,14)_"^"_DT_"^"_"PCC DATA TX VISIT RPT"
S APCPRPV("BT")=$H
S APCDOVRR=1
V ;
S APCPRPV("V")=0 F S APCPRPV("V")=$O(^APCPLOG(APCPRPV("LOG"),21,APCPRPV("V"))) Q:APCPRPV("V")'=+APCPRPV("V")!($D(APCPRPV("QUIT"))) D PROC
Q
PROC ;
Q:'$P(^APCPLOG(APCPRPV("LOG"),21,APCPRPV("V"),0),U,7)
S ^("TOTAL")=$S($D(^XTMP("APCPRPV",APCPJOB,APCPBTH,"GEN","TOTAL")):(+^("TOTAL")+1),1:1)
S ^XTMP("APCPRPV",APCPJOB,APCPBTH,"VISITS",APCPRPV("V"))=""
Q
XIT ;
K DA,DIE,DIC,DIR,DFN
K APCPRPV,APCPS,APCDOVRR,APCPV0,APCPJOB,APCPBTH
Q
APCPRPV ; IHS/TUCSON/LAB - PCC Operational Summary AUGUST 14, 1992 ; [ 04/07/99 11:46 AM ]
+1 ;;2.0;IHS PCC DATA EXTRACTION SYSTEM;**1**;APR 03, 1998
+2 ;IHS/CMI/LAB - XTMP
+3 ;
START ;
+1 IF $DATA(IOF)
WRITE @IOF
+2 WRITE !,"********** PCC DATA TRANSMISSION SUMMARY REPORT **********",!
+3 WRITE !!,"This report will list all visits that were exported during a PCC export.",!!,"WARNING: This report can be very long!!!",!!
LOG ;
+1 SET APCPRPV("LOG")=""
+2 KILL DIC
SET DIC="^APCPLOG("
SET DIC(0)="AEQM"
DO ^DIC
IF Y<0
GOTO XIT
+3 SET APCPRPV("LOG")=+Y
+4 IF '$DATA(^APCPLOG(APCPRPV("LOG"),21))
WRITE !!,"Visit data has already been purged!!"
GOTO LOG
+5 SET X=^APCPLOG(APCPRPV("LOG"),0)
SET APCPRPV("RUN BEGIN")=$PIECE(X,U)
SET APCPRPV("RUN END")=$PIECE(X,U,2)
SET APCPRPV("COUNT")=$PIECE(X,U,6)
SET APCPRPV("ORIG TX DATE")=$PIECE($PIECE(X,U,3),".")
+6 SET Y=APCPRPV("RUN BEGIN")
XECUTE ^DD("DD")
SET APCPRPV("PRINT BEGIN")=Y
+7 SET Y=APCPRPV("RUN END")
XECUTE ^DD("DD")
SET APCPRPV("PRINT END")=Y
+8 SET APCPRPV("VISITS")=$PIECE(^APCPLOG(APCPRPV("LOG"),21,0),U,4)
+9 WRITE !!,"Log entry ",APCPRPV("LOG"),", was for date range ",APCPRPV("PRINT BEGIN")," through",!,APCPRPV("PRINT END")," and generated ",APCPRPV("COUNT")," transactions from ",APCPRPV("VISITS")," visits.",!!
ZIS ;
+1 SET Y=DT
DO DD^%DT
SET APCPRPV("DTP")=Y
+2 SET XBRC="PROCESS^APCPRPV"
SET XBRP="^APCPRPV1"
SET XBRX="XIT^APCPRPV"
SET XBNS="APCP"
+3 DO ^XBDBQUE
+4 DO XIT
+5 QUIT
PROCESS ; Entry point for Taskman
+1 SET APCPJOB=$JOB
SET APCPBTH=$HOROLOG
+2 KILL ^XTMP("APCPRPV",APCPJOB,APCPBTH)
+3 SET ^XTMP("APCPRPV",0)=$$FMADD^XLFDT(DT,14)_"^"_DT_"^"_"PCC DATA TX VISIT RPT"
+4 SET APCPRPV("BT")=$HOROLOG
+5 SET APCDOVRR=1
V ;
+1 SET APCPRPV("V")=0
FOR
SET APCPRPV("V")=$ORDER(^APCPLOG(APCPRPV("LOG"),21,APCPRPV("V")))
IF APCPRPV("V")'=+APCPRPV("V")!($DATA(APCPRPV("QUIT")))
QUIT
DO PROC
+2 QUIT
PROC ;
+1 IF '$PIECE(^APCPLOG(APCPRPV("LOG"),21,APCPRPV("V"),0),U,7)
QUIT
+2 SET ^("TOTAL")=$SELECT($DATA(^XTMP("APCPRPV",APCPJOB,APCPBTH,"GEN","TOTAL")):(+^("TOTAL")+1),1:1)
+3 SET ^XTMP("APCPRPV",APCPJOB,APCPBTH,"VISITS",APCPRPV("V"))=""
+4 QUIT
XIT ;
+1 KILL DA,DIE,DIC,DIR,DFN
+2 KILL APCPRPV,APCPS,APCDOVRR,APCPV0,APCPJOB,APCPBTH
+3 QUIT