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

IBCNSBL2.m

Go to the documentation of this file.
  1. IBCNSBL2 ;ALB/CPM - 'BILL NEXT PAYOR' BULLETIN ;08-AUG-96
  1. ;;2.0;INTEGRATED BILLING;**52,80,153,240,432,568**;21-MAR-94;Build 40
  1. ;;Per VA Directive 6402, this routine should not be modified.
  1. ;
  1. EOB(IBIFN,IBORIG,IBPYMT,IBTXT) ; determine if there may be another payer for this claim that should be billed
  1. ; in general the EOB of the current bill is required to be sent with the next TP bill in the series
  1. ; if there is another Third Party Payer then returns true, if any other payer (including patient) then set array
  1. ;
  1. ; Input: IBIFN -- Pointer to AR (file #430), or Claim (file #399)
  1. ; IBORIG -- Original amount of the claim
  1. ; IBPYMT -- Total Amount paid on the claim
  1. ;
  1. ; Output: IBTXT -- Array, pass by reference, if needed
  1. ; If a another payer (third party or patient) for the claim can be found,
  1. ; this array will contain the text that explains who the next payer is
  1. ;
  1. ; Returns: 0 -- no need to forward EOB (no next Third Party payer found or payment=>amount due)
  1. ; 'true^Next payer' -- if the EOB of the bill needs to be forwarded for inclusion in the next bill,
  1. ; generally there must be another payer for the bill that is
  1. ; third party, non-patient, and payment was not the amount due
  1. ;
  1. N X,IB,IBPOL,IBCS,IBARCAT,IBSEC,IBRETURN,IBSEQ,IBINS S IBRETURN=0
  1. I '$G(IBIFN) G EOBQ
  1. I $G(^PRCA(430,IBIFN,0))="" G EOBQ
  1. I '$G(IBORIG) G EOBQ
  1. I $G(IBPYMT)="" G EOBQ
  1. ;
  1. S IB=$G(^DGCR(399,IBIFN,0)) I IB="" G EOBQ
  1. ;
  1. ; - quit if there is no remaining balance on the bill
  1. I IBPYMT'<IBORIG G EOBQ
  1. ;
  1. S IBARCAT=$P($G(^DGCR(399.3,+$P(IB,"^",7),0)),"^",6) I 'IBARCAT G EOBQ
  1. ;
  1. ; for Emergency/Humanitarian Reimb. IB*2.0*568
  1. I IBARCAT=46 D G EOBQ
  1. . S IBRETURN="2^Emergency/Humanitarian Reimb."
  1. . S IBTXT(14)="You should balance bill this patient using the appropriate cost-based rate type."
  1. ;
  1. ; for Ineligible Hosp. Reimb. IB*2.0*568
  1. I IBARCAT=47 D G EOBQ
  1. . S IBRETURN="2^Ineligible Hosp. Reimb."
  1. . S IBTXT(14)="You should balance bill this patient using the appropriate cost-based rate type."
  1. ;
  1. ; - for Champva third party claims, bill the Champva Center next
  1. I IBARCAT=28 D G EOBQ
  1. . S IBTXT(14)="You should prepare a claim to be sent to the CHAMPVA Center.",IBRETURN="1^CHAMPVA Center"
  1. ;
  1. ; - for Tricare third party claims, next bill Tricare or the patient
  1. I IBARCAT=32 D G EOBQ
  1. . ;
  1. . ; - third party bill went to Tricare Supplemental carrier, bill patient next
  1. . S IBSEQ=$P($G(^DGCR(399,IBIFN,0)),U,21),IBSEQ=$S(IBSEQ="P":"I1",IBSEQ="S":"I2",IBSEQ="T":"I3",1:-1)
  1. . S IBPOL=$G(^DGCR(399,IBIFN,IBSEQ))
  1. . S IBCS=$D(^IBE(355.1,"D","CS",+$P($G(^IBA(355.3,+$P(IBPOL,"^",18),0)),"^",9)))>0
  1. . I IBCS D Q
  1. .. S IBTXT(14)="This claim was sent to the TRICARE Supplemental insurance carrier."
  1. .. S IBTXT(15)="You should send a copayment charge to the patient."
  1. . ;
  1. . ; - otherwise third party bill went to patients Reimb. Ins carrier, bill the tricare FI next
  1. . S IBRETURN="1^TRICARE Fiscal Intermediary"
  1. . S IBTXT(14)="You should prepare a claim to send to the TRICARE Fiscal Intermediary."
  1. ;
  1. ; - for Tricare claims, bill the patient or Tricare supplemental policy
  1. I IBARCAT=30 D G EOBQ
  1. . ;
  1. . ; - if the patient has a Tricare supplemental policy, bill it
  1. . I $$CHPSUP(+$P(IB,"^",2)) D Q
  1. .. S IBRETURN="1^TRICARE Supplemental policy"
  1. .. S IBTXT(14)="The patient has a TRICARE Supplemental policy."
  1. .. S IBTXT(15)="You should prepare a claim to be sent to that carrier."
  1. . ;
  1. . ; - otherwise, bill the patient
  1. . S IBTXT(14)="You should send a copayment charge to the patient."
  1. ;
  1. ; - all other bills: if there is a next payer in the series then a bill needs to be created for that payer
  1. S IBSEQ=$P($G(^DGCR(399,IBIFN,0)),U,21),IBSEQ=$S(IBSEQ="P":2,IBSEQ="S":3,1:"")
  1. I +IBSEQ S IBINS=$P($G(^DGCR(399,IBIFN,"M")),U,IBSEQ) I +IBINS D
  1. . S IBRETURN=+IBINS_U_$P($G(^DIC(36,+IBINS,0)),U,1)
  1. . S IBTXT(14)="There is a "_$S(IBSEQ=2:"secondary",1:"tertiary")_" payor associated with this claim."
  1. . S IBTXT(15)="You may need to prepare a claim to be sent to "_$P(IBRETURN,U,2)_"."
  1. ;
  1. EOBQ Q IBRETURN
  1. ;
  1. BULL(IBIFN,IBORIG,IBPYMT) ; Generate bulletin detailing next payer for a claim, if any
  1. ;
  1. ; Input: IBIFN -- Pointer to AR (file #430), or Claim (file #399)
  1. ; IBORIG -- Original amount of the claim
  1. ; IBPYMT -- Total Amount paid on the claim
  1. ;
  1. ; Output: Bulletin: Mail Group MEANS TEST BILLING MAIL GROUP: IB MEANS TEST (350.9,.11)
  1. ; If a secondary payor for the claim can be found, a bulletin will be sent
  1. ; to the billing unit to alert them to forward the claim to that payor.
  1. ;
  1. N X,IB,IBX,IBTXT,IBP,IBGRP,IBWLF ;WCJ;IB*2.0*432
  1. ;
  1. S IBX=$$EOB($G(IBIFN),$G(IBORIG),$G(IBPYMT),.IBTXT) I '$D(IBTXT) D WLCK(IBIFN) G BULLQ
  1. ;
  1. ; WCJ;IB*2.0*432;Trigger commercial auto processing.
  1. ; This will replace the bulletin when activated.
  1. ; (not using a master switch just yet so it's automatically activated)
  1. ;I $$GET1^DIQ(350.9,1,8.18) D G BULLQ
  1. ; check if these should go directly to the worklist
  1. S IBWLF=$S('IBX:1,".CHAMPVA Center.TRICARE Fiscal Intermediary.TRICARE Supplemental policy."[("."_$P(IBX,U,2)_"."):1,".Ineligible Hosp. Reimb..Emergency/Humanitarian Reimb.."[("."_$P(IBX,U,2)_"."):2,1:0)
  1. D EN^IBCAPP(IBIFN,IBORIG,IBPYMT,IBWLF)
  1. G BULLQ
  1. ; WCJ;IB*2.0*432;end changes
  1. ;
  1. S IB=$G(^DGCR(399,IBIFN,0)) I IB="" G BULLQ
  1. S IBP=$$PT^IBEFUNC(+$P(IB,"^",2))
  1. ;
  1. ; - create remainder of bulletin
  1. N XMDUZ,XMTEXT,XMY,XMSUB
  1. S XMSUB="Notification of Subsequent Payor"
  1. S XMDUZ="INTEGRATED BILLING PACKAGE",XMTEXT="IBTXT("
  1. K XMY S XMY(DUZ)=""
  1. ;
  1. S IBTXT(1)="A payment has been made on the following claim, which has been identified"
  1. S IBTXT(2)="as potentially having a subsequent payor:"
  1. S IBTXT(3)=" "
  1. S IBTXT(4)=" Bill Number: "_$P($G(^PRCA(430,IBIFN,0)),"^")
  1. S IBTXT(5)=" Patient: "_$E($P(IBP,"^"),1,30)_" Pt. Id: "_$P(IBP,"^",2)
  1. S IBTXT(6)=" Bill Type: "_$P($G(^DGCR(399.3,+$P(IB,"^",7),0)),"^")
  1. S IBTXT(7)=" Orig Amount: $"_$J(IBORIG,0,2)
  1. S IBTXT(8)=" Amount Paid: $"_$J(IBPYMT,0,2)
  1. S IBTXT(9)=" "
  1. ;
  1. S IBX=$G(^DGCR(399,IBIFN,0))
  1. S IBTXT(10)="Bill Sequence: "_$$EXSET^IBEFUNC($P(IBX,U,21),399,.21)
  1. S IBTXT(11)=" Bill Payer: "_$E($P($G(^DIC(36,+$G(^DGCR(399,IBIFN,"MP")),0)),U,1),1,20)
  1. ;
  1. S IBX=$G(^DGCR(399,IBIFN,"M"))
  1. I IBX S IBTXT(10)=IBTXT(10)_$J("",(40-$L(IBTXT(10))))_" Primary Carrier: "_$E($P($G(^DIC(36,+IBX,0)),U,1),1,20)
  1. I +$P(IBX,U,2) S IBTXT(11)=IBTXT(11)_$J("",(40-$L(IBTXT(11))))_"Secondary Carrier: "_$E($P($G(^DIC(36,+$P(IBX,U,2),0)),U,1),1,20)
  1. I +$P(IBX,U,3) S IBTXT(12)=$J("",40)_" Tertiary Carrier: "_$E($P($G(^DIC(36,+$P(IBX,U,3),0)),U,1),1,20)
  1. S IBTXT(13)=" "
  1. ;
  1. ; - send to the Means Test billing mailgroup (for now)
  1. S IBGRP=$P($G(^XMB(3.8,+$P($G(^IBE(350.9,1,0)),"^",11),0)),"^")
  1. I IBGRP]"" S XMY("G."_IBGRP_"@"_^XMB("NETNAME"))=""
  1. ;
  1. D ^XMD
  1. ;
  1. BULLQ Q
  1. ;
  1. ;
  1. CHPSUP(DFN) ; Does the patient have a TRICARE Supplemental policy?
  1. ; Input: DFN -- Pointer to the patient in file #2
  1. ; Output: 0 - Has no TRICARE Supplemental policy
  1. ; 1 - Yes, patient has such a policy.
  1. ;
  1. N X,IBINS,IBCS
  1. D ALL^IBCNS1(DFN,"IBINS",1,DT)
  1. S (IBCS,X)=0 F S X=$O(IBINS(X)) Q:'X D Q:IBCS
  1. .I $D(^IBE(355.1,"D","CS",+$P($G(IBINS(X,355.3)),"^",9))) S IBCS=1
  1. Q IBCS
  1. ;
  1. WLCK(IBIFN) ; does this claim need to be removed from the worklist?
  1. ; IBIFN = claim ien, if collected/closed and NO subsequent payer, remove from worklist if there
  1. ;
  1. N X
  1. Q:$P($$BILL^RCJIBFN2(IBIFN),U,2)'=22 ; AR status DBIA 1452
  1. Q:'$D(^DGCR(399,"CAP",1,IBIFN)) ; not on worklist
  1. S X=$$WLRMVF^IBCECOB1(IBIFN,"RM",1)
  1. Q