IVMCMF3 ;ALB/RMM - CHECK INCOME TEST DATA (CON'T.) ; 01/02/03
;;2.0;INCOME VERIFICATION MATCH;**71,107**;21-OCT-94
;
;
; This routine is called from IVMCMF2.
;
MT(STRING,INCOME) ; Calculate means test status
; DGMTBS - BASE THRESHOLD VALUE FOR SITE
; DGMTBH - BASE THRESHOLD VALUE SENT FROM HEC
; DGTDEP - TOTAL # OF DEPENDENTS SENT BY HEC.
;
N X,Y,ADJ,HAR,INC,NET,THRESH,THRESHA,THRESHT,IVMTEXT,XMSUB,CAT,CAT1
N VADM,DGMTBS,DGMTBH,DGTDEP,DGMTICY,DGMTCMP,DECLINE,DGMTICYR
S CAT1=$P(STRING,HLFS,3),CAT=$P(STRING,HLFS,26) I CAT="" S CAT=CAT1
;
; If previous yr mt threshold flag is set use date of prev year
S X=$S($P(STRING,HLFS,11):($E($P(STRING,HLFS,2),1,4)-1),1:$E($P(STRING,HLFS,2),1,4)),DGMTICY=$P($G(STRING),HLFS,2)
N Y S Y=$$HL7TFM^XLFDT(DGMTICY,"1D") X ^DD("DD") S DGMTICY=Y
S %DT="" D ^%DT S X=Y K %DT
S THRESH=$G(^DG(43,1,"MT",X,0)),THRESHT=$P(THRESH,U,2),DGMTBS=THRESHT
I $P(STRING,HLFS,12) S THRESHT=THRESHT+$P(THRESH,U,3)+(($P(STRING,HLFS,12)-1)*$P(THRESH,U,4)),DGTDEP=$P($G(STRING),HLFS,12)
;
S INC=$P(STRING,HLFS,4)-$P(STRING,HLFS,9),NET=$P(STRING,HLFS,5)
S ADJ=$P(STRING,HLFS,6),THRESHA=$P(STRING,HLFS,8),DGMTBH=THRESHA
I $P(STRING,HLFS,12),(THRESHA'=THRESHT) S THRESHA=THRESHA+$P(THRESH,U,3)+(($P(STRING,HLFS,12)-1)*$P(THRESH,U,4))
S DECLINE=$P(STRING,HLFS,16),HAR=$P(STRING,HLFS,13),DGMTCMP=+$P(STRING,HLFS,10)
S DGMTICYR=$$LYR^DGMTSCU1($$HL7TFM^XLFDT($P(STRING,HLFS,2)))
;
; If Decline to Give Incone Info & MT CP Req, Quit
I DECLINE,CAT="C" G MTQ
;
; If threshold A is incorrect, send message to sites's IVM MESSAGE
; mail group and continue to process
I +DGMTBH>0,DGMTCMP>0,(CAT'="G"&(THRESHT'=THRESHA)) D
.D:$G(DFN)'=""
..N VAHOW,VAROOT,VAPTYP
..D DEM^VADPT
.S XMSUB="MT threshold discrepancy - "_"PID - "_$P($G(VADM(2)),U,2)
.S IVMTEXT(1)="While uploading the following income test from HEC a"
.S IVMTEXT(2)="discrepancy was found with the threshold A values."
.S IVMTEXT(3)=" ",IVMTEXT(4)=" NAME: "_$G(VADM(1))
.S IVMTEXT(5)=" ",IVMTEXT(6)=" PID : "_$P($G(VADM(2)),"^",2)
.S IVMTEXT(8)=" ",IVMTEXT(9)="Date of Test sent from HEC: "_DGMTICY
.S IVMTEXT(10)=" "
.S IVMTEXT(11)="Site MT Threshold value: "_$J($FN($G(THRESHT),",",0),6)
.S IVMTEXT(12)=" "
.S IVMTEXT(13)="HEC Transmitted MT Threshold value: "_$J($FN($G(DGMTBH),",",0),6)
.S IVMTEXT(14)=" ",IVMTEXT(16)="Total number of dependents: "_$G(DGTDEP)
.S IVMTEXT(17)=" "
.D MAIL^IVMUFNC("DGMT MT/CT UPLOAD ALERTS")
.Q
;
I INC'>THRESHA I ((INC+NET)'>$P(THRESH,U,8))&(CAT="C") S CNT=CNT+1,IVMERR(CNT)="Income plus net worth not greater than threshold value-incorrect status"
I INC>THRESHA,CAT'="C",'HAR,'ADJ,CAT'="P" S CNT=CNT+1,IVMERR(CNT)="Incorrect means test status for Test-Determined Status"
MTQ Q
;
;
CO(STRING) ; Calculate copay test status
;
; Variables containing ZMT fields
N CAT,CAT1,DGCAT,DGCOPS,DGCOST
S CAT1=$P(STRING,HLFS,3),CAT=$P(STRING,HLFS,26) I CAT="" S CAT=CAT1
S DGCOST=$$FMDATE^HLFNC($P(STRING,HLFS,2))_U_DFN_U_U_$P(STRING,HLFS,4)_U_U_U_U_U_U_U_U_U_U_$P(STRING,HLFS,16)_U_$P(STRING,HLFS,9)_U_U_U_$P(STRING,HLFS,12)_U_2
S DGCOPS=$$INCDT^IBARXEU1(DGCOST),DGCAT=$S(+DGCOPS=1:"E",+DGCOPS=2:"M",+DGCOPS=3:"P",1:"I")
I CAT'=DGCAT S CNT=CNT+1,IVMERR(CNT)="Copay Test Status should be "_DGCAT
COQ Q
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HIVMCMF3 3327 printed Oct 16, 2024@18:02:15 Page 2
IVMCMF3 ;ALB/RMM - CHECK INCOME TEST DATA (CON'T.) ; 01/02/03
+1 ;;2.0;INCOME VERIFICATION MATCH;**71,107**;21-OCT-94
+2 ;
+3 ;
+4 ; This routine is called from IVMCMF2.
+5 ;
MT(STRING,INCOME) ; Calculate means test status
+1 ; DGMTBS - BASE THRESHOLD VALUE FOR SITE
+2 ; DGMTBH - BASE THRESHOLD VALUE SENT FROM HEC
+3 ; DGTDEP - TOTAL # OF DEPENDENTS SENT BY HEC.
+4 ;
+5 NEW X,Y,ADJ,HAR,INC,NET,THRESH,THRESHA,THRESHT,IVMTEXT,XMSUB,CAT,CAT1
+6 NEW VADM,DGMTBS,DGMTBH,DGTDEP,DGMTICY,DGMTCMP,DECLINE,DGMTICYR
+7 SET CAT1=$PIECE(STRING,HLFS,3)
SET CAT=$PIECE(STRING,HLFS,26)
IF CAT=""
SET CAT=CAT1
+8 ;
+9 ; If previous yr mt threshold flag is set use date of prev year
+10 SET X=$SELECT($PIECE(STRING,HLFS,11):($EXTRACT($PIECE(STRING,HLFS,2),1,4)-1),1:$EXTRACT($PIECE(STRING,HLFS,2),1,4))
SET DGMTICY=$PIECE($GET(STRING),HLFS,2)
+11 NEW Y
SET Y=$$HL7TFM^XLFDT(DGMTICY,"1D")
XECUTE ^DD("DD")
SET DGMTICY=Y
+12 SET %DT=""
DO ^%DT
SET X=Y
KILL %DT
+13 SET THRESH=$GET(^DG(43,1,"MT",X,0))
SET THRESHT=$PIECE(THRESH,U,2)
SET DGMTBS=THRESHT
+14 IF $PIECE(STRING,HLFS,12)
SET THRESHT=THRESHT+$PIECE(THRESH,U,3)+(($PIECE(STRING,HLFS,12)-1)*$PIECE(THRESH,U,4))
SET DGTDEP=$PIECE($GET(STRING),HLFS,12)
+15 ;
+16 SET INC=$PIECE(STRING,HLFS,4)-$PIECE(STRING,HLFS,9)
SET NET=$PIECE(STRING,HLFS,5)
+17 SET ADJ=$PIECE(STRING,HLFS,6)
SET THRESHA=$PIECE(STRING,HLFS,8)
SET DGMTBH=THRESHA
+18 IF $PIECE(STRING,HLFS,12)
IF (THRESHA'=THRESHT)
SET THRESHA=THRESHA+$PIECE(THRESH,U,3)+(($PIECE(STRING,HLFS,12)-1)*$PIECE(THRESH,U,4))
+19 SET DECLINE=$PIECE(STRING,HLFS,16)
SET HAR=$PIECE(STRING,HLFS,13)
SET DGMTCMP=+$PIECE(STRING,HLFS,10)
+20 SET DGMTICYR=$$LYR^DGMTSCU1($$HL7TFM^XLFDT($PIECE(STRING,HLFS,2)))
+21 ;
+22 ; If Decline to Give Incone Info & MT CP Req, Quit
+23 IF DECLINE
IF CAT="C"
GOTO MTQ
+24 ;
+25 ; If threshold A is incorrect, send message to sites's IVM MESSAGE
+26 ; mail group and continue to process
+27 IF +DGMTBH>0
IF DGMTCMP>0
IF (CAT'="G"&(THRESHT'=THRESHA))
Begin DoDot:1
+28 if $GET(DFN)'=""
Begin DoDot:2
+29 NEW VAHOW,VAROOT,VAPTYP
+30 DO DEM^VADPT
End DoDot:2
+31 SET XMSUB="MT threshold discrepancy - "_"PID - "_$PIECE($GET(VADM(2)),U,2)
+32 SET IVMTEXT(1)="While uploading the following income test from HEC a"
+33 SET IVMTEXT(2)="discrepancy was found with the threshold A values."
+34 SET IVMTEXT(3)=" "
SET IVMTEXT(4)=" NAME: "_$GET(VADM(1))
+35 SET IVMTEXT(5)=" "
SET IVMTEXT(6)=" PID : "_$PIECE($GET(VADM(2)),"^",2)
+36 SET IVMTEXT(8)=" "
SET IVMTEXT(9)="Date of Test sent from HEC: "_DGMTICY
+37 SET IVMTEXT(10)=" "
+38 SET IVMTEXT(11)="Site MT Threshold value: "_$JUSTIFY($FNUMBER($GET(THRESHT),",",0),6)
+39 SET IVMTEXT(12)=" "
+40 SET IVMTEXT(13)="HEC Transmitted MT Threshold value: "_$JUSTIFY($FNUMBER($GET(DGMTBH),",",0),6)
+41 SET IVMTEXT(14)=" "
SET IVMTEXT(16)="Total number of dependents: "_$GET(DGTDEP)
+42 SET IVMTEXT(17)=" "
+43 DO MAIL^IVMUFNC("DGMT MT/CT UPLOAD ALERTS")
+44 QUIT
End DoDot:1
+45 ;
+46 IF INC'>THRESHA
IF ((INC+NET)'>$PIECE(THRESH,U,8))&(CAT="C")
SET CNT=CNT+1
SET IVMERR(CNT)="Income plus net worth not greater than threshold value-incorrect status"
+47 IF INC>THRESHA
IF CAT'="C"
IF 'HAR
IF 'ADJ
IF CAT'="P"
SET CNT=CNT+1
SET IVMERR(CNT)="Incorrect means test status for Test-Determined Status"
MTQ QUIT
+1 ;
+2 ;
CO(STRING) ; Calculate copay test status
+1 ;
+2 ; Variables containing ZMT fields
+3 NEW CAT,CAT1,DGCAT,DGCOPS,DGCOST
+4 SET CAT1=$PIECE(STRING,HLFS,3)
SET CAT=$PIECE(STRING,HLFS,26)
IF CAT=""
SET CAT=CAT1
+5 SET DGCOST=$$FMDATE^HLFNC($PIECE(STRING,HLFS,2))_U_DFN_U_U_$PIECE(STRING,HLFS,4)_U_U_U_U_U_U_U_U_U_U_$PIECE(STRING,HLFS,16)_U_$PIECE(STRING,HLFS,9)_U_U_U_$PIECE(STRING,HLFS,12)_U_2
+6 SET DGCOPS=$$INCDT^IBARXEU1(DGCOST)
SET DGCAT=$SELECT(+DGCOPS=1:"E",+DGCOPS=2:"M",+DGCOPS=3:"P",1:"I")
+7 IF CAT'=DGCAT
SET CNT=CNT+1
SET IVMERR(CNT)="Copay Test Status should be "_DGCAT
COQ QUIT