Home   Package List   Routine Alphabetical List   Global Alphabetical List   FileMan Files List   FileMan Sub-Files List   Package Component Lists   Package-Namespace Mapping  
Routine: DGMTDD2

DGMTDD2.m

Go to the documentation of this file.
  1. DGMTDD2 ;ALB/RMO,LBD - Income Relation file (#408.22) Data Dictionary Calls ;13 MAR 1992 3:00 pm
  1. ;;5.3;Registration;**33,45,518,688**;Aug 13, 1993;Build 29
  1. ;
  1. ID ;Identifier for Income Relation file
  1. N DGIN0,DGPRI,Y
  1. S DGIN0=$G(^DGMT(408.21,+$P($G(^(0)),U,2),0))
  1. S DGPRI=+$P(DGIN0,U,2),Y=+DGIN0 X ^DD("DD")
  1. W " ",Y W:$P($G(^DGPR(408.12,DGPRI,0)),U,2)'=1 " Relation: ",$$NAME^DGMTU1(DGPRI)," (",$$REL^DGMTU1(DGPRI),")" W !
  1. Q
  1. ;
  1. FUN ;"Trigger" Cross-reference on the Married field (#.05) and
  1. ;Dependent Children field (#.08) to delete funeral and burial
  1. ;expenses
  1. ; If the test is a LTC Copay test do not delete the funeral and
  1. ; burial expenses. Added for LTC Phase III (DG*5.3*518)
  1. N DGFLD,DGIN0,DGINI,DGVAL,DGMT,DGMTIR ;DG5.3*688 added DGMTIR
  1. S DGINI=+$P($G(^DGMT(408.22,DA,0)),U,2),DGIN1=$G(^DGMT(408.21,DGINI,1))
  1. S DGMTIR=$P($G(^DGMT(408.22,DA,"MT")),U) ;DG5.3*688 defines DGMTIR
  1. S DGMT=+$G(^DGMT(408.21,DGINI,"MT"))
  1. I DGMT,$P($G(^DGMT(408.31,DGMT,0)),U,19)=3 Q
  1. I DGMT,$P($G(^DGMT(408.31,DGMT,2)),U,11)=1 Q ;* GTS DG*688 - MT V1 does not require Spouse or Children for F&B
  1. I DGMTIR,$P($G(^DGMT(408.31,DGMTIR,2)),U,11)=1 Q ;* DG*688 - Check for Version 1 using 408.22 MT Ptr
  1. S DGFLD=1.02,DGVAL=$P(DGIN1,U,2)
  1. I DGVAL]"" D KILL S $P(^DGMT(408.21,DGINI,1),U,2)=""
  1. Q
  1. ;
  1. SP ;"Trigger" Cross-reference on the Amount Contributed to Spouse field
  1. ;(#.07) to delete net worth on file for a spouse
  1. N DFN,DGIN2,DGINI,DGLY,DGREL,DGVAL
  1. S DGIR0=$G(^DGMT(408.22,DA,0))
  1. S DFN=+DGIR0,DGLY=+$G(^DGMT(408.21,+$P(DGIR0,U,2),0)) D
  1. .N DA,X
  1. .D GETREL^DGMTU11(DFN,"S",DGLY,$S($G(DGMTI):DGMTI,1:""))
  1. S DGINI=+$$IAI^DGMTU3(+$G(DGREL("S")),DGLY)
  1. S DGIN2=$G(^DGMT(408.21,DGINI,2))
  1. F DGFLD=2.01:.01:2.05 S DGVAL=$P(DGIN2,U,(DGFLD-2)/.01) I DGVAL]"" D
  1. .D KILL
  1. .S $P(^DGMT(408.21,DGINI,2),U,(DGFLD-2)/.01)=""
  1. Q
  1. ;
  1. INC ;"Trigger" Cross-reference on the Child Had Income field (#.11) and
  1. ;Income Available To You field (#.12) to delete educational expenses
  1. ;on file for a child
  1. N DGINI
  1. S DGINI=+$P($G(^DGMT(408.22,DA,0)),U,2)
  1. I $P($G(^DGMT(408.21,DGINI,0)),U,14)]"" D
  1. .N DGFLD,DGVAL
  1. .I $P($G(^DGMT(408.21,DGINI,1)),U,3)]"" S DGVAL=$P(^(1),U,3),DGFLD=1.03 D KILL S $P(^DGMT(408.21,DGINI,1),U,3)=""
  1. Q
  1. KILL ;Kill Cross-Reference
  1. N DA,DGIX,X
  1. S DA=DGINI,X=DGVAL,DGIX=0
  1. F S DGIX=$O(^DD(408.21,DGFLD,1,DGIX)) Q:'DGIX X ^(DGIX,2) S X=DGVAL
  1. Q
  1. ;
  1. MAR ;Input Transform check for the Married field (#.05)
  1. ;for an active spouse
  1. N DFN,DGIR0,DGLY,DGREL
  1. S DGIR0=$G(^DGMT(408.22,DA,0))
  1. S DFN=+DGIR0,DGLY=+$G(^DGMT(408.21,+$P(DGIR0,U,2),0)) D
  1. .N DA,X
  1. .D GETREL^DGMTU11(DFN,"S",DGLY,$S($G(DGMTI):DGMTI,1:""))
  1. I $D(DGREL("S")) W !?5,"An active spouse exists. Married cannot be 'NO'.",!?5,"You have to use the 'Expand Dependent' action and inactive first." K X
  1. Q
  1. ;
  1. DEP ;Input Transform check for the Dependent Children field (#.08)
  1. ;for active children
  1. N DFN,DGDEP,DGIR0,DGLY,DGREL
  1. S DGIR0=$G(^DGMT(408.22,DA,0))
  1. S DFN=+DGIR0,DGLY=+$G(^DGMT(408.21,+$P(DGIR0,U,2),0)) D
  1. .N DA,X
  1. .D GETREL^DGMTU11(DFN,"C",DGLY,$S($G(DGMTI):DGMTI,1:""))
  1. I $D(DGREL("C")) W !?5,"Active children exist. Dependent Children cannot be 'NO'." K X
  1. Q
  1. ;
  1. LIV ;Input Transform check for Lived With Patient field (#.06)
  1. N DGIR0,DGPRI
  1. S DGIR0=$G(^DGMT(408.22,DA,0)),DGPRI=+$P($G(^DGMT(408.21,+$P(DGIR0,U,2),0)),U,2)
  1. I $P($G(^DGPR(408.12,DGPRI,0)),U,2)=1,'$P(DGIR0,U,5) W !?5,"This field does not need to be filled in unless the patient is married." K X
  1. Q
  1. ;
  1. AMT ;Input Transform check for Amount Contributed To Spouse field (#.07)
  1. N DGIR0,DGPRI
  1. S DGIR0=$G(^DGMT(408.22,DA,0)),DGPRI=+$P($G(^DGMT(408.21,+$P(DGIR0,U,2),0)),U,2)
  1. I $P($G(^DGPR(408.12,DGPRI,0)),U,2)=1,('$P(DGIR0,U,5)!($P(DGIR0,U,6)'=0)) W !?5,"This field does not need to be filled in unless the patient was married",!?5,"and did not live with his or her spouse." K X
  1. Q
  1. ;
  1. CON ;Input Transform check for Contributed To Support field (#.1)
  1. N DGIR0,DGPRI
  1. S DGIR0=$G(^DGMT(408.22,DA,0)),DGPRI=+$P($G(^DGMT(408.21,+$P(DGIR0,U,2),0)),U,2)
  1. I "^3^4^5^6^"[(U_$P($G(^DGPR(408.12,DGPRI,0)),U,2)_U),$P(DGIR0,U,6)'=0 W !?5,"This field does not need to be filled in unless the child did not",!?5,"live with the patient." K X
  1. Q
  1. ;
  1. AVL ;Input Transform check for Income Available To You field (#.12)
  1. I '$P($G(^DGMT(408.22,DA,0)),U,11) W !?5,"This field does not need to be filled in unless the child has income." K X
  1. Q
  1. ;
  1. NAM ;Output Transform for Individual Annual Income field (#.02)
  1. N DGIN0,DGPRI
  1. S DGIN0=$G(^DGMT(408.21,Y,0)),DGPRI=+$P(DGIN0,U,2),Y=+DGIN0 X ^DD("DD")
  1. S Y=Y_" "_$$NAME^DGMTU1(DGPRI)
  1. Q
  1. ;
  1. LIVHLP ;Help for Lived With Patient field (#.06)
  1. N DGIR0,DGPRI
  1. S DGIR0=$G(^DGMT(408.22,DA,0)),DGPRI=+$P($G(^DGMT(408.21,+$P(DGIR0,U,2),0)),U,2)
  1. I $P($G(^DGPR(408.12,DGPRI,0)),U,2)=1 W !?5,"Enter in this field whether the veteran resided with his or her spouse",!?5,"last calendar year. If they were living apart because one was",!?5,"hospitalized or in a nursing home, enter 'YES'."
  1. I "^3^4^5^6^"[(U_$P($G(^DGPR(408.12,DGPRI,0)),U,2)_U) W !?5,"Enter in this field whether the child resided with the veteran last",!?5,"calendar year."
  1. W !
  1. Q