source: FOIAVistA/trunk/r/SCHEDULING-SD-SC/SDAMOW.m@ 1742

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

initial load of FOIAVistA 6/30/08 version

File size: 3.3 KB
Line 
1SDAMOW ;ALB/CAW - Waiting Time Report ; 12/1/91
2 ;;5.3;Scheduling;**12**;Aug 13, 1993
3 ;
4EN ; main entry point
5 N DIC,SDBEG,SDEND,SDSEL,VAUTD,VAUTC,SDSORT,SDAMLIST
6EN1 I '$$INIT G ENQ
7 I '$$RANGE G ENQ
8 I '$$SELECT G ENQ
9 I '$$SORT G ENQ
10EN2 I '$$DIV G ENQ
11 I SDSORT=5 S (VAUTS,VAUTC)=1 G EN3
12 I SDSORT=1!(SDSORT=2) G ENQ:'$$CLINIC
13 I SDSORT=3!(SDSORT=4) G ENQ:'$$STOP
14EN3 I '$$ASK G EN1
15 W !!,$$LINE("Device Selection")
16 W !!,"This output requires 132 columns.",!!
17 S %ZIS="PMQ" D ^%ZIS I POP G ENQ
18 I '$D(IO("Q")) D START^SDAMOW1 G ENQ
19 S Y=$$QUE
20ENQ D:'$D(ZTQUEUED) ^%ZISC
21 K VAUTD,VAUTC,VAUTS Q
22 ;
23INIT() ; -- init vars
24 Q 1
25 ;
26RANGE() ; select date range
27 ; input: none
28 ; output: SDBEG := begin date
29 ; SDEND := end date
30 ; return: was selection made [ 1|yes 0|no]
31 ;
32 W !!,$$LINE("Date Range Selection")
33 Q $$RANGE^SDAMQ(.SDBEG,.SDEND)
34 ;
35SELECT() ; -- get selection criteria
36 ; input: none
37 ; output: SDSEL := criteria selected
38 ; return: was selection made [ 1|yes 0|no]
39 ;
40 W !!,$$LINE("Type of Report Criteria")
41 S X="S^"
42 S X=X_"1:Full Report;"
43 S X=X_"2:Totals Only;"
44 S DIR(0)=X,DIR("A")="Which Report",DIR("B")="Totals Only"
45 D ^DIR K DIR S SDSEL=$S($D(DIRUT):0,1:+Y)
46 Q SDSEL>0
47 ;
48SORT() ; -- how to sort
49 ; input: none
50 ; output: SDSORT := sort selected
51 ; return: was selection made [ 1|yes 0|no]
52 ;
53 W !!,$$LINE("Sort Selection")
54 W !!,"Note: Top level sort will always be by Division."
55 S X="S^"
56 S X=X_"1:Clinic, then by Patient;"
57 S X=X_"2:Clinic, then by Appointment Date/Time;"
58 S X=X_"3:Stop Code, then by Clinic;"
59 S X=X_"4:Stop Code, then by Patient;"
60 S X=X_"5:Patient then by Appointment Date/Time;"
61 S DIR(0)=X,DIR("A")="Within Division Sort By",DIR("B")="Clinic, then by Patient"
62 D ^DIR K DIR S SDSORT=$S($D(DIRUT):0,1:+Y)
63 Q SDSORT>0
64 ;
65DIV() ; -- get division data
66 ; input: none
67 ; output: VAUTD := divs selected (VAUTD=1 for all)
68 ; return: was selection made [ 1|yes 0|no]
69 ;
70 W:$P($G(^DG(43,1,"GL")),U,2) !!,$$LINE("Division Selection")
71 D ASK2^SDDIV I Y<0 K VAUTD
72 Q $D(VAUTD)>0
73 ;
74CLINIC() ; -- get clinic data
75 ; input: VAUTD := divisions selected
76 ; output: VAUTC := clinic selected (VAUTC=1 for all)
77 ; return: was selection made [ 1|yes 0|no]
78 ;
79 W !!,$$LINE("Clinic Selection")
80 D CLINIC^SDAMO0
81 I Y<0 K VAUTC
82CLINICQ Q $D(VAUTC)>0
83 ;
84STOP() ; -- get stop code data
85 ; output: VAUTS := stop codes selected (VAUTS=1 for all)
86 ; return: was selection made [ 1|yes 0|no]
87 ;
88 W !!,$$LINE("Stop Codes Selection")
89 S DIC="^DIC(40.7,",VAUTSTR="stop code",VAUTVB="VAUTS",VAUTNI=2
90 D FIRST^VAUTOMA
91 I Y<0 K VAUTS
92STOPQ Q $D(VAUTS)>0
93 ;
94 ;
95LINE(STR) ; -- print line
96 ; input: STR := text to insert
97 ; output: none
98 ; return: text to use
99 ;
100 N X
101 S:STR]"" STR=" "_STR_" "
102 S $P(X,"_",(IOM/2)-($L(STR)/2))=""
103 Q X_STR_X
104 ;
105QUE() ; -- que job
106 ; return: did job que [ 1|yes 0|no ]
107 ;
108 K ZTSK,IO("Q")
109 S ZTDESC="Appointment Management Report",ZTRTN="START^SDAMOW1"
110 F X="VAUTD(","VAUTC(","SDSORT","SDSEL","SDBEG","SDEND","VAUTD","VAUTC","VAUTS","VAUTS(" S ZTSAVE(X)=""
111 D ^%ZTLOAD W:$D(ZTSK) " (Task: ",ZTSK,")"
112 Q $D(ZTSK)
113 ;
114ASK() ; -- ask if ok to use specs
115 ; input: all selection variables
116 ; output: none
117 ; return: ok to continue [ 1|yes 0|no]
118 ;
119 I '$$DISP^SDAMOW1 S Y=0 G ASKQ
120 S DIR(0)="Y",DIR("A")="Continue",DIR("B")="Yes" D ^DIR K DIR
121ASKQ Q $S($D(DIRUT):0,1:Y)
Note: See TracBrowser for help on using the repository browser.