source: WorldVistAEHR/trunk/r/AUTOMATED_LAB_INSTRUMENTS-LA/LA7VORC.m@ 738

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

initial load of WorldVistAEHR

File size: 4.6 KB
RevLine 
[613]1LA7VORC ;DALOI/JMC - LAB ORC Segment message builder ; 11-17-98
2 ;;5.2;AUTOMATED LAB INSTRUMENTS;**46,64**;Sep 27, 1994
3 ;
4 Q
5 ;
6ORC1(LA7TYP) ; Build ORC-1 sequence - Order control
7 ; Call with LA7TYP = order type from table 0119
8 ;
9 Q LA7TYP
10 ;
11 ;
12ORC2(LA7VAL,LA7FS,LA7ECH) ; Build ORC-2 sequence - Placer order number
13 ; Call with LA7VAL = accession number/UID
14 ; LA7FS = HL field separator
15 ; LA7ECH = HL encoding characters
16 N LA7Y
17 ;
18 S $P(LA7Y,$E(LA7ECH),1)=$$CHKDATA^LA7VHLU3(LA7VAL,LA7FS_LA7ECH)
19 ;
20 Q LA7Y
21 ;
22 ;
23ORC3(LA7VAL,LA7FS,LA7ECH) ; Build ORC-3 sequence - Filler order number
24 ; Call with LA7VAL = accession number/UID
25 ; LA7FS = HL field separator
26 ; LA7ECH = HL encoding characters
27 N LA7Y
28 ;
29 S $P(LA7Y,$E(LA7ECH),1)=$$CHKDATA^LA7VHLU3(LA7VAL,LA7FS_LA7ECH)
30 ;
31 Q LA7Y
32 ;
33 ;
34ORC4(LA7VAL,LA7FS,LA7ECH) ; Build ORC-4 sequence - Placer group number
35 ; Call with LA7VAL = LEDI - shipping manifest number
36 ; LA7FS = HL field separator
37 ; LA7ECH = HL encoding characters
38 ; Returns ORD-4 sequence
39 ;
40 N LA7Y
41 ;
42 S $P(LA7Y,$E(LA7ECH),1)=$$CHKDATA^LA7VHLU3(LA7VAL,LA7FS_LA7ECH)
43 ;
44 Q LA7Y
45 ;
46 ;
47ORC5(LA7VAL,LA7FS,LA7ECH) ; Build ORC-5 sequence - Order status
48 ; Call with LA7VAL = order status
49 ; LA7FS = HL field separator
50 ; LA7ECH = HL encoding characters
51 ; Returns ORC-5 sequence
52 ;
53 N LA7Y
54 ;
55 I LA7VAL="CM" S LA7Y="CM"
56 ;
57 Q LA7Y
58 ;
59 ;
60ORC7(LA7DUR,LA7DURU,LA76205,LA7FS,LA7ECH) ; Build ORC-7 sequence - Quantity/Timing
61 ; Call with LA7DUR = collection duration
62 ; LA7DURU = duration units (pointer to #64.061)
63 ; LA76205 = test urgency
64 ; LA7FS = HL field separator
65 ; LA7ECH = HL encoding characters
66 ;
67 ; Returns ORC-7 sequence
68 ;
69 N LA7X,LA7Y
70 ;
71 I LA7DUR'="",LA7DURU D
72 . S LA7X=$$GET1^DIQ(64.061,LA7DURU_",",2) ; duration units
73 . S $P(LA7Y,$E(LA7ECH,1),3)=$$CHKDATA^LA7VHLU3(LA7X_LA7DUR,LA7FS_LA7ECH)
74 ;
75 I LA76205 D
76 . S LA7X=$$GET1^DIQ(64.061,+$$GET1^DIQ(62.05,LA76205_",",4,"I")_",",2) ; Urgency
77 . S $P(LA7Y,$E(LA7ECH,1),6)=$$CHKDATA^LA7VHLU3(LA7X,LA7FS_LA7ECH)
78 ;
79 Q LA7Y
80 ;
81 ;
82ORC9(LA7DT) ; Build ORC-9 sequence - date/time of transaction
83 ; Call with LA7DT = order date/time
84 ;
85 ; Returns ORC-9 sequence
86 ;
87 S LA7DT=$$CHKDT^LA7VHLU1(LA7DT)
88 Q $$FMTHL7^XLFDT(LA7DT)
89 ;
90 ;
91ORC12(LA7DUZ,LA7DIV,LA7FS,LA7ECH) ; Build ORC-12 sequence - Ordering provider
92 ; Call with LA7DUZ = DUZ of ordering provider
93 ; LA7DIV = Facility (division) of provider
94 ; LA7FS = HL field separator
95 ; LA7ECH = HL encoding characters
96 ;
97 ; Returns ORC-12 sequence
98 ; Also used to build OBR-16 sequence
99 ;
100 Q $$XCN^LA7VHLU4(LA7DUZ,LA7DIV,LA7FS,LA7ECH)
101 ;
102 ;
103ORC17(LA74,LA7FS,LA7ECH) ; Build ORC-17 sequence - Entering organization
104 ; Call with LA74 = ien of institution in file #4
105 ; if null/undefined then use Kernel Site file.
106 ; LA7FS = HL field separator
107 ; LA7ECH = HL encoding characters
108 ;
109 ; Returns ORC-17 sequence (ID^text^99VA4)
110 ;
111 Q $$INST^LA7VHLU4(LA74,LA7FS,LA7ECH)
112 ;
113 ;
114ORC21(LA74,LA7FS,LA7ECH) ; Build ORC-21 sequence - Ordering facility name
115 ; Call with LA74 = ien of institution in file #4
116 ; if null/undefined then use Kernel Site file.
117 ; LA7FS = HL field separator
118 ; LA7ECH = HL encoding characters
119 ;
120 ; Returns ORC-21 sequence
121 ;
122 N LA7X,LA7Y
123 ;
124 I $G(LA74)<1 S LA74=0
125 S LA7X=$$NAME^XUAF4(LA74)
126 S LA7Y=""
127 ;
128 Q LA7Y
129 ;
130 ;
131ORC22(LA74,LA7DT,LA7FS,LA7ECH) ; Build ORC-22 sequence - Ordering facility address
132 ; Call with LA74 = ien of institution in file #4
133 ; if null/undefined then use Kernel Site file.
134 ; LA7DT = "as of" date in FileMan format
135 ; LA7FS = HL field separator
136 ; LA7ECH = HL encoding characters
137 ;
138 ; Returns ORC-22 sequence
139 ;
140 N LA7X,LA7Y
141 ;
142 S LA7X=$$PADD^XUAF4(LA74)
143 S LA7Y=""
144 ;
145 Q LA7Y
146 ;
147 ;
148ORC23(LA74,LA7DT,LA7FS,LA7ECH) ; Build ORC-23 sequence - Ordering facility phone number
149 ; Call with LA74 = ien of institution in file #4
150 ; if null/undefined then use Kernel Site file.
151 ; LA7DT = "as of" date in FileMan format
152 ; LA7FS = HL field separator
153 ; LA7ECH = HL encoding characters
154 ;
155 ; Returns ORC-23 sequence
156 ;
157 N LA7Y
158 ;
159 S LA7Y=""
160 ;
161 Q LA7Y
162 ;
163 ;
164ORC24(LA7200,LA7DT,LA7FS,LA7ECH) ; Build ORC-24 sequence - Ordering provider address
165 ; Call with LA7200 = ien of provider in file #200
166 ; LA7DT = "as of" date in FileMan format
167 ; LA7FS = HL field separator
168 ; LA7ECH = HL encoding characters
169 ;
170 ; Returns ORC-24 sequence
171 ;
172 N LA7Y
173 ;
174 S LA7Y=""
175 ;
176 Q LA7Y
Note: See TracBrowser for help on using the repository browser.