IBCERP1 ;ALB/CXW - BILL AWAITING RESUBMISSION REPORT ;20-APR-99
;;2.0;INTEGRATED BILLING;**137**;21-MAR-94
Q
INC ; Report of bill awaiting resubmission/cancel
N DIR,Y,IBSORT,DIRUT,DIROUT,DTOUT,DUOUT
S DIR(0)="SBM^B:BILL NUMBER;L:LAST SENT DATE;A:BILLED AMOUNT;N:BATCH NUMBER"
S DIR("A")="SORT REPORT BY",DIR("B")="BILL NUMBER"
S DIR("?")="Select the order you want the report sorted in" D ^DIR K DIR
Q:$D(DTOUT)!($D(DUOUT))
S IBSORT=Y
;
N %ZIS,ZTSAVE,ZTRTN,ZTDESC
S %ZIS="QM" D ^%ZIS Q:POP
I $D(IO("Q")) K IO("Q") S ZTRTN="EN^IBCERP1",ZTSAVE("IBSORT")="",ZTDESC="IB - Bills Awaiting Resubmission Report" D ^%ZTLOAD K ZTSK D HOME^%ZIS Q
U IO
EN ; Queued job entrypoint
N IBSTOP,IBPAGE,IBLINE,IB,IB0,IB1,IBB,IBB0,IBB1,IBBIL,IBHDRDT,DIR,Y
W:$E(IOST,1,2)["C-" @IOF ;Only initial form feed for print to screen
K ^TMP($J,"IBSORT")
S IB=0 F S IB=$O(^IBA(364.1,"AINC",1,IB)) Q:'IB D
. S IBLDT=+$P($G(^IBA(364.1,IB,1)),"^",3)
. S IBB=0 F S IBB=$O(^IBA(364,"C",IB,IBB)) Q:'IBB S IBB0=$G(^IBA(364,IBB,0)) D
.. ;Q:$$LAST364^IBCEF4(+IBB0)'=IBB
.. S ^TMP($J,"IBSORT",$S(IBSORT="B":$$BN1^PRCAFN(+IBB0),IBSORT="L":IBLDT,IBSORT="A":-$P($G(^DGCR(399,+IBB0,"U1")),U),1:IB),IBB)=IB
LIST ;display
S (IBSTOP,IBPAGE)=0 D HDR1
I '$D(^TMP($J,"IBSORT")) D G INCQ
. W !,?7,"No entries found for this report"
S IBB1="" F S IBB1=$O(^TMP($J,"IBSORT",IBB1)) Q:IBB1=""!(IBSTOP) S IBB=0 F S IBB=$O(^TMP($J,"IBSORT",IBB1,IBB)) Q:'IBB D Q:IBSTOP
. S IB0=$G(^IBA(364.1,+$G(^TMP($J,"IBSORT",IBB1,IBB)),0)),IB1=$G(^(1))
. S IB=$G(^IBA(364,IBB,0)),IBBIL=$$BN1^PRCAFN(+IB)
. S:IBBIL=-1 IBBIL=""
. I ($Y+5)>IOSL D HDR1 Q:IBSTOP
. W !,?0,IBBIL,?13,$P(IB0,U),?25,$$FMTE^XLFDT($P(IB1,U,3),2),?41,$E($$EXPAND^IBTRE(364,.03,$P(IB,U,3)),1,24),?67,"$"_$J(+$G(^DGCR(399,+IB,"U1")),0,2)
W !
G:IBSTOP INCQ
I $E(IOST,1,2)["C-" K DIR S DIR(0)="E" D ^DIR K DIR
INCQ K ^TMP($J,"IBSORT")
I $D(ZTQUEUED) S ZTREQ="@"
I '$D(ZTQUEUED) W ! D ^%ZISC
Q
HDR1 ;
N DIR,Y
I 'IBPAGE S IBHDRDT=$$HTE^XLFDT($H,"2")
I IBPAGE D Q:IBSTOP
. I $E(IOST,1,2)["C-" K DIR S DIR(0)="E" D ^DIR K DIR S IBSTOP=('Y) Q:IBSTOP
. W @IOF
S IBPAGE=IBPAGE+1
W !,?23,"BILLS AWAITING RESUBMISSION REPORT",?65,"PAGE: ",IBPAGE,!,?27,"RUN DATE: ",IBHDRDT,!
W !,?2,"SORT BY: ",$S(IBSORT="B":"BILL NUMBER",IBSORT="L":"LAST SENT DATE",IBSORT="A":"BILLED AMOUNT",1:"BATCH NUMBER"),!
W !,?13,"LAST SENT",?25,"LAST SENT",?67,"BILLED"
W !,"BILL NUMBER",?13,"IN BATCH #",?25,"DATE/TIME",?41,"BILL TRANSMISSION STATUS",?67,"AMOUNT"
W !,$TR($J("",80)," ","-"),!
Q
;
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HIBCERP1 2577 printed Dec 13, 2024@02:12:14 Page 2
IBCERP1 ;ALB/CXW - BILL AWAITING RESUBMISSION REPORT ;20-APR-99
+1 ;;2.0;INTEGRATED BILLING;**137**;21-MAR-94
+2 QUIT
INC ; Report of bill awaiting resubmission/cancel
+1 NEW DIR,Y,IBSORT,DIRUT,DIROUT,DTOUT,DUOUT
+2 SET DIR(0)="SBM^B:BILL NUMBER;L:LAST SENT DATE;A:BILLED AMOUNT;N:BATCH NUMBER"
+3 SET DIR("A")="SORT REPORT BY"
SET DIR("B")="BILL NUMBER"
+4 SET DIR("?")="Select the order you want the report sorted in"
DO ^DIR
KILL DIR
+5 if $DATA(DTOUT)!($DATA(DUOUT))
QUIT
+6 SET IBSORT=Y
+7 ;
+8 NEW %ZIS,ZTSAVE,ZTRTN,ZTDESC
+9 SET %ZIS="QM"
DO ^%ZIS
if POP
QUIT
+10 IF $DATA(IO("Q"))
KILL IO("Q")
SET ZTRTN="EN^IBCERP1"
SET ZTSAVE("IBSORT")=""
SET ZTDESC="IB - Bills Awaiting Resubmission Report"
DO ^%ZTLOAD
KILL ZTSK
DO HOME^%ZIS
QUIT
+11 USE IO
EN ; Queued job entrypoint
+1 NEW IBSTOP,IBPAGE,IBLINE,IB,IB0,IB1,IBB,IBB0,IBB1,IBBIL,IBHDRDT,DIR,Y
+2 ;Only initial form feed for print to screen
if $EXTRACT(IOST,1,2)["C-"
WRITE @IOF
+3 KILL ^TMP($JOB,"IBSORT")
+4 SET IB=0
FOR
SET IB=$ORDER(^IBA(364.1,"AINC",1,IB))
if 'IB
QUIT
Begin DoDot:1
+5 SET IBLDT=+$PIECE($GET(^IBA(364.1,IB,1)),"^",3)
+6 SET IBB=0
FOR
SET IBB=$ORDER(^IBA(364,"C",IB,IBB))
if 'IBB
QUIT
SET IBB0=$GET(^IBA(364,IBB,0))
Begin DoDot:2
+7 ;Q:$$LAST364^IBCEF4(+IBB0)'=IBB
+8 SET ^TMP($JOB,"IBSORT",$SELECT(IBSORT="B":$$BN1^PRCAFN(+IBB0),IBSORT="L":IBLDT,IBSORT="A":-$PIECE($GET(^DGCR(399,+IBB0,"U1")),U),1:IB),IBB)=IB
End DoDot:2
End DoDot:1
LIST ;display
+1 SET (IBSTOP,IBPAGE)=0
DO HDR1
+2 IF '$DATA(^TMP($JOB,"IBSORT"))
Begin DoDot:1
+3 WRITE !,?7,"No entries found for this report"
End DoDot:1
GOTO INCQ
+4 SET IBB1=""
FOR
SET IBB1=$ORDER(^TMP($JOB,"IBSORT",IBB1))
if IBB1=""!(IBSTOP)
QUIT
SET IBB=0
FOR
SET IBB=$ORDER(^TMP($JOB,"IBSORT",IBB1,IBB))
if 'IBB
QUIT
Begin DoDot:1
+5 SET IB0=$GET(^IBA(364.1,+$GET(^TMP($JOB,"IBSORT",IBB1,IBB)),0))
SET IB1=$GET(^(1))
+6 SET IB=$GET(^IBA(364,IBB,0))
SET IBBIL=$$BN1^PRCAFN(+IB)
+7 if IBBIL=-1
SET IBBIL=""
+8 IF ($Y+5)>IOSL
DO HDR1
if IBSTOP
QUIT
+9 WRITE !,?0,IBBIL,?13,$PIECE(IB0,U),?25,$$FMTE^XLFDT($PIECE(IB1,U,3),2),?41,$EXTRACT($$EXPAND^IBTRE(364,.03,$PIECE(IB,U,3)),1,24),?67,"$"_$JUSTIFY(+$GET(^DGCR(399,+IB,"U1")),0,2)
End DoDot:1
if IBSTOP
QUIT
+10 WRITE !
+11 if IBSTOP
GOTO INCQ
+12 IF $EXTRACT(IOST,1,2)["C-"
KILL DIR
SET DIR(0)="E"
DO ^DIR
KILL DIR
INCQ KILL ^TMP($JOB,"IBSORT")
+1 IF $DATA(ZTQUEUED)
SET ZTREQ="@"
+2 IF '$DATA(ZTQUEUED)
WRITE !
DO ^%ZISC
+3 QUIT
HDR1 ;
+1 NEW DIR,Y
+2 IF 'IBPAGE
SET IBHDRDT=$$HTE^XLFDT($HOROLOG,"2")
+3 IF IBPAGE
Begin DoDot:1
+4 IF $EXTRACT(IOST,1,2)["C-"
KILL DIR
SET DIR(0)="E"
DO ^DIR
KILL DIR
SET IBSTOP=('Y)
if IBSTOP
QUIT
+5 WRITE @IOF
End DoDot:1
if IBSTOP
QUIT
+6 SET IBPAGE=IBPAGE+1
+7 WRITE !,?23,"BILLS AWAITING RESUBMISSION REPORT",?65,"PAGE: ",IBPAGE,!,?27,"RUN DATE: ",IBHDRDT,!
+8 WRITE !,?2,"SORT BY: ",$SELECT(IBSORT="B":"BILL NUMBER",IBSORT="L":"LAST SENT DATE",IBSORT="A":"BILLED AMOUNT",1:"BATCH NUMBER"),!
+9 WRITE !,?13,"LAST SENT",?25,"LAST SENT",?67,"BILLED"
+10 WRITE !,"BILL NUMBER",?13,"IN BATCH #",?25,"DATE/TIME",?41,"BILL TRANSMISSION STATUS",?67,"AMOUNT"
+11 WRITE !,$TRANSLATE($JUSTIFY("",80)," ","-"),!
+12 QUIT
+13 ;