IBECEA2 ;ALB/CPM-Cancel/Edit/Add... Edit a Charge ; 15-MAR-93
;;2.0;INTEGRATED BILLING;**57,52,150,176,183,240,563,646**;21-MAR-94;Build 5
;;Per VA Directive 6402, this routine should not be modified.
;
ONE ; Edit a single charge.
N IBGMTR
S IBGMTR=0 ; GMT Related flag
;
D HDR^IBECEAU("E D I T")
;
;IB*2.0*646 - Disable ability to edit any Copays. Need to cancel the charge and re-bill.
W !,"Sorry! Editing a copayment is not allowed within Integrated Billing.",!,"Please cancel this charge and add a new charge."
;
; - don't allow edit of CHAMPVA charges
;I $P($G(^IB(IBN,1)),"^",5) W !,"Sorry! You cannot edit the CHAMPVA inpatient subsistence charge.",!,"Please cancel this charge and add a new charge." G ONEQ
;
; - don't allow edit of TRICARE charges
;I $P($G(^IBE(350.1,+$P($G(^IB(IBN,0)),"^",3),0)),"^",11)=7 W !,"Sorry! You cannot edit TRICARE copayment charges.",!,"Please cancel this charge and add a new charge." G ONEQ
;
; - don't allow edit of LTC charges
;S IBXA=$P($G(^IBE(350.1,+$P($G(^IB(IBN,0)),"^",3),0)),"^",11)
;I IBXA>7,IBXA<10 W !,"Sorry! You cannot edit LTC copayment charges.",!,"Please cancel this charge and add a new charge." G ONEQ
;
; - perform up-front edits
;I 'IBND S IBY="-1^IB021" G ONEQ
;S IBPARNT=+$P(IBND,"^",9) I '$D(^IB(IBPARNT,0)) S IBY="-1^IB027" G ONEQ
;I $$LAST^IBECEAU(IBPARNT)'=IBN W !,"You can only edit the last transaction for an original charge." G ONEQ
;S IBATYP=$G(^IBE(350.1,+$P(IBND,"^",3),0)) I IBATYP="" S IBY="-1^IB022" G ONEQ
;S IBSEQNO=$P(IBATYP,"^",5) I 'IBSEQNO S IBY="-1^IB023" G ONEQ
;I $P(IBATYP,"^",5)=2 W !,"You cannot edit cancellation transactions... please add a new charge." G ONEQ
;I $P(IBND,"^",5)=10 W !,"You cannot edit charges which have been directly cancelled.",!,"Please add a new charge." G ONEQ
;
; - see if charge has been billed or not
;S IBH="^1^2^8^9^99^"[("^"_+$P(IBND,"^",5)_"^"),IBXA=$P(IBATYP,"^",11)
;S IBIL=$P(IBND,"^",11),IBUNITP=+$P(IBND,"^",6),IBCHGP=+$P(IBND,"^",7)
;S IBATYP=+$P($G(^IBE(350.1,+$P(IBND,"^",3),0)),"^",9)
;I 'IBH D G:IBY<0 ONEQ
;.I 'IBUNITP W !,"This charge has been billed, but there are no units!" S IBY=-1 Q
;.I 'IBCHGP W !,"There is no charge amount associated with this action!" S IBY=-1 Q
;.I IBIL="" W !,"This charge has been billed, but there is no bill number!" S IBY=-1 Q
;I IBH,$P(IBND,"^",5)'=8 W !,"*** Please Note: This charge has not yet been passed to Accounts Receivable ***"
;I $P(IBND,"^",5)=8 W !?17,"*** Please Note: This charge is on hold. ***",!?9,"Editing it will cause it to be passed to Accounts Receivable."
;
; - ask user for the cancellation reason
;I 'IBH,IBXA'=4 D REAS^IBECEAU2("E") G:IBCRES<0 ONEQ
;
; - ask user for data to be edited
;D ^IBECEA21 G:IBY<0 ONEQ
;
; - okay to proceed?
;D PROC^IBECEAU4("edit") G:IBY<0 ONEQ S IBUPD=IBND
;
; - cancel 354.71 transaction (copay cap)
;S:$P(IBND,"^",19) IBAMC=$$CANCEL^IBARXMN(DFN,$P(IBND,"^",19),.IBY) G:IBY<0 ONEQ
;
; - build the cancellation transaction
;D CANC^IBECEAU4(IBN,IBCRES,0) G:IBY<0 ONEQ
;
; - build new 354.71 transaction (copay cap)
;I IBXA=5 W !!,"Building the new cap transaction... " S IBAM=$$ADD^IBARXMN(DFN,"^^"_$G(IBEFDT,DT)_"^^P^^"_IBUNIT_"^"_IBCHG_"^"_IBDESC_"^^"_IBCHG_"^0^"_IBSITE_"^^^^^^^"_$G(IBTIER)) I IBAM<0 S IBY="-1^IB316" G ONEQ
;
; - build the updated transaction
;D UPD^IBECEA22 G:IBY<0 ONEQ
;
; - handle updating of clock
;I "^1^2^3^"[("^"_IBXA_"^") D CLOCK^IBECEAU(IBDOLA-IBCLDOL,IBCLDAY,IBDAYA-IBCLDAY)
;
ONEQ D ERR^IBECEAU4:IBY<0,PAUSE^IBECEAU
K IBBS,IBCRES,IBDESC,IBIL,IBND,IBARTYP,IBSEQNO,IBTOTL,IBUNIT,IBATYP,IBIDX,IBN,IBY,IBPARNT,IBH,IBXA,IBNOS,IBRTED,IBADJMED,IBAM,IBAMC,IBEFDT,IBTIER
K IBAFY,IBCAN,IBCHG,IBCHGP,IBCLDA,IBCLDAY,IBCLDOL,IBCLDOLO,IBCLDT,IBCLST,IBDAYA,IBDAYP,IBDOLA,IBDOLP,IBDT,IBFR,IBFRP,IBI,IBJ,IBLIM,IBMED,IBTO,IBTOP,IBTRAN,IBUNIT,IBUNITP,IBUPD
Q
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HIBECEA2 3942 printed Nov 22, 2024@17:31:17 Page 2
IBECEA2 ;ALB/CPM-Cancel/Edit/Add... Edit a Charge ; 15-MAR-93
+1 ;;2.0;INTEGRATED BILLING;**57,52,150,176,183,240,563,646**;21-MAR-94;Build 5
+2 ;;Per VA Directive 6402, this routine should not be modified.
+3 ;
ONE ; Edit a single charge.
+1 NEW IBGMTR
+2 ; GMT Related flag
SET IBGMTR=0
+3 ;
+4 DO HDR^IBECEAU("E D I T")
+5 ;
+6 ;IB*2.0*646 - Disable ability to edit any Copays. Need to cancel the charge and re-bill.
+7 WRITE !,"Sorry! Editing a copayment is not allowed within Integrated Billing.",!,"Please cancel this charge and add a new charge."
+8 ;
+9 ; - don't allow edit of CHAMPVA charges
+10 ;I $P($G(^IB(IBN,1)),"^",5) W !,"Sorry! You cannot edit the CHAMPVA inpatient subsistence charge.",!,"Please cancel this charge and add a new charge." G ONEQ
+11 ;
+12 ; - don't allow edit of TRICARE charges
+13 ;I $P($G(^IBE(350.1,+$P($G(^IB(IBN,0)),"^",3),0)),"^",11)=7 W !,"Sorry! You cannot edit TRICARE copayment charges.",!,"Please cancel this charge and add a new charge." G ONEQ
+14 ;
+15 ; - don't allow edit of LTC charges
+16 ;S IBXA=$P($G(^IBE(350.1,+$P($G(^IB(IBN,0)),"^",3),0)),"^",11)
+17 ;I IBXA>7,IBXA<10 W !,"Sorry! You cannot edit LTC copayment charges.",!,"Please cancel this charge and add a new charge." G ONEQ
+18 ;
+19 ; - perform up-front edits
+20 ;I 'IBND S IBY="-1^IB021" G ONEQ
+21 ;S IBPARNT=+$P(IBND,"^",9) I '$D(^IB(IBPARNT,0)) S IBY="-1^IB027" G ONEQ
+22 ;I $$LAST^IBECEAU(IBPARNT)'=IBN W !,"You can only edit the last transaction for an original charge." G ONEQ
+23 ;S IBATYP=$G(^IBE(350.1,+$P(IBND,"^",3),0)) I IBATYP="" S IBY="-1^IB022" G ONEQ
+24 ;S IBSEQNO=$P(IBATYP,"^",5) I 'IBSEQNO S IBY="-1^IB023" G ONEQ
+25 ;I $P(IBATYP,"^",5)=2 W !,"You cannot edit cancellation transactions... please add a new charge." G ONEQ
+26 ;I $P(IBND,"^",5)=10 W !,"You cannot edit charges which have been directly cancelled.",!,"Please add a new charge." G ONEQ
+27 ;
+28 ; - see if charge has been billed or not
+29 ;S IBH="^1^2^8^9^99^"[("^"_+$P(IBND,"^",5)_"^"),IBXA=$P(IBATYP,"^",11)
+30 ;S IBIL=$P(IBND,"^",11),IBUNITP=+$P(IBND,"^",6),IBCHGP=+$P(IBND,"^",7)
+31 ;S IBATYP=+$P($G(^IBE(350.1,+$P(IBND,"^",3),0)),"^",9)
+32 ;I 'IBH D G:IBY<0 ONEQ
+33 ;.I 'IBUNITP W !,"This charge has been billed, but there are no units!" S IBY=-1 Q
+34 ;.I 'IBCHGP W !,"There is no charge amount associated with this action!" S IBY=-1 Q
+35 ;.I IBIL="" W !,"This charge has been billed, but there is no bill number!" S IBY=-1 Q
+36 ;I IBH,$P(IBND,"^",5)'=8 W !,"*** Please Note: This charge has not yet been passed to Accounts Receivable ***"
+37 ;I $P(IBND,"^",5)=8 W !?17,"*** Please Note: This charge is on hold. ***",!?9,"Editing it will cause it to be passed to Accounts Receivable."
+38 ;
+39 ; - ask user for the cancellation reason
+40 ;I 'IBH,IBXA'=4 D REAS^IBECEAU2("E") G:IBCRES<0 ONEQ
+41 ;
+42 ; - ask user for data to be edited
+43 ;D ^IBECEA21 G:IBY<0 ONEQ
+44 ;
+45 ; - okay to proceed?
+46 ;D PROC^IBECEAU4("edit") G:IBY<0 ONEQ S IBUPD=IBND
+47 ;
+48 ; - cancel 354.71 transaction (copay cap)
+49 ;S:$P(IBND,"^",19) IBAMC=$$CANCEL^IBARXMN(DFN,$P(IBND,"^",19),.IBY) G:IBY<0 ONEQ
+50 ;
+51 ; - build the cancellation transaction
+52 ;D CANC^IBECEAU4(IBN,IBCRES,0) G:IBY<0 ONEQ
+53 ;
+54 ; - build new 354.71 transaction (copay cap)
+55 ;I IBXA=5 W !!,"Building the new cap transaction... " S IBAM=$$ADD^IBARXMN(DFN,"^^"_$G(IBEFDT,DT)_"^^P^^"_IBUNIT_"^"_IBCHG_"^"_IBDESC_"^^"_IBCHG_"^0^"_IBSITE_"^^^^^^^"_$G(IBTIER)) I IBAM<0 S IBY="-1^IB316" G ONEQ
+56 ;
+57 ; - build the updated transaction
+58 ;D UPD^IBECEA22 G:IBY<0 ONEQ
+59 ;
+60 ; - handle updating of clock
+61 ;I "^1^2^3^"[("^"_IBXA_"^") D CLOCK^IBECEAU(IBDOLA-IBCLDOL,IBCLDAY,IBDAYA-IBCLDAY)
+62 ;
ONEQ if IBY<0
DO ERR^IBECEAU4
DO PAUSE^IBECEAU
+1 KILL IBBS,IBCRES,IBDESC,IBIL,IBND,IBARTYP,IBSEQNO,IBTOTL,IBUNIT,IBATYP,IBIDX,IBN,IBY,IBPARNT,IBH,IBXA,IBNOS,IBRTED,IBADJMED,IBAM,IBAMC,IBEFDT,IBTIER
+2 KILL IBAFY,IBCAN,IBCHG,IBCHGP,IBCLDA,IBCLDAY,IBCLDOL,IBCLDOLO,IBCLDT,IBCLST,IBDAYA,IBDAYP,IBDOLA,IBDOLP,IBDT,IBFR,IBFRP,IBI,IBJ,IBLIM,IBMED,IBTO,IBTOP,IBTRAN,IBUNIT,IBUNITP,IBUPD
+3 QUIT