1 | OCXDI02K ;SLC/RJS,CLA - OCX PACKAGE DIAGNOSTIC ROUTINES ;SEP 7,1999 at 10:30
|
---|
2 | ;;3.0;ORDER ENTRY/RESULTS REPORTING;**32**;Dec 17,1997
|
---|
3 | ;; ;;ORDER CHECK EXPERT version 1.01 released OCT 29,1998
|
---|
4 | ;
|
---|
5 | S ;
|
---|
6 | ;
|
---|
7 | D DOT^OCXDIAG
|
---|
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("OCXDIAG",$J,$O(^TMP("OCXDIAG",$J,"A"),-1)+1)=TEXT
|
---|
13 | ;
|
---|
14 | G ^OCXDI02L
|
---|
15 | ;
|
---|
16 | Q
|
---|
17 | ;
|
---|
18 | DATA ;
|
---|
19 | ;
|
---|
20 | ;;D^ ; ;
|
---|
21 | ;;R^"860.8:",100,14
|
---|
22 | ;;D^ ; S ZTSAVE("ORN")="" ; notification identifier (required)
|
---|
23 | ;;R^"860.8:",100,15
|
---|
24 | ;;D^ ; S ZTSAVE("ORBDFN")="" ; patient identifier (required)
|
---|
25 | ;;R^"860.8:",100,16
|
---|
26 | ;;D^ ; S ZTSAVE("ORNUM")="" ; order number - used to determine ordering provider
|
---|
27 | ;;R^"860.8:",100,17
|
---|
28 | ;;D^ ; S ZTSAVE("ORBADUZ")="" ; array of package-identified recipients
|
---|
29 | ;;R^"860.8:",100,18
|
---|
30 | ;;D^ ; S ZTSAVE("ORBPMSG")="" ; package-defined message
|
---|
31 | ;;R^"860.8:",100,19
|
---|
32 | ;;D^ ; S ZTSAVE("ORBPDATA")="" ; package-defined data for follow-up action
|
---|
33 | ;;R^"860.8:",100,20
|
---|
34 | ;;D^ ; ;
|
---|
35 | ;;R^"860.8:",100,21
|
---|
36 | ;;D^ ; D ^%ZTLOAD
|
---|
37 | ;;R^"860.8:",100,22
|
---|
38 | ;;D^ ; ;
|
---|
39 | ;;R^"860.8:",100,23
|
---|
40 | ;;D^ ; Q 0
|
---|
41 | ;;R^"860.8:",100,24
|
---|
42 | ;;D^ ; ;
|
---|
43 | ;;EOR^
|
---|
44 | ;;KEY^860.8:^LOCAL TERM LOOKUP
|
---|
45 | ;;R^"860.8:",.01,"E"
|
---|
46 | ;;D^LOCAL TERM LOOKUP
|
---|
47 | ;;R^"860.8:",.02,"E"
|
---|
48 | ;;D^TERMLKUP
|
---|
49 | ;;R^"860.8:",1,1
|
---|
50 | ;;D^
|
---|
51 | ;;R^"860.8:",1,2
|
---|
52 | ;;D^ This function allows a local site to define to Order Checking
|
---|
53 | ;;R^"860.8:",1,3
|
---|
54 | ;;D^ a term specific to that site. (ie. Lab Test Name, Radiology
|
---|
55 | ;;R^"860.8:",1,4
|
---|
56 | ;;D^ procedure name, etc.)
|
---|
57 | ;;R^"860.8:",1,5
|
---|
58 | ;;D^
|
---|
59 | ;;R^"860.8:",100,1
|
---|
60 | ;;D^ ;TERMLKUP(OCXTERM,OCXFILE) ;
|
---|
61 | ;;R^"860.8:",100,2
|
---|
62 | ;;D^ ; ;
|
---|
63 | ;;R^"860.8:",100,3
|
---|
64 | ;;D^ ; Q
|
---|
65 | ;;R^"860.8:",100,4
|
---|
66 | ;;D^ ; ;
|
---|
67 | ;;EOR^
|
---|
68 | ;;KEY^860.8:^GET LOCAL LIST FOR STANDARD TERM
|
---|
69 | ;;R^"860.8:",.01,"E"
|
---|
70 | ;;D^GET LOCAL LIST FOR STANDARD TERM
|
---|
71 | ;;EOR^
|
---|
72 | ;;KEY^860.8:^GENERATE STRING CHECKSUM
|
---|
73 | ;;R^"860.8:",.01,"E"
|
---|
74 | ;;D^GENERATE STRING CHECKSUM
|
---|
75 | ;;R^"860.8:",.02,"E"
|
---|
76 | ;;D^CKSUM
|
---|
77 | ;;R^"860.8:",100,1
|
---|
78 | ;;D^ ;CKSUM(STR) ;
|
---|
79 | ;;R^"860.8:",100,2
|
---|
80 | ;;D^ ; ;
|
---|
81 | ;;R^"860.8:",100,3
|
---|
82 | ;;D^ ; N CKSUM,PTR,ASC S CKSUM=0
|
---|
83 | ;;R^"860.8:",100,4
|
---|
84 | ;;D^ ; S STR=$TR(STR,"abcdefghijklmnopqrstuvwxyz","ABCDEFGHIJKLMNOPQRSTUVWXYZ")
|
---|
85 | ;;R^"860.8:",100,5
|
---|
86 | ;;D^ ; F PTR=$L(STR):-1:1 S ASC=$A(STR,PTR)-42 I (ASC>0),(ASC<51) S CKSUM=CKSUM*2+ASC
|
---|
87 | ;;R^"860.8:",100,6
|
---|
88 | ;;D^ ; Q +CKSUM
|
---|
89 | ;;R^"860.8:",100,7
|
---|
90 | ;;D^ ; ;
|
---|
91 | ;;EOR^
|
---|
92 | ;;KEY^860.8:^EQUALS TERM OPERATOR
|
---|
93 | ;;R^"860.8:",.01,"E"
|
---|
94 | ;;D^EQUALS TERM OPERATOR
|
---|
95 | ;;R^"860.8:",.02,"E"
|
---|
96 | ;;D^EQTERM
|
---|
97 | ;;R^"860.8:",100,1
|
---|
98 | ;;D^ ;EQTERM(DATA,TERM) ;
|
---|
99 | ;;R^"860.8:",100,2
|
---|
100 | ;;D^ ; ;
|
---|
101 | ;;R^"860.8:",100,3
|
---|
102 | ;;D^T+; I $G(OCXTRACE) W !,"%%%%",?20," Execution trace DATA: ",$G(DATA)," TERM: ",$G(TERM)
|
---|
103 | ;;R^"860.8:",100,4
|
---|
104 | ;;D^ ; N OCXF,OCXL
|
---|
105 | ;;R^"860.8:",100,5
|
---|
106 | ;;D^ ; ;
|
---|
107 | ;;R^"860.8:",100,6
|
---|
108 | ;;D^ ; S OCXL="",OCXF=$$TERMLKUP(TERM,.OCXL)
|
---|
109 | ;;R^"860.8:",100,7
|
---|
110 | ;;D^T-; Q:'OCXF 0
|
---|
111 | ;;R^"860.8:",100,8
|
---|
112 | ;;D^T+; I 'OCXF W:$G(OCXTRACE) !,"%%%%",?20," Term '",TERM,"' not in Order Check National Term File" Q 0
|
---|
113 | ;;R^"860.8:",100,9
|
---|
114 | ;;D^T+; I '$O(OCXL(0)) W:$G(OCXTRACE) !,"%%%%",?20," There are no local terms listed for the National Term '",TERM,"'." Q 0
|
---|
115 | ;;R^"860.8:",100,10
|
---|
116 | ;;D^T+; I ($D(OCXL(DATA))!$D(OCXL("B",DATA))) W:$G(OCXTRACE) !,"%%%%",?20," Data equals Term" Q 1
|
---|
117 | ;;R^"860.8:",100,11
|
---|
118 | ;;D^T-; I ($D(OCXL(DATA))!$D(OCXL("B",DATA))) Q 1
|
---|
119 | ;;R^"860.8:",100,12
|
---|
120 | ;;D^T-; Q 0
|
---|
121 | ;;R^"860.8:",100,13
|
---|
122 | ;;D^T+; W:$G(OCXTRACE) !,"%%%%",?20," Data does not equal Term" Q 0
|
---|
123 | ;;R^"860.8:",100,14
|
---|
124 | ;;D^ ; ;
|
---|
125 | ;;EOR^
|
---|
126 | ;;KEY^860.8:^RECENT CREATININE LAB PROCEDURE
|
---|
127 | ;;R^"860.8:",.01,"E"
|
---|
128 | ;;D^RECENT CREATININE LAB PROCEDURE
|
---|
129 | ;;R^"860.8:",.02,"E"
|
---|
130 | ;;D^RECCREAT
|
---|
131 | ;;R^"860.8:",100,1
|
---|
132 | ;;D^ ;RECCREAT(ORDFN,ORDAYS) ;extrinsic function to return most recent
|
---|
133 | ;;R^"860.8:",100,2
|
---|
134 | ;;D^ ; ;SERUM CREATININE within <ORDAYS> in format:
|
---|
135 | ;;R^"860.8:",100,3
|
---|
136 | ;;D^ ; ; test id^result units flag ref range collection d/t
|
---|
137 | ;;R^"860.8:",100,4
|
---|
138 | ;;D^ ; N BDT,CDT,ORY,ORX,ORZ,X,TEST,ORI,ORJ,CREARSLT,LABFILE,SPECFILE
|
---|
139 | ;;R^"860.8:",100,5
|
---|
140 | ;;D^ ; Q:'$L($G(ORDFN)) "0^"
|
---|
141 | ;;R^"860.8:",100,6
|
---|
142 | ;;D^ ; Q:'$L($G(ORDAYS)) "0^"
|
---|
143 | ;;R^"860.8:",100,7
|
---|
144 | ;;D^ ; D NOW^%DTC
|
---|
145 | ;;R^"860.8:",100,8
|
---|
146 | ;;D^ ; S BDT=$$FMADD^XLFDT(%,"-"_ORDAYS,"","","")
|
---|
147 | ;;R^"860.8:",100,9
|
---|
148 | ;;D^ ; K %
|
---|
149 | ;;R^"860.8:",100,10
|
---|
150 | ;;D^ ; Q:'$L($G(BDT)) "0^"
|
---|
151 | ;;R^"860.8:",100,11
|
---|
152 | ;;D^ ; S LABFILE=$$TERMLKUP^ORB31(.ORY,"SERUM CREATININE")
|
---|
153 | ;;R^"860.8:",100,12
|
---|
154 | ;;D^ ; Q:$G(LABFILE)'=60 "0^"
|
---|
155 | ;;R^"860.8:",100,13
|
---|
156 | ;;D^ ; S SPECFILE=$$TERMLKUP^ORB31(.ORX,"SERUM SPECIMEN")
|
---|
157 | ;;R^"860.8:",100,14
|
---|
158 | ;;D^ ; Q:$G(SPECFILE)'=61 "0^"
|
---|
159 | ;;R^"860.8:",100,15
|
---|
160 | ;;D^ ; F ORI=1:1:ORY I +$G(CREARSLT)<1 D
|
---|
161 | ;;R^"860.8:",100,16
|
---|
162 | ;;D^ ; .S TEST=$P(ORY(ORI),U)
|
---|
163 | ;;R^"860.8:",100,17
|
---|
164 | ;;D^ ; .Q:+$G(TEST)<1
|
---|
165 | ;;R^"860.8:",100,18
|
---|
166 | ;;D^ ; .F ORJ=1:1:ORX I +$G(CREARSLT)<1 D
|
---|
167 | ;;R^"860.8:",100,19
|
---|
168 | ;;D^ ; ..S SPECIMEN=$P(ORX(ORJ),U)
|
---|
169 | ;;R^"860.8:",100,20
|
---|
170 | ;;D^ ; ..Q:+$G(SPECIMEN)<1
|
---|
171 | ;;R^"860.8:",100,21
|
---|
172 | ;;D^ ; ..S ORZ=$$LOCL^ORQQLR1(ORDFN,TEST,SPECIMEN)
|
---|
173 | ;;R^"860.8:",100,22
|
---|
174 | ;;D^ ; ..Q:'$L($G(ORZ))
|
---|
175 | ;;R^"860.8:",100,23
|
---|
176 | ;;D^ ; ..S CDT=$P(ORZ,U,7)
|
---|
177 | ;1;
|
---|
178 | ;
|
---|