source: FOIAVistA/trunk/r/KERNEL-XU-A4A7-USC-XG-XLF-XNOA-XPD-XQ-XVIR-ZI-ZOSF-ZOSV-ZT-ZU-%Z-XIP--XQAB--XUC--XUR--ZIN--ZTED/XUMF333.m@ 1150

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

initial load of FOIAVistA 6/30/08 version

File size: 6.9 KB
Line 
1XUMF333 ;OIFO-OAK/RAM - Add HCS data types ;02/21/02
2 ;;8.0;KERNEL;**335**;Jul 10, 1995
3 ;
4 Q
5 ;
6 ;
7POST ; -- post installation XU*8*333
8 ;
9 N XUMF,IENS,IEN,FDA,I,HCS,XXX
10 ;
11 S XUMF=1
12 ;
13 D KM,KM1,KM2,KM3,STUFF
14 ;
15 Q
16 ;
17KM ; -- add XUMF IMF EDIT STATUS to XUKERNEL
18 ;
19 N X,Y
20 ;
21 S X=$$FIND1^DIC(19,,"B","XUKERNEL")
22 S Y="?+1,"
23 ;
24 S IENS=Y_X_","
25 S FDA(19,"?1,",.01)="XUKERNEL"
26 S FDA(19.01,"?+2,?1,",.01)="XUMF IMF EDIT STATUS"
27 D UPDATE^DIE("","FDA")
28 ;
29 Q
30 ;
31KM1 ; -- add XUMF IMF EDIT STATUS to XUKERNEL
32 ;
33 N X,Y
34 ;
35 S X=$$FIND1^DIC(19,,"B","XUKERNEL")
36 S Y="?+1,"
37 ;
38 S IENS=Y_X_","
39 S FDA(19,"?1,",.01)="XUKERNEL"
40 S FDA(19.01,"?+3,?1,",.01)="XUMF LOAD INSTITUTION"
41 D UPDATE^DIE("","FDA")
42 ;
43 Q
44 ;
45KM2 ; -- add XUMF IMF EDIT STATUS to XUKERNEL
46 ;
47 N X,Y
48 ;
49 S X=$$FIND1^DIC(19,,"B","XUKERNEL")
50 S Y="?+1,"
51 ;
52 S IENS=Y_X_","
53 S FDA(19,"?1,",.01)="XUKERNEL"
54 S FDA(19.01,"?+3,?1,",.01)="Patch XU*8*335 clean 4.1 and 4"
55 D UPDATE^DIE("","FDA")
56 ;
57 Q
58 ;
59KM3 ; -- remove XUMF333 clean 4.1 and 4 if present
60 ;
61 N X,IENS,FDA
62 ;
63 S X=$$FIND1^DIC(19,,"B","XUMF333 clean 4.1 and 4")
64 ;
65 Q:'X
66 ;
67 S IENS=X_","
68 S FDA(19,IENS,.01)="@"
69 D UPDATE^DIE("","FDA")
70 ;
71 Q
72 ;
73STUFF ;
74 ;
75 S IEN=$O(^DIC(4.1,"B","HCS",0))
76 S IENS=$S(IEN:IEN_",",1:"+1,")
77 K FDA
78 S FDA(4.1,IENS,.01)="HCS"
79 S FDA(4.1,IENS,1)="HEALTH CARE SYSTEM"
80 S FDA(4.1,IENS,3)="LOCAL"
81 D UPDATE^DIE("E","FDA")
82 ;
83 S HCS=""
84 F XXX=1:1 D Q:HCS=""
85 .S HCS=$P($T(HCS+XXX),";;",2)
86 .S IEN=$S(HCS="":0,1:$O(^DIC(4,"B",HCS,0)))
87 .S IENS=$S(IEN:IEN_",",1:"+1,")
88 .;
89 .K FDA
90 .S FDA(4,IENS,.01)=HCS
91 .S FDA(4,IENS,11)="LOCAL"
92 .S FDA(4,IENS,13)="HCS"
93 .D UPDATE^DIE("E","FDA")
94 ;
95 Q
96 ;
97HCS ;
98 ;;VA GREATER LOS ANGELES (691)
99 ;;VA HEARTLAND-EAST VISN15 (657)
100 ;;VA HEARTLAND-WEST VISN15 (589)
101 ;;VA CHICAGO HSC (537)
102 ;;CENTRAL PLAINS NETWORK (636)
103 ;;MONTANA HCS (436)
104 ;;VA PACIFIC ISLANDS HCS (459)
105 ;;NEW MEXICO HCS (501)
106 ;;AMARILLO HCS (504)
107 ;;MARYLAND HCS (512)
108 ;;WEST TEXAS HCS (519)
109 ;;BOSTON HCS (523)
110 ;;UPSTATE NEW YORK HCS (528)
111 ;;NORTH TEXAS HCS (549)
112 ;;EASTERN COLORADO HCS (554)
113 ;;NEW JERSEY HCS (561)
114 ;;BLACK HILLS HCS (568)
115 ;;CENTRAL CALIFORNIA HCS (570)
116 ;;N FLORIDA/S GEORGIA HCS (573)
117 ;;GREATER NEBRASKA HCS (597)
118 ;;CENTRAL ARKANSAS HCS (598)
119 ;;LONG BEACH HCS (600)
120 ;;CENTRAL ALABAMA HCS (619)
121 ;;HUDSON VALLEY HCS VAMC (620)
122 ;;TENNESSEE VALLEY HCS (626)
123 ;;PALO ALTO HCS (640)
124 ;;PITTSBURGH HCS (646)
125 ;;ROSEBURG HCS (653)
126 ;;SIERRA NEVADA HCS (654)
127 ;;SALT LAKE CITY HCS (660)
128 ;;PUGET SOUND HCS (663)
129 ;;SAN DIEGO HCS (664)
130 ;;SOUTH TEXAS HCS (671)
131 ;;CENTRAL TEXAS HCS (674)
132 ;;EASTERN KANSAS HCS (677)
133 ;;SOUTHERN ARIZONA VA HCS (678)
134 ;;CONNECTICUT HCS (689)
135 ;;EL PASO VA HCS (756)
136 ;;NEW YORK HHS (630)
137 ;
138 ; do not include
139 ;;EASTERN COLORADO HCS (554A4)
140 ;;SOUTHERN COLORADO HCS
141 ;;CENTRAL IOWA HCS (555)
142 ;;ILLIANA HCS (550)
143 ;;NORTHERN CALIFORNIA HCS (612)
144 ;;SOUTHERN NEVADA HCS (593)
145 ;;NORTHERN ARIZONA HCS (649)
146 ;
147 Q
148 ;
149CHK ; -- check site updating required
150 ;
151 N STA,IEN,FLAG,CHK
152 ;
153 S STA=$$STA^XUAF4(+$G(DUZ(2)))
154 ;
155 I STA="" W !!,"DUZ not defined. Please log on." Q
156 ;
157 W @IOF,!,STA," ",$P($$NS^XUAF4(+DUZ(2)),U)
158 ;
159 S CHK=$$INST^XUMF333(+DUZ(2),.ERR)
160 I CHK=1 D
161 .W !!?5,"MISSING DATA - please fix",!
162 .S I=0 F S I=$O(ERR("FATAL",I)) Q:'I D
163 ..W !?5,ERR("FATAL",I)
164 I CHK'=1 W " is okay"
165 ;
166 S STA=STA_"A"
167 F S STA=$O(^DIC(4,"D",STA)) Q:STA="" D Q:$G(FLAG)
168 .I $E($$STA^XUAF4(DUZ(2)),1,3)'=$E(STA,1,3) S FLAG=1 Q
169 .S IEN=$$IEN^XUAF4(STA)
170 .S CHK=$$INST^XUMF333(+IEN,.ERR)
171 .W !!,STA," ",$P($$NS^XUAF4(+IEN),U)
172 .I CHK'=1 W " is okay" Q
173 .I CHK=1 D
174 ..W " is MISSING DATA - please fix",!
175 ..S I=0 F S I=$O(ERR("FATAL",I)) Q:'I D
176 ...W !?5,ERR("FATAL",I)
177 .K ERR
178 ;
179 ;
180 Q
181 ;
182INST(IEN,ERR) ; -- validate Institution entry FALSE=valid
183 ;
184 Q:'$G(IEN) "IEN null"
185 ;
186 S CNT=1
187 ;
188 D ZERO(IEN,.ERR,.CNT)
189 D ADD1(IEN,.ERR,.CNT)
190 D ADD2(IEN,.ERR,.CNT)
191 D FTYP(IEN,.ERR,.CNT)
192 D ND99(IEN,.ERR,.CNT)
193 ;
194 Q $S($D(ERR("FATAL")):1,$D(ERR("WARNING")):2,1:0)
195 ;
196ZERO(IEN,ERR,CNT) ; -- zero node
197 ;
198 N X
199 ;
200 S CNT=$G(CNT) S:'CNT CNT=1
201 ;
202 S X=$G(^DIC(4,+IEN,0))
203 I $P(X,U,2)="" D
204 .S ERR("FATAL",CNT)="STATE is missing",CNT=CNT+1
205 ;
206 Q
207 ;
208ADD1(IEN,ERR,CNT) ; -- address node
209 ;
210 N X,I
211 ;
212 S CNT=$G(CNT) S:'CNT CNT=1
213 ;
214 S X=$G(^DIC(4,+IEN,1))
215 I $P(X,U,1)="" D
216 .S ERR("FATAL",CNT)="Physical address St. line 1 missing"
217 .S CNT=CNT+1
218 I $P(X,U,3)="" D
219 .S ERR("FATAL",CNT)="Physical address City missing"
220 .S CNT=CNT+1
221 I $P(X,U,4)="" D
222 .S ERR("FATAL",CNT)="Physical address ZIP missing"
223 .S CNT=CNT+1
224 I $P(X,U,2)="" D
225 .S ERR("WARNING",CNT)="Physical address St. line 2 missing"
226 .S CNT=CNT+1
227 ;
228 Q
229 ;
230ADD2(IEN,ERR,CNT) ; -- mailing address node
231 ;
232 N X,I
233 ;
234 S CNT=$G(CNT) S:'CNT CNT=1
235 ;
236 S X=$G(^DIC(4,+IEN,4))
237 I $P(X,U,1)="" D
238 .S ERR("FATAL",CNT)="Mailing address St. line 1 missing"
239 .S CNT=CNT+1
240 I $P(X,U,3)="" D
241 .S ERR("FATAL",CNT)="Mailing address City missing"
242 .S CNT=CNT+1
243 I $P(X,U,4)="" D
244 .S ERR("FATAL",CNT)="Mailing address State missing"
245 .S CNT=CNT+1
246 I $P(X,U,5)="" D
247 .S ERR("FATAL",CNT)="Mailing address ZIP missing"
248 .S CNT=CNT+1
249 I $P(X,U,2)="" D
250 .S ERR("WARNING",CNT)="Mailing address St. line 2 missing"
251 .S CNT=CNT+1
252 ;
253 Q
254 ;
255FTYP(IEN,ERR,CNT) ; -- facility type node
256 ;
257 N X
258 ;
259 S CNT=$G(CNT) S:'CNT CNT=1
260 ;
261 S X=$G(^DIC(4,+IEN,3))
262 I 'X D
263 .S ERR("FATAL",CNT)="FACILITY TYPE is missing",CNT=CNT+1
264 I $P($G(^DIC(4.1,+X,0)),U,4)'="N" D
265 .S ERR("FATAL",CNT)="FACILITY TYPE is not NATIONAL",CNT=CNT+1
266 ;
267 Q
268 ;
269ND99(IEN,ERR,CNT) ; -- 99 node
270 ;
271 N X
272 ;
273 S CNT=$G(CNT) S:'CNT CNT=1
274 ;
275 S X=$G(^DIC(4,+IEN,99))
276 I $P(X,U,3)="" D
277 .S ERR("FATAL",CNT)="OFFICIAL VA NAME is missing",CNT=CNT+1
278 I ($P(X,U,4))&($E($$NS^XUAF4(+IEN),1,2)'="ZZ") D
279 .S ERR("FATAL",CNT)="Inactive facility NAME not ZZ'd",CNT=CNT+1
280 ;
281 Q
282 ;
283C4 ; -- clean up Institution file
284 ;
285 D RIP,CFTYP,GET
286 ;
287 Q
288 ;
289RIP ; -- remove from all inactive and local the associations visn & parent
290 ;
291 N IEN
292 ;
293 S IEN=0
294 F S IEN=$O(^DIC(4,IEN)) Q:'IEN D
295 .I $P($G(^DIC(4,+IEN,0)),U,11)="N",'$P($G(^DIC(4,+IEN,99)),U,4) Q
296 .D IFF^XUMF333(IEN)
297 ;
298 Q
299 ;
300IFF(IEN) ; -- inactive facility remove VISN and parent association
301 ;
302 N FDA,IENS,XUMF
303 ;
304 S XUMF=1
305 ;
306 S IENS="1,"_IEN_","
307 S FDA(4.014,IENS,.01)="@"
308 S IENS="2,"_IEN_","
309 S FDA(4.014,IENS,.01)="@"
310 D FILE^DIE("E","FDA")
311 ;
312 Q
313 ;
314CFTYP ; - clean 4.1
315 ;
316 N FDA,IENS,XUMF,IEN
317 ;
318 M ^TMP("XUMF 4.1",$J)=^DIC(4.1)
319 ;
320 S XUMF=1
321 ;
322 S IEN=0
323 F S IEN=$O(^DIC(4.1,IEN)) Q:'IEN D
324 .S IENS=IEN_","
325 .K FDA
326 .S FDA(4.1,IENS,.01)="@"
327 .D FILE^DIE("E","FDA")
328 ;
329 S IEN=0
330 F S IEN=$O(^DIC(4,IEN)) Q:'IEN D
331 .S IENS=IEN_","
332 .K FDA
333 .S FDA(4,IENS,13)="@"
334 .D FILE^DIE("E","FDA")
335 ;
336 Q
337 ;
338GET ; -- get Institution Master File (IMF) and Facility Types
339 ;
340 W !!,"...getting Facility Types - wait please 5 min..."
341 D LOAD^XUMF(4.1)
342 W !!,"...getting Institutions - wait please 10 min..."
343 D LOAD^XUMF(4)
344 ;
345 Q
346 ;
347SCN(IEN,XUMF) ; screen out HCS entries
348 ;
349 ; IEN = Institution Internal Entry Number to check
350 ;
351 S XUMF=$G(XUMF) Q:XUMF 1
352 ;
353 I $O(^DIC(4.1,"B","HCS",0))=+$G(^DIC(4,+IEN,3)) Q 0
354 ;
355 Q 1
356 ;
Note: See TracBrowser for help on using the repository browser.