AMHEYRLG ; IHS/CMI/LAB - UPDATE LOG IN REDO AUGUST 14, 1992 ;
;;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."
S AMHLOG=AMH("RUN LOG")
S AMHRIEN=$O(^AMHRECD("B","BH0",0))
I 'AMHRIEN Q ""
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
D NOW^%DTC S AMH("RUN STOP")=%
S X=^AMHXLOG(AMH("RUN LOG"),0),$P(X,U,3)="",$P(X,U,4)="",$P(X,U,5)="",$P(X,U,6)="",$P(X,U,7)="",$P(X,U,11)="",$P(X,U,12)="",$P(X,U,13)="",$P(X,U,15)="",^AMHXLOG(AMH("RUN LOG"),0)=X
S DA=AMH("RUN LOG"),DIE="^AMHXLOG(",DR=".03////"_AMH("RUN START")_";.04////"_AMH("RUN STOP")_";.05////"_AMH("ERROR COUNT")_";.06////"_AMH("COUNT")_";.15///P"
D CALLDIE^AMHLEIN
I $D(Y) S AMH("QFLG")=30 Q
Q
;
;
AMHEYRLG ; IHS/CMI/LAB - UPDATE LOG IN REDO AUGUST 14, 1992 ;
+1 ;;4.0;IHS BEHAVIORAL HEALTH;;MAY 14, 2010
LOG ; UPDATE LOG
+1 IF '$DATA(ZTQUEUED)
WRITE !!,AMH("COUNT")," transactions were generated."
+2 IF '$DATA(ZTQUEUED)
WRITE !,"Updating Log entry."
+3 SET AMHLOG=AMH("RUN LOG")
+4 SET AMHRIEN=$ORDER(^AMHRECD("B","BH0",0))
+5 IF 'AMHRIEN
QUIT ""
+6 SET AMHY=0
SET AMHT=""
FOR
SET AMHY=$ORDER(^AMHRECD(AMHRIEN,11,"B",AMHY))
IF AMHY'=+AMHY
QUIT
Begin DoDot:1
+7 SET X=""
+8 SET AMHZ=$ORDER(^AMHRECD(AMHRIEN,11,"B",AMHY,0))
+9 IF '$DATA(^AMHRECD(AMHRIEN,11,AMHZ,1))
QUIT
+10 XECUTE ^AMHRECD(AMHRIEN,11,AMHZ,1)
+11 SET $PIECE(AMHT,U,AMHY)=X
End DoDot:1
+12 SET ^BHSXDATA(0)=AMHT
+13 DO NOW^%DTC
SET AMH("RUN STOP")=%
+14 SET X=^AMHXLOG(AMH("RUN LOG"),0)
SET $PIECE(X,U,3)=""
SET $PIECE(X,U,4)=""
SET $PIECE(X,U,5)=""
SET $PIECE(X,U,6)=""
SET $PIECE(X,U,7)=""
SET $PIECE(X,U,11)=""
SET $PIECE(X,U,12)=""
SET $PIECE(X,U,13)=""
SET $PIECE(X,U,15)=""
SET ^AMHXLOG(AMH("RUN LOG"),0)=X
+15 SET DA=AMH("RUN LOG")
SET DIE="^AMHXLOG("
SET DR=".03////"_AMH("RUN START")_";.04////"_AMH("RUN STOP")_";.05////"_AMH("ERROR COUNT")_";.06////"_AMH("COUNT")_";.15///P"
+16 DO CALLDIE^AMHLEIN
+17 IF $DATA(Y)
SET AMH("QFLG")=30
QUIT
+18 QUIT
+19 ;
+20 ;