source: WorldVistAEHR/trunk/r/INCOME_VERIFICATION_MATCH-IVM/IVMUCHK1.m@ 1579

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

initial load of WorldVistAEHR

File size: 3.1 KB
Line 
1IVMUCHK1 ;ALB/MLI - Filter Routine to Validate IVM Center Tranmissions, Cont ; September 3, 1994
2 ;;Version 2.0 ; INCOME VERIFICATION MATCH ;**6**; 21-OCT-94
3 ;;Per VHA Directive 10-93-142, this routine should not be modified.
4 ;
5 ; This routine is a continuation of IVMUCHK. It performs checks on incoming means test
6 ; transmissions to ensure they are accurate prior to their upload into DHCP.
7 ;
8ZIR(STRING,DEPIEN) ; check validity of ZIR segment
9 ;
10 ; Input: STRING as ZIR segment
11 ; DEPIEN as the IEN of the dependent in the array, if applicable
12 ;
13 ; Output: ERROR message or null
14 ;
15 N ERROR,I,X
16 S ERROR=""
17 F I=2,3,5:1:9 D I ERROR]"" G ZIRQ
18 . S X=$P(STRING,HLFS,I)
19 . I X]"",(X'=0),(X'=1) S ERROR=$P($T(ZIRFLD+I),";;",2)_" contains unacceptable value" Q
20 I $$NUM^IVMUCHK2($P(STRING,HLFS,4),5,2) S ERROR="Invalid number for Amount Contributed to Spouse" G ZIRQ
21 S X=$P(STRING,HLFS,10) I X]""&((X>30)!(X<0)!(+X'=X)) S ERROR="Invalid number in Number of Dependent Children field" G ZIRQ
22 I X]"",(X'=DEP-SPOUSE) S ERROR="Number of Dependent Children does not match dependents transmitted" G ZIRQ
23 I '$G(DEPIEN) D I ERROR]"" G ZIRQ ; if veteran ZIR segment
24 . I $P(STRING,HLFS,2)']"" S ERROR="Must have Married Last Calendar Year for veteran" Q
25 . I SPOUSE,'$P(STRING,HLFS,2) S ERROR="Spouse transmitted, but Married Last Calendar Year is NO" Q
26 . I 'SPOUSE,$P(STRING,HLFS,2) S ERROR="No spouse transmitted, but Married Last Calendar Year is YES" Q
27 . I '$P(STRING,HLFS,2),($P(STRING,HLFS,3)]"") S ERROR="Can't have Lived with Patient if not Married" Q
28 . I $P(STRING,HLFS,2),($P(STRING,HLFS,3)']"") S ERROR="Must have Living with Patient if Married" Q
29 . I $P(STRING,HLFS,3),($P(STRING,HLFS,4)]"") S ERROR="Should not have Amount contributed to spouse if living w/patient" Q
30 . I $P(STRING,HLFS,3)=0,($P(STRING,HLFS,4)']"") S ERROR="Need amount contributed to spouse if not living w/patient" Q
31 . F I=6:1:9 I $P(STRING,HLFS,I)]"" S ERROR=$P($T(ZIRFLD+I),";;",2)_" should not be filled in for veteran" Q
32 . I '$P(STRING,HLFS,3),SPOUSE,($P(STRING,HLFS,4)<600) F I=3:1:20 I $P(ARRAY(SPOUSE,"ZIC"),HLFS,I) S ERROR="No income data allowed if spouse didn't live w/vet & amt contributed <$600" Q
33 I $G(DEPIEN)=SPOUSE D I ERROR]"" G ZIRQ ; if spouse ZIR segment
34 . F I=2:1:10 I $P(STRING,HLFS,I)]"" S ERROR=$P($T(ZIRFLD+I),";;",2)_" should not be filled in for spouse ZIR" Q
35 I $G(DEPIEN),(DEPIEN'=SPOUSE) D I ERROR]"" G ZIRQ ; if child ZIR segment
36 . I $P(STRING,HLFS,3)']"" S ERROR="Dependents must have Lived With Patient field" Q
37 . I '$P(STRING,HLFS,8),($P(STRING,HLFS,9)]"") S ERROR="Shouldn't have Income Available answered if Child had no income" Q
38 . I $P(STRING,HLFS,3),($P(STRING,HLFS,7)]"") S ERROR="Shouldn't have Contributed to Support if living w/patient" Q
39 . I '$P(STRING,HLFS,8) F I=3:1:20 I $P(ARRAY(DEPIEN,"ZIC"),HLFS,I) S ERROR="Shouldn't have income data if Child Had Income is NO" Q
40ZIRQ Q ERROR
41 ;
42 ;
43ZIRFLD ; ZIR field names
44 ;;
45 ;;MARRIED LAST CALENDAR YEAR
46 ;;LIVED WITH PATIENT
47 ;;AMOUNT CONTRIBUTED TO SPOUSE
48 ;;DEPENDENT CHILDREN
49 ;;INCAPABLE OF SELF SUPPORT
50 ;;CONTRIBUTED TO SUPPORT
51 ;;CHILD HAD INCOME
52 ;;INCOME AVAILABLE TO YOU
53 ;;NUMBER OF DEPENDENT CHILDREN
Note: See TracBrowser for help on using the repository browser.