IVMCUC ;ALB/KCL/CJM,LBD - DATA COLLECTION DIVISION (DCD) SELECTION CRITERIA ; 07-MAR-95
;;2.0;INCOME VERIFICATION MATCH;**9,17,62**;21-OCT-94
;
;
BT(IEN) ;
;Description: logs DCD defined Beneficiary Travel event if DCD criteria are met.
;
N DFN
Q:'$G(IEN)
S DFN=$P($G(^DGBT(392.2,IEN,0)),"^",2)
D:DFN LOGDCD(DFN)
Q
LOGDCD(DFN,IVMCDT) ;
;Description: logs DCD defined events for nightly transmission if DCD criteria are met.
;
;Input:
; DFN - ien of record in the PATIENT file
; IVMCDT - optional parameter, is the date/time to check, uses DT if not passed in
;
;
S:'$G(IVMCDT) IVMCDT=DT
;if patient meets DCD criteria, want to log patient for transmission
I $$DCD(DFN,IVMCDT) D
.N EVENTS,YEAR
.S EVENTS("DCD")=1
.S YEAR=$E(IVMCDT,1,3)-1_"0000"
.I $$LOG^IVMPLOG(DFN,YEAR,.EVENTS) ;then call was successful
Q
DCD(DFN,IVMCDT) ;
; - Determine if patient meets Data Collection Division (DCD) selection
; criteria and should be transmitted to the HEC.
; ===================================================================
; Veteran meets DCD section criteria if:
; 1. MT category based on IVMCDT is Cat A or Cat C
; or GMT (added by IVM*2*62)
;
; OR, 2. Completed an Rx-Copay Test based on IVMCDT
;
; OR, 3. Primary Eligiblility is NSC and veteran is
; eligible for Medicaid based on IVMCDT
;
; OR, 3. Primary Eligiblility is (NOT) one of the following:
; 1. NSC, VA PENSION
; 2. SC 50% TO 100%
; 3. AID & ATTENDANCE
; 4. HOUSE BOUND
;
; AND,
; a. Had any Income Screening based on IVMCDT
; OR, b. Submitted a claim for BT based on IVMCDT
; ====================================================================
;
; Input: DFN - as IEN of Patient (#2) file
; IVMCDT - as Date/Time (Optional - default is today@2359)
;
; Output: 1 --> if pt meets DCD selection criteria and
; should be sent to IVM Center
; 0 --> if pt does not meet DCD selection criteria and
; should not be sent to IVM Center
;
N IVMCBTCL,IVMCPEL,IVMCFLAG,IVMCIYR,IVMCTEST,VA,VAERR,VAEL
;
S DFN=$G(DFN) I '$D(^DPT(+DFN,0)) G DCDQ
S IVMCDT=$S($G(IVMCDT):IVMCDT,1:DT) S:'$P(IVMCDT,".",2) IVMCDT=IVMCDT_.2359
;
; - exclude non-vets
I $G(^DPT(DFN,"VET"))="N" G DCDQ
;
; - determine income year
S IVMCIYR=$$LYR^DGMTSCU1(IVMCDT)
;
; - flag indicating pt meets DCD selection criteria, transmit
S IVMCFLAG=1
;
MT ; - get last Means Test or Rx Copay Test for patient
S IVMCTEST=$$LST^DGMTCOU1(DFN,IVMCDT,3)
I $E($P(IVMCTEST,"^",2),1,3)'=$E(IVMCDT,1,3) G PRIM
;
; - if pt MT category is A or C based on date of test, transmit
; add check for GMT status (IVM*2*62)
I IVMCTEST,($P(IVMCTEST,"^",5)=1),"^A^C^G^"[("^"_$P(IVMCTEST,"^",4)_"^") G DCDQ
;
; - if completed Rx Copay Test based on date of test, transmit
I IVMCTEST,($P(IVMCTEST,"^",5)=2),($P(IVMCTEST,"^",4)="M"!($P(IVMCTEST,"^",4)="E")) G DCDQ
;
PRIM ; - get pt Primary Eligibility
D ELIG^VADPT S IVMCPEL=$P($G(^DIC(8,+VAEL(1),0)),"^",9)
;
; - if Primary Elig code is NSC and eligible for Medicaid
; based on (Date Last Asked?) field, transmit
I IVMCPEL=5,+$G(^DPT(DFN,.38)),($P($G(^(.38)),"^",2)>($E(DT,1,3)-2_1231.999999)) G DCDQ
;
; - if pt Primary Eligibility code is on DCD exclusion list,
; do not transmit
I "^1^2^4^15^"[("^"_IVMCPEL_"^") S IVMCFLAG=0 G DCDQ
;
; - If pt has any Income Screening (reported income), transmit
I $$IS(DFN,IVMCIYR) G DCDQ
;
; - if submitted Beneficiary Travel claim
S IVMCBTCL=$O(^DGBT(392,"C",DFN,$E(IVMCDT,1,3)_"0000"))
;
; - check if claim in date range
G:IVMCBTCL DCDQ
;
; - otherwise, set flag indicating pt should not be transmitted
S IVMCFLAG=0
;
DCDQ Q $G(IVMCFLAG)
;
;
IS(DFN,IVMCIYR) ; Has the veteran had Income Screening this year?
; Input: DFN -- Pointer to the patient in file #2
; IVMCIYR -- Income year in question
; Output: Has the vet had income screening? 0 => No | 1 => Yes
;
N IVMCIS,IVMCPR,IVMCIAI S IVMCIS=0
I '$G(DFN) G ISQ
;
; - get IEN of Patient Relation (#408.12) file, look at pts dependents
F IVMCPR=0:0 S IVMCPR=$O(^DGPR(408.12,"B",DFN,IVMCPR)) Q:'IVMCPR D
.;
.; - get IEN of Individual Annual Income (#408.21) file
.; get dependents annual income record effective on input date
.S IVMCIAI=$O(^DGMT(408.21,"AI",+IVMCPR,-IVMCIYR,0))
.;
.; - check for reported income
.I IVMCIAI S IVMCIS=IVMCIS+$S($P($G(^DGMT(408.21,+IVMCIAI,0)),U,8,17)'?."^":1,1:0)
;
ISQ Q IVMCIS>0
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HIVMCUC 4738 printed Dec 13, 2024@02:01:38 Page 2
IVMCUC ;ALB/KCL/CJM,LBD - DATA COLLECTION DIVISION (DCD) SELECTION CRITERIA ; 07-MAR-95
+1 ;;2.0;INCOME VERIFICATION MATCH;**9,17,62**;21-OCT-94
+2 ;
+3 ;
BT(IEN) ;
+1 ;Description: logs DCD defined Beneficiary Travel event if DCD criteria are met.
+2 ;
+3 NEW DFN
+4 if '$GET(IEN)
QUIT
+5 SET DFN=$PIECE($GET(^DGBT(392.2,IEN,0)),"^",2)
+6 if DFN
DO LOGDCD(DFN)
+7 QUIT
LOGDCD(DFN,IVMCDT) ;
+1 ;Description: logs DCD defined events for nightly transmission if DCD criteria are met.
+2 ;
+3 ;Input:
+4 ; DFN - ien of record in the PATIENT file
+5 ; IVMCDT - optional parameter, is the date/time to check, uses DT if not passed in
+6 ;
+7 ;
+8 if '$GET(IVMCDT)
SET IVMCDT=DT
+9 ;if patient meets DCD criteria, want to log patient for transmission
+10 IF $$DCD(DFN,IVMCDT)
Begin DoDot:1
+11 NEW EVENTS,YEAR
+12 SET EVENTS("DCD")=1
+13 SET YEAR=$EXTRACT(IVMCDT,1,3)-1_"0000"
+14 ;then call was successful
IF $$LOG^IVMPLOG(DFN,YEAR,.EVENTS)
End DoDot:1
+15 QUIT
DCD(DFN,IVMCDT) ;
+1 ; - Determine if patient meets Data Collection Division (DCD) selection
+2 ; criteria and should be transmitted to the HEC.
+3 ; ===================================================================
+4 ; Veteran meets DCD section criteria if:
+5 ; 1. MT category based on IVMCDT is Cat A or Cat C
+6 ; or GMT (added by IVM*2*62)
+7 ;
+8 ; OR, 2. Completed an Rx-Copay Test based on IVMCDT
+9 ;
+10 ; OR, 3. Primary Eligiblility is NSC and veteran is
+11 ; eligible for Medicaid based on IVMCDT
+12 ;
+13 ; OR, 3. Primary Eligiblility is (NOT) one of the following:
+14 ; 1. NSC, VA PENSION
+15 ; 2. SC 50% TO 100%
+16 ; 3. AID & ATTENDANCE
+17 ; 4. HOUSE BOUND
+18 ;
+19 ; AND,
+20 ; a. Had any Income Screening based on IVMCDT
+21 ; OR, b. Submitted a claim for BT based on IVMCDT
+22 ; ====================================================================
+23 ;
+24 ; Input: DFN - as IEN of Patient (#2) file
+25 ; IVMCDT - as Date/Time (Optional - default is today@2359)
+26 ;
+27 ; Output: 1 --> if pt meets DCD selection criteria and
+28 ; should be sent to IVM Center
+29 ; 0 --> if pt does not meet DCD selection criteria and
+30 ; should not be sent to IVM Center
+31 ;
+32 NEW IVMCBTCL,IVMCPEL,IVMCFLAG,IVMCIYR,IVMCTEST,VA,VAERR,VAEL
+33 ;
+34 SET DFN=$GET(DFN)
IF '$DATA(^DPT(+DFN,0))
GOTO DCDQ
+35 SET IVMCDT=$SELECT($GET(IVMCDT):IVMCDT,1:DT)
if '$PIECE(IVMCDT,".",2)
SET IVMCDT=IVMCDT_.2359
+36 ;
+37 ; - exclude non-vets
+38 IF $GET(^DPT(DFN,"VET"))="N"
GOTO DCDQ
+39 ;
+40 ; - determine income year
+41 SET IVMCIYR=$$LYR^DGMTSCU1(IVMCDT)
+42 ;
+43 ; - flag indicating pt meets DCD selection criteria, transmit
+44 SET IVMCFLAG=1
+45 ;
MT ; - get last Means Test or Rx Copay Test for patient
+1 SET IVMCTEST=$$LST^DGMTCOU1(DFN,IVMCDT,3)
+2 IF $EXTRACT($PIECE(IVMCTEST,"^",2),1,3)'=$EXTRACT(IVMCDT,1,3)
GOTO PRIM
+3 ;
+4 ; - if pt MT category is A or C based on date of test, transmit
+5 ; add check for GMT status (IVM*2*62)
+6 IF IVMCTEST
IF ($PIECE(IVMCTEST,"^",5)=1)
IF "^A^C^G^"[("^"_$PIECE(IVMCTEST,"^",4)_"^")
GOTO DCDQ
+7 ;
+8 ; - if completed Rx Copay Test based on date of test, transmit
+9 IF IVMCTEST
IF ($PIECE(IVMCTEST,"^",5)=2)
IF ($PIECE(IVMCTEST,"^",4)="M"!($PIECE(IVMCTEST,"^",4)="E"))
GOTO DCDQ
+10 ;
PRIM ; - get pt Primary Eligibility
+1 DO ELIG^VADPT
SET IVMCPEL=$PIECE($GET(^DIC(8,+VAEL(1),0)),"^",9)
+2 ;
+3 ; - if Primary Elig code is NSC and eligible for Medicaid
+4 ; based on (Date Last Asked?) field, transmit
+5 IF IVMCPEL=5
IF +$GET(^DPT(DFN,.38))
IF ($PIECE($GET(^(.38)),"^",2)>($EXTRACT(DT,1,3)-2_1231.999999))
GOTO DCDQ
+6 ;
+7 ; - if pt Primary Eligibility code is on DCD exclusion list,
+8 ; do not transmit
+9 IF "^1^2^4^15^"[("^"_IVMCPEL_"^")
SET IVMCFLAG=0
GOTO DCDQ
+10 ;
+11 ; - If pt has any Income Screening (reported income), transmit
+12 IF $$IS(DFN,IVMCIYR)
GOTO DCDQ
+13 ;
+14 ; - if submitted Beneficiary Travel claim
+15 SET IVMCBTCL=$ORDER(^DGBT(392,"C",DFN,$EXTRACT(IVMCDT,1,3)_"0000"))
+16 ;
+17 ; - check if claim in date range
+18 if IVMCBTCL
GOTO DCDQ
+19 ;
+20 ; - otherwise, set flag indicating pt should not be transmitted
+21 SET IVMCFLAG=0
+22 ;
DCDQ QUIT $GET(IVMCFLAG)
+1 ;
+2 ;
IS(DFN,IVMCIYR) ; Has the veteran had Income Screening this year?
+1 ; Input: DFN -- Pointer to the patient in file #2
+2 ; IVMCIYR -- Income year in question
+3 ; Output: Has the vet had income screening? 0 => No | 1 => Yes
+4 ;
+5 NEW IVMCIS,IVMCPR,IVMCIAI
SET IVMCIS=0
+6 IF '$GET(DFN)
GOTO ISQ
+7 ;
+8 ; - get IEN of Patient Relation (#408.12) file, look at pts dependents
+9 FOR IVMCPR=0:0
SET IVMCPR=$ORDER(^DGPR(408.12,"B",DFN,IVMCPR))
if 'IVMCPR
QUIT
Begin DoDot:1
+10 ;
+11 ; - get IEN of Individual Annual Income (#408.21) file
+12 ; get dependents annual income record effective on input date
+13 SET IVMCIAI=$ORDER(^DGMT(408.21,"AI",+IVMCPR,-IVMCIYR,0))
+14 ;
+15 ; - check for reported income
+16 IF IVMCIAI
SET IVMCIS=IVMCIS+$SELECT($PIECE($GET(^DGMT(408.21,+IVMCIAI,0)),U,8,17)'?."^":1,1:0)
End DoDot:1
+17 ;
ISQ QUIT IVMCIS>0