source: WorldVistAEHR/trunk/r/ORDER_ENTRY_RESULTS_REPORTING-OR-OCX--ORRC--ORRJ/OCXOZ11.m

Last change on this file was 623, checked in by George Lilly, 15 years ago

revised back to 6/30/08 version

File size: 6.6 KB
Line 
1OCXOZ11 ;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 ;
13R68R1A ; Verify all Event/Elements of Rule #68 'DANGEROUS MEDS OVER AGE 64' Relation #1 'MED ORDER FOR PT > 64 AND AMITRIPTYLINE'
14 ; Called from EL122+5^OCXOZ0I, and EL125+5^OCXOZ0I.
15 ;
16 Q:$G(OCXOERR)
17 ;
18 ; Local Extrinsic Functions
19 ; MCE122( ----------> Verify Event/Element: 'AMITRIPTYLINE ORDER'
20 ; MCE125( ----------> Verify Event/Element: 'MED ORDER FOR PT > 64'
21 ;
22 Q:$G(^OCXS(860.2,68,"INACT"))
23 ;
24 I $$MCE125 D
25 .I $$MCE122 D R68R1B
26 Q
27 ;
28R68R1B ; Send Order Check, Notication messages and/or Execute code for Rule #68 'DANGEROUS MEDS OVER AGE 64' Relation #1 'MED ORDER FOR PT > 64 AND AMITRIPTYLINE'
29 ; Called from R68R1A+12.
30 ;
31 Q:$G(OCXOERR)
32 ;
33 ; Local Extrinsic Functions
34 ; GETDATA( ---------> GET DATA FROM THE ACTIVE DATA FILE
35 ;
36 Q:$D(OCXRULE("R68R1B"))
37 ;
38 N OCXNMSG,OCXCMSG,OCXPORD,OCXFORD,OCXDATA,OCXNUM,OCXDUZ,OCXQUIT,OCXLOGS,OCXLOGD
39 I ($G(OCXOSRC)="CPRS ORDER PRESCAN") S OCXCMSG=(+OCXPSD)_"^30^^Patient is "_$$GETDATA(DFN,"122^125",62)_". "_$$GETDATA(DFN,"122^125",141) I 1
40 E S OCXCMSG="Patient is "_$$GETDATA(DFN,"122^125",62)_". "_$$GETDATA(DFN,"122^125",141)
41 S OCXNMSG=""
42 ;
43 Q:$G(OCXOERR)
44 ;
45 ; Send Order Check Message
46 ;
47 S OCXOCMSG($O(OCXOCMSG(999999),-1)+1)=OCXCMSG
48 Q
49 ;
50R68R2A ; Verify all Event/Elements of Rule #68 'DANGEROUS MEDS OVER AGE 64' Relation #2 'MED ORDER FOR PT > 64 AND CHLORPROPAMIDE'
51 ; Called from EL125+6^OCXOZ0I, and EL123+5^OCXOZ0I.
52 ;
53 Q:$G(OCXOERR)
54 ;
55 ; Local Extrinsic Functions
56 ; MCE123( ----------> Verify Event/Element: 'CHLORPROPAMIDE ORDER'
57 ; MCE125( ----------> Verify Event/Element: 'MED ORDER FOR PT > 64'
58 ;
59 Q:$G(^OCXS(860.2,68,"INACT"))
60 ;
61 I $$MCE125 D
62 .I $$MCE123 D R68R2B
63 Q
64 ;
65R68R2B ; Send Order Check, Notication messages and/or Execute code for Rule #68 'DANGEROUS MEDS OVER AGE 64' Relation #2 'MED ORDER FOR PT > 64 AND CHLORPROPAMIDE'
66 ; Called from R68R2A+12.
67 ;
68 Q:$G(OCXOERR)
69 ;
70 ; Local Extrinsic Functions
71 ; GETDATA( ---------> GET DATA FROM THE ACTIVE DATA FILE
72 ;
73 Q:$D(OCXRULE("R68R2B"))
74 ;
75 N OCXNMSG,OCXCMSG,OCXPORD,OCXFORD,OCXDATA,OCXNUM,OCXDUZ,OCXQUIT,OCXLOGS,OCXLOGD
76 I ($G(OCXOSRC)="CPRS ORDER PRESCAN") S OCXCMSG=(+OCXPSD)_"^30^^Patient is "_$$GETDATA(DFN,"123^125",62)_". "_$$GETDATA(DFN,"123^125",142) I 1
77 E S OCXCMSG="Patient is "_$$GETDATA(DFN,"123^125",62)_". "_$$GETDATA(DFN,"123^125",142)
78 S OCXNMSG=""
79 ;
80 Q:$G(OCXOERR)
81 ;
82 ; Send Order Check Message
83 ;
84 S OCXOCMSG($O(OCXOCMSG(999999),-1)+1)=OCXCMSG
85 Q
86 ;
87R68R3A ; Verify all Event/Elements of Rule #68 'DANGEROUS MEDS OVER AGE 64' Relation #3 'MED ORDER FOR PT > 64 AND DIPYRIDAMOLE'
88 ; Called from EL125+7^OCXOZ0I, and EL124+5^OCXOZ0I.
89 ;
90 Q:$G(OCXOERR)
91 ;
92 ; Local Extrinsic Functions
93 ; MCE124( ----------> Verify Event/Element: 'DIPYRIDAMOLE ORDER'
94 ; MCE125( ----------> Verify Event/Element: 'MED ORDER FOR PT > 64'
95 ;
96 Q:$G(^OCXS(860.2,68,"INACT"))
97 ;
98 I $$MCE125 D
99 .I $$MCE124 D R68R3B
100 Q
101 ;
102R68R3B ; Send Order Check, Notication messages and/or Execute code for Rule #68 'DANGEROUS MEDS OVER AGE 64' Relation #3 'MED ORDER FOR PT > 64 AND DIPYRIDAMOLE'
103 ; Called from R68R3A+12.
104 ;
105 Q:$G(OCXOERR)
106 ;
107 ; Local Extrinsic Functions
108 ; GETDATA( ---------> GET DATA FROM THE ACTIVE DATA FILE
109 ;
110 Q:$D(OCXRULE("R68R3B"))
111 ;
112 N OCXNMSG,OCXCMSG,OCXPORD,OCXFORD,OCXDATA,OCXNUM,OCXDUZ,OCXQUIT,OCXLOGS,OCXLOGD
113 I ($G(OCXOSRC)="CPRS ORDER PRESCAN") S OCXCMSG=(+OCXPSD)_"^30^^Patient is "_$$GETDATA(DFN,"124^125",62)_". "_$$GETDATA(DFN,"124^125",144) I 1
114 E S OCXCMSG="Patient is "_$$GETDATA(DFN,"124^125",62)_". "_$$GETDATA(DFN,"124^125",144)
115 S OCXNMSG=""
116 ;
117 Q:$G(OCXOERR)
118 ;
119 ; Send Order Check Message
120 ;
121 S OCXOCMSG($O(OCXOCMSG(999999),-1)+1)=OCXCMSG
122 Q
123 ;
124R69R1A ; Verify all Event/Elements of Rule #69 'LAB THRESHOLD' Relation #1 'IF HL7 LAB RESULTS AND (GREATER THAN THRESHOLD VAL...'
125 ; Called from EL5+7^OCXOZ0H, and EL131+5^OCXOZ0I, and EL132+5^OCXOZ0I.
126 ;
127 Q:$G(OCXOERR)
128 ;
129 ; Local Extrinsic Functions
130 ; MCE131( ----------> Verify Event/Element: 'GREATER THAN LAB THRESHOLD'
131 ; MCE132( ----------> Verify Event/Element: 'LESS THAN LAB THRESHOLD'
132 ; MCE5( ------------> Verify Event/Element: 'HL7 FINAL LAB RESULT'
133 ;
134 Q:$G(^OCXS(860.2,69,"INACT"))
135 ;
136 I $$MCE5 D
137 .I $$MCE131 D R69R1B^OCXOZ12
138 .I $$MCE132 D R69R1B^OCXOZ12
139 Q
140 ;
141GETDATA(DFN,OCXL,OCXDFI) ; This Local Extrinsic Function returns runtime data
142 ;
143 N OCXE,VAL,PC S VAL=""
144 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)
145 Q VAL
146 ;
147MCE122() ; Verify Event/Element: AMITRIPTYLINE ORDER
148 ;
149 ; OCXDF(37) -> PATIENT IEN data field
150 ;
151 N OCXRES
152 S OCXDF(37)=$G(DFN) I $L(OCXDF(37)) S OCXRES(122,37)=OCXDF(37)
153 Q:'(OCXDF(37)) 0 I $D(^TMP("OCXCHK",$J,OCXDF(37),122)) Q $G(^TMP("OCXCHK",$J,OCXDF(37),122))
154 Q 0
155 ;
156MCE123() ; Verify Event/Element: CHLORPROPAMIDE ORDER
157 ;
158 ; OCXDF(37) -> PATIENT IEN data field
159 ;
160 N OCXRES
161 S OCXDF(37)=$G(DFN) I $L(OCXDF(37)) S OCXRES(123,37)=OCXDF(37)
162 Q:'(OCXDF(37)) 0 I $D(^TMP("OCXCHK",$J,OCXDF(37),123)) Q $G(^TMP("OCXCHK",$J,OCXDF(37),123))
163 Q 0
164 ;
165MCE124() ; Verify Event/Element: DIPYRIDAMOLE ORDER
166 ;
167 ; OCXDF(37) -> PATIENT IEN data field
168 ;
169 N OCXRES
170 S OCXDF(37)=$G(DFN) I $L(OCXDF(37)) S OCXRES(124,37)=OCXDF(37)
171 Q:'(OCXDF(37)) 0 I $D(^TMP("OCXCHK",$J,OCXDF(37),124)) Q $G(^TMP("OCXCHK",$J,OCXDF(37),124))
172 Q 0
173 ;
174MCE125() ; Verify Event/Element: MED ORDER FOR PT > 64
175 ;
176 ; OCXDF(37) -> PATIENT IEN data field
177 ;
178 N OCXRES
179 S OCXDF(37)=$G(DFN) I $L(OCXDF(37)) S OCXRES(125,37)=OCXDF(37)
180 Q:'(OCXDF(37)) 0 I $D(^TMP("OCXCHK",$J,OCXDF(37),125)) Q $G(^TMP("OCXCHK",$J,OCXDF(37),125))
181 Q 0
182 ;
183MCE131() ; Verify Event/Element: GREATER THAN LAB THRESHOLD
184 ;
185 ;
186 N OCXRES
187 I $L(OCXDF(37)) S OCXRES(131,37)=OCXDF(37)
188 Q:'(OCXDF(37)) 0 I $D(^TMP("OCXCHK",$J,OCXDF(37),131)) Q $G(^TMP("OCXCHK",$J,OCXDF(37),131))
189 Q 0
190 ;
191MCE132() ; Verify Event/Element: LESS THAN LAB THRESHOLD
192 ;
193 ;
194 N OCXRES
195 I $L(OCXDF(37)) S OCXRES(132,37)=OCXDF(37)
196 Q:'(OCXDF(37)) 0 I $D(^TMP("OCXCHK",$J,OCXDF(37),132)) Q $G(^TMP("OCXCHK",$J,OCXDF(37),132))
197 Q 0
198 ;
199MCE5() ; Verify Event/Element: HL7 FINAL LAB RESULT
200 ;
201 ;
202 N OCXRES
203 I $L(OCXDF(37)) S OCXRES(5,37)=OCXDF(37)
204 Q:'(OCXDF(37)) 0 I $D(^TMP("OCXCHK",$J,OCXDF(37),5)) Q $G(^TMP("OCXCHK",$J,OCXDF(37),5))
205 Q 0
206 ;
Note: See TracBrowser for help on using the repository browser.