IBOHIST ;ALB/EMG - HISTORY OF CHARGES ON HOLD REPORT ; FEB 25 1997
;;2.0; INTEGRATED BILLING ;**70**; 21-MAR-94
;
EN ;
;***
D HOME^%ZIS W @IOF,!!,"History of Charges ON HOLD Report",!
;
N DIRUT,DUOUT,DTOUT,IBDATE,Y
W !!?6,"This report uses the date the IB Action was created to determine"
W !?6,"whether it should be included in the count and amount totals."
W !?6,"Please enter the starting date for this report. The date should"
W !?6,"be after 6/1/96 or when patch IB*2.0*70 was installed at your"
W !?6,"facility since this report only counts charges with an ON HOLD"
W !?6,"DATE defined. You can also type '^' to exit.",!
;
S DIR(0)="DA^2960601:NOW:EX",DIR("A")="Start with DATE: "
S DIR("?")="Enter the starting date for this report. (No earlier than 6/1/96)"
D ^DIR K DIR G:$D(DIRUT) END S IBSDT=+Y
S DIR(0)="DA^"_+Y_":NOW:EX",DIR("A")=" Go to DATE: ",DIR("?")="Enter the ending date for this report." D ^DIR K DIR G:$D(DIRUT) END S IBEDT=+Y
;
DEV S %ZIS="QM",%ZIS("A")="Output Device: " D ^%ZIS G:POP END
I $D(IO("Q")) S ZTRTN="DQ^IBOHIST",ZTDESC="IB History of Charges on hold Report",ZTSAVE("IB*")="" D ^%ZTLOAD K IO("Q"),ZTSK G END
U IO
;***
W !!
;
DQ ; -entry from tasked job
;***
;
; -gross count of statuses, total charges
; -^tmp($j,"ib",ibstatus,"gcnt")=count
; ^tmp($j,"ib",ibstatus,"gtot")=sum of charges
;
K ^TMP($J)
S IBEDT=IBEDT+.24
S IBDT=IBSDT+.000001 F S IBDT=$O(^IB("D",IBDT)) Q:IBDT=""!(IBDT>IBEDT) S IBN="" F S IBN=$O(^IB("D",IBDT,IBN)) Q:IBN="" D
.S IBND=^IB(IBN,0) Q:'IBND
.S IBSTAT=$S($D(^IBE(350.21,+$P(IBND,"^",5),0)):$P(^(0),"^"),1:"UNKNOWN")
.S IBOH=$P($G(^IB(IBN,1)),"^",6) Q:'IBOH
.S:'$D(^TMP($J,"IB",IBSTAT,"GCNT")) ^("GCNT")=0 S ^("GCNT")=^("GCNT")+1
.S:'$D(^TMP($J,"IB",IBSTAT,"GTOT")) ^("GTOT")=0 S ^("GTOT")=^("GTOT")+$P(IBND,"^",7)
.Q
;
D PRINT W !
G END
;
;
PRINT ; -output data
S IBQUIT=0,IBPAG=0,Y=DT D D^DIQ S IBHDT=Y D HDR
W !!?((IOM-34)/2),"TOTALS BY CURRENT STATUS OF CHARGE",!
;
S IBSTAT=0 F S IBSTAT=$O(^TMP($J,"IB",IBSTAT)) Q:IBSTAT=""!(IBQUIT) D LINE
Q
;
LINE ;
I $Y>(IOSL-5) D PAUSE^IBOUTL Q:IBQUIT D HDR
W !!,"Current Status: ",IBSTAT
;W !,"--------------------------"
W !?5,"NUMBER ENTRIES: ",$J($S($D(^TMP($J,"IB",IBSTAT,"GCNT")):^("GCNT"),1:0),9)
W !?5,"DOLLAR AMOUNT: $",$J($S($D(^TMP($J,"IB",IBSTAT,"GTOT")):^("GTOT"),1:0),9,2)
Q
;
HDR ;
W:$E(IOST,1,2)["C-"!(IBPAG>0) @IOF
W !?((IOM-26)/2),"History of Charges ON HOLD"
W !?((IOM-3)/2),"for"
D SITE^IBAUTL S IBSNM=$S($D(^DIC(4,IBFAC,0)):$P(^(0),"^"),1:"")
W !?((IOM-($L(IBSNM)+6))/2),IBSNM_" ("_IBSITE_")"
W !?((IOM-54)/2),"Charges created between ",$$DAT2^IBOUTL(IBSDT)," and ",$P($$DAT2^IBOUTL(IBEDT),"@")
W !!?(IOM-26/2),"Date Printed: ",IBHDT
S IBPAG=IBPAG+1 W !?(IOM-8/2),"Page: ",IBPAG
W !?(IOM-26/2),"--------------------------"
Q
;
;
END K ^TMP($J)
;***
I $D(ZTQUEUED) S ZTREQ="@" Q
K DFN,DIRUT,DUOUT,DTOUT,IBDT,IBHDT,IBDATE,IBOH,IBSDT,IBEDT,IBPAG,IBSNM,IBST,IBSTAT,IBFAC,IBSITE,IBN,IBND,IBQUIT,POP,ZTDESC,ZTQUEUED,ZTREQ,ZTRTN,ZTSAVE,X,Y
D ^%ZISC
Q
;end ibohist
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HIBOHIST 3154 printed Nov 22, 2024@17:35:38 Page 2
IBOHIST ;ALB/EMG - HISTORY OF CHARGES ON HOLD REPORT ; FEB 25 1997
+1 ;;2.0; INTEGRATED BILLING ;**70**; 21-MAR-94
+2 ;
EN ;
+1 ;***
+2 DO HOME^%ZIS
WRITE @IOF,!!,"History of Charges ON HOLD Report",!
+3 ;
+4 NEW DIRUT,DUOUT,DTOUT,IBDATE,Y
+5 WRITE !!?6,"This report uses the date the IB Action was created to determine"
+6 WRITE !?6,"whether it should be included in the count and amount totals."
+7 WRITE !?6,"Please enter the starting date for this report. The date should"
+8 WRITE !?6,"be after 6/1/96 or when patch IB*2.0*70 was installed at your"
+9 WRITE !?6,"facility since this report only counts charges with an ON HOLD"
+10 WRITE !?6,"DATE defined. You can also type '^' to exit.",!
+11 ;
+12 SET DIR(0)="DA^2960601:NOW:EX"
SET DIR("A")="Start with DATE: "
+13 SET DIR("?")="Enter the starting date for this report. (No earlier than 6/1/96)"
+14 DO ^DIR
KILL DIR
if $DATA(DIRUT)
GOTO END
SET IBSDT=+Y
+15 SET DIR(0)="DA^"_+Y_":NOW:EX"
SET DIR("A")=" Go to DATE: "
SET DIR("?")="Enter the ending date for this report."
DO ^DIR
KILL DIR
if $DATA(DIRUT)
GOTO END
SET IBEDT=+Y
+16 ;
DEV SET %ZIS="QM"
SET %ZIS("A")="Output Device: "
DO ^%ZIS
if POP
GOTO END
+1 IF $DATA(IO("Q"))
SET ZTRTN="DQ^IBOHIST"
SET ZTDESC="IB History of Charges on hold Report"
SET ZTSAVE("IB*")=""
DO ^%ZTLOAD
KILL IO("Q"),ZTSK
GOTO END
+2 USE IO
+3 ;***
+4 WRITE !!
+5 ;
DQ ; -entry from tasked job
+1 ;***
+2 ;
+3 ; -gross count of statuses, total charges
+4 ; -^tmp($j,"ib",ibstatus,"gcnt")=count
+5 ; ^tmp($j,"ib",ibstatus,"gtot")=sum of charges
+6 ;
+7 KILL ^TMP($JOB)
+8 SET IBEDT=IBEDT+.24
+9 SET IBDT=IBSDT+.000001
FOR
SET IBDT=$ORDER(^IB("D",IBDT))
if IBDT=""!(IBDT>IBEDT)
QUIT
SET IBN=""
FOR
SET IBN=$ORDER(^IB("D",IBDT,IBN))
if IBN=""
QUIT
Begin DoDot:1
+10 SET IBND=^IB(IBN,0)
if 'IBND
QUIT
+11 SET IBSTAT=$SELECT($DATA(^IBE(350.21,+$PIECE(IBND,"^",5),0)):$PIECE(^(0),"^"),1:"UNKNOWN")
+12 SET IBOH=$PIECE($GET(^IB(IBN,1)),"^",6)
if 'IBOH
QUIT
+13 if '$DATA(^TMP($JOB,"IB",IBSTAT,"GCNT"))
SET ^("GCNT")=0
SET ^("GCNT")=^("GCNT")+1
+14 if '$DATA(^TMP($JOB,"IB",IBSTAT,"GTOT"))
SET ^("GTOT")=0
SET ^("GTOT")=^("GTOT")+$PIECE(IBND,"^",7)
+15 QUIT
End DoDot:1
+16 ;
+17 DO PRINT
WRITE !
+18 GOTO END
+19 ;
+20 ;
PRINT ; -output data
+1 SET IBQUIT=0
SET IBPAG=0
SET Y=DT
DO D^DIQ
SET IBHDT=Y
DO HDR
+2 WRITE !!?((IOM-34)/2),"TOTALS BY CURRENT STATUS OF CHARGE",!
+3 ;
+4 SET IBSTAT=0
FOR
SET IBSTAT=$ORDER(^TMP($JOB,"IB",IBSTAT))
if IBSTAT=""!(IBQUIT)
QUIT
DO LINE
+5 QUIT
+6 ;
LINE ;
+1 IF $Y>(IOSL-5)
DO PAUSE^IBOUTL
if IBQUIT
QUIT
DO HDR
+2 WRITE !!,"Current Status: ",IBSTAT
+3 ;W !,"--------------------------"
+4 WRITE !?5,"NUMBER ENTRIES: ",$JUSTIFY($SELECT($DATA(^TMP($JOB,"IB",IBSTAT,"GCNT")):^("GCNT"),1:0),9)
+5 WRITE !?5,"DOLLAR AMOUNT: $",$JUSTIFY($SELECT($DATA(^TMP($JOB,"IB",IBSTAT,"GTOT")):^("GTOT"),1:0),9,2)
+6 QUIT
+7 ;
HDR ;
+1 if $EXTRACT(IOST,1,2)["C-"!(IBPAG>0)
WRITE @IOF
+2 WRITE !?((IOM-26)/2),"History of Charges ON HOLD"
+3 WRITE !?((IOM-3)/2),"for"
+4 DO SITE^IBAUTL
SET IBSNM=$SELECT($DATA(^DIC(4,IBFAC,0)):$PIECE(^(0),"^"),1:"")
+5 WRITE !?((IOM-($LENGTH(IBSNM)+6))/2),IBSNM_" ("_IBSITE_")"
+6 WRITE !?((IOM-54)/2),"Charges created between ",$$DAT2^IBOUTL(IBSDT)," and ",$PIECE($$DAT2^IBOUTL(IBEDT),"@")
+7 WRITE !!?(IOM-26/2),"Date Printed: ",IBHDT
+8 SET IBPAG=IBPAG+1
WRITE !?(IOM-8/2),"Page: ",IBPAG
+9 WRITE !?(IOM-26/2),"--------------------------"
+10 QUIT
+11 ;
+12 ;
END KILL ^TMP($JOB)
+1 ;***
+2 IF $DATA(ZTQUEUED)
SET ZTREQ="@"
QUIT
+3 KILL DFN,DIRUT,DUOUT,DTOUT,IBDT,IBHDT,IBDATE,IBOH,IBSDT,IBEDT,IBPAG,IBSNM,IBST,IBSTAT,IBFAC,IBSITE,IBN,IBND,IBQUIT,POP,ZTDESC,ZTQUEUED,ZTREQ,ZTRTN,ZTSAVE,X,Y
+4 DO ^%ZISC
+5 QUIT
+6 ;end ibohist