1 | BMXADOXY ; IHS/CIHA/GIS - RPC CALL: GENERATE AN ADO SCHEMA STRING AND DATA SET ;
|
---|
2 | ;;2.1;BMX;;Jul 26, 2009
|
---|
3 | ; EXMAPLES OF FILEMAN SCHEMA GENERATION
|
---|
4 | ;
|
---|
5 | ;
|
---|
6 | ;
|
---|
7 | DISP(OUT) ; TEMP DISPLAY OF THE ANR
|
---|
8 | N I,X
|
---|
9 | S I=0 W !
|
---|
10 | F S I=$O(@OUT@(I)) Q:'I S X=@OUT@(I) S X=$TR(X,$C(30),"}") S X=$TR(X,$C(31),"{") W !,X
|
---|
11 | Q
|
---|
12 | ;
|
---|
13 | SCHEMA(NAME) ; GIVEN SCHEMA NAME, RETURN THE IEN
|
---|
14 | N IEN
|
---|
15 | S IEN=$O(^BMXADO("B",NAME,0))
|
---|
16 | Q IEN
|
---|
17 | ;
|
---|
18 | NUM ; ITERATE BY IEN
|
---|
19 | ; IX="",START WITH IEN=1, STOP AFTER IEN=20, MAX # RECORDS RETURNED = 5
|
---|
20 | ; TO VIEW INTERNAL VALUES SET VSTG="~1~20~5~I"
|
---|
21 | N OUT,%,SIEN
|
---|
22 | S SIEN=$$SCHEMA("IHS PATIENT")
|
---|
23 | D SS^BMXADO(.OUT,SIEN,"","~1~20~5")
|
---|
24 | D DISP(OUT) R %:$G(DTIME,60)
|
---|
25 | K ^TMP("BMX ADO",$J)
|
---|
26 | Q
|
---|
27 | ;
|
---|
28 | IX ; ITERATE BY INDEX
|
---|
29 | ; ITERATE USING THE "B" INDEX
|
---|
30 | ; START WITH PT NAME "C", STOP AFTER PATIENT NAME = "D", MAX # RECORDS RETURNED = 5
|
---|
31 | N OUT,%,SIEN
|
---|
32 | S SIEN=$$SCHEMA("IHS PATIENT")
|
---|
33 | D SS^BMXADO(.OUT,SIEN,"","B~C~D~5")
|
---|
34 | D DISP(OUT) R %:$G(DTIME,60)
|
---|
35 | K ^TMP("BMX ADO",$J)
|
---|
36 | Q
|
---|
37 | ;
|
---|
38 | RENT ; ITERATE IN CHUNKS
|
---|
39 | ; RE-ITERATE USING THE "B" INDEX
|
---|
40 | ; START WITH PT IEN 5 AS THE "SEED", STOP AFTER PATIENT NAME = "D", MAX # RECORDS RETURNED = 5
|
---|
41 | N OUT,%,SIEN,SEED,LSEED,X,Y
|
---|
42 | S SEED=0,LSEED=""
|
---|
43 | S SIEN=$$SCHEMA("IHS PATIENT")
|
---|
44 | RIT F D I '$G(SEED) Q
|
---|
45 | . D SS^BMXADO(.OUT,SIEN,SEED,"B~CA~CB~5")
|
---|
46 | . D DISP(OUT) R %:$G(DTIME,60) E S SEED="" Q
|
---|
47 | . I %?1"^" S SEED="" Q
|
---|
48 | . S X=$P(@OUT@(1),U,1)
|
---|
49 | . S SEED=$P(X,"|",3)
|
---|
50 | . I SEED=LSEED S SEED="" Q
|
---|
51 | . S LSEED=SEED
|
---|
52 | . K ^TMP("BMX ADO",$J)
|
---|
53 | . Q
|
---|
54 | Q
|
---|
55 | ;
|
---|
56 | SUB ; SUBFILE ITERATION
|
---|
57 | ; THE SCHEMA IS ATTACHED TO THE MEDICARE ELIGIBILITY FILE/ELIG DATE SUBFILE
|
---|
58 | ; THE DA STRING HAS A VALUE OF '4,',: THE IEN IN THE PARENT FILE (PATIENT DFN).
|
---|
59 | ; NOTE THE COMMA IN THE DA STRING. THIS INDICATES THAT THE FILE IEN IS 4 BUT THE SUBFILE IEN IS UNSPECIFIED
|
---|
60 | N OUT,%,SIEN
|
---|
61 | S SIEN=$$SCHEMA("UPDATE MEDICARE DATES")
|
---|
62 | ;D SS^BMXADO(.OUT,SIEN,"1,","~~~")
|
---|
63 | D SS^BMXADO(.OUT,18,"1,","~~~")
|
---|
64 | D DISP(OUT) R %:$G(DTIME,60)
|
---|
65 | K ^TMP("BMX ADO",$J)
|
---|
66 | Q
|
---|
67 | ;
|
---|
68 | DINUM ; DINUMED POINTER ITERATION
|
---|
69 | ; THE SCHEMA IS ATTACHED TO THE PATIENT FILE (9000001)
|
---|
70 | ; THE PATIENT FILE IS DINUM'D AND ITS .01 FIELD POINTS TO THE VA PATIENT FILE (2)
|
---|
71 | ; BECAUSE OF THE SPECIAL RELATIONSHIP BETWEEN THE FILES, WE CAN USE THE B INDEX OF FILE 2 TO ITERATE FILE 9000001.
|
---|
72 | N OUT,%,SIEN
|
---|
73 | S SIEN=$$SCHEMA("IHS PATIENT")
|
---|
74 | D SS^BMXADO(.OUT,SIEN,"","B~A~B~5")
|
---|
75 | D DISP(OUT) R %:$G(DTIME,60)
|
---|
76 | K ^TMP("BMX ADO",$J)
|
---|
77 | Q
|
---|
78 | ;
|
---|
79 | IXP ; INDEXED POINTER ITERATION
|
---|
80 | ; THE SCHEMA IS ATTACHED TO THE V POV FILE
|
---|
81 | ; THE AC CROSS REFERENCE INDEXES THE PATIENT FIELD
|
---|
82 | ; BY STARTING AND STOPING WITH PATIENT 235 (MAX=5) WE COLLECT THE FIRST 5 POVS FOR PATIENT 235 IN THE FILE
|
---|
83 | N OUT,%,SIEN
|
---|
84 | S SIEN=$$SCHEMA("VIEW POVS")
|
---|
85 | D SS^BMXADO(.OUT,SIEN,"","AC~235~235~5")
|
---|
86 | D DISP(OUT) R %:$G(DTIME,60)
|
---|
87 | K ^TMP("BMX ADO",$J)
|
---|
88 | Q
|
---|
89 | ;
|
---|
90 | AA ; ITERATE USING AA INDEX
|
---|
91 | ; INDEX IS 'AA" THE START AND STOP DATES ARE SPECIFIED IN EXTERNAL FORMAT. MAX=10
|
---|
92 | ; THE FOLLOWING FILTERS ARE SPECIFIED IN THE LAST PARAMETER ("235|WT|C"):
|
---|
93 | ; 235=PATIENT DFN #235
|
---|
94 | ; WT=RETURN ONLY WEIGHTS. MEASUREMENT TYPE MUST BE SPECIFIED WITH A VALID, UNAMBIGUOUS LOOKUP VALUE.
|
---|
95 | ; C=RETRUN VALUES IN CHRONOLOGICAL ORDER USE 'R' INSTEAD OF 'C' FOR REVERSE CHRONOLOGICAL ORDER. DEFAULT=C
|
---|
96 | ; THE SEED PARAMTER IS SET AND CAN BE USED TO RETURN DATA IN CHUNKS
|
---|
97 | N OUT,%,SIEN
|
---|
98 | S SIEN=$$SCHEMA("VIEW MEASUREMENTS")
|
---|
99 | D SS^BMXADO(.OUT,SIEN,"","AA~3/21/1965~6/4/2004~5~~~~235|WT|C")
|
---|
100 | D DISP(OUT) R %:$G(DTIME,60)
|
---|
101 | K ^TMP("BMX ADO",$J)
|
---|
102 | Q
|
---|
103 | ;
|
---|
104 | AA2 ; ITERATE USING AA INDEX
|
---|
105 | ; THIS SCHEMA IS ATTACHED TO THE VISIT FILE (9000010)
|
---|
106 | ; IN THIS CASE THERE IS NO ATTRIBUTE TYPE SO THE FILTER PARAM HAS ONLY 2 PIECES "1|R"
|
---|
107 | ; 235=PATIENT DFN
|
---|
108 | ; R=RETURN DATA IN REVERSE CHRONOLOGICAL ORDER
|
---|
109 | N OUT,%,SIEN
|
---|
110 | S SIEN=$$SCHEMA("VISITS") ;12
|
---|
111 | D SS^BMXADO(.OUT,SIEN,"","AA~3/21/1965~6/4/2004~5~~~~235|R")
|
---|
112 | D DISP(OUT) R %:$G(DTIME,60)
|
---|
113 | K ^TMP("BMX ADO",$J)
|
---|
114 | Q
|
---|
115 | ;
|
---|
116 | CIT ; CUSTOM ITERATOR
|
---|
117 | ; IF COMPLEX OR UNUSUAL SORTING/FILTERING IS REQUITED, USE A CUSTOM ITERATOR
|
---|
118 | ; THE CUSTOM ITERATOR IS DEFINED BY 6TH, 7TH AND 8TH PIECES IN THE VSTG
|
---|
119 | ; PIECE 8=TAG, PIECE 9=ROUTINE, PIECE 8=A PARAMETER PASSED TO THE ENTRY POINT
|
---|
120 | ; THE 9TH PIECE CONTAINS PT DFN, TIMESTAMP, VISIT TYPE, LOC IEN, AND SERVICE CATEGORY IN A "|" DELIMTED STRING
|
---|
121 | ; THE ITERATOR CALL TAG^ROUTINE(PARAM) TO GENERATE IENS
|
---|
122 | ; IN THIS CASE THE SCHEMA IS ATTACHED TO THE VISIT FILE.
|
---|
123 | ; GIVEN THE INFORMATION IN THE PARAMETER, THE CUSTOM ITERATOR RETURNS POSSIBLE DUPLICATE VISITS
|
---|
124 | N OUT,%,SIEN
|
---|
125 | S SIEN=$$SCHEMA("VISITS")
|
---|
126 | D SS^BMXADO(.OUT,SIEN,"","~~~~~DUPV~BMXADOV2~9285|5/24/04@1PM|I|516|~")
|
---|
127 | D DISP(OUT) R %:$G(DTIME,60)
|
---|
128 | K ^TMP("BMX ADO",$J)
|
---|
129 | Q
|
---|
130 | ;
|
---|
131 | ID ; IDENTIFIER FIELD
|
---|
132 | ; THE SCHEMA IS ATTACHED TO THE VA PATIENT FILE (2)
|
---|
133 | ; THE SCHEMA HAS A BUILT IN FIELD (.01ID) THAT RETURNS THE IDENTIFIERS
|
---|
134 | ; THE ENTRY POINT THAT GENERATES THE IDETIFIERS IS STORED IN THE BMX ADO SCHEMA FILE
|
---|
135 | ; PATIENT DFN=235
|
---|
136 | N OUT,%,SIEN
|
---|
137 | S SIEN=$$SCHEMA("UPDATE PATIENT DEMOGRAPHICS")
|
---|
138 | D SS^BMXADO(.OUT,SIEN,"","~235~235~")
|
---|
139 | D DISP(OUT) R %:$G(DTIME,60)
|
---|
140 | K ^TMP("BMX ADO",$J)
|
---|
141 | Q
|
---|
142 | ;
|
---|
143 | JSTD ; STANDARD JOIN
|
---|
144 | ; BY SPECIFYING A JOIN IN THE VSTG, MULTIPLE SCHEMAE AND DATA SETS ARE RETURNED IN ONE PASS
|
---|
145 | ; THE SCHEMA IS ATTACHED TO THE V MEASUREMENT FILE
|
---|
146 | ; THIS IS JOINED TO A SECOND FILE, THE VA PATIENT FILE VIA A JOIN
|
---|
147 | ; THE JOIN IS BASTED ON THE FACT THAT THE PATIENT FIELD (.02) IN THE V MEASUREMENT FILE POINTS TO THE VA PATIENT FILE
|
---|
148 | ; THE JOIN PARAMETER IS THE 9TH PIECE OF THE VSTG. IT CONSISTS OF 2 PIECES DELIMITED BY A ","
|
---|
149 | ; PIECE 1 IS THE SCHEMA THAT YOU ARE JOINING TO
|
---|
150 | ; PIECE 2 IS THE FIELD IN THE PRIMARY FILE THAT ENABLES THE JOIN
|
---|
151 | ; THE DATA SET FROM THE SECOND (JOIN) FILE CONTAINS ONLY THOSE RECORDS NECESSARY TO COMPLETE THE JOIN
|
---|
152 | ; PATIENT DFN=235, INDEX=AA, MAX=5, START=3/21/65, STOP=6/4/04
|
---|
153 | N OUT,%,SIEN1,SIEN2
|
---|
154 | S SIEN2=$$SCHEMA("VIEW MEASUREMENTS")
|
---|
155 | S SIEN1=$$SCHEMA("PATIENT DEMOGRAPHICS")
|
---|
156 | ;SIEN1=23, SIEN2=11
|
---|
157 | ;D SS^BMXADO(.OUT,SIEN1,"","AA~3/21/1965~6/4/2004~5~~~~234|WT|C~"_SIEN2_",.02")
|
---|
158 | D SS^BMXADO(.OUT,SIEN1,"","~234~236~~~~~~"_SIEN2_",.01")
|
---|
159 | D DISP(OUT) R %:$G(DTIME,60)
|
---|
160 | K ^TMP("BMX ADO",$J)
|
---|
161 | Q
|
---|
162 | ;
|
---|
163 | HWSTD ;
|
---|
164 | ; PATIENT DFN=235, INDEX=AA, MAX=5, START=3/21/65, STOP=6/4/04
|
---|
165 | N OUT,%,SIEN1,SIEN2
|
---|
166 | S SIEN1=$$SCHEMA("PATIENT DEMOGRAPHICS")
|
---|
167 | S SIEN2=$$SCHEMA("VIEW MEASUREMENTS")
|
---|
168 | ;SIEN2=23, SIEN1=11
|
---|
169 | D SS^BMXADO(.OUT,SIEN1,"","~235~250~~~~~~"_SIEN2_",.01")
|
---|
170 | D DISP(OUT) R %:$G(DTIME,60)
|
---|
171 | K ^TMP("BMX ADO",$J)
|
---|
172 | Q
|
---|
173 | ;
|
---|
174 | JMD ;JOIN MASTER TO DETAIL
|
---|
175 | N OUT,%,SIEN1,SIEN2,SIEN3,VSTG
|
---|
176 | S SIEN1=$$SCHEMA("PATIENT DEMOGRAPHICS")
|
---|
177 | S SIEN2=$$SCHEMA("VIEW MEASUREMENTS")
|
---|
178 | S SIEN3=$$SCHEMA("VIEW MEDS")
|
---|
179 | S VSTG="~1~5~~~~~~"
|
---|
180 | ;S VSTG=VSTG_SIEN3_",.001,.02IEN,AA~1/1/1960~6/30/2004~~~~~|C"
|
---|
181 | S VSTG=VSTG_SIEN3_",.001,.02IEN,AA~1/1/1960~6/30/2004~~~~~|C"
|
---|
182 | ;S VSTG="~1~5~~~~~~23,.001,.02IEN,AA~1/1/1960~6/30/2004~~~~~|WT|C"
|
---|
183 | ;BMX ADO SS^11^^~1~5~~~~~~23,.001,.02IEN,AA~1/1/1960~6/30/2004~~~~~|WT|C
|
---|
184 | ;BMX ADO SS^11^^~1~5~~~~~~25,.001,.02IEN,AA~1/1/1960~6/30/2004~~~~~|C
|
---|
185 | D SS^BMXADO(.OUT,SIEN1,"",VSTG)
|
---|
186 | D DISP(OUT) R %:$G(DTIME,60)
|
---|
187 | K ^TMP("BMX ADO",$J)
|
---|
188 | Q
|
---|
189 | ;
|
---|
190 | JSUB ; SUBFILE JOIN
|
---|
191 | ; IN THIS CASE THE RECORDS IN A PARENT FILE ARE "JOINED" TO THE RECORDS IN ONE OF ITS SUB FILES
|
---|
192 | ; THE SCHEMA IS ATTACHED TO THE "MEDICARE ELIGIBLE" FILE
|
---|
193 | ; IT IS JOINED TO ITS SUBFILE, "ELIG DATES", VIA THE UPDATE MEDICARE DATES SCHEMA
|
---|
194 | ; THE SYNTAX FOR THE JOIN PIECE IS "sien2,SUB" WHERE sien2=IEN OF SECOND SCHEMA
|
---|
195 | ; PATIENT DFN=4
|
---|
196 | N OUT,%,SIEN1,SIEN2
|
---|
197 | S SIEN1=$$SCHEMA("UPDATE MEDICARE INFO") ;17
|
---|
198 | S SIEN2=$$SCHEMA("UPDATE MEDICARE DATES") ;18
|
---|
199 | ;BMX ADO SS^17^^~4~5~~~~~~18,SUB
|
---|
200 | D SS^BMXADO(.OUT,SIEN1,"","~4~5~~~~~~"_SIEN2_",SUB")
|
---|
201 | D DISP(OUT) R %:$G(DTIME,60)
|
---|
202 | K ^TMP("BMX ADO",$J)
|
---|
203 | Q
|
---|
204 | ;
|
---|
205 | JPAR ; PARENT FILE JOIN
|
---|
206 | ; SIMILAR TO A SUBFILE JOIN EXCEPT THE SUB-FILE IS TREATED AS THE PRIMARY FILE AND IT IS JOINED TO ITS PARENT
|
---|
207 | ; BECAUSE WE ARE STARTING IN A SUBFILE, THE DA STRING CONTAINS THE IEN OF THE PARENT FILE ("4,"
|
---|
208 | ; THE SYNTAX OF THE 9TH PIECE IS "sien2,PARENT" WHERE sien2 IS THE IEN OF THE SECONDARY SCHEMA
|
---|
209 | ; PATIENT DFN=4
|
---|
210 | N OUT,%,SIEN1,SIEN2
|
---|
211 | S SIEN1=$$SCHEMA("UPDATE MEDICARE DATES")
|
---|
212 | S SIEN2=$$SCHEMA("UPDATE MEDICARE INFO")
|
---|
213 | D SS^BMXADO(.OUT,SIEN1,"4,","~~~5~~~~~"_SIEN2_",PARENT")
|
---|
214 | D DISP(OUT) R %:$G(DTIME,60)
|
---|
215 | K ^TMP("BMX ADO",$J)
|
---|
216 | Q
|
---|
217 | ;
|
---|
218 | ADD ; ADD A NEW ENTRY
|
---|
219 | ; THIS IS A 2 STEP PROCESS:
|
---|
220 | ; FIRST GET THE SCHEMA FOR THE FILE YOU WISH TO UPDATE
|
---|
221 | ; THIS SCHEMA'S NAME TYPICALLY BEGINS WITH THE WORD "UPDATE"
|
---|
222 | ; IT CONTAINS NO ID OR IEN FIELDS
|
---|
223 | ; SECOND ADD THE DATA NODE TO THE ARRAY
|
---|
224 | ; IT HAS THE SAME FORMAT AS A DATA STRING ASSOCIATED WITH THE SCHEMA EXCEPT THE FIRST "^" PIECE IS NULL
|
---|
225 | ; THIS PIECE CORRESPONDS TO THE IEN OF THE RECORD. SINCE THE RECORD HAS NOT BEEN ADDED YET, IT IS NULL.
|
---|
226 | ; IN THE DATA STRING, ALL POINTER VALUES ARE PRECEDED BY THE '`' CHARACTER AND EA. STRING ENDS IN $C(30)
|
---|
227 | ; MULTIPLE DATA STRINGS CAN BE APPENDED AS NEW NODES AT THE BOTTOM OF THE ARRAY
|
---|
228 | ; IN THIS CASE WE ARE ADDING A RECORD TO THE V MEASUREMENT FILE
|
---|
229 | ; DATA STRING="^MEASUREMENT TYPE IEN^PATIENT DFN^VISIT IEN^RESULT"_$C(30)
|
---|
230 | ; THERE ARE 2 INPUT PARAMS:
|
---|
231 | ; THE CLOSED REF WHERE THE INPUT ARRAY IS STORED
|
---|
232 | ; SINCE IT IS PASSED BY REFERENCE "OUT" CAN BE NULL OR UNDEFIEND.
|
---|
233 | ; OUT WILL BE DEFINED AT THE CONCLUSION OF THE TRANSACTION.
|
---|
234 | ; THE OUTPUT IS IN THE OUT ARRAY
|
---|
235 | ; OUT(1)="OK|ien" WHERE ien IS THE IEN OF THE RECORD THAT HAS BEE ADDED.
|
---|
236 | ; IF THE TRANSACTION FAILED, AN ERROR MSG WILL BE IN THE OUT ARRAY
|
---|
237 | ; MEASUREMENT TYPE=2, PATIENT DFN=2, VISIT IEN=7806, PATIENT'S WEIGHT=172.75
|
---|
238 | N OUT,%,SIEN,NODE,DFN
|
---|
239 | S DFN=2
|
---|
240 | S SIEN=$$SCHEMA("UPDATE MEASUREMENTS")
|
---|
241 | D SS^BMXADO(.OUT,SIEN,"","") ; GET SCHEMA
|
---|
242 | S NODE=$O(^TMP("BMX ADO",$J,999999),-1)+1
|
---|
243 | S ^TMP("BMX ADO",$J,NODE)="^`2^`"_DFN_"^`7806^172.75"_$C(30)
|
---|
244 | D DISP(OUT) R %:$G(DTIME,60) ; DISPLAY THE INPUT ARRAY BEFORE UPDATING THE RECORD
|
---|
245 | D BAFM^BMXADOF1(.OUT,$NA(^TMP("BMX ADO",$J))) ; EP FOR UPDAING THE RECORD
|
---|
246 | K ^TMP("BMX ADO",$J)
|
---|
247 | W !!,OUT S %=0 F S %=$O(OUT(%)) Q:'% W !,OUT(%) ; SEND BACK AN ACKNOWLEDGEMENT OR ERROR MSG
|
---|
248 | Q
|
---|
249 | ;
|
---|
250 | DEL ; DELETE A RECORD
|
---|
251 | ; THE SIPLEST WAY TO DELETE AN ENTRY IS TO PUT THE RECORD IEN IN THE DA STRING PRECEDED BY A MINUS SIGN
|
---|
252 | ; YOU CAN ALSO SET THE VALUE OF THE .01 FIELD TO "@"
|
---|
253 | ; IF THE VALUE OF THE .01 FIELD IS NULL AND THE DA STRING IS NOT PRECEDED BY A MINUS SIGN, THE TRANSACTION WILL BE CANCELLED
|
---|
254 | ; IF THE DA STRING IS NULL, THE TRANSACTION WILL BE CANCELLED
|
---|
255 | ; IN THIS EXAMPLE, WE DELETE A V MEASUREMENT RECORD THAT WAS JUST ADDED
|
---|
256 | N OUT,%,SIEN,NODE,DEL
|
---|
257 | S DEL=1621
|
---|
258 | S SIEN=$$SCHEMA("UPDATE MEASUREMENTS")
|
---|
259 | D SS^BMXADO(.OUT,SIEN,"","") ; GET SCHEMA
|
---|
260 | S NODE=$O(^TMP("BMX ADO",$J,999999),-1)+1
|
---|
261 | S ^TMP("BMX ADO",$J,NODE)="-"_DEL_$C(30)
|
---|
262 | D DISP(OUT) R %:$G(DTIME,60) ; DISPLAY THE INPUT ARRAY BEFORE UPDATING THE RECORD
|
---|
263 | D BAFM^BMXADOF1(.OUT,$NA(^TMP("BMX ADO",$J))) ; EP FOR UPDAING THE RECORD
|
---|
264 | K ^TMP("BMX ADO",$J)
|
---|
265 | W !!,OUT S %=0 F S %=$O(OUT(%)) Q:'% W !,OUT(%) ; SEND BACK AN ACKNOWLEDGEMENT OR ERROR MSG
|
---|
266 | Q
|
---|
267 | ;
|
---|
268 | EDIT ; EDIT AN EXISTING ENTRY
|
---|
269 | ; SIMILAR TO ABOVE EXCEPT THAT THE FIRST "^" PIECE OF THE DATA NODE IS THE IEN OF THE RECORD TO BE EDITIED
|
---|
270 | ; NOTE THAT THERE IS NO '`' IN FRONT OF THE FIRST PIECE. IT IS A PURE INTEGER
|
---|
271 | ; LAB TEST=175, PATIENT DFN=2, VISIT IEN=8040, PT'S GLUCOSE=276, ANORMAL="ABNORMAL"
|
---|
272 | N OUT,%,SIEN,NODE
|
---|
273 | S SIEN=$$SCHEMA("UPDATE LABS")
|
---|
274 | D SS^BMXADO(.OUT,SIEN,"","") ; GET SCHEMA
|
---|
275 | S NODE=$O(^TMP("BMX ADO",$J,999999),-1)+1
|
---|
276 | S ^TMP("BMX ADO",$J,NODE)="279^`175^`2^`8040^280^H"_$C(30)
|
---|
277 | D DISP(OUT) R %:$G(DTIME,60) ; DISPLAY THE INPUT ARRAY BEFORE UPDATING THE RECORD
|
---|
278 | D BAFM^BMXADOF1(.OUT,$NA(^TMP("BMX ADO",$J))) ; EP FOR UPDAING THE RECORD
|
---|
279 | K ^TMP("BMX ADO",$J)
|
---|
280 | W !!,OUT S %=0 F S %=$O(OUT(%)) Q:'% W !,OUT(%) ; SEND BACK AN ACKNOWLEDGEMENT OR ERROR MSG
|
---|
281 | Q
|
---|
282 | ;
|
---|
283 | DELVAL ; DELETE A VALUE IN A FIELD
|
---|
284 | ; SIMILAR TO EDIT EXCEPT THE VALUE IS "@"
|
---|
285 | ; DELETE WILL BE ABORTED IF IF FILEMAN SAYS THIS IS A REQUIRED FIELD
|
---|
286 | N OUT,%,SIEN,NODE
|
---|
287 | S SIEN=$$SCHEMA("UPDATE LABS")
|
---|
288 | D SS^BMXADO(.OUT,SIEN,"","") ; GET SCHEMA
|
---|
289 | S NODE=$O(^TMP("BMX ADO",$J,999999),-1)+1
|
---|
290 | S ^TMP("BMX ADO",$J,NODE)="279^`175^`2^`8040^^@"_$C(30)
|
---|
291 | D DISP(OUT) R %:$G(DTIME,60) ; DISPLAY THE INPUT ARRAY BEFORE UPDATING THE RECORD
|
---|
292 | D BAFM^BMXADOF1(.OUT,$NA(^TMP("BMX ADO",$J))) ; EP FOR UPDAING THE RECORD
|
---|
293 | K ^TMP("BMX ADO",$J)
|
---|
294 | W !!,OUT S %=0 F S %=$O(OUT(%)) Q:'% W !,OUT(%) ; SEND BACK AN ACKNOWLEDGEMENT OR ERROR MSG
|
---|
295 | Q
|
---|
296 | ;
|
---|