EASEZPV2 ;ALB/AMA/GTS/CMF - GATHER VISTA MEANS TEST DATA TO PRINT FROM DG OPTIONS ; 8/1/08 1:27pm
;;1.0;ENROLLMENT APPLICATION SYSTEM;**57,66,70**;Mar 15, 2001;Build 26
;
V408(EASDFN,EASMTIEN) ;GATHER MEANS TEST DATA -- CALLED FROM VISTA^EASEZPVD
; INPUT:
; EASDFN - POINTER TO PATIENT FILE (#2)
; EASMTIEN - MeansTestIEN (#408.31)
N MTIFN,MTDT,INCREL
S MTIFN=+$G(EASMTIEN)
S MTDT=$$GET1^DIQ(408.31,MTIFN_",",.01,"I")
;
;GET DATA FROM FILES 408.12, 408.13, 408.21, AND 408.22
D I408^EASEZPVI(EASDFN,MTDT,.INCREL)
I $D(INCREL)>1 D
. ;MODIFIED FROM A408^EASEZC2
. N IENS,B,FILE,M,MM,TYPE,IEN,NSD,FLD,IEN2
. N FFF,PERS,GRP,GRP1,SUBF,SUBIEN,WHERE
. S IENS=$G(INCREL(408,"V",1))
. ;ADD "INCOME YEAR" AND "DECLINES TO GIVE INFO" INTO ^TMP GLOBALS
. N EZTMPIEN
. S EZTMPIEN=$O(^TMP("EZDATA",$J,""),-1)+1
. S ^TMP("EZDATA",$J,EZTMPIEN)="408.21^408.21^.01^IIC;999^Income Year"
. S ^TMP("EZINDEX",$J,"A",408.21,408.21,.01,EZTMPIEN)=EZTMPIEN_"^APPLICANT INCOME YEAR"
. S EZTMPIEN=EZTMPIEN+1
. S ^TMP("EZDATA",$J,EZTMPIEN)="408.31^408.31^.14^IIC;998^Declines To Give Info"
. S ^TMP("EZINDEX",$J,"A",408.31,408.31,.14,EZTMPIEN)=EZTMPIEN_"^APPLICANT DECLINES TO GIVE INFO"
. I MTIFN>0 S B=0 D GET408(408.31,"A",MTIFN)
. S IEN=$P(IENS,U,3),IEN2=$P(IENS,U,4) ;EAS*66 - GENERATE ADJ EXP
. I +IEN,+IEN2 D GROSS^DGMTSCU4(IEN,EASDFN,MTDT,IEN2)
. ;
. I IENS S B=0 F FILE=408.12,2,408.21,408.22 D GET408(FILE,"A",IENS)
. ;MODIFIED FROM SP408^EASEZC2
. S IENS=$G(INCREL(408,"S",1))
. I IENS S B=0 F FILE=408.12,408.13,408.21,408.22 D GET408(FILE,"S",IENS)
. ;EAS*1.0*70 -- GET SPOUSE GROSS ANNUAL INCOME AND NET WORTH
. D SPGAINW
. ;
. ;MODIFIED FROM C1N408^EASEZC2
. S (M,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_U_408.13_U_FLD,VDATA=$$GET^EASEZC1(IEN,FFF)
. . . I FLD=.09 S VDATA=$$SSNOUT^EASEZT1(VDATA)
. . . I FLD=.03 S VDATA=$$XDATE^EASEZT1(VDATA)
. . . S NSD=NSD_VDATA_U
. . I MM=0 D I 1
. . . S MM=1
. . . S PERS("EZ","CHILD1",1)=NSD
. . . S PERS("EZ","CHILD1",1,"IENS")=INCREL(408,"C",M)
. . E D
. . . S PERS("EZ","CHILD(N)",MM)=NSD
. . . S PERS("EZ","CHILD(N)",MM,"IENS")=INCREL(408,"C",M)
. . . S MM=MM+1
. ;
. ;get identifying data for child in database
. ;EAS*1.0*70 - duplicate the gross annual income entries
. ; for CHILD1, using the CHILD(N) index IENs
. F FLD=.08,.14,.17 D
. . S KEY=$O(^TMP("EZINDEX",$J,"CN",408.21,408.21,FLD,0)) Q:'KEY
. . S ^TMP("EZINDEX",$J,"C1",408.21,408.21,FLD,KEY)=^TMP("EZINDEX",$J,"CN",408.21,408.21,FLD,KEY)
. ;
. 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 FILE=408.12,408.13,408.21,408.22 D
. . . S B=B+1,IEN=+$P(IENS,U,B) Q:'IEN
. . . I 'MTDT,((FILE=408.21)!(FILE=408.22)) Q
. . . D CONT
. . ;EAS*1.0*70
. . S IEN=$P($G(PERS("EZ",TYPE,M,"IENS")),U,4) Q:'IEN
. . N IATY S IATY=$$GET^EASEZC1(IEN,"408.22^408.22^.12")
. . I IATY'="YES" D Q
. . . I EASVRSN>5.99,(TYPE="CHILD(N)") D DELETE(GRP,(M+1))
. . . E D DELETE(GRP,M)
Q
;
GET408(FILE,SRCE,IENS) ;GATHER THE DATA FROM THE 408 FILES
; INPUT:
; FILE - FILE TO SEARCH
; SRCE - SOURCE OF DATA ("A"PPLICANT, "S"POUSE)
; IENS - IEN FROM THE INCREL ARRAY
;
N IEN,FLD,MAP,VDATA,KEY
;IF NO MEANS TEST, THEN DON'T GATHER ANY MONEY AMOUNTS
I 'MTDT,((FILE=408.21)!(FILE=408.22)) Q
S B=B+1,IEN=+$P(IENS,U,B) Q:'IEN Q:FILE=2
I (FILE=408.22),('MTIFN!($P($G(^DGMT(FILE,+IEN,"MT")),U)'=MTIFN)) Q
S FLD=0 F S FLD=$O(^TMP("EZINDEX",$J,SRCE,FILE,FILE,FLD)) Q:'FLD D
. S MAP=FILE_U_FILE_U_FLD
. S VDATA=$$GET^EASEZC1(IEN,MAP)
. I (FILE=408.31),(FLD=.14) D
. . I (VDATA="")!(VDATA=0) S VDATA="NO"
. . I VDATA=1 S VDATA="YES"
. I (FILE=408.21) D
. . I (FLD=.08) S VDATA=$$SUMSSI^EASEZT2(VDATA,IEN)
. . I (FLD=2.01) S VDATA=$$SUMCASH^EASEZT2(VDATA,IEN)
. . I (FLD=2.04) S VDATA=$$SUMPROP^EASEZT2(VDATA,IEN)
. . Q
. Q:VDATA=-1 Q:VDATA=""
. I (SRCE="S"),(FILE=408.13),(FLD=.09) S VDATA=$$SSNOUT^EASEZT1(VDATA)
. I (SRCE="S"),(FILE=408.13),(FLD=.03) S VDATA=$$XDATE^EASEZT1(VDATA)
. S KEY=0 F S KEY=$O(^TMP("EZINDEX",$J,SRCE,FILE,FILE,FLD,KEY)) Q:'KEY D
. . S ^TMP("EZDATA",$J,KEY,1,2)=VDATA
. . I (FILE=408.21),(SRCE="A") D
. . . I ";2.01;2.03;2.04;"'[(";"_FLD_";") Q
. . . N TEXT,NEWKEY
. . . I FLD=2.01 S TEXT="APPLICANT CASH IN BANK2"
. . . I FLD=2.03 S TEXT="APPLICANT REAL PROPERTY LESS MORTGAGES2"
. . . I FLD=2.04 S TEXT="APPLICANT STOCKS BONDS ASSETS LESS DEBTS2"
. . . S NEWKEY=+$$KEY711^EASEZU1(TEXT)
. . . S ^TMP("EZDATA",$J,NEWKEY,1,2)=VDATA
;
I (FILE=408.12),(SRCE="S") D
. S SUBF=408.1275
. S FLD=0 F S FLD=$O(^TMP("EZINDEX",$J,SRCE,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)
. . Q:VDATA=-1 Q:VDATA=""
. . S KEY=0 F S KEY=$O(^TMP("EZINDEX",$J,SRCE,FILE,SUBF,FLD,KEY)) Q:'KEY D
. . . S ^TMP("EZDATA",$J,KEY,1,2)=VDATA
Q
;
CONT ;CONTINUATION OF CHILD FINANCIAL DATA
;
I (FILE=408.22),('MTIFN!'IEN!($P($G(^DGMT(FILE,+IEN,"MT")),U)'=MTIFN)) Q
S FLD=0 F S FLD=$O(^TMP("EZINDEX",$J,GRP,FILE,FILE,FLD)) Q:FLD="" D
. S MAP=FILE_U_FILE_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"
. S VDATA=$$GET^EASEZC1(IEN,MAP)
. I (FILE=408.21) D
. . I (FLD=.08) S VDATA=$$SUMSSI^EASEZT2(VDATA,IEN)
. . I (FLD=2.01) S VDATA=$$SUMCASH^EASEZT2(VDATA,IEN)
. . I (FLD=2.04) S VDATA=$$SUMPROP^EASEZT2(VDATA,IEN)
. . Q
. Q:VDATA=-1 Q:VDATA=""
. I (FILE=408.13),(FLD=.09) S VDATA=$$SSNOUT^EASEZT1(VDATA)
. I (FILE=408.13),(FLD=.03) S VDATA=$$XDATE^EASEZT1(VDATA)
. ;store link in all 1010EZ elements associated with this file/subfile
. S KEY=$O(^TMP("EZINDEX",$J,GRP1,FILE,FILE,FLD,0)) Q:'KEY
. 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
. S ^TMP("EZDATA",$J,KEY,MM,2)=VDATA
;get data in subfile #408.1275
I FILE=408.12 S SUBF=408.1275 D
. 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)
. . Q:VDATA=-1 Q:VDATA=""
. . ;store link in all 1010EZ elements associated with this file/subfile
. . 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
Q
SPGAINW ;Determine when to print Spouse's
;Gross Annual Income and Net Worth Amounts
N IEN,MLY,LWSP,ACTSP
S IEN=$P($G(INCREL(408,"V",1)),U,4) Q:'IEN
S MLY=$$GET^EASEZC1(IEN,"408.22^408.22^.05")
I MLY'="YES" D DELETE("S",1) Q
;
S LWSP=$$GET^EASEZC1(IEN,"408.22^408.22^.06")
S ACTSP=+$$GET^EASEZC1(IEN,"408.22^408.22^.07")
I (LWSP'="YES"),(ACTSP<600) D DELETE("S",1) Q
Q
DELETE(SRCE,MULT) ;Delete dependent's GAI and NW amounts
N FILE,FLD,KEY,X
S FILE=408.21 F FLD=.08,.14,.17,2.01,2.03,2.04 D
. S KEY=0 F S KEY=$O(^TMP("EZINDEX",$J,SRCE,FILE,FILE,FLD,KEY)) Q:'KEY D
. . F X=1,2 K ^TMP("EZDATA",$J,KEY,MULT,X)
Q
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HEASEZPV2 7382 printed Oct 16, 2024@17:55:45 Page 2
EASEZPV2 ;ALB/AMA/GTS/CMF - GATHER VISTA MEANS TEST DATA TO PRINT FROM DG OPTIONS ; 8/1/08 1:27pm
+1 ;;1.0;ENROLLMENT APPLICATION SYSTEM;**57,66,70**;Mar 15, 2001;Build 26
+2 ;
V408(EASDFN,EASMTIEN) ;GATHER MEANS TEST DATA -- CALLED FROM VISTA^EASEZPVD
+1 ; INPUT:
+2 ; EASDFN - POINTER TO PATIENT FILE (#2)
+3 ; EASMTIEN - MeansTestIEN (#408.31)
+4 NEW MTIFN,MTDT,INCREL
+5 SET MTIFN=+$GET(EASMTIEN)
+6 SET MTDT=$$GET1^DIQ(408.31,MTIFN_",",.01,"I")
+7 ;
+8 ;GET DATA FROM FILES 408.12, 408.13, 408.21, AND 408.22
+9 DO I408^EASEZPVI(EASDFN,MTDT,.INCREL)
+10 IF $DATA(INCREL)>1
Begin DoDot:1
+11 ;MODIFIED FROM A408^EASEZC2
+12 NEW IENS,B,FILE,M,MM,TYPE,IEN,NSD,FLD,IEN2
+13 NEW FFF,PERS,GRP,GRP1,SUBF,SUBIEN,WHERE
+14 SET IENS=$GET(INCREL(408,"V",1))
+15 ;ADD "INCOME YEAR" AND "DECLINES TO GIVE INFO" INTO ^TMP GLOBALS
+16 NEW EZTMPIEN
+17 SET EZTMPIEN=$ORDER(^TMP("EZDATA",$JOB,""),-1)+1
+18 SET ^TMP("EZDATA",$JOB,EZTMPIEN)="408.21^408.21^.01^IIC;999^Income Year"
+19 SET ^TMP("EZINDEX",$JOB,"A",408.21,408.21,.01,EZTMPIEN)=EZTMPIEN_"^APPLICANT INCOME YEAR"
+20 SET EZTMPIEN=EZTMPIEN+1
+21 SET ^TMP("EZDATA",$JOB,EZTMPIEN)="408.31^408.31^.14^IIC;998^Declines To Give Info"
+22 SET ^TMP("EZINDEX",$JOB,"A",408.31,408.31,.14,EZTMPIEN)=EZTMPIEN_"^APPLICANT DECLINES TO GIVE INFO"
+23 IF MTIFN>0
SET B=0
DO GET408(408.31,"A",MTIFN)
+24 ;EAS*66 - GENERATE ADJ EXP
SET IEN=$PIECE(IENS,U,3)
SET IEN2=$PIECE(IENS,U,4)
+25 IF +IEN
IF +IEN2
DO GROSS^DGMTSCU4(IEN,EASDFN,MTDT,IEN2)
+26 ;
+27 IF IENS
SET B=0
FOR FILE=408.12,2,408.21,408.22
DO GET408(FILE,"A",IENS)
+28 ;MODIFIED FROM SP408^EASEZC2
+29 SET IENS=$GET(INCREL(408,"S",1))
+30 IF IENS
SET B=0
FOR FILE=408.12,408.13,408.21,408.22
DO GET408(FILE,"S",IENS)
+31 ;EAS*1.0*70 -- GET SPOUSE GROSS ANNUAL INCOME AND NET WORTH
+32 DO SPGAINW
+33 ;
+34 ;MODIFIED FROM C1N408^EASEZC2
+35 SET (M,MM)=0
FOR
SET M=$ORDER(INCREL(408,"C",M))
if 'M
QUIT
Begin DoDot:2
+36 SET IEN=+$PIECE(INCREL(408,"C",M),U,2)
+37 SET NSD=""
FOR FLD=.01,.09,.03
Begin DoDot:3
+38 SET FFF=408.13_U_408.13_U_FLD
SET VDATA=$$GET^EASEZC1(IEN,FFF)
+39 IF FLD=.09
SET VDATA=$$SSNOUT^EASEZT1(VDATA)
+40 IF FLD=.03
SET VDATA=$$XDATE^EASEZT1(VDATA)
+41 SET NSD=NSD_VDATA_U
End DoDot:3
+42 IF MM=0
Begin DoDot:3
+43 SET MM=1
+44 SET PERS("EZ","CHILD1",1)=NSD
+45 SET PERS("EZ","CHILD1",1,"IENS")=INCREL(408,"C",M)
End DoDot:3
IF 1
+46 IF '$TEST
Begin DoDot:3
+47 SET PERS("EZ","CHILD(N)",MM)=NSD
+48 SET PERS("EZ","CHILD(N)",MM,"IENS")=INCREL(408,"C",M)
+49 SET MM=MM+1
End DoDot:3
End DoDot:2
+50 ;
+51 ;get identifying data for child in database
+52 ;EAS*1.0*70 - duplicate the gross annual income entries
+53 ; for CHILD1, using the CHILD(N) index IENs
+54 FOR FLD=.08,.14,.17
Begin DoDot:2
+55 SET KEY=$ORDER(^TMP("EZINDEX",$JOB,"CN",408.21,408.21,FLD,0))
if 'KEY
QUIT
+56 SET ^TMP("EZINDEX",$JOB,"C1",408.21,408.21,FLD,KEY)=^TMP("EZINDEX",$JOB,"CN",408.21,408.21,FLD,KEY)
End DoDot:2
+57 ;
+58 FOR TYPE="CHILD1","CHILD(N)"
SET M=0
FOR
SET M=$ORDER(PERS("EZ",TYPE,M))
if 'M
QUIT
Begin DoDot:2
+59 SET IENS=$GET(PERS("EZ",TYPE,M,"IENS"))
if IENS=""
QUIT
+60 SET GRP=$SELECT(TYPE="CHILD1":"C1",1:"CN")
+61 ;associate each ien with file/subfile
+62 SET B=0
FOR FILE=408.12,408.13,408.21,408.22
Begin DoDot:3
+63 SET B=B+1
SET IEN=+$PIECE(IENS,U,B)
if 'IEN
QUIT
+64 IF 'MTDT
IF ((FILE=408.21)!(FILE=408.22))
QUIT
+65 DO CONT
End DoDot:3
+66 ;EAS*1.0*70
+67 SET IEN=$PIECE($GET(PERS("EZ",TYPE,M,"IENS")),U,4)
if 'IEN
QUIT
+68 NEW IATY
SET IATY=$$GET^EASEZC1(IEN,"408.22^408.22^.12")
+69 IF IATY'="YES"
Begin DoDot:3
+70 IF EASVRSN>5.99
IF (TYPE="CHILD(N)")
DO DELETE(GRP,(M+1))
+71 IF '$TEST
DO DELETE(GRP,M)
End DoDot:3
QUIT
End DoDot:2
End DoDot:1
+72 QUIT
+73 ;
GET408(FILE,SRCE,IENS) ;GATHER THE DATA FROM THE 408 FILES
+1 ; INPUT:
+2 ; FILE - FILE TO SEARCH
+3 ; SRCE - SOURCE OF DATA ("A"PPLICANT, "S"POUSE)
+4 ; IENS - IEN FROM THE INCREL ARRAY
+5 ;
+6 NEW IEN,FLD,MAP,VDATA,KEY
+7 ;IF NO MEANS TEST, THEN DON'T GATHER ANY MONEY AMOUNTS
+8 IF 'MTDT
IF ((FILE=408.21)!(FILE=408.22))
QUIT
+9 SET B=B+1
SET IEN=+$PIECE(IENS,U,B)
if 'IEN
QUIT
if FILE=2
QUIT
+10 IF (FILE=408.22)
IF ('MTIFN!($PIECE($GET(^DGMT(FILE,+IEN,"MT")),U)'=MTIFN))
QUIT
+11 SET FLD=0
FOR
SET FLD=$ORDER(^TMP("EZINDEX",$JOB,SRCE,FILE,FILE,FLD))
if 'FLD
QUIT
Begin DoDot:1
+12 SET MAP=FILE_U_FILE_U_FLD
+13 SET VDATA=$$GET^EASEZC1(IEN,MAP)
+14 IF (FILE=408.31)
IF (FLD=.14)
Begin DoDot:2
+15 IF (VDATA="")!(VDATA=0)
SET VDATA="NO"
+16 IF VDATA=1
SET VDATA="YES"
End DoDot:2
+17 IF (FILE=408.21)
Begin DoDot:2
+18 IF (FLD=.08)
SET VDATA=$$SUMSSI^EASEZT2(VDATA,IEN)
+19 IF (FLD=2.01)
SET VDATA=$$SUMCASH^EASEZT2(VDATA,IEN)
+20 IF (FLD=2.04)
SET VDATA=$$SUMPROP^EASEZT2(VDATA,IEN)
+21 QUIT
End DoDot:2
+22 if VDATA=-1
QUIT
if VDATA=""
QUIT
+23 IF (SRCE="S")
IF (FILE=408.13)
IF (FLD=.09)
SET VDATA=$$SSNOUT^EASEZT1(VDATA)
+24 IF (SRCE="S")
IF (FILE=408.13)
IF (FLD=.03)
SET VDATA=$$XDATE^EASEZT1(VDATA)
+25 SET KEY=0
FOR
SET KEY=$ORDER(^TMP("EZINDEX",$JOB,SRCE,FILE,FILE,FLD,KEY))
if 'KEY
QUIT
Begin DoDot:2
+26 SET ^TMP("EZDATA",$JOB,KEY,1,2)=VDATA
+27 IF (FILE=408.21)
IF (SRCE="A")
Begin DoDot:3
+28 IF ";2.01;2.03;2.04;"'[(";"_FLD_";")
QUIT
+29 NEW TEXT,NEWKEY
+30 IF FLD=2.01
SET TEXT="APPLICANT CASH IN BANK2"
+31 IF FLD=2.03
SET TEXT="APPLICANT REAL PROPERTY LESS MORTGAGES2"
+32 IF FLD=2.04
SET TEXT="APPLICANT STOCKS BONDS ASSETS LESS DEBTS2"
+33 SET NEWKEY=+$$KEY711^EASEZU1(TEXT)
+34 SET ^TMP("EZDATA",$JOB,NEWKEY,1,2)=VDATA
End DoDot:3
End DoDot:2
End DoDot:1
+35 ;
+36 IF (FILE=408.12)
IF (SRCE="S")
Begin DoDot:1
+37 SET SUBF=408.1275
+38 SET FLD=0
FOR
SET FLD=$ORDER(^TMP("EZINDEX",$JOB,SRCE,FILE,SUBF,FLD))
if 'FLD
QUIT
Begin DoDot:2
+39 SET SUBIEN=$$I1275^EASEZI(IEN)
+40 SET MAP=FILE_U_SUBF_U_FLD
SET WHERE=IEN_";"_SUBIEN
+41 SET VDATA=$$GET^EASEZC1(WHERE,MAP)
+42 if VDATA=-1
QUIT
if VDATA=""
QUIT
+43 SET KEY=0
FOR
SET KEY=$ORDER(^TMP("EZINDEX",$JOB,SRCE,FILE,SUBF,FLD,KEY))
if 'KEY
QUIT
Begin DoDot:3
+44 SET ^TMP("EZDATA",$JOB,KEY,1,2)=VDATA
End DoDot:3
End DoDot:2
End DoDot:1
+45 QUIT
+46 ;
CONT ;CONTINUATION OF CHILD FINANCIAL DATA
+1 ;
+2 IF (FILE=408.22)
IF ('MTIFN!'IEN!($PIECE($GET(^DGMT(FILE,+IEN,"MT")),U)'=MTIFN))
QUIT
+3 SET FLD=0
FOR
SET FLD=$ORDER(^TMP("EZINDEX",$JOB,GRP,FILE,FILE,FLD))
if FLD=""
QUIT
Begin DoDot:1
+4 SET MAP=FILE_U_FILE_U_FLD
+5 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"
+6 SET VDATA=$$GET^EASEZC1(IEN,MAP)
+7 IF (FILE=408.21)
Begin DoDot:2
+8 IF (FLD=.08)
SET VDATA=$$SUMSSI^EASEZT2(VDATA,IEN)
+9 IF (FLD=2.01)
SET VDATA=$$SUMCASH^EASEZT2(VDATA,IEN)
+10 IF (FLD=2.04)
SET VDATA=$$SUMPROP^EASEZT2(VDATA,IEN)
+11 QUIT
End DoDot:2
+12 if VDATA=-1
QUIT
if VDATA=""
QUIT
+13 IF (FILE=408.13)
IF (FLD=.09)
SET VDATA=$$SSNOUT^EASEZT1(VDATA)
+14 IF (FILE=408.13)
IF (FLD=.03)
SET VDATA=$$XDATE^EASEZT1(VDATA)
+15 ;store link in all 1010EZ elements associated with this file/subfile
+16 SET KEY=$ORDER(^TMP("EZINDEX",$JOB,GRP1,FILE,FILE,FLD,0))
if 'KEY
QUIT
+17 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
+18 SET ^TMP("EZDATA",$JOB,KEY,MM,2)=VDATA
End DoDot:1
+19 ;get data in subfile #408.1275
+20 IF FILE=408.12
SET SUBF=408.1275
Begin DoDot:1
+21 SET FLD=0
FOR
SET FLD=$ORDER(^TMP("EZINDEX",$JOB,GRP,FILE,SUBF,FLD))
if FLD=""
QUIT
Begin DoDot:2
+22 SET SUBIEN=$$I1275^EASEZI(IEN)
+23 SET MAP=FILE_U_SUBF_U_FLD
SET WHERE=IEN_";"_SUBIEN
+24 SET VDATA=$$GET^EASEZC1(WHERE,MAP)
+25 if VDATA=-1
QUIT
if VDATA=""
QUIT
+26 ;store link in all 1010EZ elements associated with this file/subfile
+27 SET KEY=0
FOR
SET KEY=$ORDER(^TMP("EZINDEX",$JOB,GRP,FILE,SUBF,FLD,KEY))
if 'KEY
QUIT
Begin DoDot:3
+28 SET ^TMP("EZDATA",$JOB,KEY,MM,2)=VDATA
End DoDot:3
End DoDot:2
End DoDot:1
+29 QUIT
SPGAINW ;Determine when to print Spouse's
+1 ;Gross Annual Income and Net Worth Amounts
+2 NEW IEN,MLY,LWSP,ACTSP
+3 SET IEN=$PIECE($GET(INCREL(408,"V",1)),U,4)
if 'IEN
QUIT
+4 SET MLY=$$GET^EASEZC1(IEN,"408.22^408.22^.05")
+5 IF MLY'="YES"
DO DELETE("S",1)
QUIT
+6 ;
+7 SET LWSP=$$GET^EASEZC1(IEN,"408.22^408.22^.06")
+8 SET ACTSP=+$$GET^EASEZC1(IEN,"408.22^408.22^.07")
+9 IF (LWSP'="YES")
IF (ACTSP<600)
DO DELETE("S",1)
QUIT
+10 QUIT
DELETE(SRCE,MULT) ;Delete dependent's GAI and NW amounts
+1 NEW FILE,FLD,KEY,X
+2 SET FILE=408.21
FOR FLD=.08,.14,.17,2.01,2.03,2.04
Begin DoDot:1
+3 SET KEY=0
FOR
SET KEY=$ORDER(^TMP("EZINDEX",$JOB,SRCE,FILE,FILE,FLD,KEY))
if 'KEY
QUIT
Begin DoDot:2
+4 FOR X=1,2
KILL ^TMP("EZDATA",$JOB,KEY,MULT,X)
End DoDot:2
End DoDot:1
+5 QUIT