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

EASECSU3.m

Go to the documentation of this file.
  1. EASECSU3 ;ALB/LBD - LTC Co-Pay Test Screen Variable Utilities Cont. ;14 AUG 2001
  1. ;;1.0;ENROLLMENT APPLICATION SYSTEM;**5,7,40**;Mar 15, 2001
  1. ;
  1. INC ;Determine income, expense and net worth
  1. ; Input -- DFN Patient file IEN
  1. ; DGCOMF LTC Co-Pay Test Completion Flag (Optional)
  1. ; (1 if completing LTC co-pay test)
  1. ; DGMTDT Date of Test
  1. ; DGMTI Annual Means Test IEN
  1. ; DGVINI Veteran Individual Annual Income IEN
  1. ; DGSP Spouse 1=YES and 0=NO (mt income)
  1. ; DGDC Dependent children 1=YES and 0=NO (mt income)
  1. ; DGMTPAR Annual Means Test Parameters
  1. ; Output -- DGIN0 Annual Income 0th node array (income)
  1. ; DGIN1 Annual Income 1 node array (expense)
  1. ; DGIN2 Annual Income 2 node array (net worth)
  1. ; DGINT Total income
  1. ; DGDET Total deductible expenses
  1. ; DGNWT Total net worth
  1. ; DGINTF Income flag
  1. ; DGNWTF Net worth flag
  1. N DGCNT,DGINC,DGINR,I,J,Y
  1. D ALL^EASECU21(DFN,"VCS",DGMTDT,"IR",$S($G(DGMTI):DGMTI,1:""))
  1. S DGIN0("V")=$G(^DGMT(408.21,DGVINI,0)),DGIN1("V")=$G(^(1)),DGIN2("V")=$G(^(2))
  1. S DGINT=$$TOT^DGMTSCU1(DGIN0("V"),6,17)+$$TOT^DGMTSCU1(DGIN0("V"),19,20)
  1. S DGDET=$$TOT^DGMTSCU1(DGIN1("V"),1,10)
  1. S DGNWT=$$TOT^DGMTSCU1(DGIN2("V"),1,4)+$$TOT^DGMTSCU1(DGIN2("V"),6,9)
  1. I $G(DGCOMF) D MT(DGINR("V"),DGMTI)
  1. I DGSP S (DGIN0("S"),DGIN1("S"),DGIN2("S"))="" D SPOUSE:$D(DGINC("S"))
  1. ; dependent child income is not included for LTC co-pay test
  1. ;I DGDC S (DGIN0("C"),DGIN1("C"))="",DGCNT=0 F S DGCNT=$O(DGINC("C",DGCNT)) Q:'DGCNT D CHK^DGMTSCU2,CHILD:Y
  1. S DGINTF=$S(DGINT:1,1:0)
  1. S DGNWTF=$S(DGNWT:1,1:0)
  1. Q
  1. ;
  1. SPOUSE ;Determine spouse income and net worth
  1. S DGIN0("S")=$G(^DGMT(408.21,DGINC("S"),0)),DGIN1("S")=$G(^(1)),DGIN2("S")=$G(^(2))
  1. S DGINT=DGINT+$$TOT^DGMTSCU1(DGIN0("S"),6,17)+$$TOT^DGMTSCU1(DGIN0("S"),19,20)
  1. ; Added next line for LTC Phase IV (EAS*1*40)
  1. S DGNWT=DGNWT+$$TOT^DGMTSCU1(DGIN2("S"),1,4)+$$TOT^DGMTSCU1(DGIN2("S"),6,9)
  1. I $G(DGCOMF) D MT(DGINR("S"),DGMTI)
  1. SPOUSEQ Q
  1. ;
  1. CHILD ;Determine total dependent children(s) income and expense
  1. N DGCE,DGEMP,I,X
  1. S X=$G(^DGMT(408.21,DGINC("C",DGCNT),0)) F I=8:1:17 I $P(X,"^",I)]"" S $P(DGIN0("C"),"^",I)=$P(DGIN0("C"),"^",I)+$P(X,"^",I)
  1. S DGEMP=$P(X,"^",14),DGINT=DGINT+$$TOT^DGMTSCU1(X,8,17)
  1. S X=$G(^DGMT(408.21,DGINC("C",DGCNT),1)) I $P(X,"^",3)]"" S $P(DGIN1("C"),"^",3)=$P(DGIN1("C"),"^",3)+$P(X,"^",3)
  1. S DGCE=(DGEMP-$P(DGMTPAR,"^",17))-$P(X,"^",3)
  1. S DGDET=DGDET+DGEMP-$S($G(DGCE)>0:DGCE,1:0)
  1. I $G(DGCOMF) D MT(DGINR("C",DGCNT),DGMTI)
  1. CHILDQ Q
  1. ;
  1. MT(DGINR,DGMTI) ;Update Income Relation file with Means Test IEN
  1. ; Input -- DGINR Income Relation IEN
  1. ; DGMTI Annual Means Test IEN
  1. ; Output -- Update Means Test IEN
  1. N DA,DIE,DR
  1. S DA=DGINR,DIE="^DGMT(408.22,",DR="31////^S X="_DGMTI D ^DIE
  1. Q
  1. ;
  1. DEP ;Determine dependent data
  1. ; Input -- DFN Patient file IEN
  1. ; DGMTDT Date of Test
  1. ; DGVIRI Veteran Income Relation IEN
  1. ; Output -- DGVIR0 Veteran Income Relation 0th node
  1. ; DGSP Spouse 1=YES and 0=NO (mt income)
  1. ; DGDC Dependent children 1=YES and 0=NO (mt income)
  1. ; DGNC Number of dependent children
  1. ; DGND Total number of dependents
  1. N DGCNT,DGDEP,DGINR,DGREL,Y
  1. S DGVIR0=$G(^DGMT(408.22,DGVIRI,0)) D ALL^EASECU21(DFN,"SC",DGMTDT,"PR",$S($G(DGMTI):DGMTI,1:""))
  1. ;Include spouse's income for LTC co-pay if vet is married
  1. ;If vet is legally separated, do not include spouse's income. Added for
  1. ;LTC Phase IV (EAS*1*40)
  1. S DGSP=$S('$P(DGVIR0,U,14):0,$P(DGVIR0,U,17):0,'$G(DGREL("S")):0,1:1)
  1. ;Child's income is not included for LTC co-pay test
  1. S DGDC=0
  1. S DGNC=+$P(DGVIR0,"^",13)
  1. S DGND=DGSP+DGNC
  1. Q