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

IBEFUNC.m

Go to the documentation of this file.
  1. IBEFUNC ;ALB/RLW - EXTRINSIC FUNCTION ; 12-JUN-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. ETXT(X) ; -- output error message text from 350.8
  1. ; -- input error message code
  1. N Y S Y=X
  1. I X="" G ETXTQ
  1. S Y=$P($G(^IBE(350.8,+$O(^IBE(350.8,"AC",X,0)),0)),"^",2)
  1. ETXTQ Q Y
  1. ;
  1. IGN(X,Y) ; ignore means test? for appointment type on dates
  1. ; -- input x = mas appointment type
  1. ; y = date of appointment
  1. ; output = true if this appointment type should not be billed for
  1. ; Cat C Means test billing (352.1,.04) for given date
  1. ;
  1. I '$G(X)!('$G(Y)) Q 1
  1. Q +$P($G(^IBE(352.1,+$O(^(+$O(^IBE(352.1,"AIVDT",+X,-(Y+.1))),0)),0)),"^",4)
  1. ;
  1. DSP(X,Y) ; display on input screen?
  1. ; -- input X = mas appointment type (P409.1)
  1. ; Y = date
  1. ; output = true if appointment type X (352.1,.02) should be displayed as a
  1. ; potential billable visit (352.1,.06) on the given date Y (352.1,.03)
  1. ;
  1. I '$G(X)!('$G(Y)) Q 0
  1. Q +$P($G(^IBE(352.1,+$O(^(+$O(^IBE(352.1,"AIVDT",+X,-(Y+.1))),0)),0)),"^",6)
  1. ;
  1. RPT(X,Y) ; print on report?
  1. ; -- input X = mas appointment type (P409.1)
  1. ; Y = date
  1. ; output = true if appointment type X (352.1,.02) should be printed on 'Vets w/ Ins and Opt
  1. ; Visits' report (352.1,.05) on the given date Y (352.1,.06)
  1. ;
  1. I '$G(X)!('$G(Y)) Q 0
  1. Q +$P($G(^IBE(352.1,+$O(^(+$O(^IBE(352.1,"AIVDT",+X,-(Y+.1))),0)),0)),"^",5)
  1. ;
  1. NBDIS(X,Y) ; Is this disposition non-billable?
  1. ; -- input X = disposition (P37)
  1. ; Y = date of appointment
  1. ; output = true (1) if this disposition should be ignored for
  1. ; Means test billing (352.2,.03) for the given date
  1. ;
  1. I '$G(X)!('$G(Y)) Q 0
  1. Q +$P($G(^IBE(352.2,+$O(^(+$O(^IBE(352.2,"AIVDT",+X,-(Y+.1))),0)),0)),"^",3)
  1. ;
  1. NBCSC(X,Y) ; Is this clinic stop code non-billable?
  1. ; -- input X = clinic stop code (P40.7)
  1. ; Y = date of appointment
  1. ; output = true (1) if this clinic stop code should be ignored for
  1. ; Means test billing (352.3,.03) for the given date
  1. ;
  1. I '$G(X)!('$G(Y)) Q 0
  1. Q +$P($G(^IBE(352.3,+$O(^(+$O(^IBE(352.3,"AIVDT",+X,-(Y+.1))),0)),0)),"^",3)
  1. ;
  1. NBCL(X,Y) ; Is this clinic non-billable?
  1. ; -- input X = clinic (P44)
  1. ; Y = date of appointment
  1. ; output = true (1) if this clinic should be ignored for
  1. ; Means test billing (352.4,.03) for the given date
  1. ;
  1. I '$G(X)!('$G(Y)) Q 0
  1. Q +$P($G(^IBE(352.4,+$O(^(+$O(^IBE(352.4,"AIVDT",+X,-(Y+.1))),0)),0)),"^",3)
  1. ;
  1. PT(DFN) ;returns (patient name^long patient id^short patient id) or null if not found
  1. N X S X="" I $D(DFN) S X=$G(^DPT(+DFN,0)) I X'="" S X=$P(X,"^",1)_"^"_$P($G(^DPT(DFN,.36)),"^",3,4)
  1. Q X
  1. ;
  1. EXSET(X,D0,D1) ;returns external value of a set in file D0, field D1
  1. N Y,Z S Y="" I $G(X)'="",+$G(D0),+$G(D1) S Z=$G(^DD(+D0,+D1,0)) I $P(Z,U,2)["S" S X=X_":",Y=$P($P(Z,X,2),";",1)
  1. ; ***** S Y=X,C=$P(^DD(+D0,+D1,0),"^",2) D Y^DIQ K C ******
  1. Q Y
  1. ;
  1. BABCSC(DFN,IBDT) ; -- is there any billable stop codes in the encounter file for patient
  1. ; -- Input dfn = patient,
  1. ; ibdt = date
  1. ; output = 1 if any billable stop on date OR 0 if none
  1. ;
  1. N IBX,IBOE,IBOEDATA,IBY S IBX=0
  1. I '$G(DFN)!('$G(IBDT)) G BABQ
  1. S IBY=IBDT\1-.00001 F S IBY=$O(^SCE("ADFN",DFN,IBY)) Q:'IBY!(IBY>(IBDT+.24)) D Q:IBX
  1. .S IBOE=$O(^SCE("ADFN",DFN,IBY,0))
  1. .Q:'IBOE
  1. .S IBOEDATA=$G(^SCE(IBOE,0))
  1. .I $P(IBOEDATA,"^",3),$P(IBOEDATA,"^",12)=2,'$$NBCSC($P(IBOEDATA,"^",3),IBY) S IBX=1
  1. .Q
  1. BABQ Q IBX