APCPSR ; IHS/TUCSON/LAB - PCC Operational Summary AUGUST 14, 1992 ; [ 08/17/03 8:19 PM ]
;;2.0;IHS PCC DATA EXTRACTION SYSTEM;**1,6**;APR 03, 1998
;IHS/CMI/LAB - changed TMP to XTMP
;
START ;
W:$D(IOF) @IOF
W !,"********** PCC DATA TRANSMISSION SUMMARY REPORT **********",!
W !!,"This report presents a summary of data for a single PCC Data Transmission",!,"Log entry.",!!
LOG ;
S APCPSR("LOG")=""
K DIC S DIC="^APCPLOG(",DIC(0)="AEQM" D ^DIC I Y<0 G XIT
S APCPSR("LOG")=+Y
I '$D(^APCPLOG(APCPSR("LOG"),21)) W !!,"Visit data has already been purged!!" G LOG
S X=^APCPLOG(APCPSR("LOG"),0),APCPSR("RUN BEGIN")=$P(X,U),APCPSR("RUN END")=$P(X,U,2),APCPSR("COUNT")=$P(X,U,6),APCPSR("ORIG TX DATE")=$P($P(X,U,3),".")
S Y=APCPSR("RUN BEGIN") X ^DD("DD") S APCPSR("PRINT BEGIN")=Y
S Y=APCPSR("RUN END") X ^DD("DD") S APCPSR("PRINT END")=Y
S APCPSR("VISITS")=$P(^APCPLOG(APCPSR("LOG"),21,0),U,4)
W !!,"Log entry ",APCPSR("LOG"),", was for date range ",APCPSR("PRINT BEGIN")," through",!,APCPSR("PRINT END")," and generated ",APCPSR("COUNT")," transactions from ",APCPSR("VISITS")," visits.",!!
;S DIC="^DIC(40.7,",X=39,DIC(0)="",D="C" D MIX^DIC1 I Y=-1 W !,$C(7),$C(7),"CAN'T FIND PHARMACY CLINIC IN CLINIC STOP FILE" D XIT Q
;S APCPSR("PHARM NAME")=$P(Y,U,2)
S Y=DT D DD^%DT S APCPSR("DTP")=Y
ZIS ;call to XBDBQUE
S XBRP="PRINT^APCPSR",XBRC="PROCESS^APCPSR",XBRX="XIT^APCPSR",XBNS="APCP"
D ^XBDBQUE
D XIT
Q
PROCESS ; Entry point for Taskman
S APCPJOB=$J,APCPBTH=$H
K ^XTMP("APCPSR",APCPJOB,APCPBTH),^XTMP("APCPSRP",APCPJOB,APCPBTH)
S ^XTMP("APCPSR",0)=$$FMADD^XLFDT(DT,14)_"^"_DT_"^"_"PCC DATA TX SUM REPORT"
S APCPSR("BT")=$H
D CHKSITE^APCPDRI
S APCDOVRR=1,APCPSR="APCPSR"
D V^APCPSR1
D SET^APCPSR11
S APCPSR("ET")=$H
Q
PRINT ;EP
D ^APCPSRP
K ^XTMP("APCPSR",APCPJOB,APCPBTH),^XTMP("APCPSRP",APCPJOB,APCPBTH)
Q
XIT ;
K DA,DIE,DIC,POP,DIR
K APCPSR,APCPS,APCDOVRR,APCPVAR,APCPJOB,APCPBTH
Q
APCPSR ; IHS/TUCSON/LAB - PCC Operational Summary AUGUST 14, 1992 ; [ 08/17/03 8:19 PM ]
+1 ;;2.0;IHS PCC DATA EXTRACTION SYSTEM;**1,6**;APR 03, 1998
+2 ;IHS/CMI/LAB - changed TMP to XTMP
+3 ;
START ;
+1 IF $DATA(IOF)
WRITE @IOF
+2 WRITE !,"********** PCC DATA TRANSMISSION SUMMARY REPORT **********",!
+3 WRITE !!,"This report presents a summary of data for a single PCC Data Transmission",!,"Log entry.",!!
LOG ;
+1 SET APCPSR("LOG")=""
+2 KILL DIC
SET DIC="^APCPLOG("
SET DIC(0)="AEQM"
DO ^DIC
IF Y<0
GOTO XIT
+3 SET APCPSR("LOG")=+Y
+4 IF '$DATA(^APCPLOG(APCPSR("LOG"),21))
WRITE !!,"Visit data has already been purged!!"
GOTO LOG
+5 SET X=^APCPLOG(APCPSR("LOG"),0)
SET APCPSR("RUN BEGIN")=$PIECE(X,U)
SET APCPSR("RUN END")=$PIECE(X,U,2)
SET APCPSR("COUNT")=$PIECE(X,U,6)
SET APCPSR("ORIG TX DATE")=$PIECE($PIECE(X,U,3),".")
+6 SET Y=APCPSR("RUN BEGIN")
XECUTE ^DD("DD")
SET APCPSR("PRINT BEGIN")=Y
+7 SET Y=APCPSR("RUN END")
XECUTE ^DD("DD")
SET APCPSR("PRINT END")=Y
+8 SET APCPSR("VISITS")=$PIECE(^APCPLOG(APCPSR("LOG"),21,0),U,4)
+9 WRITE !!,"Log entry ",APCPSR("LOG"),", was for date range ",APCPSR("PRINT BEGIN")," through",!,APCPSR("PRINT END")," and generated ",APCPSR("COUNT")," transactions from ",APCPSR("VISITS")," visits.",!!
+10 ;S DIC="^DIC(40.7,",X=39,DIC(0)="",D="C" D MIX^DIC1 I Y=-1 W !,$C(7),$C(7),"CAN'T FIND PHARMACY CLINIC IN CLINIC STOP FILE" D XIT Q
+11 ;S APCPSR("PHARM NAME")=$P(Y,U,2)
+12 SET Y=DT
DO DD^%DT
SET APCPSR("DTP")=Y
ZIS ;call to XBDBQUE
+1 SET XBRP="PRINT^APCPSR"
SET XBRC="PROCESS^APCPSR"
SET XBRX="XIT^APCPSR"
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("APCPSR",APCPJOB,APCPBTH),^XTMP("APCPSRP",APCPJOB,APCPBTH)
+3 SET ^XTMP("APCPSR",0)=$$FMADD^XLFDT(DT,14)_"^"_DT_"^"_"PCC DATA TX SUM REPORT"
+4 SET APCPSR("BT")=$HOROLOG
+5 DO CHKSITE^APCPDRI
+6 SET APCDOVRR=1
SET APCPSR="APCPSR"
+7 DO V^APCPSR1
+8 DO SET^APCPSR11
+9 SET APCPSR("ET")=$HOROLOG
+10 QUIT
PRINT ;EP
+1 DO ^APCPSRP
+2 KILL ^XTMP("APCPSR",APCPJOB,APCPBTH),^XTMP("APCPSRP",APCPJOB,APCPBTH)
+3 QUIT
XIT ;
+1 KILL DA,DIE,DIC,POP,DIR
+2 KILL APCPSR,APCPS,APCDOVRR,APCPVAR,APCPJOB,APCPBTH
+3 QUIT