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

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

initial load of FOIAVistA 6/30/08 version

File size: 4.7 KB
Line 
1XU8P378E ;OOIFO/SO- XU378 ENVIRONMENT CHECK ;6:00 AM 4 Feb 2006
2 ;;8.0;KERNEL;**378**;Jul 10, 1995;Build 59
3 ; State file enviroment check
4 D MES^XPDUTL("Begin STATE(#5) file environment check...")
5 D MES^XPDUTL(" ")
6 I '$$FIND1^DIC(.11,"","X","ADUALC","IX") D
7 . N DIK
8 . K ^DIC(5,"C")
9 . S DIK="^DIC(5,"
10 . S DIK(1)="1^C"
11 . D ENALL^DIK
12 . S DIK(1)="2^C"
13 . D ENALL^DIK
14 ;
15 N DATA,TMP,TMPERR
16 N I1 S I1=0
17 F S I1=$O(^DIC(5,I1)) Q:'I1 D
18 . I '$D(^DIC(5,I1,0)) Q ;Bogus entry
19NC . D
20 .. ;Duplicate Name check
21 .. N VALUE,DIERR,Z,ZERR
22 .. S VALUE=$P(^DIC(5,I1,0),U)
23 .. I VALUE="" Q ;No NAME
24 .. D FIND^DIC(5,"","@;.01;1;2","MPQX",VALUE,"","","I $P(^(0),U,1)=VALUE","","Z","ZERR")
25 .. I $D(DIERR) Q
26 .. I $P(Z("DILIST",0),U)<2 Q
27 .. N I2
28 .. S I2=0
29 .. F S I2=$O(Z("DILIST",I2)) Q:'I2 S TMPERR(Z("DILIST",I2,0)_"^[F]Duplicate State NAME(#.01)")="",XPDQUIT=2
30 .. Q
31AC . D
32 .. ;Duplicate Abbreviation check
33 .. N VALUE,DIERR,Z,ZERR
34 .. S VALUE=$P(^DIC(5,I1,0),U,2)
35 .. I VALUE="" Q ;No ABBREVIATION
36 .. D FIND^DIC(5,"","@;.01;1;2","MPQX",VALUE,"","","I $P(^(0),U,2)=VALUE","","Z","ZERR")
37 .. I $D(DIERR) Q
38 .. I $P(Z("DILIST",0),U)<2 Q
39 .. N I2
40 .. S I2=0
41 .. F S I2=$O(Z("DILIST",I2)) Q:'I2 S TMPERR(Z("DILIST",I2,0)_"^[F]Duplicate State ABBREVIATION(#1)")="",XPDQUIT=2
42 .. Q
43VC . D
44 .. ;Duplicate VA State Code check
45 .. N VALUE,DIERR,Z,ZERR
46 .. S VALUE=$P(^DIC(5,I1,0),U,3)
47 .. I VALUE="" Q ;No VA STATE CODE
48 .. D FIND^DIC(5,"","@;.01;1;2","MPQX",VALUE,"","","I $P(^(0),U,3)=VALUE","","Z","ZERR")
49 .. I $D(DIERR) Q
50 .. I $P(Z("DILIST",0),U)<2 Q
51 .. N I2
52 .. S I2=0
53 .. F S I2=$O(Z("DILIST",I2)) Q:'I2 S TMPERR(Z("DILIST",I2,0)_"^[F]Duplicate State VA STATE CODE(#2)")="",XPDQUIT=2
54 .. Q
55 . Q
56TC ; Now check for missing States against table
57 F I=1:1 S DATA=$T(D5+I) Q:$P(DATA,";;",2)["EOD" D
58 . N X
59 . S DATA=$P(DATA,";;",2)
60 . ; NAME^ABBREVIATION^VA STATE CODE
61 . S TMP($P(DATA,U,2)_U_$P(DATA,U,3)_U_$P(DATA,U,1))=""
62 . Q
63 S I1=0
64 F S I1=$O(^DIC(5,I1)) Q:'I1 D
65 . N X,X1
66 . I '$D(^DIC(5,I1,0))#2 Q
67 . S X=$P(^DIC(5,I1,0),U,1,3)
68 . I $D(TMP(X)) S TMP(X)=1 Q
69 . S TMPERR(I1_U_$P(X,U,1)_U_$P(X,U,2)_U_$P(X,U,3)_"^[W]Not a recognized VistA State")=""
70 . Q
71 S I1=""
72 F S I1=$O(TMP(I1)) Q:I1="" I TMP(I1)="" D
73 . S TMPERR(U_$P(I1,U,1)_U_$P(I1,U,2)_U_$P(I1,U,3)_"^[F]State not found in STATE(#5) file")="",XPDQUIT=2
74 .Q
75E1 I $D(XPDQUIT) D
76 . S I1=""
77 . D MES^XPDUTL("IEN^NAME(#.01)^ABBREVIATION(#1)^VA STATE CODE(#2)^[W]arning/[F]ailure Reason")
78 . F S I1=$O(TMPERR(I1)) Q:I1="" D
79 .. D MES^XPDUTL(I1)
80 .. Q
81 . Q
82 I $D(XPDQUIT) D MES^XPDUTL(" ")
83 D MES^XPDUTL("Finished environment check.")
84 I $D(XPDQUIT) D MES^XPDUTL(">> Environment check failed!")
85 Q
86 ;
87D5 ;VA STATE CODE^NAME^ABBREVIATION^AAC RECOGNIZED^US STATE OR POSSESSION
88 ;;01^ALABAMA^AL^1^1
89 ;;02^ALASKA^AK^1^1
90 ;;58^ALBERTA^AB^1^0
91 ;;60^AMERICAN SAMOA^AS^1^1
92 ;;04^ARIZONA^AZ^1^1
93 ;;05^ARKANSAS^AR^1^1
94 ;;87^ARMED FORCES AF,EU,ME,CA^AE^1^1
95 ;;85^ARMED FORCES AMER (EXC CANADA)^AA^1^1
96 ;;88^ARMED FORCES PACIFIC^AP^1^1
97 ;;59^BRITISH COLUMBIA^BC^1^0
98 ;;06^CALIFORNIA^CA^1^1
99 ;;91^CANADA^CANAD^0^0
100 ;;08^COLORADO^CO^1^1
101 ;;09^CONNECTICUT^CT^1^1
102 ;;10^DELAWARE^DE^1^1
103 ;;11^DISTRICT OF COLUMBIA^DC^1^1
104 ;;93^EUROPE^EU^1^0
105 ;;64^FEDERATED STATES OF MICRONESIA^FM^1^1
106 ;;12^FLORIDA^FL^1^1
107 ;;90^FOREIGN COUNTRY^FG^1^0
108 ;;13^GEORGIA^GA^1^1
109 ;;66^GUAM^GU^1^1
110 ;;15^HAWAII^HI^1^1
111 ;;16^IDAHO^ID^1^1
112 ;;17^ILLINOIS^IL^1^1
113 ;;18^INDIANA^IN^1^1
114 ;;19^IOWA^IA^1^1
115 ;;20^KANSAS^KS^1^1
116 ;;21^KENTUCKY^KY^1^1
117 ;;22^LOUISIANA^LA^1^1
118 ;;23^MAINE^ME^1^1
119 ;;61^MANITOBA^MB^1^0
120 ;;68^MARSHALL ISLANDS^MH^1^1
121 ;;24^MARYLAND^MD^1^1
122 ;;25^MASSACHUSETTS^MA^1^1
123 ;;92^MEXICO^MX^1^0
124 ;;26^MICHIGAN^MI^1^1
125 ;;27^MINNESOTA^MN^1^1
126 ;;28^MISSISSIPPI^MS^1^1
127 ;;29^MISSOURI^MO^1^1
128 ;;30^MONTANA^MT^1^1
129 ;;31^NEBRASKA^NE^1^1
130 ;;32^NEVADA^NV^1^1
131 ;;62^NEW BRUNSWICK^NB^1^0
132 ;;33^NEW HAMPSHIRE^NH^1^1
133 ;;34^NEW JERSEY^NJ^1^1
134 ;;35^NEW MEXICO^NM^1^1
135 ;;36^NEW YORK^NY^1^1
136 ;;63^NEWFOUNDLAND^NF^1^0
137 ;;37^NORTH CAROLINA^NC^1^1
138 ;;38^NORTH DAKOTA^ND^1^1
139 ;;69^NORTHERN MARIANA ISLANDS^MP^1^1
140 ;;73^NORTHWEST TERRITORIES^NT^1^0
141 ;;65^NOVA SCOTIA^NS^1^0
142 ;;94^NUNAVUT PROVINCE^NU^1^0
143 ;;39^OHIO^OH^1^1
144 ;;40^OKLAHOMA^OK^1^1
145 ;;75^ONTARIO^ON^1^0
146 ;;41^OREGON^OR^1^1
147 ;;70^PALAU^PW^1^1
148 ;;42^PENNSYLVANIA^PA^1^1
149 ;;96^PHILIPPINES^PH^1^0
150 ;;77^PRINCE EDWARD ISLAND^PE^1^0
151 ;;72^PUERTO RICO^PR^1^1
152 ;;80^QUEBEC^QC^1^0
153 ;;44^RHODE ISLAND^RI^1^1
154 ;;82^SASKATCHEWAN^SK^1^0
155 ;;45^SOUTH CAROLINA^SC^1^1
156 ;;46^SOUTH DAKOTA^SD^1^1
157 ;;47^TENNESSEE^TN^1^1
158 ;;48^TEXAS^TX^1^1
159 ;;74^U.S. MINOR OUTLYING ISLANDS^UM^1^1
160 ;;49^UTAH^UT^1^1
161 ;;50^VERMONT^VT^1^1
162 ;;78^VIRGIN ISLANDS^VI^1^1
163 ;;51^VIRGINIA^VA^1^1
164 ;;53^WASHINGTON^WA^1^1
165 ;;54^WEST VIRGINIA^WV^1^1
166 ;;55^WISCONSIN^WI^1^1
167 ;;56^WYOMING^WY^1^1
168 ;;83^YUKON TERRITORY^YT^1^0
169 ;;99999^EOD^EOD^EOD^EOD
Note: See TracBrowser for help on using the repository browser.