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

IBCCCB0.m

Go to the documentation of this file.
  1. IBCCCB0 ;ALB/ARH - COPY BILL FOR COB (OVERFLOW) ;06-19-97
  1. ;;2.0;INTEGRATED BILLING;**51,137,155,727**;21-MAR-94;Build 34
  1. ;;Per VA Directive 6402, this routine should not be modified.
  1. ;
  1. DSPRB(IBIFN) ; display related bills
  1. ;
  1. N IBCOB,IBI,IBLABEL,IBJ,IBK,IBINS,IBAR,IBDS Q:'$G(IBIFN)
  1. S IBDS="------------------------------------------------------------------"
  1. D BCOB^IBCU3(IBIFN,.IBCOB) I $O(IBCOB(0)) D
  1. . W !!!,?13,"Payer Responsible",?33,"Bill #",?41,"Status",?49,"Original",?59,"Collected",?72,"Balance",!,?13,IBDS
  1. . S IBI=0 F S IBI=$O(IBCOB(IBI)) Q:'IBI D
  1. .. S IBLABEL=$S(IBI=1:"Primary",IBI=2:"Secondary",IBI=3:"Tertiary",1:"Other")_":",IBLABEL=$J(IBLABEL,10)
  1. .. S IBJ=0 F S IBJ=$O(IBCOB(IBI,IBJ)) Q:'IBJ D
  1. ... S IBK="" F S IBK=$O(IBCOB(IBI,IBJ,IBK)) Q:IBK="" D
  1. .... S IBINS=$G(^DIC(36,+IBJ,0))
  1. .... W !," ",IBLABEL,?13,$E($P(IBINS,U),1,18) S IBLABEL="" Q:'IBK
  1. .... S IBAR=$$BILL^RCJIBFN2(IBK)
  1. .... W ?33,$P($G(^DGCR(399,+IBK,0)),U)
  1. .... W ?43,$P($$STNO^RCJIBFN2(+$P(IBAR,U,2)),U,2)
  1. .... W ?47,$J($P(IBAR,U),10,2)
  1. .... W ?58,$J($P(IBAR,U,4),10,2)
  1. .... W ?69,$J($P(IBAR,U,3),10,2)
  1. I +$$IB^IBRUTL(IBIFN,0) W !!,?8,"* There are patient bills on Hold for the date range of this bill."
  1. W !!
  1. Q
  1. ;
  1. CTCOPY(IBIFN,IBMRA) ; based on the type of bill, copy it without cancelling
  1. ; IBMRA = 1 if an MRA bill and copy for prof components is desired
  1. ;
  1. N IB0,IBCTYPE I +$G(IBCBCOPY) Q
  1. S IB0=$G(^DGCR(399,+$G(IBIFN),0)),IBCTYPE=+$P(IB0,U,27) Q:'IBCTYPE
  1. I $S('$G(IBMRA):$P(IB0,U,21)'=$E($$BINS^IBCU3(+$G(IBIFN))),1:0) Q ; don't copy if not first in series, current payer=first payer and not an MRA
  1. I IBCTYPE=1 D CTCOPY1(IBIFN) Q
  1. I IBCTYPE=2 D CTCOPY2(IBIFN) Q
  1. Q
  1. ;
  1. CTCOPY1(IBIFN) ; Copy a Reasonable Charges inst bill to create a prof bill:
  1. ; - Billing Rate must be Reasonable Charges
  1. ; - Bill being copied must be an inst bill
  1. ; - Prof bill must not already exist for the event date
  1. ; - If the bill is outpt at least one CPT must have prof charges
  1. ; - Procedure codes are copied only if the care is outpt
  1. ;
  1. N IB0,IBU,IBBTYPE,IBBCTO,IBBCTN,IBBCTOD,IBBCTND,IBNOCPT,IBCTCOPY,IBX,IBHV,IBNOTC
  1. ;
  1. S IBCTCOPY=1 ; flag - the copy function entered to auto copy Inst->Prof
  1. ;
  1. S IB0=$G(^DGCR(399,+$G(IBIFN),0)) Q:IB0="" S IBU=$G(^("U")) Q:'IBU
  1. S IBBTYPE=$S($P(IB0,U,5)<3:"Inpatient",1:"Outpatient")
  1. ;
  1. S IBBCTO=$P(IB0,U,27),IBBCTN=0 I 'IBBCTO Q
  1. I IBBCTO=1 S IBBCTN=2 ; inst defined, create prof
  1. I 'IBBCTN Q
  1. ;
  1. I '$$BILLRATE^IBCRU3($P(IB0,U,7),$P(IB0,U,5),$P(IBU,U,1,2),"RC") Q ; copy only reasonable charges bills
  1. ;
  1. S IBBCTOD=$S(IBBCTO=1:"INSTITUTIONAL",2:"PROFESSIONAL"),IBBCTND=$S(IBBCTN=1:"INSTITUTIONAL",2:"PROFESSIONAL")
  1. ;
  1. I $P(IB0,U,5)>2,'$$CPTCHG^IBCRCU1(IBIFN,"PROF") W !!!,"There are no Reasonable Charges Outpatient Professional charges for this bill,",!,"second bill not created.",!! Q
  1. ;
  1. W !!!,"This ",IBBTYPE," ",IBBCTOD," bill may have corresponding ",IBBCTND," charges."
  1. ;
  1. I '$G(^DGCR(399,IBIFN,"U1")) W !!,"The current bill has no charges defined, no second bill created." Q
  1. ;
  1. S IBX=$$CTCHK^IBCU41(IBIFN) I +IBX W !!,"There is an existing ",IBBTYPE," ",IBBCTND," bill (",$P($G(^DGCR(399,+IBX,0)),U,1),") that appears",!,"to correspond to this ",IBBCTOD," bill, second bill not created.",!! Q
  1. ;
  1. W !,"Creating an ",IBBTYPE," ",IBBCTND," bill.",!!
  1. ;
  1. S IBCOB(0,27)=IBBCTN
  1. S IBIDS(.15)=IBIFN D KVAR^IBCCCB
  1. ;
  1. I $P(IB0,U,5)<3 S IBNOCPT=1 ; do not copy inpt facility procedures (ICD) to inpt prof bill
  1. S IBNOTC=1 ; don't copy TC modifier from inst to prof bill
  1. D STEP2^IBCCC ; copy/create second bill
  1. ;
  1. I $G(IBHV("IBIFN1"))!(IBCTCOPY=1) D FTPRV^IBCEU5(+$G(IBHV("IBIFN1")),1) ; Change att to rend prov if new prof bill added
  1. S IBV=0,IBAC=1
  1. ;
  1. ; DSS QuadraMed Interface: CPT Sequence and Diagnosis Linkage
  1. I +$G(IBHV("IBIFN1")),$$QMED^IBCU1("CTCOPY^VEJDIBE1",IBHV("IBIFN1")) D CTCOPY^VEJDIBE1(IBHV("IBIFN1"))
  1. Q
  1. ;
  1. CTCOPY2(IBIFN) ; Copy a Reasonable Charges prof bill to create another prof bill if user wants another:
  1. ; - Billing Rate must be Reasonable Charges
  1. ; - Bill being copied must be a prof bill
  1. ; - Procedures are not copied
  1. ;
  1. N IB0,IBU,IBBTYPE,IBBCTO,IBNOCPT,IBCTCOPY,IBX,DIR,DIRUT,DUOUT,DTOUT,X,Y
  1. ;
  1. S IBCTCOPY=2 ; flag indicating the copy function is entered to auto Copy prof->prof
  1. ;
  1. S IB0=$G(^DGCR(399,+$G(IBIFN),0)) Q:IB0="" S IBU=$G(^("U")) Q:'IBU
  1. S IBBTYPE=$S($P(IB0,U,5)<3:"Inpatient",1:"Outpatient")
  1. S IBBCTO=$P(IB0,U,27) I IBBCTO'=2 Q ; prof bills only
  1. ;
  1. I '$$BILLRATE^IBCRU3($P(IB0,U,7),$P(IB0,U,5),$P(IBU,U,1,2),"RC") Q ; copy only reasonable charges bills
  1. ;
  1. I '$G(^DGCR(399,IBIFN,"U1")) Q ; if the current bill has no charges do not allow creation of another one
  1. ;
  1. ; ask if they want a second prof bill
  1. S DIR("?",1)="If answered Yes, the current bill will be copied, without being cancelled,"
  1. S DIR("?",2)="to create another "_$S($$FT^IBCEF(IBIFN)=7:"Dental",1:"Professional")_" bill for the same dates of care.",DIR("?",3)=" "
  1. S DIR("?")="Enter Yes if multiple "_$S($$FT^IBCEF(IBIFN)=7:"Dental",1:"Professional")_" bills are needed for the care provided on this date."
  1. ;JWS;IB*2.0*727
  1. S DIR("A")="Copy this bill to create another "_$S($$FT^IBCEF(IBIFN)=7:"Dental",1:"Professional")_" bill for this date now"
  1. W !! S DIR(0)="Y",DIR("B")="No" D ^DIR I $D(DIRUT)!('Y) Q
  1. ;JWS;IB*2.0*727
  1. W !,"Creating an ",IBBTYPE,$S($$FT^IBCEF(IBIFN)=7:" Dental",1:" Professional")," bill.",!!
  1. ;
  1. S IBIDS(.15)=IBIFN D KVAR^IBCCCB
  1. ;
  1. S IBNOCPT=1
  1. D STEP2^IBCCC ; copy/create second prof bill
  1. S IBV=0,IBAC=1
  1. Q
  1. ;
  1. ;
  1. FINALEOB(IBIFN) ; Returns 1 if user indicates final EOB has been received
  1. ; from prior payer
  1. N DIR,X,Y,IBOK
  1. N IBRETSPLT ;WCJ;727
  1. S IBOK=0
  1. I '$$MCRONBIL^IBEFUNC(IBIFN) D G FEOBQ
  1. . S DIR(0)="YA",DIR("B")="NO",DIR("A")="Has the final EOB been received for this claim?: "
  1. . S DIR("?",1)="COB should not normally be performed until the claim is fully processed by the",DIR("?",2)="prior payer. Enter Y (yes) if the prior payer's final EOB has",DIR("?")="been received"
  1. . D ^DIR K DIR
  1. . I Y'=0 S IBOK=$S(Y>0:1,1:0)
  1. ;
  1. ; In additon to checking if there is only one split MRA, see if that one contained all the lines (aka is complete).
  1. ; true story - This is to correct an issue where a complete MRA came in but the medicare processor accidentally said it was split.
  1. ; that is an extremely rare occurance
  1. ;I $$SPLTMRA^IBCEMU1(IBIFN)=1 D G FEOBQ ;WCJ;IB727
  1. I $$SPLTMRA^IBCEMU1(IBIFN,.IBRETSPLT)=1,'$$SPLIT2^IBCEMU1($O(IBRETSPLT("")),1) D G FEOBQ ;WCJ;IB727
  1. . W !!," Only one MRA has been received for this claim. The MRA on file indicates"
  1. . W !," that it is a 'split MRA' meaning that additional MRA's are needed."
  1. . W !," Processing cannot continue until all MRA's have been received for this claim."
  1. . W ! S DIR(0)="E" D ^DIR K DIR
  1. . Q
  1. ;
  1. ; I $$SPLTMRA^IBCEMU1(IBIFN)>1 D ;WCJ;IB727
  1. I $$SPLTMRA^IBCEMU1(IBIFN,.IBRETSPLT)>1,$$SPLIT2^IBCEMU1($O(IBRETSPLT("")),2)=0 D
  1. .; W !!," At least 2 MRA's have been received for this claim." ;WCJ;IB727
  1. . W !!,$$SPLTMRA^IBCEMU1(IBIFN)," MRA's have been received for this claim." ;WCJ;IB727
  1. . W !,"Please verify that all possible MRA's have been received for",!,"this claim before processing.",!
  1. S DIR(0)="YA",DIR("B")="NO",DIR("A")="Are you sure you want to continue to process this COB?: "
  1. D ^DIR K DIR
  1. W !
  1. S IBOK=$S(Y'=1:0,1:1)
  1. FEOBQ Q IBOK
  1. ;
  1. ;
  1. COBOK(IBIFN) ; Returns 1 if user indicates the COB process should proceed
  1. ; even though the prior payer's bill is still in ENTERED/NOT REVIEWED
  1. ; or REQUEST MRA status (1,2)
  1. N DIR,X,Y,IBOK,IBSTAT
  1. S IBOK=0,IBSTAT=$P($G(^DGCR(399,IBIFN,0)),U,13)
  1. I "^1^2"'[(U_IBSTAT_U) S IBOK=1 G COBOKQ
  1. S DIR(0)="YA",DIR("B")="NO"
  1. S DIR("A",1)="The bill for the prior ("_$P("primary^secondary",U,+$$COBN^IBCEF(IBIFN))_") payer is still in "_$$EXTERNAL^DILFD(399,.13,,IBSTAT)_" status"
  1. S DIR("A")="Are you sure you want to continue to process this COB?: "
  1. D ^DIR K DIR
  1. W !
  1. S IBOK=$S(Y'=1:0,1:1)
  1. COBOKQ Q IBOK
  1. ;