ABMDRPER ; IHS/ASDST/DMJ - UTILITY TO DISPLAY % COMPLETE SCALE ;
;;2.6;IHS 3P BILLING SYSTEM;;NOV 12, 2009
;Original;TMD;
;
; This utility generates a scale which is used to inform the user
; of the completion percentage of a job.
;
; Input Variables: ABMR("R") - Number of Records
; ABMR - Current Value
;
; Entry Points: START - Sets variables, prints scale and starting time.
; CURR - Prints present completion percentage.
; END - Prints ending time and kills all variables.
;
START ;EP for entering utility
S ABMR("C%")=.02
W $$EN^ABMVDF("IOF")
F ABMR("%I")=.02:.02:1 S ABMR(ABMR("%I"),"%")=ABMR("R")*ABMR("%I")
U IO(0) S ABMR("%X")="========== PROCESSING ACTIVITY =========="
W !!,?(40-($L(ABMR("%X"))\2)),ABMR("%X")
W !!?3,"Total Records to Process.....: ",ABMR("R")
W !?3,"Currently Processing Record..: 1"
W !!?3,"Starting Time................: " D NOW^%DTC W $$MDT^ABMDUTL(%)
S ABMR("%X")="Job Completion Percentage"
W !!,?(40-($L(ABMR("%X"))\2)),ABMR("%X"),!
W ?13,0 F ABMR("%I")=10:10:100 W ?($X+3) W:ABMR("%I")=10 " " W ABMR("%I")
W !?13,"|" F ABMR("%I")=1:1:10 W "----|"
S ABMR("X%")=13
Q
;
CURR ;EP for writing scale
Q:ABMR("C%")>1
F Q:ABMR(ABMR("C%"),"%")>ABMR D Q:'$D(ABMR(ABMR("C%"),"%"))
.U IO(0)
.S DX=34,DY=6 X IOXY W ABMR
.S DY=12,DX=ABMR("X%")+$S(ABMR("C%")'=.02:1,1:0)
.X IOXY W $$EN^ABMVDF("RVN")
.I ABMR("C%")#.1'=0 W $S(ABMR("C%")'=".02":"=",1:"|=")
.E W "|"
.W $$EN^ABMVDF("RVF")
.S ABMR("C%")=ABMR("C%")+.02,ABMR("X%")=ABMR("X%")+1
Q
END ;EP for cleaning up
U IO(0)
W !!?3,"Ending Time..................: " D NOW^%DTC W $$MDT^ABMDUTL(%),!!
K ABMR
XIT Q
;
CHK1 I $G(ABMR("R"))="" G ERR
Q
CHK2 I $G(ABMR)="" G ERR
Q
;
ERR S ABMR("%XIT")=""
W !!,*7,"NECESSARY VARIABLES NOT DEFINED!"
Q
;
TEST S ABMR("R")=$P(^AUPNVSIT(0),U,4),ABMR("T")=0 D START F ABMR=1:1 S ABMR("T")=$O(^AUPNVSIT(ABMR("T"))) Q:'ABMR("T") D CURR
D END
Q
ABMDRPER ; IHS/ASDST/DMJ - UTILITY TO DISPLAY % COMPLETE SCALE ;
+1 ;;2.6;IHS 3P BILLING SYSTEM;;NOV 12, 2009
+2 ;Original;TMD;
+3 ;
+4 ; This utility generates a scale which is used to inform the user
+5 ; of the completion percentage of a job.
+6 ;
+7 ; Input Variables: ABMR("R") - Number of Records
+8 ; ABMR - Current Value
+9 ;
+10 ; Entry Points: START - Sets variables, prints scale and starting time.
+11 ; CURR - Prints present completion percentage.
+12 ; END - Prints ending time and kills all variables.
+13 ;
START ;EP for entering utility
+1 SET ABMR("C%")=.02
+2 WRITE $$EN^ABMVDF("IOF")
+3 FOR ABMR("%I")=.02:.02:1
SET ABMR(ABMR("%I"),"%")=ABMR("R")*ABMR("%I")
+4 USE IO(0)
SET ABMR("%X")="========== PROCESSING ACTIVITY =========="
+5 WRITE !!,?(40-($LENGTH(ABMR("%X"))\2)),ABMR("%X")
+6 WRITE !!?3,"Total Records to Process.....: ",ABMR("R")
+7 WRITE !?3,"Currently Processing Record..: 1"
+8 WRITE !!?3,"Starting Time................: "
DO NOW^%DTC
WRITE $$MDT^ABMDUTL(%)
+9 SET ABMR("%X")="Job Completion Percentage"
+10 WRITE !!,?(40-($LENGTH(ABMR("%X"))\2)),ABMR("%X"),!
+11 WRITE ?13,0
FOR ABMR("%I")=10:10:100
WRITE ?($X+3)
IF ABMR("%I")=10
WRITE " "
WRITE ABMR("%I")
+12 WRITE !?13,"|"
FOR ABMR("%I")=1:1:10
WRITE "----|"
+13 SET ABMR("X%")=13
+14 QUIT
+15 ;
CURR ;EP for writing scale
+1 IF ABMR("C%")>1
QUIT
+2 FOR
IF ABMR(ABMR("C%"),"%")>ABMR
QUIT
Begin DoDot:1
+3 USE IO(0)
+4 SET DX=34
SET DY=6
XECUTE IOXY
WRITE ABMR
+5 SET DY=12
SET DX=ABMR("X%")+$SELECT(ABMR("C%")'=.02:1,1:0)
+6 XECUTE IOXY
WRITE $$EN^ABMVDF("RVN")
+7 IF ABMR("C%")#.1'=0
WRITE $SELECT(ABMR("C%")'=".02":"=",1:"|=")
+8 IF '$TEST
WRITE "|"
+9 WRITE $$EN^ABMVDF("RVF")
+10 SET ABMR("C%")=ABMR("C%")+.02
SET ABMR("X%")=ABMR("X%")+1
End DoDot:1
IF '$DATA(ABMR(ABMR("C%"),"%"))
QUIT
+11 QUIT
END ;EP for cleaning up
+1 USE IO(0)
+2 WRITE !!?3,"Ending Time..................: "
DO NOW^%DTC
WRITE $$MDT^ABMDUTL(%),!!
+3 KILL ABMR
XIT QUIT
+1 ;
CHK1 IF $GET(ABMR("R"))=""
GOTO ERR
+1 QUIT
CHK2 IF $GET(ABMR)=""
GOTO ERR
+1 QUIT
+2 ;
ERR SET ABMR("%XIT")=""
+1 WRITE !!,*7,"NECESSARY VARIABLES NOT DEFINED!"
+2 QUIT
+3 ;
TEST SET ABMR("R")=$PIECE(^AUPNVSIT(0),U,4)
SET ABMR("T")=0
DO START
FOR ABMR=1:1
SET ABMR("T")=$ORDER(^AUPNVSIT(ABMR("T")))
IF 'ABMR("T")
QUIT
DO CURR
+1 DO END
+2 QUIT