BPSRPT7A ;AITC/CKB - ECME REPORTS ;3/9/2020
;;1.0;E CLAIMS MGMT ENGINE;**28**;JUN 2004;Build 22
;;Per VA Directive 6402, this routine should not be modified.
;
Q
;
;Routine to Display the Reports (Continued - moved from BPSRPT7)
;
; Input Variables -> BPCLM = Array of report data by date
; BPDIV,BPSUMDET,GTOT
; Returned Value -> Cumulative Grand Totals
;
PTBDT(BPDIV,BPSUMDET,BPCLM,GTOT) N DIFF,I,NP,RDT,TOT,X
;
;Loop through compiled array and display
S TOT=""
S RDT="" F S RDT=$O(BPCLM(RDT)) Q:RDT="" D Q:BPQ
.S NP=$$CHKP^BPSRPT5(1) Q:BPQ
.S X=$G(BPCLM(RDT))
.;
.;Print Details - Report
.I BPSUMDET=0,'BPEXCEL D
..W !,$$DATTIM^BPSRPT1(RDT) ;Date
..W ?15,$J(+$P(X,U),17) ;#Claims
..W ?33,$J(+$P(X,U,2),17,2) ;Amount Submitted
..W ?51,$J(+$P(X,U,3),17,2) ;Returned Rejected
..W ?69,$J(+$P(X,U,4),17,2) ;Returned Payable
..W ?87,$J(+$P(X,U,5),17,2) ;Amount to Receive
..;
..;Difference
..S DIFF=+$P(X,U,4)-$P(X,U,5)
..I DIFF<0 S DIFF="<"_$TR($J(-DIFF,15,2)," ")_">" W ?117,$J(DIFF,15)
..E W ?116,$J(DIFF,15,2)
..;
..;Print Details - Excel
.I BPSUMDET=0,BPEXCEL D
..;
..;Division
..W !,$S(BPDIV=0:"BLANK",$$DIVNAME^BPSSCRDS(BPDIV)]"":$$DIVNAME^BPSSCRDS(BPDIV),1:BPDIV),U
..W $$DATTIM^BPSRPT1(RDT),U ;Date
..W +$P(X,U),U ;#Claims
..W $TR($J(+$P(X,U,2),17,2)," "),U ;Amount Submitted
..W $TR($J(+$P(X,U,3),17,2)," "),U ;Returned Rejected
..W $TR($J(+$P(X,U,4),17,2)," "),U ;Returned Payable
..W $TR($J(+$P(X,U,5),17,2)," "),U ;Amount to Receive
..;
..;Difference
..S DIFF=+$P(X,U,4)-$P(X,U,5)
..W $TR($J(DIFF,15,2)," ")
.;
.;Save Totals
.F I=1:1:5 S $P(TOT,U,I)=$P(TOT,U,I)+$P(X,U,I),$P(GTOT,U,I)=$P($G(GTOT),U,I)+$P(X,U,I)
;
;Print Totals
Q:BPEXCEL
Q:BPQ S NP=$$CHKP^BPSRPT5(2) Q:BPQ
D ULINE^BPSRPT5("-")
W !,"TOTALS"
W ?15,$J(+$P(TOT,U),17)
W ?33,$J(+$P(TOT,U,2),17,2)
W ?51,$J(+$P(TOT,U,3),17,2)
W ?69,$J(+$P(TOT,U,4),17,2)
W ?87,$J(+$P(TOT,U,5),17,2)
S X=$S((+$P(TOT,U,4))=0:0,1:(+$P(TOT,U,5))/(+$P(TOT,U,4)))
S DIFF=+$P(TOT,U,4)-$P(TOT,U,5)
I DIFF<0 S DIFF="<"_$TR($J(-DIFF,15,2)," ")_">" W ?117,$J(DIFF,15)
E W ?116,$J(DIFF,15,2)
Q
;
;Print Grand Totals - Report 6
;
PGTOT6(GTOT) N DIFF,NP,X
Q:BPQ S NP=$$CHKP^BPSRPT5(2) Q:BPQ
D ULINE^BPSRPT5("-")
W !,"GRAND TOTALS"
W ?15,$J(+$P(GTOT,U),17)
W ?33,$J(+$P(GTOT,U,2),17,2)
W ?51,$J(+$P(GTOT,U,3),17,2)
W ?69,$J(+$P(GTOT,U,4),17,2)
W ?87,$J(+$P(GTOT,U,5),17,2)
S X=$S((+$P(GTOT,U,4))=0:0,1:(+$P(GTOT,U,5))/(+$P(GTOT,U,4)))
S DIFF=+$P(GTOT,U,4)-$P(GTOT,U,5)
I DIFF<0 S DIFF="<"_$TR($J(-DIFF,15,2)," ")_">" W ?117,$J(DIFF,15)
E W ?116,$J(DIFF,15,2)
Q
;
;Print Grand Totals - Reports 1,2,3,4,5,7,8,9,10
;
PGTOT(BPRTYPE,BPGBIL,BPGINS,BPGCOLL,BPGDPAY,BPGCNT,BPGELTM,BPRICE) ;
I (BPRTYPE=1)!(BPRTYPE=4) D Q
.W !!,?83,"----------",?105,"----------",?122,"----------"
.W !,"GRAND TOTALS",?83,$J(BPGBIL,10,2),?105,$J(BPGINS,10,2),?122,$J(BPGCOLL,10,2)
.W !,"COUNT",?83,$J(BPGCNT,10),?105,$J(BPGCNT,10),?122,$J(BPGCNT,10)
.W:BPGCNT !,"MEAN",?83,$J(BPGBIL/BPGCNT,10,2),?105,$J(BPGINS/BPGCNT,10,2),?122,$J(BPGCOLL/BPGCNT,10,2)
I BPRTYPE=3 D Q
.W !!,?100,"----------",?122,"----------"
.W !,"GRAND TOTALS",?100,$J(BPGBIL,10,2),?122,$J(BPGINS,10,2)
.W !,"COUNT",?100,$J(BPGCNT,10),?122,$J(BPGCNT,10)
.W:BPGCNT !,"MEAN",?100,$J(BPGBIL/BPGCNT,10,2),?122,$J(BPGINS/BPGCNT,10,2)
I BPRTYPE=2 D Q
.W !!,?41,"----------"
.W !,"GRAND TOTALS",?41,$J(BPGBIL,10,2)
.W !,"COUNT",?41,$J(BPGCNT,10)
.W:BPGCNT !,"MEAN",?41,$J(BPGBIL/BPGCNT,10,2)
I (BPRTYPE=5) D Q
.W !!,"GRAND TOTALS (ALL DIVISIONS)",?65,"---------------"
.W !,"TOTAL CLAIMS",?65,$J(BPGCNT,15)
.W !,"AVERAGE ELAPSED TIME PER CLAIM",?65,$J($S(BPGCNT=0:"0",1:(BPGELTM\BPGCNT)),15)
I (BPRTYPE=7) D Q
.W !!,"GRAND TOTALS (ALL DIVISIONS) BY BILLER"
.N BPBILR,BPDIV S BPDIV="ALL DIVISIONS"
.S BPBILR="" F S BPBILR=$O(BPGCNT(BPBILR)) Q:BPBILR="" D Q:BPQ
..S NP=$$CHKP^BPSRPT5(1) Q:BPQ
..W !,?3,BPBILR,?65,$J($G(BPGCNT(BPBILR)),5)
.Q:$G(BPQ)
.W !,?65,"-----"
.W !,"CLOSED CLAIMS GRAND TOTAL",?65,$J(BPGCNT,5)
I BPRTYPE=8 D Q
.W !!,?78,"----------",?100,"----------",?122,"----------"
.W !,"GRAND TOTALS",?78,$J(BPGBIL,10,2),?100,$J(BPGINS,10,2),?122,$J(BPGCOLL,10,2)
.W !,?4,$J($P(BPRICE,U,3),10,2),?23,$J($P(BPRICE,U,4),10,2),?38,$J($P(BPRICE,U,5),10,2),?56,$J($P(BPRICE,U,6),10,2),?81,$J($P(BPRICE,U,7),10,2),?96,$J($P(BPRICE,U,2),10,2),?111,$J($P(BPRICE,U),10,2)
.W !,"COUNT",?78,$J(BPGCNT,10),?100,$J(BPGCNT,10),?122,$J(BPGCNT,10)
.W !,?4,$J(BPGCNT,10),?23,$J(BPGCNT,10),?38,$J(BPGCNT,10),?56,$J(BPGCNT,10),?81,$J(BPGCNT,10),?96,$J(BPGCNT,10),?111,$J(BPGCNT,10)
.W:BPGCNT !,"MEAN",?78,$J(BPGBIL/BPGCNT,10,2),?100,$J(BPGINS/BPGCNT,10,2),?122,$J(BPGCOLL/BPGCNT,10,2)
.W !,?4,$J($P(BPRICE,U,3)/BPGCNT,10,2),?23,$J($P(BPRICE,U,4)/BPGCNT,10,2),?38,$J($P(BPRICE,U,5)/BPGCNT,10,2)
.W ?56,$J($P(BPRICE,U,6)/BPGCNT,10,2),?81,$J($P(BPRICE,U,7)/BPGCNT,10,2),?96,$J($P(BPRICE,U,2)/BPGCNT,10,2),?111,$J($P(BPRICE,U)/BPGCNT,10,2)
;
I BPRTYPE=9 D Q
.W !!,?84,"----------"
.W !,"GRAND TOTALS",?84,$J(BPGBIL,10,2)
.W !,"COUNT",?84,$J(BPGCNT,10)
.W:BPGCNT !,"MEAN",?84,$J(BPGBIL/BPGCNT,10,2)
;
I BPRTYPE=10 D Q
.W !!,?77,"----------",?90,$J("----------",13),?106,"----------",?118,$J("----------",12)
.W !,"GRAND TOTALS",?77,$J(BPGBIL,10,2),?90,$J(BPGINS,13,2),?106,$J(BPGCOLL,10,2),?118,$J(BPGDPAY,12,2)
.W !,"COUNT",?77,$J(BPGCNT,10),?90,$J(BPGCNT,13),?106,$J(BPGCNT,10),?118,$J(BPGCNT,12)
.W:BPGCNT !,"MEAN",?77,$J(BPGBIL/BPGCNT,10,2),?90,$J(BPGINS/BPGCNT,13,2),?106,$J(BPGCOLL/BPGCNT,10,2),?118,$J(BPGDPAY/BPGCNT,12,2)
Q
;
;Print Report Insurance Subtotals
;
ITOT(BPRTYPE,BPDIV,BPGRPLAN,BPTBIL,BPTINS,BPTCOLL,BPTDPAY,BPCNT,BPRICE) ;
N BPNP
I (BPRTYPE=1)!(BPRTYPE=4) D Q
.W !!,?83,"----------",?105,"----------",?122,"----------"
.W !,"SUBTOTALS for INS:",$E(BPGRPLAN,1,50),?83,$J(BPTBIL,10,2),?105,$J(BPTINS,10,2),?122,$J(BPTCOLL,10,2)
.W !,"COUNT",?83,$J(BPCNT,10),?105,$J(BPCNT,10),?122,$J(BPCNT,10)
.W:BPCNT !,"MEAN",?83,$J(BPTBIL/BPCNT,10,2),?105,$J(BPTINS/BPCNT,10,2),?122,$J(BPTCOLL/BPCNT,10,2)
I BPRTYPE=3 D Q
.W !!,?100,"----------",?122,"----------"
.W !,"SUBTOTALS for INS:",$E(BPGRPLAN,1,50),?100,$J(BPTBIL,10,2),?122,$J(BPTINS,10,2)
.W !,"COUNT",?100,$J(BPCNT,10),?122,$J(BPCNT,10)
.W:BPCNT !,"MEAN",?100,$J(BPTBIL/BPCNT,10,2),?122,$J(BPTINS/BPCNT,10,2)
I BPRTYPE=2 D Q
.W !!,?41,"----------"
.W !,"SUBTOTALS for INS:",$E(BPGRPLAN,1,22),?41,$J(BPTBIL,10,2)
.W !,"COUNT",?41,$J(BPCNT,10)
.W:BPCNT !,"MEAN",?41,$J(BPTBIL/BPCNT,10,2)
I (BPRTYPE=7) D Q
.W !!,"SUBTOTALS for INS:",$E(BPGRPLAN,1,50)
.N BPBILR
.S BPBILR="" F S BPBILR=$O(BPCNT(BPBILR)) Q:BPBILR="" D Q:BPQ
..S BPNP=$$CHKP^BPSRPT5(1) Q:BPQ
..W !,?3,BPBILR,?65,$J($G(BPCNT(BPBILR)),5)
.Q:$G(BPQ)
.W !,?65,"-----"
.W !,"CLOSED CLAIMS SUBTOTAL",?65,$J(BPCNT,5)
I BPRTYPE=8 D Q
.W !!,?78,"----------",?100,"----------",?122,"----------"
.W !,"SUBTOTALS for INS:",$E(BPGRPLAN,1,50),?78,$J(BPTBIL,10,2),?100,$J(BPTINS,10,2),?122,$J(BPTCOLL,10,2)
.W !,?4,$J($P(BPRICE,U,3),10,2),?23,$J($P(BPRICE,U,4),10,2),?38,$J($P(BPRICE,U,5),10,2),?56,$J($P(BPRICE,U,6),10,2),?81,$J($P(BPRICE,U,7),10,2),?96,$J($P(BPRICE,U,2),10,2),?111,$J($P(BPRICE,U),10,2)
.W !,"COUNT",?78,$J(BPCNT,10),?100,$J(BPCNT,10),?122,$J(BPCNT,10)
.W !,?4,$J(BPCNT,10),?23,$J(BPCNT,10),?38,$J(BPCNT,10),?56,$J(BPCNT,10),?81,$J(BPCNT,10),?96,$J(BPCNT,10),?111,$J(BPCNT,10)
.W:BPCNT !,"MEAN",?78,$J(BPTBIL/BPCNT,10,2),?100,$J(BPTINS/BPCNT,10,2),?122,$J(BPTCOLL/BPCNT,10,2)
.W !,?4,$J($P(BPRICE,U,3)/BPCNT,10,2),?23,$J($P(BPRICE,U,4)/BPCNT,10,2),?38,$J($P(BPRICE,U,5)/BPCNT,10,2),?56,$J($P(BPRICE,U,6)/BPCNT,10,2),?81,$J($P(BPRICE,U,7)/BPCNT,10,2),?96,$J($P(BPRICE,U,2)/BPCNT,10,2),?111,$J($P(BPRICE,U)/BPCNT,10,2)
;
I BPRTYPE=9 D Q
.W !!,?84,"----------"
.W !,"SUBTOTALS for INS:",$E(BPGRPLAN,1,50),?84,$J(BPTBIL,10,2)
.W !,"COUNT",?84,$J(BPCNT,10)
.W:BPCNT !,"MEAN",?84,$J(BPTBIL/BPCNT,10,2)
;
I BPRTYPE=10 D Q
.W !!,?77,"----------",?90,$J("----------",13),?106,"----------",?118,$J("----------",12)
.W !,"SUBTOTALS for INS:",$E(BPGRPLAN,1,50),?77,$J(BPTBIL,10,2),?90,$J(BPTINS,13,2),?106,$J(BPTCOLL,10,2),?118,$J(BPTDPAY,12,2)
.W !,"COUNT",?77,$J(BPCNT,10),?90,$J(BPCNT,13),?106,$J(BPCNT,10),?118,$J(BPCNT,12)
.W:BPCNT !,"MEAN",?77,$J(BPTBIL/BPCNT,10,2),?90,$J(BPTINS/BPCNT,13,2),?106,$J(BPTCOLL/BPCNT,10,2),?118,$J(BPTDPAY/BPCNT,12,2)
Q
;
;Return the Billed Amount
;
BILLED(BP59) ;
Q +$P($G(^BPST(BP59,5)),U,5)
;
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HBPSRPT7A 8655 printed Dec 13, 2024@01:52:48 Page 2
BPSRPT7A ;AITC/CKB - ECME REPORTS ;3/9/2020
+1 ;;1.0;E CLAIMS MGMT ENGINE;**28**;JUN 2004;Build 22
+2 ;;Per VA Directive 6402, this routine should not be modified.
+3 ;
+4 QUIT
+5 ;
+6 ;Routine to Display the Reports (Continued - moved from BPSRPT7)
+7 ;
+8 ; Input Variables -> BPCLM = Array of report data by date
+9 ; BPDIV,BPSUMDET,GTOT
+10 ; Returned Value -> Cumulative Grand Totals
+11 ;
PTBDT(BPDIV,BPSUMDET,BPCLM,GTOT) NEW DIFF,I,NP,RDT,TOT,X
+1 ;
+2 ;Loop through compiled array and display
+3 SET TOT=""
+4 SET RDT=""
FOR
SET RDT=$ORDER(BPCLM(RDT))
if RDT=""
QUIT
Begin DoDot:1
+5 SET NP=$$CHKP^BPSRPT5(1)
if BPQ
QUIT
+6 SET X=$GET(BPCLM(RDT))
+7 ;
+8 ;Print Details - Report
+9 IF BPSUMDET=0
IF 'BPEXCEL
Begin DoDot:2
+10 ;Date
WRITE !,$$DATTIM^BPSRPT1(RDT)
+11 ;#Claims
WRITE ?15,$JUSTIFY(+$PIECE(X,U),17)
+12 ;Amount Submitted
WRITE ?33,$JUSTIFY(+$PIECE(X,U,2),17,2)
+13 ;Returned Rejected
WRITE ?51,$JUSTIFY(+$PIECE(X,U,3),17,2)
+14 ;Returned Payable
WRITE ?69,$JUSTIFY(+$PIECE(X,U,4),17,2)
+15 ;Amount to Receive
WRITE ?87,$JUSTIFY(+$PIECE(X,U,5),17,2)
+16 ;
+17 ;Difference
+18 SET DIFF=+$PIECE(X,U,4)-$PIECE(X,U,5)
+19 IF DIFF<0
SET DIFF="<"_$TRANSLATE($JUSTIFY(-DIFF,15,2)," ")_">"
WRITE ?117,$JUSTIFY(DIFF,15)
+20 IF '$TEST
WRITE ?116,$JUSTIFY(DIFF,15,2)
+21 ;
+22 ;Print Details - Excel
End DoDot:2
+23 IF BPSUMDET=0
IF BPEXCEL
Begin DoDot:2
+24 ;
+25 ;Division
+26 WRITE !,$SELECT(BPDIV=0:"BLANK",$$DIVNAME^BPSSCRDS(BPDIV)]"":$$DIVNAME^BPSSCRDS(BPDIV),1:BPDIV),U
+27 ;Date
WRITE $$DATTIM^BPSRPT1(RDT),U
+28 ;#Claims
WRITE +$PIECE(X,U),U
+29 ;Amount Submitted
WRITE $TRANSLATE($JUSTIFY(+$PIECE(X,U,2),17,2)," "),U
+30 ;Returned Rejected
WRITE $TRANSLATE($JUSTIFY(+$PIECE(X,U,3),17,2)," "),U
+31 ;Returned Payable
WRITE $TRANSLATE($JUSTIFY(+$PIECE(X,U,4),17,2)," "),U
+32 ;Amount to Receive
WRITE $TRANSLATE($JUSTIFY(+$PIECE(X,U,5),17,2)," "),U
+33 ;
+34 ;Difference
+35 SET DIFF=+$PIECE(X,U,4)-$PIECE(X,U,5)
+36 WRITE $TRANSLATE($JUSTIFY(DIFF,15,2)," ")
End DoDot:2
+37 ;
+38 ;Save Totals
+39 FOR I=1:1:5
SET $PIECE(TOT,U,I)=$PIECE(TOT,U,I)+$PIECE(X,U,I)
SET $PIECE(GTOT,U,I)=$PIECE($GET(GTOT),U,I)+$PIECE(X,U,I)
End DoDot:1
if BPQ
QUIT
+40 ;
+41 ;Print Totals
+42 if BPEXCEL
QUIT
+43 if BPQ
QUIT
SET NP=$$CHKP^BPSRPT5(2)
if BPQ
QUIT
+44 DO ULINE^BPSRPT5("-")
+45 WRITE !,"TOTALS"
+46 WRITE ?15,$JUSTIFY(+$PIECE(TOT,U),17)
+47 WRITE ?33,$JUSTIFY(+$PIECE(TOT,U,2),17,2)
+48 WRITE ?51,$JUSTIFY(+$PIECE(TOT,U,3),17,2)
+49 WRITE ?69,$JUSTIFY(+$PIECE(TOT,U,4),17,2)
+50 WRITE ?87,$JUSTIFY(+$PIECE(TOT,U,5),17,2)
+51 SET X=$SELECT((+$PIECE(TOT,U,4))=0:0,1:(+$PIECE(TOT,U,5))/(+$PIECE(TOT,U,4)))
+52 SET DIFF=+$PIECE(TOT,U,4)-$PIECE(TOT,U,5)
+53 IF DIFF<0
SET DIFF="<"_$TRANSLATE($JUSTIFY(-DIFF,15,2)," ")_">"
WRITE ?117,$JUSTIFY(DIFF,15)
+54 IF '$TEST
WRITE ?116,$JUSTIFY(DIFF,15,2)
+55 QUIT
+56 ;
+57 ;Print Grand Totals - Report 6
+58 ;
PGTOT6(GTOT) NEW DIFF,NP,X
+1 if BPQ
QUIT
SET NP=$$CHKP^BPSRPT5(2)
if BPQ
QUIT
+2 DO ULINE^BPSRPT5("-")
+3 WRITE !,"GRAND TOTALS"
+4 WRITE ?15,$JUSTIFY(+$PIECE(GTOT,U),17)
+5 WRITE ?33,$JUSTIFY(+$PIECE(GTOT,U,2),17,2)
+6 WRITE ?51,$JUSTIFY(+$PIECE(GTOT,U,3),17,2)
+7 WRITE ?69,$JUSTIFY(+$PIECE(GTOT,U,4),17,2)
+8 WRITE ?87,$JUSTIFY(+$PIECE(GTOT,U,5),17,2)
+9 SET X=$SELECT((+$PIECE(GTOT,U,4))=0:0,1:(+$PIECE(GTOT,U,5))/(+$PIECE(GTOT,U,4)))
+10 SET DIFF=+$PIECE(GTOT,U,4)-$PIECE(GTOT,U,5)
+11 IF DIFF<0
SET DIFF="<"_$TRANSLATE($JUSTIFY(-DIFF,15,2)," ")_">"
WRITE ?117,$JUSTIFY(DIFF,15)
+12 IF '$TEST
WRITE ?116,$JUSTIFY(DIFF,15,2)
+13 QUIT
+14 ;
+15 ;Print Grand Totals - Reports 1,2,3,4,5,7,8,9,10
+16 ;
PGTOT(BPRTYPE,BPGBIL,BPGINS,BPGCOLL,BPGDPAY,BPGCNT,BPGELTM,BPRICE) ;
+1 IF (BPRTYPE=1)!(BPRTYPE=4)
Begin DoDot:1
+2 WRITE !!,?83,"----------",?105,"----------",?122,"----------"
+3 WRITE !,"GRAND TOTALS",?83,$JUSTIFY(BPGBIL,10,2),?105,$JUSTIFY(BPGINS,10,2),?122,$JUSTIFY(BPGCOLL,10,2)
+4 WRITE !,"COUNT",?83,$JUSTIFY(BPGCNT,10),?105,$JUSTIFY(BPGCNT,10),?122,$JUSTIFY(BPGCNT,10)
+5 if BPGCNT
WRITE !,"MEAN",?83,$JUSTIFY(BPGBIL/BPGCNT,10,2),?105,$JUSTIFY(BPGINS/BPGCNT,10,2),?122,$JUSTIFY(BPGCOLL/BPGCNT,10,2)
End DoDot:1
QUIT
+6 IF BPRTYPE=3
Begin DoDot:1
+7 WRITE !!,?100,"----------",?122,"----------"
+8 WRITE !,"GRAND TOTALS",?100,$JUSTIFY(BPGBIL,10,2),?122,$JUSTIFY(BPGINS,10,2)
+9 WRITE !,"COUNT",?100,$JUSTIFY(BPGCNT,10),?122,$JUSTIFY(BPGCNT,10)
+10 if BPGCNT
WRITE !,"MEAN",?100,$JUSTIFY(BPGBIL/BPGCNT,10,2),?122,$JUSTIFY(BPGINS/BPGCNT,10,2)
End DoDot:1
QUIT
+11 IF BPRTYPE=2
Begin DoDot:1
+12 WRITE !!,?41,"----------"
+13 WRITE !,"GRAND TOTALS",?41,$JUSTIFY(BPGBIL,10,2)
+14 WRITE !,"COUNT",?41,$JUSTIFY(BPGCNT,10)
+15 if BPGCNT
WRITE !,"MEAN",?41,$JUSTIFY(BPGBIL/BPGCNT,10,2)
End DoDot:1
QUIT
+16 IF (BPRTYPE=5)
Begin DoDot:1
+17 WRITE !!,"GRAND TOTALS (ALL DIVISIONS)",?65,"---------------"
+18 WRITE !,"TOTAL CLAIMS",?65,$JUSTIFY(BPGCNT,15)
+19 WRITE !,"AVERAGE ELAPSED TIME PER CLAIM",?65,$JUSTIFY($SELECT(BPGCNT=0:"0",1:(BPGELTM\BPGCNT)),15)
End DoDot:1
QUIT
+20 IF (BPRTYPE=7)
Begin DoDot:1
+21 WRITE !!,"GRAND TOTALS (ALL DIVISIONS) BY BILLER"
+22 NEW BPBILR,BPDIV
SET BPDIV="ALL DIVISIONS"
+23 SET BPBILR=""
FOR
SET BPBILR=$ORDER(BPGCNT(BPBILR))
if BPBILR=""
QUIT
Begin DoDot:2
+24 SET NP=$$CHKP^BPSRPT5(1)
if BPQ
QUIT
+25 WRITE !,?3,BPBILR,?65,$JUSTIFY($GET(BPGCNT(BPBILR)),5)
End DoDot:2
if BPQ
QUIT
+26 if $GET(BPQ)
QUIT
+27 WRITE !,?65,"-----"
+28 WRITE !,"CLOSED CLAIMS GRAND TOTAL",?65,$JUSTIFY(BPGCNT,5)
End DoDot:1
QUIT
+29 IF BPRTYPE=8
Begin DoDot:1
+30 WRITE !!,?78,"----------",?100,"----------",?122,"----------"
+31 WRITE !,"GRAND TOTALS",?78,$JUSTIFY(BPGBIL,10,2),?100,$JUSTIFY(BPGINS,10,2),?122,$JUSTIFY(BPGCOLL,10,2)
+32 WRITE !,?4,$JUSTIFY($PIECE(BPRICE,U,3),10,2),?23,$JUSTIFY($PIECE(BPRICE,U,4),10,2),?38,$JUSTIFY($PIECE(BPRICE,U,5),10,2),?56,$JUSTIFY($PIECE(BPRICE,U,6),10,2),?81,$JUSTIFY($PIECE(BPRICE,U,7),10,2),?96,$JUSTIFY(...
... $PIECE(BPRICE,U,2),10,2),?111,$JUSTIFY($PIECE(BPRICE,U),10,2)
+33 WRITE !,"COUNT",?78,$JUSTIFY(BPGCNT,10),?100,$JUSTIFY(BPGCNT,10),?122,$JUSTIFY(BPGCNT,10)
+34 WRITE !,?4,$JUSTIFY(BPGCNT,10),?23,$JUSTIFY(BPGCNT,10),?38,$JUSTIFY(BPGCNT,10),?56,$JUSTIFY(BPGCNT,10),?81,$JUSTIFY(BPGCNT,10),?96,$JUSTIFY(BPGCNT,10),?111,$JUSTIFY(BPGCNT,10)
+35 if BPGCNT
WRITE !,"MEAN",?78,$JUSTIFY(BPGBIL/BPGCNT,10,2),?100,$JUSTIFY(BPGINS/BPGCNT,10,2),?122,$JUSTIFY(BPGCOLL/BPGCNT,10,2)
+36 WRITE !,?4,$JUSTIFY($PIECE(BPRICE,U,3)/BPGCNT,10,2),?23,$JUSTIFY($PIECE(BPRICE,U,4)/BPGCNT,10,2),?38,$JUSTIFY($PIECE(BPRICE,U,5)/BPGCNT,10,2)
+37 WRITE ?56,$JUSTIFY($PIECE(BPRICE,U,6)/BPGCNT,10,2),?81,$JUSTIFY($PIECE(BPRICE,U,7)/BPGCNT,10,2),?96,$JUSTIFY($PIECE(BPRICE,U,2)/BPGCNT,10,2),?111,$JUSTIFY($PIECE(BPRICE,U)/BPGCNT,10,2)
End DoDot:1
QUIT
+38 ;
+39 IF BPRTYPE=9
Begin DoDot:1
+40 WRITE !!,?84,"----------"
+41 WRITE !,"GRAND TOTALS",?84,$JUSTIFY(BPGBIL,10,2)
+42 WRITE !,"COUNT",?84,$JUSTIFY(BPGCNT,10)
+43 if BPGCNT
WRITE !,"MEAN",?84,$JUSTIFY(BPGBIL/BPGCNT,10,2)
End DoDot:1
QUIT
+44 ;
+45 IF BPRTYPE=10
Begin DoDot:1
+46 WRITE !!,?77,"----------",?90,$JUSTIFY("----------",13),?106,"----------",?118,$JUSTIFY("----------",12)
+47 WRITE !,"GRAND TOTALS",?77,$JUSTIFY(BPGBIL,10,2),?90,$JUSTIFY(BPGINS,13,2),?106,$JUSTIFY(BPGCOLL,10,2),?118,$JUSTIFY(BPGDPAY,12,2)
+48 WRITE !,"COUNT",?77,$JUSTIFY(BPGCNT,10),?90,$JUSTIFY(BPGCNT,13),?106,$JUSTIFY(BPGCNT,10),?118,$JUSTIFY(BPGCNT,12)
+49 if BPGCNT
WRITE !,"MEAN",?77,$JUSTIFY(BPGBIL/BPGCNT,10,2),?90,$JUSTIFY(BPGINS/BPGCNT,13,2),?106,$JUSTIFY(BPGCOLL/BPGCNT,10,2),?118,$JUSTIFY(BPGDPAY/BPGCNT,12,2)
End DoDot:1
QUIT
+50 QUIT
+51 ;
+52 ;Print Report Insurance Subtotals
+53 ;
ITOT(BPRTYPE,BPDIV,BPGRPLAN,BPTBIL,BPTINS,BPTCOLL,BPTDPAY,BPCNT,BPRICE) ;
+1 NEW BPNP
+2 IF (BPRTYPE=1)!(BPRTYPE=4)
Begin DoDot:1
+3 WRITE !!,?83,"----------",?105,"----------",?122,"----------"
+4 WRITE !,"SUBTOTALS for INS:",$EXTRACT(BPGRPLAN,1,50),?83,$JUSTIFY(BPTBIL,10,2),?105,$JUSTIFY(BPTINS,10,2),?122,$JUSTIFY(BPTCOLL,10,2)
+5 WRITE !,"COUNT",?83,$JUSTIFY(BPCNT,10),?105,$JUSTIFY(BPCNT,10),?122,$JUSTIFY(BPCNT,10)
+6 if BPCNT
WRITE !,"MEAN",?83,$JUSTIFY(BPTBIL/BPCNT,10,2),?105,$JUSTIFY(BPTINS/BPCNT,10,2),?122,$JUSTIFY(BPTCOLL/BPCNT,10,2)
End DoDot:1
QUIT
+7 IF BPRTYPE=3
Begin DoDot:1
+8 WRITE !!,?100,"----------",?122,"----------"
+9 WRITE !,"SUBTOTALS for INS:",$EXTRACT(BPGRPLAN,1,50),?100,$JUSTIFY(BPTBIL,10,2),?122,$JUSTIFY(BPTINS,10,2)
+10 WRITE !,"COUNT",?100,$JUSTIFY(BPCNT,10),?122,$JUSTIFY(BPCNT,10)
+11 if BPCNT
WRITE !,"MEAN",?100,$JUSTIFY(BPTBIL/BPCNT,10,2),?122,$JUSTIFY(BPTINS/BPCNT,10,2)
End DoDot:1
QUIT
+12 IF BPRTYPE=2
Begin DoDot:1
+13 WRITE !!,?41,"----------"
+14 WRITE !,"SUBTOTALS for INS:",$EXTRACT(BPGRPLAN,1,22),?41,$JUSTIFY(BPTBIL,10,2)
+15 WRITE !,"COUNT",?41,$JUSTIFY(BPCNT,10)
+16 if BPCNT
WRITE !,"MEAN",?41,$JUSTIFY(BPTBIL/BPCNT,10,2)
End DoDot:1
QUIT
+17 IF (BPRTYPE=7)
Begin DoDot:1
+18 WRITE !!,"SUBTOTALS for INS:",$EXTRACT(BPGRPLAN,1,50)
+19 NEW BPBILR
+20 SET BPBILR=""
FOR
SET BPBILR=$ORDER(BPCNT(BPBILR))
if BPBILR=""
QUIT
Begin DoDot:2
+21 SET BPNP=$$CHKP^BPSRPT5(1)
if BPQ
QUIT
+22 WRITE !,?3,BPBILR,?65,$JUSTIFY($GET(BPCNT(BPBILR)),5)
End DoDot:2
if BPQ
QUIT
+23 if $GET(BPQ)
QUIT
+24 WRITE !,?65,"-----"
+25 WRITE !,"CLOSED CLAIMS SUBTOTAL",?65,$JUSTIFY(BPCNT,5)
End DoDot:1
QUIT
+26 IF BPRTYPE=8
Begin DoDot:1
+27 WRITE !!,?78,"----------",?100,"----------",?122,"----------"
+28 WRITE !,"SUBTOTALS for INS:",$EXTRACT(BPGRPLAN,1,50),?78,$JUSTIFY(BPTBIL,10,2),?100,$JUSTIFY(BPTINS,10,2),?122,$JUSTIFY(BPTCOLL,10,2)
+29 WRITE !,?4,$JUSTIFY($PIECE(BPRICE,U,3),10,2),?23,$JUSTIFY($PIECE(BPRICE,U,4),10,2),?38,$JUSTIFY($PIECE(BPRICE,U,5),10,2),?56,$JUSTIFY($PIECE(BPRICE,U,6),10,2),?81,$JUSTIFY($PIECE(BPRICE,U,7),10,2),?96,$JUSTIFY(...
... $PIECE(BPRICE,U,2),10,2),?111,$JUSTIFY($PIECE(BPRICE,U),10,2)
+30 WRITE !,"COUNT",?78,$JUSTIFY(BPCNT,10),?100,$JUSTIFY(BPCNT,10),?122,$JUSTIFY(BPCNT,10)
+31 WRITE !,?4,$JUSTIFY(BPCNT,10),?23,$JUSTIFY(BPCNT,10),?38,$JUSTIFY(BPCNT,10),?56,$JUSTIFY(BPCNT,10),?81,$JUSTIFY(BPCNT,10),?96,$JUSTIFY(BPCNT,10),?111,$JUSTIFY(BPCNT,10)
+32 if BPCNT
WRITE !,"MEAN",?78,$JUSTIFY(BPTBIL/BPCNT,10,2),?100,$JUSTIFY(BPTINS/BPCNT,10,2),?122,$JUSTIFY(BPTCOLL/BPCNT,10,2)
+33 WRITE !,?4,$JUSTIFY($PIECE(BPRICE,U,3)/BPCNT,10,2),?23,...
WRITE $JUSTIFY($PIECE(BPRICE,U,4)/BPCNT,10,2),?38,$JUSTIFY($PIECE(BPRICE,U,5)/BPCNT,10,2),?56,$JUSTIFY($PIECE(BPRICE,U,6)/BPCNT,10,2),?81,$JUSTIFY($PIECE(BPRICE,U,7)/BPCNT,10,2),?96,$JUSTIFY($PIECE(BPRICE,U,2)/BPCNT,10,2),?111,...
... $JUSTIFY($PIECE(BPRICE,U)/BPCNT,10,2)
End DoDot:1
QUIT
+34 ;
+35 IF BPRTYPE=9
Begin DoDot:1
+36 WRITE !!,?84,"----------"
+37 WRITE !,"SUBTOTALS for INS:",$EXTRACT(BPGRPLAN,1,50),?84,$JUSTIFY(BPTBIL,10,2)
+38 WRITE !,"COUNT",?84,$JUSTIFY(BPCNT,10)
+39 if BPCNT
WRITE !,"MEAN",?84,$JUSTIFY(BPTBIL/BPCNT,10,2)
End DoDot:1
QUIT
+40 ;
+41 IF BPRTYPE=10
Begin DoDot:1
+42 WRITE !!,?77,"----------",?90,$JUSTIFY("----------",13),?106,"----------",?118,$JUSTIFY("----------",12)
+43 WRITE !,"SUBTOTALS for INS:",$EXTRACT(BPGRPLAN,1,50),?77,$JUSTIFY(BPTBIL,10,2),?90,$JUSTIFY(BPTINS,13,2),?106,$JUSTIFY(BPTCOLL,10,2),?118,$JUSTIFY(BPTDPAY,12,2)
+44 WRITE !,"COUNT",?77,$JUSTIFY(BPCNT,10),?90,$JUSTIFY(BPCNT,13),?106,$JUSTIFY(BPCNT,10),?118,$JUSTIFY(BPCNT,12)
+45 if BPCNT
WRITE !,"MEAN",?77,$JUSTIFY(BPTBIL/BPCNT,10,2),?90,$JUSTIFY(BPTINS/BPCNT,13,2),?106,$JUSTIFY(BPTCOLL/BPCNT,10,2),?118,$JUSTIFY(BPTDPAY/BPCNT,12,2)
End DoDot:1
QUIT
+46 QUIT
+47 ;
+48 ;Return the Billed Amount
+49 ;
BILLED(BP59) ;
+1 QUIT +$PIECE($GET(^BPST(BP59,5)),U,5)
+2 ;