IBNCPBB1 ;ALB/BDB - CONTINUATION OF ECME BACKBILLING ;24-JUN-2003
;;2.0;INTEGRATED BILLING;**384,550,624**;21-MAR-94;Build 10
;;Per VA Directive 6402, this routine should not be modified.
;
Q
;
PROCESS ;
N RES,IBY,IBD,IBRX,IBFIL,IBERR,IBBIL,IBPAT,IBDRUG,IBINS,IBDT,IBQ
S IBERR=0
S IBY=0 F S IBY=$O(IBSEL(IBY)) Q:'IBY D
. S IBD=$G(@IBREF@(IBY)) Q:IBD=""
. S IBRX=$P(IBD,U),IBFIL=+$P(IBD,U,3),IBBIL=$P(IBD,U,6)
. W !,"Submitting Rx# ",$P(IBD,U,2) W:IBFIL "Refill# ",IBFIL W:'IBFIL " (original fill)" W " ..."
. I IBBIL,'$P($G(^DGCR(399,IBBIL,"S")),U,16) D S IBERR=IBERR+1 Q
.. W !," *** Rx# ",$P(IBD,U,2)," was previously billed."
.. W !," Please cancel the Bill No ",$P($G(^DGCR(399,IBBIL,0)),U)," before submitting the claim"
. ; Sensitive Diagnosis Drug/ROI Check
. S IBDRUG=$P(IBD,U,5)
. I $$SENS^IBNCPDR(IBDRUG) D Q:'IBQ
.. S IBPAT=$$FILE^IBRXUTL(IBRX,2)
.. S IBDT=$P(IBD,U,4)
.. I '$$INSUR^IBBAPI(IBPAT,IBDT,"P",.IBANY,1) S IBQ=1 Q
.. S IBINS=+$G(IBANY("IBBAPI","INSUR",1,1))
.. ; If the Date of Service is on or after the Mission Act
.. ; implementation date, set IBQ to 1 and do not check for ROI on file.
.. I $$MACHK^IBNCPDR4(IBDT) S IBQ=1 Q
.. ; If there's an ROI on file (IBQ=1) then D ROICLN^IBNCPDR4.
.. S IBQ=$$ROICHK^IBNCPDR4(IBPAT,IBDRUG,IBINS,IBDT)
.. I IBQ=1 D ROICLN^IBNCPDR4("",IBRX,IBFIL)
.. I 'IBQ S IBERR=IBERR+1
. S RES=$$SUBMIT^IBNCPDPU(IBRX,IBFIL) W " ",$S(+RES=0:"Sent through ECME",1:"Not sent")
. I +RES'=0 W !?5,"*** ECME returned status: ",$$STAT^IBNCPBB(RES) S IBERR=IBERR+1
I 'IBERR W !!,"The selected Rx(s) have been submitted to ECME",!,"for electronic billing"
Q
;
;IBNCPBB1
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HIBNCPBB1 1685 printed Dec 13, 2024@02:24:34 Page 2
IBNCPBB1 ;ALB/BDB - CONTINUATION OF ECME BACKBILLING ;24-JUN-2003
+1 ;;2.0;INTEGRATED BILLING;**384,550,624**;21-MAR-94;Build 10
+2 ;;Per VA Directive 6402, this routine should not be modified.
+3 ;
+4 QUIT
+5 ;
PROCESS ;
+1 NEW RES,IBY,IBD,IBRX,IBFIL,IBERR,IBBIL,IBPAT,IBDRUG,IBINS,IBDT,IBQ
+2 SET IBERR=0
+3 SET IBY=0
FOR
SET IBY=$ORDER(IBSEL(IBY))
if 'IBY
QUIT
Begin DoDot:1
+4 SET IBD=$GET(@IBREF@(IBY))
if IBD=""
QUIT
+5 SET IBRX=$PIECE(IBD,U)
SET IBFIL=+$PIECE(IBD,U,3)
SET IBBIL=$PIECE(IBD,U,6)
+6 WRITE !,"Submitting Rx# ",$PIECE(IBD,U,2)
if IBFIL
WRITE "Refill# ",IBFIL
if 'IBFIL
WRITE " (original fill)"
WRITE " ..."
+7 IF IBBIL
IF '$PIECE($GET(^DGCR(399,IBBIL,"S")),U,16)
Begin DoDot:2
+8 WRITE !," *** Rx# ",$PIECE(IBD,U,2)," was previously billed."
+9 WRITE !," Please cancel the Bill No ",$PIECE($GET(^DGCR(399,IBBIL,0)),U)," before submitting the claim"
End DoDot:2
SET IBERR=IBERR+1
QUIT
+10 ; Sensitive Diagnosis Drug/ROI Check
+11 SET IBDRUG=$PIECE(IBD,U,5)
+12 IF $$SENS^IBNCPDR(IBDRUG)
Begin DoDot:2
+13 SET IBPAT=$$FILE^IBRXUTL(IBRX,2)
+14 SET IBDT=$PIECE(IBD,U,4)
+15 IF '$$INSUR^IBBAPI(IBPAT,IBDT,"P",.IBANY,1)
SET IBQ=1
QUIT
+16 SET IBINS=+$GET(IBANY("IBBAPI","INSUR",1,1))
+17 ; If the Date of Service is on or after the Mission Act
+18 ; implementation date, set IBQ to 1 and do not check for ROI on file.
+19 IF $$MACHK^IBNCPDR4(IBDT)
SET IBQ=1
QUIT
+20 ; If there's an ROI on file (IBQ=1) then D ROICLN^IBNCPDR4.
+21 SET IBQ=$$ROICHK^IBNCPDR4(IBPAT,IBDRUG,IBINS,IBDT)
+22 IF IBQ=1
DO ROICLN^IBNCPDR4("",IBRX,IBFIL)
+23 IF 'IBQ
SET IBERR=IBERR+1
End DoDot:2
if 'IBQ
QUIT
+24 SET RES=$$SUBMIT^IBNCPDPU(IBRX,IBFIL)
WRITE " ",$SELECT(+RES=0:"Sent through ECME",1:"Not sent")
+25 IF +RES'=0
WRITE !?5,"*** ECME returned status: ",$$STAT^IBNCPBB(RES)
SET IBERR=IBERR+1
End DoDot:1
+26 IF 'IBERR
WRITE !!,"The selected Rx(s) have been submitted to ECME",!,"for electronic billing"
+27 QUIT
+28 ;
+29 ;IBNCPBB1