ABMDES1 ; IHS/ASDST/DMJ - Display Summarized UB-82/92 Info ;
;;2.6;IHS 3P BILLING SYSTEM;;NOV 12, 2009
;
; IHS/SD/SDR - v2.5 p9 - IM16660
; 4-digit revenue codes
;
; IHS/SD/SDR - v2.5 p10 - IM20227
; Changed hardset of 001 rev code to 0001
;
; IHS/SD/SDR - v2.5 p10 - IM21581
; Added line to print active insurer in summary
;
UB82 ;EP for printing UB-82/92 charge summary
;
D HD
S ABMS="" F ABMS("I")=0:1 S ABMS=$O(ABMS(ABMS)) Q:'ABMS D Q:$D(DUOUT)!$D(DTOUT)!$D(DIROUT)
.I $Y>(IOSL-7) S DIR(0)="EO" D ^DIR Q:$D(DUOUT)!$D(DTOUT)!$D(DIROUT) D HD
.W !,$S($P($G(ABMP("FLAT")),U,6)]"":$P(ABMP("FLAT"),U,6),1:$P($G(^AUTTREVN(ABMS,0)),U,2)),?29,"|"
.W $S($D(ABMS("CPT")):$P(ABMS("CPT",1),U,2),$P($G(ABMP("FLAT")),U,7)]"":$P(ABMP("FLAT"),U,7),$P(ABMS(ABMS),U,3)]"":$J($P(ABMS(ABMS),U,3),7,2),1:"")
.W ?43,$$GETREV^ABMDUTL(ABMS),?51,$J($P(ABMS(ABMS),U,2),3),?58,$J($FN($P(ABMS(ABMS),U),",",2),9)
.I $D(ABMP("FLAT")),'ABMS("I") W ?70,$J($FN($P(ABMS(ABMS),U,5),",",2),9)
I $D(ABMS("CPT")) S ABMS=1 F S ABMS=$O(ABMS("CPT",ABMS)) Q:ABMS="" W !,$P(ABMS("CPT",ABMS),U),?29,"|",$P(ABMS("CPT",ABMS),U,2),?43,$P(ABMS("CPT",ABMS),U,3),?51,$J($P(ABMS("CPT",ABMS),U,4),3),?58,$J($FN($P(ABMS("CPT",ABMS),U,5),",",2),9)
W !?58,"---------"
TOT ;
W !?10,"TOTAL CHARGE",?43,"0001",?58,$J($FN(ABMS("TOT"),",",2),9)
S ABMP("TOT")=ABMP("TOT")+ABMS("TOT")
F W ! Q:$Y+4>IOSL
S DIR(0)="E" D ^DIR K DIR
Q
;
D PREV^ABMDFUTL
I $D(ABMP("FLAT")) S ABMP("RESP")=ABMP("RESP")-$P(ABMS($P(ABMP("FLAT"),U,2)),U,5) W !?39,"Non-Covd Charges:",?57,$J("("_$FN($P(ABMS($P(ABMP("FLAT"),U,2)),U,5),",",2),10),")"
S:ABMP("RESP")<1 ABMP("RESP")=0
I ABMP("PD")!ABMP("WO") D
.W !?38,"Previous Payments:",?57,$J("("_$FN(ABMP("PD"),",",2),10),")"
.W:ABMP("WO") !?39,"Write-off Amount:",?57,$J("("_$FN(ABMP("WO"),",",2),10),")"
.W !?58,"---------",!,?37,"Est. Responsibility:",?58,$J(($FN(ABMP("RESP"),",",2)),9)
Q
;
HD ;HEADER
W $$EN^ABMVDF("IOF")
S ABMP("FORM")=$P(^ABMDEXP(ABMP("EXP"),0),U)
S ABMP("HEADER")="***** "_ABMP("FORM")_" CHARGE SUMMARY *****"
W !?22,ABMP("HEADER")
W !!,"Active Insurer: ",$P($G(^AUTNINS(ABMP("INS"),0)),U),!
W !?42,"Revn",?60,"Total" I $D(ABMP("FLAT")) W ?71,"Non-cvd"
W !?10," Description",?42,"Code",?50,"Units",?59,"Charges" I $D(ABMP("FLAT")) W ?71,"Charges"
S ABMS("I")="",$P(ABMS("I"),"-",80)="" W !,ABMS("I")
Q
ABMDES1 ; IHS/ASDST/DMJ - Display Summarized UB-82/92 Info ;
+1 ;;2.6;IHS 3P BILLING SYSTEM;;NOV 12, 2009
+2 ;
+3 ; IHS/SD/SDR - v2.5 p9 - IM16660
+4 ; 4-digit revenue codes
+5 ;
+6 ; IHS/SD/SDR - v2.5 p10 - IM20227
+7 ; Changed hardset of 001 rev code to 0001
+8 ;
+9 ; IHS/SD/SDR - v2.5 p10 - IM21581
+10 ; Added line to print active insurer in summary
+11 ;
UB82 ;EP for printing UB-82/92 charge summary
+1 ;
+2 DO HD
+3 SET ABMS=""
FOR ABMS("I")=0:1
SET ABMS=$ORDER(ABMS(ABMS))
IF 'ABMS
QUIT
Begin DoDot:1
+4 IF $Y>(IOSL-7)
SET DIR(0)="EO"
DO ^DIR
IF $DATA(DUOUT)!$DATA(DTOUT)!$DATA(DIROUT)
QUIT
DO HD
+5 WRITE !,$SELECT($PIECE($GET(ABMP("FLAT")),U,6)]"":$PIECE(ABMP("FLAT"),U,6),1:$PIECE($GET(^AUTTREVN(ABMS,0)),U,2)),?29,"|"
+6 WRITE $SELECT($DATA(ABMS("CPT")):$PIECE(ABMS("CPT",1),U,2),$PIECE($GET(ABMP("FLAT")),U,7)]"":$PIECE(ABMP("FLAT"),U,7),$PIECE(ABMS(ABMS),U,3)]"":$JUSTIFY($PIECE(ABMS(ABMS),U,3),7,2),1:"")
+7 WRITE ?43,$$GETREV^ABMDUTL(ABMS),?51,$JUSTIFY($PIECE(ABMS(ABMS),U,2),3),?58,$JUSTIFY($FNUMBER($PIECE(ABMS(ABMS),U),",",2),9)
+8 IF $DATA(ABMP("FLAT"))
IF 'ABMS("I")
WRITE ?70,$JUSTIFY($FNUMBER($PIECE(ABMS(ABMS),U,5),",",2),9)
End DoDot:1
IF $DATA(DUOUT)!$DATA(DTOUT)!$DATA(DIROUT)
QUIT
+9 IF $DATA(ABMS("CPT"))
SET ABMS=1
FOR
SET ABMS=$ORDER(ABMS("CPT",ABMS))
IF ABMS=""
QUIT
WRITE !,$PIECE(ABMS("CPT",ABMS),U),?29,"|",$PIECE(ABMS("CPT",ABMS),U,2),?43,$PIECE(ABMS("CPT",ABMS),U,3),?51,$JUSTIFY($PIECE(ABMS("CPT",ABMS),U,4),3),?58,$JUSTIFY($FNUMBER($PIECE(ABMS("CPT",ABMS),U,5),",",2),9)
+10 WRITE !?58,"---------"
TOT ;
+1 WRITE !?10,"TOTAL CHARGE",?43,"0001",?58,$JUSTIFY($FNUMBER(ABMS("TOT"),",",2),9)
+2 SET ABMP("TOT")=ABMP("TOT")+ABMS("TOT")
+3 FOR
WRITE !
IF $Y+4>IOSL
QUIT
+4 SET DIR(0)="E"
DO ^DIR
KILL DIR
+5 QUIT
+6 ;
+7 DO PREV^ABMDFUTL
+8 IF $DATA(ABMP("FLAT"))
SET ABMP("RESP")=ABMP("RESP")-$PIECE(ABMS($PIECE(ABMP("FLAT"),U,2)),U,5)
WRITE !?39,"Non-Covd Charges:",?57,$JUSTIFY("("_$FNUMBER($PIECE(ABMS($PIECE(ABMP("FLAT"),U,2)),U,5),",",2),10),")"
+9 IF ABMP("RESP")<1
SET ABMP("RESP")=0
+10 IF ABMP("PD")!ABMP("WO")
Begin DoDot:1
+11 WRITE !?38,"Previous Payments:",?57,$JUSTIFY("("_$FNUMBER(ABMP("PD"),",",2),10),")"
+12 IF ABMP("WO")
WRITE !?39,"Write-off Amount:",?57,$JUSTIFY("("_$FNUMBER(ABMP("WO"),",",2),10),")"
+13 WRITE !?58,"---------",!,?37,"Est. Responsibility:",?58,$JUSTIFY(($FNUMBER(ABMP("RESP"),",",2)),9)
End DoDot:1
+14 QUIT
+15 ;
HD ;HEADER
+1 WRITE $$EN^ABMVDF("IOF")
+2 SET ABMP("FORM")=$PIECE(^ABMDEXP(ABMP("EXP"),0),U)
+3 SET ABMP("HEADER")="***** "_ABMP("FORM")_" CHARGE SUMMARY *****"
+4 WRITE !?22,ABMP("HEADER")
+5 WRITE !!,"Active Insurer: ",$PIECE($GET(^AUTNINS(ABMP("INS"),0)),U),!
+6 WRITE !?42,"Revn",?60,"Total"
IF $DATA(ABMP("FLAT"))
WRITE ?71,"Non-cvd"
+7 WRITE !?10," Description",?42,"Code",?50,"Units",?59,"Charges"
IF $DATA(ABMP("FLAT"))
WRITE ?71,"Charges"
+8 SET ABMS("I")=""
SET $PIECE(ABMS("I"),"-",80)=""
WRITE !,ABMS("I")
+9 QUIT