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

EASECDP0.m

Go to the documentation of this file.
EASECDP0 ;ALB/LBD Dependent Driver (con't) ;20 AUG 2001
 ;;1.0;ENROLLMENT APPLICATION SYSTEM;**5**;Mar 15, 2001
 ;NOTE: This routine was modified from DGDEP0 for LTC co-pay
 ;
RETDEP ;Return printable data of dependents
 Q:'$D(DGDEP("DGDEP",$J))
 N ACT,ACTIVE,CNT,CNTR,DEP,DGII,DGX,EDATE,INCOME,INCPER,MORE,NAME,RELATE
 F DGII=0:0 S DGII=$O(DGDEP(DGII)) Q:'DGII  K DGDEP(DGII) ; clear dependent array
 S RELATE=0,CNT=1
 ;
 F  S RELATE=$O(DGDEP("DGDEP",$J,RELATE)) Q:'RELATE  D
 .;
 .S MORE=0
 .F  S MORE=$O(DGDEP("DGDEP",$J,RELATE,MORE)) Q:'MORE  S DEP=DGDEP("DGDEP",$J,RELATE,MORE) D  S CNT=CNT+1,DGCNT=CNT-1
 ..;
 ..S $P(DGDEP(CNT),U,2)=$P($G(^DG(408.11,RELATE,0)),U)
 ..S NAME=$P(DEP,U),$P(DGDEP(CNT),U)=$P(DEP,U)
 ..S $P(DGDEP(CNT),U,3)=$S($P(DEP,U,2)="M":"Male",$P(DEP,U,2)="F":"Female",1:"Unknown"),$P(DGDEP(CNT),U,20)=$P(DEP,U,20)
 ..S $P(DGDEP(CNT),U,21)=$P(DEP,U,21),$P(DGDEP(CNT),U,22)=$P(DEP,U,22)
 ..N Y S Y=$P(DEP,U,3) D DD^%DT S $P(DGDEP(CNT),U,4)=Y
 ..I $P(DEP,U,9) S $P(DGDEP(CNT),U,5)=$E($P(DEP,U,9),1,3)_"-"_$E($P(DEP,U,9),4,5)_"-"_$E($P(DEP,U,9),6,9)
 ..;
 ..S INCOME=$P(DGDEP("DGDEP",$J,RELATE,MORE),U,21)
 ..S INCPER=$P(DGDEP("DGDEP",$J,RELATE,MORE),U,22)
 ..I RELATE=1 D SELF("",NAME,RELATE,"",DGDEP(1),$G(DGMTI),CNT)
 ..S ACT=$O(DGDEP("DGDEP",$J,RELATE,MORE,"")) Q:'ACT  S ACT=DGDEP("DGDEP",$J,RELATE,MORE,+ACT)
 ..I RELATE=1 D SELF(INCPER,NAME,RELATE,ACT,DGDEP(1),$G(DGMTI),CNT)
 ..I RELATE=2 D DEP(INCPER,NAME,RELATE,ACT,DGDEP(CNT),$G(DGMTI),$G(DGMTACT),CNT)
 ..I RELATE>2 D DEP(INCPER,NAME,RELATE,ACT,DGDEP(CNT),$G(DGMTI),$G(DGMTACT),CNT)
 ..S EDATE="",CNTR=0
 ..F  S EDATE=$O(DGDEP("DGDEP",$J,RELATE,MORE,EDATE)) Q:EDATE']""  S ACTIVE=DGDEP("DGDEP",$J,RELATE,MORE,EDATE) D
 ...;
 ...N Y S Y=+ACTIVE D DD^%DT S DGDEP(CNT,EDATE)=Y
 ...S $P(DGDEP(CNT,EDATE),U,2)=$S($P(ACTIVE,U,2)=1:"Active",1:"Inactive")
 ...S $P(DGDEP(CNT,EDATE),U,3)=$P(ACTIVE,U,3)
 K DGDEP("DGDEP",$J)
 Q
 ;
SELF(INCPER,NAME,RELATE,ACT,DGDEP,DGMTI,CNT) ;
 I $G(DGMTI),$G(DGMTACT)="VEW" G SELFQ
 I $G(DGMTI) D ADD^EASECDP2(DFN,DGDEP,DGMTI)
SELFQ I INCPER D SELF^EASECDP3(INCPER,NAME,RELATE,ACT,$G(DGMTI),CNT)
 Q
 ;
DEP(INCPER,NAME,RELATE,ACT,DGDEP,DGMTI,DGMTACT,CNT) ;
 ;
 I $G(DGMTI),$G(DGMTACT)="VEW" G DEP1
 I $G(DGMTI),$P(ACT,U,2),$G(DGMTACT)="ADD",'$G(DGREMOVE) D ADD^EASECDP2(DFN,DGDEP,DGMTI)
DEP1 I RELATE=2 D SELF^EASECDP3(INCPER,NAME,RELATE,ACT,$G(DGMTI),CNT) G DEPQ
 I INCPER D CHILD^EASECDP3(INCPER,NAME,RELATE,ACT,$G(DGMTI),$G(DGMTACT),CNT)
DEPQ Q