Home   Package List   Routine Alphabetical List   Global Alphabetical List   FileMan Files List   FileMan Sub-Files List   Package Component Lists   Package-Namespace Mapping  
Routine: XU8P378E

XU8P378E.m

Go to the documentation of this file.
XU8P378E ;OOIFO/SO- XU378 ENVIRONMENT CHECK ;6:00 AM  4 Feb 2006
 ;;8.0;KERNEL;**378**;Jul 10, 1995;Build 59
 ; State file enviroment check
 D MES^XPDUTL("Begin STATE(#5) file environment check...")
 D MES^XPDUTL(" ")
 I '$$FIND1^DIC(.11,"","X","ADUALC","IX") D
 . N DIK
 . K ^DIC(5,"C")
 . S DIK="^DIC(5,"
 . S DIK(1)="1^C"
 . D ENALL^DIK
 . S DIK(1)="2^C"
 . D ENALL^DIK
 ;
 N DATA,TMP,TMPERR
 N I1 S I1=0
 F  S I1=$O(^DIC(5,I1)) Q:'I1  D
 . I '$D(^DIC(5,I1,0)) Q  ;Bogus entry
NC . D
 .. ;Duplicate Name check
 .. N VALUE,DIERR,Z,ZERR
 .. S VALUE=$P(^DIC(5,I1,0),U)
 .. I VALUE="" Q  ;No NAME
 .. D FIND^DIC(5,"","@;.01;1;2","MPQX",VALUE,"","","I $P(^(0),U,1)=VALUE","","Z","ZERR")
 .. I $D(DIERR) Q
 .. I $P(Z("DILIST",0),U)<2 Q
 .. N I2
 .. S I2=0
 .. F  S I2=$O(Z("DILIST",I2)) Q:'I2  S TMPERR(Z("DILIST",I2,0)_"^[F]Duplicate State NAME(#.01)")="",XPDQUIT=2
 .. Q
AC . D
 .. ;Duplicate Abbreviation check
 .. N VALUE,DIERR,Z,ZERR
 .. S VALUE=$P(^DIC(5,I1,0),U,2)
 .. I VALUE="" Q  ;No ABBREVIATION
 .. D FIND^DIC(5,"","@;.01;1;2","MPQX",VALUE,"","","I $P(^(0),U,2)=VALUE","","Z","ZERR")
 .. I $D(DIERR) Q
 .. I $P(Z("DILIST",0),U)<2 Q
 .. N I2
 .. S I2=0
 .. F  S I2=$O(Z("DILIST",I2)) Q:'I2  S TMPERR(Z("DILIST",I2,0)_"^[F]Duplicate State ABBREVIATION(#1)")="",XPDQUIT=2
 .. Q
VC . D
 .. ;Duplicate VA State Code check
 .. N VALUE,DIERR,Z,ZERR
 .. S VALUE=$P(^DIC(5,I1,0),U,3)
 .. I VALUE="" Q  ;No VA STATE CODE
 .. D FIND^DIC(5,"","@;.01;1;2","MPQX",VALUE,"","","I $P(^(0),U,3)=VALUE","","Z","ZERR")
 .. I $D(DIERR) Q
 .. I $P(Z("DILIST",0),U)<2 Q
 .. N I2
 .. S I2=0
 .. F  S I2=$O(Z("DILIST",I2)) Q:'I2  S TMPERR(Z("DILIST",I2,0)_"^[F]Duplicate State VA STATE CODE(#2)")="",XPDQUIT=2
 .. Q
 . Q
TC ; Now check for missing States against table
 F I=1:1 S DATA=$T(D5+I) Q:$P(DATA,";;",2)["EOD"  D
 . N X
 . S DATA=$P(DATA,";;",2)
 . ;             NAME^ABBREVIATION^VA STATE CODE
 . S TMP($P(DATA,U,2)_U_$P(DATA,U,3)_U_$P(DATA,U,1))=""
 . Q
 S I1=0
 F  S I1=$O(^DIC(5,I1)) Q:'I1  D
 . N X,X1
 . I '$D(^DIC(5,I1,0))#2 Q
 . S X=$P(^DIC(5,I1,0),U,1,3)
 . I $D(TMP(X)) S TMP(X)=1 Q
 . S TMPERR(I1_U_$P(X,U,1)_U_$P(X,U,2)_U_$P(X,U,3)_"^[W]Not a recognized VistA State")=""
 . Q
 S I1=""
 F  S I1=$O(TMP(I1)) Q:I1=""  I TMP(I1)="" D
 . 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
 .Q
E1 I $D(XPDQUIT) D
 . S I1=""
 . D MES^XPDUTL("IEN^NAME(#.01)^ABBREVIATION(#1)^VA STATE CODE(#2)^[W]arning/[F]ailure Reason")
 . F  S I1=$O(TMPERR(I1)) Q:I1=""  D
 .. D MES^XPDUTL(I1)
 .. Q
 . Q
 I $D(XPDQUIT) D MES^XPDUTL(" ")
 D MES^XPDUTL("Finished environment check.")
 I $D(XPDQUIT) D MES^XPDUTL(">> Environment check failed!")
 Q
 ;
D5 ;VA STATE CODE^NAME^ABBREVIATION^AAC RECOGNIZED^US STATE OR POSSESSION
 ;;01^ALABAMA^AL^1^1
 ;;02^ALASKA^AK^1^1
 ;;58^ALBERTA^AB^1^0
 ;;60^AMERICAN SAMOA^AS^1^1
 ;;04^ARIZONA^AZ^1^1
 ;;05^ARKANSAS^AR^1^1
 ;;87^ARMED FORCES AF,EU,ME,CA^AE^1^1
 ;;85^ARMED FORCES AMER (EXC CANADA)^AA^1^1
 ;;88^ARMED FORCES PACIFIC^AP^1^1
 ;;59^BRITISH COLUMBIA^BC^1^0
 ;;06^CALIFORNIA^CA^1^1
 ;;91^CANADA^CANAD^0^0
 ;;08^COLORADO^CO^1^1
 ;;09^CONNECTICUT^CT^1^1
 ;;10^DELAWARE^DE^1^1
 ;;11^DISTRICT OF COLUMBIA^DC^1^1
 ;;93^EUROPE^EU^1^0
 ;;64^FEDERATED STATES OF MICRONESIA^FM^1^1
 ;;12^FLORIDA^FL^1^1
 ;;90^FOREIGN COUNTRY^FG^1^0
 ;;13^GEORGIA^GA^1^1
 ;;66^GUAM^GU^1^1
 ;;15^HAWAII^HI^1^1
 ;;16^IDAHO^ID^1^1
 ;;17^ILLINOIS^IL^1^1
 ;;18^INDIANA^IN^1^1
 ;;19^IOWA^IA^1^1
 ;;20^KANSAS^KS^1^1
 ;;21^KENTUCKY^KY^1^1
 ;;22^LOUISIANA^LA^1^1
 ;;23^MAINE^ME^1^1
 ;;61^MANITOBA^MB^1^0
 ;;68^MARSHALL ISLANDS^MH^1^1
 ;;24^MARYLAND^MD^1^1
 ;;25^MASSACHUSETTS^MA^1^1
 ;;92^MEXICO^MX^1^0
 ;;26^MICHIGAN^MI^1^1
 ;;27^MINNESOTA^MN^1^1
 ;;28^MISSISSIPPI^MS^1^1
 ;;29^MISSOURI^MO^1^1
 ;;30^MONTANA^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