- IBCBB14 ;ALB/WCJ - CONTINUATION OF EDIT CHECK ROUTINE FOR EPHARM ;15 Mar 2018 9:50 PM
- ;;2.0;INTEGRATED BILLING;**591,592,624**;21-MAR-94;Build 10
- ;;Per VA Directive 6402, this routine should not be modified.
- ;
- Q
- VALNDC(IBIFN,IBDFN) ; IB*2*363 - validate NDC# between PRESCRIPTION file (#52)
- ; and IB BILL/CLAIMS PRESCRIPTION REFILL file (#362.4)
- ; input - IBIFN = internal entry number of the billing record in the BILL/CLAIMS file (#399)
- ; IBDFN = internal entry number of patient record in the PATIENT file (#2)
- N IBX,IBRXCOL
- ; call program that determines if NDC differences exist
- D VALNDC^IBEFUNC3(IBIFN,IBDFN,.IBRXCOL)
- Q:'$D(IBRXCOL)
- ; at least one RX on the IB record has an NDC discrepancy
- S IBX=0 F S IBX=$O(IBRXCOL(IBX)) Q:'IBX D WARN^IBCBB11("NDC# on Bill does not equal the NDC# on Rx "_IBRXCOL(IBX))
- Q
- ;
- RXNPI(IBIFN) ; check for multiple pharmacy npi's on the same bill
- N IBORG,IBRXNPI,IBX,IBY
- S IBORG=$$RXSITE^IBCEF73A(IBIFN,.IBORG)
- S IBX=0 F S IBX=$O(IBORG(IBX)) Q:'IBX S IBY=0 F S IBY=$O(IBORG(IBX,IBY)) Q:'IBY S IBRXNPI(+IBORG(IBX,IBY))=""
- S (IBX,IBY)=0 F S IBX=$O(IBRXNPI(IBX)) Q:'IBX S IBY=IBY+1
- I IBY>1 D WARN^IBCBB11("Bill has prescriptions resulting from "_IBY_" different NPI locations")
- Q
- ;
- ROICHK(IBIFN,IBDFN,IBINS) ; ROI Check
- ; Verify that an ROI is on file if the drug is flagged as sensitive.
- ; No ROI is required if the Date of Service is on or after the
- ; Mission Act Implementation Date (1/28/2019).
- ; input - IBIFN = IEN of the Bill/Claims file (#399)
- ; IBDFN = IEN of the patient
- ; IBINS = IEN of the payer insurance company (#36)
- ; OUTPUT - 0 = no error
- ; 1 = a prescription is sensitive and there is no ROI on file
- ;
- N IBX,IBY0,IBRXIEN,IBDT,IBDRUG,ROIQ
- S ROIQ=0
- S IBX=0 F S IBX=$O(^IBA(362.4,"C",IBIFN,IBX)) Q:'IBX D
- .S IBY0=^IBA(362.4,IBX,0),IBRXIEN=$P(IBY0,U,5) I 'IBRXIEN Q
- .S IBDT=$P(IBY0,U,3),IBDRUG=$P(IBY0,U,4)
- .D ZERO^IBRXUTL(IBDRUG)
- .I $$SENS^IBNCPDR(IBDRUG) D ; Sensitive Diagnosis Drug - check for ROI
- .. ; Skip ROI check if the DOS is on or after the Mission Act date.
- .. I $$MACHK^IBNCPDR4(IBDT) Q
- .. I $$ROI^IBNCPDR4(IBDFN,IBDRUG,IBINS,IBDT) Q ;ROI is on file
- .. D WARN^IBCBB11("ROI not on file for prescription "_$$RXAPI1^IBNCPUT1(IBRXIEN,.01,"E"))
- .. S ROIQ=1
- ROICHKQ ;
- K ^TMP($J,"IBDRUG")
- Q ROIQ
- ;
- --- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HIBCBB14 2402 printed Mar 13, 2025@21:13:39 Page 2
- IBCBB14 ;ALB/WCJ - CONTINUATION OF EDIT CHECK ROUTINE FOR EPHARM ;15 Mar 2018 9:50 PM
- +1 ;;2.0;INTEGRATED BILLING;**591,592,624**;21-MAR-94;Build 10
- +2 ;;Per VA Directive 6402, this routine should not be modified.
- +3 ;
- +4 QUIT
- VALNDC(IBIFN,IBDFN) ; IB*2*363 - validate NDC# between PRESCRIPTION file (#52)
- +1 ; and IB BILL/CLAIMS PRESCRIPTION REFILL file (#362.4)
- +2 ; input - IBIFN = internal entry number of the billing record in the BILL/CLAIMS file (#399)
- +3 ; IBDFN = internal entry number of patient record in the PATIENT file (#2)
- +4 NEW IBX,IBRXCOL
- +5 ; call program that determines if NDC differences exist
- +6 DO VALNDC^IBEFUNC3(IBIFN,IBDFN,.IBRXCOL)
- +7 if '$DATA(IBRXCOL)
- QUIT
- +8 ; at least one RX on the IB record has an NDC discrepancy
- +9 SET IBX=0
- FOR
- SET IBX=$ORDER(IBRXCOL(IBX))
- if 'IBX
- QUIT
- DO WARN^IBCBB11("NDC# on Bill does not equal the NDC# on Rx "_IBRXCOL(IBX))
- +10 QUIT
- +11 ;
- RXNPI(IBIFN) ; check for multiple pharmacy npi's on the same bill
- +1 NEW IBORG,IBRXNPI,IBX,IBY
- +2 SET IBORG=$$RXSITE^IBCEF73A(IBIFN,.IBORG)
- +3 SET IBX=0
- FOR
- SET IBX=$ORDER(IBORG(IBX))
- if 'IBX
- QUIT
- SET IBY=0
- FOR
- SET IBY=$ORDER(IBORG(IBX,IBY))
- if 'IBY
- QUIT
- SET IBRXNPI(+IBORG(IBX,IBY))=""
- +4 SET (IBX,IBY)=0
- FOR
- SET IBX=$ORDER(IBRXNPI(IBX))
- if 'IBX
- QUIT
- SET IBY=IBY+1
- +5 IF IBY>1
- DO WARN^IBCBB11("Bill has prescriptions resulting from "_IBY_" different NPI locations")
- +6 QUIT
- +7 ;
- ROICHK(IBIFN,IBDFN,IBINS) ; ROI Check
- +1 ; Verify that an ROI is on file if the drug is flagged as sensitive.
- +2 ; No ROI is required if the Date of Service is on or after the
- +3 ; Mission Act Implementation Date (1/28/2019).
- +4 ; input - IBIFN = IEN of the Bill/Claims file (#399)
- +5 ; IBDFN = IEN of the patient
- +6 ; IBINS = IEN of the payer insurance company (#36)
- +7 ; OUTPUT - 0 = no error
- +8 ; 1 = a prescription is sensitive and there is no ROI on file
- +9 ;
- +10 NEW IBX,IBY0,IBRXIEN,IBDT,IBDRUG,ROIQ
- +11 SET ROIQ=0
- +12 SET IBX=0
- FOR
- SET IBX=$ORDER(^IBA(362.4,"C",IBIFN,IBX))
- if 'IBX
- QUIT
- Begin DoDot:1
- +13 SET IBY0=^IBA(362.4,IBX,0)
- SET IBRXIEN=$PIECE(IBY0,U,5)
- IF 'IBRXIEN
- QUIT
- +14 SET IBDT=$PIECE(IBY0,U,3)
- SET IBDRUG=$PIECE(IBY0,U,4)
- +15 DO ZERO^IBRXUTL(IBDRUG)
- +16 ; Sensitive Diagnosis Drug - check for ROI
- IF $$SENS^IBNCPDR(IBDRUG)
- Begin DoDot:2
- +17 ; Skip ROI check if the DOS is on or after the Mission Act date.
- +18 IF $$MACHK^IBNCPDR4(IBDT)
- QUIT
- +19 ;ROI is on file
- IF $$ROI^IBNCPDR4(IBDFN,IBDRUG,IBINS,IBDT)
- QUIT
- +20 DO WARN^IBCBB11("ROI not on file for prescription "_$$RXAPI1^IBNCPUT1(IBRXIEN,.01,"E"))
- +21 SET ROIQ=1
- End DoDot:2
- End DoDot:1
- ROICHKQ ;
- +1 KILL ^TMP($JOB,"IBDRUG")
- +2 QUIT ROIQ
- +3 ;