DGDEP3 ;ALB/CAW,BAJ,ERC - Dependents display ; 11/22/2005
;;5.3;PIMS;**45,624,653,688,1015,1016**;JUN 30, 2012;Build 20
;
SELF(INCPER,NAME,RELATE,ACT,DGMTI,CNT) ; Display information concerning veteran
;
S DGX="",DGX=$$SETSTR^VALM1(CNT,DGX,3,3)
I $G(DGMTI),INCPER,($P($G(^DGMT(408.22,+INCPER,"MT")),U)=DGMTI) S DGX=$$SETSTR^VALM1("*",DGX,5,1)
S DGX=$$SETSTR^VALM1(NAME,DGX,9,22)
S DGX=$$SETSTR^VALM1($P($G(^DG(408.11,RELATE,0)),U),DGX,32,30)
S DGX=$$SETSTR^VALM1($S($P(ACT,U,2)=1:"*",1:""),DGX,65,1)
S:RELATE=2 DGX=$$SETSTR^VALM1($S(+$$ADDCHK(INCPER)=1:"*",1:""),DGX,73,1)
D SET^DGDEP(DGX)
;
; Display spouse SSN and SSN Verification status DG*5.3*688 BAJ 11/22/2005
I RELATE=2 D
. S DGX="",DGX=$$SETSTR^VALM1($P(DGDEP,"^",5),DGX,9,14)
. S DGX=$$SETSTR^VALM1($P(DGDEP,"^",9),DGX,23,10)
. ;if a Pseudo SSN need Pseudo SSN Reason - DG*5.3*653, ERC
. I $P(DGDEP,U,5)["P" D
. . S DGX=$$SETSTR^VALM1("PSSN Reason: ",DGX,32,15)
. . S DGX=$$SETSTR^VALM1($P(DGDEP,U,10),DGX,45,30)
. . ;D SET^DGDEP(DGX)
. D SET^DGDEP(DGX)
;
Q:RELATE=2
S INCPER=^DGMT(408.22,INCPER,0)
S DGX="",DGX=$$SETSTR^VALM1("Married Last Year: ",DGX,18,19)
S DGX=$$SETSTR^VALM1($S($P(INCPER,U,5):"Yes",$P(INCPER,U,5)="":"Unanswered",1:"No"),DGX,38,10)
D SET^DGDEP(DGX)
;
Q:'$G(DGMTI)
I $P(INCPER,U,5)=1 D
. S DGX="",DGX=$$SETSTR^VALM1("Lived with Spouse: ",DGX,18,19)
. S DGX=$$SETSTR^VALM1($S($P(INCPER,U,6):"Yes",$P(INCPER,U,6)="":"Unanswered",1:"No"),DGX,38,10)
. D SET^DGDEP(DGX)
;
I $P(INCPER,U,6)=0 D
. S DGX="",DGX=$$SETSTR^VALM1("Amount Contributed: ",DGX,17,19)
. S DGX=$$SETSTR^VALM1($S($P(INCPER,U,7)]"":$P(INCPER,U,7),1:"Unanswered"),DGX,38,10)
. D SET^DGDEP(DGX)
Q
;
CHILD(INCPER,NAME,RELATE,ACT,DGMTI,DGMTACT,CNT) ; Display information concerning dependents
;
;** DG*5.3*688 - GTS Get MT Version
N MTVER
S:(+$G(DGMTI)>0) MTVER=$P($G(^DGMT(408.31,DGMTI,2)),"^",11)
I (+$G(DGMTI)'>0) DO
. N DGINC,DGREL,DGINR,DGDEP
. D ALL^DGMTU21(DFN,"VSD",DT,"I")
. S MTVER=$$VER^DGMTUTL3(.DGINC)
S DGX="",DGX=$$SETSTR^VALM1(CNT,DGX,3,3)
I $G(DGMTI),INCPER,($P($G(^DGMT(408.22,+INCPER,"MT")),U)=DGMTI) S DGX=$$SETSTR^VALM1("*",DGX,5,1)
S DGX=$$SETSTR^VALM1(NAME,DGX,9,22)
S DGX=$$SETSTR^VALM1($P($G(^DG(408.11,RELATE,0)),U),DGX,32,30)
S DGX=$$SETSTR^VALM1($S($P(ACT,U,2)=1:"*",1:""),DGX,65,1)
S DGX=$$SETSTR^VALM1($S(+$$ADDCHK(INCPER)=1:"*",1:""),DGX,73,1)
D SET^DGDEP(DGX)
;
;display dependent SSN and SSN Verification status DG*5.3*688 BAJ 11/22/2005
S DGX="",DGX=$$SETSTR^VALM1($P(DGDEP,"^",5),DGX,9,14)
S DGX=$$SETSTR^VALM1($P(DGDEP,"^",9),DGX,23,10)
I $P(DGDEP,U,5)["P" D
. S DGX=$$SETSTR^VALM1("PSSN Reason: ",DGX,32,15)
. S DGX=$$SETSTR^VALM1($P(DGDEP,U,10),DGX,45,30)
D SET^DGDEP(DGX)
;
Q:'$G(DGMTI)!('$P($G(^DG(408.11,RELATE,0)),U,4))
S INCPER=^DGMT(408.22,INCPER,0)
S DGX="",DGX=$$SETSTR^VALM1("Incapable of Self-support: ",DGX,10,27)
S DGX=$$SETSTR^VALM1($S($P(INCPER,U,9):"Yes",$P(INCPER,U,9)="":"Unanswered",1:"No"),DGX,38,10)
D SET^DGDEP(DGX)
;
;* DG*5.3*624
S DGX="",DGX=$$SETSTR^VALM1("Child 18 to 23. Attended School: ",DGX,4,33)
S DGX=$$SETSTR^VALM1($S($P(INCPER,U,18):"Yes",$P(INCPER,U,18)="":"Unanswered",1:"No"),DGX,38,10)
D SET^DGDEP(DGX)
;
S DGX="",DGX=$$SETSTR^VALM1("Child lived with you: ",DGX,15,22)
S DGX=$$SETSTR^VALM1($S($P(INCPER,U,6):"Yes",$P(INCPER,U,6)="":"Unanswered",1:"No"),DGX,38,10)
D SET^DGDEP(DGX)
;
S DGX="",DGX=$$SETSTR^VALM1("Child Support: ",DGX,22,15)
S DGX=$$SETSTR^VALM1($S($P(INCPER,U,6)=1:"N/A",$P(INCPER,U,10)=1:"Yes",$P(INCPER,U,10)="":"Unanswered",1:"No"),DGX,38,10)
D SET^DGDEP(DGX)
;
;* DG*5.3*624
S DGX="",DGX=$$SETSTR^VALM1("Amount contributed: ",DGX,17,20)
S DGX=$$SETSTR^VALM1($S($P(INCPER,U,10)'=1:"N/A",($P(INCPER,U,19)'="0")&($P(INCPER,U,19)'=""):$P(INCPER,U,19),$P(INCPER,U,19)="":"Unanswered",1:"0"),DGX,38,10)
D SET^DGDEP(DGX)
;
;** DG*5.3*688 - GTS Chk MT Version and output correct data
S DGX=""
S:(+MTVER<1) DGX=$$SETSTR^VALM1("Child Has Income: ",DGX,19,18)
S:(+MTVER=1) DGX=$$SETSTR^VALM1("Child Has Income/Net Worth: ",DGX,9,28)
S DGX=$$SETSTR^VALM1($S($P(INCPER,U,11)=1:"Yes",$P(INCPER,U,11)="":"Unanswered",1:"No"),DGX,38,10)
D SET^DGDEP(DGX)
;
;** DG*5.3*688 - GTS Chk MT Version and output correct data
S DGX=""
S:(+MTVER<1) DGX=$$SETSTR^VALM1("Income Available: ",DGX,19,18)
S:(+MTVER=1) DGX=$$SETSTR^VALM1("Income/Net Worth Available: ",DGX,9,28)
S DGX=$$SETSTR^VALM1($S($P(INCPER,U,11)=0:"N/A",$P(INCPER,U,12)=1:"Yes",$P(INCPER,U,12)="":"Unanswered",1:"No"),DGX,38,10)
D SET^DGDEP(DGX)
CHILDQ Q
;
ADDCHK(INCPER) ; Indicates existence of any dependent address
; Input:
; INCPER - Pointer to dep. entry in Income Relation file (408.22)
;
; Output:
; both address and phone^address^phone
; KEY:
; 0 - No data exists for the dependent in 408.13
; 1 - Data exists for the dependent in 408.13
;
; 1^1^1 - Address and Phone data exist for dependent
; 0^1^0 - Address only exists for dependent
; 0^0^1 - Phone only exists for dependent
; 0^0^0 - Neither Phone nor Address data exists for dependent
;
N ADDCKVAL,INDAIIEN,PRIEN,IPIEN
S ADDCKVAL="0^0^0"
S INDAIIEN=$P($G(^DGMT(408.22,INCPER,0)),"^",2)
S PRIEN=$P($G(^DGMT(408.21,INDAIIEN,0)),"^",2)
S IPIEN=$P($G(^DGPR(408.12,PRIEN,0)),"^",3)
I IPIEN["DGPR(408.13" DO
. S IPIEN=$P(IPIEN,";",1)
. I $P($G(^DGPR(408.13,IPIEN,1)),"^",2)]"" S $P(ADDCKVAL,U,1,2)="1^1"
. I $P($G(^DGPR(408.13,IPIEN,1)),"^",3)]"" S $P(ADDCKVAL,U,1,2)="1^1"
. I $P($G(^DGPR(408.13,IPIEN,1)),"^",4)]"" S $P(ADDCKVAL,U,1,2)="1^1"
. I $P($G(^DGPR(408.13,IPIEN,1)),"^",5)]"" S $P(ADDCKVAL,U,1,2)="1^1"
. I $P($G(^DGPR(408.13,IPIEN,1)),"^",6)]"" S $P(ADDCKVAL,U,1,2)="1^1"
. I $P($G(^DGPR(408.13,IPIEN,1)),"^",7)]"" S $P(ADDCKVAL,U,1,2)="1^1"
. I $P($G(^DGPR(408.13,IPIEN,1)),"^",8)]"" S $P(ADDCKVAL,U,3)="1"
Q ADDCKVAL
DGDEP3 ;ALB/CAW,BAJ,ERC - Dependents display ; 11/22/2005
+1 ;;5.3;PIMS;**45,624,653,688,1015,1016**;JUN 30, 2012;Build 20
+2 ;
SELF(INCPER,NAME,RELATE,ACT,DGMTI,CNT) ; Display information concerning veteran
+1 ;
+2 SET DGX=""
SET DGX=$$SETSTR^VALM1(CNT,DGX,3,3)
+3 IF $GET(DGMTI)
IF INCPER
IF ($PIECE($GET(^DGMT(408.22,+INCPER,"MT")),U)=DGMTI)
SET DGX=$$SETSTR^VALM1("*",DGX,5,1)
+4 SET DGX=$$SETSTR^VALM1(NAME,DGX,9,22)
+5 SET DGX=$$SETSTR^VALM1($PIECE($GET(^DG(408.11,RELATE,0)),U),DGX,32,30)
+6 SET DGX=$$SETSTR^VALM1($SELECT($PIECE(ACT,U,2)=1:"*",1:""),DGX,65,1)
+7 IF RELATE=2
SET DGX=$$SETSTR^VALM1($SELECT(+$$ADDCHK(INCPER)=1:"*",1:""),DGX,73,1)
+8 DO SET^DGDEP(DGX)
+9 ;
+10 ; Display spouse SSN and SSN Verification status DG*5.3*688 BAJ 11/22/2005
+11 IF RELATE=2
Begin DoDot:1
+12 SET DGX=""
SET DGX=$$SETSTR^VALM1($PIECE(DGDEP,"^",5),DGX,9,14)
+13 SET DGX=$$SETSTR^VALM1($PIECE(DGDEP,"^",9),DGX,23,10)
+14 ;if a Pseudo SSN need Pseudo SSN Reason - DG*5.3*653, ERC
+15 IF $PIECE(DGDEP,U,5)["P"
Begin DoDot:2
+16 SET DGX=$$SETSTR^VALM1("PSSN Reason: ",DGX,32,15)
+17 SET DGX=$$SETSTR^VALM1($PIECE(DGDEP,U,10),DGX,45,30)
+18 ;D SET^DGDEP(DGX)
End DoDot:2
+19 DO SET^DGDEP(DGX)
End DoDot:1
+20 ;
+21 IF RELATE=2
QUIT
+22 SET INCPER=^DGMT(408.22,INCPER,0)
+23 SET DGX=""
SET DGX=$$SETSTR^VALM1("Married Last Year: ",DGX,18,19)
+24 SET DGX=$$SETSTR^VALM1($SELECT($PIECE(INCPER,U,5):"Yes",$PIECE(INCPER,U,5)="":"Unanswered",1:"No"),DGX,38,10)
+25 DO SET^DGDEP(DGX)
+26 ;
+27 IF '$GET(DGMTI)
QUIT
+28 IF $PIECE(INCPER,U,5)=1
Begin DoDot:1
+29 SET DGX=""
SET DGX=$$SETSTR^VALM1("Lived with Spouse: ",DGX,18,19)
+30 SET DGX=$$SETSTR^VALM1($SELECT($PIECE(INCPER,U,6):"Yes",$PIECE(INCPER,U,6)="":"Unanswered",1:"No"),DGX,38,10)
+31 DO SET^DGDEP(DGX)
End DoDot:1
+32 ;
+33 IF $PIECE(INCPER,U,6)=0
Begin DoDot:1
+34 SET DGX=""
SET DGX=$$SETSTR^VALM1("Amount Contributed: ",DGX,17,19)
+35 SET DGX=$$SETSTR^VALM1($SELECT($PIECE(INCPER,U,7)]"":$PIECE(INCPER,U,7),1:"Unanswered"),DGX,38,10)
+36 DO SET^DGDEP(DGX)
End DoDot:1
+37 QUIT
+38 ;
CHILD(INCPER,NAME,RELATE,ACT,DGMTI,DGMTACT,CNT) ; Display information concerning dependents
+1 ;
+2 ;** DG*5.3*688 - GTS Get MT Version
+3 NEW MTVER
+4 IF (+$GET(DGMTI)>0)
SET MTVER=$PIECE($GET(^DGMT(408.31,DGMTI,2)),"^",11)
+5 IF (+$GET(DGMTI)'>0)
Begin DoDot:1
+6 NEW DGINC,DGREL,DGINR,DGDEP
+7 DO ALL^DGMTU21(DFN,"VSD",DT,"I")
+8 SET MTVER=$$VER^DGMTUTL3(.DGINC)
End DoDot:1
+9 SET DGX=""
SET DGX=$$SETSTR^VALM1(CNT,DGX,3,3)
+10 IF $GET(DGMTI)
IF INCPER
IF ($PIECE($GET(^DGMT(408.22,+INCPER,"MT")),U)=DGMTI)
SET DGX=$$SETSTR^VALM1("*",DGX,5,1)
+11 SET DGX=$$SETSTR^VALM1(NAME,DGX,9,22)
+12 SET DGX=$$SETSTR^VALM1($PIECE($GET(^DG(408.11,RELATE,0)),U),DGX,32,30)
+13 SET DGX=$$SETSTR^VALM1($SELECT($PIECE(ACT,U,2)=1:"*",1:""),DGX,65,1)
+14 SET DGX=$$SETSTR^VALM1($SELECT(+$$ADDCHK(INCPER)=1:"*",1:""),DGX,73,1)
+15 DO SET^DGDEP(DGX)
+16 ;
+17 ;display dependent SSN and SSN Verification status DG*5.3*688 BAJ 11/22/2005
+18 SET DGX=""
SET DGX=$$SETSTR^VALM1($PIECE(DGDEP,"^",5),DGX,9,14)
+19 SET DGX=$$SETSTR^VALM1($PIECE(DGDEP,"^",9),DGX,23,10)
+20 IF $PIECE(DGDEP,U,5)["P"
Begin DoDot:1
+21 SET DGX=$$SETSTR^VALM1("PSSN Reason: ",DGX,32,15)
+22 SET DGX=$$SETSTR^VALM1($PIECE(DGDEP,U,10),DGX,45,30)
End DoDot:1
+23 DO SET^DGDEP(DGX)
+24 ;
+25 IF '$GET(DGMTI)!('$PIECE($GET(^DG(408.11,RELATE,0)),U,4))
QUIT
+26 SET INCPER=^DGMT(408.22,INCPER,0)
+27 SET DGX=""
SET DGX=$$SETSTR^VALM1("Incapable of Self-support: ",DGX,10,27)
+28 SET DGX=$$SETSTR^VALM1($SELECT($PIECE(INCPER,U,9):"Yes",$PIECE(INCPER,U,9)="":"Unanswered",1:"No"),DGX,38,10)
+29 DO SET^DGDEP(DGX)
+30 ;
+31 ;* DG*5.3*624
+32 SET DGX=""
SET DGX=$$SETSTR^VALM1("Child 18 to 23. Attended School: ",DGX,4,33)
+33 SET DGX=$$SETSTR^VALM1($SELECT($PIECE(INCPER,U,18):"Yes",$PIECE(INCPER,U,18)="":"Unanswered",1:"No"),DGX,38,10)
+34 DO SET^DGDEP(DGX)
+35 ;
+36 SET DGX=""
SET DGX=$$SETSTR^VALM1("Child lived with you: ",DGX,15,22)
+37 SET DGX=$$SETSTR^VALM1($SELECT($PIECE(INCPER,U,6):"Yes",$PIECE(INCPER,U,6)="":"Unanswered",1:"No"),DGX,38,10)
+38 DO SET^DGDEP(DGX)
+39 ;
+40 SET DGX=""
SET DGX=$$SETSTR^VALM1("Child Support: ",DGX,22,15)
+41 SET DGX=$$SETSTR^VALM1($SELECT($PIECE(INCPER,U,6)=1:"N/A",$PIECE(INCPER,U,10)=1:"Yes",$PIECE(INCPER,U,10)="":"Unanswered",1:"No"),DGX,38,10)
+42 DO SET^DGDEP(DGX)
+43 ;
+44 ;* DG*5.3*624
+45 SET DGX=""
SET DGX=$$SETSTR^VALM1("Amount contributed: ",DGX,17,20)
+46 SET DGX=$$SETSTR^VALM1($SELECT($PIECE(INCPER,U,10)'=1:"N/A",($PIECE(INCPER,U,19)'="0")&($PIECE(INCPER,U,19)'=""):$PIECE(INCPER,U,19),$PIECE(INCPER,U,19)="":"Unanswered",1:"0"),DGX,38,10)
+47 DO SET^DGDEP(DGX)
+48 ;
+49 ;** DG*5.3*688 - GTS Chk MT Version and output correct data
+50 SET DGX=""
+51 IF (+MTVER<1)
SET DGX=$$SETSTR^VALM1("Child Has Income: ",DGX,19,18)
+52 IF (+MTVER=1)
SET DGX=$$SETSTR^VALM1("Child Has Income/Net Worth: ",DGX,9,28)
+53 SET DGX=$$SETSTR^VALM1($SELECT($PIECE(INCPER,U,11)=1:"Yes",$PIECE(INCPER,U,11)="":"Unanswered",1:"No"),DGX,38,10)
+54 DO SET^DGDEP(DGX)
+55 ;
+56 ;** DG*5.3*688 - GTS Chk MT Version and output correct data
+57 SET DGX=""
+58 IF (+MTVER<1)
SET DGX=$$SETSTR^VALM1("Income Available: ",DGX,19,18)
+59 IF (+MTVER=1)
SET DGX=$$SETSTR^VALM1("Income/Net Worth Available: ",DGX,9,28)
+60 SET DGX=$$SETSTR^VALM1($SELECT($PIECE(INCPER,U,11)=0:"N/A",$PIECE(INCPER,U,12)=1:"Yes",$PIECE(INCPER,U,12)="":"Unanswered",1:"No"),DGX,38,10)
+61 DO SET^DGDEP(DGX)
CHILDQ QUIT
+1 ;
ADDCHK(INCPER) ; Indicates existence of any dependent address
+1 ; Input:
+2 ; INCPER - Pointer to dep. entry in Income Relation file (408.22)
+3 ;
+4 ; Output:
+5 ; both address and phone^address^phone
+6 ; KEY:
+7 ; 0 - No data exists for the dependent in 408.13
+8 ; 1 - Data exists for the dependent in 408.13
+9 ;
+10 ; 1^1^1 - Address and Phone data exist for dependent
+11 ; 0^1^0 - Address only exists for dependent
+12 ; 0^0^1 - Phone only exists for dependent
+13 ; 0^0^0 - Neither Phone nor Address data exists for dependent
+14 ;
+15 NEW ADDCKVAL,INDAIIEN,PRIEN,IPIEN
+16 SET ADDCKVAL="0^0^0"
+17 SET INDAIIEN=$PIECE($GET(^DGMT(408.22,INCPER,0)),"^",2)
+18 SET PRIEN=$PIECE($GET(^DGMT(408.21,INDAIIEN,0)),"^",2)
+19 SET IPIEN=$PIECE($GET(^DGPR(408.12,PRIEN,0)),"^",3)
+20 IF IPIEN["DGPR(408.13"
Begin DoDot:1
+21 SET IPIEN=$PIECE(IPIEN,";",1)
+22 IF $PIECE($GET(^DGPR(408.13,IPIEN,1)),"^",2)]""
SET $PIECE(ADDCKVAL,U,1,2)="1^1"
+23 IF $PIECE($GET(^DGPR(408.13,IPIEN,1)),"^",3)]""
SET $PIECE(ADDCKVAL,U,1,2)="1^1"
+24 IF $PIECE($GET(^DGPR(408.13,IPIEN,1)),"^",4)]""
SET $PIECE(ADDCKVAL,U,1,2)="1^1"
+25 IF $PIECE($GET(^DGPR(408.13,IPIEN,1)),"^",5)]""
SET $PIECE(ADDCKVAL,U,1,2)="1^1"
+26 IF $PIECE($GET(^DGPR(408.13,IPIEN,1)),"^",6)]""
SET $PIECE(ADDCKVAL,U,1,2)="1^1"
+27 IF $PIECE($GET(^DGPR(408.13,IPIEN,1)),"^",7)]""
SET $PIECE(ADDCKVAL,U,1,2)="1^1"
+28 IF $PIECE($GET(^DGPR(408.13,IPIEN,1)),"^",8)]""
SET $PIECE(ADDCKVAL,U,3)="1"
End DoDot:1
+29 QUIT ADDCKVAL