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

IBCSC4B.m

Go to the documentation of this file.
IBCSC4B ;ALB/MJB - MCCR PTF SCREEN (CONT.) ;24 FEB 89  9:52
 ;;2.0;INTEGRATED BILLING;**210,228,304,479,522,714**;21-MAR-94;Build 8
 ;;Per VA Directive 6402, this routine should not be modified.
 ;
 ;
PRO ; display PTF procedures within date range of bill
 ; ^UTILITY is rebuilt because PCM may have changed since originally built
 ;
 D PTFPDSP($G(IBIFN))
 Q
 ;
PTFPDSP(IBIFN) ; display PTF procedures within the date range of the bill
 ; Output:  ^UTILITY($J,"IB") as defined by PTFPRDT^IBCSC4A
 ; includes ICD Surgeries (401) and ICD Procedures (601) or CPT Professional Services (801)
 N IB0,IBU,IBPTF,IBFDT,IBTDT,IBPCM K ^UTILITY($J,"IB")
 N IBLCNT,IBE,IBE1,IBE2,IBC,IBI,IBINDTS,IBR,IBHEADER,IBCODE,IBLINE,IBCNT,TYPE,SGRP,IBSGCD,PRTARR,DIR,Y,X
 ;
 S IB0=$G(^DGCR(399,+$G(IBIFN),0)),IBPTF=$P(IB0,U,8),IBPCM=+$P(IB0,U,9)
 S IBINDTS=$P(IB0,U,28) ; initial date of service  IB*2.0*714
 S IBU=$G(^DGCR(399,+IBIFN,"U")),IBFDT=+IBU,IBTDT=$P(IBU,U,2) Q:$P(IB0,U,5)>2
 ;
 D PTFPRDT^IBCSC4A(IBPTF,$S(IBINDTS>0:IBINDTS,1:IBFDT),IBTDT,IBPCM,IBIFN)  ; IB*2.0*714
 ;
 W @IOF,?27,"OPERATION/PROCEDURE SCREEN",! S IBLCNT=2
 I '$O(^UTILITY($J,"IB",0)) W !!,"* No PROCEDURE CODES in PTF record for this episode of care.",!! Q
 ;
 S IBE1=0 F  S IBE1=$O(^UTILITY($J,"IB",IBE1)) Q:'IBE1  S IBE2=$O(^UTILITY($J,"IB",IBE1)) D  S IBE1=IBE2 Q:'IBE1
 . ;
 . K PRTARR S PRTARR(1)=""
 . ;
 . S IBE=IBE1,IBCNT=2,IBR=0 D  S IBE=IBE2,IBCNT=2,IBR=40 I +IBE D
 .. ;
 .. S IBHEADER=$G(^UTILITY($J,"IB",IBE,1)),TYPE=$P(IBHEADER,U,4),SGRP=$P(IBHEADER,U,3)
 .. S IBLINE=$G(PRTARR(IBCNT)) S PRTARR(IBCNT)=IBLINE_$$DSPWDH(IBLINE,IBR)_$$DSPHDR(IBHEADER,TYPE) S IBCNT=IBCNT+1
 .. ;
 .. S IBC=0 F  S IBC=$O(^UTILITY($J,"IB",IBE,IBC)) Q:'IBC  D
 ... ;
 ... S IBCODE=$G(^UTILITY($J,"IB",IBE,IBC)),IBSGCD=SGRP_IBC
 ... S IBLINE=$G(PRTARR(IBCNT)) S PRTARR(IBCNT)=IBLINE_$$DSPWDH(IBLINE,IBR)_$$DSPCOD(IBCODE,TYPE,IBSGCD) S IBCNT=IBCNT+1
 .. ;
 . S IBI="" F  S IBI=$O(PRTARR(IBI)) Q:IBI=""  W !,PRTARR(IBI) S IBLCNT=IBLCNT+1 I IBLCNT>21 D  S IBLCNT=1 I 'Y S IBE2=0 Q
 .. W ! S DIR(0)="E" D ^DIR K DIR,DIRUT W !
 ;
 Q
 ;
DSPWDH(LN,RCOL) ; Pad line to RCOL width
 S LN=$G(LN) S LN=$J("",($G(RCOL)-$L(LN)))
 Q LN
 ;
DSPHDR(LN,TYPE) ; Format header line
 N IBX,IBLINE S IBLINE=""
 I $G(TYPE)="" S IBLINE="Surgery Date: "
 I $G(TYPE)="*" S IBLINE="Non-O/R Procedure Date: "
 I $G(TYPE)="+" S IBLINE="Prof Svc Date: "
 S IBX=$P($G(LN),U,2) I +IBX S IBLINE=IBLINE_$$FMTE^XLFDT(+IBX)
 ;
 S IBLINE=$E(IBLINE,1,38)
 Q IBLINE
 ;
DSPCOD(LN,TYPE,SG) ; Format code line
 N IBX,IBPB,IBLINE S IBLINE=""
 S IBPB=" " I $G(SG)'="" S IBPB=$G(^UTILITY($J,"IB","B",SG)) S IBPB=$S($P(IBPB,U,3)="Y":"*",1:" ")
 ;
 I '$G(LN) S IBLINE=$J($G(SG)_"-",4)_"UNSPECIFIED CODE"
 ;
 I $G(TYPE)'="+",+$G(LN) S IBX=$$ICD0^IBACSV(+LN) D
 . S IBLINE=IBPB_$J($G(SG)_"-",4)_$P(IBX,U,1) S IBLINE=IBLINE_$$DSPWDH(IBLINE,14)_$P(IBX,U,4)
 ;
 I $G(TYPE)="+",+$G(LN) S IBX=$$CPT^IBACSV(+LN) D
 . S IBLINE=$J($G(SG)_"-",4)_$P(IBX,U,1) I $P(LN,U,5)'="" S IBLINE=IBLINE_"("_$P(LN,U,5)_")"
 . S IBLINE=IBLINE_$$DSPWDH(IBLINE,13)_"PROV-"_$P($G(^VA(200,+$P($G(LN),U,13),0)),U,1)
 . I $P(LN,U,10)>1 S IBLINE=$E(IBLINE,1,(38-($L($P(LN,U,10))+3)))_" ("_$P(LN,U,10)_")"
 ;
 S IBLINE=$E(IBLINE,1,38)
 Q IBLINE
 ;
 ;
Q K IB3,IB4,IB5,IB6,IB7,IB8,IB9,IBAE,IBAO,IBCT,IBDIA,IBDP,IBDX,IBDXC,IBDXX,IBDXY,IBI,IBNC,IBNOR,IBP,IBPY,IBOP,IBOPC,IBOPX,IBOPY,IBPP,IBPX,IBSD,IBSP,IBWE,IBWO,IBPRO,IBPROT
 K %DT,A,B,DIC,F,I,J,K,M,S,X,Y,N,P
 Q