source: WorldVistAEHR/trunk/r/ORDER_ENTRY_RESULTS_REPORTING-OR-OCX--ORRC--ORRJ/ORY22108.m@ 1042

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

initial load of WorldVistAEHR

File size: 7.2 KB
Line 
1ORY22108 ;SLC/RJS,CLA - OCX PACKAGE RULE TRANSPORT ROUTINE (Delete after Install of OR*3*221) ;AUG 30,2005 at 11:41
2 ;;3.0;ORDER ENTRY/RESULTS REPORTING;**221**;Dec 17,1997
3 ;; ;;ORDER CHECK EXPERT version 1.01 released OCT 29,1998
4 ;
5S ;
6 ;
7 D DOT^ORY221ES
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 ^ORY22109
15 ;
16 Q
17 ;
18DATA ;
19 ;
20 ;;R^"860.8:",100,4
21 ;;D^ ; N OCXF,OCXL
22 ;;R^"860.8:",100,5
23 ;;D^ ; ;
24 ;;R^"860.8:",100,6
25 ;;D^ ; S OCXL="",OCXF=$$TERMLKUP(TERM,.OCXL)
26 ;;R^"860.8:",100,7
27 ;;D^T-; Q:'OCXF 0
28 ;;R^"860.8:",100,8
29 ;;D^T+; I 'OCXF W:$G(OCXTRACE) !,"%%%%",?20," Term '",TERM,"' not in Order Check National Term File" Q 0
30 ;;R^"860.8:",100,9
31 ;;D^T+; I '$O(OCXL(0)) W:$G(OCXTRACE) !,"%%%%",?20," There are no local terms listed for the National Term '",TERM,"'." Q 0
32 ;;R^"860.8:",100,10
33 ;;D^T+; I ($D(OCXL(DATA))!$D(OCXL("B",DATA))) W:$G(OCXTRACE) !,"%%%%",?20," Data equals Term" Q 1
34 ;;R^"860.8:",100,11
35 ;;D^T-; I ($D(OCXL(DATA))!$D(OCXL("B",DATA))) Q 1
36 ;;R^"860.8:",100,12
37 ;;D^T-; Q 0
38 ;;R^"860.8:",100,13
39 ;;D^T+; W:$G(OCXTRACE) !,"%%%%",?20," Data does not equal Term" Q 0
40 ;;R^"860.8:",100,14
41 ;;D^ ; ;
42 ;;EOR^
43 ;;KEY^860.8:^FILE DATA IN PATIENT ACTIVE DATA FILE
44 ;;R^"860.8:",.01,"E"
45 ;;D^FILE DATA IN PATIENT ACTIVE DATA FILE
46 ;;R^"860.8:",.02,"E"
47 ;;D^FILE
48 ;;R^"860.8:",1,1
49 ;;D^ ;FILE(DFN,OCXELE,OCXDFL) ; This Local Extrinsic Function files data
50 ;;R^"860.8:",1,2
51 ;;D^ ; ; in the Order Check Patient Data File
52 ;;R^"860.8:",1,3
53 ;;D^ ; ;
54 ;;R^"860.8:",100,1
55 ;;D^ ;FILE(DFN,OCXELE,OCXDFL) ; This Local Extrinsic Function logs a validated event/element.
56 ;;R^"860.8:",100,2
57 ;;D^ ; ;
58 ;;R^"860.8:",100,3
59 ;;D^T+; I $G(OCXTRACE) W !,"%%%%",?20," Execution trace DFN: ",DFN," OCXELE: ",+$G(OCXELE)," OCXDFL: ",$G(OCXDFL)
60 ;;R^"860.8:",100,4
61 ;;D^ ; N OCXTIMN,OCXTIML,OCXTIMT1,OCXTIMT2,OCXDATA,OCXPC,OCXPC,OCXVAL,OCXSUB,OCXDFI
62 ;;R^"860.8:",100,5
63 ;;D^ ; S DFN=+$G(DFN),OCXELE=+$G(OCXELE)
64 ;;R^"860.8:",100,6
65 ;;D^ ; ;
66 ;;R^"860.8:",100,7
67 ;;D^ ; Q:'DFN 1 Q:'OCXELE 1 K OCXDATA
68 ;;R^"860.8:",100,8
69 ;;D^ ; ;
70 ;;R^"860.8:",100,9
71 ;;D^ ; S OCXDATA(DFN,OCXELE)=1
72 ;;R^"860.8:",100,10
73 ;;D^ ; F OCXPC=1:1:$L(OCXDFL,",") S OCXDFI=$P(OCXDFL,",",OCXPC) I OCXDFI D
74 ;;R^"860.8:",100,11
75 ;;D^ ; .S OCXVAL=$G(OCXDF(+OCXDFI)),OCXDATA(DFN,OCXELE,+OCXDFI)=OCXVAL
76 ;;R^"860.8:",100,12
77 ;;D^T+; .I $G(OCXTRACE) W !,"%%%%",?20," ",$P($G(^OCXS(860.4,+OCXDFI,0)),U,1)," = """,OCXVAL,""""
78 ;;R^"860.8:",100,13
79 ;;D^ ; ;
80 ;;R^"860.8:",100,14
81 ;;D^ ; M ^TMP("OCXCHK",$J,DFN)=OCXDATA(DFN)
82 ;;R^"860.8:",100,15
83 ;;D^ ; ;
84 ;;R^"860.8:",100,16
85 ;;D^ ; Q 0
86 ;;R^"860.8:",100,17
87 ;;D^ ; ;
88 ;;EOR^
89 ;;KEY^860.8:^FORMATTED LAB RESULTS
90 ;;R^"860.8:",.01,"E"
91 ;;D^FORMATTED LAB RESULTS
92 ;;R^"860.8:",.02,"E"
93 ;;D^FLAB
94 ;;R^"860.8:",100,1
95 ;;D^ ;FLAB(DFN,OCXLIST,OCXSPEC) ;
96 ;;R^"860.8:",100,2
97 ;;D^ ; ;
98 ;;R^"860.8:",100,3
99 ;;D^ ; Q:'$G(DFN) "<Patient Not Specified>"
100 ;;R^"860.8:",100,4
101 ;;D^ ; Q:'$L($G(OCXLIST)) "<Lab Tests Not Specified>"
102 ;;R^"860.8:",100,5
103 ;;D^ ; N OCXLAB,OCXOUT,OCXPC,OCXSL,SPEC S OCXOUT="",SPEC=""
104 ;;R^"860.8:",100,6
105 ;;D^ ; I $L($G(OCXSPEC)) S OCXSL=$$TERMLKUP(OCXSPEC,.OCXSL)
106 ;;R^"860.8:",100,7
107 ;;D^ ; F OCXPC=1:1:$L(OCXLIST,U) S OCXLAB=$P(OCXLIST,U,OCXPC) I $L(OCXLAB) D
108 ;;R^"860.8:",100,8
109 ;;D^ ; .N OCXX,OCXY,X,Y,DIC,TEST,SPEC,OCXTL,OCXA,OCXR
110 ;;R^"860.8:",100,9
111 ;;D^ ; .S OCXTL="" Q:'$$TERMLKUP(OCXLAB,.OCXTL)
112 ;;R^"860.8:",100,10
113 ;;D^ ; .S OCXX="",TEST=0 F S TEST=$O(OCXTL(TEST)) Q:'TEST D
114 ;;R^"860.8:",100,11
115 ;;D^ ; ..I $L($G(OCXSL)) D
116 ;;R^"860.8:",100,12
117 ;;D^ ; ...S SPEC=0 F S SPEC=$O(OCXSL(SPEC)) Q:'SPEC D
118 ;;R^"860.8:",100,13
119 ;;D^ ; ....S OCXX=$$LOCL^ORQQLR1(DFN,TEST,SPEC) I $L(OCXX) D
120 ;;R^"860.8:",100,14
121 ;;D^ ; .....S OCXA($P(OCXX,U,7))=OCXX
122 ;;R^"860.8:",100,15
123 ;;D^ ; ..I '$L($G(OCXSL)) S OCXX=$$LOCL^ORQQLR1(DFN,TEST,"")
124 ;;R^"860.8:",100,16
125 ;;D^ ; ..Q:'$L(OCXX)
126 ;;R^"860.8:",100,17
127 ;;D^ ; .I $D(OCXA) S OCXR="",OCXR=$O(OCXA(OCXR),-1),OCXX=OCXA(OCXR)
128 ;;R^"860.8:",100,18
129 ;;D^ ; .I $L(OCXX) D
130 ;;R^"860.8:",100,19
131 ;;D^ ; ..S OCXY=$P(OCXX,U,2)_": "_$P(OCXX,U,3)_" "_$P(OCXX,U,4)
132 ;;R^"860.8:",100,20
133 ;;D^ ; ..S OCXY=OCXY_" "_$S($L($P(OCXX,U,5)):"["_$P(OCXX,U,5)_"]",1:"")
134 ;;R^"860.8:",100,21
135 ;;D^ ; ..I $L($P(OCXX,U,7)) S OCXY=OCXY_" "_$$FMTE^XLFDT($P(OCXX,U,7),"2P")
136 ;;R^"860.8:",100,22
137 ;;D^ ; .S:$L(OCXOUT) OCXOUT=OCXOUT_" " S OCXOUT=OCXOUT_$G(OCXY)
138 ;;R^"860.8:",100,23
139 ;;D^ ; Q:'$L(OCXOUT) "<Results Not Found>" Q OCXOUT
140 ;;R^"860.8:",100,24
141 ;;D^ ; ;
142 ;;EOR^
143 ;;KEY^860.8:^GENERATE STRING CHECKSUM
144 ;;R^"860.8:",.01,"E"
145 ;;D^GENERATE STRING CHECKSUM
146 ;;R^"860.8:",.02,"E"
147 ;;D^CKSUM
148 ;;R^"860.8:",100,1
149 ;;D^ ;CKSUM(STR) ;
150 ;;R^"860.8:",100,2
151 ;;D^ ; ;
152 ;;R^"860.8:",100,3
153 ;;D^ ; N CKSUM,PTR,ASC S CKSUM=0
154 ;;R^"860.8:",100,4
155 ;;D^ ; S STR=$TR(STR,"abcdefghijklmnopqrstuvwxyz","ABCDEFGHIJKLMNOPQRSTUVWXYZ")
156 ;;R^"860.8:",100,5
157 ;;D^ ; F PTR=$L(STR):-1:1 S ASC=$A(STR,PTR)-42 I (ASC>0),(ASC<51) S CKSUM=CKSUM*2+ASC
158 ;;R^"860.8:",100,6
159 ;;D^ ; Q +CKSUM
160 ;;R^"860.8:",100,7
161 ;;D^ ; ;
162 ;;EOR^
163 ;;KEY^860.8:^GET DATA FROM THE ACTIVE DATA FILE
164 ;;R^"860.8:",.01,"E"
165 ;;D^GET DATA FROM THE ACTIVE DATA FILE
166 ;;R^"860.8:",.02,"E"
167 ;;D^GETDATA
168 ;;R^"860.8:",100,1
169 ;;D^ ;GETDATA(DFN,OCXL,OCXDFI) ; This Local Extrinsic Function returns runtime data
170 ;;R^"860.8:",100,2
171 ;;D^ ; ;
172 ;;R^"860.8:",100,3
173 ;;D^ ; N OCXE,VAL,PC S VAL=""
174 ;;R^"860.8:",100,4
175 ;;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)
176 ;;R^"860.8:",100,5
177 ;;D^ ; Q VAL
178 ;;R^"860.8:",100,6
179 ;;D^ ; ;
180 ;;EOR^
181 ;;KEY^860.8:^IN LIST OPERATOR
182 ;;R^"860.8:",.01,"E"
183 ;;D^IN LIST OPERATOR
184 ;;R^"860.8:",.02,"E"
185 ;;D^LIST
186 ;;R^"860.8:",100,1
187 ;;D^ ;LIST(DATA,LIST) ; IS THE DATA FIELD IN THE LIST
188 ;;R^"860.8:",100,2
189 ;;D^ ; ;
190 ;;R^"860.8:",100,3
191 ;;D^T+; W:$G(OCXTRACE) !,"%%%%",?20," $$LIST(""",DATA,""",""",LIST,""")"
192 ;;R^"860.8:",100,4
193 ;;D^ ; S:'($E(LIST,1)=",") LIST=","_LIST S:'($E(LIST,$L(LIST))=",") LIST=LIST_"," S DATA=","_DATA_","
194 ;;R^"860.8:",100,5
195 ;;D^ ; Q (LIST[DATA)
196 ;;R^"860.8:",100,6
197 ;;D^ ; ;
198 ;;EOR^
199 ;;KEY^860.8:^LOCAL TERM LOOKUP
200 ;;R^"860.8:",.01,"E"
201 ;;D^LOCAL TERM LOOKUP
202 ;;R^"860.8:",.02,"E"
203 ;;D^TERMLKUP
204 ;;R^"860.8:",1,1
205 ;;D^
206 ;;R^"860.8:",1,2
207 ;;D^ This function allows a local site to define to Order Checking
208 ;;R^"860.8:",1,3
209 ;;D^ a term specific to that site. (ie. Lab Test Name, Radiology
210 ;;R^"860.8:",1,4
211 ;;D^ procedure name, etc.)
212 ;;R^"860.8:",1,5
213 ;;D^
214 ;;R^"860.8:",100,1
215 ;;D^ ;TERMLKUP(OCXTERM,OCXFILE) ;
216 ;;R^"860.8:",100,2
217 ;;D^ ; ;
218 ;;R^"860.8:",100,3
219 ;;D^ ; Q
220 ;;R^"860.8:",100,4
221 ;;D^ ; ;
222 ;;EOR^
223 ;;KEY^860.8:^NEW RULE MESSAGE
224 ;;R^"860.8:",.01,"E"
225 ;;D^NEW RULE MESSAGE
226 ;;R^"860.8:",.02,"E"
227 ;;D^NEWRULE
228 ;;R^"860.8:",100,1
229 ;;D^ ;NEWRULE(OCXDFN,OCXORD,OCXRUL,OCXREL,OCXNOTF,OCXMESS) ; Has this rule already been triggered for this order number
230 ;;R^"860.8:",100,2
231 ;;D^ ; ;
232 ;;R^"860.8:",100,3
233 ;;D^L+; S OCXERR=$$TIMELOG("M","NEWRULE("_(+$G(OCXDFN))_","_(+$G(OCXORD))_","_(+$G(OCXRUL))_","_(+$G(OCXREL))_","_(+$G(OCXNOTF))_","_$G(OCXMESS)_")")
234 ;;R^"860.8:",100,4
235 ;;D^ ; ;
236 ;;R^"860.8:",100,5
237 ;;D^ ; Q:'$G(OCXDFN) 0 Q:'$G(OCXRUL) 0
238 ;;R^"860.8:",100,6
239 ;;D^ ; Q:'$G(OCXREL) 0 Q:'$G(OCXNOTF) 0 Q:'$L($G(OCXMESS)) 0
240 ;1;
241 ;
Note: See TracBrowser for help on using the repository browser.