IBOHTOT ;ALB/EMG - COUNT/AMT OF CHARGES ON HOLD REPORT ; FEB 25 1997
;;2.0; INTEGRATED BILLING ;**70**; 21-MAR-94
;
EN ;
;***
D HOME^%ZIS W @IOF,!!,"Count and Dollar Amount of Charges ON HOLD Report",!!
;
DEV S %ZIS="QM",%ZIS("A")="Output Device: " D ^%ZIS G:POP END
I $D(IO("Q")) S ZTRTN="DQ^IBOHTOT",ZTDESC="IB Count/Amt Report",ZTSAVE("IB*")="" D ^%ZTLOAD K IO("Q"),ZTSK G END
U IO
;***
W !!
;
DQ ; -entry from tasked job
;***
K ^TMP($J)
S DFN=0 F S DFN=$O(^IB("AH",DFN)) Q:'DFN S IBN=0 F S IBN=$O(^IB("AH",DFN,IBN)) Q:'IBN I $D(^IB(IBN,0)) D DATA
;
D PRINT W !
D TPRINT W !
G END
;
DATA ; -gross count of action types, total charges
; -^tmp($j,"ib",ibaction type,"gcnt")=count
; -^tmp($j,"ib",ibaction type,"gtot")=sum of charges
; -^tmp($j,"ibtot","fcnt")=final count of entries
; -^tmp($j,"ibtot","ftot")=final sum of charges
;
S IBND=^IB(IBN,0)
S IBATYP=$S($D(^IBE(350.1,+$P(IBND,"^",3),0)):$P(^(0),"^"),1:"UNKNOWN")
S:'$D(^TMP($J,"IB",IBATYP,"GCNT")) ^("GCNT")=0 S ^("GCNT")=^("GCNT")+1
S:'$D(^TMP($J,"IB",IBATYP,"GTOT")) ^("GTOT")=0 S ^("GTOT")=^("GTOT")+$P(IBND,"^",7)
S:'$D(^TMP($J,"IBTOT","FCNT")) ^("FCNT")=0 S ^("FCNT")=^("FCNT")+1
S:'$D(^TMP($J,"IBTOT","FTOT")) ^("FTOT")=0 S ^("FTOT")=^("FTOT")+$P(IBND,"^",7)
Q
;
;
PRINT ; -output data
S IBQUIT=0,IBPAG=0,Y=DT D D^DIQ S IBHDT=Y D HDR
W !!?((IOM-25)/2),"TOTALS BY ACTION TYPE"
;
S IBATYP="" F IBT=0:0 S IBATYP=$O(^TMP($J,"IB",IBATYP)) Q:IBATYP=""!(IBQUIT) D LINE
Q
;
TPRINT ; -grand total of data
I $Y>(IOSL-5) D PAUSE^IBOUTL Q:IBQUIT D HDR
W !!,?(IOM-26/2),"**************************"
W !,?((IOM/2)-20),"TOTAL NUMBER OF ENTRIES: ",$J($S($D(^TMP($J,"IBTOT","FCNT")):^("FCNT"),1:0),13)
W !,?((IOM/2)-20)," TOTAL DOLLAR AMOUNT: $",$J($S($D(^TMP($J,"IBTOT","FTOT")):^("FTOT"),1:0),12,2)
Q
;
LINE ;
I $Y>(IOSL-5) D PAUSE^IBOUTL Q:IBQUIT D HDR
W !!?((IOM/2)-$L($P(IBATYP," ",2,99))),$P(IBATYP," ",2,99)
W !?((IOM/2)-12),"NUMBER ENTRIES: ",$J($S($D(^TMP($J,"IB",IBATYP,"GCNT")):^("GCNT"),1:0),9)
W !?((IOM/2)-12),"DOLLAR AMOUNT: $",$J($S($D(^TMP($J,"IB",IBATYP,"GTOT")):^("GTOT"),1:0),9,2)
Q
;
HDR ;
W:$E(IOST,1,2)["C-"!(IBPAG>0) !,@IOF
W ?((IOM-42)/2),"Count and Dollar Amount 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-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,IBT,IBATYP,IBHDT,IBPAG,IBSNM,IBFAC,IBSITE,IBN,IBND,IBQUIT,POP,X,Y
D ^%ZISC
Q
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HIBOHTOT 2716 printed Dec 13, 2024@02:25:45 Page 2
IBOHTOT ;ALB/EMG - COUNT/AMT 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,!!,"Count and Dollar Amount of Charges ON HOLD Report",!!
+3 ;
DEV SET %ZIS="QM"
SET %ZIS("A")="Output Device: "
DO ^%ZIS
if POP
GOTO END
+1 IF $DATA(IO("Q"))
SET ZTRTN="DQ^IBOHTOT"
SET ZTDESC="IB Count/Amt 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 KILL ^TMP($JOB)
+3 SET DFN=0
FOR
SET DFN=$ORDER(^IB("AH",DFN))
if 'DFN
QUIT
SET IBN=0
FOR
SET IBN=$ORDER(^IB("AH",DFN,IBN))
if 'IBN
QUIT
IF $DATA(^IB(IBN,0))
DO DATA
+4 ;
+5 DO PRINT
WRITE !
+6 DO TPRINT
WRITE !
+7 GOTO END
+8 ;
DATA ; -gross count of action types, total charges
+1 ; -^tmp($j,"ib",ibaction type,"gcnt")=count
+2 ; -^tmp($j,"ib",ibaction type,"gtot")=sum of charges
+3 ; -^tmp($j,"ibtot","fcnt")=final count of entries
+4 ; -^tmp($j,"ibtot","ftot")=final sum of charges
+5 ;
+6 SET IBND=^IB(IBN,0)
+7 SET IBATYP=$SELECT($DATA(^IBE(350.1,+$PIECE(IBND,"^",3),0)):$PIECE(^(0),"^"),1:"UNKNOWN")
+8 if '$DATA(^TMP($JOB,"IB",IBATYP,"GCNT"))
SET ^("GCNT")=0
SET ^("GCNT")=^("GCNT")+1
+9 if '$DATA(^TMP($JOB,"IB",IBATYP,"GTOT"))
SET ^("GTOT")=0
SET ^("GTOT")=^("GTOT")+$PIECE(IBND,"^",7)
+10 if '$DATA(^TMP($JOB,"IBTOT","FCNT"))
SET ^("FCNT")=0
SET ^("FCNT")=^("FCNT")+1
+11 if '$DATA(^TMP($JOB,"IBTOT","FTOT"))
SET ^("FTOT")=0
SET ^("FTOT")=^("FTOT")+$PIECE(IBND,"^",7)
+12 QUIT
+13 ;
+14 ;
PRINT ; -output data
+1 SET IBQUIT=0
SET IBPAG=0
SET Y=DT
DO D^DIQ
SET IBHDT=Y
DO HDR
+2 WRITE !!?((IOM-25)/2),"TOTALS BY ACTION TYPE"
+3 ;
+4 SET IBATYP=""
FOR IBT=0:0
SET IBATYP=$ORDER(^TMP($JOB,"IB",IBATYP))
if IBATYP=""!(IBQUIT)
QUIT
DO LINE
+5 QUIT
+6 ;
TPRINT ; -grand total of data
+1 IF $Y>(IOSL-5)
DO PAUSE^IBOUTL
if IBQUIT
QUIT
DO HDR
+2 WRITE !!,?(IOM-26/2),"**************************"
+3 WRITE !,?((IOM/2)-20),"TOTAL NUMBER OF ENTRIES: ",$JUSTIFY($SELECT($DATA(^TMP($JOB,"IBTOT","FCNT")):^("FCNT"),1:0),13)
+4 WRITE !,?((IOM/2)-20)," TOTAL DOLLAR AMOUNT: $",$JUSTIFY($SELECT($DATA(^TMP($JOB,"IBTOT","FTOT")):^("FTOT"),1:0),12,2)
+5 QUIT
+6 ;
LINE ;
+1 IF $Y>(IOSL-5)
DO PAUSE^IBOUTL
if IBQUIT
QUIT
DO HDR
+2 WRITE !!?((IOM/2)-$LENGTH($PIECE(IBATYP," ",2,99))),$PIECE(IBATYP," ",2,99)
+3 WRITE !?((IOM/2)-12),"NUMBER ENTRIES: ",$JUSTIFY($SELECT($DATA(^TMP($JOB,"IB",IBATYP,"GCNT")):^("GCNT"),1:0),9)
+4 WRITE !?((IOM/2)-12),"DOLLAR AMOUNT: $",$JUSTIFY($SELECT($DATA(^TMP($JOB,"IB",IBATYP,"GTOT")):^("GTOT"),1:0),9,2)
+5 QUIT
+6 ;
HDR ;
+1 if $EXTRACT(IOST,1,2)["C-"!(IBPAG>0)
WRITE !,@IOF
+2 WRITE ?((IOM-42)/2),"Count and Dollar Amount 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-26/2),"Date Printed: ",IBHDT
+7 SET IBPAG=IBPAG+1
WRITE !?(IOM-8/2),"Page: ",IBPAG
+8 WRITE !?(IOM-26/2),"--------------------------"
+9 QUIT
+10 ;
END KILL ^TMP($JOB)
+1 ;***
+2 IF $DATA(ZTQUEUED)
SET ZTREQ="@"
QUIT
+3 KILL DFN,IBT,IBATYP,IBHDT,IBPAG,IBSNM,IBFAC,IBSITE,IBN,IBND,IBQUIT,POP,X,Y
+4 DO ^%ZISC
+5 QUIT