source: FOIAVistA/trunk/r/IFCAP-PRC-PRX--PRCA--PRCN/PRCHRCV.m@ 1582

Last change on this file since 1582 was 628, checked in by George Lilly, 15 years ago

initial load of FOIAVistA 6/30/08 version

File size: 2.6 KB
Line 
1PRCHRCV ;DJM/WISC-IFCAP BAR DISPLAY ROUTINE ;7/25/94 3:33 PM
2V ;;5.1;IFCAP;;Oct 20, 2000
3 ;Per VHA Directive 10-93-142, this routine should not be modified.
4SETUP(COUNT) ;ENTER HERE TO SET UP THE BAR GRAPH DISPLAY.
5 ;YOUR ROUTINE USING THIS BAR GRAPH MUST NOT WRITE ANYTHING TO THE SCREEN.
6 ;
7 ; 'COUNT' IS THE NUMBER OF ENTRIES BEING PROCESSED.
8 ; THIS NUMBER WILL BECOME 100% ON THE BAR GRAPH.
9 ;
10 I $Y>2 W @IOF
11 I COUNT="" W !!,"THERE IS NO 'COUNT' TO WORK WITH. I QUIT." Q
12 S TREC=COUNT
13 I $E(IOST)="C",'$D(ZTQUEUED) S X="IORVON;IORVOFF" D ENDR^%ZISS
14 I $D(IORVON),$D(IORVOFF) S CURSOR=IORVON_" "_IORVOFF
15 D WAIT^PRCFYN
16 S CREC=$S($E(IOST)="C":1.24,1:4.99)
17 S X="There are "_TREC_" records to process." D MSG^PRCFQ
18 S LINE="---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+"
19 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,!
20 S (MX,NX)=0,(XPOS,XCOUNT)=0
21 S:$Y>22 Y=22 S A=$Y,N=0,M=0,BTIME=$P($H,",",2)
22 Q
23 ;
24UPDATE(INIT) ;ENTER HERE AFTER EACH RECORD IS PROCESSED.
25 ; INIT=CURRENT NUMBER OF RECORDS PROCESSED.
26 ; INIT DOES NOT NEED TO BE ENTERED.
27 ; ENTERING INIT WILL PRESET THE BAR GRAPH TO WHATEVER PERCENT
28 ; XCOUNT IS OF COUNT.
29 ;
30 ;IF ENOUGH RECORDS HAVE BEEN COMPLETED THE BAR GRAPH WILL BE UPDATED.
31 S TEST=INIT
32 S XCOUNT=$S(INIT>0:INIT,1:XCOUNT)
33 S XCOUNT=XCOUNT+1 D:'$D(ZTQUEUED) PERCENT
34 I PERCENT=100 S DX=0,DY=A+4 I $E(IOST)="C" X IOXY
35 QUIT
36END 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
37 QUIT
38 ;
39PERCENT ;
40 S PERCENT=XCOUNT/TREC*100\1
41 F Q:PERCENT'>CREC I PERCENT>CREC D
42 . W:$E(IOST)="C" CURSOR S XPOS=XPOS+1
43 . DO
44 . . W !,XCOUNT," of ",TREC," processed. ",$J((PERCENT/1),0,0),"% complete "
45 . . S TIME=$P($H,",",2)
46 . . S:BTIME>TIME TIME=TIME+86400
47 . . S TIME=TIME-BTIME D TIME(TIME)
48 . . W:$E(IOST)="C" !
49 . . W:HOURS HOURS," Hours, "
50 . . W MIN," Minutes, ",SEC," Seconds elapsed. "
51 . . I PERCENT<50 D QUIT
52 . . . S DX=XPOS,DY=A
53 . . . I $E(IOST)="C" X IOXY
54 . . . QUIT
55 . . S TTIME=TIME/(PERCENT*.01),RTIME=TTIME-TIME
56 . . S RTIME=$P(RTIME,".")
57 . . S HOURS=0,MIN=0
58 . . I RTIME>3600 S HOURS=RTIME\3600,RTIME=RTIME#3600
59 . . S MIN=RTIME\60,SEC=RTIME#60
60 . . W:$E(IOST)="C" ! W:HOURS HOURS," Hours, "
61 . . W MIN," Minutes, ",SEC," Seconds, remaining. "
62 . . S DX=XPOS,DY=A
63 . . I $E(IOST)="C" X IOXY
64 . . QUIT
65 . S CREC=CREC+$S($E(IOST)="C":1.25,1:5)
66 . QUIT
67 QUIT
68TIME(X) ;
69 S HOURS=0,MIN=0,SEC=0
70 I X>3600 S HOURS=X\3600,X=X#3600
71 S MIN=X\60,SEC=X#60
72 Q
Note: See TracBrowser for help on using the repository browser.