IBEMTF2 ;ALB/CPM - LIST NON-BILLABLE STOP CODES, DISPOSITIONS, AND CLINICS ; 05-AUG-93
;;Version 2.0 ; INTEGRATED BILLING ;**55**; 21-MAR-94
;;Per VHA Directive 10-93-142, this routine should not be modified.
;
EN ; Option entry point - describe output.
W !!?5,"This report may be used to generate a list of all clinic stop codes,"
W !?5,"dispositions, and clinics where Means Test billing will be ignored.",!
;
; - grab effective date
S %DT="AEX",%DT("A")="Please select the effective date for this list: ",%DT("B")=$$DAT2^IBOUTL(DT)
D ^%DT K %DT G:Y<0 ENQ S IBDAT=Y
;
; - select a device
S %ZIS="QM" D ^%ZIS G:POP ENQ
I $D(IO("Q")) D G ENQ
.S ZTRTN="DQ^IBEMTF2",ZTDESC="LIST NON-BILLABLE STOPS/CLINICS/DISPOSITIONS",ZTSAVE("IBDAT")=""
.D ^%ZTLOAD W !!,$S($D(ZTSK):"This job has been queued. The task number is "_ZTSK_".",1:"Unable to queue this job.")
.K ZTSK,IO("Q") D HOME^%ZIS
;
U IO
;
DQ ; Tasked entry point.
;
; - compile data
D ENQ1 F IBI=352.2,352.3,352.4 S IBJ=0 F S IBJ=$O(^IBE(IBI,"AIVDT",IBJ)) Q:'IBJ I $$NBILL(IBI,IBJ,IBDAT) S ^TMP("IBEMTF2",$J,IBI,IBJ)=""
;
; - print results
S (IBPAG,IBQ)=0 F IBI=352.2,352.3,352.4 D HDR,LST,PAUSE:'IBQ Q:IBQ
;
ENQ I '$D(ZTQUEUED) D ^%ZISC
K IBDAT,IBI,IBJ,IBQ,IBT,IBPAG
ENQ1 K ^TMP("IBEMTF2",$J)
Q
;
HDR ; Generate a report header.
I $E(IOST,1,2)="C-"!(IBPAG) W @IOF,*13
S IBPAG=IBPAG+1,IBT="LIST OF NON-BILLABLE "_$S(IBI=352.2:"DISPOSITIONS",IBI=352.3:"CLINIC STOP CODES",1:"CLINICS")_" FOR MEANS TEST BILLING"
W $$DASH(),!?(80-$L(IBT)\2),IBT,!?33,"As Of: ",$$DAT1^IBOUTL(IBDAT)
W !?64,"Page: ",IBPAG,!?60,"Run Date: ",$$DAT1^IBOUTL(DT)
W !,$$DASH(),!!
Q
;
LST ; List all selected entries.
I '$D(^TMP("IBEMTF2",$J,IBI)) W "All ",$S(IBI=352.2:"dispositions",IBI=352.3:"clinic stop codes",1:"clinics")," are billable on this date." G LSTQ
S IBJ=0 F S IBJ=$O(^TMP("IBEMTF2",$J,IBI,IBJ)) Q:'IBJ D Q:IBQ
.W:$X>40 ! I $Y>(IOSL-3) D PAUSE Q:IBQ D HDR
.W:$X>2 ?40 W $$VAL(IBI,IBJ)
LSTQ Q
;
NBILL(IBF,IBEN,IBD) ; Is the entry not billable as of the effective date?
; Input: IBF -- Base file (#352.2, #352.3, #352.4)
; IBEN -- Internal entry number for entry
; IBD -- Effective date for non-billing
N Y S Y=0
I '$G(IBF)!'$G(IBEN)!'$G(IBD) G NBILLQ
I $G(IBF)=352.2 S Y=$$NBDIS^IBEFUNC(IBEN,IBDAT) G NBILLQ
I $G(IBF)=352.3 S Y=$$NBCSC^IBEFUNC(IBEN,IBDAT) G NBILLQ
I $G(IBF)=352.4 S Y=$$NBCL^IBEFUNC(IBEN,IBDAT)
NBILLQ Q Y
;
VAL(IBF,IBEN) ; Return the entry name.
; Input: IBF -- Base file (#352.2, #352.3, #352.4)
; IBEN -- Internal entry number for entry
; Output: Entry name (#.01 from respective file)
N Y S Y="'ENTRY NAME UNKNOWN'"
I '$G(IBF)!'$G(IBEN) G VALQ
I $G(IBF)=352.2 S Y=$P($G(^DIC(37,IBEN,0)),"^") G VALQ
I $G(IBF)=352.3 S Y=$P($G(^DIC(40.7,IBEN,0)),"^") G VALQ
I $G(IBF)=352.4 S Y=$P($G(^SC(IBEN,0)),"^")
VALQ Q Y
;
DASH() ; Return a dashed line.
Q $TR($J("",80)," ","=")
;
PAUSE ; Page break
Q:$E(IOST,1,2)'="C-"
N IBX,DIR,DIRUT,DUOUT,DTOUT,DIROUT,X,Y
F IBX=$Y:1:(IOSL-3) W !
S DIR(0)="E" D ^DIR I $D(DIRUT)!($D(DUOUT)) S IBQ=1
Q
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HIBEMTF2 3192 printed Dec 13, 2024@02:22:07 Page 2
IBEMTF2 ;ALB/CPM - LIST NON-BILLABLE STOP CODES, DISPOSITIONS, AND CLINICS ; 05-AUG-93
+1 ;;Version 2.0 ; INTEGRATED BILLING ;**55**; 21-MAR-94
+2 ;;Per VHA Directive 10-93-142, this routine should not be modified.
+3 ;
EN ; Option entry point - describe output.
+1 WRITE !!?5,"This report may be used to generate a list of all clinic stop codes,"
+2 WRITE !?5,"dispositions, and clinics where Means Test billing will be ignored.",!
+3 ;
+4 ; - grab effective date
+5 SET %DT="AEX"
SET %DT("A")="Please select the effective date for this list: "
SET %DT("B")=$$DAT2^IBOUTL(DT)
+6 DO ^%DT
KILL %DT
if Y<0
GOTO ENQ
SET IBDAT=Y
+7 ;
+8 ; - select a device
+9 SET %ZIS="QM"
DO ^%ZIS
if POP
GOTO ENQ
+10 IF $DATA(IO("Q"))
Begin DoDot:1
+11 SET ZTRTN="DQ^IBEMTF2"
SET ZTDESC="LIST NON-BILLABLE STOPS/CLINICS/DISPOSITIONS"
SET ZTSAVE("IBDAT")=""
+12 DO ^%ZTLOAD
WRITE !!,$SELECT($DATA(ZTSK):"This job has been queued. The task number is "_ZTSK_".",1:"Unable to queue this job.")
+13 KILL ZTSK,IO("Q")
DO HOME^%ZIS
End DoDot:1
GOTO ENQ
+14 ;
+15 USE IO
+16 ;
DQ ; Tasked entry point.
+1 ;
+2 ; - compile data
+3 DO ENQ1
FOR IBI=352.2,352.3,352.4
SET IBJ=0
FOR
SET IBJ=$ORDER(^IBE(IBI,"AIVDT",IBJ))
if 'IBJ
QUIT
IF $$NBILL(IBI,IBJ,IBDAT)
SET ^TMP("IBEMTF2",$JOB,IBI,IBJ)=""
+4 ;
+5 ; - print results
+6 SET (IBPAG,IBQ)=0
FOR IBI=352.2,352.3,352.4
DO HDR
DO LST
if 'IBQ
DO PAUSE
if IBQ
QUIT
+7 ;
ENQ IF '$DATA(ZTQUEUED)
DO ^%ZISC
+1 KILL IBDAT,IBI,IBJ,IBQ,IBT,IBPAG
ENQ1 KILL ^TMP("IBEMTF2",$JOB)
+1 QUIT
+2 ;
HDR ; Generate a report header.
+1 IF $EXTRACT(IOST,1,2)="C-"!(IBPAG)
WRITE @IOF,*13
+2 SET IBPAG=IBPAG+1
SET IBT="LIST OF NON-BILLABLE "_$SELECT(IBI=352.2:"DISPOSITIONS",IBI=352.3:"CLINIC STOP CODES",1:"CLINICS")_" FOR MEANS TEST BILLING"
+3 WRITE $$DASH(),!?(80-$LENGTH(IBT)\2),IBT,!?33,"As Of: ",$$DAT1^IBOUTL(IBDAT)
+4 WRITE !?64,"Page: ",IBPAG,!?60,"Run Date: ",$$DAT1^IBOUTL(DT)
+5 WRITE !,$$DASH(),!!
+6 QUIT
+7 ;
LST ; List all selected entries.
+1 IF '$DATA(^TMP("IBEMTF2",$JOB,IBI))
WRITE "All ",$SELECT(IBI=352.2:"dispositions",IBI=352.3:"clinic stop codes",1:"clinics")," are billable on this date."
GOTO LSTQ
+2 SET IBJ=0
FOR
SET IBJ=$ORDER(^TMP("IBEMTF2",$JOB,IBI,IBJ))
if 'IBJ
QUIT
Begin DoDot:1
+3 if $X>40
WRITE !
IF $Y>(IOSL-3)
DO PAUSE
if IBQ
QUIT
DO HDR
+4 if $X>2
WRITE ?40
WRITE $$VAL(IBI,IBJ)
End DoDot:1
if IBQ
QUIT
LSTQ QUIT
+1 ;
NBILL(IBF,IBEN,IBD) ; Is the entry not billable as of the effective date?
+1 ; Input: IBF -- Base file (#352.2, #352.3, #352.4)
+2 ; IBEN -- Internal entry number for entry
+3 ; IBD -- Effective date for non-billing
+4 NEW Y
SET Y=0
+5 IF '$GET(IBF)!'$GET(IBEN)!'$GET(IBD)
GOTO NBILLQ
+6 IF $GET(IBF)=352.2
SET Y=$$NBDIS^IBEFUNC(IBEN,IBDAT)
GOTO NBILLQ
+7 IF $GET(IBF)=352.3
SET Y=$$NBCSC^IBEFUNC(IBEN,IBDAT)
GOTO NBILLQ
+8 IF $GET(IBF)=352.4
SET Y=$$NBCL^IBEFUNC(IBEN,IBDAT)
NBILLQ QUIT Y
+1 ;
VAL(IBF,IBEN) ; Return the entry name.
+1 ; Input: IBF -- Base file (#352.2, #352.3, #352.4)
+2 ; IBEN -- Internal entry number for entry
+3 ; Output: Entry name (#.01 from respective file)
+4 NEW Y
SET Y="'ENTRY NAME UNKNOWN'"
+5 IF '$GET(IBF)!'$GET(IBEN)
GOTO VALQ
+6 IF $GET(IBF)=352.2
SET Y=$PIECE($GET(^DIC(37,IBEN,0)),"^")
GOTO VALQ
+7 IF $GET(IBF)=352.3
SET Y=$PIECE($GET(^DIC(40.7,IBEN,0)),"^")
GOTO VALQ
+8 IF $GET(IBF)=352.4
SET Y=$PIECE($GET(^SC(IBEN,0)),"^")
VALQ QUIT Y
+1 ;
DASH() ; Return a dashed line.
+1 QUIT $TRANSLATE($JUSTIFY("",80)," ","=")
+2 ;
PAUSE ; Page break
+1 if $EXTRACT(IOST,1,2)'="C-"
QUIT
+2 NEW IBX,DIR,DIRUT,DUOUT,DTOUT,DIROUT,X,Y
+3 FOR IBX=$Y:1:(IOSL-3)
WRITE !
+4 SET DIR(0)="E"
DO ^DIR
IF $DATA(DIRUT)!($DATA(DUOUT))
SET IBQ=1
+5 QUIT