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

IBEFUNC2.m

Go to the documentation of this file.
  1. IBEFUNC2 ;ALB/ARH - CPT BILLING EXTRINSIC FUNCTIONS II ;11/27/91
  1. ;;2.0;INTEGRATED BILLING;**51,266**;21-MAR-94
  1. ;;Per VHA Directive 10-93-142, this routine should not be modified.
  1. ;
  1. MODLST(MODS,DESC,IBMOD,IBDATE) ; Function returns string of actual modifiers translated
  1. ; from the comma delimited string of modifier iens in MODS
  1. ; DESC = 1 if description of modifier should be returned in IBMOD(1)
  1. ; Must pass IBMOD by reference for this to work
  1. ; IBMOD = the ',' delimited list of modifiers,
  1. ; IBMOD(1) = the ',' delimited modifier descriptions, if
  1. ; DESC = 1 and IBMOD is passed by reference
  1. ; IBDATE = Date of Service (opt) for the versioned text description
  1. ;
  1. N Z,Z0,IBP
  1. S IBMOD="",IBMOD(1)=""
  1. F Z=1:1:$L(MODS,",") S IBP=$P(MODS,",",Z) I IBP D
  1. . S Z0=$$MOD^ICPTMOD(IBP,"I",$G(IBDATE)) Q:Z0<0
  1. . I $G(DESC) S IBMOD(1)=IBMOD(1)_$S(IBMOD="":"",1:",")_$P(Z0,U,3)
  1. . S IBMOD=IBMOD_$S(IBMOD="":"",1:",")_$P(Z0,U,2)
  1. Q IBMOD
  1. ;
  1. CPTSTAT(CPT,DATE) ;determine the overall status for a CPT for given date, assumes today if no date given
  1. ;if DATE is not today, assumes that if active in either 409.71 or 350.4 then also active in 81 for that DATE
  1. ;(ICPT is not a date sensitive file, so will only check (81) if want todays status), returns:
  1. ; 1 - if DATE=DT and CPT currently only active in ICPT file (81) (not active in 409.71 or 350.4)
  1. ; 2A - if CPT is Nationally Active only in SD(409.71) and not BASC for DATE
  1. ; 2B - if CPT is Locally Active only in SD(409.71) and not BASC for DATE
  1. ; 2C - if CPT is Nationally and Locally Active in SD(409.71) and not BASC for DATE
  1. ; 3 - if CPT is Billing Active (BASC) in IBE(350.4) and not active in (409.71) for DATE
  1. ; 4A - if CPT is Nationally Active in SD(409.71) and Billing Active in IBE(350.4) for DATE
  1. ; 4B - if CPT is Locally Active only in SD(409.71) and Billing Active in IBE(350.4) for DATE
  1. ; 4C - if CPT is Nationally and Locally Active in SD(409.71) and Billing Active in IBE(350.4) for DATE
  1. ; 0 - otherwise
  1. N X,X1,Y,POST
  1. S:'$D(CPT) CPT=0 S:'$D(DATE) DATE=DT S:'DATE DATE=DT
  1. S Y=0,POST="" G:$$CPT^ICPTCOD(+CPT)<1 CEND
  1. I $E(DATE,1,7)=DT G:'$P($$CPT^ICPTCOD(+CPT),"^",7) CEND S Y=1
  1. S X=CPT,X1=DATE D STATUS^SDAMBAE4 I X'["INACTIVE"&(X'="") D
  1. . S Y=2,POST="A" I X["LOCAL" S POST="B" I X["NATIONAL" S POST="C"
  1. I $$CPTBSTAT^IBEFUNC1(CPT,DATE) S Y=3 I POST'="" S Y=Y+1
  1. CEND Q Y_POST
  1. ;
  1. TDG(SSN) ;reformat SSN into terminal digit order
  1. ; returns either 0 or ssn in terminal digit order
  1. N X,Y,I S Y="" F I=1:1 S X=$E(SSN,I) Q:X="" I X?1N S Y=Y_X
  1. S Y=$S(Y'?9N:0,1:$E(Y,8,9)_$E(Y,6,7)_$E(Y,4,5)_$E(Y,1,3))
  1. ENDP Q Y
  1. ;
  1. FFMT ;
  1. S IBLNGX=$$FORMAT($S('$D(IBGRPX):"",1:IBGRPX),$S('$D(IBCPX):"",1:IBCPX)) Q
  1. ;
  1. FORMAT(GRP,CP) ;calculate spacing format for clinic CPT list
  1. ;input GRP - the ifn of the GROUP to be calculated or ""
  1. ; or CP - the ifn of the entry in 350.71 to return format or ""
  1. ;returns - "" if GRP not defined in ^IBE(350.7, or GRP of CP not found
  1. ; - margin width & intercolumn width ^ header width (same for both groups and catigories)
  1. ; ^ procedure name width
  1. ;if # of columns not defined for group, assumes 2
  1. ;if display charge not defined for group, assumes negative
  1. ;assumes that charge and code widths are not variable
  1. N X,DCHG,CD,IC,PN,H,COL,M,CHK
  1. S:'$D(GRP) GRP="" S:'$D(CP) CP="" I 'GRP&'CP S X="" G ENDFMT
  1. S DCHG=10,CD=7,CHK=7,IC=3,M=132
  1. S:'+GRP GRP=$G(^IBE(350.71,+CP,0)),GRP=$S($P(GRP,"^",4):$P(GRP,"^",4),1:$P($G(^IBE(350.71,+$P(GRP,"^",5),0)),"^",4))
  1. S X=$G(^IBE(350.7,+GRP,0)),COL=$P(X,"^",3) S:COL="" COL=2
  1. I X'="" S DCHG=$S($P(X,"^",2):DCHG,1:0),DCHG=DCHG*COL,CD=CD*COL,CHK=CHK*COL
  1. I X'="" S H=(M-(2*COL*IC)),PN=(H-DCHG-CD-CHK)\COL,H=H\COL
  1. ENDFMT Q $S(X="":X,1:IC_"^"_H_"^"_PN)
  1. ;
  1. FPO ;
  1. S X=$$PO(DA,X) Q
  1. ;
  1. PO(DA,X) ;check that the print order entered has not already been used for the group/sub-header
  1. ;used to ensure unique print orders within groups and sub-headers
  1. ; input: DA - the IFN of the entry being added/edited may be a subheader or procedure
  1. ; X - the print order to check
  1. ;returns: "" - if bad input or print order already defined
  1. ; X - input value of X if not previously defined for group/sub-header
  1. I '$D(DA)!('$D(^IBE(350.71,+DA,0)))!('$D(X))!('X) S X="" G ENDPO
  1. N Y S Y=^IBE(350.71,+DA,0)
  1. I $P(Y,"^",3)="S",$D(^IBE(350.71,"AG",+$P(Y,"^",4),X)) S X=""
  1. I $P(Y,"^",3)="P",$D(^IBE(350.71,"AS",+$P(Y,"^",5),X)) S X=""
  1. ENDPO Q X