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

IBOHCT.m

Go to the documentation of this file.
  1. IBOHCT ;ALB/EMG - CHECK FOR IB CHARGES ON HOLD ; MAY 2 1997
  1. ;;2.0;INTEGRATED BILLING;**70,95,347,622**;21-MAR-94;Build 35
  1. ;;Per VA Directive 6402, this routine should not be modified.
  1. ;
  1. FIND(DFN,IBTRN) ; find all related IB charges on hold for episodes of care
  1. ; for this Claims Tracking entry with Reason Not Billable
  1. ; once IB Charge is found, release Charge On Hold to AR
  1. ; so patient can be billed.
  1. ;
  1. ; Input: DFN -- pointer to the patient in file #2
  1. ; IBTRN -- ien of Claims Tracking entry
  1. ;
  1. N IBQ
  1. I '$G(DFN)!('$G(IBTRN)) G ALLQ
  1. D HOME^%ZIS
  1. ;
  1. N X,Y,Y1,IBA,IBX,IBCTR,IBEDT,IBEND,IBNOS,IBSEQNO,IBDUZ,DP,DL
  1. ;
  1. S IBCT=$G(^IBT(356,IBTRN,0)),IBEDT=$P($P(IBCT,"^",6),"."),IBI=0
  1. I $P(IBCT,"^",18)=4 D RXCHG,REL G ALLQ
  1. ;
  1. ;
  1. ; - find related inpatient/outpatient patient charges on hold
  1. S (IBNUM,Y)=0 F S Y=$O(^IB("AFDT",DFN,-IBEDT,Y)) Q:'Y D
  1. .S Y1=0 F S Y1=$O(^IB("AF",Y,Y1)) Q:'Y1 D
  1. ..Q:'$D(^IB(Y1,0)) S IBX=^(0)
  1. ..I $P(IBX,"^",5)'=8 Q
  1. ..S IBNUM=IBNUM+1,IBA(IBNUM)=Y1
  1. ..Q
  1. .Q
  1. ;
  1. REL ; allow user to select IB charges to pass to Accounts Receivable
  1. ;
  1. I '$G(IBNUM) G ALLQ
  1. W !!,"The following IB Action"_$S(IBNUM>2:"s",1:"")_", related to this CT entry, ",$S(IBNUM>2:"are",1:"is")," ON HOLD:" D HDR
  1. S IBQ=0 F IBNUM=1:1 Q:'$D(IBA(IBNUM)) D:'(IBNUM#15) Q:IBQ S IBN=IBA(IBNUM) D LST
  1. . R !,"Enter RETURN to continue or '^' to stop: ",X:DTIME S:X["^"!('$T) IBQ=1 Q
  1. ;
  1. ; prompt user to select IB Actions
  1. S DIR(0)="LA^1:"_(IBNUM-1)_"^",DIR("A")="Select IB Action"_$E("s",IBNUM>2)_" (REF #) to release to Accounts Receivable (or '^' to exit): ",DIR("?")="^D HELP^IBRREL"
  1. W ! D ^DIR K DIR I $D(DIRUT)!($D(DUOUT)) Q
  1. ;
  1. S IBRANGE=Y,IBSEQNO=1,IBDUZ=DUZ
  1. S DIR(0)="Y",DIR("A")="OK to pass "_$S($P(Y,",",2):"these charges",1:"this charge")_" to Accounts Receivable"
  1. D ^DIR K DIR I 'Y!($D(DIRUT))!($D(DUOUT)) G ALLQ
  1. ;
  1. ; pass charges to Accounts Receivable
  1. W !!,"Passing charges to Accounts Receivable...",! D HDR
  1. F IBCTR=1:1 S IBNUM=$P(IBRANGE,",",IBCTR) Q:'IBNUM I $D(IBA(IBNUM)) S IBNOS=IBA(IBNUM) D ^IBR,ERR:Y<1 I Y>0 S IBN=IBA(IBNUM) D LST
  1. W !!,"The charge"_$E("s",$P(IBRANGE,",",2)>0)_" listed above "_$S($P(IBRANGE,",",2):"have",1:"has")_" been passed to Accounts Receivable.",!
  1. ;
  1. W ! S DIR(0)="E" D ^DIR K DIR G ALLQ
  1. ;
  1. ALLQ K IBC,IBCRG,IBCT,IBCTR,IBEDT,IBEND,IBI,IBLINE,IBN,IBND
  1. K IBNOS,IBNUM,IBOHD,IBQ,IBRANGE,IBRXN,IBRXDT,IBRXEND,IBSEQNO
  1. K DIRUT,DUOUT
  1. Q
  1. ;
  1. ;
  1. HDR ; Display charge header.
  1. N IBLINE S $P(IBLINE,"=",81)=""
  1. W !,IBLINE,!," REF Action ID Bill Type",?42,"Bill #",?51,"Fr/Fl Dt",?61,"To/Rls Dt",?73,"Charge"
  1. W !,IBLINE Q
  1. ;
  1. LST ; Display individual IB Action.
  1. N IBND,IBND1,IBRXN,IBRX,IBRF,IBRDT,IENS
  1. S IBND=$G(^IB(IBN,0)),IBND1=$G(^IB(IBN,1)),(IBRXN,IBRX,IBRF,IBRDT)=0
  1. I $P(IBND,"^",4)["52:" S IBRXN=$P($P(IBND,"^",4),":",2),IBRX=$P($P(IBND,"^",8),"-"),IBRF=$P($P(IBND,"^",4),":",3)
  1. I $P(IBND,"^",4)["52:" D
  1. .I IBRF>0 S IENS=+IBRF,IBRDT=$$SUBFILE^IBRXUTL(+IBRXN,+IENS,52,.01)
  1. .E S IENS=+IBRXN,IBRDT=$$FILE^IBRXUTL(+IENS,22)
  1. W !?1,$J(IBNUM,2),?7,$J(+IBND,9)
  1. W ?18,$S(IBRXN>0:"Rx #: "_IBRX_$S(IBRF>0:"("_IBRF_")",1:""),1:$P($G(^IBE(350.1,+$P(IBND,"^",3),0)),"^",8))
  1. W ?42,$P($P(IBND,"^",11),"-",2)
  1. W ?51,$$DAT1^IBOUTL($S(IBRXN>0:IBRDT,1:$P(IBND,"^",14)))
  1. W ?61,$$DAT1^IBOUTL($S($P(IBND,"^",15)'="":($P(IBND,"^",15)),1:$P(IBND1,"^",2)))
  1. W ?70,$J(+$P(IBND,"^",7),9,2)
  1. Q
  1. ;
  1. RXCHG ; - find related rx copay's on hold in file 350
  1. N IBRXN,IBRXBN,IBRXEND,IBRXDT,IBCRG,IBC
  1. S IBNUM=0
  1. S IBRXEND=+IBEDT+.999999 F S IBEDT=$O(^IB("APTDT",DFN,IBEDT)) Q:'IBEDT!(IBEDT>IBRXEND) S Y1=0 F S Y1=$O(^IB("APTDT",DFN,IBEDT,Y1)) Q:'Y1 S IBX=^IB(Y1,0),IBOHD=$P($G(^IB(Y1,1)),"^",6) D
  1. .I $P(IBX,"^",5)'=8 Q
  1. .S IBNUM=IBNUM+1,IBA(IBNUM)=Y1 Q
  1. Q
  1. ;
  1. ERR ; display error message
  1. W !,?5,"Error encountered - a separate bulletin has been posted"
  1. Q