LRCAPW ;SLC/DCM- CAP WORKLOAD SUMMARY ; 1/31/89 10:35 ;
;;V~5.0~;LAB;;02/27/90 17:09
S LREND=0 D MAJOR^LRCAPS I 'LREND D DATE^LRCAPS I 'LREND D TIME I 'LREND D ZIS I 'LREND U IO D ^LRCAPW1,^LRCAPW2
END X ^%ZIS("C") K ^UTILITY($J),LRS,LRM,LRA,LRALL,LREND,LRMAJ,LRSEC,LRFDT,LRLDT,LRH1,LRH2,LRSHIFT,LREND,LRSTOP,ZTSAVE,ZTRTN,ZTIO,ZTDESC,ZTSK
Q
ZIS S %ZIS="QM" D ^%ZIS I POP S LREND=1 Q
I $D(IO("Q")) K IO("Q") S ZTRTN="DQ^LRCAPW",ZTDESC="CAP WORKLOAD SUMMARY",ZTSAVE("LR*")="" D ^%ZTLOAD S LREND=1 Q
Q
DQ U IO K:$D(ZTSK) ^%ZTSK(ZTSK),ZTSK D ^LRCAPW1,^LRCAPW2
G END
TIME S LREND=0,C1=1,DEF(1)="0000-0759",DEF(2)="0800-1559",DEF(3)="1600-2359"
F I=0:0 S LRSTOP=0 W !!,"Select starting and ending times for shift #"_C1_": " W:C1<4 DEF(C1)_" // " R X:DTIME D TIME1 Q:LREND Q:X=""
S:'$D(LRSHIFT) LREND=1 Q
TIME1 S:X="^"!('$T) LREND=1 S:X=""&(C1<4) X=DEF(C1) Q:X=""!(X="^") D:X'?4N1P4N HELP I X?4N1P4N D CHECK I 'LRSTOP S LRSHIFT(C1)=X_.9999,C1=C1+1
Q
HELP W !!,"Enter times in military format separated by a '-' to define"
W !,"the work shifts that are to be totaled and reported."
W !,"EXAMPLE: 0800-1630"
Q
CHECK I +$E(X,1,2)>23!(+$E(X,6,7)>23) W *7," INVALID TIME!" D HELP S LRSTOP=1 Q
I +$E(X,3,4)>59!(+$E(X,8,9)>59) W *7," INVALID TIME!" D HELP S LRSTOP=1 Q
I +$E(X,1,4)>+$E(X,6,9) W *7," INVALID TIME RANGE!" D HELP S LRSTOP=1 Q
Q
LRCAPW ;SLC/DCM- CAP WORKLOAD SUMMARY ; 1/31/89 10:35 ;
+1 ;;V~5.0~;LAB;;02/27/90 17:09
+2 SET LREND=0
DO MAJOR^LRCAPS
IF 'LREND
DO DATE^LRCAPS
IF 'LREND
DO TIME
IF 'LREND
DO ZIS
IF 'LREND
USE IO
DO ^LRCAPW1
DO ^LRCAPW2
END XECUTE ^%ZIS("C")
KILL ^UTILITY($JOB),LRS,LRM,LRA,LRALL,LREND,LRMAJ,LRSEC,LRFDT,LRLDT,LRH1,LRH2,LRSHIFT,LREND,LRSTOP,ZTSAVE,ZTRTN,ZTIO,ZTDESC,ZTSK
+1 QUIT
ZIS SET %ZIS="QM"
DO ^%ZIS
IF POP
SET LREND=1
QUIT
+1 IF $DATA(IO("Q"))
KILL IO("Q")
SET ZTRTN="DQ^LRCAPW"
SET ZTDESC="CAP WORKLOAD SUMMARY"
SET ZTSAVE("LR*")=""
DO ^%ZTLOAD
SET LREND=1
QUIT
+2 QUIT
DQ USE IO
IF $DATA(ZTSK)
KILL ^%ZTSK(ZTSK),ZTSK
DO ^LRCAPW1
DO ^LRCAPW2
+1 GOTO END
TIME SET LREND=0
SET C1=1
SET DEF(1)="0000-0759"
SET DEF(2)="0800-1559"
SET DEF(3)="1600-2359"
+1 FOR I=0:0
SET LRSTOP=0
WRITE !!,"Select starting and ending times for shift #"_C1_": "
IF C1<4
WRITE DEF(C1)_" // "
READ X:DTIME
DO TIME1
IF LREND
QUIT
IF X=""
QUIT
+2 IF '$DATA(LRSHIFT)
SET LREND=1
QUIT
TIME1 IF X="^"!('$TEST)
SET LREND=1
IF X=""&(C1<4)
SET X=DEF(C1)
IF X=""!(X="^")
QUIT
IF X'?4N1P4N
DO HELP
IF X?4N1P4N
DO CHECK
IF 'LRSTOP
SET LRSHIFT(C1)=X_.9999
SET C1=C1+1
+1 QUIT
HELP WRITE !!,"Enter times in military format separated by a '-' to define"
+1 WRITE !,"the work shifts that are to be totaled and reported."
+2 WRITE !,"EXAMPLE: 0800-1630"
+3 QUIT
CHECK IF +$EXTRACT(X,1,2)>23!(+$EXTRACT(X,6,7)>23)
WRITE *7," INVALID TIME!"
DO HELP
SET LRSTOP=1
QUIT
+1 IF +$EXTRACT(X,3,4)>59!(+$EXTRACT(X,8,9)>59)
WRITE *7," INVALID TIME!"
DO HELP
SET LRSTOP=1
QUIT
+2 IF +$EXTRACT(X,1,4)>+$EXTRACT(X,6,9)
WRITE *7," INVALID TIME RANGE!"
DO HELP
SET LRSTOP=1
QUIT
+3 QUIT