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

IBAUTL8A.m

Go to the documentation of this file.
  1. IBAUTL8A ;ALB/MGD - DUPLICATE COPAY TRANSACTION UTILITIES CONT.; Sep 30, 2020@15:16:44
  1. ;;2.0;INTEGRATED BILLING;**630**;21-MAR-94;Build 39
  1. ;;Per VA Directive 6402, this routine should not be modified.
  1. ;
  1. ; ****************************************************************************
  1. ; This routine is designed to implement a series of final checks immediately *
  1. ; prior to IB releasing a charge over to Accounts Receivable (AR). *
  1. ; IBAUTL9 handles the storing of associated information related to any *
  1. ; duplicate copays found by IBAUTL8. *
  1. ; These updates are part being released in IB*2.0*630. *
  1. ; ****************************************************************************
  1. ;
  1. IPDNEW(IBN,IBEVDT,IBACTION,IBINTACT) ;
  1. ; Perform checks for a new Inpatient Per Diem charge to determine if this charge should be passed over to AR.
  1. ; Input: IBN = Pointer to Inpatient Per Diem charge currently being reviewed in the INTEGRATED BILLING ACTION (#350) file
  1. ; IBEVDT = Event Date for the charge currently being reviewed in the INTEGRATED BILLING ACTION (#350) file
  1. ; IBACTION = Passed by reference. Passed in as 0:Pass to AR
  1. ; IBINTACT = Optional - Flag to indicate when the call is being made from an interactive option.
  1. ; 1:Interactive
  1. ; 0:Non-Interactive
  1. ; For more info see COPAYCHK above
  1. ;
  1. ; Output: IBACTION = 0 if the current charge being reviewed should be passed over to AR
  1. ; # The IEN of the existing Copay charge for the Patient/Date of interest.
  1. ; The charge being reviewed should NOT be passed over to AR.
  1. ;
  1. ; Verify incoming value of IBACTION and default to 0 if not defined
  1. S IBACTION=$S(IBACTION'="":IBACTION,1:0)
  1. ; Quit if necessary data was not passed in
  1. I +IBN<=0!(+IBEVDT'?7N) Q IBACTION
  1. ; If IBINTACT was not passed in, default it to 0:Non-Interactive
  1. S IBINTACT=$S(IBINTACT'="":IBINTACT,1:0)
  1. N IBBFI,IBBFO,IBBFOB,IBLTC,IBBPD,IBDFN,IBRSN,IBCTOT,IBETOT,IBAT1,IBAT2
  1. ; Load Patient IEN from IBN passed in
  1. S IBDFN=+$P($G(^IB(IBN,0)),U,2)
  1. ; Quit if no IEN in record
  1. I IBDFN<1 Q IBACTION
  1. ; Determine if the Patient has already been charged an Inpatient Copay for the Event Date
  1. S IBBFI=$$BFI^IBAUTL8C(IBDFN,IBEVDT,IBN)
  1. ; Take actions based on there being an existing Inpatient Copay
  1. I IBBFI D Q:IBACTION
  1. . ; Set IBACTION = IEN of existing Inpatient Copay
  1. . S IBACTION=IBBFI
  1. . ; Check for legal pairings
  1. . ; Load Action Types of the two charges
  1. . S IBAT1=$P($G(^IB(IBN,0)),U,3),IBAT2=$P($G(^IB(IBBFI,0)),U,3)
  1. . ; If 2 copays for a single day are a legal pairing, set IBACTION =0
  1. . ; If the Action Type is CC INPATIENT (133) and the Per Diem is CC PER DIEM (#130)
  1. . I IBAT1=133,IBAT2=130 S IBACTION=0
  1. . ; If the Action Type is one of the copays in Billing Group #2 and the Per Diem
  1. . ; copay is INPATIENT PER DIEM (#45) set IBACTION =0
  1. . I IBAT1=45,("^16^17^18^19^20^21^22^23^"[("^"_IBAT2_"^")) S IBACTION=0
  1. . ; If the Action Type is NHCU COPAY (#24) and the Per Diem is NHCU PER DIEM (#48) set IBACTION =0
  1. . I IBAT1=48,IBAT2=24 S IBACTION=0
  1. . ; Quit if interactive
  1. . Q:IBINTACT
  1. . ; Record related info into ^XTMP for MailMan message
  1. . S IBRSN="AN INPATIENT COPAY CHARGE BILLED AT HIGHER PRECEDENCE"
  1. . D STORE1^IBAUTL9(IBN,IBBFI,IBRSN)
  1. ;
  1. ; Determine if the Patient has already been charged an Inpatient Per Diem charge for the Event Date
  1. S IBBPD=$$BFPD^IBAUTL8A(IBDFN,IBEVDT,IBN)
  1. ; If the Patient has already been charged an Inpatient Per Diem charge for the Event Date
  1. I IBBPD D Q
  1. . ; Set return value to NOT pass the charge over to AR
  1. . S IBACTION=IBBPD
  1. . ; Quit if interactive
  1. . Q:IBINTACT
  1. . ; Load dollar amounts from the 2 charges
  1. . S IBCTOT=+$P($G(^IB(IBN,0)),U,7),IBETOT=+$P($G(^IB(+IBBPD,0)),U,7)
  1. . ; If the current charge being processed is <= to the existing Inpatient Per Diem charge
  1. . I IBCTOT<=IBETOT D Q
  1. . . ; Cancel current charge with CANCELLATION REASON = 4 - ENTERED IN ERROR
  1. . . ; ### Uncomment for Phase 2 D CNCLCHRG^IBAUTL8A(IBN,4)
  1. . . ; Record related info into ^XTMP for MailMan message
  1. . . S IBRSN="EXISTING INPATIENT PER DIEM CHARGE AT SAME OR HIGHER TIER RATE"
  1. . . D STORE1^IBAUTL9(IBN,IBBPD,IBRSN)
  1. . . Q
  1. . ; If the current charge being processed is > than the existing Inpatient Per Diem charge
  1. . I IBCTOT>IBETOT D Q
  1. . . ; IBND has to be set to 0 node for call to CANC^IBECEAU4
  1. . . ; ### N IBND S IBND=$G(^IB(IBN,0))
  1. . . ; IBFAC and IBSITE needed by Cancel operation below
  1. . . ; ### N IBFAC,IBSITE
  1. . . ; Calculate site from site parameters
  1. . . ; ### D SITE^IBAUTL
  1. . . ; Cancel existing charge with Reason = 42 - BILLED AT HIGHER TIER RATE
  1. . . ; UNCOMMENT THIS AND TEST MORE ON WHAT HAPPENS IN THE CANCELLATION PROCESS
  1. . . ; ### I 'IBINTACT D CANC^IBECEAU4(IBBPD,42,1)
  1. . . ; Record related info into ^XTMP for MailMan message
  1. . . S IBRSN="ANOTHER INPATIENT PER DIEM CHARGE BILLED AT HIGHER TIER RATE"
  1. . . D STORE2^IBAUTL9(IBN,IBBPD,IBRSN)
  1. . . Q
  1. . Q
  1. ;
  1. ; Determine if the Patient has an Outpatient Observation Copay for the Event Date
  1. S IBBFOB=$$BFOB^IBAUTL8A(IBDFN,IBEVDT,IBN)
  1. ; if there is an existing Outpatient Observation Copay, Do the following
  1. I +IBBFOB D Q
  1. . ; Set IBACTION = IEN of Outpatient Observation Copay
  1. . S IBACTION=IBBFOB
  1. . ; Quit if interactive
  1. . Q:IBINTACT
  1. . ; ###Uncomment for Phase 2
  1. . ; IBND has to be set to 0 node for call to CANC^IBECEAU4
  1. . ; ### N IBND S IBND=$G(^IB(IBN,0))
  1. . ; IBFAC and IBSITE needed by Cancel operation below
  1. . ; ### N IBFAC,IBSITE
  1. . ; Calculate site from site parameters
  1. . ; ### D SITE^IBAUTL
  1. . ; Cancel the existing Outpatient Observation Copay charge with
  1. . ; CANCELLATION REASON = 42 - BILLED AT HIGHER TIER RATE
  1. . ; ### I 'IBINTACT D CANC^IBECEAU4(IBBFI,42,1)
  1. . ; Record related info into ^XTMP for MailMan message
  1. . S IBRSN="AN INPATIENT PER DIEM CHARGE BILLED AT HIGHER PRECEDENCE"
  1. . D STORE2^IBAUTL9(IBN,IBBFOB,IBRSN)
  1. . Q
  1. ;
  1. ; Determine if the Patient has an Outpatient Copay for the Event Date
  1. S IBBFO=$$BFO^IBAUTL8A(IBDFN,IBEVDT,IBN)
  1. ; If the Patient has already been charged an Outpatient Copay for the Event Date, set IBACTION and quit
  1. I IBBFO D Q
  1. . ; Set IBACTION = IEN of Outpatient Copay
  1. . S IBACTION=IBBFO
  1. . ; Quit if interactive
  1. . Q:IBINTACT
  1. . ; ###Uncomment for Phase 2
  1. . ; IBND has to be set to 0 node for call to CANC^IBECEAU4
  1. . ; ### N IBND S IBND=$G(^IB(IBN,0))
  1. . ; IBFAC and IBSITE needed by Cancel operation below
  1. . ; ### N IBFAC,IBSITE
  1. . ; Calculate site from site parameters
  1. . ; ### D SITE^IBAUTL
  1. . ; Cancel the existing Outpatient Observation Copay charge with
  1. . ; CANCELLATION REASON = 42 - BILLED AT HIGHER TIER RATE
  1. . ; ### I 'IBINTACT D CANC^IBECEAU4(IBBFI,42,1)
  1. . ; Record related info into ^XTMP for MailMan message
  1. . S IBRSN="AN INPATIENT PER DIEM CHARGE BILLED AT HIGHER PRECEDENCE"
  1. . D STORE2^IBAUTL9(IBN,IBBFO,IBRSN)
  1. . Q
  1. ;
  1. ; Determine if the Patient has an Long Term Care Copay for the Event Date
  1. S IBLTC=$$LTC^IBAUTL8B(IBDFN,IBEVDT,IBN)
  1. ; If the patient has been charged a Long Term Care Copay for the Event Date, set IBACTION and quit
  1. I IBLTC D Q
  1. . ; Set IBACTION = IEN of Outpatient Copay
  1. . S IBACTION=IBLTC
  1. . ; Quit if interactive
  1. . Q:IBINTACT
  1. . ; ###Uncomment for Phase 2
  1. . ; IBND has to be set to 0 node for call to CANC^IBECEAU4
  1. . ; ### N IBND S IBND=$G(^IB(IBN,0))
  1. . ; IBFAC and IBSITE needed by Cancel operation below
  1. . ; ### N IBFAC,IBSITE
  1. . ; Calculate site from site parameters
  1. . ; ### D SITE^IBAUTL
  1. . ; Cancel the existing Outpatient Observation Copay charge with
  1. . ; CANCELLATION REASON = 42 - BILLED AT HIGHER TIER RATE
  1. . ; ### I 'IBINTACT D CANC^IBECEAU4(IBBFI,42,1)
  1. . ; Record related info into ^XTMP for MailMan message
  1. . S IBRSN="AN INPATIENT PER DIEM CHARGE BILLED AT HIGHER PRECEDENCE"
  1. . D STORE2^IBAUTL9(IBN,IBLTC,IBRSN)
  1. Q
  1. ;
  1. BFO(DFN,IBDATE,IBNEW) ; Patient Billed For Outpatient Copay on a specified date?
  1. ; Input: DFN - Pointer to the patient in file #2
  1. ; IBDATE - Date of the Inpatient Visit
  1. ; IBNEW - IEN of new charge in File #350
  1. ; Output: 0 - Not billed the OPT copay on the visit date
  1. ; >0 - Pointer to charge in file #350 that was billed
  1. ;
  1. ; Outpatient Copays charges will be in Billing Group 4 and have Action Types:
  1. ; Action Types = 51 - DG OPT COPAY NEW 136 - CC (OPT) NEW
  1. ; 203 - CC URGENT CARE (OPT) NEW
  1. ;
  1. N IBAMT,IBATYP,IBATYPN,IBCHRG,IBDATA0,IBN,IBSTOPDT
  1. S (IBATYP,IBATYPN)="",IBAMT=0
  1. ; Initialize the return variable to 0 - Not billed the Outpatient copay on the visit date
  1. S IBCHRG=0
  1. I '$G(DFN)!('$G(IBDATE)) Q +$G(IBCHRG)
  1. ; Set stop date for loop
  1. S IBSTOPDT=$P(IBDATE,".",1)
  1. ; Strip off time portion of DATA and reset IBDATE for looping by subtracting .000001
  1. S IBDATE=$P(IBDATE,".",1)-.000001
  1. ; Loop through Date/Time entries (earliest to latest) for the single date being checked
  1. F S IBDATE=$O(^IB("ACHDT",DFN,IBDATE)) Q:'IBDATE!($P(IBDATE,".",1)>IBSTOPDT) D
  1. . ; Loop through the individual charges
  1. . S IBN=0
  1. . F S IBN=$O(^IB("ACHDT",DFN,IBDATE,IBN)) Q:'IBN D
  1. . . ; Quit if entry found in ACHDT is the entry we are currently processing
  1. . . Q:IBN=IBNEW
  1. . . ; Load 0 node in File #350 for this record
  1. . . S IBDATA0=$G(^IB(IBN,0))
  1. . . ; Quit if ACTION TYPE is not an Outpatient Copay
  1. . . Q:"^51^136^203^"'[("^"_$P(IBDATA0,U,3)_"^")
  1. . . ; using the ACTION TYPE (#.03) field of the INTEGRATED BILLING ACTION file (#350) set IBATYP = 0 Node of the IB ACTION TYPE file (#350.1)
  1. . . S IBATYP=$G(^IBE(350.1,+$P(IBDATA0,"^",3),0))
  1. . . ; Using IBATYP set IBATYPN = NEW ACTION TYPE (#.09)
  1. . . S IBATYPN=$G(^IBE(350.1,+$P(IBATYP,"^",9),0))
  1. . . ; Quit if any of the key data for the checks is missing
  1. . . I IBDATA0=""!(IBATYP="")!(IBATYPN="") Q
  1. . . ; Check if the BILLING GROUP field (#.11) and the ACTION TYPE (#.03) matches to the
  1. . . ; specific combinations provided by the SMEs.
  1. . . ; Check for Billing Group = 4:OPT COPAY & charge type = an OPT COPAY (51^136^203)
  1. . . I $P(IBATYPN,"^",11)=4,("^51^136^203^"[("^"_$P(IBDATA0,U,3)_"^")) D
  1. . . . ; IF 1:NEW or 3:UPDATE is contained in the SEQUENCE NUMBER field (#.05) in the IB ACTION TYPE file (#350.1)
  1. . . . ; AND the STATUS field (#.05) in the INTEGRATED BILLING ACTION file (#350) is one of the following:
  1. . . . ; 1:INCOMPLETE, 2:COMPLETE, 3:BILLED, 4:UPDATED, 8:ON HOLD, 20:HOLD - RATE
  1. . . . ; THEN set IBCHRG = IEN of the duplicate Outpatient Copay
  1. . . . I "^1^3^"[("^"_$P(IBATYP,"^",5)_"^"),"^1^2^3^4^8^20^"[("^"_+$P(IBDATA0,"^",5)_"^") D
  1. . . . . ; Compare the TOTAL CHARGE of this Outpatient Copay charge to any previously identified
  1. . . . . ; Outpatient Copay for the same date and save the IEN of the highest charge
  1. . . . . I +$P(IBDATA0,U,7)>IBAMT S IBAMT=+$P(IBDATA0,U,7),IBCHRG=IBN
  1. . . . . Q
  1. . . . Q
  1. . . Q
  1. . Q
  1. Q +$G(IBCHRG)
  1. ;
  1. BFOB(DFN,IBDATE,IBNEW) ; Patient Billed For Outpatient Observation Copay on a specified date?
  1. ; Input: DFN - Pointer to the patient in file #2
  1. ; IBDATE - Date of the Outpatient Visit
  1. ; IBNEW - IEN of new charge in File #350
  1. ; Output: 0 - Not billed the OPT copay on the visit date
  1. ; >0 - Pointer to charge in file #350 that was billed
  1. ;
  1. ; Outpatient Observation Copays charges will have the following Billing Group & Action Types:
  1. ; Billing Group = 4 - OPT COPAY
  1. ; 74 - DG OBSERVATION COPAY NEW
  1. ;
  1. N IBAMT,IBATYP,IBATYPN,IBCHRG,IBDATA0,IBN,Y,IBSTOPDT
  1. S (IBATYP,IBATYPN)="",IBAMT=0
  1. ; Initialize the return variable to 0 - Not billed the Outpatient Observation Copay on the visit date
  1. S IBCHRG=0
  1. I '$G(DFN)!'$G(IBDATE) Q +$G(IBCHRG)
  1. ; Set stop date for loop
  1. S IBSTOPDT=$P(IBDATE,".",1)
  1. ; Strip off time portion of DATA and reset IBDATE for looping by subtracting .000001
  1. S IBDATE=$P(IBDATE,".",1)-.000001
  1. ; Loop through Date/Time entries (earliest to latest) for the single date being checked
  1. F S IBDATE=$O(^IB("ACHDT",DFN,IBDATE)) Q:'IBDATE!($P(IBDATE,".",1)>IBSTOPDT) D
  1. . ; Loop through the individual charges
  1. . S IBN=0
  1. . F S IBN=$O(^IB("ACHDT",DFN,IBDATE,IBN)) Q:'IBN D
  1. . . ; Quit it entry found in ACHDT is the entry we are currently processing
  1. . . Q:IBN=IBNEW
  1. . . ; Load 0 node in File #350 for this record
  1. . . S IBDATA0=$G(^IB(IBN,0))
  1. . . ; Quit if ACTION TYPE is not an Outpatient Observation Copay
  1. . . Q:$P(IBDATA0,U,3)'=74
  1. . . ; using the ACTION TYPE (#.03) field of the INTEGRATED BILLING ACTION file (#350) set IBATYP = 0 Node of the IB ACTION TYPE file (#350.1)
  1. . . S IBATYP=$G(^IBE(350.1,+$P(IBDATA0,"^",3),0))
  1. . . ; Using IBATYP set IBATYPN = NEW ACTION TYPE (#.09)
  1. . . S IBATYPN=$G(^IBE(350.1,+$P(IBATYP,"^",9),0))
  1. . . ; Quit if any of the key data for the checks is missing
  1. . . I IBDATA0=""!(IBATYP="")!(IBATYPN="") Q
  1. . . ; IF the BILLING GROUP field (#.11) in the IB ACTION TYPE file (#350.1) is OPT COPAY (#4)
  1. . . ; AND the SEQUENCE NUMBER (#.05) in the IB ACTION TYPE file (#350.1) is
  1. . . ; 1:INCOMPLETE OR 3:BILLED
  1. . . ; AND the STATUS field (#.05) in the INTEGRATED BILLING ACTION file (#350) is one of the following:
  1. . . ; 1:INCOMPLETE, 2:COMPLETE, 3:BILLED, 4:UPDATED, 8:ON HOLD, 20:HOLD - RATE
  1. . . ; THEN set IBCHRG = IEN of the Outpatient Observation Copay
  1. . . I $P(IBATYPN,"^",11)=4,"^1^3^"[("^"_$P(IBATYP,"^",5)_"^"),"^1^2^3^4^8^20^"[("^"_+$P(IBDATA0,"^",5)_"^") D
  1. . . . ; Compare the TOTAL CHARGE of this Outpatient Observation Copay charge to any previously identified
  1. . . . ; Outpatient Observation Copay and save the IEN of the highest charge
  1. . . . I +$P(IBDATA0,U,7)>IBAMT S IBAMT=+$P(IBDATA0,U,7),IBCHRG=IBN
  1. . . Q
  1. . Q
  1. Q +$G(IBCHRG)
  1. ;
  1. BFPD(DFN,IBDATE,IBNEW) ; Patient Billed For Per Diem Copay on a specified date?
  1. ; Input: DFN - Pointer to the patient in file #2
  1. ; IBDATE - Date of the Outpatient Visit
  1. ; IBNEW - IEN of charge in File #350
  1. ; Output: 0 - Not billed the OPT copay on the visit date
  1. ; >0 - Pointer to charge in file #350 that was billed
  1. ;
  1. ; Valid Per Diem charges have the following Billing Group & Action Types:
  1. ; Billing Group = 3 - INPT/NHCU PER DIEM
  1. ; 45 DG INPT PER DIEM NEW 48 DG NHCU PER DIEM NEW
  1. ; 133 CC (PER DIEM) NEW
  1. ;
  1. N IBAMT,IBATYP,IBATYPN,IBCHRG,IBDATA0,IBN,IBSTOPDT
  1. S (IBATYP,IBATYPN)="",IBAMT=0
  1. ; Initialize the IBCHRG to 0 - Not billed a Per Diem on the visit date
  1. S IBCHRG=0
  1. I '$G(DFN)!'$G(IBDATE) Q +$G(IBCHRG)
  1. ; Set stop date for loop
  1. S IBSTOPDT=$P(IBDATE,".",1)
  1. ; Strip off time portion of DATA and reset IBDATE for looping by subtracting .000001
  1. S IBDATE=$P(IBDATE,".",1)-.000001
  1. ; Loop through Date/Time entries (earliest to latest) for the single date being checked
  1. F S IBDATE=$O(^IB("ACHDT",DFN,IBDATE)) Q:'IBDATE!($P(IBDATE,".",1)>IBSTOPDT) D
  1. . ; Loop through the individual charges
  1. . S IBN=0
  1. . F S IBN=$O(^IB("ACHDT",DFN,IBDATE,IBN)) Q:'IBN D
  1. . . ; Quit it entry found in ACHDT is the entry we are currently processing
  1. . . Q:IBN=IBNEW
  1. . . ; Load 0 node in File #350 for this record
  1. . . S IBDATA0=$G(^IB(IBN,0))
  1. . . ; Quit if ACTION TYPE is not an Per Diem Copay
  1. . . Q:"^45^48^133^"'[("^"_$P(IBDATA0,U,3)_"^")
  1. . . ; using the ACTION TYPE (#.03) field of the INTEGRATED BILLING ACTION file (#350) set IBATYP = 0 Node of the IB ACTION TYPE file (#350.1)
  1. . . S IBATYP=$G(^IBE(350.1,+$P(IBDATA0,"^",3),0))
  1. . . ; Using IBATYP set IBATYPN = NEW ACTION TYPE (#.09)
  1. . . S IBATYPN=$G(^IBE(350.1,+$P(IBATYP,"^",9),0))
  1. . . ; Quit if any of the key data for the checks is missing
  1. . . I IBDATA0=""!(IBATYP="")!(IBATYPN="") Q
  1. . . ; IF the BILLING GROUP field (#.11) in the IB ACTION TYPE file (#350.1) is INPT/NHCU PER DIEM (#3)
  1. . . ; AND the SEQUENCE NUMBER (#.05) in the IB ACTION TYPE file (#350.1) is
  1. . . ; 1:INCOMPLETE OR 3:BILLED
  1. . . ; AND the STATUS field (#.05) in the INTEGRATED BILLING ACTION file (#350) is one of the following:
  1. . . ; 1:INCOMPLETE, 2:COMPLETE, 3:BILLED, 4:UPDATED, 8:ON HOLD, 20:HOLD - RATE
  1. . . ; THEN set IBCHRG = IEN of the Per Diem copay
  1. . . I $P(IBATYPN,"^",11)=3,"^1^3^"[("^"_$P(IBATYP,"^",5)_"^"),"^1^2^3^4^8^20^"[("^"_+$P(IBDATA0,"^",5)_"^") D
  1. . . . ; Compare the TOTAL CHARGE of this Per Diem Copay charge to any previously identified
  1. . . . ; Per Diem Copay and save the IEN of the highest charge
  1. . . . I +$P(IBDATA0,U,7)>IBAMT S IBAMT=+$P(IBDATA0,U,7),IBCHRG=IBN
  1. . . Q
  1. . Q
  1. Q +$G(IBCHRG)
  1. ;
  1. CNCLCHRG(IBN,IBCANRSN) ; Cancel a charge that will never be passed over to AR
  1. ; OR an existing charge in AR which is being replaced by a new charge at a higher Tier Rate.
  1. ; Input: IBN = IEN of record in the INTEGRATED BILLING ACTION (#350) file to edit
  1. ; IBCANRSN = the value to set into the CANCELLATION REASON (#.1) field in internal format
  1. ; Output: None
  1. ;
  1. ; The patch will initially be released as a info gathering patch so the set logic is currently
  1. ; commented out.
  1. Q ; ### remove to activate #630 functionality
  1. N IBFDA
  1. ; Quit if no valid IBN
  1. Q:+IBN<=0
  1. ; If the CANCELLATION REASON was not passed in, set it to 4 - ENTERED IN ERROR
  1. S IBCANRSN=$S(IBCANRSN'="":IBCANRSN,1:4)
  1. ; Set STATUS (#.05) to Cancelled (IEN=10)
  1. S IBFDA(350,IBN,.05)=10
  1. ; Set CANCELLATION REASON (#.1) to value passed in
  1. S IBFDA(350,IBN,.1)=IBCANRSN
  1. ; Cancel charge currently being reviewed
  1. D FILE^DIE(,"IBFDA")
  1. Q