source: WorldVistAEHR/trunk/r/SCHEDULING-SD-SC/SDAMOCC.m@ 1710

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

initial load of WorldVistAEHR

File size: 2.3 KB
Line 
1SDAMOCC ;IOFIO BAYPINES/TEH - AM Mgt Reports ; 12/1/91
2 ;;5.3;Scheduling;**487**;Aug 13, 1993
3 ;
4EN ; main entry point
5 N DIC,SDBEG,SDEND,SDSEL,VAUTD,VAUTC,SDSORT,SDAMLIST,Y,VAUTNI,VAUTSTR,VAUTVB,DIRUT
6EN1 I '$$INIT G ENQ
7 ;
8ASKBDT ;
9 W !!,$$LINE("Date Range Selection"),!
10 S %DT="AEX",%DT("A")="Select Beginning Date: "
11 D ^%DT S SDBEG=Y
12 I X="^" Q
13 I Y=-1 W !!,"Invalid Date!",! G ASKBDT
14 K %DT,Y
15ASKEDT ;
16 S %DT="AEX",%DT("A")="Select Ending Date: "
17 D ^%DT S SDEND=Y
18 I X="^" Q
19 I Y=-1 W !!,"Invalid Date!",! G ASKEDT
20 I SDEND<SDBEG W !!,"Ending Date must be equal to or greater than Beginning Date." G ASKEDT
21 K %DT,Y
22 ;I '$$RANGE G ENQ
23 S SDSEL=1
24 S SDSEL=SDSEL+4 ; for backwards compatibility
25 G STATS^SDAMOC
26ENQ Q
27 ;
28INIT() ; -- init vars
29 Q 1
30 ;
31RANGE() ; select date range
32 ; input: none
33 ; output: SDBEG := begin date
34 ; SDEND := end date
35 ; return: was selection made [ 1|yes 0|no]
36 ;
37 W !!,$$LINE("Date Range Selection")
38 Q $$RANGE^SDAMQ(.SDBEG,.SDEND)
39 ;
40SELECT() ; -- get selection criteria
41 ; input: none
42 ; output: SDSEL := criteria selected
43 ; return: was selection made [ 1|yes 0|no]
44 ;
45 W !!,$$LINE("Statisitcs Criteria")
46 S X="S^"
47 S X=X_"1:Statistics;"
48 S X=X_"2:Division(s) Only Statistics"
49 S DIR(0)=X,DIR("A")="Which Visits",DIR("B")="Statistics"
50 D ^DIR K DIR S SDSEL=$S($D(DIRUT):0,1:+Y)
51 Q SDSEL>0
52 ;
53DIV() ; -- get division data
54 ; input: none
55 ; output: VAUTD := divs selected (VAUTD=1 for all)
56 ; return: was selection made [ 1|yes 0|no]
57 ;
58 W:$P($G(^DG(43,1,"GL")),U,2) !!,$$LINE("Division Selection")
59 D ASK2^SDDIV I Y<0 K VAUTD
60 Q $D(VAUTD)>0
61 ;
62CLINIC() ; -- get clinic data
63 ; input: VAUTD := divisions selected
64 ; output: VAUTC := clinic selected (VAUTC=1 for all)
65 ; return: was selection made [ 1|yes 0|no]
66 ;
67 W !!,$$LINE("Clinic Selection")
68 D CLINIC^SDAMO0
69 I Y<0 K VAUTC
70CLINICQ Q $D(VAUTC)>0
71 ;
72STOP() ; -- get stop code data
73 ; output: VAUTC := stop codes selected (VAUTC=1 for all)
74 ; return: was selection made [ 1|yes 0|no]
75 ;
76 W !!,$$LINE("Stop Codes Selection")
77 S DIC="^DIC(40.7,",VAUTSTR="stop code",VAUTVB="VAUTC",VAUTNI=2
78 D FIRST^VAUTOMA
79 I Y<0 K VAUTC
80STOPQ Q $D(VAUTC)>0
81 ;
82 ;
83LINE(STR) ; -- print line
84 ; input: STR := text to insert
85 ; output: none
86 ; return: text to use
87 ;
88 N X
89 S:STR]"" STR=" "_STR_" "
90 S $P(X,"_",(IOM/2)-($L(STR)/2))=""
91 Q X_STR_X
92 ;
Note: See TracBrowser for help on using the repository browser.