source: WorldVistAEHR/trunk/r/SCHEDULING-SD-SC/SDQ.m@ 836

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

initial load of WorldVistAEHR

File size: 5.3 KB
Line 
1SDQ ;ALB/MJK - Query Object Methods ;8/12/96
2 ;;5.3;Scheduling;**131**;Aug 13, 1993
3 ;
4OPEN(SDQ,SDERR) ; -- SDQ OPEN [API ID: 79]
5 D PREP^SDQUT
6 ;
7 ; -- get query object instance and set up query class info
8 IF '$$CREATE(.SDQ,"SD STANDARD ENCOUNTER QUERY",$G(SDERR)) G OPENQ
9 ;
10 ; -- do query object instance kills and sets
11 K @SDQUERY@(SDQ)
12 S @SDQUERY@(SDQ)=""
13 F X="SCAN" M @SDQUERY@(SDQ,X)=^TMP("SDQUERY CLASS",$J,SDQ,X)
14 D STOP^SDQPROP(.SDQ)
15 ;
16 ; -- do open actions
17 N SDOPEN
18 S SDOPEN=$G(^TMP("SDQUERY CLASS",$J,SDQ,"OPEN"))
19 IF SDOPEN]"" X SDOPEN
20OPENQ Q
21 ;
22CLOSE(SDQ,SDERR) ; -- SDQ CLOSE [API ID: 80]
23 D PREP^SDQUT
24 ;
25 ; -- do validation checks
26 IF '$$QRY^SDQVAL(.SDQ,$G(SDERR)) G CLOSEQ
27 ;
28 ; -- do close actions
29 N SDCLOSE
30 S SDCLOSE=$G(^TMP("SDQUERY CLASS",$J,SDQ,"CLOSE"))
31 IF SDCLOSE]"" X SDCLOSE
32 ;
33 ; -- do query object instance kills
34 K @SDQUERY@(SDQ)
35 ;
36 ; -- do query class kills
37 IF '$$DESTROY(.SDQ) G CLOSEQ
38 S SDQ=""
39CLOSEQ Q
40 ;
41CREATE(SDQ,SDQNAME,SDERR) ; -- query class level method for CREATE
42 N SDCLS,SDCLS0,SDOK,SDSTORE
43 S SDCLS=+$O(^SD(409.64,"B",SDQNAME,0))
44 IF SDCLS D
45 . S SDCLS0=$G(^SD(409.64,SDCLS,0))
46 . S SDSTORE=$S($P(SDCLS0,U,4):$P(SDCLS0,U,4),1:5000)
47 . IF $G(SDQUERY)="" S SDQUERY="SDQDATA"
48 . D STORE(.SDQUERY,SDSTORE)
49 . IF '$O(@SDQUERY@(0)) D KILL
50 . ;
51 . ; -- set query id
52 . S (SDQ,@SDQUERY)=$G(@SDQUERY)+1
53 . ; -- set up tmp class info
54 . K ^TMP("SDQUERY CLASS",$J,SDQ)
55 . M ^TMP("SDQUERY CLASS",$J,SDQ)=^SD(409.64,SDCLS)
56 . S ^TMP("SDQUERY CLASS",$J,SDQ)=SDCLS
57 . S ^TMP("SDQUERY CLASS",$J,SDQ,"GL")=$G(^DIC(+$P(SDCLS0,"^",2),0,"GL"))
58 . ; -- subscript level of files root ; ex:^SCE = 0 ; ex:^SD(404.42, = 1
59 . S ^TMP("SDQUERY CLASS",$J,SDQ,"GL SUBSCRIPTS")=+$P(SDCLS0,"^",3)
60 . ;
61 . S SDOK=1
62 ELSE D
63 . ; -- build error msg
64 . N SDIN,SDOUT
65 . S SDIN("CLASS")=SDQNAME
66 . S SDOUT("CLASS")=SDQNAME
67 . D BLD^SDQVAL(4096400.001,.SDIN,.SDOUT,$G(SDERR))
68 . S SDOK=0
69 ;
70 Q SDOK
71 ;
72STORE(SDQUERY,SDSTORE) ; -- decide whether to use a local or global
73 N SDOLD
74 IF $S<SDSTORE,SDQUERY'["^TMP" D
75 . S SDOLD=SDQUERY
76 . S SDQUERY=$NA(^TMP("SDQDATA",$J))
77 . K @SDQUERY
78 . M @SDQUERY=@SDOLD
79 . K @SDOLD
80 Q
81 ;
82DESTROY(SDQ) ; -- query class level method for DESTROY
83 K ^TMP("SDQUERY CLASS",$J,SDQ)
84 IF '$O(@SDQUERY@(0)) D KILL K SDQUERY
85 Q 1
86 ;
87KILL ; -- kill class and ien list globals
88 K ^TMP("SDQUERY CLASS",$J)
89 K ^TMP("SDQUERY LIST",$J)
90 K @SDQUERY
91 Q
92 ;
93 ;
94PAT(SDQ,SDFN,SDACT,SDERR) ; -- SDQ PATIENT [API ID: 81]
95 D PREP^SDQUT
96 G PATG^SDOEQ
97 ;
98GETPAT(SDQ,SDERR) ; -- get patient property [API ID: 1xx]
99 ; -- not supported
100 D PREP^SDQUT
101 N SDFN
102 D PAT^SDOEQ(.SDQ,.SDFN,"GET",$G(SDERR))
103 Q $G(SDFN)
104 ;
105DATE(SDQ,SDBEG,SDEND,SDACT,SDERR) ; -- SDQ DATE RANGE [API ID: 82]
106 D PREP^SDQUT
107 G DATEG^SDQPROP
108 ;
109GETDATE(SDQ,SDERR) ; -- get date range property [API ID: 1xx]
110 ; -- not supported
111 D PREP^SDQUT
112 N SDBEG,SDEND
113 D DATE^SDQPROP(.SDQ,.SDBEG,.SDEND,"GET",$G(SDERR))
114 Q $G(SDBEG)_"^"_$G(SDEND)
115 ;
116FILTER(SDQ,SDFIL,SDACT,SDERR) ; -- SDQ FILTER [API ID: 83]
117 D PREP^SDQUT
118 G FILTERG^SDQPROP
119 ;
120GETFIL(SDQ,SDERR) ; -- get filter property [API ID: 1xx]
121 ; -- not supported
122 D PREP^SDQUT
123 N SDFIL
124 D FILTER^SDQPROP(.SDQ,.SDFIL,"GET",$G(SDERR))
125 Q $G(SDFIL)
126 ;
127VISIT(SDQ,SDVST,SDACT,SDERR) ; -- SDQ VISIT [API ID: 84]
128 D PREP^SDQUT
129 G VISITG^SDOEQ
130 ;
131GETVISIT(SDQ,SDERR) ; -- get visit property [API ID: 1xx]
132 ; -- not supported
133 D PREP^SDQUT
134 N SDVST
135 D VISIT^SDOEQ(.SDQ,.SDVST,.SDACT,$G(SDERR))
136 Q $G(SDVST)
137 ;
138INDEX(SDQ,SDIDX,SDACT,SDERR) ; -- SDQ INDEX NAME [API ID: 85]
139 D PREP^SDQUT
140 G INDEXG^SDQPROP
141 ;
142GETINDEX(SDQ,SDERR) ; -- get index property [API ID: 1xx]
143 ; -- not supported
144 D PREP^SDQUT
145 N SDIDX
146 D INDEX^SDQPROP(.SDQ,.SDIDX,"GET",$G(SDERR))
147 Q $G(SDIDX)
148 ;
149ACTIVE(SDQ,SDSTAT,SDACT,SDERR) ; -- SDQ ACTIVE STATUS [API ID: 88]
150 D PREP^SDQUT
151 G ACTIVEG^SDQPROP
152 ;
153GETACT(SDQ,SDERR) ; -- activate query [API ID: 1xx]
154 ; -- not supported
155 D PREP^SDQUT
156 N SDSTAT
157 D ACTIVE^SDQPROP(.SDQ,.SDSTAT,.SDACT,$G(SDERR))
158 Q $G(SDSTAT)
159 ;
160REFRESH(SDQ,SDERR) ; -- SDQ REFRESH [API ID: 94]
161 D PREP^SDQUT
162 G REFRESHG^SDQUT
163 ;
164SCAN(SDQ,SDIR,SDERR) ; -- SDQ SCAN [API ID: 99]
165 D PREP^SDQUT
166 G SCANG^SDQNAV
167 ;
168SCANCB(SDQ,SDCB,SDACT,SDERR) ; -- SDQ SCAN CALLBACK [API ID: 100]
169 D PREP^SDQUT
170 G SCANCBG^SDQNAV
171 ;
172NEXT(SDQ,SDERR) ; -- SDQ NEXT [API ID: 92]
173 D PREP^SDQUT
174 G NEXTG^SDQNAV
175 ;
176PRIOR(SDQ,SDERR) ; -- SDQ PRIOR [API ID: 93]
177 D PREP^SDQUT
178 G PRIORG^SDQNAV
179 ;
180FIRST(SDQ,SDERR) ; -- SDQ FIRST [API ID: 90]
181 D PREP^SDQUT
182 G FIRSTG^SDQNAV
183 ;
184LAST(SDQ,SDERR) ; -- SDQ LAST [API ID: 91]
185 D PREP^SDQUT
186 G LASTG^SDQNAV
187 ;
188EOF(SDQ,SDERR) ; -- SDQ EOF [API ID: 86]
189 D PREP^SDQUT
190 Q $$EOF^SDQNAV(.SDQ,$G(SDERR))
191 ;
192BOF(SDQ,SDERR) ; -- SDQ BOF [API ID: 87]
193 D PREP^SDQUT
194 Q $$BOF^SDQNAV(.SDQ,$G(SDERR))
195 ;
196COUNT(SDQ,SDERR) ; -- SDQ COUNT [API ID: 89]
197 D PREP^SDQUT
198 Q $$COUNT^SDQNAV(.SDQ,$G(SDERR))
199 ;
200GETENTRY(SDQ,SDERR) ; -- SDQ GET CURRENT ENTRY ID [API ID: 95]
201 D PREP^SDQUT
202 Q $$GETENTRY^SDQUT(.SDQ,$G(SDERR))
203 ;
Note: See TracBrowser for help on using the repository browser.