AMHEYLOG ; IHS/CMI/LAB - UPDATE LOG ;
;;4.0;IHS BEHAVIORAL HEALTH;;MAY 14, 2010
;
;
;
;
LOG ; UPDATE LOG
W:'$D(ZTQUEUED) !!,AMH("COUNT")," transactions were generated."
W:'$D(ZTQUEUED) !,"Updating log entry."
D NOW^%DTC S AMH("RUN STOP")=%
S DA=AMH("RUN LOG"),DIE="^AMHXLOG(",DR=".04////"_AMH("RUN STOP")_";.05////"_AMH("ERROR COUNT")_";.06////"_AMH("COUNT")_";.08///"_AMHTOTV_";.17////"_AMH("ENC")_";.18////"_AMHSFC D CALLDIE^AMHLEIN
I $D(Y) S AMH("QFLG")=26 Q
S DA=AMH("RUN LOG"),DIE="^AMHXLOG(",DR=".15///P" D CALLDIE^AMHLEIN
I $D(Y) S AMH("QFLG")=26 Q
K DR,DIE,DA,DIV,DIU
S AMHRIEN=$O(^AMHRECD("B","BH0",0))
I 'AMHRIEN Q ""
S AMHLOG=AMH("RUN LOG")
S AMHY=0,AMHT="" F S AMHY=$O(^AMHRECD(AMHRIEN,11,"B",AMHY)) Q:AMHY'=+AMHY D
.S X=""
.S AMHZ=$O(^AMHRECD(AMHRIEN,11,"B",AMHY,0))
.Q:'$D(^AMHRECD(AMHRIEN,11,AMHZ,1))
.X ^AMHRECD(AMHRIEN,11,AMHZ,1)
.S $P(AMHT,U,AMHY)=X
S ^BHSXDATA(0)=AMHT
;
Q
AMHEYLOG ; IHS/CMI/LAB - UPDATE LOG ;
+1 ;;4.0;IHS BEHAVIORAL HEALTH;;MAY 14, 2010
+2 ;
+3 ;
+4 ;
+5 ;
LOG ; UPDATE LOG
+1 IF '$DATA(ZTQUEUED)
WRITE !!,AMH("COUNT")," transactions were generated."
+2 IF '$DATA(ZTQUEUED)
WRITE !,"Updating log entry."
+3 DO NOW^%DTC
SET AMH("RUN STOP")=%
+4 SET DA=AMH("RUN LOG")
SET DIE="^AMHXLOG("
SET DR=".04////"_AMH("RUN STOP")_";.05////"_AMH("ERROR COUNT")_";.06////"_AMH("COUNT")_";.08///"_AMHTOTV_";.17////"_AMH("ENC")_";.18////"_AMHSFC
DO CALLDIE^AMHLEIN
+5 IF $DATA(Y)
SET AMH("QFLG")=26
QUIT
+6 SET DA=AMH("RUN LOG")
SET DIE="^AMHXLOG("
SET DR=".15///P"
DO CALLDIE^AMHLEIN
+7 IF $DATA(Y)
SET AMH("QFLG")=26
QUIT
+8 KILL DR,DIE,DA,DIV,DIU
+9 SET AMHRIEN=$ORDER(^AMHRECD("B","BH0",0))
+10 IF 'AMHRIEN
QUIT ""
+11 SET AMHLOG=AMH("RUN LOG")
+12 SET AMHY=0
SET AMHT=""
FOR
SET AMHY=$ORDER(^AMHRECD(AMHRIEN,11,"B",AMHY))
IF AMHY'=+AMHY
QUIT
Begin DoDot:1
+13 SET X=""
+14 SET AMHZ=$ORDER(^AMHRECD(AMHRIEN,11,"B",AMHY,0))
+15 IF '$DATA(^AMHRECD(AMHRIEN,11,AMHZ,1))
QUIT
+16 XECUTE ^AMHRECD(AMHRIEN,11,AMHZ,1)
+17 SET $PIECE(AMHT,U,AMHY)=X
End DoDot:1
+18 SET ^BHSXDATA(0)=AMHT
+19 ;
+20 QUIT