ABMDSTAT ; IHS/ASDST/DMJ - Display Processing Status ;
;;2.6;IHS 3P BILLING SYSTEM;;NOV 12, 2009
;
HD ; EP for writing heading
Q:$D(ZTQUEUED)
G ERR1:'$D(ABMXB("TOT-REC"))
S ABMXB="",$P(ABMXB,"-",80)="" W !,ABMXB
W !?5,"Records to Process: ",$FN(ABMXB("TOT-REC"),",",0),?40,"Start Time: "
D NOW^%DTC W $$MDT^ABMDUTL(%)
W !,ABMXB
S ABMXB("STIME")=$P($H,",",2)
W !?55,"Estimated"
W !?11,"Records",?25,"Current",?40,"Percent",?55,"Completion"
W !?10,"Processed",?26,"Time",?40,"Complete",?58,"Time"
W !?7,"============================================================="
W !?17,0
Q
;
WRT ;EP for displaying the processing status
Q:$D(ZTQUEUED)
G ERR1:'$D(ABMXB("TOT-REC")),ERR2:'$D(ABMXB("STIME")),ERR3:'$D(ABMXB("CUR-REC"))
S:'$D(ABMXB("INCR")) ABMXB("INCR")=1
I ABMXB("CUR-REC")#ABMXB("INCR")=0 D
.F ABMXB("J")=1:1:75 W *8
.S ABMXB("RATE")=ABMXB("CUR-REC")/ABMXB("TOT-REC")
.W ?10,$J($FN(ABMXB("CUR-REC"),",",0),7),?25
.D NOW^%DTC W $P($$MDT^ABMDUTL(%)," ",2,3),?40,$J(100*ABMXB("RATE"),5,1)," %"
.Q:ABMXB("RATE")*100<.1
.S ABMXB("ETIME")=($P($H,",",2)-ABMXB("STIME"))\ABMXB("RATE")
.S %H=$P($H,",")_","_(ABMXB("ETIME")+ABMXB("STIME")) D YX^%DTC
.S Y=$P($P(Y,"@",2),":",1,2)
.W ?56 W $J($S(Y>12:Y-12,1:+Y),2),":",$P(Y,":",2)," ",$S(Y>12:"PM",1:"AM")
Q
;
END ;EP for displaying Ending Time and Cleaning Variables
S ABMXB="",$P(ABMXB,"-",80)="" W !,ABMXB
K ABMXB
D NOW^%DTC
W !!?10,"Ending Time: ",$$MDT^ABMDUTL(%)
Q
;
ERR1 W !!,*7,"ERROR: The variable ABMXB(""TOT-REC"") is UNDEFINED!" Q
ERR2 W !!,*7,"ERROR: The variable ABMXB(""STIME"") is UNDEFINED!" Q
ERR3 W !!,*7,"ERROR: The variable ABMXB(""CUR-REC"") is UNDEFINED!" Q
;
TEST S ABMXB("TOT-REC")=199 D HD
F ABMXB("CUR-REC")=0:1:ABMXB("TOT-REC") H 1 D WRT
D END
ABMDSTAT ; IHS/ASDST/DMJ - Display Processing Status ;
+1 ;;2.6;IHS 3P BILLING SYSTEM;;NOV 12, 2009
+2 ;
HD ; EP for writing heading
+1 IF $DATA(ZTQUEUED)
QUIT
+2 IF '$DATA(ABMXB("TOT-REC"))
GOTO ERR1
+3 SET ABMXB=""
SET $PIECE(ABMXB,"-",80)=""
WRITE !,ABMXB
+4 WRITE !?5,"Records to Process: ",$FNUMBER(ABMXB("TOT-REC"),",",0),?40,"Start Time: "
+5 DO NOW^%DTC
WRITE $$MDT^ABMDUTL(%)
+6 WRITE !,ABMXB
+7 SET ABMXB("STIME")=$PIECE($HOROLOG,",",2)
+8 WRITE !?55,"Estimated"
+9 WRITE !?11,"Records",?25,"Current",?40,"Percent",?55,"Completion"
+10 WRITE !?10,"Processed",?26,"Time",?40,"Complete",?58,"Time"
+11 WRITE !?7,"============================================================="
+12 WRITE !?17,0
+13 QUIT
+14 ;
WRT ;EP for displaying the processing status
+1 IF $DATA(ZTQUEUED)
QUIT
+2 IF '$DATA(ABMXB("TOT-REC"))
GOTO ERR1
IF '$DATA(ABMXB("STIME"))
GOTO ERR2
IF '$DATA(ABMXB("CUR-REC"))
GOTO ERR3
+3 IF '$DATA(ABMXB("INCR"))
SET ABMXB("INCR")=1
+4 IF ABMXB("CUR-REC")#ABMXB("INCR")=0
Begin DoDot:1
+5 FOR ABMXB("J")=1:1:75
WRITE *8
+6 SET ABMXB("RATE")=ABMXB("CUR-REC")/ABMXB("TOT-REC")
+7 WRITE ?10,$JUSTIFY($FNUMBER(ABMXB("CUR-REC"),",",0),7),?25
+8 DO NOW^%DTC
WRITE $PIECE($$MDT^ABMDUTL(%)," ",2,3),?40,$JUSTIFY(100*ABMXB("RATE"),5,1)," %"
+9 IF ABMXB("RATE")*100<.1
QUIT
+10 SET ABMXB("ETIME")=($PIECE($HOROLOG,",",2)-ABMXB("STIME"))\ABMXB("RATE")
+11 SET %H=$PIECE($HOROLOG,",")_","_(ABMXB("ETIME")+ABMXB("STIME"))
DO YX^%DTC
+12 SET Y=$PIECE($PIECE(Y,"@",2),":",1,2)
+13 WRITE ?56
WRITE $JUSTIFY($SELECT(Y>12:Y-12,1:+Y),2),":",$PIECE(Y,":",2)," ",$SELECT(Y>12:"PM",1:"AM")
End DoDot:1
+14 QUIT
+15 ;
END ;EP for displaying Ending Time and Cleaning Variables
+1 SET ABMXB=""
SET $PIECE(ABMXB,"-",80)=""
WRITE !,ABMXB
+2 KILL ABMXB
+3 DO NOW^%DTC
+4 WRITE !!?10,"Ending Time: ",$$MDT^ABMDUTL(%)
+5 QUIT
+6 ;
ERR1 WRITE !!,*7,"ERROR: The variable ABMXB(""TOT-REC"") is UNDEFINED!"
QUIT
ERR2 WRITE !!,*7,"ERROR: The variable ABMXB(""STIME"") is UNDEFINED!"
QUIT
ERR3 WRITE !!,*7,"ERROR: The variable ABMXB(""CUR-REC"") is UNDEFINED!"
QUIT
+1 ;
TEST SET ABMXB("TOT-REC")=199
DO HD
+1 FOR ABMXB("CUR-REC")=0:1:ABMXB("TOT-REC")
HANG 1
DO WRT
+2 DO END