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

IBRUTL.m

Go to the documentation of this file.
  1. IBRUTL ;ALB/CPM - INTEGRATED BILLING - A/R INTERFACE UTILITIES ; 03-MAR-92
  1. ;;Version 2.0 ; INTEGRATED BILLING ;; 21-MAR-94
  1. ;;Per VHA Directive 10-93-142, this routine should not be modified.
  1. ;
  1. IB(IEN,RETN) ; Are there any IB Actions on hold for this bill?
  1. ; Input: IEN -- ien of Bill(#399), A/R(#430)
  1. ; RETN (opt) -- Want array of IB Actions? (1-Yes,0-No)
  1. ; if yes, returns IBA(num)=ibn
  1. ; Returns: 1 -- Yes, 0 -- No
  1. ;
  1. N ATYPE,BTYPE,BILLS,DFN,IBFR,IB0,IBTO,IBU,IBN,IBND,IBNUM,IBOK
  1. S:'$D(RETN) RETN=0 S BILLS=0
  1. ;
  1. ; - determine patient, bill type and billing dates
  1. S IB0=$G(^DGCR(399,IEN,0)),IBU=$G(^("U")),DFN=+$P(IB0,"^",2)
  1. S BTYPE=$S(+$P(IB0,"^",5)<3:"I",1:"O"),IBFR=+IBU,IBTO=$P(IBU,"^",2)
  1. ;
  1. ; - loop through all bills on hold, and set flag if there is an
  1. ; - IB Action of the same type as the UB-82 which has been billed
  1. ; - within the statement dates of the UB-82. Store all actions
  1. ; - in the array IBA if required.
  1. S (IBN,IBNUM)=0 F S IBN=$O(^IB("AH",DFN,IBN)) Q:'IBN D I IBOK Q:'RETN S IBNUM=IBNUM+1,IBA(IBNUM)=IBN
  1. . S IBOK=0,IBND=$G(^IB(IBN,0)) Q:'IBND
  1. . S ATYPE=$S($P($G(^IBE(350.1,+$P(IBND,"^",3),0)),"^")["OPT":"O",1:"I") Q:ATYPE'=BTYPE
  1. . Q:$P(IBND,"^",15)<IBFR!($P(IBND,"^",14)>IBTO) S (IBOK,BILLS)=1
  1. ;
  1. Q BILLS
  1. ;
  1. ;
  1. HOLD(X,IBN,IBDUZ,IBSEQNO) ; Place IB Action on hold?
  1. ; Input: X -- Zeroth node of IB Action
  1. ; IBN -- ien of IB Action
  1. ; IBDUZ -- User ID
  1. ; IBSEQNO -- 1 (New Action), 3 (Update Action)
  1. ; Returns: 1 -- Yes, 0 -- No
  1. ;
  1. N DFN,IBINS,IBINDT,IBOUTP,HOLD,IBHOLDP,IBDUZ,I
  1. S IBHOLDP=$P($G(^IBE(350.9,1,1)),"^",20),DFN=+$P(X,"^",2)
  1. ;
  1. I $P(X,"^",5)=8 G HOLDQ ; action is already on hold
  1. I '$P($G(^IBE(350.1,+$P(X,"^",3),0)),"^",10) G HOLDQ ; action can't be placed on hold
  1. ;
  1. ; - see if patient has insurance on Event date
  1. S IBINDT=$P($G(^IB(+$P(X,"^",16),0)),"^",17),IBOUTP=1
  1. D ^IBCNS S:IBHOLDP HOLD=IBINS
  1. ;
  1. ; - generate bulletin if patient has insurance, bulletin not suppressed
  1. I IBINS,'$P($G(^IBE(350.9,1,0)),"^",15) D ^IBRBUL
  1. ;
  1. ; - update action to 'Hold' if parameter is set and vet has insurance
  1. I IBHOLDP,IBINS S DIE="^IB(",DA=IBN,DR=".05////8" D ^DIE,UP3^IBR:IBSEQNO=3 K DA,DIE,DR,IBI,IBJ
  1. ;
  1. HOLDQ Q +$G(HOLD)