source: WorldVistAEHR/trunk/r/INCOME_VERIFICATION_MATCH-IVM/IVMCMF.m@ 975

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

initial load of WorldVistAEHR

File size: 3.0 KB
Line 
1IVMCMF ;ALB/RMM - INCOME TEST EDIT CHECK DRIVER ; 04/28/2005
2 ;;2.0;INCOME VERIFICATION MATCH;**71,82,107**;21-OCT-94
3 ;
4 ; This routine will perform edit checks to validate income tests which
5 ; are transmitted to VistA from the IVM Center. Any errors will be
6 ; recorded and will be added to the record in the ANNUAL MEANS TEST
7 ; File #408.31.
8 ;
9 ; This routine is called from IVMCM1.
10 ;
11 ; Required Input:
12 ; The global array ^TMP($J,"IVMCM" which contains the income test
13 ; The local variable IVMTYPE, which may be:
14 ; 1 - Means Test
15 ; 2 - Copay Test
16 ; 4 - Long Term Care Test
17 ;
18 ; Output:
19 ; Array IVMERR as a list of error condition(s) found (free text)
20 ;
21EN(IVMERR) ; Entry point to begin edit checks.
22 ;
23 N ARRAY,DEP,I,IEN,SPOUSE,CNT,HLERR
24 S (DEP,CNT)=1,SPOUSE=0
25 I +$G(IVMTYPE)'>0 S CNT=CNT+1,IVMERR(CNT)="Income Test Type not Specified"
26 ;
27 ; Build strings for the veteran
28 S ARRAY("PID")=$$CLEAR($G(^TMP($J,"IVMCM","PIDV")))
29 S ARRAY("ZIC")=$$CLEAR($G(^TMP($J,"IVMCM","ZICV"))),$P(ARRAY("ZIC"),HLFS,21)=$$TOTAL^IVMCME(ARRAY("ZIC"))
30 S ARRAY("ZIR")=$$CLEAR($G(^TMP($J,"IVMCM","ZIRV")))
31 ;
32 ; Build string for spouse as dependent
33 S ARRAY(DEP,"ZDP")=$$CLEAR($G(^TMP($J,"IVMCM","ZDPS")))
34 S ARRAY(DEP,"ZIC")=$$CLEAR($G(^TMP($J,"IVMCM","ZICS")))
35 S ARRAY(DEP,"ZIR")=$$CLEAR($G(^TMP($J,"IVMCM","ZIRS")))
36 D ADJ^IVMCME
37 ;
38 ; Build strings for children as dependents
39 S IEN=0 F S IEN=$O(^TMP($J,"IVMCM","ZDPC",IEN)) Q:'IEN D
40 . S DEP=DEP+1
41 . S ARRAY(DEP,"ZDP")=$$CLEAR($G(^TMP($J,"IVMCM","ZDPC",IEN)))
42 . S ARRAY(DEP,"ZIC")=$$CLEAR($G(^TMP($J,"IVMCM","ZICC",IEN)))
43 . S ARRAY(DEP,"ZIR")=$$CLEAR($G(^TMP($J,"IVMCM","ZIRC",IEN)))
44 . D ADJ^IVMCME
45 ;
46 ; - build income test string and check for errors
47 S ARRAY("ZMT")=$$CLEAR($G(^TMP($J,"IVMCM","ZMT"_IVMTYPE)))
48 ;
49 I '$$UPLDOK() S HLERR="Income Test not Uploaded",OK2UPLD=0 D ACK^IVMPREC Q
50 ;
51 ; Check Income Test before applying consistency checks
52 ; - If AGREED TO PAY DEDUCTIBLE is NO
53 ; - or DECLINES TO GIVE INCOME INFO and AGREED TO PAY DEDUCTIBLE are YES
54 ; Quit, the consistency checks are unnecessary.
55 N APD,DTGII S APD=$P(ARRAY("ZMT"),U,11),DTGII=$P(ARRAY("ZMT"),U,14)
56 I APD=0!(APD=1&(DTGII=1)) Q
57 ;
58 D CHECK
59ENQ Q
60 ;
61CLEAR(NODE) ; Convert HLQ to NULL
62 N I
63 F I=1:1:$L(NODE,HLFS) I $P(NODE,HLFS,I)=HLQ S $P(NODE,HLFS,I)=""
64 Q NODE
65 ;
66CHECK ; Check validity of transmission data
67 N IEN
68 I "^1^2^4^"[("^"_IVMTYPE_"^") D ZMT^IVMCMF2(ARRAY("ZMT"))
69 D ZIR^IVMCMF1(ARRAY("ZIR"))
70 ;
71 S IEN="" F S IEN=$O(ARRAY(IEN)) Q:'IEN D
72 . D ZDP^IVMCMF2(ARRAY(IEN,"ZDP"))
73 . D ZIC^IVMCMF1(ARRAY(IEN,"ZIC"),IEN)
74 . D ZIR^IVMCMF1(ARRAY(IEN,"ZIR"),IEN)
75CHECKQ Q
76 ;
77UPLDOK() ; Check if the test is complete and OK to upload
78 ; Quit if not a valid test type
79 I "^1^2^3^4^"'[(U_IVMTYPE_U) Q 0
80 ;
81 ; Check the Income Test Status
82 N DGSTAT S DGSTAT=$P(ARRAY("ZMT"),U,3)
83 I IVMTYPE=1,"^C^A^G^N^P^"'[(U_DGSTAT_U) Q 0
84 I IVMTYPE=2,"^M^E^L^"'[(U_DGSTAT_U) Q 0
85 I IVMTYPE=4,"^0^1^"'[(U_DGSTAT_U) Q 0
86 ;
87 ; Check if the test has been completed
88 I IVMTYPE'=3,+$P(ARRAY("ZMT"),U,10)'>0 Q 0
89 Q 1
Note: See TracBrowser for help on using the repository browser.