BCHEXLOG ; IHS/CMI/LAB - UPDATE LOG ;
;;2.0;IHS RPMS CHR SYSTEM;;OCT 23, 2012;Build 27
;IHS/CMI/LAB - new 0 node format for Y2K
;IHS/CMI/LAB - patch 10 new record format
;
;
;
;
LOG ; UPDATE LOG
W:'$D(ZTQUEUED) !!,BCH("COUNT")," transactions were generated." ;TUCSON/LAB added '$D(ZTQUEUED) patch 3
W:'$D(ZTQUEUED) !,"Updating log entry."
D NOW^%DTC S BCH("RUN STOP")=%
S ^BCHRDATA(0)=BCH("RUN LOCATION")_"^"_$P(^DIC(4,DUZ(2),0),U)_"^"_$$DATE^BCHEXD21($E(BCH("RUN START"),1,7))_"^"_$$DATE^BCHEXD21(BCH("RUN BEGIN"))_"^"_$$DATE^BCHEXD21(BCH("RUN END"))_"^"_BCH("COUNT")_"^2.0"
;S $P(^BCHRDATA(1),U,2)=BCH("RUN LOCATION")_" "_$$LZERO^BCHEXD2(BCH("BATCH"),5)_" "_$$LZERO^BCHEXD2(BCH("COUNT"),5)_"B "_$P(BCH("RUN START"),".")_" "_$$RBLK^BCHEXD2($P(^DIC(4,DUZ(2),0),U),30)_" " ;IHS/CMI/LAB
;SET BATCH NUMBER INTO SITE FILE FOR NEXT RUN
S DA=DUZ(2),DIE="^BCHSITE(",DR=".11///"_BCH("BATCH") D ^DIE K DIE,DR,DA I $D(Y) S BCH("QFLG")=26 Q
S DA=BCH("RUN LOG"),DIE="^BCHXLOG(",DR=".04////"_BCH("RUN STOP")_";.05////"_BCH("ERROR COUNT")_";.06////"_BCH("COUNT")_";.08///"_BCH("VISIT COUNT") D CALLDIE^BCHUTIL
I $D(Y) S BCH("QFLG")=26 Q
S DA=BCH("RUN LOG"),DIE="^BCHXLOG(",DR=".11////"_BCH("U")_";.13////"_BCH("D")_";.15///P;.17///"_BCH("BATCH") D CALLDIE^BCHUTIL
I $D(Y) S BCH("QFLG")=26 Q
K DR,DIE,DA,DIV,DIU
;
Q
;
DATE(D) ;EP convert date
I $G(D)="" Q ""
Q (1700+$E(D,1,3))_$E(D,4,7)
;
BCHEXLOG ; IHS/CMI/LAB - UPDATE LOG ;
+1 ;;2.0;IHS RPMS CHR SYSTEM;;OCT 23, 2012;Build 27
+2 ;IHS/CMI/LAB - new 0 node format for Y2K
+3 ;IHS/CMI/LAB - patch 10 new record format
+4 ;
+5 ;
+6 ;
+7 ;
LOG ; UPDATE LOG
+1 ;TUCSON/LAB added '$D(ZTQUEUED) patch 3
IF '$DATA(ZTQUEUED)
WRITE !!,BCH("COUNT")," transactions were generated."
+2 IF '$DATA(ZTQUEUED)
WRITE !,"Updating log entry."
+3 DO NOW^%DTC
SET BCH("RUN STOP")=%
+4 SET ^BCHRDATA(0)=BCH("RUN LOCATION")_"^"_$PIECE(^DIC(4,DUZ(2),0),U)_"^"_$$DATE^BCHEXD21($EXTRACT(BCH("RUN START"),1,7))_"^"_$$DATE^BCHEXD21(BCH("RUN BEGIN"))_"^"_$$DATE^BCHEXD21(BCH("RUN END"))_"^"_BCH("COUNT")_"^2.0"
+5 ;S $P(^BCHRDATA(1),U,2)=BCH("RUN LOCATION")_" "_$$LZERO^BCHEXD2(BCH("BATCH"),5)_" "_$$LZERO^BCHEXD2(BCH("COUNT"),5)_"B "_$P(BCH("RUN START"),".")_" "_$$RBLK^BCHEXD2($P(^DIC(4,DUZ(2),0),U),30)_" " ;IHS/CMI/LAB
+6 ;SET BATCH NUMBER INTO SITE FILE FOR NEXT RUN
+7 SET DA=DUZ(2)
SET DIE="^BCHSITE("
SET DR=".11///"_BCH("BATCH")
DO ^DIE
KILL DIE,DR,DA
IF $DATA(Y)
SET BCH("QFLG")=26
QUIT
+8 SET DA=BCH("RUN LOG")
SET DIE="^BCHXLOG("
SET DR=".04////"_BCH("RUN STOP")_";.05////"_BCH("ERROR COUNT")_";.06////"_BCH("COUNT")_";.08///"_BCH("VISIT COUNT")
DO CALLDIE^BCHUTIL
+9 IF $DATA(Y)
SET BCH("QFLG")=26
QUIT
+10 SET DA=BCH("RUN LOG")
SET DIE="^BCHXLOG("
SET DR=".11////"_BCH("U")_";.13////"_BCH("D")_";.15///P;.17///"_BCH("BATCH")
DO CALLDIE^BCHUTIL
+11 IF $DATA(Y)
SET BCH("QFLG")=26
QUIT
+12 KILL DR,DIE,DA,DIV,DIU
+13 ;
+14 QUIT
+15 ;
DATE(D) ;EP convert date
+1 IF $GET(D)=""
QUIT ""
+2 QUIT (1700+$EXTRACT(D,1,3))_$EXTRACT(D,4,7)
+3 ;