PRCHRCV ;DJM/WISC-IFCAP BAR DISPLAY ROUTINE ;7/25/94 3:33 PM
V ;;5.1;IFCAP;;Oct 20, 2000
;Per VHA Directive 10-93-142, this routine should not be modified.
SETUP(COUNT) ;ENTER HERE TO SET UP THE BAR GRAPH DISPLAY.
;YOUR ROUTINE USING THIS BAR GRAPH MUST NOT WRITE ANYTHING TO THE SCREEN.
;
; 'COUNT' IS THE NUMBER OF ENTRIES BEING PROCESSED.
; THIS NUMBER WILL BECOME 100% ON THE BAR GRAPH.
;
I $Y>2 W @IOF
I COUNT="" W !!,"THERE IS NO 'COUNT' TO WORK WITH. I QUIT." Q
S TREC=COUNT
I $E(IOST)="C",'$D(ZTQUEUED) S X="IORVON;IORVOFF" D ENDR^%ZISS
I $D(IORVON),$D(IORVOFF) S CURSOR=IORVON_" "_IORVOFF
D WAIT^PRCFYN
S CREC=$S($E(IOST)="C":1.24,1:4.99)
S X="There are "_TREC_" records to process." D MSG^PRCFQ
S LINE="---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+"
I TREC>80,$E(IOST)="C" W !!,?25,"P E R C E N T C O M P L E T E",!!," 10 20 30 40 50 60 70 80 90 100",!,LINE,!
S (MX,NX)=0,(XPOS,XCOUNT)=0
S:$Y>22 Y=22 S A=$Y,N=0,M=0,BTIME=$P($H,",",2)
Q
;
UPDATE(INIT) ;ENTER HERE AFTER EACH RECORD IS PROCESSED.
; INIT=CURRENT NUMBER OF RECORDS PROCESSED.
; INIT DOES NOT NEED TO BE ENTERED.
; ENTERING INIT WILL PRESET THE BAR GRAPH TO WHATEVER PERCENT
; XCOUNT IS OF COUNT.
;
;IF ENOUGH RECORDS HAVE BEEN COMPLETED THE BAR GRAPH WILL BE UPDATED.
S TEST=INIT
S XCOUNT=$S(INIT>0:INIT,1:XCOUNT)
S XCOUNT=XCOUNT+1 D:'$D(ZTQUEUED) PERCENT
I PERCENT=100 S DX=0,DY=A+4 I $E(IOST)="C" X IOXY
QUIT
END K FY,BFY,EFY,CFY,AFY,NX,MX,ZERONODE,FLAG,X,Y,TREC,CREC,LREC,XPOS,DX,CY,MOP,ARCBIT,DIC,DLAYGO,A,N,M,PERCENT
QUIT
;
PERCENT ;
S PERCENT=XCOUNT/TREC*100\1
F Q:PERCENT'>CREC I PERCENT>CREC D
. W:$E(IOST)="C" CURSOR S XPOS=XPOS+1
. DO
. . W !,XCOUNT," of ",TREC," processed. ",$J((PERCENT/1),0,0),"% complete "
. . S TIME=$P($H,",",2)
. . S:BTIME>TIME TIME=TIME+86400
. . S TIME=TIME-BTIME D TIME(TIME)
. . W:$E(IOST)="C" !
. . W:HOURS HOURS," Hours, "
. . W MIN," Minutes, ",SEC," Seconds elapsed. "
. . I PERCENT<50 D QUIT
. . . S DX=XPOS,DY=A
. . . I $E(IOST)="C" X IOXY
. . . QUIT
. . S TTIME=TIME/(PERCENT*.01),RTIME=TTIME-TIME
. . S RTIME=$P(RTIME,".")
. . S HOURS=0,MIN=0
. . I RTIME>3600 S HOURS=RTIME\3600,RTIME=RTIME#3600
. . S MIN=RTIME\60,SEC=RTIME#60
. . W:$E(IOST)="C" ! W:HOURS HOURS," Hours, "
. . W MIN," Minutes, ",SEC," Seconds, remaining. "
. . S DX=XPOS,DY=A
. . I $E(IOST)="C" X IOXY
. . QUIT
. S CREC=CREC+$S($E(IOST)="C":1.25,1:5)
. QUIT
QUIT
TIME(X) ;
S HOURS=0,MIN=0,SEC=0
I X>3600 S HOURS=X\3600,X=X#3600
S MIN=X\60,SEC=X#60
Q
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HPRCHRCV 2685 printed Oct 16, 2024@18:10:54 Page 2
PRCHRCV ;DJM/WISC-IFCAP BAR DISPLAY ROUTINE ;7/25/94 3:33 PM
V ;;5.1;IFCAP;;Oct 20, 2000
+1 ;Per VHA Directive 10-93-142, this routine should not be modified.
SETUP(COUNT) ;ENTER HERE TO SET UP THE BAR GRAPH DISPLAY.
+1 ;YOUR ROUTINE USING THIS BAR GRAPH MUST NOT WRITE ANYTHING TO THE SCREEN.
+2 ;
+3 ; 'COUNT' IS THE NUMBER OF ENTRIES BEING PROCESSED.
+4 ; THIS NUMBER WILL BECOME 100% ON THE BAR GRAPH.
+5 ;
+6 IF $Y>2
WRITE @IOF
+7 IF COUNT=""
WRITE !!,"THERE IS NO 'COUNT' TO WORK WITH. I QUIT."
QUIT
+8 SET TREC=COUNT
+9 IF $EXTRACT(IOST)="C"
IF '$DATA(ZTQUEUED)
SET X="IORVON;IORVOFF"
DO ENDR^%ZISS
+10 IF $DATA(IORVON)
IF $DATA(IORVOFF)
SET CURSOR=IORVON_" "_IORVOFF
+11 DO WAIT^PRCFYN
+12 SET CREC=$SELECT($EXTRACT(IOST)="C":1.24,1:4.99)
+13 SET X="There are "_TREC_" records to process."
DO MSG^PRCFQ
+14 SET LINE="---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+"
+15 IF TREC>80
IF $EXTRACT(IOST)="C"
WRITE !!,?25,"P E R C E N T C O M P L E T E",!!," 10 20 30 40 50 60 70 80 90 100",!,LINE,!
+16 SET (MX,NX)=0
SET (XPOS,XCOUNT)=0
+17 if $Y>22
SET Y=22
SET A=$Y
SET N=0
SET M=0
SET BTIME=$PIECE($HOROLOG,",",2)
+18 QUIT
+19 ;
UPDATE(INIT) ;ENTER HERE AFTER EACH RECORD IS PROCESSED.
+1 ; INIT=CURRENT NUMBER OF RECORDS PROCESSED.
+2 ; INIT DOES NOT NEED TO BE ENTERED.
+3 ; ENTERING INIT WILL PRESET THE BAR GRAPH TO WHATEVER PERCENT
+4 ; XCOUNT IS OF COUNT.
+5 ;
+6 ;IF ENOUGH RECORDS HAVE BEEN COMPLETED THE BAR GRAPH WILL BE UPDATED.
+7 SET TEST=INIT
+8 SET XCOUNT=$SELECT(INIT>0:INIT,1:XCOUNT)
+9 SET XCOUNT=XCOUNT+1
if '$DATA(ZTQUEUED)
DO PERCENT
+10 IF PERCENT=100
SET DX=0
SET DY=A+4
IF $EXTRACT(IOST)="C"
XECUTE IOXY
+11 QUIT
END KILL FY,BFY,EFY,CFY,AFY,NX,MX,ZERONODE,FLAG,X,Y,TREC,CREC,LREC,XPOS,DX,CY,MOP,ARCBIT,DIC,DLAYGO,A,N,M,PERCENT
+1 QUIT
+2 ;
PERCENT ;
+1 SET PERCENT=XCOUNT/TREC*100\1
+2 FOR
if PERCENT'>CREC
QUIT
IF PERCENT>CREC
Begin DoDot:1
+3 if $EXTRACT(IOST)="C"
WRITE CURSOR
SET XPOS=XPOS+1
+4 Begin DoDot:2
+5 WRITE !,XCOUNT," of ",TREC," processed. ",$JUSTIFY((PERCENT/1),0,0),"% complete "
+6 SET TIME=$PIECE($HOROLOG,",",2)
+7 if BTIME>TIME
SET TIME=TIME+86400
+8 SET TIME=TIME-BTIME
DO TIME(TIME)
+9 if $EXTRACT(IOST)="C"
WRITE !
+10 if HOURS
WRITE HOURS," Hours, "
+11 WRITE MIN," Minutes, ",SEC," Seconds elapsed. "
+12 IF PERCENT<50
Begin DoDot:3
+13 SET DX=XPOS
SET DY=A
+14 IF $EXTRACT(IOST)="C"
XECUTE IOXY
+15 QUIT
End DoDot:3
QUIT
+16 SET TTIME=TIME/(PERCENT*.01)
SET RTIME=TTIME-TIME
+17 SET RTIME=$PIECE(RTIME,".")
+18 SET HOURS=0
SET MIN=0
+19 IF RTIME>3600
SET HOURS=RTIME\3600
SET RTIME=RTIME#3600
+20 SET MIN=RTIME\60
SET SEC=RTIME#60
+21 if $EXTRACT(IOST)="C"
WRITE !
if HOURS
WRITE HOURS," Hours, "
+22 WRITE MIN," Minutes, ",SEC," Seconds, remaining. "
+23 SET DX=XPOS
SET DY=A
+24 IF $EXTRACT(IOST)="C"
XECUTE IOXY
+25 QUIT
End DoDot:2
+26 SET CREC=CREC+$SELECT($EXTRACT(IOST)="C":1.25,1:5)
+27 QUIT
End DoDot:1
+28 QUIT
TIME(X) ;
+1 SET HOURS=0
SET MIN=0
SET SEC=0
+2 IF X>3600
SET HOURS=X\3600
SET X=X#3600
+3 SET MIN=X\60
SET SEC=X#60
+4 QUIT