source: FOIAVistA/trunk/r/ENROLLMENT_APPLICATION_SYSTEM-EAS/EASECDP0.m@ 1765

Last change on this file since 1765 was 628, checked in by George Lilly, 15 years ago

initial load of FOIAVistA 6/30/08 version

File size: 2.4 KB
Line 
1EASECDP0 ;ALB/LBD Dependent Driver (con't) ;20 AUG 2001
2 ;;1.0;ENROLLMENT APPLICATION SYSTEM;**5**;Mar 15, 2001
3 ;NOTE: This routine was modified from DGDEP0 for LTC co-pay
4 ;
5RETDEP ;Return printable data of dependents
6 Q:'$D(DGDEP("DGDEP",$J))
7 N ACT,ACTIVE,CNT,CNTR,DEP,DGII,DGX,EDATE,INCOME,INCPER,MORE,NAME,RELATE
8 F DGII=0:0 S DGII=$O(DGDEP(DGII)) Q:'DGII K DGDEP(DGII) ; clear dependent array
9 S RELATE=0,CNT=1
10 ;
11 F S RELATE=$O(DGDEP("DGDEP",$J,RELATE)) Q:'RELATE D
12 .;
13 .S MORE=0
14 .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
15 ..;
16 ..S $P(DGDEP(CNT),U,2)=$P($G(^DG(408.11,RELATE,0)),U)
17 ..S NAME=$P(DEP,U),$P(DGDEP(CNT),U)=$P(DEP,U)
18 ..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)
19 ..S $P(DGDEP(CNT),U,21)=$P(DEP,U,21),$P(DGDEP(CNT),U,22)=$P(DEP,U,22)
20 ..N Y S Y=$P(DEP,U,3) D DD^%DT S $P(DGDEP(CNT),U,4)=Y
21 ..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)
22 ..;
23 ..S INCOME=$P(DGDEP("DGDEP",$J,RELATE,MORE),U,21)
24 ..S INCPER=$P(DGDEP("DGDEP",$J,RELATE,MORE),U,22)
25 ..I RELATE=1 D SELF("",NAME,RELATE,"",DGDEP(1),$G(DGMTI),CNT)
26 ..S ACT=$O(DGDEP("DGDEP",$J,RELATE,MORE,"")) Q:'ACT S ACT=DGDEP("DGDEP",$J,RELATE,MORE,+ACT)
27 ..I RELATE=1 D SELF(INCPER,NAME,RELATE,ACT,DGDEP(1),$G(DGMTI),CNT)
28 ..I RELATE=2 D DEP(INCPER,NAME,RELATE,ACT,DGDEP(CNT),$G(DGMTI),$G(DGMTACT),CNT)
29 ..I RELATE>2 D DEP(INCPER,NAME,RELATE,ACT,DGDEP(CNT),$G(DGMTI),$G(DGMTACT),CNT)
30 ..S EDATE="",CNTR=0
31 ..F S EDATE=$O(DGDEP("DGDEP",$J,RELATE,MORE,EDATE)) Q:EDATE']"" S ACTIVE=DGDEP("DGDEP",$J,RELATE,MORE,EDATE) D
32 ...;
33 ...N Y S Y=+ACTIVE D DD^%DT S DGDEP(CNT,EDATE)=Y
34 ...S $P(DGDEP(CNT,EDATE),U,2)=$S($P(ACTIVE,U,2)=1:"Active",1:"Inactive")
35 ...S $P(DGDEP(CNT,EDATE),U,3)=$P(ACTIVE,U,3)
36 K DGDEP("DGDEP",$J)
37 Q
38 ;
39SELF(INCPER,NAME,RELATE,ACT,DGDEP,DGMTI,CNT) ;
40 I $G(DGMTI),$G(DGMTACT)="VEW" G SELFQ
41 I $G(DGMTI) D ADD^EASECDP2(DFN,DGDEP,DGMTI)
42SELFQ I INCPER D SELF^EASECDP3(INCPER,NAME,RELATE,ACT,$G(DGMTI),CNT)
43 Q
44 ;
45DEP(INCPER,NAME,RELATE,ACT,DGDEP,DGMTI,DGMTACT,CNT) ;
46 ;
47 I $G(DGMTI),$G(DGMTACT)="VEW" G DEP1
48 I $G(DGMTI),$P(ACT,U,2),$G(DGMTACT)="ADD",'$G(DGREMOVE) D ADD^EASECDP2(DFN,DGDEP,DGMTI)
49DEP1 I RELATE=2 D SELF^EASECDP3(INCPER,NAME,RELATE,ACT,$G(DGMTI),CNT) G DEPQ
50 I INCPER D CHILD^EASECDP3(INCPER,NAME,RELATE,ACT,$G(DGMTI),$G(DGMTACT),CNT)
51DEPQ Q
Note: See TracBrowser for help on using the repository browser.