source: WorldVistAEHR/trunk/r/REGISTRATION-DGQE-DG-DPT-GRPX-VAD-VAF-VAS-VAT-VAU--VA-VIC--DGBT--DGJ--DGYA--VALM/DGMTUTL1.m@ 846

Last change on this file since 846 was 613, checked in by George Lilly, 15 years ago

initial load of WorldVistAEHR

File size: 2.2 KB
Line 
1DGMTUTL1 ;ALB/RMM - Means Test Consistency Checker ; 04/28/2005
2 ;;5.3;Registration;**463,542,610,655**;Aug 13, 1993
3 ;
4 ;
5 Q
6 ; Apply Consistency Checks to the Income Test Processes: ADD,
7 ; EDIT, and COMPLETE.
8 ;
9INCON(DFN,DGMTDT,DGMTI,IVMTYPE,IVMERR) ;
10 ;
11 ; Check Income Test before applying consistency checks
12 ; - If AGREED TO PAY DEDUCTIBLE is NO
13 ; - or DECLINES TO GIVE INCOME INFO and AGREED TO PAY DEDUCTIBLE are YES
14 ; Quit, the consistency checks are unnecessary.
15 N NODE0,APD,DTGII
16 S NODE0=$G(^DGMT(408.31,DGMTI,0)),APD=$P(NODE0,U,11),DTGII=$P(NODE0,U,14)
17 I APD=0!(APD=1&(DTGII=1)) Q
18 ;
19 ; Build the data strings for the veteran, and apply consistency checks
20 ; Get information and initialize variables
21 N CNT,HLFS,IEN,ARRAY,SPOUSE,DEP,DGDEP,DGINC,DGREL,DGINR,ZIR,ZIC,ZMT,ARRAY,DIEN
22 S CNT=1,HLFS=U,SPOUSE=0,ZIC=""
23 ;
24 ; Build Individual Annual Income and Income Relation Arrays
25 D ALL^DGMTU21(DFN,"VSC",DGMTDT)
26 ;
27 ; Build ZMT array for CC's
28 S $P(ARRAY("ZMT"),U,2)=$P($G(^DGMT(408.31,DGMTI,0)),U,1)
29 S $P(ARRAY("ZMT"),U,2)=$E($P(ARRAY("ZMT"),U,2),1,3)+1700_$E($P(ARRAY("ZMT"),U,2),4,7)
30 S $P(ARRAY("ZMT"),U,3)=$P($G(^DGMT(408.31,DGMTI,0)),U,3)
31 S $P(ARRAY("ZMT"),U,3)=$P(^DG(408.32,$P(ARRAY("ZMT"),U,3),0),U,2)
32 ;
33 ; Build Spouse ZIC Arrays
34 I $D(DGREL("S")) S SPOUSE=1,ARRAY(SPOUSE,"ZIC")=$$ZIC^DGMTUTL2(DGINC("S"),SPOUSE),ARRAY(SPOUSE,"ZIR")=$$ZIR^DGMTUTL2(DGINR("S")),ARRAY(SPOUSE,"ZDP")=$$ZDP^DGMTUTL2(DGREL("S"),SPOUSE)
35 I SPOUSE D ZDP^IVMCMF2(ARRAY(SPOUSE,"ZDP"))
36 ;
37 ; Build Dependent ZDP, ZIC & ZIR Arrays
38 F IEN=1:1:DGDEP S DIEN=IEN+SPOUSE,ARRAY(DIEN,"ZDP")=$$ZDP^DGMTUTL2(DGREL("C",IEN),DIEN),ARRAY(DIEN,"ZIC")=$$ZIC^DGMTUTL2(DGINC("C",IEN),DIEN),ARRAY(DIEN,"ZIR")=$$ZIR^DGMTUTL2(DGINR("C",IEN),DIEN)
39 S DEP=DGDEP+SPOUSE
40 ;
41 ; Perform the inconsistency Checks for the Veteran
42 I $D(DGINR("V")) D
43 .S ZIC=$$ZIC^DGMTUTL2(DGINC("V"))
44 .S ZIR=$$ZIR^DGMTUTL2(DGINR("V"),DGMTDT)
45 .D ZIR^IVMCMF1(ZIR,"")
46 ;
47 I "^1^2^4^"[("^"_IVMTYPE_"^"),(ZIC'="") D
48 .S ZMT=$$ZMT^DGMTUTL2(DGMTI)
49 .M ARRAY("ZIC")=ZIC
50 .D ZMT^IVMCMF2(ZMT)
51 ;
52 ; Perform the Consistency Checks for the dependent(s)
53 F IEN=(SPOUSE+1):1:DEP D ZDP^IVMCMF2(ARRAY(IEN,"ZDP")),ZIR^IVMCMF1(ARRAY(IEN,"ZIR"),IEN),ZIC^IVMCMF1(ARRAY(IEN,"ZIC"),IEN)
54 ;
55 Q
Note: See TracBrowser for help on using the repository browser.