XU8P428 ;SFISC/SO- ADD 'UNKNOWN' TO STATE FILE;8:01 AM 17 Aug 2006
;;8.0;KERNEL;**428**;Jul 10, 1995;Build 4
N XUMF S XUMF=1
N IEN S IEN=0
N ADD S ADD=1 ;1=Add 'UNKNOWN' to State File
F S IEN=$O(^DIC(5,IEN)) Q:'IEN I $D(^DIC(5,IEN,0))#2 D
. N X S X=^(0) ;See For loop line above
. I $P(X,U,1)="UNKNOWN" D SEDIT S ADD=0 Q ;Found State Name UNKNOWN
. I $P(X,U,2)="UN" D SEDIT S ADD=0 Q ;Found Abbreviation UN
. I $P(X,U,3)=99 D SEDIT S ADD=0 Q ;Found State Code 99
. Q
I 'ADD D COUNTY Q
ADD ; Add 'OTHER'
N DIERR,FDA,ZERR
S FDA(5,"+1,",.01)="UNKNOWN"
S FDA(5,"+1,",1)="UN"
S FDA(5,"+1,",2)=99
S FDA(5,"+1,",2.1)="YES"
S FDA(5,"+1,",2.2)="No"
D UPDATE^DIE("E","FDA","","ZERR")
D COUNTY
Q
;
SEDIT ; Edit found State entry
N DIERR,FDA,IENS,ZERR
S IENS=IEN_","
S FDA(5,IENS,.01)="UNKNOWN"
S FDA(5,IENS,1)="UN"
S FDA(5,IENS,2)=99
S FDA(5,IENS,2.1)="YES"
S FDA(5,IENS,2.2)="No"
D FILE^DIE("E","FDA","ZERR")
Q
;
COUNTY ;Edit County multiple and add to Country Code file
N IEN S IEN=$O(^DIC(5,"B","UNKNOWN",0))
N IENC S IENC=0
S ADD=1 ;1=Add 'OTHER' to County multiple
F S IENC=$O(^DIC(5,IEN,1,IENC)) Q:'IENC I $D(^DIC(5,IEN,1,IENC,0))#2 D
. N X S X=^(0) ;See For loop line above
. I $P(X,U,1)="OTHER" D CEDIT S ADD=0 Q ;Found County Name OTHER
. I $P(X,U,3)=999 D CEDIT S ADD=0 Q ;Found County Code 999
. ;Inactivate county
. N DIERR,FDA,ZERR
. S FDA(5.01,IENC_","_IEN_",",5)=$G(DT)
. D FILE^DIE("","FDA","ZERR")
. Q
I 'ADD D E513 Q
N DIERR,FDA,ZERR
S FDA(5.01,"+1,"_IEN_",",.01)="OTHER"
S FDA(5.01,"+1,"_IEN_",",2)=999
D UPDATE^DIE("E","FDA","ZERR")
D E513
Q
;
CEDIT ;Edit County multiple
N DIERR,FDA,ZERR
S FDA(5.01,IENC_","_IEN_",",.01)="OTHER"
S FDA(5.01,IENC_","_IEN_",",2)=99
D FILE^DIE("E","FDA","ZERR")
Q
;
E513 ; Add OTHER to file 5.13
N DIERR,FDA,ZERR
S FDA(5.13,"?+1,",.01)=99999
S FDA(5.13,"?+1,",1)="OTHER"
S FDA(5.13,"?+1,",2)="UNKNOWN"
D UPDATE^DIE("E","FDA","ZERR")
Q
XU8P428 ;SFISC/SO- ADD 'UNKNOWN' TO STATE FILE;8:01 AM 17 Aug 2006
+1 ;;8.0;KERNEL;**428**;Jul 10, 1995;Build 4
+2 NEW XUMF
SET XUMF=1
+3 NEW IEN
SET IEN=0
+4 ;1=Add 'UNKNOWN' to State File
NEW ADD
SET ADD=1
+5 FOR
SET IEN=$ORDER(^DIC(5,IEN))
IF 'IEN
QUIT
IF $DATA(^DIC(5,IEN,0))#2
Begin DoDot:1
+6 ;See For loop line above
NEW X
SET X=^(0)
+7 ;Found State Name UNKNOWN
IF $PIECE(X,U,1)="UNKNOWN"
DO SEDIT
SET ADD=0
QUIT
+8 ;Found Abbreviation UN
IF $PIECE(X,U,2)="UN"
DO SEDIT
SET ADD=0
QUIT
+9 ;Found State Code 99
IF $PIECE(X,U,3)=99
DO SEDIT
SET ADD=0
QUIT
+10 QUIT
End DoDot:1
+11 IF 'ADD
DO COUNTY
QUIT
ADD ; Add 'OTHER'
+1 NEW DIERR,FDA,ZERR
+2 SET FDA(5,"+1,",.01)="UNKNOWN"
+3 SET FDA(5,"+1,",1)="UN"
+4 SET FDA(5,"+1,",2)=99
+5 SET FDA(5,"+1,",2.1)="YES"
+6 SET FDA(5,"+1,",2.2)="No"
+7 DO UPDATE^DIE("E","FDA","","ZERR")
+8 DO COUNTY
+9 QUIT
+10 ;
SEDIT ; Edit found State entry
+1 NEW DIERR,FDA,IENS,ZERR
+2 SET IENS=IEN_","
+3 SET FDA(5,IENS,.01)="UNKNOWN"
+4 SET FDA(5,IENS,1)="UN"
+5 SET FDA(5,IENS,2)=99
+6 SET FDA(5,IENS,2.1)="YES"
+7 SET FDA(5,IENS,2.2)="No"
+8 DO FILE^DIE("E","FDA","ZERR")
+9 QUIT
+10 ;
COUNTY ;Edit County multiple and add to Country Code file
+1 NEW IEN
SET IEN=$ORDER(^DIC(5,"B","UNKNOWN",0))
+2 NEW IENC
SET IENC=0
+3 ;1=Add 'OTHER' to County multiple
SET ADD=1
+4 FOR
SET IENC=$ORDER(^DIC(5,IEN,1,IENC))
IF 'IENC
QUIT
IF $DATA(^DIC(5,IEN,1,IENC,0))#2
Begin DoDot:1
+5 ;See For loop line above
NEW X
SET X=^(0)
+6 ;Found County Name OTHER
IF $PIECE(X,U,1)="OTHER"
DO CEDIT
SET ADD=0
QUIT
+7 ;Found County Code 999
IF $PIECE(X,U,3)=999
DO CEDIT
SET ADD=0
QUIT
+8 ;Inactivate county
+9 NEW DIERR,FDA,ZERR
+10 SET FDA(5.01,IENC_","_IEN_",",5)=$GET(DT)
+11 DO FILE^DIE("","FDA","ZERR")
+12 QUIT
End DoDot:1
+13 IF 'ADD
DO E513
QUIT
+14 NEW DIERR,FDA,ZERR
+15 SET FDA(5.01,"+1,"_IEN_",",.01)="OTHER"
+16 SET FDA(5.01,"+1,"_IEN_",",2)=999
+17 DO UPDATE^DIE("E","FDA","ZERR")
+18 DO E513
+19 QUIT
+20 ;
CEDIT ;Edit County multiple
+1 NEW DIERR,FDA,ZERR
+2 SET FDA(5.01,IENC_","_IEN_",",.01)="OTHER"
+3 SET FDA(5.01,IENC_","_IEN_",",2)=99
+4 DO FILE^DIE("E","FDA","ZERR")
+5 QUIT
+6 ;
E513 ; Add OTHER to file 5.13
+1 NEW DIERR,FDA,ZERR
+2 SET FDA(5.13,"?+1,",.01)=99999
+3 SET FDA(5.13,"?+1,",1)="OTHER"
+4 SET FDA(5.13,"?+1,",2)="UNKNOWN"
+5 DO UPDATE^DIE("E","FDA","ZERR")
+6 QUIT