[613] | 1 | DGDEP0 ;ALB/CAW,JAN,ERC Dependent Driver (con't) ; 10/27/05 9:59am
|
---|
| 2 | ;;5.3;Registration;**45,60,395,624,653**;Aug 13, 1993;Build 2
|
---|
| 3 | ;
|
---|
| 4 | RETDEP ;Return printable data of dependents
|
---|
| 5 | Q:'$D(DGDEP("DGDEP",$J))
|
---|
| 6 | N ACT,ACTIVE,CNT,CNTR,DEP,DGII,DGX,EDATE,INCOME,INCPER,MORE,NAME,RELATE
|
---|
| 7 | F DGII=0:0 S DGII=$O(DGDEP(DGII)) Q:'DGII K DGDEP(DGII) ; clear dependent array
|
---|
| 8 | S RELATE=0,CNT=1
|
---|
| 9 | ;
|
---|
| 10 | F S RELATE=$O(DGDEP("DGDEP",$J,RELATE)) Q:'RELATE D
|
---|
| 11 | .;
|
---|
| 12 | .S MORE=0
|
---|
| 13 | .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
|
---|
| 14 | ..;
|
---|
| 15 | ..S $P(DGDEP(CNT),U,2)=$P($G(^DG(408.11,RELATE,0)),U)
|
---|
| 16 | ..S NAME=$P(DEP,U),$P(DGDEP(CNT),U)=$P(DEP,U)
|
---|
| 17 | ..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)
|
---|
| 18 | ..S $P(DGDEP(CNT),U,21)=$P(DEP,U,21),$P(DGDEP(CNT),U,22)=$P(DEP,U,22)
|
---|
| 19 | ..N Y S Y=$P(DEP,U,3) D DD^%DT S $P(DGDEP(CNT),U,4)=Y
|
---|
| 20 | ..;
|
---|
| 21 | ..I $P(DEP,U,9) D
|
---|
| 22 | ... N T 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,10)
|
---|
| 23 | ...;set 10th piece to value of Pseudo SSN Reason, if there is one
|
---|
| 24 | ...;for DG*5.3*653 - ERC
|
---|
| 25 | ...S $P(DGDEP(CNT),U,10)=$S($P(DEP,U,10)="R":"Refused to Provide",$P(DEP,U,10)="S":"SSN Unknown/Follow-up Required",$P(DEP,U,10)="N":"NO SSN ASSIGNED",1:"")
|
---|
| 26 | ..;
|
---|
| 27 | ..S INCOME=$P(DGDEP("DGDEP",$J,RELATE,MORE),U,21)
|
---|
| 28 | ..S INCPER=$P(DGDEP("DGDEP",$J,RELATE,MORE),U,22)
|
---|
| 29 | ..I RELATE>1 S DGDEP(CNT,"MNADD")=$$SPDEPADD(INCPER)
|
---|
| 30 | ..I RELATE=1 D SELF("",NAME,RELATE,"",DGDEP(1),$G(DGMTI),CNT)
|
---|
| 31 | ..S ACT=$O(DGDEP("DGDEP",$J,RELATE,MORE,"")) Q:'ACT S ACT=DGDEP("DGDEP",$J,RELATE,MORE,+ACT)
|
---|
| 32 | ..I RELATE=1 D SELF(INCPER,NAME,RELATE,ACT,DGDEP(1),$G(DGMTI),CNT)
|
---|
| 33 | ..I RELATE=2 D DEP(INCPER,NAME,RELATE,ACT,DGDEP(CNT),$G(DGMTI),$G(DGMTACT),CNT)
|
---|
| 34 | ..I RELATE>2 D DEP(INCPER,NAME,RELATE,ACT,DGDEP(CNT),$G(DGMTI),$G(DGMTACT),CNT)
|
---|
| 35 | ..S EDATE="",CNTR=0
|
---|
| 36 | ..F S EDATE=$O(DGDEP("DGDEP",$J,RELATE,MORE,EDATE)) Q:EDATE']"" S ACTIVE=DGDEP("DGDEP",$J,RELATE,MORE,EDATE) D
|
---|
| 37 | ...;
|
---|
| 38 | ...N Y S Y=+ACTIVE D DD^%DT S DGDEP(CNT,EDATE)=Y
|
---|
| 39 | ...S $P(DGDEP(CNT,EDATE),U,2)=$S($P(ACTIVE,U,2)=1:"Active",1:"Inactive")
|
---|
| 40 | ...S $P(DGDEP(CNT,EDATE),U,3)=$P(ACTIVE,U,3)
|
---|
| 41 | K DGDEP("DGDEP",$J)
|
---|
| 42 | Q
|
---|
| 43 | ;
|
---|
| 44 | SELF(INCPER,NAME,RELATE,ACT,DGDEP,DGMTI,CNT) ;
|
---|
| 45 | I $G(DGMTI),$G(DGMTACT)="VEW" G SELFQ
|
---|
| 46 | I $G(DGMTI) D ADD^DGDEP2(DFN,DGDEP,DGMTI)
|
---|
| 47 | SELFQ I INCPER>0 D SELF^DGDEP3(INCPER,NAME,RELATE,ACT,$G(DGMTI),CNT)
|
---|
| 48 | Q
|
---|
| 49 | ;
|
---|
| 50 | DEP(INCPER,NAME,RELATE,ACT,DGDEP,DGMTI,DGMTACT,CNT) ;
|
---|
| 51 | ;
|
---|
| 52 | I $G(DGMTI),$G(DGMTACT)="VEW" G DEP1
|
---|
| 53 | I $G(DGMTI),$P(ACT,U,2),$G(DGMTACT)="ADD",'$G(DGREMOVE) D ADD^DGDEP2(DFN,DGDEP,DGMTI)
|
---|
| 54 | DEP1 I RELATE=2 D SELF^DGDEP3(INCPER,NAME,RELATE,ACT,$G(DGMTI),CNT) G DEPQ
|
---|
| 55 | I INCPER>0 D CHILD^DGDEP3(INCPER,NAME,RELATE,ACT,$G(DGMTI),$G(DGMTACT),CNT)
|
---|
| 56 | DEPQ Q
|
---|
| 57 | ;
|
---|
| 58 | SPDEPADD(INCPER) ;Return Spouse/Dependent Maiden Name and Address info
|
---|
| 59 | N ADDCKVAL,INDAIIEN,PRIEN,IPIEN,SPDEPINF
|
---|
| 60 | S INDAIIEN=$P($G(^DGMT(408.22,INCPER,0)),"^",2)
|
---|
| 61 | S PRIEN=$P($G(^DGMT(408.21,INDAIIEN,0)),"^",2)
|
---|
| 62 | S IPIEN=$P($G(^DGPR(408.12,PRIEN,0)),"^",3)
|
---|
| 63 | I IPIEN["DGPR(408.13" DO
|
---|
| 64 | . S IPIEN=$P(IPIEN,";",1)
|
---|
| 65 | . S SPDEPINF=$P($G(^DGPR(408.13,IPIEN,1)),"^",1,8)
|
---|
| 66 | Q SPDEPINF
|
---|