Home   Package List   Routine Alphabetical List   Global Alphabetical List   FileMan Files List   FileMan Sub-Files List   Package Component Lists   Package-Namespace Mapping  
Routine: IVMCUC

IVMCUC.m

Go to the documentation of this file.
  1. 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
  1. ;
  1. ;
  1. BT(IEN) ;
  1. ;Description: logs DCD defined Beneficiary Travel event if DCD criteria are met.
  1. ;
  1. N DFN
  1. Q:'$G(IEN)
  1. S DFN=$P($G(^DGBT(392.2,IEN,0)),"^",2)
  1. D:DFN LOGDCD(DFN)
  1. Q
  1. LOGDCD(DFN,IVMCDT) ;
  1. ;Description: logs DCD defined events for nightly transmission if DCD criteria are met.
  1. ;
  1. ;Input:
  1. ; DFN - ien of record in the PATIENT file
  1. ; IVMCDT - optional parameter, is the date/time to check, uses DT if not passed in
  1. ;
  1. ;
  1. S:'$G(IVMCDT) IVMCDT=DT
  1. ;if patient meets DCD criteria, want to log patient for transmission
  1. I $$DCD(DFN,IVMCDT) D
  1. .N EVENTS,YEAR
  1. .S EVENTS("DCD")=1
  1. .S YEAR=$E(IVMCDT,1,3)-1_"0000"
  1. .I $$LOG^IVMPLOG(DFN,YEAR,.EVENTS) ;then call was successful
  1. Q
  1. DCD(DFN,IVMCDT) ;
  1. ; - Determine if patient meets Data Collection Division (DCD) selection
  1. ; criteria and should be transmitted to the HEC.
  1. ; ===================================================================
  1. ; Veteran meets DCD section criteria if:
  1. ; 1. MT category based on IVMCDT is Cat A or Cat C
  1. ; or GMT (added by IVM*2*62)
  1. ;
  1. ; OR, 2. Completed an Rx-Copay Test based on IVMCDT
  1. ;
  1. ; OR, 3. Primary Eligiblility is NSC and veteran is
  1. ; eligible for Medicaid based on IVMCDT
  1. ;
  1. ; OR, 3. Primary Eligiblility is (NOT) one of the following:
  1. ; 1. NSC, VA PENSION
  1. ; 2. SC 50% TO 100%
  1. ; 3. AID & ATTENDANCE
  1. ; 4. HOUSE BOUND
  1. ;
  1. ; AND,
  1. ; a. Had any Income Screening based on IVMCDT
  1. ; OR, b. Submitted a claim for BT based on IVMCDT
  1. ; ====================================================================
  1. ;
  1. ; Input: DFN - as IEN of Patient (#2) file
  1. ; IVMCDT - as Date/Time (Optional - default is today@2359)
  1. ;
  1. ; Output: 1 --> if pt meets DCD selection criteria and
  1. ; should be sent to IVM Center
  1. ; 0 --> if pt does not meet DCD selection criteria and
  1. ; should not be sent to IVM Center
  1. ;
  1. N IVMCBTCL,IVMCPEL,IVMCFLAG,IVMCIYR,IVMCTEST,VA,VAERR,VAEL
  1. ;
  1. S DFN=$G(DFN) I '$D(^DPT(+DFN,0)) G DCDQ
  1. S IVMCDT=$S($G(IVMCDT):IVMCDT,1:DT) S:'$P(IVMCDT,".",2) IVMCDT=IVMCDT_.2359
  1. ;
  1. ; - exclude non-vets
  1. I $G(^DPT(DFN,"VET"))="N" G DCDQ
  1. ;
  1. ; - determine income year
  1. S IVMCIYR=$$LYR^DGMTSCU1(IVMCDT)
  1. ;
  1. ; - flag indicating pt meets DCD selection criteria, transmit
  1. S IVMCFLAG=1
  1. ;
  1. MT ; - get last Means Test or Rx Copay Test for patient
  1. S IVMCTEST=$$LST^DGMTCOU1(DFN,IVMCDT,3)
  1. I $E($P(IVMCTEST,"^",2),1,3)'=$E(IVMCDT,1,3) G PRIM
  1. ;
  1. ; - if pt MT category is A or C based on date of test, transmit
  1. ; add check for GMT status (IVM*2*62)
  1. I IVMCTEST,($P(IVMCTEST,"^",5)=1),"^A^C^G^"[("^"_$P(IVMCTEST,"^",4)_"^") G DCDQ
  1. ;
  1. ; - if completed Rx Copay Test based on date of test, transmit
  1. I IVMCTEST,($P(IVMCTEST,"^",5)=2),($P(IVMCTEST,"^",4)="M"!($P(IVMCTEST,"^",4)="E")) G DCDQ
  1. ;
  1. PRIM ; - get pt Primary Eligibility
  1. D ELIG^VADPT S IVMCPEL=$P($G(^DIC(8,+VAEL(1),0)),"^",9)
  1. ;
  1. ; - if Primary Elig code is NSC and eligible for Medicaid
  1. ; based on (Date Last Asked?) field, transmit
  1. I IVMCPEL=5,+$G(^DPT(DFN,.38)),($P($G(^(.38)),"^",2)>($E(DT,1,3)-2_1231.999999)) G DCDQ
  1. ;
  1. ; - if pt Primary Eligibility code is on DCD exclusion list,
  1. ; do not transmit
  1. I "^1^2^4^15^"[("^"_IVMCPEL_"^") S IVMCFLAG=0 G DCDQ
  1. ;
  1. ; - If pt has any Income Screening (reported income), transmit
  1. I $$IS(DFN,IVMCIYR) G DCDQ
  1. ;
  1. ; - if submitted Beneficiary Travel claim
  1. S IVMCBTCL=$O(^DGBT(392,"C",DFN,$E(IVMCDT,1,3)_"0000"))
  1. ;
  1. ; - check if claim in date range
  1. G:IVMCBTCL DCDQ
  1. ;
  1. ; - otherwise, set flag indicating pt should not be transmitted
  1. S IVMCFLAG=0
  1. ;
  1. DCDQ Q $G(IVMCFLAG)
  1. ;
  1. ;
  1. IS(DFN,IVMCIYR) ; Has the veteran had Income Screening this year?
  1. ; Input: DFN -- Pointer to the patient in file #2
  1. ; IVMCIYR -- Income year in question
  1. ; Output: Has the vet had income screening? 0 => No | 1 => Yes
  1. ;
  1. N IVMCIS,IVMCPR,IVMCIAI S IVMCIS=0
  1. I '$G(DFN) G ISQ
  1. ;
  1. ; - get IEN of Patient Relation (#408.12) file, look at pts dependents
  1. F IVMCPR=0:0 S IVMCPR=$O(^DGPR(408.12,"B",DFN,IVMCPR)) Q:'IVMCPR D
  1. .;
  1. .; - get IEN of Individual Annual Income (#408.21) file
  1. .; get dependents annual income record effective on input date
  1. .S IVMCIAI=$O(^DGMT(408.21,"AI",+IVMCPR,-IVMCIYR,0))
  1. .;
  1. .; - check for reported income
  1. .I IVMCIAI S IVMCIS=IVMCIS+$S($P($G(^DGMT(408.21,+IVMCIAI,0)),U,8,17)'?."^":1,1:0)
  1. ;
  1. ISQ Q IVMCIS>0