APCPLOG ; IHS/TUCSON/LAB - OHPRD-TUCSON/LAB UPDATE PCC DATA TRANS LOG FILE AUGUST 14, 1992 ; [ 03/03/03 9:42 AM ]
;;2.0;IHS PCC DATA EXTRACTION SYSTEM;**1,3,6**;APR 03, 1998
;IHS/CMI/LAB - date format changed in 0 node per ray willie
LOG ; UPDATE LOG
W:'$D(ZTQUEUED) !!,APCP("COUNT")," transactions were generated."
W:'$D(ZTQUEUED) !,"Updating log entry."
D NOW^%DTC S APCP("RUN STOP")=%
;S ^BAPCDATA(0)=APCP("RUN LOCATION")_"^"_$P(^DIC(4,DUZ(2),0),U)_"^"_$E(APCP("RUN START"),1,7)_"^"_APCP("RUN BEGIN")_"^"_APCP("RUN END")_"^^"_APCP("COUNT")_"^^" ;IHS/CMI/LAB - commented out
S X="AD0"_"^"_$P(^AUTTSITE(1,1),U,3)_"^"_$P(^DIC(4,DUZ(2),0),U)_"^"_$$DATE($E(APCP("RUN START"),1,7))_"^"_$$DATE(APCP("RUN BEGIN"))_"^"_$$DATE(APCP("RUN END"))
S X=X_"^"_$S(APCPO("RUN")="REDO":"R",APCPO("RUN")="DATE":"R",1:"")_"^"_APCP("COUNT")_"^"_APCP("VISITS STAT")_"^"
S Y=$G(APCP("ERROR COUNT"))+$G(APCP("DEMO PAT"))+$G(APCP("DEL NEVER SENT"))+$G(APCP("IN NO PP"))
S X=X_Y_"^"_$G(APCP("ERROR COUNT"))_"^"_$G(APCP("DEMO PAT"))_"^"_$G(APCP("FILENAME"))
S ^BAPCDATA(0)=X
S DA=APCP("RUN LOG"),DIE="^APCPLOG(",DR=".04////"_APCP("RUN STOP")_";.05////"_APCP("ERROR COUNT")_";.06////"_APCP("COUNT")_";.08///"_APCPCNTR D ^DIE I $D(Y) S APCP("QFLG")=26 Q
S DA=APCP("RUN LOG"),DIE="^APCPLOG(",DR=".11////"_APCP("INPT")_";.14////"_APCP("CHA")_";.13////"_APCP("APC")_";.17////"_APCP("STAT")_";.18////"_$G(APCP("VISITS STAT"))_";.15///P" D ^DIE I $D(Y) S APCP("QFLG")=26 Q
K DR,DIE,DA,DIV,DIU
S DA=APCP("RUN LOG"),DIE="^APCPLOG(",DR=".19////"_$G(APCP("DEMO PAT"))_";.21////"_$G(APCP("EVENTS"))_";.22////"_$G(APCP("DELETED"))_";.23////"_$G(APCP("IN NO PP"))_";.28////"_$G(APCP("MFI")) D ^DIE I $D(Y) S APCP("QFLG")=26 Q
S DA=APCP("RUN LOG"),DIE="^APCPLOG(",DR=".24///"_APCP("FILENAME")_";.25///"_$S(APCPO("RUN")="REDO":1,APCPO("RUN")="DATE":1,1:"")_";.26///"_APCP("DEL NEVER SENT") D ^DIE I $D(Y) S APCP("QFLG")=26 Q
;
Q
;
DATE(D) ;EP ;IHS/CMI/LAB - new date format - format date in YYYYMMDD format
I $G(D)="" Q ""
Q $E(D,1,3)+1700_$E(D,4,7)
;
APCPLOG ; IHS/TUCSON/LAB - OHPRD-TUCSON/LAB UPDATE PCC DATA TRANS LOG FILE AUGUST 14, 1992 ; [ 03/03/03 9:42 AM ]
+1 ;;2.0;IHS PCC DATA EXTRACTION SYSTEM;**1,3,6**;APR 03, 1998
+2 ;IHS/CMI/LAB - date format changed in 0 node per ray willie
LOG ; UPDATE LOG
+1 IF '$DATA(ZTQUEUED)
WRITE !!,APCP("COUNT")," transactions were generated."
+2 IF '$DATA(ZTQUEUED)
WRITE !,"Updating log entry."
+3 DO NOW^%DTC
SET APCP("RUN STOP")=%
+4 ;S ^BAPCDATA(0)=APCP("RUN LOCATION")_"^"_$P(^DIC(4,DUZ(2),0),U)_"^"_$E(APCP("RUN START"),1,7)_"^"_APCP("RUN BEGIN")_"^"_APCP("RUN END")_"^^"_APCP("COUNT")_"^^" ;IHS/CMI/LAB - commented out
+5 SET X="AD0"_"^"_$PIECE(^AUTTSITE(1,1),U,3)_"^"_$PIECE(^DIC(4,DUZ(2),0),U)_"^"_$$DATE($EXTRACT(APCP("RUN START"),1,7))_"^"_$$DATE(APCP("RUN BEGIN"))_"^"_$$DATE(APCP("RUN END"))
+6 SET X=X_"^"_$SELECT(APCPO("RUN")="REDO":"R",APCPO("RUN")="DATE":"R",1:"")_"^"_APCP("COUNT")_"^"_APCP("VISITS STAT")_"^"
+7 SET Y=$GET(APCP("ERROR COUNT"))+$GET(APCP("DEMO PAT"))+$GET(APCP("DEL NEVER SENT"))+$GET(APCP("IN NO PP"))
+8 SET X=X_Y_"^"_$GET(APCP("ERROR COUNT"))_"^"_$GET(APCP("DEMO PAT"))_"^"_$GET(APCP("FILENAME"))
+9 SET ^BAPCDATA(0)=X
+10 SET DA=APCP("RUN LOG")
SET DIE="^APCPLOG("
SET DR=".04////"_APCP("RUN STOP")_";.05////"_APCP("ERROR COUNT")_";.06////"_APCP("COUNT")_";.08///"_APCPCNTR
DO ^DIE
IF $DATA(Y)
SET APCP("QFLG")=26
QUIT
+11 SET DA=APCP("RUN LOG")
SET DIE="^APCPLOG("
SET DR=".11////"_APCP("INPT")_";.14////"_APCP("CHA")_";.13////"_APCP("APC")_";.17////"_APCP("STAT")_";.18////"_$GET(APCP("VISITS STAT"))_";.15///P"
DO ^DIE
IF $DATA(Y)
SET APCP("QFLG")=26
QUIT
+12 KILL DR,DIE,DA,DIV,DIU
+13 SET DA=APCP("RUN LOG")
SET DIE="^APCPLOG("
SET DR=".19////"_$GET(APCP("DEMO PAT"))_";.21////"_$GET(APCP("EVENTS"))_";.22////"_$GET(APCP("DELETED"))_";.23////"_$GET(APCP("IN NO PP"))_";.28////"_$GET(APCP("MFI"))
DO ^DIE
IF $DATA(Y)
SET APCP("QFLG")=26
QUIT
+14 SET DA=APCP("RUN LOG")
SET DIE="^APCPLOG("
SET DR=".24///"_APCP("FILENAME")_";.25///"_$SELECT(APCPO("RUN")="REDO":1,APCPO("RUN")="DATE":1,1:"")_";.26///"_APCP("DEL NEVER SENT")
DO ^DIE
IF $DATA(Y)
SET APCP("QFLG")=26
QUIT
+15 ;
+16 QUIT
+17 ;
DATE(D) ;EP ;IHS/CMI/LAB - new date format - format date in YYYYMMDD format
+1 IF $GET(D)=""
QUIT ""
+2 QUIT $EXTRACT(D,1,3)+1700_$EXTRACT(D,4,7)
+3 ;