IBCU7A ;ALB/ARH - BILL PROCEDURE MANIPULATIONS ; 10-OCT-03
;;2.0;INTEGRATED BILLING;**245,287,483,564,619**;21-MAR-94;Build 34
;;Per VA Directive 6402, this routine should not be modified.
;
; Based on Reasonable Charges v2.0+, certain CPT codes should be reported in a certain way
; this set of routines manipulates the bill's procedure to conform to the charges and proper billing
;
; criteria: bill must be a Reasonable Charges bill
; charges must be v2.0 or greater
;
; called after bill created and populated to reset procedures
;
PROC(IBIFN,EDIT) ; manipulate bill procedures base on charges and the clinical data
; EDIT is a flag for which manipulations should be completed, if true then only the charge significant manipulations are preformed
N IB0,IBBCT,IBPBTYP S EDIT=$G(EDIT)
I '$O(^DGCR(399,+$G(IBIFN),"CP",0)) Q
S IB0=$G(^DGCR(399,+IBIFN,0)) Q:IB0="" S IBBCT=$P(IB0,U,27) Q:'IBBCT
I +$P($G(^DGCR(399,+IBIFN,"U")),U,2)<$$VERSDT^IBCRU8(2) Q
I '$$BILLRATE^IBCRU3($P(IB0,U,7),$P(IB0,U,5),$P(IB0,U,3),"RC") Q
;
S IBPBTYP=$P($$RCDV^IBCRU8(+$P(IB0,U,22)),U,3) Q:'IBPBTYP
;
I 'EDIT,IBPBTYP<3 D DELCLN(IBIFN) ; delete TC/26 component clinical procedures from bills
I 'EDIT,IBPBTYP<3 D ADDCLN(IBIFN) ; add 26 modified clinical procedures to bill
;
; *483 - add TC modifier to procedures on a provider based facility bill if the only professional charge for the procedure is 26 modified
;I 'EDIT,IBPBTYP<3 D DELTC(IBIFN) ; delete all TC modifiers from institutional bills
D MODTC(IBIFN)
;
D MOD26(IBIFN) ; if only professional charge is a 26 charge then add or delete modifier 26 on procedure
;
D BNDL^IBCU7A1(IBIFN) ; split or combine bundled procedures
;
K ^UTILITY($J)
Q
;
;
;
DELTC(IBIFN) ; delete TC modifier from all procedures on RC v2.0+ Institutional bills
N IB0,IBBCT,IBTC,IBBCPT,IBLN,IBEVDT,IBMODS,IBV2,IBCHANGE S IBCHANGE=0
S IB0=$G(^DGCR(399,+$G(IBIFN),0)) Q:IB0="" S IBBCT=$P(IB0,U,27) I IBBCT'=1 Q
S IBTC=+$$MOD^ICPTMOD("TC","E") Q:IBTC<1 S IBV2=$$VERSDT^IBCRU8(2)
;
S IBBCPT=0 F S IBBCPT=$O(^DGCR(399,IBIFN,"CP",IBBCPT)) Q:'IBBCPT D
. S IBLN=$G(^DGCR(399,IBIFN,"CP",IBBCPT,0)),IBEVDT=$P(IBLN,U,2) Q:IBLN'[";ICPT("
. I IBEVDT<IBV2 Q
. S IBMODS=","_$$GETMOD^IBEFUNC(IBIFN,IBBCPT)_","
. I IBMODS[IBTC D DELMOD^IBCU73(IBIFN,IBBCPT,IBTC) S IBCHANGE=IBCHANGE+1
I '$D(ZTQUEUED),'$G(IBAUTO),+IBCHANGE W !,"Modifier TC Deleted from all Procedures ("_IBCHANGE_")."
Q
;
DELCLN(IBIFN) ; remove clinical procedures from RC v2.0+ bills
; - remove from institutional bill any procedures with a 26 in the clinical data
; - remove from professional bill any procedures with a TC in the clinical data
; to delete a procedure the outpatient encounter pointer must match the clinical encounter
; (checks for non-modified procedure on bill in case modifier was manually removed)
;
N IB0,IBBCT,IBMODE,IBMOD,IBX,IBLN,IBOE,IBCM,IBCPT,IBBCPT,IBLN1,IBFND,IBEND,IBV2,IBCHANGE S IBCHANGE=0
S IB0=$G(^DGCR(399,+$G(IBIFN),0)) Q:IB0="" S IBBCT=$P(IB0,U,27) I 'IBBCT Q
S IBMODE=$S(IBBCT=1:26,IBBCT=2:"TC",1:"") Q:IBMODE="" S IBV2=$$VERSDT^IBCRU8(2)
S IBMOD=+$$MOD^ICPTMOD(IBMODE,"E") Q:IBMOD<1
;
D GETSD^IBCU7U(IBIFN)
S IBX=0 F S IBX=$O(^UTILITY($J,"CPT-CNT",IBX)) Q:'IBX D
. S IBLN=$G(^UTILITY($J,"CPT-CNT",IBX)),(IBEND,IBFND)=0
. I +$P(IBLN,U,2)<IBV2 Q
. S IBOE=+$P(IBLN,U,11),IBCM=","_$P(IBLN,U,10)_","
. ;
. I IBCM[(","_IBMOD_",") D
.. S IBCPT=+IBLN_";ICPT(",IBBCPT=0 F S IBBCPT=$O(^DGCR(399,IBIFN,"CP","B",IBCPT,IBBCPT)) Q:'IBBCPT D Q:IBEND
... S IBLN1=$G(^DGCR(399,IBIFN,"CP",IBBCPT,0))
... I IBOE=$P(IBLN1,U,20) S IBFND=IBBCPT I $O(^DGCR(399,IBIFN,"CP",IBBCPT,"MOD","C",IBMOD,0)) S IBEND=1
.. I +IBFND,+$$DELCPT^IBCU7U(IBIFN,IBBCPT) S IBCHANGE=IBCHANGE+1
I '$D(ZTQUEUED),'$G(IBAUTO),+IBCHANGE W !,"Modifier "_IBMODE_" Procedures Deleted ("_IBCHANGE_")."
Q
;
ADDCLN(IBIFN) ; add 26 modified clinical procedures to RC v2.0+ bills
; - add to professional bill any procedures with a 26 in the clinical data
; to add the clinical procedure the bill must not already have that procedure for the date
; (checks for non-modified procedure on bill in case modifier was manually removed)
;
N IB0,IBBCT,IBMOD,IBX,IBLN,IBEVDT,IBCM,IBCPT,IBBCPT,IBLN1,IBFND,IBEND,IBV2,IBCHANGE S IBCHANGE=0
S IB0=$G(^DGCR(399,+$G(IBIFN),0)) Q:IB0="" S IBBCT=$P(IB0,U,27) I IBBCT'=2 Q
S IBMOD=+$$MOD^ICPTMOD("26","E") Q:IBMOD<1 S IBV2=$$VERSDT^IBCRU8(2)
;
D GETSD^IBCU7U(IBIFN)
S IBX=0 F S IBX=$O(^UTILITY($J,"CPT-CNT",IBX)) Q:'IBX D
. S IBLN=$G(^UTILITY($J,"CPT-CNT",IBX)),(IBEND,IBFND)=0
. S IBEVDT=+$P(IBLN,U,2),IBCM=","_$P(IBLN,U,10)_","
. I IBEVDT<IBV2 Q
. ;
. I IBCM[(","_IBMOD_",") D
.. S IBCPT=+IBLN_";ICPT(",IBBCPT=0 F S IBBCPT=$O(^DGCR(399,IBIFN,"CP","B",IBCPT,IBBCPT)) Q:'IBBCPT D Q:IBEND
... S IBLN1=$G(^DGCR(399,IBIFN,"CP",IBBCPT,0))
... I IBEVDT=$P(IBLN1,U,2) S IBFND=IBBCPT I $O(^DGCR(399,IBIFN,"CP",IBBCPT,"MOD","C",IBMOD,0)) S IBEND=1
.. I 'IBFND,+$$ADDCPT^IBCU7U(IBIFN,IBLN) S IBCHANGE=IBCHANGE+1
I '$D(ZTQUEUED),'$G(IBAUTO),+IBCHANGE W !,"Modifier 26 Procedures Added ("_IBCHANGE_")."
Q
;
MOD26(IBIFN) ; add/delete modifier 26 to procedure if that is the only professional charge available
; added on professional bill, deleted from institutional bill
N IB0,IBBCT,IB26,IBBCPT,IBLN,IBEVDT,IBMODS,IBV2,IBCHANGE,IBCHGS S IBCHANGE=0
S IB0=$G(^DGCR(399,+$G(IBIFN),0)) Q:IB0="" S IBBCT=$P(IB0,U,27) I 'IBBCT Q
S IB26=+$$MOD^ICPTMOD("26","E") Q:IB26<1 S IBV2=$$VERSDT^IBCRU8(2)
;
S IBBCPT=0 F S IBBCPT=$O(^DGCR(399,IBIFN,"CP",IBBCPT)) Q:'IBBCPT D
. S IBLN=$G(^DGCR(399,IBIFN,"CP",IBBCPT,0)),IBEVDT=$P(IBLN,U,2) Q:IBLN'[";ICPT("
. I IBEVDT<IBV2 Q
. S IBMODS=","_$$GETMOD^IBEFUNC(IBIFN,IBBCPT)_","
. ;
. S IBCHGS=$$CHGMOD^IBCRCU1(IBIFN,+IBLN,IBEVDT,2) I (+IBCHGS'=1)!(+$P(IBCHGS,":",3)'=IB26) Q
. ; *484
. I IBBCT=1,$F(IBMODS,","_IB26_",") D DELMOD^IBCU73(IBIFN,IBBCPT,IB26) S IBCHANGE=IBCHANGE+1
. I IBBCT=2,IBMODS'[IB26 D ADDMOD^IBCU73(IBIFN,IBBCPT,IB26) S IBCHANGE=IBCHANGE+1
;
I '$D(ZTQUEUED),'$G(IBAUTO),+IBCHANGE W !,"Modifier 26 "_$S(IBBCT=1:"Deleted from",1:"Added to")_" Procedures ("_IBCHANGE_")."
Q
;
MODTC(IBIFN) ; add TC modifier to procedures on the institutional bill
; *564 remove TC modifier from procedures on the professional bill
N IB0,IBBCT,IBCHGS,IBTC,IB26,IBBCPT,IBLN,IBEVDT,IBMODS,IBV2,IBCHANGE
S IBCHANGE=0,IBV2=$$VERSDT^IBCRU8(2)
S IB0=$G(^DGCR(399,+$G(IBIFN),0)) Q:IB0=""
S IBBCT=$P(IB0,U,27) Q:'IBBCT
S IBTC=+$$MOD^ICPTMOD("TC","E") Q:IBTC<1
S IB26=+$$MOD^ICPTMOD("26","E") Q:IB26<1
;
S IBBCPT=0 F S IBBCPT=$O(^DGCR(399,IBIFN,"CP",IBBCPT)) Q:'IBBCPT D
. S IBLN=$G(^DGCR(399,IBIFN,"CP",IBBCPT,0)),IBEVDT=$P(IBLN,U,2) Q:IBLN'[";ICPT("
. I IBEVDT<IBV2 Q
. S IBMODS=","_$$GETMOD^IBEFUNC(IBIFN,IBBCPT)_","
. S IBCHGS=$$CHGMOD^IBCRCU1(IBIFN,+IBLN,IBEVDT,2) I (+IBCHGS'=1)!(+$P(IBCHGS,":",3)'=IB26) Q
. I IBBCT=2,$F(IBMODS,","_IBTC_",") D DELMOD^IBCU73(IBIFN,IBBCPT,IBTC) S IBCHANGE=IBCHANGE+1
. I IBBCT=1,'$$MCRB(IBIFN),IBMODS'[IBTC D ADDMOD^IBCU73(IBIFN,IBBCPT,IBTC) S IBCHANGE=IBCHANGE+1
I '$D(ZTQUEUED),'$G(IBAUTO),+IBCHANGE W !,"Modifier TC "_$S(IBBCT=2:"Deleted from",1:"Added to")_" Procedures ("_IBCHANGE_")."
Q
;
MCRB(IBIFN) ; *619 - no TC modifier for Medicare
; input-IBIFN, output-1 if payer sequence is primary and 1st or 2nd payer is Medicare, otherwise 0
N IBMCR,IBCOB S IBMCR=0
S IBCOB=$$COBN^IBCEF(IBIFN)
I IBCOB=1 I ($$WNRBILL^IBEFUNC(IBIFN,1))!($$WNRBILL^IBEFUNC(IBIFN,2)) S IBMCR=1
Q IBMCR
;
ASK(IBIFN) ; ask if the bill procedure modifications should be executed
N DIR,DIRUT,DUOUT,DTOUT,X,Y
I '$O(^DGCR(399,+$G(IBIFN),"CP",0)) Q
S DIR("?")="Enter Yes to apply the bill procedure modifications for charges."
S DIR("?",1)="For Reasonable Charges some procedures must be billed in a certain way to"
S DIR("?",2)="receive a charge. The bill procedure modifications apply rules to the bill"
S DIR("?",3)="procedures to ensure the correct Reasonable Charge.",DIR("?",4)=""
S DIR("?",5)="- Modifier 26 will be added/removed from procedures if it affects the charges."
S DIR("?",6)="- Certain global procedures with no charge will be split into their component"
S DIR("?",7)=" procedures which do have charges.",DIR("?",8)=""
;
S DIR("A")="Apply Procedure Updates for Charges" W !!
S DIR(0)="Y",DIR("B")="YES" D ^DIR K DIR,X I Y=1 D PROC(+IBIFN,1) W !
Q
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HIBCU7A 8506 printed Dec 13, 2024@02:20:53 Page 2
IBCU7A ;ALB/ARH - BILL PROCEDURE MANIPULATIONS ; 10-OCT-03
+1 ;;2.0;INTEGRATED BILLING;**245,287,483,564,619**;21-MAR-94;Build 34
+2 ;;Per VA Directive 6402, this routine should not be modified.
+3 ;
+4 ; Based on Reasonable Charges v2.0+, certain CPT codes should be reported in a certain way
+5 ; this set of routines manipulates the bill's procedure to conform to the charges and proper billing
+6 ;
+7 ; criteria: bill must be a Reasonable Charges bill
+8 ; charges must be v2.0 or greater
+9 ;
+10 ; called after bill created and populated to reset procedures
+11 ;
PROC(IBIFN,EDIT) ; manipulate bill procedures base on charges and the clinical data
+1 ; EDIT is a flag for which manipulations should be completed, if true then only the charge significant manipulations are preformed
+2 NEW IB0,IBBCT,IBPBTYP
SET EDIT=$GET(EDIT)
+3 IF '$ORDER(^DGCR(399,+$GET(IBIFN),"CP",0))
QUIT
+4 SET IB0=$GET(^DGCR(399,+IBIFN,0))
if IB0=""
QUIT
SET IBBCT=$PIECE(IB0,U,27)
if 'IBBCT
QUIT
+5 IF +$PIECE($GET(^DGCR(399,+IBIFN,"U")),U,2)<$$VERSDT^IBCRU8(2)
QUIT
+6 IF '$$BILLRATE^IBCRU3($PIECE(IB0,U,7),$PIECE(IB0,U,5),$PIECE(IB0,U,3),"RC")
QUIT
+7 ;
+8 SET IBPBTYP=$PIECE($$RCDV^IBCRU8(+$PIECE(IB0,U,22)),U,3)
if 'IBPBTYP
QUIT
+9 ;
+10 ; delete TC/26 component clinical procedures from bills
IF 'EDIT
IF IBPBTYP<3
DO DELCLN(IBIFN)
+11 ; add 26 modified clinical procedures to bill
IF 'EDIT
IF IBPBTYP<3
DO ADDCLN(IBIFN)
+12 ;
+13 ; *483 - add TC modifier to procedures on a provider based facility bill if the only professional charge for the procedure is 26 modified
+14 ;I 'EDIT,IBPBTYP<3 D DELTC(IBIFN) ; delete all TC modifiers from institutional bills
+15 DO MODTC(IBIFN)
+16 ;
+17 ; if only professional charge is a 26 charge then add or delete modifier 26 on procedure
DO MOD26(IBIFN)
+18 ;
+19 ; split or combine bundled procedures
DO BNDL^IBCU7A1(IBIFN)
+20 ;
+21 KILL ^UTILITY($JOB)
+22 QUIT
+23 ;
+24 ;
+25 ;
DELTC(IBIFN) ; delete TC modifier from all procedures on RC v2.0+ Institutional bills
+1 NEW IB0,IBBCT,IBTC,IBBCPT,IBLN,IBEVDT,IBMODS,IBV2,IBCHANGE
SET IBCHANGE=0
+2 SET IB0=$GET(^DGCR(399,+$GET(IBIFN),0))
if IB0=""
QUIT
SET IBBCT=$PIECE(IB0,U,27)
IF IBBCT'=1
QUIT
+3 SET IBTC=+$$MOD^ICPTMOD("TC","E")
if IBTC<1
QUIT
SET IBV2=$$VERSDT^IBCRU8(2)
+4 ;
+5 SET IBBCPT=0
FOR
SET IBBCPT=$ORDER(^DGCR(399,IBIFN,"CP",IBBCPT))
if 'IBBCPT
QUIT
Begin DoDot:1
+6 SET IBLN=$GET(^DGCR(399,IBIFN,"CP",IBBCPT,0))
SET IBEVDT=$PIECE(IBLN,U,2)
if IBLN'[";ICPT("
QUIT
+7 IF IBEVDT<IBV2
QUIT
+8 SET IBMODS=","_$$GETMOD^IBEFUNC(IBIFN,IBBCPT)_","
+9 IF IBMODS[IBTC
DO DELMOD^IBCU73(IBIFN,IBBCPT,IBTC)
SET IBCHANGE=IBCHANGE+1
End DoDot:1
+10 IF '$DATA(ZTQUEUED)
IF '$GET(IBAUTO)
IF +IBCHANGE
WRITE !,"Modifier TC Deleted from all Procedures ("_IBCHANGE_")."
+11 QUIT
+12 ;
DELCLN(IBIFN) ; remove clinical procedures from RC v2.0+ bills
+1 ; - remove from institutional bill any procedures with a 26 in the clinical data
+2 ; - remove from professional bill any procedures with a TC in the clinical data
+3 ; to delete a procedure the outpatient encounter pointer must match the clinical encounter
+4 ; (checks for non-modified procedure on bill in case modifier was manually removed)
+5 ;
+6 NEW IB0,IBBCT,IBMODE,IBMOD,IBX,IBLN,IBOE,IBCM,IBCPT,IBBCPT,IBLN1,IBFND,IBEND,IBV2,IBCHANGE
SET IBCHANGE=0
+7 SET IB0=$GET(^DGCR(399,+$GET(IBIFN),0))
if IB0=""
QUIT
SET IBBCT=$PIECE(IB0,U,27)
IF 'IBBCT
QUIT
+8 SET IBMODE=$SELECT(IBBCT=1:26,IBBCT=2:"TC",1:"")
if IBMODE=""
QUIT
SET IBV2=$$VERSDT^IBCRU8(2)
+9 SET IBMOD=+$$MOD^ICPTMOD(IBMODE,"E")
if IBMOD<1
QUIT
+10 ;
+11 DO GETSD^IBCU7U(IBIFN)
+12 SET IBX=0
FOR
SET IBX=$ORDER(^UTILITY($JOB,"CPT-CNT",IBX))
if 'IBX
QUIT
Begin DoDot:1
+13 SET IBLN=$GET(^UTILITY($JOB,"CPT-CNT",IBX))
SET (IBEND,IBFND)=0
+14 IF +$PIECE(IBLN,U,2)<IBV2
QUIT
+15 SET IBOE=+$PIECE(IBLN,U,11)
SET IBCM=","_$PIECE(IBLN,U,10)_","
+16 ;
+17 IF IBCM[(","_IBMOD_",")
Begin DoDot:2
+18 SET IBCPT=+IBLN_";ICPT("
SET IBBCPT=0
FOR
SET IBBCPT=$ORDER(^DGCR(399,IBIFN,"CP","B",IBCPT,IBBCPT))
if 'IBBCPT
QUIT
Begin DoDot:3
+19 SET IBLN1=$GET(^DGCR(399,IBIFN,"CP",IBBCPT,0))
+20 IF IBOE=$PIECE(IBLN1,U,20)
SET IBFND=IBBCPT
IF $ORDER(^DGCR(399,IBIFN,"CP",IBBCPT,"MOD","C",IBMOD,0))
SET IBEND=1
End DoDot:3
if IBEND
QUIT
+21 IF +IBFND
IF +$$DELCPT^IBCU7U(IBIFN,IBBCPT)
SET IBCHANGE=IBCHANGE+1
End DoDot:2
End DoDot:1
+22 IF '$DATA(ZTQUEUED)
IF '$GET(IBAUTO)
IF +IBCHANGE
WRITE !,"Modifier "_IBMODE_" Procedures Deleted ("_IBCHANGE_")."
+23 QUIT
+24 ;
ADDCLN(IBIFN) ; add 26 modified clinical procedures to RC v2.0+ bills
+1 ; - add to professional bill any procedures with a 26 in the clinical data
+2 ; to add the clinical procedure the bill must not already have that procedure for the date
+3 ; (checks for non-modified procedure on bill in case modifier was manually removed)
+4 ;
+5 NEW IB0,IBBCT,IBMOD,IBX,IBLN,IBEVDT,IBCM,IBCPT,IBBCPT,IBLN1,IBFND,IBEND,IBV2,IBCHANGE
SET IBCHANGE=0
+6 SET IB0=$GET(^DGCR(399,+$GET(IBIFN),0))
if IB0=""
QUIT
SET IBBCT=$PIECE(IB0,U,27)
IF IBBCT'=2
QUIT
+7 SET IBMOD=+$$MOD^ICPTMOD("26","E")
if IBMOD<1
QUIT
SET IBV2=$$VERSDT^IBCRU8(2)
+8 ;
+9 DO GETSD^IBCU7U(IBIFN)
+10 SET IBX=0
FOR
SET IBX=$ORDER(^UTILITY($JOB,"CPT-CNT",IBX))
if 'IBX
QUIT
Begin DoDot:1
+11 SET IBLN=$GET(^UTILITY($JOB,"CPT-CNT",IBX))
SET (IBEND,IBFND)=0
+12 SET IBEVDT=+$PIECE(IBLN,U,2)
SET IBCM=","_$PIECE(IBLN,U,10)_","
+13 IF IBEVDT<IBV2
QUIT
+14 ;
+15 IF IBCM[(","_IBMOD_",")
Begin DoDot:2
+16 SET IBCPT=+IBLN_";ICPT("
SET IBBCPT=0
FOR
SET IBBCPT=$ORDER(^DGCR(399,IBIFN,"CP","B",IBCPT,IBBCPT))
if 'IBBCPT
QUIT
Begin DoDot:3
+17 SET IBLN1=$GET(^DGCR(399,IBIFN,"CP",IBBCPT,0))
+18 IF IBEVDT=$PIECE(IBLN1,U,2)
SET IBFND=IBBCPT
IF $ORDER(^DGCR(399,IBIFN,"CP",IBBCPT,"MOD","C",IBMOD,0))
SET IBEND=1
End DoDot:3
if IBEND
QUIT
+19 IF 'IBFND
IF +$$ADDCPT^IBCU7U(IBIFN,IBLN)
SET IBCHANGE=IBCHANGE+1
End DoDot:2
End DoDot:1
+20 IF '$DATA(ZTQUEUED)
IF '$GET(IBAUTO)
IF +IBCHANGE
WRITE !,"Modifier 26 Procedures Added ("_IBCHANGE_")."
+21 QUIT
+22 ;
MOD26(IBIFN) ; add/delete modifier 26 to procedure if that is the only professional charge available
+1 ; added on professional bill, deleted from institutional bill
+2 NEW IB0,IBBCT,IB26,IBBCPT,IBLN,IBEVDT,IBMODS,IBV2,IBCHANGE,IBCHGS
SET IBCHANGE=0
+3 SET IB0=$GET(^DGCR(399,+$GET(IBIFN),0))
if IB0=""
QUIT
SET IBBCT=$PIECE(IB0,U,27)
IF 'IBBCT
QUIT
+4 SET IB26=+$$MOD^ICPTMOD("26","E")
if IB26<1
QUIT
SET IBV2=$$VERSDT^IBCRU8(2)
+5 ;
+6 SET IBBCPT=0
FOR
SET IBBCPT=$ORDER(^DGCR(399,IBIFN,"CP",IBBCPT))
if 'IBBCPT
QUIT
Begin DoDot:1
+7 SET IBLN=$GET(^DGCR(399,IBIFN,"CP",IBBCPT,0))
SET IBEVDT=$PIECE(IBLN,U,2)
if IBLN'[";ICPT("
QUIT
+8 IF IBEVDT<IBV2
QUIT
+9 SET IBMODS=","_$$GETMOD^IBEFUNC(IBIFN,IBBCPT)_","
+10 ;
+11 SET IBCHGS=$$CHGMOD^IBCRCU1(IBIFN,+IBLN,IBEVDT,2)
IF (+IBCHGS'=1)!(+$PIECE(IBCHGS,":",3)'=IB26)
QUIT
+12 ; *484
+13 IF IBBCT=1
IF $FIND(IBMODS,","_IB26_",")
DO DELMOD^IBCU73(IBIFN,IBBCPT,IB26)
SET IBCHANGE=IBCHANGE+1
+14 IF IBBCT=2
IF IBMODS'[IB26
DO ADDMOD^IBCU73(IBIFN,IBBCPT,IB26)
SET IBCHANGE=IBCHANGE+1
End DoDot:1
+15 ;
+16 IF '$DATA(ZTQUEUED)
IF '$GET(IBAUTO)
IF +IBCHANGE
WRITE !,"Modifier 26 "_$SELECT(IBBCT=1:"Deleted from",1:"Added to")_" Procedures ("_IBCHANGE_")."
+17 QUIT
+18 ;
MODTC(IBIFN) ; add TC modifier to procedures on the institutional bill
+1 ; *564 remove TC modifier from procedures on the professional bill
+2 NEW IB0,IBBCT,IBCHGS,IBTC,IB26,IBBCPT,IBLN,IBEVDT,IBMODS,IBV2,IBCHANGE
+3 SET IBCHANGE=0
SET IBV2=$$VERSDT^IBCRU8(2)
+4 SET IB0=$GET(^DGCR(399,+$GET(IBIFN),0))
if IB0=""
QUIT
+5 SET IBBCT=$PIECE(IB0,U,27)
if 'IBBCT
QUIT
+6 SET IBTC=+$$MOD^ICPTMOD("TC","E")
if IBTC<1
QUIT
+7 SET IB26=+$$MOD^ICPTMOD("26","E")
if IB26<1
QUIT
+8 ;
+9 SET IBBCPT=0
FOR
SET IBBCPT=$ORDER(^DGCR(399,IBIFN,"CP",IBBCPT))
if 'IBBCPT
QUIT
Begin DoDot:1
+10 SET IBLN=$GET(^DGCR(399,IBIFN,"CP",IBBCPT,0))
SET IBEVDT=$PIECE(IBLN,U,2)
if IBLN'[";ICPT("
QUIT
+11 IF IBEVDT<IBV2
QUIT
+12 SET IBMODS=","_$$GETMOD^IBEFUNC(IBIFN,IBBCPT)_","
+13 SET IBCHGS=$$CHGMOD^IBCRCU1(IBIFN,+IBLN,IBEVDT,2)
IF (+IBCHGS'=1)!(+$PIECE(IBCHGS,":",3)'=IB26)
QUIT
+14 IF IBBCT=2
IF $FIND(IBMODS,","_IBTC_",")
DO DELMOD^IBCU73(IBIFN,IBBCPT,IBTC)
SET IBCHANGE=IBCHANGE+1
+15 IF IBBCT=1
IF '$$MCRB(IBIFN)
IF IBMODS'[IBTC
DO ADDMOD^IBCU73(IBIFN,IBBCPT,IBTC)
SET IBCHANGE=IBCHANGE+1
End DoDot:1
+16 IF '$DATA(ZTQUEUED)
IF '$GET(IBAUTO)
IF +IBCHANGE
WRITE !,"Modifier TC "_$SELECT(IBBCT=2:"Deleted from",1:"Added to")_" Procedures ("_IBCHANGE_")."
+17 QUIT
+18 ;
MCRB(IBIFN) ; *619 - no TC modifier for Medicare
+1 ; input-IBIFN, output-1 if payer sequence is primary and 1st or 2nd payer is Medicare, otherwise 0
+2 NEW IBMCR,IBCOB
SET IBMCR=0
+3 SET IBCOB=$$COBN^IBCEF(IBIFN)
+4 IF IBCOB=1
IF ($$WNRBILL^IBEFUNC(IBIFN,1))!($$WNRBILL^IBEFUNC(IBIFN,2))
SET IBMCR=1
+5 QUIT IBMCR
+6 ;
ASK(IBIFN) ; ask if the bill procedure modifications should be executed
+1 NEW DIR,DIRUT,DUOUT,DTOUT,X,Y
+2 IF '$ORDER(^DGCR(399,+$GET(IBIFN),"CP",0))
QUIT
+3 SET DIR("?")="Enter Yes to apply the bill procedure modifications for charges."
+4 SET DIR("?",1)="For Reasonable Charges some procedures must be billed in a certain way to"
+5 SET DIR("?",2)="receive a charge. The bill procedure modifications apply rules to the bill"
+6 SET DIR("?",3)="procedures to ensure the correct Reasonable Charge."
SET DIR("?",4)=""
+7 SET DIR("?",5)="- Modifier 26 will be added/removed from procedures if it affects the charges."
+8 SET DIR("?",6)="- Certain global procedures with no charge will be split into their component"
+9 SET DIR("?",7)=" procedures which do have charges."
SET DIR("?",8)=""
+10 ;
+11 SET DIR("A")="Apply Procedure Updates for Charges"
WRITE !!
+12 SET DIR(0)="Y"
SET DIR("B")="YES"
DO ^DIR
KILL DIR,X
IF Y=1
DO PROC(+IBIFN,1)
WRITE !
+13 QUIT