source: WorldVistAEHR/trunk/r/LAB_SERVICE-LR-LS/LRCAPA12.m@ 1270

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

initial load of WorldVistAEHR

File size: 2.3 KB
RevLine 
[613]1LRCAPA12 ;SLC/RJS/FHS - LAB WORKLOAD DIVISION REPORT;8/23/91 1039;
2 ;;5.2;LAB SERVICE;**201**;Sep 27, 1994
3EN ;
4 ;
5 K ^TMP($J),ZTSK
6ASK1 ;
7 S %DT="E" W !!,"Beginning Date: " R X:$S($D(DTIME):DTIME,1:999) E G EXIT
8 G:(X["^") EXIT D ^%DT G:(Y<0) ASK1 S LRDT1=+Y
9ASK2 ;
10 S %DT="E" W !!,"Ending Date: " R X:$S($D(DTIME):DTIME,1:999) E G EXIT
11 G:(X["^") EXIT D ^%DT G:(Y<0) ASK2 S LRDT2=+Y I LRDT1>LRDT2 S Y=LRDT1,LRDT1=LRDT2,LRDT2=Y
12 W !! S %ZIS="NQ" D ^%ZIS G:'$L(IO) EXIT
13 G:IO'=IO(0)!($D(IO("Q"))) QUEUE
14DQ ;
15 I $D(ZTQUEUED) S ZTREQ="@"
16 U IO S LRPG=0 D LOOP W:TOT !!,?35,"Total for the Report: ",$J(TOT,10,2)
17 I '$D(^TMP($J)) W !!?10,"No Data for " S X=LRDT1P D DD W " - " S X=LRDT2P D DD W !!
18 W:IOST["P-" @IOF
19EXIT ;
20 D ^%ZISC
21 K LRPG,TOT,LRDT,LRDT1,LRDT2,LRDV1,LRDV2,LRLN,^TMP($J),LRTXT,ZTSK,%DT,%ZIS,ZTRTN,ZTDESC,ZTIO,ZTSAVE,LRDT1P,LRDT2P,IO("Q")
22 Q
23QUEUE ;
24 S ZTRTN="DQ^LRCAPA12",ZTSAVE("LRDT*")="",ZTDESC="Lab Workload Division Report",ZTIO=ION
25 K ZTDTH,ZTCPU,ZTUCI
26 D ^%ZTLOAD
27 G EXIT
28 Q
29LOOP ;
30 S (LRLN,LRDV1,LRDV2,TOT)=0,LRDT1P=LRDT1,LRDT2P=LRDT2,LRDT1=LRDT1-.0001,LRDT2=LRDT2+.00001 D DT^LRX
31 W !! D WAIT^DICD W:IOST["P-" @IOF
32 F S LRLN=$O(^TMP("WL",LRLN)) Q:'LRLN S LRTXT=^(LRLN) D LOOP1
33 D HEADER
34 S LRDV1=0 F S LRDV1=$O(^TMP($J,LRDV1)) Q:'LRDV1 D LOOP2
35 Q
36LOOP1 ;
37 I ($E(LRTXT,1,2)="$$") S LRDV2=+$E(LRTXT,3,99),LRDT=$E(LRTXT,10,16) Q
38 I ($E(LRTXT,1)="$") S LRDV1=+$E(LRTXT,2,99) Q
39 Q:'LRDV1!('LRDV2)
40 I LRDT>LRDT1,LRDT<LRDT2 D DATES S ^TMP($J,LRDV1,LRDV2,"TOT WRK")=^TMP($J,LRDV1,LRDV2,"TOT WRK")+(+$E(LRTXT,28,99)*(+$E(LRTXT,34,99)))
41 Q
42LOOP2 ;
43 S LRDV2=0 F S LRDV2=$O(^TMP($J,LRDV1,LRDV2)) Q:'LRDV2 D LOOP3
44 Q
45LOOP3 ;
46 I IOST["P-"&($Y>(IOSL-6)) D HEADER
47 W !,"Division: ",LRDV2
48 S X=^TMP($J,LRDV1,LRDV2,"LO DT") W ?20,"From: " D DD S X=^("HI DT") W ?35,"To: " D DD
49 W ?50,"Total: ",$J(^("TOT WRK"),10,2) S TOT=TOT+^("TOT WRK")
50 Q
51DATES ;
52 D:'$D(^TMP($J,LRDV1,LRDV2,"HI DT"))#2 NEW
53 S:'(LRDT<^TMP($J,LRDV1,LRDV2,"HI DT")) ^TMP($J,LRDV1,LRDV2,"HI DT")=LRDT
54 S:'(LRDT>^TMP($J,LRDV1,LRDV2,"LO DT")) ^TMP($J,LRDV1,LRDV2,"LO DT")=LRDT
55 Q
56NEW ;
57 S ^TMP($J,LRDV1,LRDV2,"HI DT")=0
58 S ^TMP($J,LRDV1,LRDV2,"LO DT")=9999999
59 S ^TMP($J,LRDV1,LRDV2,"TOT WRK")=0
60 Q
61HEADER ;
62 S LRPG=LRPG+1 W:IOST["P-"&($Y>(IOSL-6)) @IOF W !!," Lab Workload Division Report for Site: ",LRDV1," Printed: ",LRDT0,!!,?60,"Pg: ",LRPG,!
63 Q
64DD ;
65 W $$FMTE^XLFDT(X,"1D") Q
Note: See TracBrowser for help on using the repository browser.