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

IBNCPBB1.m

Go to the documentation of this file.
  1. IBNCPBB1 ;ALB/BDB - CONTINUATION OF ECME BACKBILLING ;24-JUN-2003
  1. ;;2.0;INTEGRATED BILLING;**384,550,624**;21-MAR-94;Build 10
  1. ;;Per VA Directive 6402, this routine should not be modified.
  1. ;
  1. Q
  1. ;
  1. PROCESS ;
  1. N RES,IBY,IBD,IBRX,IBFIL,IBERR,IBBIL,IBPAT,IBDRUG,IBINS,IBDT,IBQ
  1. S IBERR=0
  1. S IBY=0 F S IBY=$O(IBSEL(IBY)) Q:'IBY D
  1. . S IBD=$G(@IBREF@(IBY)) Q:IBD=""
  1. . S IBRX=$P(IBD,U),IBFIL=+$P(IBD,U,3),IBBIL=$P(IBD,U,6)
  1. . W !,"Submitting Rx# ",$P(IBD,U,2) W:IBFIL "Refill# ",IBFIL W:'IBFIL " (original fill)" W " ..."
  1. . I IBBIL,'$P($G(^DGCR(399,IBBIL,"S")),U,16) D S IBERR=IBERR+1 Q
  1. .. W !," *** Rx# ",$P(IBD,U,2)," was previously billed."
  1. .. W !," Please cancel the Bill No ",$P($G(^DGCR(399,IBBIL,0)),U)," before submitting the claim"
  1. . ; Sensitive Diagnosis Drug/ROI Check
  1. . S IBDRUG=$P(IBD,U,5)
  1. . I $$SENS^IBNCPDR(IBDRUG) D Q:'IBQ
  1. .. S IBPAT=$$FILE^IBRXUTL(IBRX,2)
  1. .. S IBDT=$P(IBD,U,4)
  1. .. I '$$INSUR^IBBAPI(IBPAT,IBDT,"P",.IBANY,1) S IBQ=1 Q
  1. .. S IBINS=+$G(IBANY("IBBAPI","INSUR",1,1))
  1. .. ; If the Date of Service is on or after the Mission Act
  1. .. ; implementation date, set IBQ to 1 and do not check for ROI on file.
  1. .. I $$MACHK^IBNCPDR4(IBDT) S IBQ=1 Q
  1. .. ; If there's an ROI on file (IBQ=1) then D ROICLN^IBNCPDR4.
  1. .. S IBQ=$$ROICHK^IBNCPDR4(IBPAT,IBDRUG,IBINS,IBDT)
  1. .. I IBQ=1 D ROICLN^IBNCPDR4("",IBRX,IBFIL)
  1. .. I 'IBQ S IBERR=IBERR+1
  1. . S RES=$$SUBMIT^IBNCPDPU(IBRX,IBFIL) W " ",$S(+RES=0:"Sent through ECME",1:"Not sent")
  1. . I +RES'=0 W !?5,"*** ECME returned status: ",$$STAT^IBNCPBB(RES) S IBERR=IBERR+1
  1. I 'IBERR W !!,"The selected Rx(s) have been submitted to ECME",!,"for electronic billing"
  1. Q
  1. ;
  1. ;IBNCPBB1