source: WorldVistAEHR/trunk/r/LAB_SERVICE-LR-LS/LRRP8A.m@ 1006

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

initial load of WorldVistAEHR

File size: 3.2 KB
Line 
1LRRP8A ;DALISC/TNN/J0 - WKLD STATS REPORT BY SHIFT ; 4/9/93
2 ;;5.2;LAB SERVICE;**63**;Sep 27, 1994
3 W !!,"ENTRY POINT IS AT EN^LRRP8." H 3 QUIT
4 ;
5ASK ;
6 D INST Q:LREND
7 D ACCAREA Q:LREND
8 D DATES Q:LREND
9 D CAPS Q:LREND
10 D TIMES Q:LREND
11 D REPTYP Q:LREND
12 D DEVICE Q:LREND
13 Q
14INST ;*** Query for institution ***
15 K DIC
16 W @IOF,!
17 S DIC="^LRO(64.1,",DIC(0)="AQENM" D ^DIC
18 I (+Y<0)!($D(DUOUT))!($D(DTOUT)) S LREND=1 Q
19 S LRIN=+Y
20 Q
21ACCAREA ;*** Query for accession areas ***
22 S LRAA=0
23 K DIR,X,Y S DIR(0)="S^Y:YES;N:NO",DIR("B")="NO"
24 S DIR("A")="Do you want to select accession areas (YES or NO) "
25 S DIR("?",1)="Enter 'NO' to include ALL accession areas."
26 S DIR("?")="Enter 'YES' to limit report to one or more accession areas."
27 D ^DIR
28 Q:Y="N"
29 I ($D(DTOUT))!($D(DUOUT)) S LREND=1 Q
30 K DIC S DIC=68,DIC(0)="AEMQZ"
31 F D ^DIC Q:Y=-1 D
32 .S LRAA=+Y,LRAA(+Y)=$P(Y(0),U,11)
33 I ($D(DTOUT))!($D(DUOUT)) S LREND=1 Q
34 Q
35DATES ;*** Query for date ***
36 W !,"DATE selection:"
37 K DIR,X,Y S DIR(0)="S^1:A specific date;2:A range of dates"
38 D ^DIR
39 I $D(DIRUT)!($D(DUOUT)) S LREND=1 Q
40 I X=1 D QDT Q
41 D DATE^LRCAPR1A S:Y=-1 LREND=1
42 Q
43CAPS ;*** Query for CAP codes ***
44 N I S LRCAPS=0 K DIR,X,Y
45 S DIR(0)="S^Y:YES;N:NO",DIR("B")="NO"
46 S DIR("A")="Do you want to select workload codes (YES or NO) "
47 S DIR("?",1)="Enter 'NO' to include ALL workload codes."
48 S DIR("?")="Enter 'YES' to limit report to one or more workload codes."
49 D ^DIR
50 Q:Y="N"
51 I ($D(DTOUT))!($D(DUOUT)) S LREND=1 Q
52 W !
53 S DIC="^LAM(",DIC(0)="AQENM",DIC("A")="Select WKLD code:"
54 F I=1:1 D ^DIC Q:Y=-1 S LRCAPS(+Y)=$P(Y,U),LRCAPS=I
55 S:($D(DTOUT))!($D(DUOUT)) LREND=1
56 Q
57TIMES ;*** Query for type of time search ***
58 W !,"TIME selection:"
59 K DIR S DIR(0)="S^1:A time range;2:A set of shifts"
60 D ^DIR K DIR I $D(DTOUT)!($D(DUOUT)) S LREND=1 Q
61 I X=2 D QST Q
62 D QTR I ($G(LRSTRT)<0)!($G(LRSTOP)<0) S LREND=1
63 Q
64REPTYP ;*** Query for type of type of report ***
65 W !,"REPORT selection:"
66 K DIR S DIR(0)="S^1:Detail report;2:Summary report"
67 D ^DIR
68 I $D(DTOUT)!($D(DUOUT)) S LREND=1 Q
69 S LRRPT=+X
70 Q
71DEVICE ;
72 K %ZIS,POP S %ZIS="Q" D ^%ZIS
73 I POP S LREND=1 Q
74 I $D(IO("Q")) D QUE S LREND=1
75 Q
76QUE ;
77 S ZTSAVE("LR*")="",ZTRTN="DQ^LRRP8",ZTDESC="LR WKLD SHIFT REPORT"
78 S:$G(LRAA) ZTSAVE("LRAA*")=""
79 D ^%ZTLOAD,^%ZISC
80 W:$G(ZTSK) !!,"TASK ",ZTSK," QUEUED." H 3
81 Q
82QDT ;*** Query for a specific date ***
83 W !
84 S DIC="^LRO(64.1,"_LRIN_",1,",DIC(0)="AQENM" D ^DIC
85 I Y=-1 S LREND=1 Q
86 S (LRDATE,LRFR,LRTO)=+Y,LRDR=1 D DD^%DT
87 S LRDTH="For: "_Y
88 Q
89QST ;*** Query for shifts ***
90 N I3
91 S LRSTFLG=1 W !,"How many shifts?"
92 K DIR S DIR(0)="N^1:4:0"
93 D ^DIR K DIR S LRNSFT=X I $D(DIRUT)!($D(DUOUT)) S LREND=1 Q
94 F I3=1:1:LRNSFT D Q:LREND
95 . W !!,"For Shift # ",I3
96 . D QTR Q:LREND=1
97 . S LRST(I3)=LRSTRT_"^"_LRSTOP
98 Q
99QTR ;*** Query for a time range (in military format) ***
100 W !,"Enter TIME RANGE in military format HHMM.SS (0.00 - 2400.00):"
101 K DIR S DIR(0)="LO^0.00:2400.00",DIR("A")="START time: "
102 D ^DIR K DIR I $D(DTOUT)!($D(DUOUT)) S LREND=1 Q
103 S LRSTRT=X S:+LRSTRT=0 LRSTRT=.01 I LRSTRT="" G QTR
104Q1 K DIR S DIR(0)="LO^0.00:2400.00",DIR("A")="STOP time: "
105 D ^DIR K DIR I $D(DTOUT)!($D(DUOUT)) S LREND=1 Q
106 S LRSTOP=X I LRSTOP="" G Q1
107 I LRSTOP<LRSTRT W !,"Stop time should be GREATER than start time" G QTR
108 Q
Note: See TracBrowser for help on using the repository browser.