ABMUVBC2 ; 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 from ABMUVBCH
;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.
;
SET ;SET UP SOME THINGS
;ABME("BDATE") = Batch export date
;ABME("FNAME") = File Name
S ABMSAV=ABMSUMDT ;save original option
K Y,DIRUT,DIROUT,DTOUT,DUOUT
S ABMSUMDT=$S(ABMSUMDT="X"!(ABMSUMDT="D"):"D",1:"S") ;change option back for summary
F S ABMP("XMIT")=$O(^ABMUTXMT(ABMP("XMIT"))) Q:'+ABMP("XMIT")!(ABMP("XMIT")>ABME("XMITE")) D Q:(IOST["C")&(($G(Y)=0)!($D(DIRUT)!$D(DIROUT)!$D(DTOUT)!$D(DUOUT)))
.S Y=$P(^ABMUTXMT(ABMP("XMIT"),0),U)
.D DD^%DT
.S ABME("BDATE")=Y
.S ABME("FNAME")=$P($G(^ABMUTXMT(ABMP("XMIT"),0)),U,2)
.S ABME("LOC")=$P($G(^ABMUTXMT(ABMP("XMIT"),0)),U,4)
.S ABME("TOT")=0
.S ABME("STOT")=0
.S ABME("CNT")=0
.S $P(ABME("-"),"-",81)=""
.S $P(ABME("EQ"),"=",81)=""
.I "PXG"[ABMSAV D ;print reconcile page before summary
..D LOOP^ABMUVBCR(ABMP("XMIT"),ABME("LOC"))
..S ABME("PG")=0 ;reset page cntr
.F ABMI=1,2 D
..S ABMUS=0
..F S ABMUS=$O(^ABMUTXMT(ABMP("XMIT"),ABMI,ABMUS)) Q:+ABMUS=0 D
...S ABMUSR=$G(^ABMUTXMT(ABMP("XMIT"),ABMI,ABMUS,0))
...Q:+ABMUSR=0
...S ABMSDT=0
...F S ABMSDT=$O(^ABMUTXMT(ABMP("XMIT"),ABMI,ABMUSR,2,ABMSDT)) Q:+ABMSDT=0 D
....S ABMLOOP=$S(ABMI=1:10,1:20)
....S ABM0=$G(^ABMUCASH(ABME("LOC"),ABMLOOP,ABMUSR,20,ABMSDT,0))
....S ABMSTR=$P(ABM0,U,4)_U_$P(ABM0,U,3) ;SESSION STATUS^SIGN OUT DATE
....S ABMUSER=$S(ABMLOOP=20:"POS",1:ABMUSR) ;SUB "POS" FOR USER IEN
....S ABMC(ABMSDT,ABMUSER,ABMSDT)=ABMSTR ;Create local ABMC array
.D HD^ABMUVBCH
.D:ABMSAV'="G" LOOP^ABMUVBCH Q:(IOST["C")&(($G(Y)=0)!($D(DIRUT)!$D(DIROUT)!$D(DTOUT)!$D(DUOUT)))
.D:ABMSAV="G" GLOOP^ABMUVBCH,GRANDTOT^ABMUVBCH Q:(IOST["C")&(($G(Y)=0)!($D(DIRUT)!$D(DIROUT)!$D(DTOUT)!$D(DUOUT)))
Q
LOOP ; Loop through bills of specified batch to gather data and print report
S ABMSDT=0
F S ABMSDT=$O(ABMC(ABMSDT)) Q:+ABMSDT=0 D
.S ABMUSER=""
.F S ABMUSER=$O(ABMC(ABMSDT,ABMUSER)) Q:ABMUSER="" D
..S ABMLOOP=$S(+ABMUSER'=0:1,1:2)
..S ABMUS=ABMUSER
..I ABMUS="POS" S ABMUS=1
..W !!,"SESSION ID: ",ABMSDT
..;start old abm*2.6*1
..;W:ABMUS'=1 ?30,"BILLER: ",$P($P($G(^VA(200,ABMUS,0)),U),",")_","_$E($P($P($G(^VA(200,ABMUS,0)),U),",",2),1),!
..;W:ABMUS=1 ?30,"BILLER: POS CLAIMS",!
..;end old start new
..W:ABMUS'=1 ?30,"BILLER: ",$P($P($G(^VA(200,ABMUS,0)),U),",")_","_$E($P($P($G(^VA(200,ABMUS,0)),U),",",2),1)
..W:ABMUS=1 ?30,"BILLER: POS CLAIMS"
..;end new
..;start new abm*2.6*1 NOHEAT
..D TOTAL^ABMUVBC1
..W ?55,"TOTAL: ",$J($FN(ABME("TAMT"),",",2),10)
..;end new NOHEAT
..S ABMBA=0,ABMEXCNT=0,ABMEXAMT=0
..F S ABMBA=$O(^ABMUTXMT(ABMP("XMIT"),ABMLOOP,ABMUS,2,ABMSDT,11,ABMBA)) Q:+ABMBA=0 D Q:$D(DIRUT)!$D(DIROUT)!$D(DTOUT)!$D(DUOUT)
...S ABMBAOUT=$P($G(^ABMUTXMT(ABMP("XMIT"),ABMLOOP,ABMUS,2,ABMSDT,11,ABMBA,0)),U)
...K ABME(ABMBAOUT)
...S ABMBIEN=0
...;W !?2,$P($T(@ABMBAOUT^ABMUCASH),";;",2) ;abm*2.6*21 IHS/SD/SDR HEAT129446
...W !?2,$$INSTYP^ABMUCASH(ABMBAOUT) ;abm*2.6*21 IHS/SD/SDR HEAT129446
...F S ABMBIEN=$O(^ABMUTXMT(ABMP("XMIT"),ABMLOOP,ABMUS,2,ABMSDT,11,ABMBA,2,ABMBIEN)) Q:+ABMBIEN=0 D Q:$D(DIRUT)!$D(DIROUT)!$D(DTOUT)!$D(DUOUT)
....I ABMSUMDT="D" D DTAIL^ABMUVBCH
....I ABMSUMDT="S" D SUMMARY^ABMUVBCH
....Q:((IOST["C")&(+$G(Y)=0))!$D(DIRUT)!$D(DIROUT)!$D(DTOUT)!$D(DUOUT)
...I ABMSUMDT="S" D
....W ?35,+$G(ABME(ABMBAOUT)),$S(+$G(ABME(ABMBAOUT))=1:" bill",1:" bills")
....W ?50,$J($FN(ABME(ABMBAOUT,"AMT"),",",2),10)
...;start new abm*2.6*1 NOHEAT
...I ABMSUMDT="D" D
....W !?68,"----------"
....W !?68,$J($FN(ABME(ABMBAOUT,"AMT"),",",2),10)
...;end new NOHEAT
..I +$G(ABMEXCNT)'=0 D
...W !?26,+$G(ABMEXCNT)," excluded "_$S(+$G(ABMEXCNT)=1:"bill",1:"bills"),?45,$J($FN(ABMEXAMT,",",2),10),!
W !!,$$EN^ABMVDF("HIN"),"TOTAL BILLS FOR THIS EXPORT: ",$$EN^ABMVDF("HIF"),?35,ABME("CNT")_$S(ABME("CNT")=1:" bill",1:" bills"),?$S(ABMSUMDT="S":50,1:69),$J($FN(ABME("TOT"),",",2),10)
S ABME("TOT")=0
Q
GLOOP ;Loop thru bills of specified batch to gather data and print report
K ABMT
S ABMEXCNT=0,ABMEXAMT=0
K ABMBAT ;abm*2.6*3
F ABMLOOP=1,2 D Q:(IOST["C")&(($G(Y)<0)!($D(DIRUT)!$D(DIROUT)!$D(DTOUT)!$D(DUOUT)))
.S ABMU=0
.F S ABMU=$O(^ABMUTXMT(ABMP("XMIT"),ABMLOOP,ABMU)) Q:+ABMU=0 D Q:(IOST["C")&(($D(DIRUT)!$D(DIROUT)!$D(DTOUT)!$D(DUOUT)))
..S ABMUS=$G(^ABMUTXMT(ABMP("XMIT"),ABMLOOP,ABMU,0))
..Q:+ABMUS=0
..S ABMDT=0
..F S ABMDT=$O(^ABMUTXMT(ABMP("XMIT"),ABMLOOP,ABMUS,2,ABMDT)) Q:+ABMDT=0 D Q:(IOST["C")&(($D(DIRUT)!$D(DIROUT)!$D(DTOUT)!$D(DUOUT)))
...S ABMBA=0
...F S ABMBA=$O(^ABMUTXMT(ABMP("XMIT"),ABMLOOP,ABMUS,2,ABMDT,11,ABMBA)) Q:+ABMBA=0 D Q:$D(DIRUT)!$D(DIROUT)!$D(DTOUT)!$D(DUOUT)
....S ABMBAOUT=$P($G(^ABMUTXMT(ABMP("XMIT"),ABMLOOP,ABMUS,2,ABMDT,11,ABMBA,0)),U)
....;S ABMBAOUT=$P($T(@ABMBAOUT),";;",2) ;abm*2.6*21 IHS/SD/SDR HEAT279161
....S ABMBAOUT=$$INSTYP^ABMUCASH(ABMBAOUT) ;abm*2.6*21 IHS/SD/SDR HEAT279161
....S ABMBIEN=0
....F S ABMBIEN=$O(^ABMUTXMT(ABMP("XMIT"),ABMLOOP,ABMUS,2,ABMDT,11,ABMBA,2,ABMBIEN)) Q:+ABMBIEN=0 D Q:$D(DIRUT)!$D(DIROUT)!$D(DTOUT)!$D(DUOUT)
.....K ABMDUZ2,ABMBDFN
.....S ABMDUZ2=$P($G(^ABMUTXMT(ABMP("XMIT"),ABMLOOP,ABMUS,2,ABMDT,11,ABMBA,2,ABMBIEN,0)),U,2)
.....S ABMBDFN=$P($G(^ABMUTXMT(ABMP("XMIT"),ABMLOOP,ABMUS,2,ABMDT,11,ABMBA,2,ABMBIEN,0)),U,3)
.....S ABMT(ABMDUZ2,ABMBAOUT)=+$G(ABMT(ABMDUZ2,ABMBAOUT))+1 ;cnt b.a. bills for location
.....;start new abm*2.6*3 NOHEAT
.....S ABMBAT(ABMBAOUT,"CNT")=+$G(ABMBAT(ABMBAOUT,"CNT"))+1 ;cnt b.a. tot
.....S ABMBAT(ABMBAOUT,"AMT")=+$G(ABMBAT(ABMBAOUT,"AMT"))+($P($G(^ABMDBILL(ABMDUZ2,ABMBDFN,2)),U)) ;cnt b.a. total amt
.....;end new abm*2.6*3
.....S ABMT(ABMDUZ2,ABMBAOUT,"AMT")=+$G(ABMT(ABMDUZ2,ABMBAOUT,"AMT"))+($P($G(^ABMDBILL(ABMDUZ2,ABMBDFN,2)),U)) ;cnt bill amt
.....S ABM(ABMDUZ2,"CNT")=+$G(ABM(ABMDUZ2,"CNT"))+1 ;cnt bills for loc
.....S ABM("CNT")=+$G(ABM("CNT"))+1 ;cnt total bills
.....S ABM(ABMDUZ2,"TOT")=+$G(ABM(ABMDUZ2,"TOT"))+($P($G(^ABMDBILL(ABMDUZ2,ABMBDFN,2)),U)) ;cnt amt for location
.....S ABM("TOT")=+$G(ABM("TOT"))+($P($G(^ABMDBILL(ABMDUZ2,ABMBDFN,2)),U)) ;cnt tot bill amt
.....I $P($G(^ABMUTXMT(ABMP("XMIT"),ABMLOOP,ABMUS,2,ABMDT,11,ABMBA,2,ABMBIEN,0)),U,5)=1 D ;excluded bills
......S ABMT(ABMDUZ2,ABMBAOUT,"ECNT")=+$G(ABMT(ABMDUZ2,ABMBAOUT,"ECNT"))+1 ;cnt excluded by loc/Budget act.
......S ABMT(ABMDUZ2,ABMBAOUT,"EAMT")=+$G(ABMT(ABMDUZ2,ABMBAOUT,"EAMT"))+($P($G(^ABMDBILL(ABMDUZ2,ABMBDFN,2)),U)) ;excl. amt
......;start new abm*2.6*3 NOHEAT
......S ABMBAT(ABMBAOUT,"ECNT")=+$G(ABMBAT(ABMBAOUT,"ECNT"))+1 ;cnt b.a. E-total
......S ABMBAT(ABMBAOUT,"EAMT")=+$G(ABMBAT(ABMBAOUT,"ETOT"))+($P($G(^ABMDBILL(ABMDUZ2,ABMBDFN,2)),U)) ;cnt b.a. total E-amt
......;end new abm*2.6*3
......S ABMEXCNT=+$G(ABMEXCNT)+1
......S ABMEXAMT=+$G(ABMEXAMT)+($P($G(^ABMDBILL(ABMDUZ2,ABMBDFN,2)),U))
.....S ABMU(ABMDT,ABMUS)=""
Q
ABMUVBC2 ; 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 from ABMUVBCH
+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 ;
SET ;SET UP SOME THINGS
+1 ;ABME("BDATE") = Batch export date
+2 ;ABME("FNAME") = File Name
+3 ;save original option
SET ABMSAV=ABMSUMDT
+4 KILL Y,DIRUT,DIROUT,DTOUT,DUOUT
+5 ;change option back for summary
SET ABMSUMDT=$SELECT(ABMSUMDT="X"!(ABMSUMDT="D"):"D",1:"S")
+6 FOR
SET ABMP("XMIT")=$ORDER(^ABMUTXMT(ABMP("XMIT")))
IF '+ABMP("XMIT")!(ABMP("XMIT")>ABME("XMITE"))
QUIT
Begin DoDot:1
+7 SET Y=$PIECE(^ABMUTXMT(ABMP("XMIT"),0),U)
+8 DO DD^%DT
+9 SET ABME("BDATE")=Y
+10 SET ABME("FNAME")=$PIECE($GET(^ABMUTXMT(ABMP("XMIT"),0)),U,2)
+11 SET ABME("LOC")=$PIECE($GET(^ABMUTXMT(ABMP("XMIT"),0)),U,4)
+12 SET ABME("TOT")=0
+13 SET ABME("STOT")=0
+14 SET ABME("CNT")=0
+15 SET $PIECE(ABME("-"),"-",81)=""
+16 SET $PIECE(ABME("EQ"),"=",81)=""
+17 ;print reconcile page before summary
IF "PXG"[ABMSAV
Begin DoDot:2
+18 DO LOOP^ABMUVBCR(ABMP("XMIT"),ABME("LOC"))
+19 ;reset page cntr
SET ABME("PG")=0
End DoDot:2
+20 FOR ABMI=1,2
Begin DoDot:2
+21 SET ABMUS=0
+22 FOR
SET ABMUS=$ORDER(^ABMUTXMT(ABMP("XMIT"),ABMI,ABMUS))
IF +ABMUS=0
QUIT
Begin DoDot:3
+23 SET ABMUSR=$GET(^ABMUTXMT(ABMP("XMIT"),ABMI,ABMUS,0))
+24 IF +ABMUSR=0
QUIT
+25 SET ABMSDT=0
+26 FOR
SET ABMSDT=$ORDER(^ABMUTXMT(ABMP("XMIT"),ABMI,ABMUSR,2,ABMSDT))
IF +ABMSDT=0
QUIT
Begin DoDot:4
+27 SET ABMLOOP=$SELECT(ABMI=1:10,1:20)
+28 SET ABM0=$GET(^ABMUCASH(ABME("LOC"),ABMLOOP,ABMUSR,20,ABMSDT,0))
+29 ;SESSION STATUS^SIGN OUT DATE
SET ABMSTR=$PIECE(ABM0,U,4)_U_$PIECE(ABM0,U,3)
+30 ;SUB "POS" FOR USER IEN
SET ABMUSER=$SELECT(ABMLOOP=20:"POS",1:ABMUSR)
+31 ;Create local ABMC array
SET ABMC(ABMSDT,ABMUSER,ABMSDT)=ABMSTR
End DoDot:4
End DoDot:3
End DoDot:2
+32 DO HD^ABMUVBCH
+33 IF ABMSAV'="G"
DO LOOP^ABMUVBCH
IF (IOST["C")&(($GET(Y)=0)!($DATA(DIRUT)!$DATA(DIROUT)!$DATA(DTOUT)!$DATA(DUOUT)))
QUIT
+34 IF ABMSAV="G"
DO GLOOP^ABMUVBCH
DO GRANDTOT^ABMUVBCH
IF (IOST["C")&(($GET(Y)=0)!($DATA(DIRUT)!$DATA(DIROUT)!$DATA(DTOUT)!$DATA(DUOUT)))
QUIT
End DoDot:1
IF (IOST["C")&(($GET(Y)=0)!($DATA(DIRUT)!$DATA(DIROUT)!$DATA(DTOUT)!$DATA(DUOUT)))
QUIT
+35 QUIT
LOOP ; Loop through bills of specified batch to gather data and print report
+1 SET ABMSDT=0
+2 FOR
SET ABMSDT=$ORDER(ABMC(ABMSDT))
IF +ABMSDT=0
QUIT
Begin DoDot:1
+3 SET ABMUSER=""
+4 FOR
SET ABMUSER=$ORDER(ABMC(ABMSDT,ABMUSER))
IF ABMUSER=""
QUIT
Begin DoDot:2
+5 SET ABMLOOP=$SELECT(+ABMUSER'=0:1,1:2)
+6 SET ABMUS=ABMUSER
+7 IF ABMUS="POS"
SET ABMUS=1
+8 WRITE !!,"SESSION ID: ",ABMSDT
+9 ;start old abm*2.6*1
+10 ;W:ABMUS'=1 ?30,"BILLER: ",$P($P($G(^VA(200,ABMUS,0)),U),",")_","_$E($P($P($G(^VA(200,ABMUS,0)),U),",",2),1),!
+11 ;W:ABMUS=1 ?30,"BILLER: POS CLAIMS",!
+12 ;end old start new
+13 IF ABMUS'=1
WRITE ?30,"BILLER: ",$PIECE($PIECE($GET(^VA(200,ABMUS,0)),U),",")_","_$EXTRACT($PIECE($PIECE($GET(^VA(200,ABMUS,0)),U),",",2),1)
+14 IF ABMUS=1
WRITE ?30,"BILLER: POS CLAIMS"
+15 ;end new
+16 ;start new abm*2.6*1 NOHEAT
+17 DO TOTAL^ABMUVBC1
+18 WRITE ?55,"TOTAL: ",$JUSTIFY($FNUMBER(ABME("TAMT"),",",2),10)
+19 ;end new NOHEAT
+20 SET ABMBA=0
SET ABMEXCNT=0
SET ABMEXAMT=0
+21 FOR
SET ABMBA=$ORDER(^ABMUTXMT(ABMP("XMIT"),ABMLOOP,ABMUS,2,ABMSDT,11,ABMBA))
IF +ABMBA=0
QUIT
Begin DoDot:3
+22 SET ABMBAOUT=$PIECE($GET(^ABMUTXMT(ABMP("XMIT"),ABMLOOP,ABMUS,2,ABMSDT,11,ABMBA,0)),U)
+23 KILL ABME(ABMBAOUT)
+24 SET ABMBIEN=0
+25 ;W !?2,$P($T(@ABMBAOUT^ABMUCASH),";;",2) ;abm*2.6*21 IHS/SD/SDR HEAT129446
+26 ;abm*2.6*21 IHS/SD/SDR HEAT129446
WRITE !?2,$$INSTYP^ABMUCASH(ABMBAOUT)
+27 FOR
SET ABMBIEN=$ORDER(^ABMUTXMT(ABMP("XMIT"),ABMLOOP,ABMUS,2,ABMSDT,11,ABMBA,2,ABMBIEN))
IF +ABMBIEN=0
QUIT
Begin DoDot:4
+28 IF ABMSUMDT="D"
DO DTAIL^ABMUVBCH
+29 IF ABMSUMDT="S"
DO SUMMARY^ABMUVBCH
+30 IF ((IOST["C")&(+$GET(Y)=0))!$DATA(DIRUT)!$DATA(DIROUT)!$DATA(DTOUT)!$DATA(DUOUT)
QUIT
End DoDot:4
IF $DATA(DIRUT)!$DATA(DIROUT)!$DATA(DTOUT)!$DATA(DUOUT)
QUIT
+31 IF ABMSUMDT="S"
Begin DoDot:4
+32 WRITE ?35,+$GET(ABME(ABMBAOUT)),$SELECT(+$GET(ABME(ABMBAOUT))=1:" bill",1:" bills")
+33 WRITE ?50,$JUSTIFY($FNUMBER(ABME(ABMBAOUT,"AMT"),",",2),10)
End DoDot:4
+34 ;start new abm*2.6*1 NOHEAT
+35 IF ABMSUMDT="D"
Begin DoDot:4
+36 WRITE !?68,"----------"
+37 WRITE !?68,$JUSTIFY($FNUMBER(ABME(ABMBAOUT,"AMT"),",",2),10)
End DoDot:4
+38 ;end new NOHEAT
End DoDot:3
IF $DATA(DIRUT)!$DATA(DIROUT)!$DATA(DTOUT)!$DATA(DUOUT)
QUIT
+39 IF +$GET(ABMEXCNT)'=0
Begin DoDot:3
+40 WRITE !?26,+$GET(ABMEXCNT)," excluded "_$SELECT(+$GET(ABMEXCNT)=1:"bill",1:"bills"),?45,$JUSTIFY($FNUMBER(ABMEXAMT,",",2),10),!
End DoDot:3
End DoDot:2
End DoDot:1
+41 WRITE !!,$$EN^ABMVDF("HIN"),"TOTAL BILLS FOR THIS EXPORT: ",$$EN^ABMVDF("HIF"),?35,ABME("CNT")_$SELECT(ABME("CNT")=1:" bill",1:" bills"),?$SELECT(ABMSUMDT="S":50,1:69),$JUSTIFY($FNUMBER(ABME("TOT"),",",2),10)
+42 SET ABME("TOT")=0
+43 QUIT
GLOOP ;Loop thru bills of specified batch to gather data and print report
+1 KILL ABMT
+2 SET ABMEXCNT=0
SET ABMEXAMT=0
+3 ;abm*2.6*3
KILL ABMBAT
+4 FOR ABMLOOP=1,2
Begin DoDot:1
+5 SET ABMU=0
+6 FOR
SET ABMU=$ORDER(^ABMUTXMT(ABMP("XMIT"),ABMLOOP,ABMU))
IF +ABMU=0
QUIT
Begin DoDot:2
+7 SET ABMUS=$GET(^ABMUTXMT(ABMP("XMIT"),ABMLOOP,ABMU,0))
+8 IF +ABMUS=0
QUIT
+9 SET ABMDT=0
+10 FOR
SET ABMDT=$ORDER(^ABMUTXMT(ABMP("XMIT"),ABMLOOP,ABMUS,2,ABMDT))
IF +ABMDT=0
QUIT
Begin DoDot:3
+11 SET ABMBA=0
+12 FOR
SET ABMBA=$ORDER(^ABMUTXMT(ABMP("XMIT"),ABMLOOP,ABMUS,2,ABMDT,11,ABMBA))
IF +ABMBA=0
QUIT
Begin DoDot:4
+13 SET ABMBAOUT=$PIECE($GET(^ABMUTXMT(ABMP("XMIT"),ABMLOOP,ABMUS,2,ABMDT,11,ABMBA,0)),U)
+14 ;S ABMBAOUT=$P($T(@ABMBAOUT),";;",2) ;abm*2.6*21 IHS/SD/SDR HEAT279161
+15 ;abm*2.6*21 IHS/SD/SDR HEAT279161
SET ABMBAOUT=$$INSTYP^ABMUCASH(ABMBAOUT)
+16 SET ABMBIEN=0
+17 FOR
SET ABMBIEN=$ORDER(^ABMUTXMT(ABMP("XMIT"),ABMLOOP,ABMUS,2,ABMDT,11,ABMBA,2,ABMBIEN))
IF +ABMBIEN=0
QUIT
Begin DoDot:5
+18 KILL ABMDUZ2,ABMBDFN
+19 SET ABMDUZ2=$PIECE($GET(^ABMUTXMT(ABMP("XMIT"),ABMLOOP,ABMUS,2,ABMDT,11,ABMBA,2,ABMBIEN,0)),U,2)
+20 SET ABMBDFN=$PIECE($GET(^ABMUTXMT(ABMP("XMIT"),ABMLOOP,ABMUS,2,ABMDT,11,ABMBA,2,ABMBIEN,0)),U,3)
+21 ;cnt b.a. bills for location
SET ABMT(ABMDUZ2,ABMBAOUT)=+$GET(ABMT(ABMDUZ2,ABMBAOUT))+1
+22 ;start new abm*2.6*3 NOHEAT
+23 ;cnt b.a. tot
SET ABMBAT(ABMBAOUT,"CNT")=+$GET(ABMBAT(ABMBAOUT,"CNT"))+1
+24 ;cnt b.a. total amt
SET ABMBAT(ABMBAOUT,"AMT")=+$GET(ABMBAT(ABMBAOUT,"AMT"))+($PIECE($GET(^ABMDBILL(ABMDUZ2,ABMBDFN,2)),U))
+25 ;end new abm*2.6*3
+26 ;cnt bill amt
SET ABMT(ABMDUZ2,ABMBAOUT,"AMT")=+$GET(ABMT(ABMDUZ2,ABMBAOUT,"AMT"))+($PIECE($GET(^ABMDBILL(ABMDUZ2,ABMBDFN,2)),U))
+27 ;cnt bills for loc
SET ABM(ABMDUZ2,"CNT")=+$GET(ABM(ABMDUZ2,"CNT"))+1
+28 ;cnt total bills
SET ABM("CNT")=+$GET(ABM("CNT"))+1
+29 ;cnt amt for location
SET ABM(ABMDUZ2,"TOT")=+$GET(ABM(ABMDUZ2,"TOT"))+($PIECE($GET(^ABMDBILL(ABMDUZ2,ABMBDFN,2)),U))
+30 ;cnt tot bill amt
SET ABM("TOT")=+$GET(ABM("TOT"))+($PIECE($GET(^ABMDBILL(ABMDUZ2,ABMBDFN,2)),U))
+31 ;excluded bills
IF $PIECE($GET(^ABMUTXMT(ABMP("XMIT"),ABMLOOP,ABMUS,2,ABMDT,11,ABMBA,2,ABMBIEN,0)),U,5)=1
Begin DoDot:6
+32 ;cnt excluded by loc/Budget act.
SET ABMT(ABMDUZ2,ABMBAOUT,"ECNT")=+$GET(ABMT(ABMDUZ2,ABMBAOUT,"ECNT"))+1
+33 ;excl. amt
SET ABMT(ABMDUZ2,ABMBAOUT,"EAMT")=+$GET(ABMT(ABMDUZ2,ABMBAOUT,"EAMT"))+($PIECE($GET(^ABMDBILL(ABMDUZ2,ABMBDFN,2)),U))
+34 ;start new abm*2.6*3 NOHEAT
+35 ;cnt b.a. E-total
SET ABMBAT(ABMBAOUT,"ECNT")=+$GET(ABMBAT(ABMBAOUT,"ECNT"))+1
+36 ;cnt b.a. total E-amt
SET ABMBAT(ABMBAOUT,"EAMT")=+$GET(ABMBAT(ABMBAOUT,"ETOT"))+($PIECE($GET(^ABMDBILL(ABMDUZ2,ABMBDFN,2)),U))
+37 ;end new abm*2.6*3
+38 SET ABMEXCNT=+$GET(ABMEXCNT)+1
+39 SET ABMEXAMT=+$GET(ABMEXAMT)+($PIECE($GET(^ABMDBILL(ABMDUZ2,ABMBDFN,2)),U))
End DoDot:6
+40 SET ABMU(ABMDT,ABMUS)=""
End DoDot:5
IF $DATA(DIRUT)!$DATA(DIROUT)!$DATA(DTOUT)!$DATA(DUOUT)
QUIT
End DoDot:4
IF $DATA(DIRUT)!$DATA(DIROUT)!$DATA(DTOUT)!$DATA(DUOUT)
QUIT
End DoDot:3
IF (IOST["C")&(($DATA(DIRUT)!$DATA(DIROUT)!$DATA(DTOUT)!$DATA(DUOUT)))
QUIT
End DoDot:2
IF (IOST["C")&(($DATA(DIRUT)!$DATA(DIROUT)!$DATA(DTOUT)!$DATA(DUOUT)))
QUIT
End DoDot:1
IF (IOST["C")&(($GET(Y)<0)!($DATA(DIRUT)!$DATA(DIROUT)!$DATA(DTOUT)!$DATA(DUOUT)))
QUIT
+41 QUIT