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

IBCEMQA.m

Go to the documentation of this file.
  1. IBCEMQA ;DAOU/ESG - MRA QUIET BILL AUTHORIZATION ;25-MAR-2003
  1. ;;2.0;INTEGRATED BILLING;**155,432,592**;21-MAR-94;Build 58
  1. ;;Per VA Directive 6402, this routine should not be modified.
  1. ;
  1. Q ; must be called at proper entry point
  1. ;
  1. ;
  1. AUTOCOB(IBIFN,IBEOB,ERRMSG,IBMRANOT,IBNCN) ; This procedure mimics and automates the
  1. ; Process COB action on the MRA management screen. This is intended
  1. ; to be called in background mode (no user interface).
  1. ;
  1. ; Input
  1. ; IBIFN - bill#
  1. ; IBEOB - ien of entry in file 361.1 (MRA)
  1. ; IBMRANOT - 1 indicates process is NOT from MRA
  1. ; IBNCN - By Reference. Need to pass back the new claim number
  1. ;
  1. ; Output
  1. ; ERRMSG - optional output parameter, passed by reference
  1. ; - error message text
  1. ;
  1. ;JWS;IB*2.0*592; added IBQUIT to new - SQA
  1. NEW MRADATA,IB364,IBCBASK,IBCBCOPY,IBCAN,IBIFNH,IBAUTO,IBDA,IBQUIT
  1. NEW IBCE,IBSILENT,IBPRCOB,IBERRMSG,IBSTSM
  1. NEW IBCOB,IBCOBIL,IBCOBN,IBINS,IBINSN,IBINSOLD,IBMRAIO,IBMRAO,IBNMOLD
  1. S (IBIFN,IBIFNH)=+$G(IBIFN),IBEOB=+$G(IBEOB),ERRMSG=""
  1. ;
  1. S MRADATA=$G(^IBM(361.1,IBEOB,0))
  1. ; IB*2.0*432 - Add auto-process of non-MRA's
  1. I $G(IBMRANOT)'=1,$P(MRADATA,U,1)'=IBIFN S ERRMSG="Incorrect Bill or MRA EOB" G AUCOBX
  1. I $G(IBMRANOT)'=1,$P(MRADATA,U,4)'=1 S ERRMSG="EOB is not a Medicare MRA" G AUCOBX
  1. S IB364=+$P(MRADATA,U,19)
  1. I $G(IBMRANOT)'=1,'IB364 S ERRMSG="Missing or incorrect Transmission record" G AUCOBX
  1. ;
  1. I '$P($G(^DGCR(399,IBIFN,"I"_($$COBN^IBCEF(IBIFN)+1))),U,1) D G AUCOBX
  1. . S ERRMSG="No next payer for this bill"
  1. . Q
  1. ;
  1. ; Make sure that Medicare WNR is the current insurance for this bill if MRA processing
  1. I $G(IBMRANOT)'=1,'$$WNRBILL^IBEFUNC(IBIFN) D G AUCOBX
  1. . S ERRMSG="Medicare (WNR) is not the current payer for this bill"
  1. . Q
  1. ;
  1. ; Set variable flags for use in IBCCCB/IBCCC2
  1. S (IBCBASK,IBCBCOPY,IBCAN,IBAUTO,IBCE("EDI"),IBSILENT,IBPRCOB)=1
  1. ; IB*2.0*432 - if non-MRA processing, set Secondary/Tertiary Silent mode=1
  1. S:$G(IBMRANOT)=1 IBSTSM=1
  1. S IBDA=IBEOB
  1. ;
  1. D CHKB1^IBCCCB
  1. ;
  1. I $G(IBMRANOT)=1 S IBNCN=$S($G(IBCE("EDI","NEW")):IBCE("EDI","NEW"),1:$G(IBHV("IBIFN1")))
  1. S IBIFN=IBIFNH ; restore bill#
  1. I $G(IBERRMSG)'="" S ERRMSG=IBERRMSG G AUCOBX ; error message
  1. D UPDEDI^IBCEM(IB364,"Z") ; status updates
  1. AUCOBX ;
  1. Q
  1. ;
  1. ;
  1. AUTH(IBIFN,ERRMSG,IBMRANOT) ; Entry Point
  1. ; This procedure's job is to authorize this bill. The manual
  1. ; process to authorize a bill is found in routine IBCB1. This
  1. ; routine borrows heavily from that routine.
  1. ;
  1. ; *** Any changes here should be considered also in IBCB1 ***
  1. ;
  1. ; This routine is called when receiving an incoming MRA from
  1. ; Medicare. If that MRA/EOB meets certain criteria, then the bill
  1. ; will become a secondary bill and we will try to authorize it (using
  1. ; this procedure) and put it in the EDI queue ready for extract.
  1. ;
  1. ; Input
  1. ; IBIFN - internal bill#
  1. ; IBMRANOT - 1 indicates process is NOT from MRA
  1. ;
  1. ; Output
  1. ; ERRMSG - optional output parameter, passed by reference
  1. ; - error message text
  1. ;
  1. NEW CST,IBTXSTAT,IB364,PRCASV,DFN,STSMSG
  1. NEW DIE,DA,DR,IBYY
  1. ;
  1. ; Check the bill, make sure the current status is valid
  1. S IBIFN=+$G(IBIFN),ERRMSG=""
  1. S CST=$P($G(^DGCR(399,IBIFN,0)),U,13)
  1. I CST="" S ERRMSG="Bill has no current status defined." G AUTHX
  1. ; IB*2.0*432 add auto-processing of non-MRA's
  1. I $G(IBMRANOT)'=1,CST'=2 S ERRMSG="This bill's status is "_$$GET1^DIQ(399,IBIFN_",",.13)_". It must be REQUEST MRA." G AUTHX
  1. ;
  1. ; authorize the bill quietly
  1. S DIE=399,DA=IBIFN,DR="[IB STATUS]",IBYY="@902" D ^DIE
  1. ;
  1. ; Update the review status for all EOB's on file
  1. D STAT^IBCEMU2(IBIFN,3) ; Accepted - Complete EOB
  1. ;
  1. ; Checks for need to add any codes to bill for EDI (call in quiet mode)
  1. D AUTOCK^IBCEU2(IBIFN,1)
  1. ;
  1. ; Calculate transmittable status
  1. ; 0 = not transmittable
  1. ; 1 = yes, live transmittable
  1. ; 2 = yes, test transmittable
  1. ; P432 add MRANOT flag so it will create new entry in trans file for non-MRA's
  1. S IBTXSTAT=+$$TXMT^IBCEF4(IBIFN,,$G(IBMRANOT))
  1. ;
  1. ; If transmittable, add this bill to the bill transmission file
  1. I IBTXSTAT D I ERRMSG'="" G AUTHX
  1. . S IB364=$$ADDTBILL^IBCB1(IBIFN,IBTXSTAT)
  1. . I '$P(IB364,U,3) S ERRMSG="Error loading bill into transmit file."
  1. . Q
  1. ;
  1. ; Pass completed bill to Accounts Receivable (quietly)
  1. D ARPASS^IBCB1(IBIFN,0)
  1. I '$G(PRCASV("OKAY")) S ERRMSG="Error while passing bill to A/R." G AUTHX
  1. ;
  1. ; Find and process any IB charges on hold
  1. S DFN=+$P($G(^DGCR(399,IBIFN,0)),U,2)
  1. D FIND^IBOHCK(DFN,IBIFN)
  1. ;
  1. ; If transmittable, check for unreviewed items & update 364 status
  1. I IBTXSTAT D
  1. . S STSMSG=$$STATUS^IBCEF4(IBIFN)
  1. . I $P(STSMSG,U,1) D UPDEDI^IBCEM($P(STSMSG,U,1),"E")
  1. . I $P(STSMSG,U,2),$P(STSMSG,U,2)'=$P(STSMSG,U,1) D UPDEDI^IBCEM($P(STSMSG,U,2),"E")
  1. . Q
  1. ;
  1. AUTHX ;
  1. Q
  1. ;