source: WorldVistAEHR/trunk/r/ORDER_ENTRY_RESULTS_REPORTING-OR-OCX--ORRC--ORRJ/ORY14405.m@ 1375

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

initial load of WorldVistAEHR

File size: 7.3 KB
RevLine 
[613]1ORY14405 ;SLC/RJS,CLA - OCX PACKAGE RULE TRANSPORT ROUTINE (Delete after Install of OR*3*144) ;JUN 12,2002 at 12:20
2 ;;3.0;ORDER ENTRY/RESULTS REPORTING;**144**;Dec 17,1997
3 ;; ;;ORDER CHECK EXPERT version 1.01 released OCT 29,1998
4 ;
5S ;
6 ;
7 D DOT^ORY144ES
8 ;
9 ;
10 K REMOTE,LOCAL,OPCODE,REF
11 F LINE=1:1:500 S TEXT=$P($T(DATA+LINE),";",2,999) Q:TEXT I $L(TEXT) D Q:QUIT
12 .S ^TMP("OCXRULE",$J,$O(^TMP("OCXRULE",$J,"A"),-1)+1)=TEXT
13 ;
14 G ^ORY14406
15 ;
16 Q
17 ;
18DATA ;
19 ;
20 ;;D^GENERATE STRING CHECKSUM
21 ;;R^"860.8:",.02,"E"
22 ;;D^CKSUM
23 ;;R^"860.8:",100,1
24 ;;D^ ;CKSUM(STR) ;
25 ;;R^"860.8:",100,2
26 ;;D^ ; ;
27 ;;R^"860.8:",100,3
28 ;;D^ ; N CKSUM,PTR,ASC S CKSUM=0
29 ;;R^"860.8:",100,4
30 ;;D^ ; S STR=$TR(STR,"abcdefghijklmnopqrstuvwxyz","ABCDEFGHIJKLMNOPQRSTUVWXYZ")
31 ;;R^"860.8:",100,5
32 ;;D^ ; F PTR=$L(STR):-1:1 S ASC=$A(STR,PTR)-42 I (ASC>0),(ASC<51) S CKSUM=CKSUM*2+ASC
33 ;;R^"860.8:",100,6
34 ;;D^ ; Q +CKSUM
35 ;;R^"860.8:",100,7
36 ;;D^ ; ;
37 ;;EOR^
38 ;;KEY^860.8:^GET DATA FROM THE ACTIVE DATA FILE
39 ;;R^"860.8:",.01,"E"
40 ;;D^GET DATA FROM THE ACTIVE DATA FILE
41 ;;R^"860.8:",.02,"E"
42 ;;D^GETDATA
43 ;;R^"860.8:",100,1
44 ;;D^ ;GETDATA(DFN,OCXL,OCXDFI) ; This Local Extrinsic Function returns runtime data
45 ;;R^"860.8:",100,2
46 ;;D^ ; ;
47 ;;R^"860.8:",100,3
48 ;;D^ ; N OCXE,VAL,PC S VAL=""
49 ;;R^"860.8:",100,4
50 ;;D^ ; 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)
51 ;;R^"860.8:",100,5
52 ;;D^ ; Q VAL
53 ;;R^"860.8:",100,6
54 ;;D^ ; ;
55 ;;EOR^
56 ;;KEY^860.8:^IN LIST OPERATOR
57 ;;R^"860.8:",.01,"E"
58 ;;D^IN LIST OPERATOR
59 ;;R^"860.8:",.02,"E"
60 ;;D^LIST
61 ;;R^"860.8:",100,1
62 ;;D^ ;LIST(DATA,LIST) ; IS THE DATA FIELD IN THE LIST
63 ;;R^"860.8:",100,2
64 ;;D^ ; ;
65 ;;R^"860.8:",100,3
66 ;;D^T+; W:$G(OCXTRACE) !,"%%%%",?20," $$LIST(""",DATA,""",""",LIST,""")"
67 ;;R^"860.8:",100,4
68 ;;D^ ; S:'($E(LIST,1)=",") LIST=","_LIST S:'($E(LIST,$L(LIST))=",") LIST=LIST_"," S DATA=","_DATA_","
69 ;;R^"860.8:",100,5
70 ;;D^ ; Q (LIST[DATA)
71 ;;R^"860.8:",100,6
72 ;;D^ ; ;
73 ;;EOR^
74 ;;KEY^860.8:^LAB THRESHOLD EXCEEDED BOOLEAN
75 ;;R^"860.8:",.01,"E"
76 ;;D^LAB THRESHOLD EXCEEDED BOOLEAN
77 ;;R^"860.8:",.02,"E"
78 ;;D^LABTHRSB
79 ;;R^"860.8:",1,1
80 ;;D^Extrinsic function returns "1" if any entity has a parameter threshold
81 ;;R^"860.8:",1,2
82 ;;D^value that is exceeded by the lab result.
83 ;;R^"860.8:",100,1
84 ;;D^ ;LABTHRSB(OCXLAB,OCXSPEC,OCXRSLT,OCXOP) ;
85 ;;R^"860.8:",100,2
86 ;;D^ ; ;
87 ;;R^"860.8:",100,3
88 ;;D^ ; Q:'$G(OCXLAB)!'$G(OCXSPEC)!'$G(OCXRSLT)!'$L($G(OCXOP)) 0
89 ;;R^"860.8:",100,4
90 ;;D^ ; ;
91 ;;R^"860.8:",100,5
92 ;;D^ ; N OCXX,OCXPENT,OCXERR,OCXLABSP,OCXPVAL,OCXEXCD
93 ;;R^"860.8:",100,6
94 ;;D^ ; S OCXEXCD=0,OCXLABSP=OCXLAB_";"_OCXSPEC
95 ;;R^"860.8:",100,7
96 ;;D^ ; D ENVAL^XPAR(.OCXX,"ORB LAB "_OCXOP_" THRESHOLD",OCXLABSP,.OCXERR)
97 ;;R^"860.8:",100,8
98 ;;D^T+; I $G(OCXTRACE) W !,"Lab parameter values:",! ZW OCXX,OCXERR
99 ;;R^"860.8:",100,9
100 ;;D^ ; Q:+$G(ORERR)'=0 OCXEXCD
101 ;;R^"860.8:",100,10
102 ;;D^ ; Q:+$G(OCXX)=0 OCXEXCD
103 ;;R^"860.8:",100,11
104 ;;D^ ; S OCXPENT="" F S OCXPENT=$O(OCXX(OCXPENT)) Q:'OCXPENT!OCXEXCD=1 D
105 ;;R^"860.8:",100,12
106 ;;D^ ; .S OCXPVAL=OCXX(OCXPENT,OCXLABSP)
107 ;;R^"860.8:",100,13
108 ;;D^ ; .I $L(OCXPVAL) D
109 ;;R^"860.8:",100,14
110 ;;D^ ; ..I $P(OCXPENT,";",2)="VA(200,",@((+OCXRSLT)_OCXOP_OCXPVAL) D
111 ;;R^"860.8:",100,15
112 ;;D^ ; ...S OCXEXCD=1
113 ;;R^"860.8:",100,16
114 ;;D^ ; Q OCXEXCD
115 ;;EOR^
116 ;;KEY^860.8:^LOCAL TERM LOOKUP
117 ;;R^"860.8:",.01,"E"
118 ;;D^LOCAL TERM LOOKUP
119 ;;R^"860.8:",.02,"E"
120 ;;D^TERMLKUP
121 ;;R^"860.8:",1,1
122 ;;D^
123 ;;R^"860.8:",1,2
124 ;;D^ This function allows a local site to define to Order Checking
125 ;;R^"860.8:",1,3
126 ;;D^ a term specific to that site. (ie. Lab Test Name, Radiology
127 ;;R^"860.8:",1,4
128 ;;D^ procedure name, etc.)
129 ;;R^"860.8:",1,5
130 ;;D^
131 ;;R^"860.8:",100,1
132 ;;D^ ;TERMLKUP(OCXTERM,OCXFILE) ;
133 ;;R^"860.8:",100,2
134 ;;D^ ; ;
135 ;;R^"860.8:",100,3
136 ;;D^ ; Q
137 ;;R^"860.8:",100,4
138 ;;D^ ; ;
139 ;;EOR^
140 ;;KEY^860.8:^NEW RULE MESSAGE
141 ;;R^"860.8:",.01,"E"
142 ;;D^NEW RULE MESSAGE
143 ;;R^"860.8:",.02,"E"
144 ;;D^NEWRULE
145 ;;R^"860.8:",100,1
146 ;;D^ ;NEWRULE(OCXDFN,OCXORD,OCXRUL,OCXREL,OCXNOTF,OCXMESS) ; Has this rule already been triggered for this order number
147 ;;R^"860.8:",100,2
148 ;;D^ ; ;
149 ;;R^"860.8:",100,3
150 ;;D^L+; S OCXERR=$$TIMELOG("M","NEWRULE("_(+$G(OCXDFN))_","_(+$G(OCXORD))_","_(+$G(OCXRUL))_","_(+$G(OCXREL))_","_(+$G(OCXNOTF))_","_$G(OCXMESS)_")")
151 ;;R^"860.8:",100,4
152 ;;D^ ; ;
153 ;;R^"860.8:",100,5
154 ;;D^ ; Q:'$G(OCXDFN) 0 Q:'$G(OCXRUL) 0
155 ;;R^"860.8:",100,6
156 ;;D^ ; Q:'$G(OCXREL) 0 Q:'$G(OCXNOTF) 0 Q:'$L($G(OCXMESS)) 0
157 ;;R^"860.8:",100,7
158 ;;D^ ; S OCXORD=+$G(OCXORD),OCXDFN=+OCXDFN
159 ;;R^"860.8:",100,8
160 ;;D^ ; ;
161 ;;R^"860.8:",100,9
162 ;;D^ ; N OCXNDX,OCXDATA,OCXDFI,OCXELE,OCXGR,OCXTIME,OCXCKSUM
163 ;;R^"860.8:",100,10
164 ;;D^ ; ;
165 ;;R^"860.8:",100,11
166 ;;D^ ; S OCXTIME=(+$H)
167 ;;R^"860.8:",100,12
168 ;;D^ ; S OCXCKSUM=$$CKSUM(OCXMESS)
169 ;;R^"860.8:",100,13
170 ;;D^ ; ;
171 ;;R^"860.8:",100,14
172 ;;D^ ; Q:$D(^OCXD(860.7,"AT",OCXTIME,OCXDFN,OCXRUL,+OCXORD,OCXCKSUM)) 0
173 ;;R^"860.8:",100,15
174 ;;D^ ; ;
175 ;;R^"860.8:",100,16
176 ;;D^ ; K OCXDATA
177 ;;R^"860.8:",100,17
178 ;;D^ ; S OCXDATA(OCXDFN,0)=OCXDFN
179 ;;R^"860.8:",100,18
180 ;;D^ ; S OCXDATA("B",OCXDFN,OCXDFN)=""
181 ;;R^"860.8:",100,19
182 ;;D^ ; S OCXDATA("AT",OCXTIME,OCXDFN,OCXRUL,+OCXORD,OCXCKSUM)=""
183 ;;R^"860.8:",100,20
184 ;;D^ ; ;
185 ;;R^"860.8:",100,21
186 ;;D^ ; S OCXGR="^OCXD(860.7"
187 ;;R^"860.8:",100,22
188 ;;D^T+; D SETAP(OCXGR_")",0,"Patient",$P($G(^DPT(OCXDFN,0)),U,1),.OCXDATA,OCXDFN)
189 ;;R^"860.8:",100,23
190 ;;D^T-; D SETAP(OCXGR_")",0,.OCXDATA,OCXDFN)
191 ;;R^"860.8:",100,24
192 ;;D^ ; ;
193 ;;R^"860.8:",100,25
194 ;;D^ ; K OCXDATA
195 ;;R^"860.8:",100,26
196 ;;D^ ; S OCXDATA(OCXRUL,0)=OCXRUL_U_(OCXTIME)_U_(+OCXORD)
197 ;;R^"860.8:",100,27
198 ;;D^ ; S OCXDATA(OCXRUL,"M")=OCXMESS
199 ;;R^"860.8:",100,28
200 ;;D^ ; S OCXDATA("B",OCXRUL,OCXRUL)=""
201 ;;R^"860.8:",100,29
202 ;;D^ ; S OCXGR=OCXGR_","_OCXDFN_",1"
203 ;;R^"860.8:",100,30
204 ;;D^T+; D SETAP(OCXGR_")","860.71P","Rule",$P($G(^OCXS(860.2,OCXRUL,0)),U,1),.OCXDATA,OCXRUL)
205 ;;R^"860.8:",100,31
206 ;;D^T-; D SETAP(OCXGR_")","860.71P",.OCXDATA,OCXRUL)
207 ;;R^"860.8:",100,32
208 ;;D^ ; ;
209 ;;R^"860.8:",100,33
210 ;;D^ ; K OCXDATA
211 ;;R^"860.8:",100,34
212 ;;D^ ; S OCXDATA(OCXREL,0)=OCXREL
213 ;;R^"860.8:",100,35
214 ;;D^ ; S OCXDATA("B",OCXREL,OCXREL)=""
215 ;;R^"860.8:",100,36
216 ;;D^ ; S OCXGR=OCXGR_","_OCXRUL_",1"
217 ;;R^"860.8:",100,37
218 ;;D^T+; D SETAP(OCXGR_")","860.712","Relation",OCXREL,.OCXDATA,OCXREL)
219 ;;R^"860.8:",100,38
220 ;;D^T-; D SETAP(OCXGR_")","860.712",.OCXDATA,OCXREL)
221 ;;R^"860.8:",100,39
222 ;;D^ ; ;
223 ;;R^"860.8:",100,40
224 ;;D^ ; S OCXELE=0 F S OCXELE=$O(^OCXS(860.2,OCXRUL,"C","C",OCXELE)) Q:'OCXELE D
225 ;;R^"860.8:",100,41
226 ;;D^ ; .;
227 ;;R^"860.8:",100,42
228 ;;D^ ; .N OCXGR1
229 ;;R^"860.8:",100,43
230 ;;D^ ; .S OCXGR1=OCXGR_","_OCXREL_",1"
231 ;;R^"860.8:",100,44
232 ;;D^ ; .K OCXDATA
233 ;;R^"860.8:",100,45
234 ;;D^ ; .S OCXDATA(OCXELE,0)=OCXELE
235 ;;R^"860.8:",100,46
236 ;;D^ ; .S OCXDATA(OCXELE,"TIME")=OCXTIME
237 ;;R^"860.8:",100,47
238 ;;D^ ; .S OCXDATA(OCXELE,"LOG")=$G(OCXOLOG)
239 ;;R^"860.8:",100,48
240 ;;D^ ; .S OCXDATA("B",OCXELE,OCXELE)=""
241 ;;R^"860.8:",100,49
242 ;;D^ ; .K ^OCXD(860.7,OCXDFN,1,OCXRUL,1,OCXREL,1,OCXELE)
243 ;;R^"860.8:",100,50
244 ;;D^T+; .D SETAP(OCXGR1_")","860.7122P","Element",$P($G(^OCXS(860.3,OCXELE,0)),U,1),.OCXDATA,OCXELE)
245 ;;R^"860.8:",100,51
246 ;;D^T-; .D SETAP(OCXGR1_")","860.7122P",.OCXDATA,OCXELE)
247 ;;R^"860.8:",100,52
248 ;;D^ ; .;
249 ;;R^"860.8:",100,53
250 ;;D^ ; .S OCXDFI=0 F S OCXDFI=$O(^TMP("OCXCHK",$J,OCXDFN,OCXELE,OCXDFI)) Q:'OCXDFI D
251 ;1;
252 ;
Note: See TracBrowser for help on using the repository browser.