ABMUVBCH ; IHS/SD/SDR - 3PB/UFMS View Batch option
;;2.6;IHS Third Party Billing;**1,3,9,11,21**;NOV 12, 2009;Build 379
; View Batch
;IHS/SD/SDR v2.6 p1 NO HEAT - Added totals for cash. sessions
;IHS/SD/SDR 2.6 p9 HEAT28995 - added screen so only exports from current DUZ(2) display
;IHS/SD/SDR v2.6 p11 added V to list of codes
;IHS/SD/SDR 2.6*21 split to ABMUVBC2
;IHS/SD/SDR 2.6*21 HEAT129446 - Made change so insurer type would show correctly on report; was blank because of code
; change made in p11.
;
START ;START HERE
; Find requested UFMS export batch in UFMS export file
BEG ;Find beg. export batch
S ABMTRIBL=$P($G(^ABMDPARM(DUZ(2),1,4)),U,14)
W !
K DIC,DIE,X,Y,DA
S DIC="^ABMUTXMT("
S DIC(0)="AEMQ"
S DIC("A")="Select beginning export: "
S ABMSCRND=$P($G(^ABMDPARM(DUZ(2),1,4)),U,16) ;only show limited entries
S DIC("S")="I $P(^(0),U,4)=DUZ(2) S X1=DT,X2=$P(^ABMUTXMT(Y,0),U) D ^%DTC I X<ABMSCRND" ;abm*2.6*9 HEAT28995
D ^DIC
Q:Y<0
S ABME("XMITB")=+Y
END ;Find end. export batch
W !
S DIC("A")="Select ending export: "
D ^DIC
K DIC
Q:Y<0
S ABME("XMITE")=+Y
I ABME("XMITE")<ABME("XMITB") W !!,"INVALID RANGE!" G BEG
SUMDET ;summary or detail?
K DIC,DIE,DIR,X,Y,DA
S DIR(0)="S^S:SUMMARY;D:DETAIL;P:SUMMARY WITH EXPORT PAGE;X:DETAIL WITH EXPORT PAGE;G:GRAND TOTAL ALL FILES BY TRANSMISSION DATE"
S DIR("A")="SUMMARY OR DETAIL"
S DIR("B")="SUMMARY"
D ^DIR K DIR
S ABMSUMDT=Y
K ABMSAV
SEL ;Select device
S %ZIS="NQ"
S %ZIS("A")="Enter DEVICE: "
D ^%ZIS Q:POP
I IO'=IO(0) D QUE,HOME^%ZIS S DIR(0)="E" D ^DIR K DIR Q
I $D(IO("S")) S IOP=ION D ^%ZIS
PRINT ;EP
;Callable point for queuing
S ABME("PG")=0
S ABMP("XMIT")=ABME("XMITB")-1
D SET Q:(IOST["C")&(($G(Y)=0)!($D(DIRUT)!$D(DIROUT)!$D(DTOUT)!$D(DUOUT)))
W !!,$$EN^ABMVDF("HIN"),"E N D O F R E P O R T",$$EN^ABMVDF("HIF"),!
I $E(IOST)="C" S DIR(0)="E" D ^DIR K DIR
I $E(IOST)="P" W $$EN^ABMVDF("IOF")
I $D(IO("S")) D ^%ZISC
K ABME
Q
SET ;SET UP SOME THINGS
D SET^ABMUVBC2 ;abm*2.6*21 IHS/SD/SDR split routine
Q
LOOP ; Loop through bills of specified batch to gather data and print report
D LOOP^ABMUVBC2 ;abm*2.6*21 IHS/SD/SDR split routine
Q
SUMMARY ;
K ABMDUZ2,ABMBDFN
S ABME(ABMBAOUT)=+$G(ABME(ABMBAOUT))+1 ;cnt budget activity bills
S ABMDUZ2=$P($G(^ABMUTXMT(ABMP("XMIT"),ABMLOOP,ABMUS,2,ABMSDT,11,ABMBA,2,ABMBIEN,0)),U,2)
S ABMBDFN=$P($G(^ABMUTXMT(ABMP("XMIT"),ABMLOOP,ABMUS,2,ABMSDT,11,ABMBA,2,ABMBIEN,0)),U,3)
S ABME(ABMBAOUT,"AMT")=+$G(ABME(ABMBAOUT,"AMT"))+($P($G(^ABMDBILL(ABMDUZ2,ABMBDFN,2)),U)) ;cnt bill amt
S ABME("CNT")=+$G(ABME("CNT"))+1 ;cnt total bills
S ABME("TOT")=+$G(ABME("TOT"))+($P($G(^ABMDBILL(ABMDUZ2,ABMBDFN,2)),U)) ;cnt total bill amt
I $P($G(^ABMUTXMT(ABMP("XMIT"),ABMLOOP,ABMUS,2,ABMSDT,11,ABMBA,2,ABMBIEN,0)),U,5)=1 D ;excluded bills
.S ABMEXCNT=+$G(ABMEXCNT)+1
.S ABMEXAMT=+$G(ABMEXAMT)+($P($G(^ABMDBILL(ABMDUZ2,ABMBDFN,2)),U))
Q
DTAIL ;DISPLAY DETAIL
S ABME(ABMBAOUT)=+$G(ABME(ABMBAOUT))+1 ;cnt budget activity bills
S ABMDUZ2=$P($G(^ABMUTXMT(ABMP("XMIT"),ABMLOOP,ABMUS,2,ABMSDT,11,ABMBA,2,ABMBIEN,0)),U,2)
S ABMBDFN=$P($G(^ABMUTXMT(ABMP("XMIT"),ABMLOOP,ABMUS,2,ABMSDT,11,ABMBA,2,ABMBIEN,0)),U,3)
S ABME(21)=$P($G(^ABMDBILL(ABMDUZ2,ABMBDFN,2)),U)
S ABME(ABMBAOUT,"AMT")=$G(ABME(ABMBAOUT,"AMT"))+(ABME(21)) ;count bill amt
S ABME("CNT")=+$G(ABME("CNT"))+1 ;cnt total bills
S ABME("TOT")=+$G(ABME("TOT"))+(ABME(21)) ;cnt total bill amt
S ABME(71)=$$SDT^ABMDUTL($P($G(^ABMDBILL(ABMDUZ2,ABMBDFN,7)),U))
S ABME(1)=$P($G(^ABMDBILL(ABMDUZ2,ABMBDFN,0)),U)
S ABME(3)=$P($G(^ABMDBILL(ABMDUZ2,ABMBDFN,0)),U,3)
S ABME(5)=$P($G(^ABMDBILL(ABMDUZ2,ABMBDFN,0)),U,5)
S ABME(15)=$$SDT^ABMDUTL($P($G(^ABMDBILL(ABMDUZ2,ABMBDFN,1)),U,5))
S ABME("HRN")=$P($G(^AUPNPAT(+ABME(5),41,+ABMDUZ2,0)),U,2)
S ABME("SUFFIX")=$P($G(^ABMDPARM(ABME(3),1,2)),U,4)
W !,ABME("SUFFIX")
;W ?4,ABME(1),?13,ABME("HRN"),?21,$P($G(^DPT(+ABME(5),0)),U),?48,ABME(15) ;abm*2.6*1 NO HEAT
W ?4,ABME(1),?13,ABME("HRN"),?21,$E($P($G(^DPT(+ABME(5),0)),U),1,22),?45,ABME(15) ;abm*2.6*1 NO HEAT
;W ?59,ABME(71),?70,$J($FN(ABME(21),",",2),10) ;abm*2.6*1 NO HEAT
W ?57,ABME(71),?68,$J($FN(ABME(21),",",2),10) ;abm*2.6*1 NO HEAT
S ABMXMIT=$O(^ABMDBILL(ABMDUZ2,ABMBDFN,69,"B",ABMP("XMIT"),0))
;excluded/tribal data
I (ABMTRIBL=1),(+$G(ABMXMIT)'=0),($P($G(^ABMDBILL(ABMDUZ2,ABMBDFN,69,ABMXMIT,0)),U,3)=1) W "*"
I $Y+5>IOSL D HD Q:(IOST["C")&((+$G(Y)=0)!($D(DIRUT)!$D(DIROUT)!$D(DTOUT)!$D(DUOUT)))
Q
GLOOP ;Loop thru bills of specified batch to gather data and print report
D GLOOP^ABMUVBC2 ;abm*2.6*21 IHS/SD/SDR split routine
Q
GRANDTOT ;EP
S ABMDT=0
F S ABMDT=$O(ABMU(ABMDT)) Q:+ABMDT=0 D
.S ABMUS=0
.F S ABMUS=$O(ABMU(ABMDT,ABMUS)) Q:+ABMUS=0 D
..W !,"SESSION ID: ",ABMDT,?32,"BILLER: ",$S(ABMUS=1:"POS CLAIMS",1:$P($G(^VA(200,ABMUS,0)),U))
W !,ABMLINE
;
S ABMDUZ2=0
F S ABMDUZ2=$O(ABMT(ABMDUZ2)) Q:+ABMDUZ2=0 D
.W !,$P($G(^DIC(4,ABMDUZ2,0)),U) ;facility name
.S ABMBAOUT=""
.F S ABMBAOUT=$O(ABMT(ABMDUZ2,ABMBAOUT)) Q:ABMBAOUT="" D
..W !?3,ABMBAOUT,?26,$J(+$G(ABMT(ABMDUZ2,ABMBAOUT)),6),$S(+$G(ABMT(ABMDUZ2,ABMBAOUT))=1:" bill ",1:" bills")
..W ?40,$J($FN(ABMT(ABMDUZ2,ABMBAOUT,"AMT"),",",2),10)
..W ?55,$J(+$G(ABMT(ABMDUZ2,ABMBAOUT,"ECNT")),6)_$S(+$G(ABMT(ABMDUZ2,ABMBAOUT,"ECNT"))=1:" bill ",1:" bills")
..W ?65,$J($FN(+$G(ABMT(ABMDUZ2,ABMBAOUT,"EAMT")),",",2),10)
.W !?5,"Total for facility",?26,$J(+$G(ABM(ABMDUZ2,"CNT")),6),$S(+$G(ABM(ABMDUZ2,"CNT"))=1:" bill ",1:" bills")
.W ?40,$J($FN(ABM(ABMDUZ2,"TOT"),",",2),10),!
;
W !?5,$$EN^ABMVDF("HIN"),"TOTAL BILLS: ",$$EN^ABMVDF("HIF"),?26,$J(+$G(ABM("CNT")),6)_$S(+$G(ABM("CNT"))=1:" bill",1:" bills"),?$S($G(ABMSUMDT)="S":40,1:69),$J($FN(+$G(ABM("TOT")),",",2),10)
W ?55,$J(+$G(ABMEXCNT),6),$S(+$G(ABMEXCNT)=1:" bill",1:" bills"),?65,$J($FN(+$G(ABMEXAMT),",",2),10),!
;start new abm*2.6*3 NOHEAT
W !,$E(ABMLINE,1,3)_" EXPORT SUMMARY "_$E(ABMLINE,1,60)
S ABMBAOUT=""
F S ABMBAOUT=$O(ABMBAT(ABMBAOUT)) Q:($G(ABMBAOUT)="") D
.W !?2,ABMBAOUT,?26,$J(+$G(ABMBAT(ABMBAOUT,"CNT")),6),$S(+$G(ABMBAT(ABMBAOUT,"CNT"))=1:" bill ",1:" bills")
.W ?40,$J($FN(ABMBAT(ABMBAOUT,"AMT"),",",2),10)
.W ?55,$J(+$G(ABMBAT(ABMBAOUT,"ECNT")),6),$S(+$G(ABMBAT(ABMBAOUT,"ECNT"))=1:" bill ",1:" bills")
.W ?65,$J($FN(+$G(ABMBAT(ABMBAOUT,"EAMT")),",",2),10)
W !,ABMLINE
;end new abm*2.6*3 NOHEAT
W !!?5,"TOTAL EXPORTED: ",?26,$J((+$G(ABM("CNT"))-(+$G(ABMEXCNT))),6)_$S(+$G(ABM("CNT"))=1:" bill",1:" bills"),?40,$J($FN((+$G(ABM("TOT"))-(+$G(ABMEXAMT))),",",2),10)
;
S ABM("TOT")=0
Q
HD ;HEADER FOR DETAIL LISTING
I $G(ABME("PG")),($E(IOST)="C") S DIR(0)="E" D ^DIR K DIR Q:Y=0!$D(DIRUT)!$D(DIROUT)!$D(DTOUT)!$D(DUOUT)
S ABME("PG")=ABME("PG")+1
W $$EN^ABMVDF("IOF"),!,?30,$$EN^ABMVDF("HIN"),"UFMS EXPORT SUMMARY",?70,"Page: ",$$EN^ABMVDF("HIF"),ABME("PG")
W !,$$EN^ABMVDF("HIN"),"LOCATION: ",$$EN^ABMVDF("HIF"),$P($G(^AUTTLOC(ABME("LOC"),0)),U,2)
W !,$$EN^ABMVDF("HIN"),"EXPORT DATE: ",$$EN^ABMVDF("HIF"),ABME("BDATE")
W !,$$EN^ABMVDF("HIN"),"FILE NAME: ",$$EN^ABMVDF("HIF"),ABME("FNAME")
W !,$$EN^ABMVDF("HIN")
;
W "EXPORT(S) RESENT: ",$$EN^ABMVDF("HIF")
S ABMEU=0
F S ABMEU=$O(^ABMUTXMT(ABMP("XMIT"),1,ABMEU)) Q:+ABMEU=0 D
.S ABMEDT=""
.F S ABMEDT=$O(^ABMUTXMT(ABMP("XMIT"),1,ABMEU,2,ABMEDT)) Q:+$G(ABMEDT)=0 D
..S ABMREXP=0
..F S ABMREXP=$O(^ABMUTXMT(ABMP("XMIT"),1,ABMEU,2,ABMEDT,3,ABMREXP)) Q:+ABMREXP=0 D
...S ABMRXIEN=$P($G(^ABMUTXMT(ABMP("XMIT"),1,ABMEU,2,ABMEDT,3,ABMREXP,0)),U)
...S ABMRXFIL=$P($G(^ABMUTXMT(ABMRXIEN,0)),U,2),ABMREXPF=1
...W !?3,ABMRXFIL_" IN SESSION "_ABMEDT
I $G(ABMREXPF)'=1 W " <<NONE>>"
;
W !,$$EN^ABMVDF("HIN")
W ABME("EQ")
;
;I ABMSUMDT="D" D ;abm*2.6*1
I ABMSUMDT="D"!(ABMSUMDT="X") D ;abm*2.6*1
.W:(ABMTRIBL=1) !,"NOTE: ""*"" by amount means it was excluded from export"
.W !,?48,"APPROVAL",?60,"DATE OF"
.W !,"LOC",?4,"BILL #",?13,"HRN",?21,"PATIENT",?48,"DATE",?60,"SERVICE",?72,"AMOUNT"
;I ABMSAV="S" D ;abm*2.6*1
I "^S^P^"[("^"_ABMSAV_"^") D ;abm*2.6*1
.W !,?4,"BUDGET ACTIVITY",?35,"BILL COUNT",?50,"AMOUNT"
I ABMSAV="G" D
.W !,?4,"BUDGET ACTIVITY",?30,"BILL CNT",?43,"AMOUNT",?54,"EXCL.CNT",?67,"EXCL.AMT"
W !,ABME("-"),$$EN^ABMVDF("HIF")
Q
QUE ;QUE TO TASKMAN
S ZTRTN="PRINT^ABMUVBCH"
S ZTDESC="3P UFMS TX EXPORT SUMMARY"
S ZTSAVE("ABM*")=""
K ZTSK
D ^%ZTLOAD
W:$G(ZTSK) !,"Task # ",ZTSK," queued.",!
Q
STOT ;SITE TOTAL
W !!,$$EN^ABMVDF("HIN"),"SITE/BILL TYPE TOTAL:",$$EN^ABMVDF("HIF"),?68,$J($FN(ABME("STOT"),",",2),10)
S ABME("STOT")=0
Q
R ;;MEDICARE
MD ;;MEDICARE
MH ;;MEDICARE
MC ;;MEDICARE
MMC ;;MEDICARE
D ;;MEDICAID
K ;;MEDICAID
FPL ;;MEDICAID
F ;;PRIVATE INSURANCE
P ;;PRIVATE INSURANCE
H ;;PRIVATE INSURANCE
M ;;PRIVATE INSURANCE
N ;;OTHER
I ;;OTHER
W ;;OTHER
C ;;OTHER
G ;;OTHER
T ;;OTHER
SEP ;;OTHER
TSI ;;OTHER
V ;;VET
ABMUVBCH ; IHS/SD/SDR - 3PB/UFMS View Batch option
+1 ;;2.6;IHS Third Party Billing;**1,3,9,11,21**;NOV 12, 2009;Build 379
+2 ; View Batch
+3 ;IHS/SD/SDR v2.6 p1 NO HEAT - Added totals for cash. sessions
+4 ;IHS/SD/SDR 2.6 p9 HEAT28995 - added screen so only exports from current DUZ(2) display
+5 ;IHS/SD/SDR v2.6 p11 added V to list of codes
+6 ;IHS/SD/SDR 2.6*21 split to ABMUVBC2
+7 ;IHS/SD/SDR 2.6*21 HEAT129446 - Made change so insurer type would show correctly on report; was blank because of code
+8 ; change made in p11.
+9 ;
START ;START HERE
+1 ; Find requested UFMS export batch in UFMS export file
BEG ;Find beg. export batch
+1 SET ABMTRIBL=$PIECE($GET(^ABMDPARM(DUZ(2),1,4)),U,14)
+2 WRITE !
+3 KILL DIC,DIE,X,Y,DA
+4 SET DIC="^ABMUTXMT("
+5 SET DIC(0)="AEMQ"
+6 SET DIC("A")="Select beginning export: "
+7 ;only show limited entries
SET ABMSCRND=$PIECE($GET(^ABMDPARM(DUZ(2),1,4)),U,16)
+8 ;abm*2.6*9 HEAT28995
SET DIC("S")="I $P(^(0),U,4)=DUZ(2) S X1=DT,X2=$P(^ABMUTXMT(Y,0),U) D ^%DTC I X<ABMSCRND"
+9 DO ^DIC
+10 IF Y<0
QUIT
+11 SET ABME("XMITB")=+Y
END ;Find end. export batch
+1 WRITE !
+2 SET DIC("A")="Select ending export: "
+3 DO ^DIC
+4 KILL DIC
+5 IF Y<0
QUIT
+6 SET ABME("XMITE")=+Y
+7 IF ABME("XMITE")<ABME("XMITB")
WRITE !!,"INVALID RANGE!"
GOTO BEG
SUMDET ;summary or detail?
+1 KILL DIC,DIE,DIR,X,Y,DA
+2 SET DIR(0)="S^S:SUMMARY;D:DETAIL;P:SUMMARY WITH EXPORT PAGE;X:DETAIL WITH EXPORT PAGE;G:GRAND TOTAL ALL FILES BY TRANSMISSION DATE"
+3 SET DIR("A")="SUMMARY OR DETAIL"
+4 SET DIR("B")="SUMMARY"
+5 DO ^DIR
KILL DIR
+6 SET ABMSUMDT=Y
+7 KILL ABMSAV
SEL ;Select device
+1 SET %ZIS="NQ"
+2 SET %ZIS("A")="Enter DEVICE: "
+3 DO ^%ZIS
IF POP
QUIT
+4 IF IO'=IO(0)
DO QUE
DO HOME^%ZIS
SET DIR(0)="E"
DO ^DIR
KILL DIR
QUIT
+5 IF $DATA(IO("S"))
SET IOP=ION
DO ^%ZIS
PRINT ;EP
+1 ;Callable point for queuing
+2 SET ABME("PG")=0
+3 SET ABMP("XMIT")=ABME("XMITB")-1
+4 DO SET
IF (IOST["C")&(($GET(Y)=0)!($DATA(DIRUT)!$DATA(DIROUT)!$DATA(DTOUT)!$DATA(DUOUT)))
QUIT
+5 WRITE !!,$$EN^ABMVDF("HIN"),"E N D O F R E P O R T",$$EN^ABMVDF("HIF"),!
+6 IF $EXTRACT(IOST)="C"
SET DIR(0)="E"
DO ^DIR
KILL DIR
+7 IF $EXTRACT(IOST)="P"
WRITE $$EN^ABMVDF("IOF")
+8 IF $DATA(IO("S"))
DO ^%ZISC
+9 KILL ABME
+10 QUIT
SET ;SET UP SOME THINGS
+1 ;abm*2.6*21 IHS/SD/SDR split routine
DO SET^ABMUVBC2
+2 QUIT
LOOP ; Loop through bills of specified batch to gather data and print report
+1 ;abm*2.6*21 IHS/SD/SDR split routine
DO LOOP^ABMUVBC2
+2 QUIT
SUMMARY ;
+1 KILL ABMDUZ2,ABMBDFN
+2 ;cnt budget activity bills
SET ABME(ABMBAOUT)=+$GET(ABME(ABMBAOUT))+1
+3 SET ABMDUZ2=$PIECE($GET(^ABMUTXMT(ABMP("XMIT"),ABMLOOP,ABMUS,2,ABMSDT,11,ABMBA,2,ABMBIEN,0)),U,2)
+4 SET ABMBDFN=$PIECE($GET(^ABMUTXMT(ABMP("XMIT"),ABMLOOP,ABMUS,2,ABMSDT,11,ABMBA,2,ABMBIEN,0)),U,3)
+5 ;cnt bill amt
SET ABME(ABMBAOUT,"AMT")=+$GET(ABME(ABMBAOUT,"AMT"))+($PIECE($GET(^ABMDBILL(ABMDUZ2,ABMBDFN,2)),U))
+6 ;cnt total bills
SET ABME("CNT")=+$GET(ABME("CNT"))+1
+7 ;cnt total bill amt
SET ABME("TOT")=+$GET(ABME("TOT"))+($PIECE($GET(^ABMDBILL(ABMDUZ2,ABMBDFN,2)),U))
+8 ;excluded bills
IF $PIECE($GET(^ABMUTXMT(ABMP("XMIT"),ABMLOOP,ABMUS,2,ABMSDT,11,ABMBA,2,ABMBIEN,0)),U,5)=1
Begin DoDot:1
+9 SET ABMEXCNT=+$GET(ABMEXCNT)+1
+10 SET ABMEXAMT=+$GET(ABMEXAMT)+($PIECE($GET(^ABMDBILL(ABMDUZ2,ABMBDFN,2)),U))
End DoDot:1
+11 QUIT
DTAIL ;DISPLAY DETAIL
+1 ;cnt budget activity bills
SET ABME(ABMBAOUT)=+$GET(ABME(ABMBAOUT))+1
+2 SET ABMDUZ2=$PIECE($GET(^ABMUTXMT(ABMP("XMIT"),ABMLOOP,ABMUS,2,ABMSDT,11,ABMBA,2,ABMBIEN,0)),U,2)
+3 SET ABMBDFN=$PIECE($GET(^ABMUTXMT(ABMP("XMIT"),ABMLOOP,ABMUS,2,ABMSDT,11,ABMBA,2,ABMBIEN,0)),U,3)
+4 SET ABME(21)=$PIECE($GET(^ABMDBILL(ABMDUZ2,ABMBDFN,2)),U)
+5 ;count bill amt
SET ABME(ABMBAOUT,"AMT")=$GET(ABME(ABMBAOUT,"AMT"))+(ABME(21))
+6 ;cnt total bills
SET ABME("CNT")=+$GET(ABME("CNT"))+1
+7 ;cnt total bill amt
SET ABME("TOT")=+$GET(ABME("TOT"))+(ABME(21))
+8 SET ABME(71)=$$SDT^ABMDUTL($PIECE($GET(^ABMDBILL(ABMDUZ2,ABMBDFN,7)),U))
+9 SET ABME(1)=$PIECE($GET(^ABMDBILL(ABMDUZ2,ABMBDFN,0)),U)
+10 SET ABME(3)=$PIECE($GET(^ABMDBILL(ABMDUZ2,ABMBDFN,0)),U,3)
+11 SET ABME(5)=$PIECE($GET(^ABMDBILL(ABMDUZ2,ABMBDFN,0)),U,5)
+12 SET ABME(15)=$$SDT^ABMDUTL($PIECE($GET(^ABMDBILL(ABMDUZ2,ABMBDFN,1)),U,5))
+13 SET ABME("HRN")=$PIECE($GET(^AUPNPAT(+ABME(5),41,+ABMDUZ2,0)),U,2)
+14 SET ABME("SUFFIX")=$PIECE($GET(^ABMDPARM(ABME(3),1,2)),U,4)
+15 WRITE !,ABME("SUFFIX")
+16 ;W ?4,ABME(1),?13,ABME("HRN"),?21,$P($G(^DPT(+ABME(5),0)),U),?48,ABME(15) ;abm*2.6*1 NO HEAT
+17 ;abm*2.6*1 NO HEAT
WRITE ?4,ABME(1),?13,ABME("HRN"),?21,$EXTRACT($PIECE($GET(^DPT(+ABME(5),0)),U),1,22),?45,ABME(15)
+18 ;W ?59,ABME(71),?70,$J($FN(ABME(21),",",2),10) ;abm*2.6*1 NO HEAT
+19 ;abm*2.6*1 NO HEAT
WRITE ?57,ABME(71),?68,$JUSTIFY($FNUMBER(ABME(21),",",2),10)
+20 SET ABMXMIT=$ORDER(^ABMDBILL(ABMDUZ2,ABMBDFN,69,"B",ABMP("XMIT"),0))
+21 ;excluded/tribal data
+22 IF (ABMTRIBL=1)
IF (+$GET(ABMXMIT)'=0)
IF ($PIECE($GET(^ABMDBILL(ABMDUZ2,ABMBDFN,69,ABMXMIT,0)),U,3)=1)
WRITE "*"
+23 IF $Y+5>IOSL
DO HD
IF (IOST["C")&((+$GET(Y)=0)!($DATA(DIRUT)!$DATA(DIROUT)!$DATA(DTOUT)!$DATA(DUOUT)))
QUIT
+24 QUIT
GLOOP ;Loop thru bills of specified batch to gather data and print report
+1 ;abm*2.6*21 IHS/SD/SDR split routine
DO GLOOP^ABMUVBC2
+2 QUIT
GRANDTOT ;EP
+1 SET ABMDT=0
+2 FOR
SET ABMDT=$ORDER(ABMU(ABMDT))
IF +ABMDT=0
QUIT
Begin DoDot:1
+3 SET ABMUS=0
+4 FOR
SET ABMUS=$ORDER(ABMU(ABMDT,ABMUS))
IF +ABMUS=0
QUIT
Begin DoDot:2
+5 WRITE !,"SESSION ID: ",ABMDT,?32,"BILLER: ",$SELECT(ABMUS=1:"POS CLAIMS",1:$PIECE($GET(^VA(200,ABMUS,0)),U))
End DoDot:2
End DoDot:1
+6 WRITE !,ABMLINE
+7 ;
+8 SET ABMDUZ2=0
+9 FOR
SET ABMDUZ2=$ORDER(ABMT(ABMDUZ2))
IF +ABMDUZ2=0
QUIT
Begin DoDot:1
+10 ;facility name
WRITE !,$PIECE($GET(^DIC(4,ABMDUZ2,0)),U)
+11 SET ABMBAOUT=""
+12 FOR
SET ABMBAOUT=$ORDER(ABMT(ABMDUZ2,ABMBAOUT))
IF ABMBAOUT=""
QUIT
Begin DoDot:2
+13 WRITE !?3,ABMBAOUT,?26,$JUSTIFY(+$GET(ABMT(ABMDUZ2,ABMBAOUT)),6),$SELECT(+$GET(ABMT(ABMDUZ2,ABMBAOUT))=1:" bill ",1:" bills")
+14 WRITE ?40,$JUSTIFY($FNUMBER(ABMT(ABMDUZ2,ABMBAOUT,"AMT"),",",2),10)
+15 WRITE ?55,$JUSTIFY(+$GET(ABMT(ABMDUZ2,ABMBAOUT,"ECNT")),6)_$SELECT(+$GET(ABMT(ABMDUZ2,ABMBAOUT,"ECNT"))=1:" bill ",1:" bills")
+16 WRITE ?65,$JUSTIFY($FNUMBER(+$GET(ABMT(ABMDUZ2,ABMBAOUT,"EAMT")),",",2),10)
End DoDot:2
+17 WRITE !?5,"Total for facility",?26,$JUSTIFY(+$GET(ABM(ABMDUZ2,"CNT")),6),$SELECT(+$GET(ABM(ABMDUZ2,"CNT"))=1:" bill ",1:" bills")
+18 WRITE ?40,$JUSTIFY($FNUMBER(ABM(ABMDUZ2,"TOT"),",",2),10),!
End DoDot:1
+19 ;
+20 WRITE !?5,$$EN^ABMVDF("HIN"),"TOTAL BILLS: ",$$EN^ABMVDF("HIF"),?26,$JUSTIFY(+$GET(ABM("CNT")),6)_$SELECT(+$GET(ABM("CNT"))=1:" bill",1:" bills"),?$SELECT($GET(ABMSUMDT)="S":40,1:69),$JUSTIFY($FNUMBER(+$GET(ABM("TOT")),",",2),10)
+21 WRITE ?55,$JUSTIFY(+$GET(ABMEXCNT),6),$SELECT(+$GET(ABMEXCNT)=1:" bill",1:" bills"),?65,$JUSTIFY($FNUMBER(+$GET(ABMEXAMT),",",2),10),!
+22 ;start new abm*2.6*3 NOHEAT
+23 WRITE !,$EXTRACT(ABMLINE,1,3)_" EXPORT SUMMARY "_$EXTRACT(ABMLINE,1,60)
+24 SET ABMBAOUT=""
+25 FOR
SET ABMBAOUT=$ORDER(ABMBAT(ABMBAOUT))
IF ($GET(ABMBAOUT)="")
QUIT
Begin DoDot:1
+26 WRITE !?2,ABMBAOUT,?26,$JUSTIFY(+$GET(ABMBAT(ABMBAOUT,"CNT")),6),$SELECT(+$GET(ABMBAT(ABMBAOUT,"CNT"))=1:" bill ",1:" bills")
+27 WRITE ?40,$JUSTIFY($FNUMBER(ABMBAT(ABMBAOUT,"AMT"),",",2),10)
+28 WRITE ?55,$JUSTIFY(+$GET(ABMBAT(ABMBAOUT,"ECNT")),6),$SELECT(+$GET(ABMBAT(ABMBAOUT,"ECNT"))=1:" bill ",1:" bills")
+29 WRITE ?65,$JUSTIFY($FNUMBER(+$GET(ABMBAT(ABMBAOUT,"EAMT")),",",2),10)
End DoDot:1
+30 WRITE !,ABMLINE
+31 ;end new abm*2.6*3 NOHEAT
+32 WRITE !!?5,"TOTAL EXPORTED: ",?26,$JUSTIFY((+$GET(ABM("CNT"))-(+$GET(ABMEXCNT))),6)_$SELECT(+$GET(ABM("CNT"))=1:" bill",1:" bills"),?40,$JUSTIFY($FNUMBER((+$GET(ABM("TOT"))-(+$GET(ABMEXAMT))),",",2),10)
+33 ;
+34 SET ABM("TOT")=0
+35 QUIT
HD ;HEADER FOR DETAIL LISTING
+1 IF $GET(ABME("PG"))
IF ($EXTRACT(IOST)="C")
SET DIR(0)="E"
DO ^DIR
KILL DIR
IF Y=0!$DATA(DIRUT)!$DATA(DIROUT)!$DATA(DTOUT)!$DATA(DUOUT)
QUIT
+2 SET ABME("PG")=ABME("PG")+1
+3 WRITE $$EN^ABMVDF("IOF"),!,?30,$$EN^ABMVDF("HIN"),"UFMS EXPORT SUMMARY",?70,"Page: ",$$EN^ABMVDF("HIF"),ABME("PG")
+4 WRITE !,$$EN^ABMVDF("HIN"),"LOCATION: ",$$EN^ABMVDF("HIF"),$PIECE($GET(^AUTTLOC(ABME("LOC"),0)),U,2)
+5 WRITE !,$$EN^ABMVDF("HIN"),"EXPORT DATE: ",$$EN^ABMVDF("HIF"),ABME("BDATE")
+6 WRITE !,$$EN^ABMVDF("HIN"),"FILE NAME: ",$$EN^ABMVDF("HIF"),ABME("FNAME")
+7 WRITE !,$$EN^ABMVDF("HIN")
+8 ;
+9 WRITE "EXPORT(S) RESENT: ",$$EN^ABMVDF("HIF")
+10 SET ABMEU=0
+11 FOR
SET ABMEU=$ORDER(^ABMUTXMT(ABMP("XMIT"),1,ABMEU))
IF +ABMEU=0
QUIT
Begin DoDot:1
+12 SET ABMEDT=""
+13 FOR
SET ABMEDT=$ORDER(^ABMUTXMT(ABMP("XMIT"),1,ABMEU,2,ABMEDT))
IF +$GET(ABMEDT)=0
QUIT
Begin DoDot:2
+14 SET ABMREXP=0
+15 FOR
SET ABMREXP=$ORDER(^ABMUTXMT(ABMP("XMIT"),1,ABMEU,2,ABMEDT,3,ABMREXP))
IF +ABMREXP=0
QUIT
Begin DoDot:3
+16 SET ABMRXIEN=$PIECE($GET(^ABMUTXMT(ABMP("XMIT"),1,ABMEU,2,ABMEDT,3,ABMREXP,0)),U)
+17 SET ABMRXFIL=$PIECE($GET(^ABMUTXMT(ABMRXIEN,0)),U,2)
SET ABMREXPF=1
+18 WRITE !?3,ABMRXFIL_" IN SESSION "_ABMEDT
End DoDot:3
End DoDot:2
End DoDot:1
+19 IF $GET(ABMREXPF)'=1
WRITE " <<NONE>>"
+20 ;
+21 WRITE !,$$EN^ABMVDF("HIN")
+22 WRITE ABME("EQ")
+23 ;
+24 ;I ABMSUMDT="D" D ;abm*2.6*1
+25 ;abm*2.6*1
IF ABMSUMDT="D"!(ABMSUMDT="X")
Begin DoDot:1
+26 IF (ABMTRIBL=1)
WRITE !,"NOTE: ""*"" by amount means it was excluded from export"
+27 WRITE !,?48,"APPROVAL",?60,"DATE OF"
+28 WRITE !,"LOC",?4,"BILL #",?13,"HRN",?21,"PATIENT",?48,"DATE",?60,"SERVICE",?72,"AMOUNT"
End DoDot:1
+29 ;I ABMSAV="S" D ;abm*2.6*1
+30 ;abm*2.6*1
IF "^S^P^"[("^"_ABMSAV_"^")
Begin DoDot:1
+31 WRITE !,?4,"BUDGET ACTIVITY",?35,"BILL COUNT",?50,"AMOUNT"
End DoDot:1
+32 IF ABMSAV="G"
Begin DoDot:1
+33 WRITE !,?4,"BUDGET ACTIVITY",?30,"BILL CNT",?43,"AMOUNT",?54,"EXCL.CNT",?67,"EXCL.AMT"
End DoDot:1
+34 WRITE !,ABME("-"),$$EN^ABMVDF("HIF")
+35 QUIT
QUE ;QUE TO TASKMAN
+1 SET ZTRTN="PRINT^ABMUVBCH"
+2 SET ZTDESC="3P UFMS TX EXPORT SUMMARY"
+3 SET ZTSAVE("ABM*")=""
+4 KILL ZTSK
+5 DO ^%ZTLOAD
+6 IF $GET(ZTSK)
WRITE !,"Task # ",ZTSK," queued.",!
+7 QUIT
STOT ;SITE TOTAL
+1 WRITE !!,$$EN^ABMVDF("HIN"),"SITE/BILL TYPE TOTAL:",$$EN^ABMVDF("HIF"),?68,$JUSTIFY($FNUMBER(ABME("STOT"),",",2),10)
+2 SET ABME("STOT")=0
+3 QUIT
R ;;MEDICARE
MD ;;MEDICARE
MH ;;MEDICARE
MC ;;MEDICARE
MMC ;;MEDICARE
D ;;MEDICAID
K ;;MEDICAID
FPL ;;MEDICAID
F ;;PRIVATE INSURANCE
P ;;PRIVATE INSURANCE
H ;;PRIVATE INSURANCE
M ;;PRIVATE INSURANCE
N ;;OTHER
I ;;OTHER
W ;;OTHER
C ;;OTHER
G ;;OTHER
T ;;OTHER
SEP ;;OTHER
TSI ;;OTHER
V ;;VET