source: WorldVistAEHR/trunk/r/ORDER_ENTRY_RESULTS_REPORTING-OR-OCX--ORRC--ORRJ/ORY24306.m@ 771

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

initial load of WorldVistAEHR

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