IBCERP6 ;ALB/JEH - MRA/EDI CLAIMS READY FOR EXTRACT ;12/10/99
;;2.0;INTEGRATED BILLING;**137,211,155,348,349,592**;21-MAR-94;Build 58
;;Per VA Directive 6402, this routine should not be modified.
;
EN ;Entry point from option
W !!,"This report provides a list of claims held in a"
W !,"Ready for Extract status. Users can select all bills"
W !,"in a Ready for extract status or only those trapped due to"
W !,"the EDI/MRA Parameters being turned off."
;
S IBQUIT=0 D SELECT I IBQUIT G ENQ1
S IBQUIT=0 D PARAM I IBQUIT G ENQ1
;
W !!,"This report requires a 132 column printer.",!!
; - Ask device
N %ZIS,ZTRTN,ZTSAVE,ZTDESC
S %ZIS="QM" D ^%ZIS G:POP ENQ1
I $D(IO("Q")) D G ENQ1
.S ZTRTN="BLD^IBCERP6",ZTDESC="IB - EDI/MRA Claims in Waiting Transmission Status"
.S ZTSAVE("IB*")=""
.D ^%ZTLOAD
.W !!,$S($D(ZTSK):"Your task number"_ZTSK_" has been queued.",1:"Unable to queue this job.")
.K ZTSK,IO("Q") D HOME^%ZIS
U IO
;
BLD ; - Tasked entry point
;
N IBSTAT,IBILL,IBREC,IBIFN,IBSTAT,IBVSIT,IBCAT,IBI,IBINS,IBPREC,IBEVDT,IBTYP,IBPG,IBCHK
K ^TMP("IBCERP6",$J)
S (IBI,IBIFN)=0 F S IBI=$O(^IBA(364,"ASTAT","X",IBI)) Q:'IBI S IBIFN=+$G(^IBA(364,IBI,0)) D
.S IBQUIT=0
.S IBSTAT=$$WNRBILL^IBEFUNC(IBIFN)
.I IBSEL=2 D I IBQUIT Q
..I 'IBSTAT,13[IBPARAM S IBQUIT=1 Q
..I IBSTAT,23[IBPARAM S IBQUIT=1 Q
.S IBSTAT=$S(IBSTAT:"MRA",1:"EDI")
.S IBREC=$G(^DGCR(399,+IBIFN,0))
.S IBVSIT=$S($$INPAT^IBCEF(IBIFN,1)=1:"INP",1:"OPT")
.;JWS;IB*2.0*592:Dental form 7
.S IBCAT=$S($$FT^IBCEF(IBIFN)=3:"UB04",$$FT^IBCEF(IBIFN)=7:"J430D",1:"1500")
.S IBILL=$$BN1^PRCAFN(IBIFN)
.S IBINS=$P($G(^DIC(36,+$$CURR^IBCEF2(IBIFN),0)),U)
.S IBPREC=$$PT^IBEFUNC(+$P(IBREC,U,2))
.S IBEVDT=$P($G(^DGCR(399,IBIFN,"U")),U) ;Statement from date
.;S IBTYP=$P(IBREC,U,24)_U_$P($G(^DGCR(399.1,+$P(IBREC,U,25),0)),U)_U_$P(IBREC,U,26)
.S IBTYP=$$GET1^DIQ(399,IBIFN,.24)_U_$$GET1^DIQ(399,IBIFN,.25)_U_$$GET1^DIQ(399,IBIFN,.26)
.S ^TMP("IBCERP6",$J,IBSTAT,IBILL)=IBILL_U_IBVSIT_U_IBCAT_U_$P(IBPREC,U)_U_$E($P(IBPREC,U,2),8,11)_U_IBEVDT_U_IBTYP_U_IBINS
;
PRINT ;Prints report
S (IBQUIT,IBPG,IBEDI,IBMRA,IBTOT)=0 D HDR
I '$D(^TMP("IBCERP6",$J)) W !!,"There are no "_$S(IBPARAM=1:"EDI",IBPARAM=2:"MRA",1:"EDI/MRA")_" records"_$S(IBSEL=2:" trapped",1:"")_" in a ready for extract status" G ENQ1
S IBSTAT="" F S IBSTAT=$O(^TMP("IBCERP6",$J,IBSTAT)) Q:IBSTAT=""!(IBQUIT=1) D
.S IBILL="" F S IBILL=$O(^TMP("IBCERP6",$J,IBSTAT,IBILL)) Q:IBILL=""!(IBQUIT=1) S IBREC=^(IBILL) D
..I ($Y+5)>IOSL D I IBQUIT Q
...D ASK I IBQUIT Q
...D HDR
..;
..W !,?2,$P(IBREC,U),?15,$P(IBREC,U,2),?22,$P(IBREC,U,3)
..W ?28,$E($P(IBREC,U,4),1,20),?50,$P(IBREC,U,5)
..W ?57,$$FMTE^XLFDT($P(IBREC,U,6)),?73,$E($P(IBREC,U,7),1,8)_", "_$E($P(IBREC,U,8),1,3)_", "_$E($P(IBREC,U,9),1,16),?110,$E($P(IBREC,U,10),1,20)
..I IBSTAT="EDI" S IBEDI=IBEDI+1
..E S IBMRA=IBMRA+1
..S IBTOT=IBTOT+1
W !!
I IBEDI>0 W !,?3,"Total EDI Bills ",IBEDI
I IBMRA>0 W !,?3,"Total MRA Bills ",IBMRA
W !!,?3,"Total bills ",IBTOT
K ^TMP("IBCERP6",$J)
I $D(ZTQUEUED) S ZTREQ="@"
I '$D(ZTQUEUED) D ^%ZISC
ENQ1 K IBPARAM,IBQUIT,IBSEL,Y,IBEDI,IBMRA,IBTOT Q
;
PARAM ;
S IBPARAM=$P($G(^IBE(350.9,1,8)),U,10) ;Get MRA/EDI site parameter setting
I IBPARAM="" D
.W !!,"Your EDI/MRA site parameter setting is incomplete."
.W !,"Please contact your coordinator.",!
.S IBQUIT=1
;
I IBSEL=2,IBPARAM=3 D
.W !!,"Your site parameters are set to allow both EDI and MRA"
.W !,"transmissions. There is no need to run this report.",!
.S IBQUIT=1
Q
;
HDR ;Prints report heading
; IB*2.0*211
;I $E(IOST,1,2)="C-" W @IOF,*13
I $S(IBPG:1,1:$E(IOST,1,2)="C-") W @IOF,*13
S IBPG=IBPG+1
W !!,?45,$S(IBSEL=2:"Trapped ",1:"")_" Claims Ready for Extract",?90,$$FMTE^XLFDT(DT),?110,"Page: ",IBPG
W !!,?15,"Inpt/",?23,"Inst/",!,?4,"Bill #",?15,"Opt",?23,"Prof",?32,"Name"
W ?51,"SSN",?57,"Statement Date",?89,"Type",?110,"Insurance Co."
W !,$TR($J("",IOM)," ","=")
Q
;
ASK ;
I $E(IOST,1,2)'["C-" Q
N DIR,DIROUT,DIRUT,DTOUT,DUOUT
S DIR(0)="E" D ^DIR
I ($D(DIRUT))!($D(DUOUT)) S IBQUIT=1 Q
Q
;
SELECT ;Report selection
N DIR,DIROUT,DTOUT,DUOUT,DTOUT
S IBSEL=0
W !! S DIR("A",1)="Do you want to print a list of:"
S DIR("A",2)=""
S DIR("A",3)=" 1 - All bills in Ready for Extract status"
S DIR("A",4)=" 2 - Bills trapped due to EDI/MRA parameter being turned off"
S DIR("A",5)=""
S DIR(0)="SAXB^1:All bills;2:Trapped bills"
W !
S DIR("A")="Select Number: ",DIR("B")=1
D ^DIR
I +Y'>0 S IBQUIT=1 Q
S IBSEL=+Y
Q
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HIBCERP6 4613 printed Nov 22, 2024@17:22:24 Page 2
IBCERP6 ;ALB/JEH - MRA/EDI CLAIMS READY FOR EXTRACT ;12/10/99
+1 ;;2.0;INTEGRATED BILLING;**137,211,155,348,349,592**;21-MAR-94;Build 58
+2 ;;Per VA Directive 6402, this routine should not be modified.
+3 ;
EN ;Entry point from option
+1 WRITE !!,"This report provides a list of claims held in a"
+2 WRITE !,"Ready for Extract status. Users can select all bills"
+3 WRITE !,"in a Ready for extract status or only those trapped due to"
+4 WRITE !,"the EDI/MRA Parameters being turned off."
+5 ;
+6 SET IBQUIT=0
DO SELECT
IF IBQUIT
GOTO ENQ1
+7 SET IBQUIT=0
DO PARAM
IF IBQUIT
GOTO ENQ1
+8 ;
+9 WRITE !!,"This report requires a 132 column printer.",!!
+10 ; - Ask device
+11 NEW %ZIS,ZTRTN,ZTSAVE,ZTDESC
+12 SET %ZIS="QM"
DO ^%ZIS
if POP
GOTO ENQ1
+13 IF $DATA(IO("Q"))
Begin DoDot:1
+14 SET ZTRTN="BLD^IBCERP6"
SET ZTDESC="IB - EDI/MRA Claims in Waiting Transmission Status"
+15 SET ZTSAVE("IB*")=""
+16 DO ^%ZTLOAD
+17 WRITE !!,$SELECT($DATA(ZTSK):"Your task number"_ZTSK_" has been queued.",1:"Unable to queue this job.")
+18 KILL ZTSK,IO("Q")
DO HOME^%ZIS
End DoDot:1
GOTO ENQ1
+19 USE IO
+20 ;
BLD ; - Tasked entry point
+1 ;
+2 NEW IBSTAT,IBILL,IBREC,IBIFN,IBSTAT,IBVSIT,IBCAT,IBI,IBINS,IBPREC,IBEVDT,IBTYP,IBPG,IBCHK
+3 KILL ^TMP("IBCERP6",$JOB)
+4 SET (IBI,IBIFN)=0
FOR
SET IBI=$ORDER(^IBA(364,"ASTAT","X",IBI))
if 'IBI
QUIT
SET IBIFN=+$GET(^IBA(364,IBI,0))
Begin DoDot:1
+5 SET IBQUIT=0
+6 SET IBSTAT=$$WNRBILL^IBEFUNC(IBIFN)
+7 IF IBSEL=2
Begin DoDot:2
+8 IF 'IBSTAT
IF 13[IBPARAM
SET IBQUIT=1
QUIT
+9 IF IBSTAT
IF 23[IBPARAM
SET IBQUIT=1
QUIT
End DoDot:2
IF IBQUIT
QUIT
+10 SET IBSTAT=$SELECT(IBSTAT:"MRA",1:"EDI")
+11 SET IBREC=$GET(^DGCR(399,+IBIFN,0))
+12 SET IBVSIT=$SELECT($$INPAT^IBCEF(IBIFN,1)=1:"INP",1:"OPT")
+13 ;JWS;IB*2.0*592:Dental form 7
+14 SET IBCAT=$SELECT($$FT^IBCEF(IBIFN)=3:"UB04",$$FT^IBCEF(IBIFN)=7:"J430D",1:"1500")
+15 SET IBILL=$$BN1^PRCAFN(IBIFN)
+16 SET IBINS=$PIECE($GET(^DIC(36,+$$CURR^IBCEF2(IBIFN),0)),U)
+17 SET IBPREC=$$PT^IBEFUNC(+$PIECE(IBREC,U,2))
+18 ;Statement from date
SET IBEVDT=$PIECE($GET(^DGCR(399,IBIFN,"U")),U)
+19 ;S IBTYP=$P(IBREC,U,24)_U_$P($G(^DGCR(399.1,+$P(IBREC,U,25),0)),U)_U_$P(IBREC,U,26)
+20 SET IBTYP=$$GET1^DIQ(399,IBIFN,.24)_U_$$GET1^DIQ(399,IBIFN,.25)_U_$$GET1^DIQ(399,IBIFN,.26)
+21 SET ^TMP("IBCERP6",$JOB,IBSTAT,IBILL)=IBILL_U_IBVSIT_U_IBCAT_U_$PIECE(IBPREC,U)_U_$EXTRACT($PIECE(IBPREC,U,2),8,11)_U_IBEVDT_U_IBTYP_U_IBINS
End DoDot:1
+22 ;
PRINT ;Prints report
+1 SET (IBQUIT,IBPG,IBEDI,IBMRA,IBTOT)=0
DO HDR
+2 IF '$DATA(^TMP("IBCERP6",$JOB))
WRITE !!,"There are no "_$SELECT(IBPARAM=1:"EDI",IBPARAM=2:"MRA",1:"EDI/MRA")_" records"_$SELECT(IBSEL=2:" trapped",1:"")_" in a ready for extract status"
GOTO ENQ1
+3 SET IBSTAT=""
FOR
SET IBSTAT=$ORDER(^TMP("IBCERP6",$JOB,IBSTAT))
if IBSTAT=""!(IBQUIT=1)
QUIT
Begin DoDot:1
+4 SET IBILL=""
FOR
SET IBILL=$ORDER(^TMP("IBCERP6",$JOB,IBSTAT,IBILL))
if IBILL=""!(IBQUIT=1)
QUIT
SET IBREC=^(IBILL)
Begin DoDot:2
+5 IF ($Y+5)>IOSL
Begin DoDot:3
+6 DO ASK
IF IBQUIT
QUIT
+7 DO HDR
End DoDot:3
IF IBQUIT
QUIT
+8 ;
+9 WRITE !,?2,$PIECE(IBREC,U),?15,$PIECE(IBREC,U,2),?22,$PIECE(IBREC,U,3)
+10 WRITE ?28,$EXTRACT($PIECE(IBREC,U,4),1,20),?50,$PIECE(IBREC,U,5)
+11 WRITE ?57,$$FMTE^XLFDT($PIECE(IBREC,U,6)),?73,$EXTRACT($PIECE(IBREC,U,7),1,8)_", "_$EXTRACT($PIECE(IBREC,U,8),1,3)_", "_$EXTRACT($PIECE(IBREC,U,9),1,16),?110,$EXTRACT($PIECE(IBREC,U,10),1,20)
+12 IF IBSTAT="EDI"
SET IBEDI=IBEDI+1
+13 IF '$TEST
SET IBMRA=IBMRA+1
+14 SET IBTOT=IBTOT+1
End DoDot:2
End DoDot:1
+15 WRITE !!
+16 IF IBEDI>0
WRITE !,?3,"Total EDI Bills ",IBEDI
+17 IF IBMRA>0
WRITE !,?3,"Total MRA Bills ",IBMRA
+18 WRITE !!,?3,"Total bills ",IBTOT
+19 KILL ^TMP("IBCERP6",$JOB)
+20 IF $DATA(ZTQUEUED)
SET ZTREQ="@"
+21 IF '$DATA(ZTQUEUED)
DO ^%ZISC
ENQ1 KILL IBPARAM,IBQUIT,IBSEL,Y,IBEDI,IBMRA,IBTOT
QUIT
+1 ;
PARAM ;
+1 ;Get MRA/EDI site parameter setting
SET IBPARAM=$PIECE($GET(^IBE(350.9,1,8)),U,10)
+2 IF IBPARAM=""
Begin DoDot:1
+3 WRITE !!,"Your EDI/MRA site parameter setting is incomplete."
+4 WRITE !,"Please contact your coordinator.",!
+5 SET IBQUIT=1
End DoDot:1
+6 ;
+7 IF IBSEL=2
IF IBPARAM=3
Begin DoDot:1
+8 WRITE !!,"Your site parameters are set to allow both EDI and MRA"
+9 WRITE !,"transmissions. There is no need to run this report.",!
+10 SET IBQUIT=1
End DoDot:1
+11 QUIT
+12 ;
HDR ;Prints report heading
+1 ; IB*2.0*211
+2 ;I $E(IOST,1,2)="C-" W @IOF,*13
+3 IF $SELECT(IBPG:1,1:$EXTRACT(IOST,1,2)="C-")
WRITE @IOF,*13
+4 SET IBPG=IBPG+1
+5 WRITE !!,?45,$SELECT(IBSEL=2:"Trapped ",1:"")_" Claims Ready for Extract",?90,$$FMTE^XLFDT(DT),?110,"Page: ",IBPG
+6 WRITE !!,?15,"Inpt/",?23,"Inst/",!,?4,"Bill #",?15,"Opt",?23,"Prof",?32,"Name"
+7 WRITE ?51,"SSN",?57,"Statement Date",?89,"Type",?110,"Insurance Co."
+8 WRITE !,$TRANSLATE($JUSTIFY("",IOM)," ","=")
+9 QUIT
+10 ;
ASK ;
+1 IF $EXTRACT(IOST,1,2)'["C-"
QUIT
+2 NEW DIR,DIROUT,DIRUT,DTOUT,DUOUT
+3 SET DIR(0)="E"
DO ^DIR
+4 IF ($DATA(DIRUT))!($DATA(DUOUT))
SET IBQUIT=1
QUIT
+5 QUIT
+6 ;
SELECT ;Report selection
+1 NEW DIR,DIROUT,DTOUT,DUOUT,DTOUT
+2 SET IBSEL=0
+3 WRITE !!
SET DIR("A",1)="Do you want to print a list of:"
+4 SET DIR("A",2)=""
+5 SET DIR("A",3)=" 1 - All bills in Ready for Extract status"
+6 SET DIR("A",4)=" 2 - Bills trapped due to EDI/MRA parameter being turned off"
+7 SET DIR("A",5)=""
+8 SET DIR(0)="SAXB^1:All bills;2:Trapped bills"
+9 WRITE !
+10 SET DIR("A")="Select Number: "
SET DIR("B")=1
+11 DO ^DIR
+12 IF +Y'>0
SET IBQUIT=1
QUIT
+13 SET IBSEL=+Y
+14 QUIT