EASEZC2 ;ALB/jap - Compare 1010EZ Data with VistA Database ;10/16/00 13:08
;;1.0;ENROLLMENT APPLICATION SYSTEM;**1,51,70**;Mar 15, 2001;Build 26
;
A408 ;get applicant financial data from VistA
N IENS,IEN,B,FF,FILE,SUBF,FLD,MAP,VDATA,KEY,EASAEL
S IENS=$G(INCREL(408,"V",1))
Q:IENS=""
;associate each ien with file/subfile
S B=0 F FF=408.12,2,408.21,408.22 D
. S B=B+1,IEN=+$P(IENS,U,B)
. Q:'IEN Q:FF=2
. S (FILE,SUBF)=FF
. S FLD=0 F S FLD=$O(^TMP("EZINDEX",$J,"A",FILE,SUBF,FLD)) Q:FLD="" D
. . S MAP=FILE_U_SUBF_U_FLD
. . ;get patient database data
. . S VDATA=$$GET^EASEZC1(IEN,MAP)
. . ;store link in all 1010EZ elements associated with this file/subfile
. . ;store patient data in tmp array and link in subfile #712.01; KEY is ien to file #711
. . S KEY=0 F S KEY=$O(^TMP("EZINDEX",$J,"A",FILE,SUBF,FLD,KEY)) Q:'KEY D
. . . S ^TMP("EZDATA",$J,KEY,1,2)=VDATA
. . . S EASAEL=$P($G(^TMP("EZDATA",$J,KEY,1,1)),U,3)
. . . I EASAEL D LINKUP^EASEZU1(EASAPP,EASAEL,IEN)
. . . I 'EASAEL,VDATA'="" D ADD71201^EASEZU1(EASAPP,KEY,IEN,1)
Q
;
SP408 ;get spouse financial data from VistA
;
N B,TYPE,MAP,M,MM,NSD,OUT,X,IEN,IENS,KEY,FILE,FF,FFF,FLD,SUBF,SUBIEN,VDATA,WHERE
;get identifying data for database spouse
S IENS=$G(INCREL(408,"S",1))
Q:IENS=""
;associate each ien with file/subfile
S B=0 F FF=408.12,408.13,408.21,408.22 D
. S B=B+1,IEN=+$P(IENS,U,B)
. Q:'IEN
. S (FILE,SUBF)=FF
. S FLD=0 F S FLD=$O(^TMP("EZINDEX",$J,"S",FILE,SUBF,FLD)) Q:FLD="" D
. . S MAP=FILE_U_SUBF_U_FLD
. . ;get patient database data
. . S VDATA=$$GET^EASEZC1(IEN,MAP)
. . ;store link in all 1010EZ elements associated with this file/subfile
. . ;store patient data in tmp array and link in subfile #712.01; KEY is ien to file #711
. . S KEY=0 F S KEY=$O(^TMP("EZINDEX",$J,"S",FILE,SUBF,FLD,KEY)) Q:'KEY D
. . . S ^TMP("EZDATA",$J,KEY,1,2)=VDATA
. . . S EASAEL=$P($G(^TMP("EZDATA",$J,KEY,1,1)),U,3)
. . . I EASAEL D LINKUP^EASEZU1(EASAPP,EASAEL,IEN)
. . . I 'EASAEL,VDATA'="" D ADD71201^EASEZU1(EASAPP,KEY,IEN,1)
. ;get data in subfile #408.1275
. I FILE=408.12 S SUBF=408.1275 S FLD=0 F S FLD=$O(^TMP("EZINDEX",$J,"S",FILE,SUBF,FLD)) Q:FLD="" D
. . S SUBIEN=$$I1275^EASEZI(IEN)
. . S MAP=FILE_U_SUBF_U_FLD,WHERE=IEN_";"_SUBIEN
. . S VDATA=$$GET^EASEZC1(WHERE,MAP)
. . ;store link in all 1010EZ elements associated with this file/subfile
. . ;store patient data in tmp array and link in subfile #712.01; KEY is ien to file #711
. . S KEY=0 F S KEY=$O(^TMP("EZINDEX",$J,"S",FILE,SUBF,FLD,KEY)) Q:'KEY D
. . . S ^TMP("EZDATA",$J,KEY,1,2)=VDATA
. . . S EASAEL=$P($G(^TMP("EZDATA",$J,KEY,1,1)),U,3)
. . . I EASAEL D LINKUP^EASEZU1(EASAPP,EASAEL,WHERE)
. . . I 'EASAEL,VDATA'="" D ADD71201^EASEZU1(EASAPP,KEY,WHERE,1)
Q
;
C1N408 ;get child/dependent financial data from VistA
N B,PERS,EZ,PT,TYPE,GRP,GRP1,MAP,M,MM,NSD,OUT,X,IEN,IENS,FLD,FF,FFF,FILE,SUBF,SUBIEN,VDATA,WHERE
;
;get identifying data for 1010EZ child dependents
K PERS("EZ")
S TYPE="CHILD1" S X=$$NSD^EASEZU3(EASAPP,TYPE,1) I X'="" S PERS("EZ",TYPE,1)=X
S TYPE="CHILD(N)",M=0,OUT=0 F S M=M+1 D Q:OUT
. S X=$$NSD^EASEZU3(EASAPP,TYPE,M)
. I X="" S OUT=1 Q
. S PERS("EZ",TYPE,M)=X
;
;get identifying data for all database dependents
K PERS("PT")
S M=0,MM=0 F S M=$O(INCREL(408,"C",M)) Q:'M D
. S IEN=+$P(INCREL(408,"C",M),U,2)
. S NSD="" F FLD=".01",".09",".03" D
. . S FFF="408.13^408.13^"_FLD S X=$$GET^EASEZC1(IEN,FFF)
. . I FLD=".09" S X=$$SSNOUT^EASEZT1(X)
. . S NSD=NSD_X_U
. S MM=MM+1,PERS("PT","CHILD",MM)=NSD,PERS("PT","CHILD",MM,"IENS")=INCREL(408,"C",M)
;
;match each EZ child dependent to database dependent if possible
F TYPE="CHILD1","CHILD(N)" S M=0 F S M=$O(PERS("EZ",TYPE,M)) Q:'M D
. S EZ=PERS("EZ",TYPE,M)
. S MM=0 F S MM=$O(PERS("PT","CHILD",MM)) Q:'MM S PT=PERS("PT","CHILD",MM) D
. . I ($P(EZ,U,2,3)=$P(PT,U,2,3))!($$CMORE^EASEZC2(EZ,PT)) D
. . . S PERS("EZ",TYPE,M,"IENS")=PERS("PT","CHILD",MM,"IENS")
. . . K PERS("PT","CHILD",MM)
;
;get identifying data for child in database
F TYPE="CHILD1","CHILD(N)" S M=0 F S M=$O(PERS("EZ",TYPE,M)) Q:'M D
. S IENS=$G(PERS("EZ",TYPE,M,"IENS"))
. Q:IENS=""
. S GRP=$S(TYPE="CHILD1":"C1",1:"CN")
. ;associate each ien with file/subfile
. S B=0 F FF=408.12,408.13,408.21,408.22 D
. . S B=B+1,IEN=+$P(IENS,U,B)
. . Q:'IEN
. . S (FILE,SUBF)=FF
. . S FLD=0 F S FLD=$O(^TMP("EZINDEX",$J,GRP,FILE,SUBF,FLD)) Q:FLD="" D
. . . S MAP=FILE_U_SUBF_U_FLD
. . . S GRP1=GRP I EASVRSN>5.99,FILE=408.21,"^.08^.14^.17^2.01^2.03^2.04^"[("^"_FLD_"^") S GRP1="CN"
. . . ;get patient database data
. . . S VDATA=$$GET^EASEZC1(IEN,MAP)
. . . ;I FILE=408.21 W !,FLD,?8,TYPE,?18,M,?21,VDATA ;instrumentation for testing
. . . ;store link in all 1010EZ elements associated with this file/subfile
. . . ;store patient data in tmp array and link in subfile #712.01; KEY is ien to file #711
. . . S KEY=$O(^TMP("EZINDEX",$J,GRP1,FILE,SUBF,FLD,0)) Q:'KEY D
. . . . S MM=M I EASVRSN>5.99,FILE=408.21,"^.08^.14^.17^2.01^2.03^2.04^"[("^"_FLD_"^") S:(TYPE="CHILD(N)") MM=M+1
. . . . ;I FILE=408.21 W !,"*",FLD,?8,TYPE,?18,MM,?21,VDATA ;instrumentation for testing
. . . . S ^TMP("EZDATA",$J,KEY,MM,2)=VDATA
. . . . S EASAEL=$P($G(^TMP("EZDATA",$J,KEY,MM,1)),U,3)
. . . . I EASAEL D LINKUP^EASEZU1(EASAPP,EASAEL,IEN)
. . . . I 'EASAEL,VDATA'="" D ADD71201^EASEZU1(EASAPP,KEY,IEN,1)
. . ;get data in subfile #408.1275
. . I FILE=408.12 S SUBF=408.1275 S FLD=0 F S FLD=$O(^TMP("EZINDEX",$J,GRP,FILE,SUBF,FLD)) Q:FLD="" D
. . . S SUBIEN=$$I1275^EASEZI(IEN)
. . . S MAP=FILE_U_SUBF_U_FLD,WHERE=IEN_";"_SUBIEN
. . . S VDATA=$$GET^EASEZC1(WHERE,MAP)
. . . ;store link in all 1010EZ elements associated with this file/subfile
. . . ;store patient data in tmp array and link in subfile #712.01; KEY is ien to file #711
. . . S KEY=0 F S KEY=$O(^TMP("EZINDEX",$J,GRP,FILE,SUBF,FLD,KEY)) Q:'KEY D
. . . . S ^TMP("EZDATA",$J,KEY,MM,2)=VDATA
. . . . S EASAEL=$P($G(^TMP("EZDATA",$J,KEY,MM,1)),U,3)
. . . . I EASAEL D LINKUP^EASEZU1(EASAPP,EASAEL,WHERE)
. . . . I 'EASAEL,VDATA'="" D ADD71201^EASEZU1(EASAPP,KEY,WHERE,1)
Q
;
CMORE(EZ,PT) ;
;input EZ = name^ssn^dob of child on 1010EZ
; PT = name^ssn^dob of child in database
;output MATCH = 0, if no match
N PSSN,PDOB,ESSN,EDOB,K,MATCH,MATCH1,MATCH2
S (MATCH,MATCH1,MATCH2)=0
S ESSN=$P(EZ,U,2),EDOB=$P(EZ,U,3),PSSN=$P(PT,U,2),PDOB=$P(PT,U,3)
S MATCH1=0 F K=1,2,3,5,6,8,9,10,11 I $P(ESSN,U,K)=$P(PSSN,U,K) S MATCH1=MATCH1+1
I $P(EDOB,"/",3)=$P(PDOB,"/",3) S MATCH2=1
I MATCH1>7,MATCH2 S MATCH=1
Q MATCH
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HEASEZC2 6702 printed Oct 16, 2024@17:55:13 Page 2
EASEZC2 ;ALB/jap - Compare 1010EZ Data with VistA Database ;10/16/00 13:08
+1 ;;1.0;ENROLLMENT APPLICATION SYSTEM;**1,51,70**;Mar 15, 2001;Build 26
+2 ;
A408 ;get applicant financial data from VistA
+1 NEW IENS,IEN,B,FF,FILE,SUBF,FLD,MAP,VDATA,KEY,EASAEL
+2 SET IENS=$GET(INCREL(408,"V",1))
+3 if IENS=""
QUIT
+4 ;associate each ien with file/subfile
+5 SET B=0
FOR FF=408.12,2,408.21,408.22
Begin DoDot:1
+6 SET B=B+1
SET IEN=+$PIECE(IENS,U,B)
+7 if 'IEN
QUIT
if FF=2
QUIT
+8 SET (FILE,SUBF)=FF
+9 SET FLD=0
FOR
SET FLD=$ORDER(^TMP("EZINDEX",$JOB,"A",FILE,SUBF,FLD))
if FLD=""
QUIT
Begin DoDot:2
+10 SET MAP=FILE_U_SUBF_U_FLD
+11 ;get patient database data
+12 SET VDATA=$$GET^EASEZC1(IEN,MAP)
+13 ;store link in all 1010EZ elements associated with this file/subfile
+14 ;store patient data in tmp array and link in subfile #712.01; KEY is ien to file #711
+15 SET KEY=0
FOR
SET KEY=$ORDER(^TMP("EZINDEX",$JOB,"A",FILE,SUBF,FLD,KEY))
if 'KEY
QUIT
Begin DoDot:3
+16 SET ^TMP("EZDATA",$JOB,KEY,1,2)=VDATA
+17 SET EASAEL=$PIECE($GET(^TMP("EZDATA",$JOB,KEY,1,1)),U,3)
+18 IF EASAEL
DO LINKUP^EASEZU1(EASAPP,EASAEL,IEN)
+19 IF 'EASAEL
IF VDATA'=""
DO ADD71201^EASEZU1(EASAPP,KEY,IEN,1)
End DoDot:3
End DoDot:2
End DoDot:1
+20 QUIT
+21 ;
SP408 ;get spouse financial data from VistA
+1 ;
+2 NEW B,TYPE,MAP,M,MM,NSD,OUT,X,IEN,IENS,KEY,FILE,FF,FFF,FLD,SUBF,SUBIEN,VDATA,WHERE
+3 ;get identifying data for database spouse
+4 SET IENS=$GET(INCREL(408,"S",1))
+5 if IENS=""
QUIT
+6 ;associate each ien with file/subfile
+7 SET B=0
FOR FF=408.12,408.13,408.21,408.22
Begin DoDot:1
+8 SET B=B+1
SET IEN=+$PIECE(IENS,U,B)
+9 if 'IEN
QUIT
+10 SET (FILE,SUBF)=FF
+11 SET FLD=0
FOR
SET FLD=$ORDER(^TMP("EZINDEX",$JOB,"S",FILE,SUBF,FLD))
if FLD=""
QUIT
Begin DoDot:2
+12 SET MAP=FILE_U_SUBF_U_FLD
+13 ;get patient database data
+14 SET VDATA=$$GET^EASEZC1(IEN,MAP)
+15 ;store link in all 1010EZ elements associated with this file/subfile
+16 ;store patient data in tmp array and link in subfile #712.01; KEY is ien to file #711
+17 SET KEY=0
FOR
SET KEY=$ORDER(^TMP("EZINDEX",$JOB,"S",FILE,SUBF,FLD,KEY))
if 'KEY
QUIT
Begin DoDot:3
+18 SET ^TMP("EZDATA",$JOB,KEY,1,2)=VDATA
+19 SET EASAEL=$PIECE($GET(^TMP("EZDATA",$JOB,KEY,1,1)),U,3)
+20 IF EASAEL
DO LINKUP^EASEZU1(EASAPP,EASAEL,IEN)
+21 IF 'EASAEL
IF VDATA'=""
DO ADD71201^EASEZU1(EASAPP,KEY,IEN,1)
End DoDot:3
End DoDot:2
+22 ;get data in subfile #408.1275
+23 IF FILE=408.12
SET SUBF=408.1275
SET FLD=0
FOR
SET FLD=$ORDER(^TMP("EZINDEX",$JOB,"S",FILE,SUBF,FLD))
if FLD=""
QUIT
Begin DoDot:2
+24 SET SUBIEN=$$I1275^EASEZI(IEN)
+25 SET MAP=FILE_U_SUBF_U_FLD
SET WHERE=IEN_";"_SUBIEN
+26 SET VDATA=$$GET^EASEZC1(WHERE,MAP)
+27 ;store link in all 1010EZ elements associated with this file/subfile
+28 ;store patient data in tmp array and link in subfile #712.01; KEY is ien to file #711
+29 SET KEY=0
FOR
SET KEY=$ORDER(^TMP("EZINDEX",$JOB,"S",FILE,SUBF,FLD,KEY))
if 'KEY
QUIT
Begin DoDot:3
+30 SET ^TMP("EZDATA",$JOB,KEY,1,2)=VDATA
+31 SET EASAEL=$PIECE($GET(^TMP("EZDATA",$JOB,KEY,1,1)),U,3)
+32 IF EASAEL
DO LINKUP^EASEZU1(EASAPP,EASAEL,WHERE)
+33 IF 'EASAEL
IF VDATA'=""
DO ADD71201^EASEZU1(EASAPP,KEY,WHERE,1)
End DoDot:3
End DoDot:2
End DoDot:1
+34 QUIT
+35 ;
C1N408 ;get child/dependent financial data from VistA
+1 NEW B,PERS,EZ,PT,TYPE,GRP,GRP1,MAP,M,MM,NSD,OUT,X,IEN,IENS,FLD,FF,FFF,FILE,SUBF,SUBIEN,VDATA,WHERE
+2 ;
+3 ;get identifying data for 1010EZ child dependents
+4 KILL PERS("EZ")
+5 SET TYPE="CHILD1"
SET X=$$NSD^EASEZU3(EASAPP,TYPE,1)
IF X'=""
SET PERS("EZ",TYPE,1)=X
+6 SET TYPE="CHILD(N)"
SET M=0
SET OUT=0
FOR
SET M=M+1
Begin DoDot:1
+7 SET X=$$NSD^EASEZU3(EASAPP,TYPE,M)
+8 IF X=""
SET OUT=1
QUIT
+9 SET PERS("EZ",TYPE,M)=X
End DoDot:1
if OUT
QUIT
+10 ;
+11 ;get identifying data for all database dependents
+12 KILL PERS("PT")
+13 SET M=0
SET MM=0
FOR
SET M=$ORDER(INCREL(408,"C",M))
if 'M
QUIT
Begin DoDot:1
+14 SET IEN=+$PIECE(INCREL(408,"C",M),U,2)
+15 SET NSD=""
FOR FLD=".01",".09",".03"
Begin DoDot:2
+16 SET FFF="408.13^408.13^"_FLD
SET X=$$GET^EASEZC1(IEN,FFF)
+17 IF FLD=".09"
SET X=$$SSNOUT^EASEZT1(X)
+18 SET NSD=NSD_X_U
End DoDot:2
+19 SET MM=MM+1
SET PERS("PT","CHILD",MM)=NSD
SET PERS("PT","CHILD",MM,"IENS")=INCREL(408,"C",M)
End DoDot:1
+20 ;
+21 ;match each EZ child dependent to database dependent if possible
+22 FOR TYPE="CHILD1","CHILD(N)"
SET M=0
FOR
SET M=$ORDER(PERS("EZ",TYPE,M))
if 'M
QUIT
Begin DoDot:1
+23 SET EZ=PERS("EZ",TYPE,M)
+24 SET MM=0
FOR
SET MM=$ORDER(PERS("PT","CHILD",MM))
if 'MM
QUIT
SET PT=PERS("PT","CHILD",MM)
Begin DoDot:2
+25 IF ($PIECE(EZ,U,2,3)=$PIECE(PT,U,2,3))!($$CMORE^EASEZC2(EZ,PT))
Begin DoDot:3
+26 SET PERS("EZ",TYPE,M,"IENS")=PERS("PT","CHILD",MM,"IENS")
+27 KILL PERS("PT","CHILD",MM)
End DoDot:3
End DoDot:2
End DoDot:1
+28 ;
+29 ;get identifying data for child in database
+30 FOR TYPE="CHILD1","CHILD(N)"
SET M=0
FOR
SET M=$ORDER(PERS("EZ",TYPE,M))
if 'M
QUIT
Begin DoDot:1
+31 SET IENS=$GET(PERS("EZ",TYPE,M,"IENS"))
+32 if IENS=""
QUIT
+33 SET GRP=$SELECT(TYPE="CHILD1":"C1",1:"CN")
+34 ;associate each ien with file/subfile
+35 SET B=0
FOR FF=408.12,408.13,408.21,408.22
Begin DoDot:2
+36 SET B=B+1
SET IEN=+$PIECE(IENS,U,B)
+37 if 'IEN
QUIT
+38 SET (FILE,SUBF)=FF
+39 SET FLD=0
FOR
SET FLD=$ORDER(^TMP("EZINDEX",$JOB,GRP,FILE,SUBF,FLD))
if FLD=""
QUIT
Begin DoDot:3
+40 SET MAP=FILE_U_SUBF_U_FLD
+41 SET GRP1=GRP
IF EASVRSN>5.99
IF FILE=408.21
IF "^.08^.14^.17^2.01^2.03^2.04^"[("^"_FLD_"^")
SET GRP1="CN"
+42 ;get patient database data
+43 SET VDATA=$$GET^EASEZC1(IEN,MAP)
+44 ;I FILE=408.21 W !,FLD,?8,TYPE,?18,M,?21,VDATA ;instrumentation for testing
+45 ;store link in all 1010EZ elements associated with this file/subfile
+46 ;store patient data in tmp array and link in subfile #712.01; KEY is ien to file #711
+47 SET KEY=$ORDER(^TMP("EZINDEX",$JOB,GRP1,FILE,SUBF,FLD,0))
if 'KEY
QUIT
Begin DoDot:4
+48 SET MM=M
IF EASVRSN>5.99
IF FILE=408.21
IF "^.08^.14^.17^2.01^2.03^2.04^"[("^"_FLD_"^")
if (TYPE="CHILD(N)")
SET MM=M+1
+49 ;I FILE=408.21 W !,"*",FLD,?8,TYPE,?18,MM,?21,VDATA ;instrumentation for testing
+50 SET ^TMP("EZDATA",$JOB,KEY,MM,2)=VDATA
+51 SET EASAEL=$PIECE($GET(^TMP("EZDATA",$JOB,KEY,MM,1)),U,3)
+52 IF EASAEL
DO LINKUP^EASEZU1(EASAPP,EASAEL,IEN)
+53 IF 'EASAEL
IF VDATA'=""
DO ADD71201^EASEZU1(EASAPP,KEY,IEN,1)
End DoDot:4
End DoDot:3
+54 ;get data in subfile #408.1275
+55 IF FILE=408.12
SET SUBF=408.1275
SET FLD=0
FOR
SET FLD=$ORDER(^TMP("EZINDEX",$JOB,GRP,FILE,SUBF,FLD))
if FLD=""
QUIT
Begin DoDot:3
+56 SET SUBIEN=$$I1275^EASEZI(IEN)
+57 SET MAP=FILE_U_SUBF_U_FLD
SET WHERE=IEN_";"_SUBIEN
+58 SET VDATA=$$GET^EASEZC1(WHERE,MAP)
+59 ;store link in all 1010EZ elements associated with this file/subfile
+60 ;store patient data in tmp array and link in subfile #712.01; KEY is ien to file #711
+61 SET KEY=0
FOR
SET KEY=$ORDER(^TMP("EZINDEX",$JOB,GRP,FILE,SUBF,FLD,KEY))
if 'KEY
QUIT
Begin DoDot:4
+62 SET ^TMP("EZDATA",$JOB,KEY,MM,2)=VDATA
+63 SET EASAEL=$PIECE($GET(^TMP("EZDATA",$JOB,KEY,MM,1)),U,3)
+64 IF EASAEL
DO LINKUP^EASEZU1(EASAPP,EASAEL,WHERE)
+65 IF 'EASAEL
IF VDATA'=""
DO ADD71201^EASEZU1(EASAPP,KEY,WHERE,1)
End DoDot:4
End DoDot:3
End DoDot:2
End DoDot:1
+66 QUIT
+67 ;
CMORE(EZ,PT) ;
+1 ;input EZ = name^ssn^dob of child on 1010EZ
+2 ; PT = name^ssn^dob of child in database
+3 ;output MATCH = 0, if no match
+4 NEW PSSN,PDOB,ESSN,EDOB,K,MATCH,MATCH1,MATCH2
+5 SET (MATCH,MATCH1,MATCH2)=0
+6 SET ESSN=$PIECE(EZ,U,2)
SET EDOB=$PIECE(EZ,U,3)
SET PSSN=$PIECE(PT,U,2)
SET PDOB=$PIECE(PT,U,3)
+7 SET MATCH1=0
FOR K=1,2,3,5,6,8,9,10,11
IF $PIECE(ESSN,U,K)=$PIECE(PSSN,U,K)
SET MATCH1=MATCH1+1
+8 IF $PIECE(EDOB,"/",3)=$PIECE(PDOB,"/",3)
SET MATCH2=1
+9 IF MATCH1>7
IF MATCH2
SET MATCH=1
+10 QUIT MATCH