BUDCRPP2 ; IHS/CMI/LAB - UDS REPORT PRINT 30 Dec 2015 10:44 AM 22 Oct 2015 12:16 PM ;
;;10.0;IHS/RPMS UNIFORM DATA SYSTEM;;FEB 04, 2016;Build 50
T4SH ;
W !!,$$CTR("TABLE 4 - SELECTED PATIENT CHARACTERISTICS",80)
W !!,BUD80L
Q
;
T4 ;EP
S BUDPG=0
S BUDTABI=$O(^BUDCCNTL("B","TABLE 4 LINE LABELS",0))
D HEADER^BUDCRPTP Q:BUDQUIT D T4SH
;print out each line
;
I $Y>(IOSL-6) D HEADER^BUDCRPTP Q:BUDQUIT D T4SH
W !!,"CHARACTERISTIC",?60,"NUMBER OF PATIENTS"
W !,BUD80L
W !,"INCOME AS PERCENT OF POVERTY LEVEL",?60,"Number of Patients",!?66,"(a)"
W !,BUD80L
F BUDX=1,2,3,4,5,6 Q:BUDQUIT D
.I $Y>(IOSL-3) D HEADER^BUDCRPTP Q:BUDQUIT D T4SH
.S BUDY=$O(^BUDCCNTL(BUDTABI,11,"B",BUDX,0))
.W !?2,BUDX,".",?7,$P(^BUDCCNTL(BUDTABI,11,BUDY,0),U,2),?63,$$C(BUDT4V(BUDX))
.W !,BUD80L
I $Y>(IOSL-22) D HEADER^BUDCRPTP Q:BUDQUIT D T4SH
W !!,"Principal Third Party Medical Insurance",?50,"0-17 Years",?65,"18 and Older",!?52,"Old (a)",?70,"(b)"
W !,BUD80L
F BUDX=7,"8a","8b",8,"9a",9,"10a","10b",10,11,12 Q:BUDQUIT D
.I $Y>(IOSL-3) D HEADER^BUDCRPTP Q:BUDQUIT D T4SH
.S BUDY=$O(^BUDCCNTL(BUDTABI,11,"B",BUDX,0))
.W !?2,BUDX,".",?7,$P(^BUDCCNTL(BUDTABI,11,BUDY,0),U,2)
.I $P(^BUDCCNTL(BUDTABI,11,BUDY,0),U,3)]"" W !?7,$P(^BUDCCNTL(BUDTABI,11,BUDY,0),U,3)
.W ?50,$$C($P(BUDT4V(BUDX),U,1)),?65,$$C($P(BUDT4V(BUDX),U,2))
.W !,BUD80L
D HEADER^BUDCRPTP Q:BUDQUIT
D T4SH
W !,BUD80L
W !,?50,"Other"
W !,?50,"Public"
W !,?2,"Managed Care Utilization",?50,"Including"
W !,?2,"Payor Category",?30,"Medicaid",?40,"Medicare",?50,"Non-",?60,"Private",?70,"Total"
W !?50,"Medicaid"
W !,?50,"CHIP"
W !,?30," (a)",?40," (b)",?50,"(c)",?60," (d)",?70," (e)"
W !,BUD80L
F BUDX="13a","13b","13c" Q:BUDQUIT D
.I $Y>(IOSL-3) D HEADER^BUDCRPTP Q:BUDQUIT D T4SH
.S BUDY=$O(^BUDCCNTL(BUDTABI,11,"B",BUDX,0))
.W !?2,BUDX,".",?7,$P(^BUDCCNTL(BUDTABI,11,BUDY,0),U,2),!,?7,$P(^BUDCCNTL(BUDTABI,11,BUDY,0),U,3) ;,?50,$$C($P(BUDT4V(BUDX),U,1)),?65,$$C($P(BUDT4V(BUDX),U,2))
.W !,BUD80L
I $Y>(IOSL-28) D HEADER^BUDCRPTP Q:BUDQUIT D T4SH
W !,"Special Populations",?60,"Number of Patients",!?65," (a)"
W !,BUD80L
F BUDX=14:1:26 Q:BUDQUIT D
.I $Y>(IOSL-3) D HEADER^BUDCRPTP Q:BUDQUIT D T4SH
.S BUDY=$O(^BUDCCNTL(BUDTABI,11,"B",BUDX,0))
.W !?2,BUDX,".",?7,$P(^BUDCCNTL(BUDTABI,11,BUDY,0),U,2) W:$P(^BUDCCNTL(BUDTABI,11,BUDY,0),U,3)]"" !?7,$P(^BUDCCNTL(BUDTABI,11,BUDY,0),U,3) W ?63,$$C(BUDT4V(BUDX))
.W !,BUD80L
W !
Q
C(X,Y) ;
I $G(Y)=1,+X=0 Q ""
I $G(Y)=2 Q "*******"
S X2=0,X3=8
D COMMA^%DTC
Q X
C9(X,Y) ;
I $G(Y)=1,+X=0 Q ""
I $G(Y)=2 Q "**********"
S X2=2,X3=14
D COMMA^%DTC
Q X
CTR(X,Y) ;EP - Center X in a field Y wide.
Q $J("",$S($D(Y):Y,1:IOM)-$L(X)\2)_X
;----------
USR() ;EP - Return name of current user from ^VA(200.
Q $S($G(DUZ):$S($D(^VA(200,DUZ,0)):$P(^(0),U),1:"UNKNOWN"),1:"DUZ UNDEFINED OR 0")
;----------
LOC() ;EP - Return location name from file 4 based on DUZ(2).
Q $S($G(DUZ(2)):$S($D(^DIC(4,DUZ(2),0)):$P(^(0),U),1:"UNKNOWN"),1:"DUZ(2) UNDEFINED OR 0")
;----------
T9SH ;
W !!,$$CTR("TABLE 9D - PATIENT-RELATED REVENUE (SCOPE OF PROJECT ONLY)",80)
W !!,BUD80L
W !!?40," FULL",?60,"AMOUNT"
W !?40,"CHARGES",?60,"COLLECTED"
W !?40,"THIS PERIOD",?60,"THIS PERIOD"
W !,"PAYOR CATEGORY",?42,"(a)",?61,"(b)"
;W !,BUD80L
Q
;
T9 ;EP
S BUDPG=0
D HEADER^BUDCRPTP Q:BUDQUIT D T9SH
;print out each line
;
I $Y>(IOSL-9) D HEADER^BUDCRPTP Q:BUDQUIT D T9SH
W !,BUD80L
W !?5,"Medicaid Non-Managed",!,"1. Care"
W !,BUD80L
W !?5,"Medicaid Managed Care",!,"2a. (capitated)"
W !,BUD80L
W !?5,"Medicaid Managed Care",!,"2b. (fee-for-service)"
W !,BUD80L
W !?5," TOTAL MEDICAID",!,"3. (LINES 1+2A+2B)"
W ?40,$$C9($P(BUDT9(3),U,1))
W ?60,$$C9($P(BUDT9(3),U,2))
;W !,BUD80L
4 ;
I $Y>(IOSL-9) D HEADER^BUDCRPTP Q:BUDQUIT D T9SH
W !,BUD80L
W !?5,"Medicare Non-Managed",!,"4. Care"
W !,BUD80L
W !?5,"Medicare Managed Care",!,"5a. (capitated)"
W !,BUD80L
W !?5,"Medicare Managed Care",!,"5b. (fee-for-service)"
W !,BUD80L
W !?5," TOTAL MEDICARE",!,"6. (LINES 4+5A+5B)"
W ?40,$$C9($P(BUDT9(6),U,1))
W ?60,$$C9($P(BUDT9(6),U,2))
;W !,BUD80L
7 ;
I $Y>(IOSL-13) D HEADER^BUDCRPTP Q:BUDQUIT D T9SH
W !,BUD80L
W !?5,"Other Public including"
W !,"7. Non-Medicaid CHIP (Non"
W !?5,"Managed Care)"
W !,BUD80L
W !?5,"Other Public including"
W !,"8a. Non-Medicaid CHIP"
W !,?5,"(Managed Care Capitated)"
W !,BUD80L
W !?5,"Other Public including"
W !,"8b. Non-Medicaid CHIP"
W !,?5,"(Managed Care fee-for-service)"
W !,BUD80L
W !?5," TOTAL OTHER PUBLIC"
W !,"9. (LINES 7+8A+8B)"
W ?40,$$C9($P(BUDT9(9),U,1))
W ?60,$$C9($P(BUDT9(9),U,2))
W !,BUD80L
10 ;
I $Y>(IOSL-9) D HEADER^BUDCRPTP Q:BUDQUIT D T9SH
W !,BUD80L
W !?5,"Private Non-Managed",!,"10. Care"
W !,BUD80L
W !?5,"Private Managed Care",!,"11a. (capitated)"
W !,BUD80L
W !?5,"Private Managed Care",!,"11b. (fee-for-service)"
W !,BUD80L
W !?5," TOTAL PRIVATE",!,"12. (LINES 10+11A+11B)"
W ?40,$$C9($P(BUDT9(12),U,1))
W ?60,$$C9($P(BUDT9(12),U,2))
;W !,BUD80L
13 ;
I $Y>(IOSL-9) D HEADER^BUDCRPTP Q:BUDQUIT D T9SH
W !,BUD80L
W !,"13.",!?5,"Self Pay"
W ?40,$$C9($P(BUDT9(13),U,1))
W ?60,$$C9($P(BUDT9(13),U,2))
W !,BUD80L
W !,"14.",?5," TOTAL"
W !?5,"(LINES 3+6+9+12+13)"
S T=$P($G(BUDT9(3)),U,1)+$P($G(BUDT9(6)),U,1)+$P($G(BUDT9(9)),U,1)+$P($G(BUDT9(12)),U,1)+$P($G(BUDT9(13)),U,1)
S V=$P($G(BUDT9(3)),U,2)+$P($G(BUDT9(6)),U,2)+$P($G(BUDT9(9)),U,2)+$P($G(BUDT9(12)),U,2)+$P($G(BUDT9(13)),U,2)
W ?40,$$C9(T)
W ?60,$$C9(V)
W !,BUD80L
PAGE2 ;
D HEADER^BUDCRPTP Q:BUDQUIT D T92SH
;print out each line
;
I $Y>(IOSL-9) D HEADER^BUDCRPTP Q:BUDQUIT D T92SH
W !,BUD80L
W !?5,"Medicaid Non-Managed",!,"1. Care"
W !,BUD80L
W !?5,"Medicaid Managed Care",!,"2a. (capitated)"
W !,BUD80L
W !?5,"Medicaid Managed Care",!,"2b. (fee-for-service)"
W !,BUD80L
W !?5," TOTAL MEDICAID",!,"3. (LINES 1+2A+2B)"
;W ?40,$$C9($P(BUDT9(3),U,1))
;W ?60,$$C9($P(BUDT9(3),U,2))
;W !,BUD80L
24 ;
I $Y>(IOSL-9) D HEADER^BUDCRPTP Q:BUDQUIT D T92SH
W !,BUD80L
W !?5,"Medicare Non-Managed",!,"4. Care"
W !,BUD80L
W !?5,"Medicare Managed Care",!,"5a. (capitated)"
W !,BUD80L
W !?5,"Medicare Managed Care",!,"5b. (fee-for-service)"
W !,BUD80L
W !?5," TOTAL MEDICARE",!,"6. (LINES 4+5A+5B)"
;W ?40,$$C9($P(BUDT9(6),U,1))
;W ?60,$$C9($P(BUDT9(6),U,2))
;W !,BUD80L
27 ;
I $Y>(IOSL-13) D HEADER^BUDCRPTP Q:BUDQUIT D T92SH
W !,BUD80L
W !?5,"Other Public including"
W !,"7. Non-Medicaid CHIP (Non"
W !?5,"Managed Care)"
W !,BUD80L
W !?5,"Other Public including"
W !,"8a. Non-Medicaid CHIP"
W !,?5,"(Managed Care Capitated)"
W !,BUD80L
W !?5,"Other Public including"
W !,"8b. Non-Medicaid CHIP"
W !,?5,"(Managed Care fee-for-service)"
W !,BUD80L
W !?5," TOTAL OTHER PUBLIC"
W !,"9. (LINES 7+8A+8B)"
;W ?40,$$C9($P(BUDT9(9),U,1))
;W ?60,$$C9($P(BUDT9(9),U,2))
;W !,BUD80L
210 ;
I $Y>(IOSL-9) D HEADER^BUDCRPTP Q:BUDQUIT D T92SH
W !,BUD80L
W !?5,"Private Non-Managed",!,"10. Care"
W !,BUD80L
W !?5,"Private Managed Care",!,"11a. (capitated)"
W !,BUD80L
W !?5,"Private Managed Care",!,"11b. (fee-for-service)"
W !,BUD80L
W !?5," TOTAL PRIVATE",!,"12. (LINES 10+11A+11B)"
;W ?40,$$C9($P(BUDT9(12),U,1))
;W ?60,$$C9($P(BUDT9(12),U,2))
;W !,BUD80L
213 ;
I $Y>(IOSL-9) D HEADER^BUDCRPTP Q:BUDQUIT D T92SH
W !,BUD80L
W !,"13.",!?5,"Self Pay"
;W ?40,$$C9($P(BUDT9(13),U,1))
;W ?60,$$C9($P(BUDT9(13),U,2))
W !,BUD80L
W !,"14.",?5," TOTAL"
W !?5,"(LINES 3+6+9+12+13)"
;S T=$P($G(BUDT9(3)),U,1)+$P($G(BUDT9(6)),U,1)+$P($G(BUDT9(9)),U,1)+$P($G(BUDT9(12)),U,1)+$P($G(BUDT9(13)),U,1)
;S V=$P($G(BUDT9(3)),U,2)+$P($G(BUDT9(6)),U,2)+$P($G(BUDT9(9)),U,2)+$P($G(BUDT9(12)),U,2)+$P($G(BUDT9(13)),U,2)
;W ?40,$$C9(T)
;W ?60,$$C9(V)
W !,BUD80L
PAGE3 ;
D HEADER^BUDCRPTP Q:BUDQUIT D T93SH
;print out each line
;
I $Y>(IOSL-9) D HEADER^BUDCRPTP Q:BUDQUIT D T93SH
W !,BUD80L
W !?5,"Medicaid Non-Managed",!,"1. Care"
W !,BUD80L
W !?5,"Medicaid Managed Care",!,"2a. (capitated)"
W !,BUD80L
W !?5,"Medicaid Managed Care",!,"2b. (fee-for-service)"
W !,BUD80L
W !?5," TOTAL MEDICAID",!,"3. (LINES 1+2A+2B)"
W ?35,$$C9($P(BUDT9(3),U,3))
;W ?60,$$C9($P(BUDT9(3),U,2))
;W !,BUD80L
34 ;
I $Y>(IOSL-9) D HEADER^BUDCRPTP Q:BUDQUIT D T93SH
W !,BUD80L
W !?5,"Medicare Non-Managed",!,"4. Care"
W !,BUD80L
W !?5,"Medicare Managed Care",!,"5a. (capitated)"
W !,BUD80L
W !?5,"Medicare Managed Care",!,"5b. (fee-for-service)"
W !,BUD80L
W !?5," TOTAL MEDICARE",!,"6. (LINES 4+5A+5B)"
W ?35,$$C9($P(BUDT9(6),U,3))
;W ?60,$$C9($P(BUDT9(6),U,2))
;W !,BUD80L
37 ;
I $Y>(IOSL-13) D HEADER^BUDCRPTP Q:BUDQUIT D T93SH
W !,BUD80L
W !?5,"Other Public including"
W !,"7. Non-Medicaid CHIP (Non"
W !?5,"Managed Care)"
W !,BUD80L
W !?5,"Other Public including"
W !,"8a. Non-Medicaid CHIP"
W !,?5,"(Managed Care Capitated)"
W !,BUD80L
W !?5,"Other Public including"
W !,"8b. Non-Medicaid CHIP"
W !,?5,"(Managed Care fee-for-service)"
W !,BUD80L
W !?5," TOTAL OTHER PUBLIC"
W !,"9. (LINES 7+8A+8B)"
W ?35,$$C9($P(BUDT9(9),U,3))
;W ?60,$$C9($P(BUDT9(9),U,2))
W !,BUD80L
310 ;
I $Y>(IOSL-9) D HEADER^BUDCRPTP Q:BUDQUIT D T93SH
W !,BUD80L
W !?5,"Private Non-Managed",!,"10. Care"
W !,BUD80L
W !?5,"Private Managed Care",!,"11a. (capitated)"
W !,BUD80L
W !?5,"Private Managed Care",!,"11b. (fee-for-service)"
W !,BUD80L
W !?5," TOTAL PRIVATE",!,"12. (LINES 10+11A+11B)"
W ?35,$$C9($P(BUDT9(12),U,3))
;W ?60,$$C9($P(BUDT9(12),U,2))
;W !,BUD80L
313 ;
I $Y>(IOSL-9) D HEADER^BUDCRPTP Q:BUDQUIT D T93SH
W !,BUD80L
W !,"13.",!?5,"Self Pay"
W ?35,$$C9($P(BUDT9(13),U,3))
;W ?60,$$C9($P(BUDT9(13),U,2))
W !,BUD80L
W !,"14.",?5," TOTAL"
W !?5,"(LINES 3+6+9+12+13)"
S T=$P($G(BUDT9(3)),U,3)+$P($G(BUDT9(6)),U,3)+$P($G(BUDT9(9)),U,3)+$P($G(BUDT9(12)),U,3)+$P($G(BUDT9(13)),U,3)
;S V=$P($G(BUDT9(3)),U,2)+$P($G(BUDT9(6)),U,2)+$P($G(BUDT9(9)),U,2)+$P($G(BUDT9(12)),U,2)+$P($G(BUDT9(13)),U,2)
W ?35,$$C9(T)
;W ?60,$$C9(V)
W !,BUD80L
Q
T92SH ;
W !!,$$CTR("TABLE 9D - PATIENT-RELATED REVENUE (SCOPE OF PROJECT ONLY)",80)
W !!,BUD80L
W !,$$CTR("RETROACTIVE SETTLEMENTS, RECEIPTS AND PAYPACKS (c)")
W !?56,"COLLECTION OF"
W !?43,"COLLECTION",?56,"OTHER"
W !?30,"COLLECTION",?43,"OF RECONCIL",?56,"RETROACTIVE"
W !?30,"RECONCILIA",?43,"IATION/WRAP",?56,"PAYMENTS",?69,"PENALTY/"
W !?30,"TION/WRAP",?43,"AROUND",?56,"INCLUDING",?69,"PAYBACK"
W !?30,"AROUND",?43,"PREVIOUS",?56,"RISK POOL/"
W !?30,"CURRENT",?43,"YEARS",?56,"INCENTIVE/"
W !?30,"YEAR",?56,"WITHHOLD"
W !,"PAYOR CATEGORY",?33,"(c1)",?46,"(c2)",?59,"(c3)",?72,"(c4)"
;W !,BUD80L
Q
;----------
T93SH ;
W !!,$$CTR("TABLE 9D - PATIENT-RELATED REVENUE (SCOPE OF PROJECT ONLY)",80)
W !!,BUD80L
W !!?50,"SLIDING",?65,"BAD DEBT"
W !?35,"ALLOWANCES",?50,"DISCOUNTS",?65,"WRITE OFF"
W !,"PAYOR CATEGORY",?38,"(d)",?53,"(e)",?68,"(f)"
;W !,BUD80L
Q
BUDCRPP2 ; IHS/CMI/LAB - UDS REPORT PRINT 30 Dec 2015 10:44 AM 22 Oct 2015 12:16 PM ;
+1 ;;10.0;IHS/RPMS UNIFORM DATA SYSTEM;;FEB 04, 2016;Build 50
T4SH ;
+1 WRITE !!,$$CTR("TABLE 4 - SELECTED PATIENT CHARACTERISTICS",80)
+2 WRITE !!,BUD80L
+3 QUIT
+4 ;
T4 ;EP
+1 SET BUDPG=0
+2 SET BUDTABI=$ORDER(^BUDCCNTL("B","TABLE 4 LINE LABELS",0))
+3 DO HEADER^BUDCRPTP
IF BUDQUIT
QUIT
DO T4SH
+4 ;print out each line
+5 ;
+6 IF $Y>(IOSL-6)
DO HEADER^BUDCRPTP
IF BUDQUIT
QUIT
DO T4SH
+7 WRITE !!,"CHARACTERISTIC",?60,"NUMBER OF PATIENTS"
+8 WRITE !,BUD80L
+9 WRITE !,"INCOME AS PERCENT OF POVERTY LEVEL",?60,"Number of Patients",!?66,"(a)"
+10 WRITE !,BUD80L
+11 FOR BUDX=1,2,3,4,5,6
IF BUDQUIT
QUIT
Begin DoDot:1
+12 IF $Y>(IOSL-3)
DO HEADER^BUDCRPTP
IF BUDQUIT
QUIT
DO T4SH
+13 SET BUDY=$ORDER(^BUDCCNTL(BUDTABI,11,"B",BUDX,0))
+14 WRITE !?2,BUDX,".",?7,$PIECE(^BUDCCNTL(BUDTABI,11,BUDY,0),U,2),?63,$$C(BUDT4V(BUDX))
+15 WRITE !,BUD80L
End DoDot:1
+16 IF $Y>(IOSL-22)
DO HEADER^BUDCRPTP
IF BUDQUIT
QUIT
DO T4SH
+17 WRITE !!,"Principal Third Party Medical Insurance",?50,"0-17 Years",?65,"18 and Older",!?52,"Old (a)",?70,"(b)"
+18 WRITE !,BUD80L
+19 FOR BUDX=7,"8a","8b",8,"9a",9,"10a","10b",10,11,12
IF BUDQUIT
QUIT
Begin DoDot:1
+20 IF $Y>(IOSL-3)
DO HEADER^BUDCRPTP
IF BUDQUIT
QUIT
DO T4SH
+21 SET BUDY=$ORDER(^BUDCCNTL(BUDTABI,11,"B",BUDX,0))
+22 WRITE !?2,BUDX,".",?7,$PIECE(^BUDCCNTL(BUDTABI,11,BUDY,0),U,2)
+23 IF $PIECE(^BUDCCNTL(BUDTABI,11,BUDY,0),U,3)]""
WRITE !?7,$PIECE(^BUDCCNTL(BUDTABI,11,BUDY,0),U,3)
+24 WRITE ?50,$$C($PIECE(BUDT4V(BUDX),U,1)),?65,$$C($PIECE(BUDT4V(BUDX),U,2))
+25 WRITE !,BUD80L
End DoDot:1
+26 DO HEADER^BUDCRPTP
IF BUDQUIT
QUIT
+27 DO T4SH
+28 WRITE !,BUD80L
+29 WRITE !,?50,"Other"
+30 WRITE !,?50,"Public"
+31 WRITE !,?2,"Managed Care Utilization",?50,"Including"
+32 WRITE !,?2,"Payor Category",?30,"Medicaid",?40,"Medicare",?50,"Non-",?60,"Private",?70,"Total"
+33 WRITE !?50,"Medicaid"
+34 WRITE !,?50,"CHIP"
+35 WRITE !,?30," (a)",?40," (b)",?50,"(c)",?60," (d)",?70," (e)"
+36 WRITE !,BUD80L
+37 FOR BUDX="13a","13b","13c"
IF BUDQUIT
QUIT
Begin DoDot:1
+38 IF $Y>(IOSL-3)
DO HEADER^BUDCRPTP
IF BUDQUIT
QUIT
DO T4SH
+39 SET BUDY=$ORDER(^BUDCCNTL(BUDTABI,11,"B",BUDX,0))
+40 ;,?50,$$C($P(BUDT4V(BUDX),U,1)),?65,$$C($P(BUDT4V(BUDX),U,2))
WRITE !?2,BUDX,".",?7,$PIECE(^BUDCCNTL(BUDTABI,11,BUDY,0),U,2),!,?7,$PIECE(^BUDCCNTL(BUDTABI,11,BUDY,0),U,3)
+41 WRITE !,BUD80L
End DoDot:1
+42 IF $Y>(IOSL-28)
DO HEADER^BUDCRPTP
IF BUDQUIT
QUIT
DO T4SH
+43 WRITE !,"Special Populations",?60,"Number of Patients",!?65," (a)"
+44 WRITE !,BUD80L
+45 FOR BUDX=14:1:26
IF BUDQUIT
QUIT
Begin DoDot:1
+46 IF $Y>(IOSL-3)
DO HEADER^BUDCRPTP
IF BUDQUIT
QUIT
DO T4SH
+47 SET BUDY=$ORDER(^BUDCCNTL(BUDTABI,11,"B",BUDX,0))
+48 WRITE !?2,BUDX,".",?7,$PIECE(^BUDCCNTL(BUDTABI,11,BUDY,0),U,2)
IF $PIECE(^BUDCCNTL(BUDTABI,11,BUDY,0),U,3)]""
WRITE !?7,$PIECE(^BUDCCNTL(BUDTABI,11,BUDY,0),U,3)
WRITE ?63,$$C(BUDT4V(BUDX))
+49 WRITE !,BUD80L
End DoDot:1
+50 WRITE !
+51 QUIT
C(X,Y) ;
+1 IF $GET(Y)=1
IF +X=0
QUIT ""
+2 IF $GET(Y)=2
QUIT "*******"
+3 SET X2=0
SET X3=8
+4 DO COMMA^%DTC
+5 QUIT X
C9(X,Y) ;
+1 IF $GET(Y)=1
IF +X=0
QUIT ""
+2 IF $GET(Y)=2
QUIT "**********"
+3 SET X2=2
SET X3=14
+4 DO COMMA^%DTC
+5 QUIT X
CTR(X,Y) ;EP - Center X in a field Y wide.
+1 QUIT $JUSTIFY("",$SELECT($DATA(Y):Y,1:IOM)-$LENGTH(X)\2)_X
+2 ;----------
USR() ;EP - Return name of current user from ^VA(200.
+1 QUIT $SELECT($GET(DUZ):$SELECT($DATA(^VA(200,DUZ,0)):$PIECE(^(0),U),1:"UNKNOWN"),1:"DUZ UNDEFINED OR 0")
+2 ;----------
LOC() ;EP - Return location name from file 4 based on DUZ(2).
+1 QUIT $SELECT($GET(DUZ(2)):$SELECT($DATA(^DIC(4,DUZ(2),0)):$PIECE(^(0),U),1:"UNKNOWN"),1:"DUZ(2) UNDEFINED OR 0")
+2 ;----------
T9SH ;
+1 WRITE !!,$$CTR("TABLE 9D - PATIENT-RELATED REVENUE (SCOPE OF PROJECT ONLY)",80)
+2 WRITE !!,BUD80L
+3 WRITE !!?40," FULL",?60,"AMOUNT"
+4 WRITE !?40,"CHARGES",?60,"COLLECTED"
+5 WRITE !?40,"THIS PERIOD",?60,"THIS PERIOD"
+6 WRITE !,"PAYOR CATEGORY",?42,"(a)",?61,"(b)"
+7 ;W !,BUD80L
+8 QUIT
+9 ;
T9 ;EP
+1 SET BUDPG=0
+2 DO HEADER^BUDCRPTP
IF BUDQUIT
QUIT
DO T9SH
+3 ;print out each line
+4 ;
+5 IF $Y>(IOSL-9)
DO HEADER^BUDCRPTP
IF BUDQUIT
QUIT
DO T9SH
+6 WRITE !,BUD80L
+7 WRITE !?5,"Medicaid Non-Managed",!,"1. Care"
+8 WRITE !,BUD80L
+9 WRITE !?5,"Medicaid Managed Care",!,"2a. (capitated)"
+10 WRITE !,BUD80L
+11 WRITE !?5,"Medicaid Managed Care",!,"2b. (fee-for-service)"
+12 WRITE !,BUD80L
+13 WRITE !?5," TOTAL MEDICAID",!,"3. (LINES 1+2A+2B)"
+14 WRITE ?40,$$C9($PIECE(BUDT9(3),U,1))
+15 WRITE ?60,$$C9($PIECE(BUDT9(3),U,2))
+16 ;W !,BUD80L
4 ;
+1 IF $Y>(IOSL-9)
DO HEADER^BUDCRPTP
IF BUDQUIT
QUIT
DO T9SH
+2 WRITE !,BUD80L
+3 WRITE !?5,"Medicare Non-Managed",!,"4. Care"
+4 WRITE !,BUD80L
+5 WRITE !?5,"Medicare Managed Care",!,"5a. (capitated)"
+6 WRITE !,BUD80L
+7 WRITE !?5,"Medicare Managed Care",!,"5b. (fee-for-service)"
+8 WRITE !,BUD80L
+9 WRITE !?5," TOTAL MEDICARE",!,"6. (LINES 4+5A+5B)"
+10 WRITE ?40,$$C9($PIECE(BUDT9(6),U,1))
+11 WRITE ?60,$$C9($PIECE(BUDT9(6),U,2))
+12 ;W !,BUD80L
7 ;
+1 IF $Y>(IOSL-13)
DO HEADER^BUDCRPTP
IF BUDQUIT
QUIT
DO T9SH
+2 WRITE !,BUD80L
+3 WRITE !?5,"Other Public including"
+4 WRITE !,"7. Non-Medicaid CHIP (Non"
+5 WRITE !?5,"Managed Care)"
+6 WRITE !,BUD80L
+7 WRITE !?5,"Other Public including"
+8 WRITE !,"8a. Non-Medicaid CHIP"
+9 WRITE !,?5,"(Managed Care Capitated)"
+10 WRITE !,BUD80L
+11 WRITE !?5,"Other Public including"
+12 WRITE !,"8b. Non-Medicaid CHIP"
+13 WRITE !,?5,"(Managed Care fee-for-service)"
+14 WRITE !,BUD80L
+15 WRITE !?5," TOTAL OTHER PUBLIC"
+16 WRITE !,"9. (LINES 7+8A+8B)"
+17 WRITE ?40,$$C9($PIECE(BUDT9(9),U,1))
+18 WRITE ?60,$$C9($PIECE(BUDT9(9),U,2))
+19 WRITE !,BUD80L
10 ;
+1 IF $Y>(IOSL-9)
DO HEADER^BUDCRPTP
IF BUDQUIT
QUIT
DO T9SH
+2 WRITE !,BUD80L
+3 WRITE !?5,"Private Non-Managed",!,"10. Care"
+4 WRITE !,BUD80L
+5 WRITE !?5,"Private Managed Care",!,"11a. (capitated)"
+6 WRITE !,BUD80L
+7 WRITE !?5,"Private Managed Care",!,"11b. (fee-for-service)"
+8 WRITE !,BUD80L
+9 WRITE !?5," TOTAL PRIVATE",!,"12. (LINES 10+11A+11B)"
+10 WRITE ?40,$$C9($PIECE(BUDT9(12),U,1))
+11 WRITE ?60,$$C9($PIECE(BUDT9(12),U,2))
+12 ;W !,BUD80L
13 ;
+1 IF $Y>(IOSL-9)
DO HEADER^BUDCRPTP
IF BUDQUIT
QUIT
DO T9SH
+2 WRITE !,BUD80L
+3 WRITE !,"13.",!?5,"Self Pay"
+4 WRITE ?40,$$C9($PIECE(BUDT9(13),U,1))
+5 WRITE ?60,$$C9($PIECE(BUDT9(13),U,2))
+6 WRITE !,BUD80L
+7 WRITE !,"14.",?5," TOTAL"
+8 WRITE !?5,"(LINES 3+6+9+12+13)"
+9 SET T=$PIECE($GET(BUDT9(3)),U,1)+$PIECE($GET(BUDT9(6)),U,1)+$PIECE($GET(BUDT9(9)),U,1)+$PIECE($GET(BUDT9(12)),U,1)+$PIECE($GET(BUDT9(13)),U,1)
+10 SET V=$PIECE($GET(BUDT9(3)),U,2)+$PIECE($GET(BUDT9(6)),U,2)+$PIECE($GET(BUDT9(9)),U,2)+$PIECE($GET(BUDT9(12)),U,2)+$PIECE($GET(BUDT9(13)),U,2)
+11 WRITE ?40,$$C9(T)
+12 WRITE ?60,$$C9(V)
+13 WRITE !,BUD80L
PAGE2 ;
+1 DO HEADER^BUDCRPTP
IF BUDQUIT
QUIT
DO T92SH
+2 ;print out each line
+3 ;
+4 IF $Y>(IOSL-9)
DO HEADER^BUDCRPTP
IF BUDQUIT
QUIT
DO T92SH
+5 WRITE !,BUD80L
+6 WRITE !?5,"Medicaid Non-Managed",!,"1. Care"
+7 WRITE !,BUD80L
+8 WRITE !?5,"Medicaid Managed Care",!,"2a. (capitated)"
+9 WRITE !,BUD80L
+10 WRITE !?5,"Medicaid Managed Care",!,"2b. (fee-for-service)"
+11 WRITE !,BUD80L
+12 WRITE !?5," TOTAL MEDICAID",!,"3. (LINES 1+2A+2B)"
+13 ;W ?40,$$C9($P(BUDT9(3),U,1))
+14 ;W ?60,$$C9($P(BUDT9(3),U,2))
+15 ;W !,BUD80L
24 ;
+1 IF $Y>(IOSL-9)
DO HEADER^BUDCRPTP
IF BUDQUIT
QUIT
DO T92SH
+2 WRITE !,BUD80L
+3 WRITE !?5,"Medicare Non-Managed",!,"4. Care"
+4 WRITE !,BUD80L
+5 WRITE !?5,"Medicare Managed Care",!,"5a. (capitated)"
+6 WRITE !,BUD80L
+7 WRITE !?5,"Medicare Managed Care",!,"5b. (fee-for-service)"
+8 WRITE !,BUD80L
+9 WRITE !?5," TOTAL MEDICARE",!,"6. (LINES 4+5A+5B)"
+10 ;W ?40,$$C9($P(BUDT9(6),U,1))
+11 ;W ?60,$$C9($P(BUDT9(6),U,2))
+12 ;W !,BUD80L
27 ;
+1 IF $Y>(IOSL-13)
DO HEADER^BUDCRPTP
IF BUDQUIT
QUIT
DO T92SH
+2 WRITE !,BUD80L
+3 WRITE !?5,"Other Public including"
+4 WRITE !,"7. Non-Medicaid CHIP (Non"
+5 WRITE !?5,"Managed Care)"
+6 WRITE !,BUD80L
+7 WRITE !?5,"Other Public including"
+8 WRITE !,"8a. Non-Medicaid CHIP"
+9 WRITE !,?5,"(Managed Care Capitated)"
+10 WRITE !,BUD80L
+11 WRITE !?5,"Other Public including"
+12 WRITE !,"8b. Non-Medicaid CHIP"
+13 WRITE !,?5,"(Managed Care fee-for-service)"
+14 WRITE !,BUD80L
+15 WRITE !?5," TOTAL OTHER PUBLIC"
+16 WRITE !,"9. (LINES 7+8A+8B)"
+17 ;W ?40,$$C9($P(BUDT9(9),U,1))
+18 ;W ?60,$$C9($P(BUDT9(9),U,2))
+19 ;W !,BUD80L
210 ;
+1 IF $Y>(IOSL-9)
DO HEADER^BUDCRPTP
IF BUDQUIT
QUIT
DO T92SH
+2 WRITE !,BUD80L
+3 WRITE !?5,"Private Non-Managed",!,"10. Care"
+4 WRITE !,BUD80L
+5 WRITE !?5,"Private Managed Care",!,"11a. (capitated)"
+6 WRITE !,BUD80L
+7 WRITE !?5,"Private Managed Care",!,"11b. (fee-for-service)"
+8 WRITE !,BUD80L
+9 WRITE !?5," TOTAL PRIVATE",!,"12. (LINES 10+11A+11B)"
+10 ;W ?40,$$C9($P(BUDT9(12),U,1))
+11 ;W ?60,$$C9($P(BUDT9(12),U,2))
+12 ;W !,BUD80L
213 ;
+1 IF $Y>(IOSL-9)
DO HEADER^BUDCRPTP
IF BUDQUIT
QUIT
DO T92SH
+2 WRITE !,BUD80L
+3 WRITE !,"13.",!?5,"Self Pay"
+4 ;W ?40,$$C9($P(BUDT9(13),U,1))
+5 ;W ?60,$$C9($P(BUDT9(13),U,2))
+6 WRITE !,BUD80L
+7 WRITE !,"14.",?5," TOTAL"
+8 WRITE !?5,"(LINES 3+6+9+12+13)"
+9 ;S T=$P($G(BUDT9(3)),U,1)+$P($G(BUDT9(6)),U,1)+$P($G(BUDT9(9)),U,1)+$P($G(BUDT9(12)),U,1)+$P($G(BUDT9(13)),U,1)
+10 ;S V=$P($G(BUDT9(3)),U,2)+$P($G(BUDT9(6)),U,2)+$P($G(BUDT9(9)),U,2)+$P($G(BUDT9(12)),U,2)+$P($G(BUDT9(13)),U,2)
+11 ;W ?40,$$C9(T)
+12 ;W ?60,$$C9(V)
+13 WRITE !,BUD80L
PAGE3 ;
+1 DO HEADER^BUDCRPTP
IF BUDQUIT
QUIT
DO T93SH
+2 ;print out each line
+3 ;
+4 IF $Y>(IOSL-9)
DO HEADER^BUDCRPTP
IF BUDQUIT
QUIT
DO T93SH
+5 WRITE !,BUD80L
+6 WRITE !?5,"Medicaid Non-Managed",!,"1. Care"
+7 WRITE !,BUD80L
+8 WRITE !?5,"Medicaid Managed Care",!,"2a. (capitated)"
+9 WRITE !,BUD80L
+10 WRITE !?5,"Medicaid Managed Care",!,"2b. (fee-for-service)"
+11 WRITE !,BUD80L
+12 WRITE !?5," TOTAL MEDICAID",!,"3. (LINES 1+2A+2B)"
+13 WRITE ?35,$$C9($PIECE(BUDT9(3),U,3))
+14 ;W ?60,$$C9($P(BUDT9(3),U,2))
+15 ;W !,BUD80L
34 ;
+1 IF $Y>(IOSL-9)
DO HEADER^BUDCRPTP
IF BUDQUIT
QUIT
DO T93SH
+2 WRITE !,BUD80L
+3 WRITE !?5,"Medicare Non-Managed",!,"4. Care"
+4 WRITE !,BUD80L
+5 WRITE !?5,"Medicare Managed Care",!,"5a. (capitated)"
+6 WRITE !,BUD80L
+7 WRITE !?5,"Medicare Managed Care",!,"5b. (fee-for-service)"
+8 WRITE !,BUD80L
+9 WRITE !?5," TOTAL MEDICARE",!,"6. (LINES 4+5A+5B)"
+10 WRITE ?35,$$C9($PIECE(BUDT9(6),U,3))
+11 ;W ?60,$$C9($P(BUDT9(6),U,2))
+12 ;W !,BUD80L
37 ;
+1 IF $Y>(IOSL-13)
DO HEADER^BUDCRPTP
IF BUDQUIT
QUIT
DO T93SH
+2 WRITE !,BUD80L
+3 WRITE !?5,"Other Public including"
+4 WRITE !,"7. Non-Medicaid CHIP (Non"
+5 WRITE !?5,"Managed Care)"
+6 WRITE !,BUD80L
+7 WRITE !?5,"Other Public including"
+8 WRITE !,"8a. Non-Medicaid CHIP"
+9 WRITE !,?5,"(Managed Care Capitated)"
+10 WRITE !,BUD80L
+11 WRITE !?5,"Other Public including"
+12 WRITE !,"8b. Non-Medicaid CHIP"
+13 WRITE !,?5,"(Managed Care fee-for-service)"
+14 WRITE !,BUD80L
+15 WRITE !?5," TOTAL OTHER PUBLIC"
+16 WRITE !,"9. (LINES 7+8A+8B)"
+17 WRITE ?35,$$C9($PIECE(BUDT9(9),U,3))
+18 ;W ?60,$$C9($P(BUDT9(9),U,2))
+19 WRITE !,BUD80L
310 ;
+1 IF $Y>(IOSL-9)
DO HEADER^BUDCRPTP
IF BUDQUIT
QUIT
DO T93SH
+2 WRITE !,BUD80L
+3 WRITE !?5,"Private Non-Managed",!,"10. Care"
+4 WRITE !,BUD80L
+5 WRITE !?5,"Private Managed Care",!,"11a. (capitated)"
+6 WRITE !,BUD80L
+7 WRITE !?5,"Private Managed Care",!,"11b. (fee-for-service)"
+8 WRITE !,BUD80L
+9 WRITE !?5," TOTAL PRIVATE",!,"12. (LINES 10+11A+11B)"
+10 WRITE ?35,$$C9($PIECE(BUDT9(12),U,3))
+11 ;W ?60,$$C9($P(BUDT9(12),U,2))
+12 ;W !,BUD80L
313 ;
+1 IF $Y>(IOSL-9)
DO HEADER^BUDCRPTP
IF BUDQUIT
QUIT
DO T93SH
+2 WRITE !,BUD80L
+3 WRITE !,"13.",!?5,"Self Pay"
+4 WRITE ?35,$$C9($PIECE(BUDT9(13),U,3))
+5 ;W ?60,$$C9($P(BUDT9(13),U,2))
+6 WRITE !,BUD80L
+7 WRITE !,"14.",?5," TOTAL"
+8 WRITE !?5,"(LINES 3+6+9+12+13)"
+9 SET T=$PIECE($GET(BUDT9(3)),U,3)+$PIECE($GET(BUDT9(6)),U,3)+$PIECE($GET(BUDT9(9)),U,3)+$PIECE($GET(BUDT9(12)),U,3)+$PIECE($GET(BUDT9(13)),U,3)
+10 ;S V=$P($G(BUDT9(3)),U,2)+$P($G(BUDT9(6)),U,2)+$P($G(BUDT9(9)),U,2)+$P($G(BUDT9(12)),U,2)+$P($G(BUDT9(13)),U,2)
+11 WRITE ?35,$$C9(T)
+12 ;W ?60,$$C9(V)
+13 WRITE !,BUD80L
+14 QUIT
T92SH ;
+1 WRITE !!,$$CTR("TABLE 9D - PATIENT-RELATED REVENUE (SCOPE OF PROJECT ONLY)",80)
+2 WRITE !!,BUD80L
+3 WRITE !,$$CTR("RETROACTIVE SETTLEMENTS, RECEIPTS AND PAYPACKS (c)")
+4 WRITE !?56,"COLLECTION OF"
+5 WRITE !?43,"COLLECTION",?56,"OTHER"
+6 WRITE !?30,"COLLECTION",?43,"OF RECONCIL",?56,"RETROACTIVE"
+7 WRITE !?30,"RECONCILIA",?43,"IATION/WRAP",?56,"PAYMENTS",?69,"PENALTY/"
+8 WRITE !?30,"TION/WRAP",?43,"AROUND",?56,"INCLUDING",?69,"PAYBACK"
+9 WRITE !?30,"AROUND",?43,"PREVIOUS",?56,"RISK POOL/"
+10 WRITE !?30,"CURRENT",?43,"YEARS",?56,"INCENTIVE/"
+11 WRITE !?30,"YEAR",?56,"WITHHOLD"
+12 WRITE !,"PAYOR CATEGORY",?33,"(c1)",?46,"(c2)",?59,"(c3)",?72,"(c4)"
+13 ;W !,BUD80L
+14 QUIT
+15 ;----------
T93SH ;
+1 WRITE !!,$$CTR("TABLE 9D - PATIENT-RELATED REVENUE (SCOPE OF PROJECT ONLY)",80)
+2 WRITE !!,BUD80L
+3 WRITE !!?50,"SLIDING",?65,"BAD DEBT"
+4 WRITE !?35,"ALLOWANCES",?50,"DISCOUNTS",?65,"WRITE OFF"
+5 WRITE !,"PAYOR CATEGORY",?38,"(d)",?53,"(e)",?68,"(f)"
+6 ;W !,BUD80L
+7 QUIT