ABMTALL2 ; IHS/SD/SDR - Monthly tally report - 8/19/2005 1:28:34 PM
;;2.6;IHS 3P BILLING SYSTEM;;NOV 12, 2009
;
TRANS ;EP
; for checking Transaction File data parameters
Q:'$D(^BARTR(DUZ(2),ABMTRIEN,0)) ; No data
K ABMTR
S ABMTR(0)=$G(^BARTR(DUZ(2),ABMTRIEN,0)) ; A/R Transaction 0 node
S ABMTR(1)=$G(^BARTR(DUZ(2),ABMTRIEN,1)) ; A/R Transaction 1 node
S ABMTR("T")=$P(ABMTR(1),U) ; Transaction type
S ABMTR("DT")=$P(ABMTR(0),U) ; Transaction date/time
S ABMTR("B")=$P(ABMTR(0),U,14) ; A/R Collection batch IEN
S:ABMTR("B")="" ABMTR("B")="No Collection Batch"
S ABMTR("IT")=$P(ABMTR(0),U,15) ; A/R Collection batch item
S:ABMTR("IT")="" ABMTR("IT")="No Collection Batch Item"
S ABMTR("AR")=$P(ABMTR(0),U,13) ; Entry by (AR Clerk)
S:ABMTR("AR")="" ABMTR("AR")=9999999
S:'$D(ABMY("AR")) ABMTR("AR")=0
S ABMTR("CR-DB")=$$GET1^DIQ(90050.03,ABMTRIEN,3.5)
S ABM=$P(ABMTR(0),U,4) ; A/R Bill IEN
I $D(ABMY("BATCH")),ABMTR("T")=100 S ABM("UN-ALLOCATED",ABMTR("IT"))=$G(ABM("UN-ALLOCATED",ABMTR("IT")))+ABMTR("CR-DB")_U_DUZ(2)
Q:'+ABM ; No bill for transaction
Q:'$D(^BARBL(DUZ(2),ABM)) ; Trans points to non-existent bill
S ABM(0)=$G(^BARBL(DUZ(2),ABM,0)) ; A/R Bill 0 node
S ABM(10)=$G(^BARBL(DUZ(2),ABM,1)) ; A/R Bill 1 node
S ABMTR("I")=$P(ABM(0),U,3) ; A/R Account
S ABMTR("L")=$P(ABM(10),U,8) ; Visit location
S ABM("PV")=$P(ABM(10),U,13) ; Provider (New Person)
S ABM("V")=$P(ABM(10),U,14) ; Visit type (3P Visit Type)
S ABM("C")=$P(ABM(10),U,12) ; Clinic (Clinic Stop File)
S ABM("DS")=$$GET1^DIQ(90050.01,ABM,23) ; Discharge Service (#)
I ABMTR("I")]"" D
. S D0=ABMTR("I")
. S ABMTR("BI")=$$VALI^BARVPM(8) ; Insurer Type
I $G(ABMTR("BI"))="" S ABMTR("BI")="No Billing Entity"
I ABMTR("BI")'="No Billing Entity" D
. S ABMTR("ALL")="O" ; Other Allow Cat
. I ABMTR("BI")="R" S ABMTR("ALL")="R" Q ; Medicare Allow Cat
. I ABMTR("BI")="D" S ABMTR("ALL")="D" Q ; Medicaid Allow Cat
. I ABMTR("BI")="K" S ABMTR("ALL")="K" Q ; CHIPS Allow Cat
. I ",F,M,H,P,"[(","_ABMTR("BI")_",") S ABMTR("ALL")="P" Q ; Private
I $G(ABMTR("ALL"))="" S ABMTR("ALL")="No Allowance Category"
Q:ABMTR("L")=""!(ABMTR("I")="")!(ABMTR("DT")="")
Q
OUTPUT ; EP
S ABMCATS=$P($G(^DD(9000010,.07,0)),U,3) ;GET THE SERVICE CATEGORIES
S ABMTAB=";"
F ABMPKG="PCC","TPB","BAR" D
.I ABMPKG="PCC" D VHDB
.I ABMPKG="TPB" D THDB
.I ABMPKG="BAR" D BHDB
.S (ABMVLS,ABMCLNS,ABMSTDTS,ABMCLMSS,ABMVTYPS)=""
.S ABMVL=0
.F S ABMVL=$O(^TMP("ABM-TALLY",$J,ABMPKG,ABMVL)) Q:+ABMVL=0 D
..S ABMCLN=0
..F S ABMCLN=$O(^TMP("ABM-TALLY",$J,ABMPKG,ABMVL,ABMCLN)) Q:+ABMCLN=0 D
...S ABMVTYP=0
...F S ABMVTYP=$O(^TMP("ABM-TALLY",$J,ABMPKG,ABMVL,ABMCLN,ABMVTYP)) Q:ABMVTYP="" D
....S ABMSTODT=0
....F S ABMSTODT=$O(^TMP("ABM-TALLY",$J,ABMPKG,ABMVL,ABMCLN,ABMVTYP,ABMSTODT)) Q:+ABMSTODT=0 D
.....I ABMPKG="PCC" D PCCOUT
.....I ABMPKG="TPB" D TPBOUT
.....I ABMPKG="BAR" D BAROUT
.I ABMPKG="PCC" W !,ABMTAB_ABMTAB_ABMTAB_ABMTAB_ABMTAB_"TOTAL VISITS "_+$G(^TMP("ABM-TALLY",$J,"VTOT")),!
.I ABMPKG="TPB" W !,ABMTAB_ABMTAB_ABMTAB_ABMTAB_ABMTAB_ABMTAB_ABMTAB_"TOTAL CLAIMS "_+$G(^TMP("ABM-TALLY",$J,"CTOT")),!
.I ABMPKG="BAR" D
..W !,ABMTAB_ABMTAB_ABMTAB_ABMTAB_ABMTAB_ABMTAB_ABMTAB_"TOTAL BILLS "_+$G(^TMP("ABM-TALLY",$J,"BTOT"))_ABMTAB
..W $J($G(^TMP("ABM-TALLY",$J,"TBILLED")),15,2)_ABMTAB
..W $J($G(^TMP("ABM-TALLY",$J,"TCBILLED")),15,2)_ABMTAB
..W $J($G(^TMP("ABM-TALLY",$J,"TPAY")),15,2)_ABMTAB
..W $J($G(^TMP("ABM-TALLY",$J,"TADJ")),15,2)_ABMTAB
..W $J($G(^TMP("ABM-TALLY",$J,"TREF")),15,2)
Q
PCCOUT ;
S ABMCLMS=""
F S ABMCLMS=$O(^TMP("ABM-TALLY",$J,ABMPKG,ABMVL,ABMCLN,ABMVTYP,ABMSTODT,ABMCLMS)) Q:ABMCLMS="" D
.W !,$S(ABMVL'=ABMVLS:$P($G(^DIC(4,ABMVL,0)),U),1:"")_ABMTAB
.S ABMVLS=ABMVL
.W $S(ABMCLNS'=ABMCLN:$P($G(^DIC(40.7,ABMCLN,0)),U),ABMCLN=99999:"NO CLINIC ENTERED IN PCC",1:"")_ABMTAB
.S ABMCLNS=ABMCLN
.W $S(ABMVTYPS'=ABMVTYP:$$GETSVCAT^ABMTALLY(ABMVTYP),1:"")_ABMTAB
.S ABMVTYPS=ABMVTYP
.W $TR($TR($P($$MDT^ABMDUTL(ABMSTODT),"-",2,3)," "),"-"," ")_ABMTAB
.W $S(ABMCLMS="NOCLM":"VISITS THAT DIDN'T GENERATE A CLAIM",1:"VISITS THAT GENERATED A CLAIM")_ABMTAB
.W $G(^TMP("ABM-TALLY",$J,ABMPKG,ABMVL,ABMCLN,ABMVTYP,ABMSTODT,ABMCLMS))
Q
TPBOUT ;
S ABMCLMS=""
F S ABMCLMS=$O(^TMP("ABM-TALLY",$J,ABMPKG,ABMVL,ABMCLN,ABMVTYP,ABMSTODT,ABMCLMS)) Q:ABMCLMS="" D
.S ABMITYP=""
.F S ABMITYP=$O(^TMP("ABM-TALLY",$J,ABMPKG,ABMVL,ABMCLN,ABMVTYP,ABMSTODT,ABMCLMS,ABMITYP)) Q:ABMITYP="" D
..S ABMINS=""
..F S ABMINS=$O(^TMP("ABM-TALLY",$J,ABMPKG,ABMVL,ABMCLN,ABMVTYP,ABMSTODT,ABMCLMS,ABMITYP,ABMINS)) Q:ABMINS="" D
...W !,$S(ABMVL'=ABMVLS:$P($G(^DIC(4,ABMVL,0)),U),1:"")_ABMTAB
...S ABMVLS=ABMVL
...W $S(ABMCLNS'=ABMCLN:$P($G(^DIC(40.7,ABMCLN,0)),U),1:"")_ABMTAB
...S ABMCLNS=ABMCLN
...W $S(ABMVTYPS'=ABMVTYP:$P($G(^ABMDVTYP(ABMVTYP,0)),U),1:"")_ABMTAB
...S ABMVTYPS=ABMVTYP
...W $TR($TR($P($$MDT^ABMDUTL(ABMSTODT),"-",2,3)," "),"-"," ")_ABMTAB
...W $S(ABMCLMS="E":"EDIT Mode",ABMCLMS="R":"Claim Rejected",ABMCLMS="U":"Billed",ABMCLMS="C":"Claim Completed",ABMCLMS="F":"Flagged as Billable",ABMCLMS="X":"Cancelled",1:"Pending")_ABMTAB
...W $P($P($P(^DD(9999999.18,.21,0),U,3),";"_ABMITYP_":",2),";")_ABMTAB
...W ABMINS_ABMTAB
...W $G(^TMP("ABM-TALLY",$J,ABMPKG,ABMVL,ABMCLN,ABMVTYP,ABMSTODT,ABMCLMS,ABMITYP,ABMINS))
Q
BAROUT ;
S ABMBLST=""
F S ABMBLST=$O(^TMP("ABM-TALLY",$J,ABMPKG,ABMVL,ABMCLN,ABMVTYP,ABMSTODT,ABMBLST)) Q:ABMBLST="" D
.S ABMITYP=""
.F S ABMITYP=$O(^TMP("ABM-TALLY",$J,ABMPKG,ABMVL,ABMCLN,ABMVTYP,ABMSTODT,ABMBLST,ABMITYP)) Q:ABMITYP="" D
..S ABMINS=""
..F S ABMINS=$O(^TMP("ABM-TALLY",$J,ABMPKG,ABMVL,ABMCLN,ABMVTYP,ABMSTODT,ABMBLST,ABMITYP,ABMINS)) Q:ABMINS="" D
...W !,$S(ABMVL'=ABMVLS:$P($G(^DIC(4,ABMVL,0)),U),1:"")_ABMTAB
...S ABMVLS=ABMVL
...W $S(ABMCLNS'=ABMCLN:$P($G(^DIC(40.7,ABMCLN,0)),U),1:"")_ABMTAB
...S ABMCLNS=ABMCLN
...W $S(ABMVTYPS'=ABMVTYP:$P($G(^ABMDVTYP(ABMVTYP,0)),U),1:"")_ABMTAB
...S ABMVTYPS=ABMVTYP
...W $TR($TR($P($$MDT^ABMDUTL(ABMSTODT),"-",2,3)," "),"-"," ")_ABMTAB
...W ABMBLST_ABMTAB
...W ABMITYP_ABMTAB
...W ABMINS_ABMTAB
...W $G(^TMP("ABM-TALLY",$J,ABMPKG,ABMVL,ABMCLN,ABMVTYP,ABMSTODT,ABMBLST,ABMITYP,ABMINS))_ABMTAB
...W $J($G(^TMP("ABM-TALLY",$J,"BAR-BILLED",ABMVL,ABMCLN,ABMVTYP,ABMSTODT,ABMBLST,ABMITYP,ABMINS)),15,2)_ABMTAB
...W $J($G(^TMP("ABM-TALLY",$J,"BAR-CBILLED",ABMVL,ABMCLN,ABMVTYP,ABMSTODT,ABMBLST,ABMITYP,ABMINS)),15,2)_ABMTAB
...W $J($G(^TMP("ABM-TALLY",$J,"PAYMENT",ABMVL,ABMCLN,ABMVTYP,ABMSTODT,ABMBLST,ABMITYP,ABMINS)),15,2)_ABMTAB
...W $J($G(^TMP("ABM-TALLY",$J,"ADJUST",ABMVL,ABMCLN,ABMVTYP,ABMSTODT,ABMBLST,ABMITYP,ABMINS)),15,2)_ABMTAB
...W $J($G(^TMP("ABM-TALLY",$J,"REFUND",ABMVL,ABMCLN,ABMVTYP,ABMSTODT,ABMBLST,ABMITYP,ABMINS)),15,2)
Q
HD D PAZ^ABMDRUTL Q:$D(DTOUT)!$D(DUOUT)!$D(DIROUT)
VHDB ;
W !,"PCC data from Visit file"
W !,"Visit Location"_ABMTAB_"Clinic"_ABMTAB_"Service Cat"_ABMTAB_"Date"_ABMTAB_"with/without claim"_ABMTAB_"Total"
Q
THDB ;
W !,"Third Party Billing data from the 3P Claim Data file"
W !,"Visit Location"_ABMTAB_"Clinic"_ABMTAB_"Visit Type"_ABMTAB_"Date"_ABMTAB_"Claim Status"_ABMTAB_"Insurer Type"_ABMTAB_"Insurer"_ABMTAB_"Total"
Q
BHDB ;
W !,"Accounts Receivable data from the A/R Bill/IHS file"
W !,"Visit Location"_ABMTAB_"Clinic"_ABMTAB_"Visit Type"_ABMTAB_"Date"_ABMTAB_"Bill Status"_ABMTAB
W "Insurer Type"_ABMTAB_"Insurer"_ABMTAB_"Total"_ABMTAB_"Billed"_ABMTAB_"Outstanding"_ABMTAB
W "Payments"_ABMTAB_"Adjustments"_ABMTAB_"Refunds"
Q
ABMTALL2 ; IHS/SD/SDR - Monthly tally report - 8/19/2005 1:28:34 PM
+1 ;;2.6;IHS 3P BILLING SYSTEM;;NOV 12, 2009
+2 ;
TRANS ;EP
+1 ; for checking Transaction File data parameters
+2 ; No data
IF '$DATA(^BARTR(DUZ(2),ABMTRIEN,0))
QUIT
+3 KILL ABMTR
+4 ; A/R Transaction 0 node
SET ABMTR(0)=$GET(^BARTR(DUZ(2),ABMTRIEN,0))
+5 ; A/R Transaction 1 node
SET ABMTR(1)=$GET(^BARTR(DUZ(2),ABMTRIEN,1))
+6 ; Transaction type
SET ABMTR("T")=$PIECE(ABMTR(1),U)
+7 ; Transaction date/time
SET ABMTR("DT")=$PIECE(ABMTR(0),U)
+8 ; A/R Collection batch IEN
SET ABMTR("B")=$PIECE(ABMTR(0),U,14)
+9 IF ABMTR("B")=""
SET ABMTR("B")="No Collection Batch"
+10 ; A/R Collection batch item
SET ABMTR("IT")=$PIECE(ABMTR(0),U,15)
+11 IF ABMTR("IT")=""
SET ABMTR("IT")="No Collection Batch Item"
+12 ; Entry by (AR Clerk)
SET ABMTR("AR")=$PIECE(ABMTR(0),U,13)
+13 IF ABMTR("AR")=""
SET ABMTR("AR")=9999999
+14 IF '$DATA(ABMY("AR"))
SET ABMTR("AR")=0
+15 SET ABMTR("CR-DB")=$$GET1^DIQ(90050.03,ABMTRIEN,3.5)
+16 ; A/R Bill IEN
SET ABM=$PIECE(ABMTR(0),U,4)
+17 IF $DATA(ABMY("BATCH"))
IF ABMTR("T")=100
SET ABM("UN-ALLOCATED",ABMTR("IT"))=$GET(ABM("UN-ALLOCATED",ABMTR("IT")))+ABMTR("CR-DB")_U_DUZ(2)
+18 ; No bill for transaction
IF '+ABM
QUIT
+19 ; Trans points to non-existent bill
IF '$DATA(^BARBL(DUZ(2),ABM))
QUIT
+20 ; A/R Bill 0 node
SET ABM(0)=$GET(^BARBL(DUZ(2),ABM,0))
+21 ; A/R Bill 1 node
SET ABM(10)=$GET(^BARBL(DUZ(2),ABM,1))
+22 ; A/R Account
SET ABMTR("I")=$PIECE(ABM(0),U,3)
+23 ; Visit location
SET ABMTR("L")=$PIECE(ABM(10),U,8)
+24 ; Provider (New Person)
SET ABM("PV")=$PIECE(ABM(10),U,13)
+25 ; Visit type (3P Visit Type)
SET ABM("V")=$PIECE(ABM(10),U,14)
+26 ; Clinic (Clinic Stop File)
SET ABM("C")=$PIECE(ABM(10),U,12)
+27 ; Discharge Service (#)
SET ABM("DS")=$$GET1^DIQ(90050.01,ABM,23)
+28 IF ABMTR("I")]""
Begin DoDot:1
+29 SET D0=ABMTR("I")
+30 ; Insurer Type
SET ABMTR("BI")=$$VALI^BARVPM(8)
End DoDot:1
+31 IF $GET(ABMTR("BI"))=""
SET ABMTR("BI")="No Billing Entity"
+32 IF ABMTR("BI")'="No Billing Entity"
Begin DoDot:1
+33 ; Other Allow Cat
SET ABMTR("ALL")="O"
+34 ; Medicare Allow Cat
IF ABMTR("BI")="R"
SET ABMTR("ALL")="R"
QUIT
+35 ; Medicaid Allow Cat
IF ABMTR("BI")="D"
SET ABMTR("ALL")="D"
QUIT
+36 ; CHIPS Allow Cat
IF ABMTR("BI")="K"
SET ABMTR("ALL")="K"
QUIT
+37 ; Private
IF ",F,M,H,P,"[(","_ABMTR("BI")_",")
SET ABMTR("ALL")="P"
QUIT
End DoDot:1
+38 IF $GET(ABMTR("ALL"))=""
SET ABMTR("ALL")="No Allowance Category"
+39 IF ABMTR("L")=""!(ABMTR("I")="")!(ABMTR("DT")="")
QUIT
+40 QUIT
OUTPUT ; EP
+1 ;GET THE SERVICE CATEGORIES
SET ABMCATS=$PIECE($GET(^DD(9000010,.07,0)),U,3)
+2 SET ABMTAB=";"
+3 FOR ABMPKG="PCC","TPB","BAR"
Begin DoDot:1
+4 IF ABMPKG="PCC"
DO VHDB
+5 IF ABMPKG="TPB"
DO THDB
+6 IF ABMPKG="BAR"
DO BHDB
+7 SET (ABMVLS,ABMCLNS,ABMSTDTS,ABMCLMSS,ABMVTYPS)=""
+8 SET ABMVL=0
+9 FOR
SET ABMVL=$ORDER(^TMP("ABM-TALLY",$JOB,ABMPKG,ABMVL))
IF +ABMVL=0
QUIT
Begin DoDot:2
+10 SET ABMCLN=0
+11 FOR
SET ABMCLN=$ORDER(^TMP("ABM-TALLY",$JOB,ABMPKG,ABMVL,ABMCLN))
IF +ABMCLN=0
QUIT
Begin DoDot:3
+12 SET ABMVTYP=0
+13 FOR
SET ABMVTYP=$ORDER(^TMP("ABM-TALLY",$JOB,ABMPKG,ABMVL,ABMCLN,ABMVTYP))
IF ABMVTYP=""
QUIT
Begin DoDot:4
+14 SET ABMSTODT=0
+15 FOR
SET ABMSTODT=$ORDER(^TMP("ABM-TALLY",$JOB,ABMPKG,ABMVL,ABMCLN,ABMVTYP,ABMSTODT))
IF +ABMSTODT=0
QUIT
Begin DoDot:5
+16 IF ABMPKG="PCC"
DO PCCOUT
+17 IF ABMPKG="TPB"
DO TPBOUT
+18 IF ABMPKG="BAR"
DO BAROUT
End DoDot:5
End DoDot:4
End DoDot:3
End DoDot:2
+19 IF ABMPKG="PCC"
WRITE !,ABMTAB_ABMTAB_ABMTAB_ABMTAB_ABMTAB_"TOTAL VISITS "_+$GET(^TMP("ABM-TALLY",$JOB,"VTOT")),!
+20 IF ABMPKG="TPB"
WRITE !,ABMTAB_ABMTAB_ABMTAB_ABMTAB_ABMTAB_ABMTAB_ABMTAB_"TOTAL CLAIMS "_+$GET(^TMP("ABM-TALLY",$JOB,"CTOT")),!
+21 IF ABMPKG="BAR"
Begin DoDot:2
+22 WRITE !,ABMTAB_ABMTAB_ABMTAB_ABMTAB_ABMTAB_ABMTAB_ABMTAB_"TOTAL BILLS "_+$GET(^TMP("ABM-TALLY",$JOB,"BTOT"))_ABMTAB
+23 WRITE $JUSTIFY($GET(^TMP("ABM-TALLY",$JOB,"TBILLED")),15,2)_ABMTAB
+24 WRITE $JUSTIFY($GET(^TMP("ABM-TALLY",$JOB,"TCBILLED")),15,2)_ABMTAB
+25 WRITE $JUSTIFY($GET(^TMP("ABM-TALLY",$JOB,"TPAY")),15,2)_ABMTAB
+26 WRITE $JUSTIFY($GET(^TMP("ABM-TALLY",$JOB,"TADJ")),15,2)_ABMTAB
+27 WRITE $JUSTIFY($GET(^TMP("ABM-TALLY",$JOB,"TREF")),15,2)
End DoDot:2
End DoDot:1
+28 QUIT
PCCOUT ;
+1 SET ABMCLMS=""
+2 FOR
SET ABMCLMS=$ORDER(^TMP("ABM-TALLY",$JOB,ABMPKG,ABMVL,ABMCLN,ABMVTYP,ABMSTODT,ABMCLMS))
IF ABMCLMS=""
QUIT
Begin DoDot:1
+3 WRITE !,$SELECT(ABMVL'=ABMVLS:$PIECE($GET(^DIC(4,ABMVL,0)),U),1:"")_ABMTAB
+4 SET ABMVLS=ABMVL
+5 WRITE $SELECT(ABMCLNS'=ABMCLN:$PIECE($GET(^DIC(40.7,ABMCLN,0)),U),ABMCLN=99999:"NO CLINIC ENTERED IN PCC",1:"")_ABMTAB
+6 SET ABMCLNS=ABMCLN
+7 WRITE $SELECT(ABMVTYPS'=ABMVTYP:$$GETSVCAT^ABMTALLY(ABMVTYP),1:"")_ABMTAB
+8 SET ABMVTYPS=ABMVTYP
+9 WRITE $TRANSLATE($TRANSLATE($PIECE($$MDT^ABMDUTL(ABMSTODT),"-",2,3)," "),"-"," ")_ABMTAB
+10 WRITE $SELECT(ABMCLMS="NOCLM":"VISITS THAT DIDN'T GENERATE A CLAIM",1:"VISITS THAT GENERATED A CLAIM")_ABMTAB
+11 WRITE $GET(^TMP("ABM-TALLY",$JOB,ABMPKG,ABMVL,ABMCLN,ABMVTYP,ABMSTODT,ABMCLMS))
End DoDot:1
+12 QUIT
TPBOUT ;
+1 SET ABMCLMS=""
+2 FOR
SET ABMCLMS=$ORDER(^TMP("ABM-TALLY",$JOB,ABMPKG,ABMVL,ABMCLN,ABMVTYP,ABMSTODT,ABMCLMS))
IF ABMCLMS=""
QUIT
Begin DoDot:1
+3 SET ABMITYP=""
+4 FOR
SET ABMITYP=$ORDER(^TMP("ABM-TALLY",$JOB,ABMPKG,ABMVL,ABMCLN,ABMVTYP,ABMSTODT,ABMCLMS,ABMITYP))
IF ABMITYP=""
QUIT
Begin DoDot:2
+5 SET ABMINS=""
+6 FOR
SET ABMINS=$ORDER(^TMP("ABM-TALLY",$JOB,ABMPKG,ABMVL,ABMCLN,ABMVTYP,ABMSTODT,ABMCLMS,ABMITYP,ABMINS))
IF ABMINS=""
QUIT
Begin DoDot:3
+7 WRITE !,$SELECT(ABMVL'=ABMVLS:$PIECE($GET(^DIC(4,ABMVL,0)),U),1:"")_ABMTAB
+8 SET ABMVLS=ABMVL
+9 WRITE $SELECT(ABMCLNS'=ABMCLN:$PIECE($GET(^DIC(40.7,ABMCLN,0)),U),1:"")_ABMTAB
+10 SET ABMCLNS=ABMCLN
+11 WRITE $SELECT(ABMVTYPS'=ABMVTYP:$PIECE($GET(^ABMDVTYP(ABMVTYP,0)),U),1:"")_ABMTAB
+12 SET ABMVTYPS=ABMVTYP
+13 WRITE $TRANSLATE($TRANSLATE($PIECE($$MDT^ABMDUTL(ABMSTODT),"-",2,3)," "),"-"," ")_ABMTAB
+14 WRITE $SELECT(ABMCLMS="E":"EDIT Mode",ABMCLMS="R":"Claim Rejected",ABMCLMS="U":"Billed",ABMCLMS="C":"Claim Completed",ABMCLMS="F":"Flagged as Billable",ABMCLMS="X":"Cancelled",1:"Pending")_ABMTAB
+15 WRITE $PIECE($PIECE($PIECE(^DD(9999999.18,.21,0),U,3),";"_ABMITYP_":",2),";")_ABMTAB
+16 WRITE ABMINS_ABMTAB
+17 WRITE $GET(^TMP("ABM-TALLY",$JOB,ABMPKG,ABMVL,ABMCLN,ABMVTYP,ABMSTODT,ABMCLMS,ABMITYP,ABMINS))
End DoDot:3
End DoDot:2
End DoDot:1
+18 QUIT
BAROUT ;
+1 SET ABMBLST=""
+2 FOR
SET ABMBLST=$ORDER(^TMP("ABM-TALLY",$JOB,ABMPKG,ABMVL,ABMCLN,ABMVTYP,ABMSTODT,ABMBLST))
IF ABMBLST=""
QUIT
Begin DoDot:1
+3 SET ABMITYP=""
+4 FOR
SET ABMITYP=$ORDER(^TMP("ABM-TALLY",$JOB,ABMPKG,ABMVL,ABMCLN,ABMVTYP,ABMSTODT,ABMBLST,ABMITYP))
IF ABMITYP=""
QUIT
Begin DoDot:2
+5 SET ABMINS=""
+6 FOR
SET ABMINS=$ORDER(^TMP("ABM-TALLY",$JOB,ABMPKG,ABMVL,ABMCLN,ABMVTYP,ABMSTODT,ABMBLST,ABMITYP,ABMINS))
IF ABMINS=""
QUIT
Begin DoDot:3
+7 WRITE !,$SELECT(ABMVL'=ABMVLS:$PIECE($GET(^DIC(4,ABMVL,0)),U),1:"")_ABMTAB
+8 SET ABMVLS=ABMVL
+9 WRITE $SELECT(ABMCLNS'=ABMCLN:$PIECE($GET(^DIC(40.7,ABMCLN,0)),U),1:"")_ABMTAB
+10 SET ABMCLNS=ABMCLN
+11 WRITE $SELECT(ABMVTYPS'=ABMVTYP:$PIECE($GET(^ABMDVTYP(ABMVTYP,0)),U),1:"")_ABMTAB
+12 SET ABMVTYPS=ABMVTYP
+13 WRITE $TRANSLATE($TRANSLATE($PIECE($$MDT^ABMDUTL(ABMSTODT),"-",2,3)," "),"-"," ")_ABMTAB
+14 WRITE ABMBLST_ABMTAB
+15 WRITE ABMITYP_ABMTAB
+16 WRITE ABMINS_ABMTAB
+17 WRITE $GET(^TMP("ABM-TALLY",$JOB,ABMPKG,ABMVL,ABMCLN,ABMVTYP,ABMSTODT,ABMBLST,ABMITYP,ABMINS))_ABMTAB
+18 WRITE $JUSTIFY($GET(^TMP("ABM-TALLY",$JOB,"BAR-BILLED",ABMVL,ABMCLN,ABMVTYP,ABMSTODT,ABMBLST,ABMITYP,ABMINS)),15,2)_ABMTAB
+19 WRITE $JUSTIFY($GET(^TMP("ABM-TALLY",$JOB,"BAR-CBILLED",ABMVL,ABMCLN,ABMVTYP,ABMSTODT,ABMBLST,ABMITYP,ABMINS)),15,2)_ABMTAB
+20 WRITE $JUSTIFY($GET(^TMP("ABM-TALLY",$JOB,"PAYMENT",ABMVL,ABMCLN,ABMVTYP,ABMSTODT,ABMBLST,ABMITYP,ABMINS)),15,2)_ABMTAB
+21 WRITE $JUSTIFY($GET(^TMP("ABM-TALLY",$JOB,"ADJUST",ABMVL,ABMCLN,ABMVTYP,ABMSTODT,ABMBLST,ABMITYP,ABMINS)),15,2)_ABMTAB
+22 WRITE $JUSTIFY($GET(^TMP("ABM-TALLY",$JOB,"REFUND",ABMVL,ABMCLN,ABMVTYP,ABMSTODT,ABMBLST,ABMITYP,ABMINS)),15,2)
End DoDot:3
End DoDot:2
End DoDot:1
+23 QUIT
HD DO PAZ^ABMDRUTL
IF $DATA(DTOUT)!$DATA(DUOUT)!$DATA(DIROUT)
QUIT
VHDB ;
+1 WRITE !,"PCC data from Visit file"
+2 WRITE !,"Visit Location"_ABMTAB_"Clinic"_ABMTAB_"Service Cat"_ABMTAB_"Date"_ABMTAB_"with/without claim"_ABMTAB_"Total"
+3 QUIT
THDB ;
+1 WRITE !,"Third Party Billing data from the 3P Claim Data file"
+2 WRITE !,"Visit Location"_ABMTAB_"Clinic"_ABMTAB_"Visit Type"_ABMTAB_"Date"_ABMTAB_"Claim Status"_ABMTAB_"Insurer Type"_ABMTAB_"Insurer"_ABMTAB_"Total"
+3 QUIT
BHDB ;
+1 WRITE !,"Accounts Receivable data from the A/R Bill/IHS file"
+2 WRITE !,"Visit Location"_ABMTAB_"Clinic"_ABMTAB_"Visit Type"_ABMTAB_"Date"_ABMTAB_"Bill Status"_ABMTAB
+3 WRITE "Insurer Type"_ABMTAB_"Insurer"_ABMTAB_"Total"_ABMTAB_"Billed"_ABMTAB_"Outstanding"_ABMTAB
+4 WRITE "Payments"_ABMTAB_"Adjustments"_ABMTAB_"Refunds"
+5 QUIT