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
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HEASECDEP 2064 printed Oct 16, 2024@17:54:40 Page 2
EASECDEP ;ALB/LBD Dependent Driver ;18 AUG 2001
+1 ;;1.0;ENROLLMENT APPLICATION SYSTEM;**5**;Mar 15, 2001
+2 ;This routine was modified from DGDEP for LTC Co-pay
EN ;
+1 SET VALMBCK=""
+2 DO WAIT^DICD
DO EN^VALM("EASEC DEPENDENTS")
+3 SET VALMBCK="R"
ENQ KILL DEP,DGCNT,DGDEP,DGIR0,DGINI,DGLN,DGPRI,DGREL,^TMP("DGDEP",$JOB)
+1 QUIT
+2 ;
PAT ; Patient Lookup
+1 NEW DIC,Y
+2 SET DIC="^DPT("
SET DIC(0)="AEMQZ"
DO ^DIC
IF Y'>0
GOTO PATQ
+3 IF ($GET(DTOUT)!$GET(DUOUT))
GOTO PATQ
+4 SET DFN=+Y
PATQ QUIT
+1 ;
HDR ; Header
+1 NEW VA,VAERR
+2 DO PID^VADPT
+3 SET X=""
SET VALMHDR(1)=" MARITAL STATUS/DEPENDENTS, SCREEN <3>"
+4 SET VALMHDR(2)=$EXTRACT($PIECE("Patient: "_$GET(^DPT(DFN,0)),"^",1),1,30)_" ("_VA("PID")_")"
+5 SET X=$SELECT($DATA(^DPT(DFN,.1)):"Ward: "_^(.1),1:"Outpatient")
+6 SET VALMHDR(2)=$$SETSTR^VALM1(X,VALMHDR(2),80-$LENGTH(X),$LENGTH(X))
HDRQ QUIT
+1 ;
INIT ; Find all dependents
+1 KILL DGDEP("DGDEP",$JOB),^TMP("DGDEP",$JOB)
+2 NEW CNT,DGDATE,DGDDEP0,DGINCP,DGINI,DGIRI,DGWHERE
+3 ; Sets up veteran in person file
DO NEW^EASECED1
+4 ; Get all active dependents
+5 DO ALL^EASECU21(DFN,"VSD",$SELECT($GET(DGMTDT):DGMTDT,1:DT),"IPR",$GET(DGMTI))
+6 ;
+7 ; Get all dependents active and inactive
+8 SET (CNT,DGDEP)=0
SET DGLN=1
+9 FOR
SET DGDEP=$ORDER(^DGPR(408.12,"B",DFN,DGDEP))
if 'DGDEP
QUIT
Begin DoDot:1
+10 NEW DGDEP0
SET CNT=CNT+1
+11 SET DGDEP0=^DGPR(408.12,DGDEP,0)
+12 ;Get Annual Income IEN and Income Person IEN
DO GETIENS^EASECU2(DFN,+DGDEP,$SELECT($GET(DGMTDT):DGMTDT,1:DT))
+13 SET DGWHERE=$PIECE(DGDEP0,U,3)
+14 SET DGINCP=$GET(@("^"_$PIECE(DGWHERE,";",2)_+DGWHERE_",0)"))
+15 SET DGDEP("DGDEP",$JOB,$PIECE(DGDEP0,U,2),CNT)=DGINCP
+16 SET $PIECE(DGDEP("DGDEP",$JOB,$PIECE(DGDEP0,U,2),CNT),U,20)=DGDEP
+17 SET $PIECE(DGDEP("DGDEP",$JOB,$PIECE(DGDEP0,U,2),CNT),U,21)=$SELECT($GET(DGINI):DGINI,1:$GET(DGINC))
+18 SET $PIECE(DGDEP("DGDEP",$JOB,$PIECE(DGDEP0,U,2),CNT),U,22)=$SELECT($GET(DGIRI):DGIRI,1:$GET(DGINR))
+19 NEW DGEDATE
SET DGEDATE=0
+20 FOR
SET DGEDATE=$ORDER(^DGPR(408.12,DGDEP,"E",DGEDATE))
if 'DGEDATE
QUIT
Begin DoDot:2
+21 SET DGDATE=^DGPR(408.12,DGDEP,"E",DGEDATE,0)
+22 SET DGDEP("DGDEP",$JOB,$PIECE(DGDEP0,U,2),CNT,-$PIECE(DGDATE,U))=DGDATE
End DoDot:2
End DoDot:1
+23 DO RETDEP^EASECDP0
+24 SET VALMCNT=DGLN-1
+25 QUIT
+26 ;
SET(X) ; Set in array
+1 ;
+2 SET ^TMP("DGDEP",$JOB,DGLN,0)=X
SET ^TMP("DGDEP",$JOB,"IDX",CNT,CNT)=""
+3 SET DGLN=DGLN+1
+4 QUIT