IVMCMF2 ;ALB/SEK,CKN,TDM,BDB - CHECK INCOME DEPENDENT DATA ;4/14/06 1:34pm
;;2.0;INCOME VERIFICATION MATCH;**71,107,105,115,190**;21-OCT-94;Build 47
;
; This routine is a called from IVMCMF.
;
ZMT(STRING) ; check ZMT segment
;
; Input: STRING as ZMT segment
;
N X,Y
;
; Means Test Status Checks
I IVMTYPE=1,$P(STRING,HLFS,3)'="G" D MT^IVMCMF3(STRING,ARRAY("ZIC"))
;
; Copay Test Status Checks
I IVMTYPE=2 D CO^IVMCMF3(STRING)
;
; Hardship consistency checks
N HARDSHIP K HARDSHIP
S HARDSHIP("Y/N")=$P(STRING,HLFS,13)
S HARDSHIP("SITE")=$P(STRING,HLFS,23)
S HARDSHIP("EFFDATE")=$P(STRING,HLFS,24)
;
I (IVMTYPE'=4),(HARDSHIP("Y/N"))!(+HARDSHIP("SITE"))!(HARDSHIP("EFFDATE")) D
.I HARDSHIP("Y/N")="" S CNT=CNT+1,IVMERR(CNT)="Missing Hardship Indicator"
.I HARDSHIP("SITE")="" S CNT=CNT+1,IVMERR(CNT)="Missing Site Granting Hardship"
.;starting in year 2000, all hardships should have an effective date
.I $E($P(STRING,HLFS,2),1,4)'<2000,(HARDSHIP("EFFDATE")="") S CNT=CNT+1,IVMERR(CNT)="Missing Hardship Effective Date"
.I $L(HARDSHIP("EFFDATE")) S X=$$FMDATE^HLFNC(HARDSHIP("EFFDATE")),%DT=X D ^%DT I Y<0 S CNT=CNT+1,IVMERR(CNT)="Invalid Hardship Effective Date"
.I HARDSHIP("EFFDATE"),(HARDSHIP("EFFDATE")<$P(STRING,HLFS,2)) S CNT=CNT+1,IVMERR(CNT)="Hardship Effective Date earlier than Means Test Date" ;IVM*2.0*190 BDB
;
; Source of Test
S X=$P(STRING,HLFS,18)
I "^1^2^3^4^"'[(U_X_U) S CNT=CNT+1,IVMERR(CNT)="Source of Test must be identified"
I X=4,$P(STRING,HLFS,22)="" S CNT=CNT+1,IVMERR(CNT)="Site Conducting Test must be identified"
;
ZMTQ Q
;
ZDP(STRING) ; Check validity of ZDP segment
;
; Input: STRING as ZDP segment
;
N RELAT,IVMZDP5,PSSNRSN,SSNVSTAT
S IVMZDP5=$P(STRING,HLFS,5)
I +IVMZDP5'>0 D G ZDPQ
.S RELAT=$P(STRING,HLFS,6),RELAT=$S($D(^DG(408.11,RELAT,0)):$P(^DG(408.11,RELAT,0),HLFS),1:"OTHER")
.S CNT=CNT+1,IVMERR(CNT)="Dependent ("_RELAT_") transmitted without SSN"
I $D(IVMAR2(IVMZDP5)) S CNT=CNT+1,IVMERR(CNT)="Two dependents transmitted with same SSN"
S IVMAR2(IVMZDP5)=""
S PSSNRSN=$P(STRING,HLFS,10) I PSSNRSN]"",(PSSNRSN'="R"),(PSSNRSN'="S"),(PSSNRSN'="N") S CNT=CNT+1,IVMERR(CNT)="Invalid Pseudo SSN Reason transmitted for Spouse/Dependent."
S SSNVSTAT=$P(STRING,HLFS,12) I SSNVSTAT]"",(SSNVSTAT'=2),(SSNVSTAT'=4) S CNT=CNT+1,IVMERR(CNT)="Invalid SSN Verification Status transmitted for Spouse/Dependent."
ZDPQ Q
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HIVMCMF2 2442 printed Oct 16, 2024@18:02:14 Page 2
IVMCMF2 ;ALB/SEK,CKN,TDM,BDB - CHECK INCOME DEPENDENT DATA ;4/14/06 1:34pm
+1 ;;2.0;INCOME VERIFICATION MATCH;**71,107,105,115,190**;21-OCT-94;Build 47
+2 ;
+3 ; This routine is a called from IVMCMF.
+4 ;
ZMT(STRING) ; check ZMT segment
+1 ;
+2 ; Input: STRING as ZMT segment
+3 ;
+4 NEW X,Y
+5 ;
+6 ; Means Test Status Checks
+7 IF IVMTYPE=1
IF $PIECE(STRING,HLFS,3)'="G"
DO MT^IVMCMF3(STRING,ARRAY("ZIC"))
+8 ;
+9 ; Copay Test Status Checks
+10 IF IVMTYPE=2
DO CO^IVMCMF3(STRING)
+11 ;
+12 ; Hardship consistency checks
+13 NEW HARDSHIP
KILL HARDSHIP
+14 SET HARDSHIP("Y/N")=$PIECE(STRING,HLFS,13)
+15 SET HARDSHIP("SITE")=$PIECE(STRING,HLFS,23)
+16 SET HARDSHIP("EFFDATE")=$PIECE(STRING,HLFS,24)
+17 ;
+18 IF (IVMTYPE'=4)
IF (HARDSHIP("Y/N"))!(+HARDSHIP("SITE"))!(HARDSHIP("EFFDATE"))
Begin DoDot:1
+19 IF HARDSHIP("Y/N")=""
SET CNT=CNT+1
SET IVMERR(CNT)="Missing Hardship Indicator"
+20 IF HARDSHIP("SITE")=""
SET CNT=CNT+1
SET IVMERR(CNT)="Missing Site Granting Hardship"
+21 ;starting in year 2000, all hardships should have an effective date
+22 IF $EXTRACT($PIECE(STRING,HLFS,2),1,4)'<2000
IF (HARDSHIP("EFFDATE")="")
SET CNT=CNT+1
SET IVMERR(CNT)="Missing Hardship Effective Date"
+23 IF $LENGTH(HARDSHIP("EFFDATE"))
SET X=$$FMDATE^HLFNC(HARDSHIP("EFFDATE"))
SET %DT=X
DO ^%DT
IF Y<0
SET CNT=CNT+1
SET IVMERR(CNT)="Invalid Hardship Effective Date"
+24 ;IVM*2.0*190 BDB
IF HARDSHIP("EFFDATE")
IF (HARDSHIP("EFFDATE")<$PIECE(STRING,HLFS,2))
SET CNT=CNT+1
SET IVMERR(CNT)="Hardship Effective Date earlier than Means Test Date"
End DoDot:1
+25 ;
+26 ; Source of Test
+27 SET X=$PIECE(STRING,HLFS,18)
+28 IF "^1^2^3^4^"'[(U_X_U)
SET CNT=CNT+1
SET IVMERR(CNT)="Source of Test must be identified"
+29 IF X=4
IF $PIECE(STRING,HLFS,22)=""
SET CNT=CNT+1
SET IVMERR(CNT)="Site Conducting Test must be identified"
+30 ;
ZMTQ QUIT
+1 ;
ZDP(STRING) ; Check validity of ZDP segment
+1 ;
+2 ; Input: STRING as ZDP segment
+3 ;
+4 NEW RELAT,IVMZDP5,PSSNRSN,SSNVSTAT
+5 SET IVMZDP5=$PIECE(STRING,HLFS,5)
+6 IF +IVMZDP5'>0
Begin DoDot:1
+7 SET RELAT=$PIECE(STRING,HLFS,6)
SET RELAT=$SELECT($DATA(^DG(408.11,RELAT,0)):$PIECE(^DG(408.11,RELAT,0),HLFS),1:"OTHER")
+8 SET CNT=CNT+1
SET IVMERR(CNT)="Dependent ("_RELAT_") transmitted without SSN"
End DoDot:1
GOTO ZDPQ
+9 IF $DATA(IVMAR2(IVMZDP5))
SET CNT=CNT+1
SET IVMERR(CNT)="Two dependents transmitted with same SSN"
+10 SET IVMAR2(IVMZDP5)=""
+11 SET PSSNRSN=$PIECE(STRING,HLFS,10)
IF PSSNRSN]""
IF (PSSNRSN'="R")
IF (PSSNRSN'="S")
IF (PSSNRSN'="N")
SET CNT=CNT+1
SET IVMERR(CNT)="Invalid Pseudo SSN Reason transmitted for Spouse/Dependent."
+12 SET SSNVSTAT=$PIECE(STRING,HLFS,12)
IF SSNVSTAT]""
IF (SSNVSTAT'=2)
IF (SSNVSTAT'=4)
SET CNT=CNT+1
SET IVMERR(CNT)="Invalid SSN Verification Status transmitted for Spouse/Dependent."
ZDPQ QUIT