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

IBECEAU.m

Go to the documentation of this file.
  1. IBECEAU ;ALB/CPM - Cancel/Edit/Add... Utilities ; 11-MAR-93
  1. ;;Version 2.0 ; INTEGRATED BILLING ;; 21-MAR-94
  1. ;;Per VHA Directive 10-93-142, this routine should not be modified.
  1. ;
  1. CHECK(TALK) ; Retrieve the institution and MAS Service pointer.
  1. ; Input: TALK -- 1 : do i/o (writes)
  1. ; 0 : no i/o
  1. N IBY,Y S (IBY,Y)=1
  1. D SITE^IBAUTL I Y<1 S IBY=Y W:$G(TALK) !!,"You must define your facility in the IB SITE PARAMETER file before proceeding!",!
  1. I IBY>0 D SERV^IBAUTL2 I IBY<1 W:$G(TALK) !!,"You must define the MAS Service Pointer in the IB SITE PARAMETER file",!,"before proceeding!",!
  1. Q IBY>0
  1. ;
  1. PAUSE ; Go to end of page to pause.
  1. N DIR,DIRUT,DUOUT,DTOUT,X,Y
  1. W ! F Y=$Y:1:21 W !
  1. S DIR("A")="Press RETURN to process the next charge or to return to the list"
  1. S DIR(0)="E" D ^DIR K DIR
  1. Q
  1. ;
  1. INPT(DAYS) ; Return a description for Billing Clock days.
  1. ; Input: DAYS -- Number of days in a billing clock
  1. ; Output: "1st", "2nd", "3rd", "4th"
  1. Q $S(DAYS>270:"4th",DAYS>180:"3rd",DAYS>90:"2nd",1:"1st")
  1. ;
  1. LAST(PAR) ; Find last action filed for any parent action.
  1. ; Input: PAR -- Parent IB Action
  1. ; Output: Last action filed for parent (or parent if none)
  1. N IBL,IBLDT,IBLAST
  1. S IBLAST="",IBLDT=$O(^IB("APDT",PAR,"")) I +IBLDT S IBL=0 F S IBL=$O(^IB("APDT",PAR,IBLDT,IBL)) Q:'IBL S IBLAST=IBL
  1. Q $S(IBLAST:IBLAST,1:PAR)
  1. ;
  1. BFO(DFN,DATE) ; Patient Billed For OPT Copay on a specified date?
  1. ; Input: DFN -- Pointer to the patient in file #2
  1. ; DATE -- Date of the Outpatient Visit
  1. ; Output: 0 -- Not billed the OPT copay on the visit date
  1. ; >0 -- Pointer to charge in file #350 that was billed
  1. N IBATYP,IBATYPN,IBL,IBND,IBN,Y
  1. I '$G(DFN)!'$G(DATE) G BFOQ
  1. S IBN=0 F S IBN=$O(^IB("AFDT",DFN,-DATE,IBN)) Q:'IBN D I $P(IBATYPN,"^",11)=4,"^1^3^"[("^"_$P(IBATYP,"^",5)_"^"),"^1^2^3^4^8^20^"[("^"_+$P(IBND,"^",5)_"^") S Y=IBL Q
  1. .S IBL=$$LAST(+$P($G(^IB(IBN,0)),"^",9)),IBND=$G(^IB(IBL,0))
  1. .S IBATYP=$G(^IBE(350.1,+$P(IBND,"^",3),0))
  1. .S IBATYPN=$G(^IBE(350.1,+$P(IBATYP,"^",9),0))
  1. BFOQ Q +$G(Y)
  1. ;
  1. CNP(DFN,DATE) ; Did the patient have a C&P Exam on a specified date?
  1. ; Input: DFN -- Pointer to the patient in file #2
  1. ; DATE -- Date of the Outpatient Visit
  1. ; Output: 0 -- Patient did not have a C&P Exam on the visit date
  1. ; 1 -- Patient had a C&P Exam on the visit date
  1. N I,IBD,IBSD,Y
  1. I '$G(DFN)!'$G(DATE) G CNPQ
  1. ; - check scheduled appointments
  1. S IBD=DATE F S IBD=$O(^DPT(DFN,"S",IBD)) Q:IBD=""!(IBD>(DATE+.9999)) S IBSD=$G(^(IBD,0)) I IBSD,$P(IBSD,"^",16)=1,$P($$STATUS^SDAM1(DFN,IBD,+IBSD,IBSD),";")<3 S Y=1 G CNPQ
  1. ; - check stop codes
  1. S IBD=$G(^SDV("ADT",DFN,DATE)) G:'IBD CNPQ
  1. S I=0 F S I=$O(^SDV(IBD,"CS",I)) Q:'I I $P($G(^(I,0)),"^",5)=1 S Y=1 Q
  1. CNPQ Q +$G(Y)
  1. ;
  1. HDR(OPT) ; Display the header for an action
  1. ; Input: OPT -- Action Header
  1. N ADD,HDR S ADD=OPT="A D D"
  1. D CLEAR^VALM1 S IBY=1,HDR=OPT_" A C H A R G E"
  1. I 'ADD S IBIDX=$G(^TMP("IBACMIDX",$J,IBNBR)),IBN=+$P(IBIDX,"^",4),IBND=$G(^IB(IBN,0))
  1. W !?(80-$L(HDR)\2),HDR W:'ADD !?29,"Processing Charge #",IBNBR
  1. W !,$$LINE,!?3,"Name: ",$P(IBNAM,"^") W:'ADD ?41,"Type: ",$P(IBIDX,"^",3)
  1. I ADD W ?41,"** " W:'IBCLDA "NO " W "ACTIVE BILLING CLOCK **"
  1. W !?5,"ID: ",$P(IBNAM,"^",2) W:'ADD ?42,"Amt:",$P(IBIDX,"^",5)," (",$P(IBIDX,"^",6),")"
  1. I ADD,IBCLDA W ?44,"Clock Begin Date: ",$$DAT1^IBOUTL(IBCLDT)
  1. W !,$$LINE,!
  1. Q
  1. ;
  1. LINE() ; Write a line.
  1. Q $TR($J("",80)," ","-")
  1. ;
  1. CLOCK(IBDOL,IBDAYPR,IBDAY) ; Display and update clock data.
  1. ; Input: IBDOL -- Dollar amount to add or subtract
  1. ; IBDAYPR -- Existing number of inpatient days
  1. ; IBDAY -- Inpatient days to add or subtract
  1. ; Also assumes that IBCLST,IBNAM, IBCLDA, and IBXA are defined.
  1. D CLDSP^IBECEAU1(IBCLST,IBNAM) I $P(IBCLST,"^",4)'=1 W !,"** Please note that an active billing clock was not selected for updating **"
  1. I IBXA=1!(IBXA=2) D CLAMT^IBECEAU1(IBCLST,IBDOL,IBCLDA)
  1. I IBXA=3 D CLINP^IBECEAU1(IBDAYPR,IBDAY,IBCLDA)
  1. Q