EASEZC1 ;ALB/jap/pjh - Compare 1010EZ Data with VistA Database ; 11/5/09 5:46pm
;;1.0;ENROLLMENT APPLICATION SYSTEM;**1,51,92**;Mar 15, 2001;Build 20
;
EN(EASAPP,EASDFN) ;this entry point is called as soon as user has selected an Application
;
;input
; EASAPP = application ien in file #712
; EASDFN = ien in file #2; if 0, then application not yet linked to file #2
;output
; ^TMP("EZDATA" where
; ^TMP("EZDATA",$J,ien_file711)=file#^subfile#^field#^data_id
; ^TMP("EZDATA",$J,ien_file711,multiple,1)=ezdata^accept_flag^subien_subfile712.01
; ^TMP("EZDATA",$J,ien_file711,multiple,2)=vista_data^link_ien
;
N IEN,KEY,SUBIEN,ACCEPT,FFF,LINK,MULTIPLE,ORIG,UPD,X,Y,C2711KEY
;don't continue if passed in dfn doesn't match link
I $G(EASDFN),$P($G(^EAS(712,EASAPP,0)),U,10)'=EASDFN S EASDFN="" Q
;don't continue if link to file #2 not available
I '$G(EASDFN) S EASDFN=+$P($G(^EAS(712,EASAPP,0)),U,10)
;if applicant is new to database, user accept/not accept of data elements is constrained
S EASEZNEW=$P(^EAS(712,EASAPP,0),U,11)
;display/file/print varies with version
S EASVRSN=$$VERSION^EASEZU4(EASAPP) ;alb/cmf/51
;
; setup local mapping array
D LOCAL711^EASEZU2
;need this for later
S C2711KEY=+$$KEY711^EASEZU1("TYPE OF BENEFIT-ENROLLMENT")
;correlate #712 data with tmp mapping array
S SUBIEN=0 F S SUBIEN=$O(^EAS(712,EASAPP,10,SUBIEN)) Q:'SUBIEN D
.S X=^EAS(712,EASAPP,10,SUBIEN,0)
.S (IEN,KEY)=$P(X,U,1),MULTIPLE=$P(X,U,2),ACCEPT=$P(X,U,3),FFF=$P(^TMP("EZDATA",$J,IEN),U,1,3)
.S X=$G(^EAS(712,EASAPP,10,SUBIEN,1)),ORIG=$P(X,U,1),UPD=$P(X,U,2)
.;if link exists, it is pointer to Vista database record for an existing patient
.; or possibly a 'new' patient (i.e., this applicant's data), if this is done post filing
.S LINK=$P($G(^EAS(712,EASAPP,10,SUBIEN,2)),U,2)
.;eliminate some garbage from web app
.I (ORIG="-")!(ORIG="--")!(ORIG="//") S ORIG=""
.Q:((ORIG="")&(UPD=""))
.I UPD="" S ^TMP("EZDATA",$J,IEN,MULTIPLE,1)=ORIG_U_ACCEPT_U_SUBIEN
.E S ^TMP("EZDATA",$J,IEN,MULTIPLE,1)=UPD_U_ACCEPT_U_SUBIEN
.;if this applicant is new to VistA database, there is no existing patient data for comparison
.;just pickup name,ssn,dob anyway;
.I EASEZNEW,EASDFN D
..S F=$P(FFF,U,1),SF=$P(FFF,U,2),FD=$P(FFF,U,3)
..I F=2,SF=2 I (FD=.01)!(FD=.02)!(FD=.03)!(FD=.09) S LINK=EASDFN
..K F,SF,FD
.;if link to database exists then get VistA data into tmp array
.I 'LINK,$P(FFF,U,1)=2 S LINK=EASDFN
.I LINK D
..S X=$$GET(LINK,FFF) S:X=-1 X="" S ^TMP("EZDATA",$J,IEN,MULTIPLE,2)=X_U_LINK
..;special for file #27.11 (Enrollment) data
..I KEY=C2711KEY D
...S CUR=$P($G(^EAS(712,EASAPP,10,SUBIEN,2)),U,2)
...D ENR(CUR,.VDATA) K CUR
...S ^TMP("EZDATA",$J,IEN,MULTIPLE,2)=VDATA_U_LINK K VDATA
..I $G(^TMP("EZDATA",$J,IEN,MULTIPLE,1))="" S ^TMP("EZDATA",$J,IEN,MULTIPLE,1)=U_ACCEPT_U_SUBIEN
D C206^EASEZC3 ;alb/cmf/51 special for ethnicity multiple
D C202^EASEZC3 ;alb/cmf/51 special for race multiple
D C3216^EASEZC3 ;pjh special for military service multiple
;set 'transformed' data into ^TMP("EZDISP" array
D SORT^EASEZC3(EASAPP)
Q
;
GET(EASLINK,EASFFF) ;get data from existing Patient database
;input EASLINK = IEN(s) needed
; format: file_ien;subfile_ien
; EASFFF = field # for file or subfile
; format: file#^subfile#^field#
;output RTR = data obtained from Patient database; external format;
; OR -1 if invalid input
;
N FILE,SUBFILE,FIELD,RTR,ARRAY,DA,DR,DIC,DIQ,X,Y
S FILE=$P(EASFFF,U,1),SUBFILE=$P(EASFFF,U,2),FIELD=$P(EASFFF,U,3)
I ('FILE)!('FIELD) Q -1
I SUBFILE,SUBFILE'=FILE,EASLINK'[";" Q -1
I EASLINK[";",SUBFILE="" Q -1
;
I (SUBFILE="")!(SUBFILE=FILE) D
.;data in main file
.S DIQ="ARRAY",DIQ(0)="E",DA=EASLINK,DR=FIELD,DIC=FILE
.D EN^DIQ1
.S RTR=$G(ARRAY(FILE,EASLINK,FIELD,"E"))
I SUBFILE'="",SUBFILE'=FILE D
.;data in subfile
.;in this case EASLINK = file_ien;subfile_ien
.S DIQ="ARRAY",DIQ(0)="E",DA=$P(EASLINK,";",1),DIC=FILE
.;get field # for subfile
.S DR=$O(^DD(FILE,"SB",SUBFILE,0))
.S DR(SUBFILE)=FIELD,DA(SUBFILE)=$P(EASLINK,";",2)
.D EN^DIQ1
.S RTR=$G(ARRAY(SUBFILE,$P(EASLINK,";",2),FIELD,"E"))
Q RTR
;
;
C2 ;get data from file #2 into local array L711
;there are alot of fields; quickest just to order thru local mapping file
;
N KEY,MAP,VDATA,EASAEL
;2nd subscript for array is always 1 (no multiples)
S KEY=0 F S KEY=$O(^TMP("EZDATA",$J,KEY)) Q:'KEY S MAP=^TMP("EZDATA",$J,KEY) I ($P(MAP,U,1)=2)&($P(MAP,U,2)=2) D
.S EASAEL=$P($G(^TMP("EZDATA",$J,KEY,1,1)),U,3)
.S VDATA=$$GET(EASDFN,MAP)
.Q:VDATA=-1 Q:VDATA=""
.;special handling for field #.362
.I ($P(MAP,U,1)=5)="I;14D3." D
..I VDATA["IN LIEU OF VA COMP" S VDATA="YES"
..I VDATA="YES, RECEIVING MILITARY RETIREMENT" S VDATA="NO"
.;ien to #711 is 1st subscript of local array is
.S ^TMP("EZDATA",$J,KEY,1,2)=VDATA
.;if data exists in 1010EZ then insert link to file #2
.I EASAEL D LINKUP^EASEZU1(EASAPP,EASAEL,EASDFN)
.;if data does not exist in 1010EZ add subrecord to hold link
.I 'EASAEL D ADD71201^EASEZU1(EASAPP,KEY,EASDFN,1)
Q
;
C201 ;get data in Alias subfile #2.01 into local array L711
; using ien(s) local array ALIAS
;
;for Alias name(s) - if other name on 1010EZ doesn't match any on file
; then it will be auto-accepted; comparision only with matching name if any.
N X,M,B,ADATA,VDATA,KEY,EASAEL
S KEY=+$$KEY711^EASEZU1("APPLICANT OTHER NAME")
S M=0 F S M=$O(^TMP("EZDATA",$J,KEY,M)) Q:'M D
.S ADATA=$P(^TMP("EZDATA",$J,KEY,M,1),U,1)
.S B=0 F S B=$O(ALIAS(B)) Q:'B D
..S VDATA=$$GET(ALIAS(B),^TMP("EZDATA",$J,KEY)) Q:VDATA=-1
..I VDATA=ADATA D
...S ^TMP("EZDATA",$J,KEY,M,2)=VDATA
...S EASAEL=$P(^TMP("EZDATA",$J,KEY,M,1),U,3)
...;only insert link if data exists in 1010EZ
...I EASAEL D LINKUP^EASEZU1(EASAPP,EASAEL,ALIAS(B))
Q
;
C2101 ;get data in Disposition subfile #2.101 into local array L711
; using ien(s) local array DISPOS
;
;display data on most recent registration if any
;2nd subscript of local array always 1 (no multiples)
N B,X,FLD,KEY,ADATA,VDATA,EASAEL
S FLD=0 F S FLD=$O(^TMP("EZINDEX","A",2,2.101,FLD)) Q:FLD="" D
.S KEY=$O(^TMP("EZINDEX","A",2,2.101,FLD,0))
.S ADATA=$G(^TMP("EZDATA",$J,KEY,1,1))
.S VDATA=$$GET(DISPOS(1),^TMP("EZDATA",$J,KEY))
.Q:VDATA=-1 Q:VDATA=""
.S ^TMP("EZDATA",$J,KEY,1,2)=VDATA
.S EASAEL=$P($G(^TMP("EZDATA",$J,KEY,1,1)),U,3)
.;if data exists in 1010EZ then insert link
.I EASAEL D LINKUP^EASEZU1(EASAPP,EASAEL,DISPOS(1)) Q
.;if data does not exist in 1010EZ add subrecord to hold link
.I 'EASAEL D ADD71201^EASEZU1(EASAPP,KEY,DISPOS(1),1)
Q
;
C2711 ;get data in Current Enrollment #27.11 into local array L711
; using ien(s) local array ENROLL
;
;2nd subscript of local array always 1 (no multiples)
N X,M,B,ADATA,CUR,DGENR,VDATA,KEY,EASAEL
S KEY=+$$KEY711^EASEZU1("TYPE OF BENEFIT-ENROLLMENT")
S CUR=$G(ENROLL(1)),VDATA=""
Q:CUR=-1
Q:CUR=""
D ENR(CUR,.VDATA)
S ^TMP("EZDATA",$J,KEY,1,2)=VDATA
S EASAEL=$P($G(^TMP("EZDATA",$J,KEY,1,1)),U,3)
;if data exists in 1010EZ then insert link
I EASAEL D LINKUP^EASEZU1(EASAPP,EASAEL,CUR)
;if data does not exist in 1010EZ add subrecord to hold link
I 'EASAEL D ADD71201^EASEZU1(EASAPP,KEY,CUR,1)
Q
;
ENR(CUR,VDATA) ;get data for current enrollment from VistA database
;input CUR = pointer to file #27.11
N DGENCAT
S VDATA=""
I $$GET^DGENA(CUR,.DGENR) D
.I $G(DGENR("STATUS"))=10!($G(DGENR("STATUS"))=19)!($G(DGENR("STATUS"))=20) D Q
..S VDATA=$S($G(DGENR("STATUS")):$$EXT^DGENU("STATUS",DGENR("STATUS")),1:"")
.S DGENCAT=$$CATEGORY^DGENA4(+EASDFN)
.S DGENCAT=$$EXTERNAL^DILFD(27.15,.02,"",DGENCAT)
.S VDATA=$S($G(DGENR("PRIORITY")):$$EXT^DGENU("PRIORITY",DGENR("PRIORITY")),1:"")
.S VDATA=VDATA_$S($G(DGENR("SUBGRP"))="":"",1:$$EXT^DGENU("SUBGRP",$G(DGENR("SUBGRP"))))
.S VDATA=VDATA_" | "_DGENCAT
Q
;
C408 ;get data from financial files into tmp mapping array
; using ien(s) local array INCREL
;if no iens for veteran then nothing at all; exit
I $G(INCREL(408,"V",1))="" Q
;link EZ applicant to veteran data
D A408^EASEZC2
;link EZ spouse to spouse data
D SP408^EASEZC2
;link EZ child to child/dependent data
D C1N408^EASEZC2
Q
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HEASEZC1 8354 printed Oct 16, 2024@17:55:12 Page 2
EASEZC1 ;ALB/jap/pjh - Compare 1010EZ Data with VistA Database ; 11/5/09 5:46pm
+1 ;;1.0;ENROLLMENT APPLICATION SYSTEM;**1,51,92**;Mar 15, 2001;Build 20
+2 ;
EN(EASAPP,EASDFN) ;this entry point is called as soon as user has selected an Application
+1 ;
+2 ;input
+3 ; EASAPP = application ien in file #712
+4 ; EASDFN = ien in file #2; if 0, then application not yet linked to file #2
+5 ;output
+6 ; ^TMP("EZDATA" where
+7 ; ^TMP("EZDATA",$J,ien_file711)=file#^subfile#^field#^data_id
+8 ; ^TMP("EZDATA",$J,ien_file711,multiple,1)=ezdata^accept_flag^subien_subfile712.01
+9 ; ^TMP("EZDATA",$J,ien_file711,multiple,2)=vista_data^link_ien
+10 ;
+11 NEW IEN,KEY,SUBIEN,ACCEPT,FFF,LINK,MULTIPLE,ORIG,UPD,X,Y,C2711KEY
+12 ;don't continue if passed in dfn doesn't match link
+13 IF $GET(EASDFN)
IF $PIECE($GET(^EAS(712,EASAPP,0)),U,10)'=EASDFN
SET EASDFN=""
QUIT
+14 ;don't continue if link to file #2 not available
+15 IF '$GET(EASDFN)
SET EASDFN=+$PIECE($GET(^EAS(712,EASAPP,0)),U,10)
+16 ;if applicant is new to database, user accept/not accept of data elements is constrained
+17 SET EASEZNEW=$PIECE(^EAS(712,EASAPP,0),U,11)
+18 ;display/file/print varies with version
+19 ;alb/cmf/51
SET EASVRSN=$$VERSION^EASEZU4(EASAPP)
+20 ;
+21 ; setup local mapping array
+22 DO LOCAL711^EASEZU2
+23 ;need this for later
+24 SET C2711KEY=+$$KEY711^EASEZU1("TYPE OF BENEFIT-ENROLLMENT")
+25 ;correlate #712 data with tmp mapping array
+26 SET SUBIEN=0
FOR
SET SUBIEN=$ORDER(^EAS(712,EASAPP,10,SUBIEN))
if 'SUBIEN
QUIT
Begin DoDot:1
+27 SET X=^EAS(712,EASAPP,10,SUBIEN,0)
+28 SET (IEN,KEY)=$PIECE(X,U,1)
SET MULTIPLE=$PIECE(X,U,2)
SET ACCEPT=$PIECE(X,U,3)
SET FFF=$PIECE(^TMP("EZDATA",$JOB,IEN),U,1,3)
+29 SET X=$GET(^EAS(712,EASAPP,10,SUBIEN,1))
SET ORIG=$PIECE(X,U,1)
SET UPD=$PIECE(X,U,2)
+30 ;if link exists, it is pointer to Vista database record for an existing patient
+31 ; or possibly a 'new' patient (i.e., this applicant's data), if this is done post filing
+32 SET LINK=$PIECE($GET(^EAS(712,EASAPP,10,SUBIEN,2)),U,2)
+33 ;eliminate some garbage from web app
+34 IF (ORIG="-")!(ORIG="--")!(ORIG="//")
SET ORIG=""
+35 if ((ORIG="")&(UPD=""))
QUIT
+36 IF UPD=""
SET ^TMP("EZDATA",$JOB,IEN,MULTIPLE,1)=ORIG_U_ACCEPT_U_SUBIEN
+37 IF '$TEST
SET ^TMP("EZDATA",$JOB,IEN,MULTIPLE,1)=UPD_U_ACCEPT_U_SUBIEN
+38 ;if this applicant is new to VistA database, there is no existing patient data for comparison
+39 ;just pickup name,ssn,dob anyway;
+40 IF EASEZNEW
IF EASDFN
Begin DoDot:2
+41 SET F=$PIECE(FFF,U,1)
SET SF=$PIECE(FFF,U,2)
SET FD=$PIECE(FFF,U,3)
+42 IF F=2
IF SF=2
IF (FD=.01)!(FD=.02)!(FD=.03)!(FD=.09)
SET LINK=EASDFN
+43 KILL F,SF,FD
End DoDot:2
+44 ;if link to database exists then get VistA data into tmp array
+45 IF 'LINK
IF $PIECE(FFF,U,1)=2
SET LINK=EASDFN
+46 IF LINK
Begin DoDot:2
+47 SET X=$$GET(LINK,FFF)
if X=-1
SET X=""
SET ^TMP("EZDATA",$JOB,IEN,MULTIPLE,2)=X_U_LINK
+48 ;special for file #27.11 (Enrollment) data
+49 IF KEY=C2711KEY
Begin DoDot:3
+50 SET CUR=$PIECE($GET(^EAS(712,EASAPP,10,SUBIEN,2)),U,2)
+51 DO ENR(CUR,.VDATA)
KILL CUR
+52 SET ^TMP("EZDATA",$JOB,IEN,MULTIPLE,2)=VDATA_U_LINK
KILL VDATA
End DoDot:3
+53 IF $GET(^TMP("EZDATA",$JOB,IEN,MULTIPLE,1))=""
SET ^TMP("EZDATA",$JOB,IEN,MULTIPLE,1)=U_ACCEPT_U_SUBIEN
End DoDot:2
End DoDot:1
+54 ;alb/cmf/51 special for ethnicity multiple
DO C206^EASEZC3
+55 ;alb/cmf/51 special for race multiple
DO C202^EASEZC3
+56 ;pjh special for military service multiple
DO C3216^EASEZC3
+57 ;set 'transformed' data into ^TMP("EZDISP" array
+58 DO SORT^EASEZC3(EASAPP)
+59 QUIT
+60 ;
GET(EASLINK,EASFFF) ;get data from existing Patient database
+1 ;input EASLINK = IEN(s) needed
+2 ; format: file_ien;subfile_ien
+3 ; EASFFF = field # for file or subfile
+4 ; format: file#^subfile#^field#
+5 ;output RTR = data obtained from Patient database; external format;
+6 ; OR -1 if invalid input
+7 ;
+8 NEW FILE,SUBFILE,FIELD,RTR,ARRAY,DA,DR,DIC,DIQ,X,Y
+9 SET FILE=$PIECE(EASFFF,U,1)
SET SUBFILE=$PIECE(EASFFF,U,2)
SET FIELD=$PIECE(EASFFF,U,3)
+10 IF ('FILE)!('FIELD)
QUIT -1
+11 IF SUBFILE
IF SUBFILE'=FILE
IF EASLINK'[";"
QUIT -1
+12 IF EASLINK[";"
IF SUBFILE=""
QUIT -1
+13 ;
+14 IF (SUBFILE="")!(SUBFILE=FILE)
Begin DoDot:1
+15 ;data in main file
+16 SET DIQ="ARRAY"
SET DIQ(0)="E"
SET DA=EASLINK
SET DR=FIELD
SET DIC=FILE
+17 DO EN^DIQ1
+18 SET RTR=$GET(ARRAY(FILE,EASLINK,FIELD,"E"))
End DoDot:1
+19 IF SUBFILE'=""
IF SUBFILE'=FILE
Begin DoDot:1
+20 ;data in subfile
+21 ;in this case EASLINK = file_ien;subfile_ien
+22 SET DIQ="ARRAY"
SET DIQ(0)="E"
SET DA=$PIECE(EASLINK,";",1)
SET DIC=FILE
+23 ;get field # for subfile
+24 SET DR=$ORDER(^DD(FILE,"SB",SUBFILE,0))
+25 SET DR(SUBFILE)=FIELD
SET DA(SUBFILE)=$PIECE(EASLINK,";",2)
+26 DO EN^DIQ1
+27 SET RTR=$GET(ARRAY(SUBFILE,$PIECE(EASLINK,";",2),FIELD,"E"))
End DoDot:1
+28 QUIT RTR
+29 ;
+30 ;
C2 ;get data from file #2 into local array L711
+1 ;there are alot of fields; quickest just to order thru local mapping file
+2 ;
+3 NEW KEY,MAP,VDATA,EASAEL
+4 ;2nd subscript for array is always 1 (no multiples)
+5 SET KEY=0
FOR
SET KEY=$ORDER(^TMP("EZDATA",$JOB,KEY))
if 'KEY
QUIT
SET MAP=^TMP("EZDATA",$JOB,KEY)
IF ($PIECE(MAP,U,1)=2)&($PIECE(MAP,U,2)=2)
Begin DoDot:1
+6 SET EASAEL=$PIECE($GET(^TMP("EZDATA",$JOB,KEY,1,1)),U,3)
+7 SET VDATA=$$GET(EASDFN,MAP)
+8 if VDATA=-1
QUIT
if VDATA=""
QUIT
+9 ;special handling for field #.362
+10 IF ($PIECE(MAP,U,1)=5)="I;14D3."
Begin DoDot:2
+11 IF VDATA["IN LIEU OF VA COMP"
SET VDATA="YES"
+12 IF VDATA="YES, RECEIVING MILITARY RETIREMENT"
SET VDATA="NO"
End DoDot:2
+13 ;ien to #711 is 1st subscript of local array is
+14 SET ^TMP("EZDATA",$JOB,KEY,1,2)=VDATA
+15 ;if data exists in 1010EZ then insert link to file #2
+16 IF EASAEL
DO LINKUP^EASEZU1(EASAPP,EASAEL,EASDFN)
+17 ;if data does not exist in 1010EZ add subrecord to hold link
+18 IF 'EASAEL
DO ADD71201^EASEZU1(EASAPP,KEY,EASDFN,1)
End DoDot:1
+19 QUIT
+20 ;
C201 ;get data in Alias subfile #2.01 into local array L711
+1 ; using ien(s) local array ALIAS
+2 ;
+3 ;for Alias name(s) - if other name on 1010EZ doesn't match any on file
+4 ; then it will be auto-accepted; comparision only with matching name if any.
+5 NEW X,M,B,ADATA,VDATA,KEY,EASAEL
+6 SET KEY=+$$KEY711^EASEZU1("APPLICANT OTHER NAME")
+7 SET M=0
FOR
SET M=$ORDER(^TMP("EZDATA",$JOB,KEY,M))
if 'M
QUIT
Begin DoDot:1
+8 SET ADATA=$PIECE(^TMP("EZDATA",$JOB,KEY,M,1),U,1)
+9 SET B=0
FOR
SET B=$ORDER(ALIAS(B))
if 'B
QUIT
Begin DoDot:2
+10 SET VDATA=$$GET(ALIAS(B),^TMP("EZDATA",$JOB,KEY))
if VDATA=-1
QUIT
+11 IF VDATA=ADATA
Begin DoDot:3
+12 SET ^TMP("EZDATA",$JOB,KEY,M,2)=VDATA
+13 SET EASAEL=$PIECE(^TMP("EZDATA",$JOB,KEY,M,1),U,3)
+14 ;only insert link if data exists in 1010EZ
+15 IF EASAEL
DO LINKUP^EASEZU1(EASAPP,EASAEL,ALIAS(B))
End DoDot:3
End DoDot:2
End DoDot:1
+16 QUIT
+17 ;
C2101 ;get data in Disposition subfile #2.101 into local array L711
+1 ; using ien(s) local array DISPOS
+2 ;
+3 ;display data on most recent registration if any
+4 ;2nd subscript of local array always 1 (no multiples)
+5 NEW B,X,FLD,KEY,ADATA,VDATA,EASAEL
+6 SET FLD=0
FOR
SET FLD=$ORDER(^TMP("EZINDEX","A",2,2.101,FLD))
if FLD=""
QUIT
Begin DoDot:1
+7 SET KEY=$ORDER(^TMP("EZINDEX","A",2,2.101,FLD,0))
+8 SET ADATA=$GET(^TMP("EZDATA",$JOB,KEY,1,1))
+9 SET VDATA=$$GET(DISPOS(1),^TMP("EZDATA",$JOB,KEY))
+10 if VDATA=-1
QUIT
if VDATA=""
QUIT
+11 SET ^TMP("EZDATA",$JOB,KEY,1,2)=VDATA
+12 SET EASAEL=$PIECE($GET(^TMP("EZDATA",$JOB,KEY,1,1)),U,3)
+13 ;if data exists in 1010EZ then insert link
+14 IF EASAEL
DO LINKUP^EASEZU1(EASAPP,EASAEL,DISPOS(1))
QUIT
+15 ;if data does not exist in 1010EZ add subrecord to hold link
+16 IF 'EASAEL
DO ADD71201^EASEZU1(EASAPP,KEY,DISPOS(1),1)
End DoDot:1
+17 QUIT
+18 ;
C2711 ;get data in Current Enrollment #27.11 into local array L711
+1 ; using ien(s) local array ENROLL
+2 ;
+3 ;2nd subscript of local array always 1 (no multiples)
+4 NEW X,M,B,ADATA,CUR,DGENR,VDATA,KEY,EASAEL
+5 SET KEY=+$$KEY711^EASEZU1("TYPE OF BENEFIT-ENROLLMENT")
+6 SET CUR=$GET(ENROLL(1))
SET VDATA=""
+7 if CUR=-1
QUIT
+8 if CUR=""
QUIT
+9 DO ENR(CUR,.VDATA)
+10 SET ^TMP("EZDATA",$JOB,KEY,1,2)=VDATA
+11 SET EASAEL=$PIECE($GET(^TMP("EZDATA",$JOB,KEY,1,1)),U,3)
+12 ;if data exists in 1010EZ then insert link
+13 IF EASAEL
DO LINKUP^EASEZU1(EASAPP,EASAEL,CUR)
+14 ;if data does not exist in 1010EZ add subrecord to hold link
+15 IF 'EASAEL
DO ADD71201^EASEZU1(EASAPP,KEY,CUR,1)
+16 QUIT
+17 ;
ENR(CUR,VDATA) ;get data for current enrollment from VistA database
+1 ;input CUR = pointer to file #27.11
+2 NEW DGENCAT
+3 SET VDATA=""
+4 IF $$GET^DGENA(CUR,.DGENR)
Begin DoDot:1
+5 IF $GET(DGENR("STATUS"))=10!($GET(DGENR("STATUS"))=19)!($GET(DGENR("STATUS"))=20)
Begin DoDot:2
+6 SET VDATA=$SELECT($GET(DGENR("STATUS")):$$EXT^DGENU("STATUS",DGENR("STATUS")),1:"")
End DoDot:2
QUIT
+7 SET DGENCAT=$$CATEGORY^DGENA4(+EASDFN)
+8 SET DGENCAT=$$EXTERNAL^DILFD(27.15,.02,"",DGENCAT)
+9 SET VDATA=$SELECT($GET(DGENR("PRIORITY")):$$EXT^DGENU("PRIORITY",DGENR("PRIORITY")),1:"")
+10 SET VDATA=VDATA_$SELECT($GET(DGENR("SUBGRP"))="":"",1:$$EXT^DGENU("SUBGRP",$GET(DGENR("SUBGRP"))))
+11 SET VDATA=VDATA_" | "_DGENCAT
End DoDot:1
+12 QUIT
+13 ;
C408 ;get data from financial files into tmp mapping array
+1 ; using ien(s) local array INCREL
+2 ;if no iens for veteran then nothing at all; exit
+3 IF $GET(INCREL(408,"V",1))=""
QUIT
+4 ;link EZ applicant to veteran data
+5 DO A408^EASEZC2
+6 ;link EZ spouse to spouse data
+7 DO SP408^EASEZC2
+8 ;link EZ child to child/dependent data
+9 DO C1N408^EASEZC2
+10 QUIT