VistA-FOIAVistA/r/ENROLLMENT_APPLICATION_SYST.../EASECDEP.m

59 lines
2.0 KiB
Mathematica

EASECDEP ;ALB/LBD Dependent Driver ;18 AUG 2001
;;1.0;ENROLLMENT APPLICATION SYSTEM;**5**;Mar 15, 2001
;This routine was modified from DGDEP for LTC Co-pay
EN ;
S VALMBCK=""
D WAIT^DICD,EN^VALM("EASEC DEPENDENTS")
S VALMBCK="R"
ENQ K DEP,DGCNT,DGDEP,DGIR0,DGINI,DGLN,DGPRI,DGREL,^TMP("DGDEP",$J)
Q
;
PAT ; Patient Lookup
N DIC,Y
S DIC="^DPT(",DIC(0)="AEMQZ" D ^DIC I Y'>0 G PATQ
I ($G(DTOUT)!$G(DUOUT)) G PATQ
S DFN=+Y
PATQ Q
;
HDR ; Header
N VA,VAERR
D PID^VADPT
S X="",VALMHDR(1)=" MARITAL STATUS/DEPENDENTS, SCREEN <3>"
S VALMHDR(2)=$E($P("Patient: "_$G(^DPT(DFN,0)),"^",1),1,30)_" ("_VA("PID")_")"
S X=$S($D(^DPT(DFN,.1)):"Ward: "_^(.1),1:"Outpatient")
S VALMHDR(2)=$$SETSTR^VALM1(X,VALMHDR(2),80-$L(X),$L(X))
HDRQ Q
;
INIT ; Find all dependents
K DGDEP("DGDEP",$J),^TMP("DGDEP",$J)
N CNT,DGDATE,DGDDEP0,DGINCP,DGINI,DGIRI,DGWHERE
D NEW^EASECED1 ; Sets up veteran in person file
; Get all active dependents
D ALL^EASECU21(DFN,"VSD",$S($G(DGMTDT):DGMTDT,1:DT),"IPR",$G(DGMTI))
;
; Get all dependents active and inactive
S (CNT,DGDEP)=0,DGLN=1
F S DGDEP=$O(^DGPR(408.12,"B",DFN,DGDEP)) Q:'DGDEP D
.N DGDEP0 S CNT=CNT+1
.S DGDEP0=^DGPR(408.12,DGDEP,0)
.D GETIENS^EASECU2(DFN,+DGDEP,$S($G(DGMTDT):DGMTDT,1:DT)) ;Get Annual Income IEN and Income Person IEN
.S DGWHERE=$P(DGDEP0,U,3)
.S DGINCP=$G(@("^"_$P(DGWHERE,";",2)_+DGWHERE_",0)"))
.S DGDEP("DGDEP",$J,$P(DGDEP0,U,2),CNT)=DGINCP
.S $P(DGDEP("DGDEP",$J,$P(DGDEP0,U,2),CNT),U,20)=DGDEP
.S $P(DGDEP("DGDEP",$J,$P(DGDEP0,U,2),CNT),U,21)=$S($G(DGINI):DGINI,1:$G(DGINC))
.S $P(DGDEP("DGDEP",$J,$P(DGDEP0,U,2),CNT),U,22)=$S($G(DGIRI):DGIRI,1:$G(DGINR))
.N DGEDATE S DGEDATE=0
.F S DGEDATE=$O(^DGPR(408.12,DGDEP,"E",DGEDATE)) Q:'DGEDATE D
..S DGDATE=^DGPR(408.12,DGDEP,"E",DGEDATE,0)
..S DGDEP("DGDEP",$J,$P(DGDEP0,U,2),CNT,-$P(DGDATE,U))=DGDATE
D RETDEP^EASECDP0
S VALMCNT=DGLN-1
Q
;
SET(X) ; Set in array
;
S ^TMP("DGDEP",$J,DGLN,0)=X,^TMP("DGDEP",$J,"IDX",CNT,CNT)=""
S DGLN=DGLN+1
Q