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

IBRFN.m

Go to the documentation of this file.
  1. IBRFN ;ALB/AAS - Supported functions for AR ; cinco de mayo, 1992
  1. ;;Version 2.0 ; INTEGRATED BILLING ;; 21-MAR-94
  1. ;;Per VHA Directive 10-93-142, this routine should not be modified.
  1. ;
  1. ERR(Y) ; - input Y = -1^error code[;error code...]^literal message
  1. ; - output IBRERR = error message 1
  1. ; if more than one code then
  1. ; IBRERR(n)=error code n
  1. N N,X,X1,X2 K IBRERR S IBRERR=""
  1. G:+Y>0 ERRQ
  1. S X2=$P(Y,"^",2) F N=1:1 S X=$P(X2,";",N) Q:X="" S X1=$P($G(^IBE(350.8,+$O(^IBE(350.8,"AC",X,0)),0)),"^",2) D
  1. .I N=1 S IBRERR=X1
  1. .I $P(Y,"^",3)]""!($P(X2,";",2,99)]"") S IBRERR(N)=X1
  1. I $P(Y,"^",3)]"" S N=N+1,IBRERR(N)=$P(Y,"^",3)
  1. ERRQ Q IBRERR
  1. ;
  1. MESS(Y) ; -input y=error code - from file 350.8 (piece 3)
  1. ; output error message
  1. Q $P($G(^IBE(350.8,+$O(^IBE(350.8,"AC",Y,0)),0)),"^",2)
  1. ;
  1. SVDT(BN,VDT) ;returns service dates for a specific bill
  1. ;- input: BN bill number (external form)
  1. ; VDT name of array to hold outpatient visit dates, pass by value (if needed)
  1. ;- output: X function value, string, = 0 if bill not found
  1. ; = 1 (Inpt) or 2 (Outpt)^event date^stmt from date^stmt to date^LOS (I)^Number of visit dates (O)
  1. ; all are internal form, any piece may be null if not defined for the bill
  1. ; array containing outpatient visit dates as subscripts/no data, if VDT passed by value
  1. N X,Y,IFN S X=0,BN=$G(BN)
  1. I BN'="" S IFN=+$O(^DGCR(399,"B",BN,0)),Y=$G(^DGCR(399,IFN,0)) I Y'="" D
  1. . S X=$S(+$P(Y,U,5)<1:"",+$P(Y,U,5)<3:1,+$P(Y,U,5)<5:2,1:"")_U_$P(Y,U,3),Y=$G(^DGCR(399,IFN,"U"))
  1. . S X=X_U_$P(Y,U,1)_U_$P(Y,U,2)_U_$P(Y,U,15)_U_$P($G(^DGCR(399,IFN,"OP",0)),U,4)
  1. . S Y=0 F S Y=$O(^DGCR(399,IFN,"OP",Y)) Q:'Y S VDT(Y)=""
  1. Q X