source: WorldVistAEHR/trunk/r/INCOME_VERIFICATION_MATCH-IVM/IVMCME3.m@ 1003

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

initial load of WorldVistAEHR

File size: 1.8 KB
Line 
1IVMCME3 ;ALB/SEK - CHECK INCOME DEPENDENT DATA ; 02-MAY-95
2 ;;2.0;INCOME VERIFICATION MATCH;**17**;21-OCT-94
3 ;;Per VHA Directive 10-93-142, this routine should not be modified.
4 ;
5 ; This routine is a called from IVMCME.
6 ;
7ZDP(STRING,DEPIEN) ; check validity of ZDP segment
8 ;
9 ; Input: STRING as ZDP segment
10 ; DEPIEN as the IEN of the dependent in the array
11 ;
12 ; Output: ERROR message or null
13 ;
14 N ERROR,IVMZDP5,IVMZDP7,X,Y
15 S ERROR=""
16 S X=$P(STRING,HLFS,2) I $L(X)>30!($L(X)<3)!(X?.N)!(X?1P.E)!(X'?1U.ANP)!(X[",")!(X?.L)!(X?." ") S ERROR="Invalid dependent name content/length" G ZDPQ
17 S X=$P(STRING,HLFS,3) I X'="M",(X'="F") S ERROR="Invalid sex transmitted for dependent" G ZDPQ
18 S X=$$FMDATE^HLFNC($P(STRING,HLFS,4)),%DT="P" D ^%DT I Y<0!(1701231>Y) S ERROR="Unacceptable DOB for dependent" G ZDPQ
19 I IVMTYPE'=3,(($E($P(ARRAY("ZMT"),HLFS,2),1,4)-1_1231)<$P(STRING,HLFS,4)) S ERROR="Unacceptable DOB for dependent" G ZDPQ
20 S X=$P(STRING,HLFS,5) I X]"",(X'?9N),(X'?3N1"-"2N1"-"4N) S ERROR="Invalid dependent SSN transmitted" G ZDPQ
21 I $E(X)=9!($E(X,1,3)="000") S ERROR="SSA-invalid SSN transmitted for a dependent" G ZDPQ
22 S X=$G(^DG(408.11,$P(STRING,HLFS,6),0))
23 I '$P(X,"^",4) S ERROR="Invalid relationship for means test dependent" G ZDPQ
24 I $P(X,"^",3)'="E",($P(X,"^",3)'=$P(STRING,HLFS,3)) S ERROR="Dependent relationship/sex are inconsistent" G ZDPQ
25 I IVMTYPE'=3,($P(STRING,HLFS,9)>($E($P(ARRAY("ZMT"),HLFS,2),1,4)-1_1231)) S ERROR="Invalid Dependent Date...must be before MT year"
26 S IVMZDP5=$P(STRING,HLFS,5) I IVMZDP5']"" G ZDP7
27 I $D(IVMAR2(IVMZDP5)) S ERROR="Two dependents transmitted with same SSN" G ZDPQ
28 S IVMAR2(IVMZDP5)=""
29ZDP7 S IVMZDP7=$P(STRING,HLFS,7) I IVMZDP7']"" G ZDPQ
30 I $D(IVMAR(IVMZDP7)) S ERROR="Two dependents transmitted with same 408.12 IEN" G ZDPQ
31 S IVMAR(IVMZDP7)=""
32ZDPQ Q ERROR
Note: See TracBrowser for help on using the repository browser.