1 | OCXOZ0V ;SLC/RJS,CLA - Order Check Scan ;DEC 27,2007 at 06:00
|
---|
2 | ;;3.0;ORDER ENTRY/RESULTS REPORTING;**32,221**;Dec 17,1997
|
---|
3 | ;; ;;ORDER CHECK EXPERT version 1.01 released OCT 29,1998
|
---|
4 | ;
|
---|
5 | ; ***************************************************************
|
---|
6 | ; ** Warning: This routine is automatically generated by the **
|
---|
7 | ; ** Rule Compiler (^OCXOCMP) and ANY changes to this routine **
|
---|
8 | ; ** will be lost the next time the rule compiler executes. **
|
---|
9 | ; ***************************************************************
|
---|
10 | ;
|
---|
11 | Q
|
---|
12 | ;
|
---|
13 | R50R1B ; Send Order Check, Notication messages and/or Execute code for Rule #50 'BIOCHEM ABNORMALITIES/CONTRAST MEDIA CHE...' Relation #1 'CONTRAST MEDIA ORDER AND ABNORMAL RENAL RESULTS'
|
---|
14 | ; Called from R50R1A+12^OCXOZ0U.
|
---|
15 | ;
|
---|
16 | Q:$G(OCXOERR)
|
---|
17 | ;
|
---|
18 | ; Local Extrinsic Functions
|
---|
19 | ; GETDATA( ---------> GET DATA FROM THE ACTIVE DATA FILE
|
---|
20 | ;
|
---|
21 | Q:$D(OCXRULE("R50R1B"))
|
---|
22 | ;
|
---|
23 | N OCXNMSG,OCXCMSG,OCXPORD,OCXFORD,OCXDATA,OCXNUM,OCXDUZ,OCXQUIT,OCXLOGS,OCXLOGD
|
---|
24 | I ($G(OCXOSRC)="CPRS ORDER PRESCAN") S OCXCMSG=(+OCXPSD)_"^9^^Procedure uses intravenous contrast media - abnormal biochem result: "_$$GETDATA(DFN,"129^130",58) I 1
|
---|
25 | E S OCXCMSG="Procedure uses intravenous contrast media - abnormal biochem result: "_$$GETDATA(DFN,"129^130",58)
|
---|
26 | S OCXNMSG=""
|
---|
27 | ;
|
---|
28 | Q:$G(OCXOERR)
|
---|
29 | ;
|
---|
30 | ; Send Order Check Message
|
---|
31 | ;
|
---|
32 | S OCXOCMSG($O(OCXOCMSG(999999),-1)+1)=OCXCMSG
|
---|
33 | Q
|
---|
34 | ;
|
---|
35 | R50R2A ; Verify all Event/Elements of Rule #50 'BIOCHEM ABNORMALITIES/CONTRAST MEDIA CHE...' Relation #2 'CONTRAST MEDIA ORDER AND NO CREAT RESULTS W/IN X D...'
|
---|
36 | ; Called from EL130+6^OCXOZ0H, and EL133+5^OCXOZ0H.
|
---|
37 | ;
|
---|
38 | Q:$G(OCXOERR)
|
---|
39 | ;
|
---|
40 | ; Local Extrinsic Functions
|
---|
41 | ; MCE130( ----------> Verify Event/Element: 'CONTRAST MEDIA ORDER'
|
---|
42 | ; MCE133( ----------> Verify Event/Element: 'NO CREAT RESULTS W/IN X DAYS'
|
---|
43 | ;
|
---|
44 | Q:$G(^OCXS(860.2,50,"INACT"))
|
---|
45 | ;
|
---|
46 | I $$MCE130 D
|
---|
47 | .I $$MCE133 D R50R2B
|
---|
48 | Q
|
---|
49 | ;
|
---|
50 | R50R2B ; Send Order Check, Notication messages and/or Execute code for Rule #50 'BIOCHEM ABNORMALITIES/CONTRAST MEDIA CHE...' Relation #2 'CONTRAST MEDIA ORDER AND NO CREAT RESULTS W/IN X D...'
|
---|
51 | ; Called from R50R2A+12.
|
---|
52 | ;
|
---|
53 | Q:$G(OCXOERR)
|
---|
54 | ;
|
---|
55 | ; Local Extrinsic Functions
|
---|
56 | ; GETDATA( ---------> GET DATA FROM THE ACTIVE DATA FILE
|
---|
57 | ;
|
---|
58 | Q:$D(OCXRULE("R50R2B"))
|
---|
59 | ;
|
---|
60 | N OCXNMSG,OCXCMSG,OCXPORD,OCXFORD,OCXDATA,OCXNUM,OCXDUZ,OCXQUIT,OCXLOGS,OCXLOGD
|
---|
61 | I ($G(OCXOSRC)="CPRS ORDER PRESCAN") S OCXCMSG=(+OCXPSD)_"^9^^Procedure uses intravenous contrast media - no creatinine results within "_$$GETDATA(DFN,"130^133",154)_" days" I 1
|
---|
62 | E S OCXCMSG="Procedure uses intravenous contrast media - no creatinine results within "_$$GETDATA(DFN,"130^133",154)_" days"
|
---|
63 | S OCXNMSG=""
|
---|
64 | ;
|
---|
65 | Q:$G(OCXOERR)
|
---|
66 | ;
|
---|
67 | ; Send Order Check Message
|
---|
68 | ;
|
---|
69 | S OCXOCMSG($O(OCXOCMSG(999999),-1)+1)=OCXCMSG
|
---|
70 | Q
|
---|
71 | ;
|
---|
72 | R51R1A ; Verify all Event/Elements of Rule #51 'RECENT CHOLECYSTOGRAM ORDER' Relation #1 'RECENT CHOLECGRM'
|
---|
73 | ; Called from EL63+5^OCXOZ0H.
|
---|
74 | ;
|
---|
75 | Q:$G(OCXOERR)
|
---|
76 | ;
|
---|
77 | ; Local Extrinsic Functions
|
---|
78 | ; MCE63( -----------> Verify Event/Element: 'PATIENT HAS RECENT CHOLECYSTOGRAM'
|
---|
79 | ;
|
---|
80 | Q:$G(^OCXS(860.2,51,"INACT"))
|
---|
81 | ;
|
---|
82 | I $$MCE63 D R51R1B
|
---|
83 | Q
|
---|
84 | ;
|
---|
85 | R51R1B ; Send Order Check, Notication messages and/or Execute code for Rule #51 'RECENT CHOLECYSTOGRAM ORDER' Relation #1 'RECENT CHOLECGRM'
|
---|
86 | ; Called from R51R1A+10.
|
---|
87 | ;
|
---|
88 | Q:$G(OCXOERR)
|
---|
89 | ;
|
---|
90 | ; Local Extrinsic Functions
|
---|
91 | ; GETDATA( ---------> GET DATA FROM THE ACTIVE DATA FILE
|
---|
92 | ;
|
---|
93 | Q:$D(OCXRULE("R51R1B"))
|
---|
94 | ;
|
---|
95 | N OCXNMSG,OCXCMSG,OCXPORD,OCXFORD,OCXDATA,OCXNUM,OCXDUZ,OCXQUIT,OCXLOGS,OCXLOGD
|
---|
96 | I ($G(OCXOSRC)="CPRS ORDER PRESCAN") S OCXCMSG=(+OCXPSD)_"^15^^Recent Cholecystogram: "_$$GETDATA(DFN,"63^",61)_" ["_$$GETDATA(DFN,"63^",122)_"]" I 1
|
---|
97 | E S OCXCMSG="Recent Cholecystogram: "_$$GETDATA(DFN,"63^",61)_" ["_$$GETDATA(DFN,"63^",122)_"]"
|
---|
98 | S OCXNMSG=""
|
---|
99 | ;
|
---|
100 | Q:$G(OCXOERR)
|
---|
101 | ;
|
---|
102 | ; Send Order Check Message
|
---|
103 | ;
|
---|
104 | S OCXOCMSG($O(OCXOCMSG(999999),-1)+1)=OCXCMSG
|
---|
105 | Q
|
---|
106 | ;
|
---|
107 | R53R1A ; Verify all Event/Elements of Rule #53 'RENAL FUNCTIONS OVER AGE 65 CHECK' Relation #1 'PHARM PAT OVER 65'
|
---|
108 | ; Called from EL64+5^OCXOZ0H.
|
---|
109 | ;
|
---|
110 | Q:$G(OCXOERR)
|
---|
111 | ;
|
---|
112 | ; Local Extrinsic Functions
|
---|
113 | ; MCE64( -----------> Verify Event/Element: 'PHARMACY PATIENT OVER 65'
|
---|
114 | ;
|
---|
115 | Q:$G(^OCXS(860.2,53,"INACT"))
|
---|
116 | ;
|
---|
117 | I $$MCE64 D R53R1B
|
---|
118 | Q
|
---|
119 | ;
|
---|
120 | R53R1B ; Send Order Check, Notication messages and/or Execute code for Rule #53 'RENAL FUNCTIONS OVER AGE 65 CHECK' Relation #1 'PHARM PAT OVER 65'
|
---|
121 | ; Called from R53R1A+10.
|
---|
122 | ;
|
---|
123 | Q:$G(OCXOERR)
|
---|
124 | ;
|
---|
125 | ; Local Extrinsic Functions
|
---|
126 | ; GETDATA( ---------> GET DATA FROM THE ACTIVE DATA FILE
|
---|
127 | ;
|
---|
128 | Q:$D(OCXRULE("R53R1B"))
|
---|
129 | ;
|
---|
130 | N OCXNMSG,OCXCMSG,OCXPORD,OCXFORD,OCXDATA,OCXNUM,OCXDUZ,OCXQUIT,OCXLOGS,OCXLOGD
|
---|
131 | I ($G(OCXOSRC)="CPRS ORDER PRESCAN") S OCXCMSG=(+OCXPSD)_"^21^^Patient >65. Renal Results: "_$$GETDATA(DFN,"64^",64) I 1
|
---|
132 | E S OCXCMSG="Patient >65. Renal Results: "_$$GETDATA(DFN,"64^",64)
|
---|
133 | S OCXNMSG=""
|
---|
134 | ;
|
---|
135 | Q:$G(OCXOERR)
|
---|
136 | ;
|
---|
137 | ; Send Order Check Message
|
---|
138 | ;
|
---|
139 | S OCXOCMSG($O(OCXOCMSG(999999),-1)+1)=OCXCMSG
|
---|
140 | Q
|
---|
141 | ;
|
---|
142 | R54R1A ; Verify all Event/Elements of Rule #54 'CONCURRENT LAB ORDERS FOR ANGIOGRAM, CAT...' Relation #1 'ANGIOGRAM'
|
---|
143 | ; Called from EL65+5^OCXOZ0H.
|
---|
144 | ;
|
---|
145 | Q:$G(OCXOERR)
|
---|
146 | ;
|
---|
147 | ; Local Extrinsic Functions
|
---|
148 | ; MCE65( -----------> Verify Event/Element: 'SESSION ORDER FOR ANGIOGRAM'
|
---|
149 | ;
|
---|
150 | Q:$G(^OCXS(860.2,54,"INACT"))
|
---|
151 | ;
|
---|
152 | I $$MCE65 D R54R1B
|
---|
153 | Q
|
---|
154 | ;
|
---|
155 | R54R1B ; Send Order Check, Notication messages and/or Execute code for Rule #54 'CONCURRENT LAB ORDERS FOR ANGIOGRAM, CAT...' Relation #1 'ANGIOGRAM'
|
---|
156 | ; Called from R54R1A+10.
|
---|
157 | ;
|
---|
158 | Q:$G(OCXOERR)
|
---|
159 | ;
|
---|
160 | ; Local Extrinsic Functions
|
---|
161 | ; GETDATA( ---------> GET DATA FROM THE ACTIVE DATA FILE
|
---|
162 | ;
|
---|
163 | Q:$D(OCXRULE("R54R1B"))
|
---|
164 | ;
|
---|
165 | N OCXNMSG,OCXCMSG,OCXPORD,OCXFORD,OCXDATA,OCXNUM,OCXDUZ,OCXQUIT,OCXLOGS,OCXLOGD
|
---|
166 | I ($G(OCXOSRC)="CPRS ORDER PRESCAN") S OCXCMSG=(+OCXPSD)_"^22^^Missing Labs for Angiogram: "_$$GETDATA(DFN,"65^",68) I 1
|
---|
167 | E S OCXCMSG="Missing Labs for Angiogram: "_$$GETDATA(DFN,"65^",68)
|
---|
168 | S OCXNMSG=""
|
---|
169 | ;
|
---|
170 | Q:$G(OCXOERR)
|
---|
171 | ;
|
---|
172 | ; Send Order Check Message
|
---|
173 | ;
|
---|
174 | S OCXOCMSG($O(OCXOCMSG(999999),-1)+1)=OCXCMSG
|
---|
175 | Q
|
---|
176 | ;
|
---|
177 | R55R1A ; Verify all Event/Elements of Rule #55 'ALLERGY - CONTRAST MEDIA REACTION' Relation #1 'ALLERGY'
|
---|
178 | ; Called from EL66+5^OCXOZ0H.
|
---|
179 | ;
|
---|
180 | Q:$G(OCXOERR)
|
---|
181 | ;
|
---|
182 | ; Local Extrinsic Functions
|
---|
183 | ; MCE66( -----------> Verify Event/Element: 'CONTRAST MEDIA ALLERGY'
|
---|
184 | ;
|
---|
185 | Q:$G(^OCXS(860.2,55,"INACT"))
|
---|
186 | ;
|
---|
187 | I $$MCE66 D R55R1B
|
---|
188 | Q
|
---|
189 | ;
|
---|
190 | R55R1B ; Send Order Check, Notication messages and/or Execute code for Rule #55 'ALLERGY - CONTRAST MEDIA REACTION' Relation #1 'ALLERGY'
|
---|
191 | ; Called from R55R1A+10.
|
---|
192 | ;
|
---|
193 | Q:$G(OCXOERR)
|
---|
194 | ;
|
---|
195 | ; Local Extrinsic Functions
|
---|
196 | ; GETDATA( ---------> GET DATA FROM THE ACTIVE DATA FILE
|
---|
197 | ;
|
---|
198 | Q:$D(OCXRULE("R55R1B"))
|
---|
199 | ;
|
---|
200 | N OCXNMSG,OCXCMSG,OCXPORD,OCXFORD,OCXDATA,OCXNUM,OCXDUZ,OCXQUIT,OCXLOGS,OCXLOGD
|
---|
201 | I ($G(OCXOSRC)="CPRS ORDER PRESCAN") S OCXCMSG=(+OCXPSD)_"^4^^Patient allergic to contrast media. ("_$$GETDATA(DFN,"66^",159)_") This procedure uses: "_$$GETDATA(DFN,"66^",66) I 1
|
---|
202 | E S OCXCMSG="Patient allergic to contrast media. ("_$$GETDATA(DFN,"66^",159)_") This procedure uses: "_$$GETDATA(DFN,"66^",66)
|
---|
203 | S OCXNMSG=""
|
---|
204 | ;
|
---|
205 | Q:$G(OCXOERR)
|
---|
206 | ;
|
---|
207 | ; Send Order Check Message
|
---|
208 | ;
|
---|
209 | S OCXOCMSG($O(OCXOCMSG(999999),-1)+1)=OCXCMSG
|
---|
210 | Q
|
---|
211 | ;
|
---|
212 | GETDATA(DFN,OCXL,OCXDFI) ; This Local Extrinsic Function returns runtime data
|
---|
213 | ;
|
---|
214 | N OCXE,VAL,PC S VAL=""
|
---|
215 | F PC=1:1:$L(OCXL,U) S OCXE=$P(OCXL,U,PC) I OCXE S VAL=$G(^TMP("OCXCHK",$J,DFN,OCXE,OCXDFI)) Q:$L(VAL)
|
---|
216 | Q VAL
|
---|
217 | ;
|
---|
218 | MCE130() ; Verify Event/Element: CONTRAST MEDIA ORDER
|
---|
219 | ;
|
---|
220 | ; OCXDF(37) -> PATIENT IEN data field
|
---|
221 | ;
|
---|
222 | N OCXRES
|
---|
223 | S OCXDF(37)=$G(DFN) I $L(OCXDF(37)) S OCXRES(130,37)=OCXDF(37)
|
---|
224 | Q:'(OCXDF(37)) 0 I $D(^TMP("OCXCHK",$J,OCXDF(37),130)) Q $G(^TMP("OCXCHK",$J,OCXDF(37),130))
|
---|
225 | Q 0
|
---|
226 | ;
|
---|
227 | MCE133() ; Verify Event/Element: NO CREAT RESULTS W/IN X DAYS
|
---|
228 | ;
|
---|
229 | ; OCXDF(37) -> PATIENT IEN data field
|
---|
230 | ;
|
---|
231 | N OCXRES
|
---|
232 | S OCXDF(37)=$G(DFN) I $L(OCXDF(37)) S OCXRES(133,37)=OCXDF(37)
|
---|
233 | Q:'(OCXDF(37)) 0 I $D(^TMP("OCXCHK",$J,OCXDF(37),133)) Q $G(^TMP("OCXCHK",$J,OCXDF(37),133))
|
---|
234 | Q 0
|
---|
235 | ;
|
---|
236 | MCE63() ; Verify Event/Element: PATIENT HAS RECENT CHOLECYSTOGRAM
|
---|
237 | ;
|
---|
238 | ; OCXDF(37) -> PATIENT IEN data field
|
---|
239 | ;
|
---|
240 | N OCXRES
|
---|
241 | S OCXDF(37)=$G(DFN) I $L(OCXDF(37)) S OCXRES(63,37)=OCXDF(37)
|
---|
242 | Q:'(OCXDF(37)) 0 I $D(^TMP("OCXCHK",$J,OCXDF(37),63)) Q $G(^TMP("OCXCHK",$J,OCXDF(37),63))
|
---|
243 | Q 0
|
---|
244 | ;
|
---|
245 | MCE64() ; Verify Event/Element: PHARMACY PATIENT OVER 65
|
---|
246 | ;
|
---|
247 | ; OCXDF(37) -> PATIENT IEN data field
|
---|
248 | ;
|
---|
249 | N OCXRES
|
---|
250 | S OCXDF(37)=$G(DFN) I $L(OCXDF(37)) S OCXRES(64,37)=OCXDF(37)
|
---|
251 | Q:'(OCXDF(37)) 0 I $D(^TMP("OCXCHK",$J,OCXDF(37),64)) Q $G(^TMP("OCXCHK",$J,OCXDF(37),64))
|
---|
252 | Q 0
|
---|
253 | ;
|
---|
254 | MCE65() ; Verify Event/Element: SESSION ORDER FOR ANGIOGRAM
|
---|
255 | ;
|
---|
256 | ; OCXDF(37) -> PATIENT IEN data field
|
---|
257 | ;
|
---|
258 | N OCXRES
|
---|
259 | S OCXDF(37)=$G(DFN) I $L(OCXDF(37)) S OCXRES(65,37)=OCXDF(37)
|
---|
260 | Q:'(OCXDF(37)) 0 I $D(^TMP("OCXCHK",$J,OCXDF(37),65)) Q $G(^TMP("OCXCHK",$J,OCXDF(37),65))
|
---|
261 | Q 0
|
---|
262 | ;
|
---|
263 | MCE66() ; Verify Event/Element: CONTRAST MEDIA ALLERGY
|
---|
264 | ;
|
---|
265 | ; OCXDF(37) -> PATIENT IEN data field
|
---|
266 | ;
|
---|
267 | N OCXRES
|
---|
268 | S OCXDF(37)=$G(DFN) I $L(OCXDF(37)) S OCXRES(66,37)=OCXDF(37)
|
---|
269 | Q:'(OCXDF(37)) 0 I $D(^TMP("OCXCHK",$J,OCXDF(37),66)) Q $G(^TMP("OCXCHK",$J,OCXDF(37),66))
|
---|
270 | Q 0
|
---|
271 | ;
|
---|