BUD8RPTP ; IHS/CMI/LAB - UDS REPORT PRINT 30 Dec 2008 10:44 AM ;
;;10.0;IHS/RPMS UNIFORM DATA SYSTEM;;FEB 04, 2016;Build 50
;
PRINT ;EP
S BUDPG=0
S BUDQUIT=0
S BUD80L="",$P(BUD80L,"_",79)="_"
I $G(BUDTZ) D TZ G:BUDQUIT EOJ
I $G(BUDT3A) D T3A G:BUDQUIT EOJ
I $G(BUDT3B) D T3B G:BUDQUIT EOJ
I $G(BUDT4) D T4 G:BUDQUIT EOJ
I $G(BUDT5) D T5 G:BUDQUIT EOJ
I $G(BUDT6) D T6 G:BUDQUIT EOJ
D PATLISTS
D EOJ
Q
;
EOJ ;
K ^TMP($J)
K ^XTMP("BUD8RPT1",BUDJ,BUDH)
Q
T4 ;
Q
T3A ;
D HEADER Q:BUDQUIT D T3ASH
;print out each line
S BUDZ=0 F S BUDZ=$O(^BUDGTTA("AC",BUDZ)) Q:BUDZ>38!(BUDQUIT) D
.S BUDC=$O(^BUDGTTA("AC",BUDZ,0))
.I $Y>(IOSL-3) D HEADER Q:BUDQUIT D T3ASH
.S BUDY=^BUDGTTA(BUDC,0)
.S BUDX=$P(BUDY,U,2) ;column one End control
.W !
.I BUDX<10 W " "
.W $P(BUDY,U,2),?5,$P(BUDY,U,3)
.;I +BUDX=0 Q
.W ?35,$$C($P(BUDTOT("M"),U,BUDX)),?50,$$C($P(BUDTOT("F"),U,BUDX)),?68,$$C($P(BUDTOT("ALL"),U,BUDX))
.I BUDX=20 D
..I $Y>(IOSL-4) D HEADER Q:BUDQUIT D T3ASH
..W !!?10,"SUBTOTAL 0-19",?35,$$C(BUD019("M")),?50,$$C(BUD019("F")),?68,$$C(BUD019("ALL")),!
S BUDC=$O(^BUDGTTA("B",43,0))
I $Y>(IOSL-3) D HEADER Q:BUDQUIT D T3ASH
W !,$P(^BUDGTTA(BUDC,0),U,2),?5,$P(^BUDGTTA(BUDC,0),U,3)
S BUDC=$O(^BUDGTTA("AC",39,0))
I $Y>(IOSL-2) D HEADER Q:BUDQUIT D T3ASH
S BUDY=^BUDGTTA(BUDC,0)
S BUDX=$P(BUDY,U,2) ;column one End control
W !
W $P(BUDY,U,2),?5,$P(BUDY,U,3)
W ?35,$$C($P(BUDTOT("M"),U,BUDX)),?50,$$C($P(BUDTOT("F"),U,BUDX)),?68,$$C($P(BUDTOT("ALL"),U,BUDX))
W !
Q
T3ASH ;
W !,$$CTR($G(^BUDGTTA(1,11)),80),!
F Y=2:1:4 S X=$O(^BUDGTTA("B",Y,0)) W !,$P(^BUDGTTA(X,0),U,2),?5,$P(^BUDGTTA(X,0),U,3),?33,$P(^BUDGTTA(X,0),U,4),?50,$P(^BUDGTTA(X,0),U,5),?68,$P(^BUDGTTA(X,0),U,6)
W !,$TR($J("",80)," ","-")
Q
T3BSH ;
W !!,$$CTR("TABLE 3B -",80)
W !,$$CTR("PATIENTS BY ETHNICITY/RACE/LANGUAGE",80),!,BUD80L
;W !,$TR($J("",80)," ","-")
Q
TZSH ;
W !!,$$CTR("PATIENTS BY ZIP CODE",80)
W !,$TR($J("",80)," ","-")
W !!?5,"ZIP CODE",?40,"PATIENTS"
W !,$TR($J("",80)," ","-")
Q
PATLISTS ;
D ^BUD8RPTL
Q
T3B ;
D HEADER Q:BUDQUIT D T3BSH
;print out each line
W !?66,"NUMBER"
W !,"PATIENTS BY ETHNICITY",?67,"(a)",!,BUD80L
W !,"NUMBER OF PATIENTS",!,BUD80L
S BUDX=0 F S BUDX=$O(BUDHISP(BUDX)) Q:BUDX'=+BUDX!(BUDQUIT) D
.I $Y>(IOSL-3) D HEADER Q:BUDQUIT D T3BSH
.W !?2,$P(BUDHISP(BUDX),U),?8,$P(BUDHISP(BUDX),U,2)
.I $P(BUDHISP(BUDX),U,4)]"" W !?8,$P(BUDHISP(BUDX),U,4)
.I $P(BUDHISP(BUDX),U,3)]"" W ?65,$$C($P(BUDHISP(BUDX),U,3))
.W !,BUD80L
;
I $Y>(IOSL-6) D HEADER Q:BUDQUIT D T3BSH
W !!,BUD80L,!?66,"NUMBER"
W !,"PATIENTS BY RACE",?67,"(a)",!,BUD80L
W !,"NUMBER OF PATIENTS",!,BUD80L
F BUDX="5B","5C","5Z","5A",6,7,8,9,10,11 Q:BUDQUIT D
.I $Y>(IOSL-3) D HEADER Q:BUDQUIT D T3BSH
.W !?2,$P(BUDRACET(BUDX),U),?8,$P(BUDRACET(BUDX),U,2)
.I $P(BUDRACET(BUDX),U,4)]"" W !?8,$P(BUDRACET(BUDX),U,4)
.I $P(BUDRACET(BUDX),U,3)]"" W ?65,$$C($P(BUDRACET(BUDX),U,3))
.W !,BUD80L
I $Y>(IOSL-6) D HEADER Q:BUDQUIT D T3BSH
W !!,BUD80L,!?66,"NUMBER"
W !,"PATIENTS BY LANGUAGE",?67,"(a)",!,BUD80L
W !,"NUMBER OF PATIENTS",!,BUD80L
W !?2,"12",?8,"PATIENTS BEST SERVED IN A LANGUAGE OTHER THAN ENGLISH",!,BUD80L
W !
Q
TZ ;
D HEADER Q:BUDQUIT D TZSH
;print out each line
S BUDZTOT=0
S ^XTMP("BUD8RPT1",BUDJ,BUDH,"ZIP","OTHER ZIP CODES")=0
;GET TOTAL
S BUDZ="" F S BUDZ=$O(^XTMP("BUD8RPT1",BUDJ,BUDH,"ZIP",BUDZ)) Q:BUDZ="" D
.S BUDY=^XTMP("BUD8RPT1",BUDJ,BUDH,"ZIP",BUDZ)
.S BUDZTOT=BUDZTOT+BUDY
;CALCULATE "OTHER"
S BUDZ="" F S BUDZ=$O(^XTMP("BUD8RPT1",BUDJ,BUDH,"ZIP",BUDZ)) Q:BUDZ="" D
.Q:BUDZ["OTHER"
.Q:BUDZ["Unknown"
.S BUDY=^XTMP("BUD8RPT1",BUDJ,BUDH,"ZIP",BUDZ)
.S X=BUDY/BUDZTOT I X<.001 K ^XTMP("BUD8RPT1",BUDJ,BUDH,"ZIP",BUDZ) S ^XTMP("BUD8RPT1",BUDJ,BUDH,"ZIP","OTHER ZIP CODES")=^XTMP("BUD8RPT1",BUDJ,BUDH,"ZIP","OTHER ZIP CODES")+BUDY D
..;now reset the list so the others collate at the end
..S BUDCOM="" F S BUDCOM=$O(^XTMP("BUD8RPT1",BUDJ,BUDH,"Z",BUDZ,BUDCOM)) Q:BUDCOM="" D
...S BUDSEX="" F S BUDSEX=$O(^XTMP("BUD8RPT1",BUDJ,BUDH,"Z",BUDZ,BUDCOM,BUDSEX)) Q:BUDSEX="" D
....S BUDNAME="" F S BUDNAME=$O(^XTMP("BUD8RPT1",BUDJ,BUDH,"Z",BUDZ,BUDCOM,BUDSEX,BUDNAME)) Q:BUDNAME="" D
.....S DFN=0 F S DFN=$O(^XTMP("BUD8RPT1",BUDJ,BUDH,"Z",BUDZ,BUDCOM,BUDSEX,BUDNAME,DFN)) Q:DFN'=+DFN D
......S X=0 F S X=$O(^XTMP("BUD8RPT1",BUDJ,BUDH,"Z",BUDZ,BUDCOM,BUDSEX,BUDNAME,DFN,X)) Q:X'=+X D
.......S ^XTMP("BUD8RPT1",BUDJ,BUDH,"Z",BUDZ_"*",BUDCOM,BUDSEX,BUDNAME,DFN,X)=""
.......K ^XTMP("BUD8RPT1",BUDJ,BUDH,"Z",BUDZ,BUDCOM,BUDSEX,BUDNAME,DFN,X)
S BUDZ="" F S BUDZ=$O(^XTMP("BUD8RPT1",BUDJ,BUDH,"ZIP",BUDZ)) Q:BUDZ=""!(BUDQUIT) D
.I $Y>(IOSL-4) D HEADER Q:BUDQUIT D TZSH
.S BUDY=^XTMP("BUD8RPT1",BUDJ,BUDH,"ZIP",BUDZ)
.W !?8,BUDZ,?40,$$C(BUDY),!,BUD80L
Q:BUDQUIT
W !!?8,"TOTAL",?40,$$C(BUDZTOT),!
Q
T5 ;print table 5
D HEADER Q:BUDQUIT D T5SH
;lines 1-8
F BUDL=1:1:7 S BUDY=$O(^BUDGTFIV("B",BUDL,0)) Q:BUDQUIT D
.Q:'BUDY
.W !
.I +BUDL<10 W " "
.W BUDL,".",?6,$P(^BUDGTFIV(BUDY,0),U,2)
.I $P(^BUDGTFIV(BUDY,0),U,3)]"" W !?6,$P(^BUDGTFIV(BUDY,0),U,3)
.I $P($G(BUDTAB5(BUDL)),U,1)]"" W ?60,$$C($P(BUDTAB5(BUDL),U,1),$S(BUDL=6:2,1:0)),?71,$$C($P(BUDTAB5(BUDL),U,2),2)
.W !,BUD80L
W !," 8.",?10,"Total Physicians",!?8,"(Lines 1 - 7)",?60,$$C($P(BUDTAB5(8),U,1)),?71,$$C($P(BUDTAB5(8),U,2),2),!,BUD80L
;print out lines 9-15
F BUDL="9A","9B",10 S BUDY=$O(^BUDGTFIV("B",BUDL,0)) Q:BUDQUIT D
.I $Y>(IOSL-3) D HEADER Q:BUDQUIT D T5SH
.W !
.I +BUDL<10 W " "
.W BUDL,".",?6,$P(^BUDGTFIV(BUDY,0),U,2)
.I $P(^BUDGTFIV(BUDY,0),U,3)]"" W !?6,$P(^BUDGTFIV(BUDY,0),U,3)
.W ?60,$$C($P(BUDTAB5(BUDL),U,1),0)
.W ?71,$$C($P(BUDTAB5(BUDL),U,2),2)
.W !,BUD80L
W !,"10a.",?10,"Total Midlevel Practitioners",!?8,"(Lines 9a - 10)",?60,$$C($P(BUDTAB5("10A"),U,1)),?71,$$C($P(BUDTAB5("10A"),U,2),2),!,BUD80L
F BUDL=11:1:14 S BUDY=$O(^BUDGTFIV("B",BUDL,0)) Q:BUDQUIT D
.I $Y>(IOSL-3) D HEADER Q:BUDQUIT D T5SH
.W !,$$LOW^XLFSTR(BUDL),".",?6,$P(^BUDGTFIV(BUDY,0),U,2) I $P(^BUDGTFIV(BUDY,0),U,3)]"" W !?6,$P(^BUDGTFIV(BUDY,0),U,3)
.W ?60,$$C($P(BUDTAB5(BUDL),U,1),$S(BUDL=11:0,1:2))
.W ?71,$$C($P(BUDTAB5(BUDL),U,2),2)
.W !,BUD80L
I $Y>(IOSL-3) D HEADER Q:BUDQUIT D T5SH
W !,"15.",?10,"Total Medical Care",!?10,"(Lines 8 + 10a through 14)",?60,$$C($P(BUDTAB5(15),U,1)),?71,$$C($P(BUDTAB5(15),U,2)),!,BUD80L
F BUDL=16:1:17 S BUDY=$O(^BUDGTFIV("B",BUDL,0)) Q:BUDQUIT D
.I $Y>(IOSL-3) D HEADER Q:BUDQUIT D T5SH
.W !,$$LOW^XLFSTR(BUDL),".",?6,$P(^BUDGTFIV(BUDY,0),U,2) I $P(^BUDGTFIV(BUDY,0),U,3)]"" W !?6,$P(^BUDGTFIV(BUDY,0),U,3)
.W ?60,$$C($P(BUDTAB5(BUDL),U,1),0)
.W ?71,$$C($P(BUDTAB5(BUDL),U,2),2)
.W !,BUD80L
T518 F BUDL=18 S BUDY=$O(^BUDGTFIV("B",BUDL,0)) Q:BUDQUIT D
.I $Y>(IOSL-3) D HEADER Q:BUDQUIT D T5SH
.W !,$$LOW^XLFSTR(BUDL),".",?6,$P(^BUDGTFIV(BUDY,0),U,2) I $P(^BUDGTFIV(BUDY,0),U,3)]"" W !?6,$P(^BUDGTFIV(BUDY,0),U,3)
.W ?60,$$C($P(BUDTAB5(BUDL),U,1),2)
.W ?71,$$C($P(BUDTAB5(BUDL),U,2),2)
.W !,BUD80L
I $Y>(IOSL-3) D HEADER Q:BUDQUIT D T5SH
W !,"19.",?10,"Total Dental Services",!?10,"(Lines 16 - 18)",?60,$$C($P(BUDTAB5(19),U,1)),?71,$$C($P(BUDTAB5(19),U,2)),!,BUD80L
;D HEADER Q:BUDQUIT D T5SH ;force page break before line 20
F BUDL="20A","20A1","20A2","20B","20C" S BUDY=$O(^BUDGTFIV("B",BUDL,0)) Q:BUDQUIT D
.I $Y>(IOSL-3) D HEADER Q:BUDQUIT D T5SH
.W !,$$LOW^XLFSTR(BUDL),".",?6,$P(^BUDGTFIV(BUDY,0),U,2)
.I $P(^BUDGTFIV(BUDY,0),U,3)]"" W !?6,$P(^BUDGTFIV(BUDY,0),U,3)
.I $P(^BUDGTFIV(BUDY,0),U,4)]"" W !?6,$P(^BUDGTFIV(BUDY,0),U,4)
.W ?60,$$C($P(BUDTAB5(BUDL),U,1),0)
.W ?71,$$C($P(BUDTAB5(BUDL),U,2),2)
.W !,BUD80L
I $Y>(IOSL-3) D HEADER Q:BUDQUIT D T5SH
W !,"20.",?10,"Mental Health Services",!?10,"(Lines 20a - c)",?60,$$C($P(BUDTAB5(20),U,1)),?71,$$C($P(BUDTAB5(20),U,2)),!,BUD80L
F BUDL=21:1:22 S BUDY=$O(^BUDGTFIV("B",BUDL,0)) Q:BUDQUIT D
.I $Y>(IOSL-3) D HEADER Q:BUDQUIT D T5SH
.W !,$$LOW^XLFSTR(BUDL),".",?6,$P(^BUDGTFIV(BUDY,0),U,2) I $P(^BUDGTFIV(BUDY,0),U,3)]"" W !?6,$P(^BUDGTFIV(BUDY,0),U,3)
.W ?60,$$C($P(BUDTAB5(BUDL),U,1),0)
.W ?71,$$C($P(BUDTAB5(BUDL),U,2),0)
.W !,BUD80L
F BUDL=23 S BUDY=$O(^BUDGTFIV("B",BUDL,0)) Q:BUDQUIT D
.I $Y>(IOSL-3) D HEADER Q:BUDQUIT D T5SH
.W !,$$LOW^XLFSTR(BUDL),".",?6,$P(^BUDGTFIV(BUDY,0),U,2) I $P(^BUDGTFIV(BUDY,0),U,3)]"" W !?6,$P(^BUDGTFIV(BUDY,0),U,3)
.W ?60,$$C($P(BUDTAB5(BUDL),U,1),2)
.W ?71,$$C($P(BUDTAB5(BUDL),U,2),2)
.W !,BUD80L
F BUDL=24:1:25 S BUDY=$O(^BUDGTFIV("B",BUDL,0)) Q:BUDQUIT D
.I $Y>(IOSL-3) D HEADER Q:BUDQUIT D T5SH
.W !,$$LOW^XLFSTR(BUDL),".",?6,$P(^BUDGTFIV(BUDY,0),U,2) I $P(^BUDGTFIV(BUDY,0),U,3)]"" W !?6,$P(^BUDGTFIV(BUDY,0),U,3)
.W ?60,$$C($P(BUDTAB5(BUDL),U,1),0)
.W ?71,$$C($P(BUDTAB5(BUDL),U,2),2)
.W !,BUD80L
F BUDL=26,27,"27a","27b",28 S BUDY=$O(^BUDGTFIV("B",BUDL,0)) Q:BUDQUIT D
.I $Y>(IOSL-3) D HEADER Q:BUDQUIT D T5SH
.W !,$$LOW^XLFSTR(BUDL),".",?6,$P(^BUDGTFIV(BUDY,0),U,2) I $P(^BUDGTFIV(BUDY,0),U,3)]"" W !?6,$P(^BUDGTFIV(BUDY,0),U,3)
.W ?60,$$C($P(BUDTAB5(BUDL),U,1),2),?71,$$C($P(BUDTAB5(BUDL),U,2),2)
.;W ?60,$$C($P(BUDTAB5(BUDL),U,1),2)
.;W ?71,$$C($P(BUDTAB5(BUDL),U,2),2)
.W !,BUD80L
I $Y>(IOSL-3) D HEADER Q:BUDQUIT D T5SH
W !,"29.",?10,"Total Enabling Services",!?10,"(Lines 24 - 28)",?60,$$C($P(BUDTAB5(29),U,1)),?71,$$C($P(BUDTAB5(29),U,2)),!,BUD80L
F BUDL="29A","30A","30B","30C" S BUDY=$O(^BUDGTFIV("B",BUDL,0)) Q:BUDQUIT D
.I $Y>(IOSL-3) D HEADER Q:BUDQUIT D T5SH
.W !,$$LOW^XLFSTR(BUDL),".",?6,$P(^BUDGTFIV(BUDY,0),U,2) I $P(^BUDGTFIV(BUDY,0),U,3)]"" W !?6,$P(^BUDGTFIV(BUDY,0),U,3)
.W ?60,$$C($P(BUDTAB5(BUDL),U,1),2)
.W ?71,$$C($P(BUDTAB5(BUDL),U,2),2)
.W !,BUD80L
I $Y>(IOSL-3) D HEADER Q:BUDQUIT D T5SH
W !,"30.",?10,"Total Administrative Staff",!?10,"(Lines 30a-30c)"
W ?60,$$C($P(BUDTAB5(33),U,1),2),?71,$$C($P(BUDTAB5(33),U,2),2),!,BUD80L
I $Y>(IOSL-3) D HEADER Q:BUDQUIT D T5SH
F BUDL=31,32 S BUDY=$O(^BUDGTFIV("B",BUDL,0)) Q:BUDQUIT D
.I $Y>(IOSL-3) D HEADER Q:BUDQUIT D T5SH
.W !,$$LOW^XLFSTR(BUDL),".",?6,$P(^BUDGTFIV(BUDY,0),U,2) I $P(^BUDGTFIV(BUDY,0),U,3)]"" W !?6,$P(^BUDGTFIV(BUDY,0),U,3)
.W ?60,$$C($P(BUDTAB5(BUDL),U,1),2)
.W ?71,$$C($P(BUDTAB5(BUDL),U,2),2)
.W !,BUD80L
I $Y>(IOSL-3) D HEADER Q:BUDQUIT D T5SH
W !,"33.",?10,"TOTAL ADMINISTRATION AND FACILITY",!?10,"(TOTAL LINES 30+31+32)"
W ?60,$$C($P(BUDTAB5(33),U,1),2),?71,$$C($P(BUDTAB5(33),U,2),2),!,BUD80L
I $Y>(IOSL-3) D HEADER Q:BUDQUIT D T5SH
W !,"34.",?10,"GRAND TOTAL: (TOTAL LINES",!?10,"(15+19+20+21+22+23+29+29A+33)"
S Y=0 F X=15,19,20,21,22,29 S Y=Y+$P(BUDTAB5(X),U)
W ?60,$$C(Y),?71,$$C(Y,2),!,BUD80L
I $P(BUDTAB5(35),U) D
.I $Y>(IOSL-3) D HEADER Q:BUDQUIT D T5SH
.W !!,$P(BUDTAB5(35),U)," encounters did not fit into any of the above categories",!
W !
Q
T5SH ;
W !,$$CTR("TABLE 5 - STAFFING AND UTILIZATION",80)
;W !,$$CTR("STAFFING AND UTILIZATION",80),!
W !,$TR($J("",80)," ","-")
W !,?54,"FTEs",?60,"ENCOUNTERS",?71,"PATIENTS"
W !,"PERSONNEL BY MAJOR SERVICE CATEGORY",?54,"(a)",?64,"(b)",?73,"(c)"
W !,$TR($J("",80)," ","-")
Q
T6 ;
D T6^BUD8RPP1
Q
G:'BUDPG HEADER1
K DIR I $E(IOST)="C",IO=IO(0) W ! S DIR(0)="EO" D ^DIR K DIR I Y=0!(Y="^")!($D(DTOUT)) S BUDQUIT=1 Q
I BUDPG!($G(BUDFNP)) W:$D(IOF) @IOF
S BUDPG=BUDPG+1
S X=$$CTR($P(^DIC(4,BUDSITE,0),U),60),$E(X,3)=$P(^VA(200,DUZ,0),U,2),$E(X,10)="UDS 2008",$E(X,70)="Page ",$E(X,75)=BUDPG W !,X
;W !?3,$P(^VA(200,DUZ,0),U,2),?10,"UDS 2008",$$CTR($P(^DIC(4,BUDSITE,0),U),80),?70,"Page ",BUDPG
;W $$CTR($P(^DIC(4,BUDSITE,0),U),80),!
W !,"UDS No. ",$P(^BUDGSITE(BUDSITE,0),U,2),?50,"Date Run: ",$$FMTE^XLFDT(DT)
W !,"Reporting Period: ",$$FMTE^XLFDT(BUDBD)," through ",$$FMTE^XLFDT(BUDED)
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
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")
;----------
BUD8RPTP ; IHS/CMI/LAB - UDS REPORT PRINT 30 Dec 2008 10:44 AM ;
+1 ;;10.0;IHS/RPMS UNIFORM DATA SYSTEM;;FEB 04, 2016;Build 50
+2 ;
PRINT ;EP
+1 SET BUDPG=0
+2 SET BUDQUIT=0
+3 SET BUD80L=""
SET $PIECE(BUD80L,"_",79)="_"
+4 IF $GET(BUDTZ)
DO TZ
IF BUDQUIT
GOTO EOJ
+5 IF $GET(BUDT3A)
DO T3A
IF BUDQUIT
GOTO EOJ
+6 IF $GET(BUDT3B)
DO T3B
IF BUDQUIT
GOTO EOJ
+7 IF $GET(BUDT4)
DO T4
IF BUDQUIT
GOTO EOJ
+8 IF $GET(BUDT5)
DO T5
IF BUDQUIT
GOTO EOJ
+9 IF $GET(BUDT6)
DO T6
IF BUDQUIT
GOTO EOJ
+10 DO PATLISTS
+11 DO EOJ
+12 QUIT
+13 ;
EOJ ;
+1 KILL ^TMP($JOB)
+2 KILL ^XTMP("BUD8RPT1",BUDJ,BUDH)
+3 QUIT
T4 ;
+1 QUIT
T3A ;
+1 DO HEADER
IF BUDQUIT
QUIT
DO T3ASH
+2 ;print out each line
+3 SET BUDZ=0
FOR
SET BUDZ=$ORDER(^BUDGTTA("AC",BUDZ))
IF BUDZ>38!(BUDQUIT)
QUIT
Begin DoDot:1
+4 SET BUDC=$ORDER(^BUDGTTA("AC",BUDZ,0))
+5 IF $Y>(IOSL-3)
DO HEADER
IF BUDQUIT
QUIT
DO T3ASH
+6 SET BUDY=^BUDGTTA(BUDC,0)
+7 ;column one End control
SET BUDX=$PIECE(BUDY,U,2)
+8 WRITE !
+9 IF BUDX<10
WRITE " "
+10 WRITE $PIECE(BUDY,U,2),?5,$PIECE(BUDY,U,3)
+11 ;I +BUDX=0 Q
+12 WRITE ?35,$$C($PIECE(BUDTOT("M"),U,BUDX)),?50,$$C($PIECE(BUDTOT("F"),U,BUDX)),?68,$$C($PIECE(BUDTOT("ALL"),U,BUDX))
+13 IF BUDX=20
Begin DoDot:2
+14 IF $Y>(IOSL-4)
DO HEADER
IF BUDQUIT
QUIT
DO T3ASH
+15 WRITE !!?10,"SUBTOTAL 0-19",?35,$$C(BUD019("M")),?50,$$C(BUD019("F")),?68,$$C(BUD019("ALL")),!
End DoDot:2
End DoDot:1
+16 SET BUDC=$ORDER(^BUDGTTA("B",43,0))
+17 IF $Y>(IOSL-3)
DO HEADER
IF BUDQUIT
QUIT
DO T3ASH
+18 WRITE !,$PIECE(^BUDGTTA(BUDC,0),U,2),?5,$PIECE(^BUDGTTA(BUDC,0),U,3)
+19 SET BUDC=$ORDER(^BUDGTTA("AC",39,0))
+20 IF $Y>(IOSL-2)
DO HEADER
IF BUDQUIT
QUIT
DO T3ASH
+21 SET BUDY=^BUDGTTA(BUDC,0)
+22 ;column one End control
SET BUDX=$PIECE(BUDY,U,2)
+23 WRITE !
+24 WRITE $PIECE(BUDY,U,2),?5,$PIECE(BUDY,U,3)
+25 WRITE ?35,$$C($PIECE(BUDTOT("M"),U,BUDX)),?50,$$C($PIECE(BUDTOT("F"),U,BUDX)),?68,$$C($PIECE(BUDTOT("ALL"),U,BUDX))
+26 WRITE !
+27 QUIT
T3ASH ;
+1 WRITE !,$$CTR($GET(^BUDGTTA(1,11)),80),!
+2 FOR Y=2:1:4
SET X=$ORDER(^BUDGTTA("B",Y,0))
WRITE !,$PIECE(^BUDGTTA(X,0),U,2),?5,$PIECE(^BUDGTTA(X,0),U,3),?33,$PIECE(^BUDGTTA(X,0),U,4),?50,$PIECE(^BUDGTTA(X,0),U,5),?68,$PIECE(^BUDGTTA(X,0),U,6)
+3 WRITE !,$TRANSLATE($JUSTIFY("",80)," ","-")
+4 QUIT
T3BSH ;
+1 WRITE !!,$$CTR("TABLE 3B -",80)
+2 WRITE !,$$CTR("PATIENTS BY ETHNICITY/RACE/LANGUAGE",80),!,BUD80L
+3 ;W !,$TR($J("",80)," ","-")
+4 QUIT
TZSH ;
+1 WRITE !!,$$CTR("PATIENTS BY ZIP CODE",80)
+2 WRITE !,$TRANSLATE($JUSTIFY("",80)," ","-")
+3 WRITE !!?5,"ZIP CODE",?40,"PATIENTS"
+4 WRITE !,$TRANSLATE($JUSTIFY("",80)," ","-")
+5 QUIT
PATLISTS ;
+1 DO ^BUD8RPTL
+2 QUIT
T3B ;
+1 DO HEADER
IF BUDQUIT
QUIT
DO T3BSH
+2 ;print out each line
+3 WRITE !?66,"NUMBER"
+4 WRITE !,"PATIENTS BY ETHNICITY",?67,"(a)",!,BUD80L
+5 WRITE !,"NUMBER OF PATIENTS",!,BUD80L
+6 SET BUDX=0
FOR
SET BUDX=$ORDER(BUDHISP(BUDX))
IF BUDX'=+BUDX!(BUDQUIT)
QUIT
Begin DoDot:1
+7 IF $Y>(IOSL-3)
DO HEADER
IF BUDQUIT
QUIT
DO T3BSH
+8 WRITE !?2,$PIECE(BUDHISP(BUDX),U),?8,$PIECE(BUDHISP(BUDX),U,2)
+9 IF $PIECE(BUDHISP(BUDX),U,4)]""
WRITE !?8,$PIECE(BUDHISP(BUDX),U,4)
+10 IF $PIECE(BUDHISP(BUDX),U,3)]""
WRITE ?65,$$C($PIECE(BUDHISP(BUDX),U,3))
+11 WRITE !,BUD80L
End DoDot:1
+12 ;
+13 IF $Y>(IOSL-6)
DO HEADER
IF BUDQUIT
QUIT
DO T3BSH
+14 WRITE !!,BUD80L,!?66,"NUMBER"
+15 WRITE !,"PATIENTS BY RACE",?67,"(a)",!,BUD80L
+16 WRITE !,"NUMBER OF PATIENTS",!,BUD80L
+17 FOR BUDX="5B","5C","5Z","5A",6,7,8,9,10,11
IF BUDQUIT
QUIT
Begin DoDot:1
+18 IF $Y>(IOSL-3)
DO HEADER
IF BUDQUIT
QUIT
DO T3BSH
+19 WRITE !?2,$PIECE(BUDRACET(BUDX),U),?8,$PIECE(BUDRACET(BUDX),U,2)
+20 IF $PIECE(BUDRACET(BUDX),U,4)]""
WRITE !?8,$PIECE(BUDRACET(BUDX),U,4)
+21 IF $PIECE(BUDRACET(BUDX),U,3)]""
WRITE ?65,$$C($PIECE(BUDRACET(BUDX),U,3))
+22 WRITE !,BUD80L
End DoDot:1
+23 IF $Y>(IOSL-6)
DO HEADER
IF BUDQUIT
QUIT
DO T3BSH
+24 WRITE !!,BUD80L,!?66,"NUMBER"
+25 WRITE !,"PATIENTS BY LANGUAGE",?67,"(a)",!,BUD80L
+26 WRITE !,"NUMBER OF PATIENTS",!,BUD80L
+27 WRITE !?2,"12",?8,"PATIENTS BEST SERVED IN A LANGUAGE OTHER THAN ENGLISH",!,BUD80L
+28 WRITE !
+29 QUIT
TZ ;
+1 DO HEADER
IF BUDQUIT
QUIT
DO TZSH
+2 ;print out each line
+3 SET BUDZTOT=0
+4 SET ^XTMP("BUD8RPT1",BUDJ,BUDH,"ZIP","OTHER ZIP CODES")=0
+5 ;GET TOTAL
+6 SET BUDZ=""
FOR
SET BUDZ=$ORDER(^XTMP("BUD8RPT1",BUDJ,BUDH,"ZIP",BUDZ))
IF BUDZ=""
QUIT
Begin DoDot:1
+7 SET BUDY=^XTMP("BUD8RPT1",BUDJ,BUDH,"ZIP",BUDZ)
+8 SET BUDZTOT=BUDZTOT+BUDY
End DoDot:1
+9 ;CALCULATE "OTHER"
+10 SET BUDZ=""
FOR
SET BUDZ=$ORDER(^XTMP("BUD8RPT1",BUDJ,BUDH,"ZIP",BUDZ))
IF BUDZ=""
QUIT
Begin DoDot:1
+11 IF BUDZ["OTHER"
QUIT
+12 IF BUDZ["Unknown"
QUIT
+13 SET BUDY=^XTMP("BUD8RPT1",BUDJ,BUDH,"ZIP",BUDZ)
+14 SET X=BUDY/BUDZTOT
IF X<.001
KILL ^XTMP("BUD8RPT1",BUDJ,BUDH,"ZIP",BUDZ)
SET ^XTMP("BUD8RPT1",BUDJ,BUDH,"ZIP","OTHER ZIP CODES")=^XTMP("BUD8RPT1",BUDJ,BUDH,"ZIP","OTHER ZIP CODES")+BUDY
Begin DoDot:2
+15 ;now reset the list so the others collate at the end
+16 SET BUDCOM=""
FOR
SET BUDCOM=$ORDER(^XTMP("BUD8RPT1",BUDJ,BUDH,"Z",BUDZ,BUDCOM))
IF BUDCOM=""
QUIT
Begin DoDot:3
+17 SET BUDSEX=""
FOR
SET BUDSEX=$ORDER(^XTMP("BUD8RPT1",BUDJ,BUDH,"Z",BUDZ,BUDCOM,BUDSEX))
IF BUDSEX=""
QUIT
Begin DoDot:4
+18 SET BUDNAME=""
FOR
SET BUDNAME=$ORDER(^XTMP("BUD8RPT1",BUDJ,BUDH,"Z",BUDZ,BUDCOM,BUDSEX,BUDNAME))
IF BUDNAME=""
QUIT
Begin DoDot:5
+19 SET DFN=0
FOR
SET DFN=$ORDER(^XTMP("BUD8RPT1",BUDJ,BUDH,"Z",BUDZ,BUDCOM,BUDSEX,BUDNAME,DFN))
IF DFN'=+DFN
QUIT
Begin DoDot:6
+20 SET X=0
FOR
SET X=$ORDER(^XTMP("BUD8RPT1",BUDJ,BUDH,"Z",BUDZ,BUDCOM,BUDSEX,BUDNAME,DFN,X))
IF X'=+X
QUIT
Begin DoDot:7
+21 SET ^XTMP("BUD8RPT1",BUDJ,BUDH,"Z",BUDZ_"*",BUDCOM,BUDSEX,BUDNAME,DFN,X)=""
+22 KILL ^XTMP("BUD8RPT1",BUDJ,BUDH,"Z",BUDZ,BUDCOM,BUDSEX,BUDNAME,DFN,X)
End DoDot:7
End DoDot:6
End DoDot:5
End DoDot:4
End DoDot:3
End DoDot:2
End DoDot:1
+23 SET BUDZ=""
FOR
SET BUDZ=$ORDER(^XTMP("BUD8RPT1",BUDJ,BUDH,"ZIP",BUDZ))
IF BUDZ=""!(BUDQUIT)
QUIT
Begin DoDot:1
+24 IF $Y>(IOSL-4)
DO HEADER
IF BUDQUIT
QUIT
DO TZSH
+25 SET BUDY=^XTMP("BUD8RPT1",BUDJ,BUDH,"ZIP",BUDZ)
+26 WRITE !?8,BUDZ,?40,$$C(BUDY),!,BUD80L
End DoDot:1
+27 IF BUDQUIT
QUIT
+28 WRITE !!?8,"TOTAL",?40,$$C(BUDZTOT),!
+29 QUIT
T5 ;print table 5
+1 DO HEADER
IF BUDQUIT
QUIT
DO T5SH
+2 ;lines 1-8
+3 FOR BUDL=1:1:7
SET BUDY=$ORDER(^BUDGTFIV("B",BUDL,0))
IF BUDQUIT
QUIT
Begin DoDot:1
+4 IF 'BUDY
QUIT
+5 WRITE !
+6 IF +BUDL<10
WRITE " "
+7 WRITE BUDL,".",?6,$PIECE(^BUDGTFIV(BUDY,0),U,2)
+8 IF $PIECE(^BUDGTFIV(BUDY,0),U,3)]""
WRITE !?6,$PIECE(^BUDGTFIV(BUDY,0),U,3)
+9 IF $PIECE($GET(BUDTAB5(BUDL)),U,1)]""
WRITE ?60,$$C($PIECE(BUDTAB5(BUDL),U,1),$SELECT(BUDL=6:2,1:0)),?71,$$C($PIECE(BUDTAB5(BUDL),U,2),2)
+10 WRITE !,BUD80L
End DoDot:1
+11 WRITE !," 8.",?10,"Total Physicians",!?8,"(Lines 1 - 7)",?60,$$C($PIECE(BUDTAB5(8),U,1)),?71,$$C($PIECE(BUDTAB5(8),U,2),2),!,BUD80L
+12 ;print out lines 9-15
+13 FOR BUDL="9A","9B",10
SET BUDY=$ORDER(^BUDGTFIV("B",BUDL,0))
IF BUDQUIT
QUIT
Begin DoDot:1
+14 IF $Y>(IOSL-3)
DO HEADER
IF BUDQUIT
QUIT
DO T5SH
+15 WRITE !
+16 IF +BUDL<10
WRITE " "
+17 WRITE BUDL,".",?6,$PIECE(^BUDGTFIV(BUDY,0),U,2)
+18 IF $PIECE(^BUDGTFIV(BUDY,0),U,3)]""
WRITE !?6,$PIECE(^BUDGTFIV(BUDY,0),U,3)
+19 WRITE ?60,$$C($PIECE(BUDTAB5(BUDL),U,1),0)
+20 WRITE ?71,$$C($PIECE(BUDTAB5(BUDL),U,2),2)
+21 WRITE !,BUD80L
End DoDot:1
+22 WRITE !,"10a.",?10,"Total Midlevel Practitioners",!?8,"(Lines 9a - 10)",?60,$$C($PIECE(BUDTAB5("10A"),U,1)),?71,$$C($PIECE(BUDTAB5("10A"),U,2),2),!,BUD80L
+23 FOR BUDL=11:1:14
SET BUDY=$ORDER(^BUDGTFIV("B",BUDL,0))
IF BUDQUIT
QUIT
Begin DoDot:1
+24 IF $Y>(IOSL-3)
DO HEADER
IF BUDQUIT
QUIT
DO T5SH
+25 WRITE !,$$LOW^XLFSTR(BUDL),".",?6,$PIECE(^BUDGTFIV(BUDY,0),U,2)
IF $PIECE(^BUDGTFIV(BUDY,0),U,3)]""
WRITE !?6,$PIECE(^BUDGTFIV(BUDY,0),U,3)
+26 WRITE ?60,$$C($PIECE(BUDTAB5(BUDL),U,1),$SELECT(BUDL=11:0,1:2))
+27 WRITE ?71,$$C($PIECE(BUDTAB5(BUDL),U,2),2)
+28 WRITE !,BUD80L
End DoDot:1
+29 IF $Y>(IOSL-3)
DO HEADER
IF BUDQUIT
QUIT
DO T5SH
+30 WRITE !,"15.",?10,"Total Medical Care",!?10,"(Lines 8 + 10a through 14)",?60,$$C($PIECE(BUDTAB5(15),U,1)),?71,$$C($PIECE(BUDTAB5(15),U,2)),!,BUD80L
+31 FOR BUDL=16:1:17
SET BUDY=$ORDER(^BUDGTFIV("B",BUDL,0))
IF BUDQUIT
QUIT
Begin DoDot:1
+32 IF $Y>(IOSL-3)
DO HEADER
IF BUDQUIT
QUIT
DO T5SH
+33 WRITE !,$$LOW^XLFSTR(BUDL),".",?6,$PIECE(^BUDGTFIV(BUDY,0),U,2)
IF $PIECE(^BUDGTFIV(BUDY,0),U,3)]""
WRITE !?6,$PIECE(^BUDGTFIV(BUDY,0),U,3)
+34 WRITE ?60,$$C($PIECE(BUDTAB5(BUDL),U,1),0)
+35 WRITE ?71,$$C($PIECE(BUDTAB5(BUDL),U,2),2)
+36 WRITE !,BUD80L
End DoDot:1
T518 FOR BUDL=18
SET BUDY=$ORDER(^BUDGTFIV("B",BUDL,0))
IF BUDQUIT
QUIT
Begin DoDot:1
+1 IF $Y>(IOSL-3)
DO HEADER
IF BUDQUIT
QUIT
DO T5SH
+2 WRITE !,$$LOW^XLFSTR(BUDL),".",?6,$PIECE(^BUDGTFIV(BUDY,0),U,2)
IF $PIECE(^BUDGTFIV(BUDY,0),U,3)]""
WRITE !?6,$PIECE(^BUDGTFIV(BUDY,0),U,3)
+3 WRITE ?60,$$C($PIECE(BUDTAB5(BUDL),U,1),2)
+4 WRITE ?71,$$C($PIECE(BUDTAB5(BUDL),U,2),2)
+5 WRITE !,BUD80L
End DoDot:1
+6 IF $Y>(IOSL-3)
DO HEADER
IF BUDQUIT
QUIT
DO T5SH
+7 WRITE !,"19.",?10,"Total Dental Services",!?10,"(Lines 16 - 18)",?60,$$C($PIECE(BUDTAB5(19),U,1)),?71,$$C($PIECE(BUDTAB5(19),U,2)),!,BUD80L
+8 ;D HEADER Q:BUDQUIT D T5SH ;force page break before line 20
+9 FOR BUDL="20A","20A1","20A2","20B","20C"
SET BUDY=$ORDER(^BUDGTFIV("B",BUDL,0))
IF BUDQUIT
QUIT
Begin DoDot:1
+10 IF $Y>(IOSL-3)
DO HEADER
IF BUDQUIT
QUIT
DO T5SH
+11 WRITE !,$$LOW^XLFSTR(BUDL),".",?6,$PIECE(^BUDGTFIV(BUDY,0),U,2)
+12 IF $PIECE(^BUDGTFIV(BUDY,0),U,3)]""
WRITE !?6,$PIECE(^BUDGTFIV(BUDY,0),U,3)
+13 IF $PIECE(^BUDGTFIV(BUDY,0),U,4)]""
WRITE !?6,$PIECE(^BUDGTFIV(BUDY,0),U,4)
+14 WRITE ?60,$$C($PIECE(BUDTAB5(BUDL),U,1),0)
+15 WRITE ?71,$$C($PIECE(BUDTAB5(BUDL),U,2),2)
+16 WRITE !,BUD80L
End DoDot:1
+17 IF $Y>(IOSL-3)
DO HEADER
IF BUDQUIT
QUIT
DO T5SH
+18 WRITE !,"20.",?10,"Mental Health Services",!?10,"(Lines 20a - c)",?60,$$C($PIECE(BUDTAB5(20),U,1)),?71,$$C($PIECE(BUDTAB5(20),U,2)),!,BUD80L
+19 FOR BUDL=21:1:22
SET BUDY=$ORDER(^BUDGTFIV("B",BUDL,0))
IF BUDQUIT
QUIT
Begin DoDot:1
+20 IF $Y>(IOSL-3)
DO HEADER
IF BUDQUIT
QUIT
DO T5SH
+21 WRITE !,$$LOW^XLFSTR(BUDL),".",?6,$PIECE(^BUDGTFIV(BUDY,0),U,2)
IF $PIECE(^BUDGTFIV(BUDY,0),U,3)]""
WRITE !?6,$PIECE(^BUDGTFIV(BUDY,0),U,3)
+22 WRITE ?60,$$C($PIECE(BUDTAB5(BUDL),U,1),0)
+23 WRITE ?71,$$C($PIECE(BUDTAB5(BUDL),U,2),0)
+24 WRITE !,BUD80L
End DoDot:1
+25 FOR BUDL=23
SET BUDY=$ORDER(^BUDGTFIV("B",BUDL,0))
IF BUDQUIT
QUIT
Begin DoDot:1
+26 IF $Y>(IOSL-3)
DO HEADER
IF BUDQUIT
QUIT
DO T5SH
+27 WRITE !,$$LOW^XLFSTR(BUDL),".",?6,$PIECE(^BUDGTFIV(BUDY,0),U,2)
IF $PIECE(^BUDGTFIV(BUDY,0),U,3)]""
WRITE !?6,$PIECE(^BUDGTFIV(BUDY,0),U,3)
+28 WRITE ?60,$$C($PIECE(BUDTAB5(BUDL),U,1),2)
+29 WRITE ?71,$$C($PIECE(BUDTAB5(BUDL),U,2),2)
+30 WRITE !,BUD80L
End DoDot:1
+31 FOR BUDL=24:1:25
SET BUDY=$ORDER(^BUDGTFIV("B",BUDL,0))
IF BUDQUIT
QUIT
Begin DoDot:1
+32 IF $Y>(IOSL-3)
DO HEADER
IF BUDQUIT
QUIT
DO T5SH
+33 WRITE !,$$LOW^XLFSTR(BUDL),".",?6,$PIECE(^BUDGTFIV(BUDY,0),U,2)
IF $PIECE(^BUDGTFIV(BUDY,0),U,3)]""
WRITE !?6,$PIECE(^BUDGTFIV(BUDY,0),U,3)
+34 WRITE ?60,$$C($PIECE(BUDTAB5(BUDL),U,1),0)
+35 WRITE ?71,$$C($PIECE(BUDTAB5(BUDL),U,2),2)
+36 WRITE !,BUD80L
End DoDot:1
+37 FOR BUDL=26,27,"27a","27b",28
SET BUDY=$ORDER(^BUDGTFIV("B",BUDL,0))
IF BUDQUIT
QUIT
Begin DoDot:1
+38 IF $Y>(IOSL-3)
DO HEADER
IF BUDQUIT
QUIT
DO T5SH
+39 WRITE !,$$LOW^XLFSTR(BUDL),".",?6,$PIECE(^BUDGTFIV(BUDY,0),U,2)
IF $PIECE(^BUDGTFIV(BUDY,0),U,3)]""
WRITE !?6,$PIECE(^BUDGTFIV(BUDY,0),U,3)
+40 WRITE ?60,$$C($PIECE(BUDTAB5(BUDL),U,1),2),?71,$$C($PIECE(BUDTAB5(BUDL),U,2),2)
+41 ;W ?60,$$C($P(BUDTAB5(BUDL),U,1),2)
+42 ;W ?71,$$C($P(BUDTAB5(BUDL),U,2),2)
+43 WRITE !,BUD80L
End DoDot:1
+44 IF $Y>(IOSL-3)
DO HEADER
IF BUDQUIT
QUIT
DO T5SH
+45 WRITE !,"29.",?10,"Total Enabling Services",!?10,"(Lines 24 - 28)",?60,$$C($PIECE(BUDTAB5(29),U,1)),?71,$$C($PIECE(BUDTAB5(29),U,2)),!,BUD80L
+46 FOR BUDL="29A","30A","30B","30C"
SET BUDY=$ORDER(^BUDGTFIV("B",BUDL,0))
IF BUDQUIT
QUIT
Begin DoDot:1
+47 IF $Y>(IOSL-3)
DO HEADER
IF BUDQUIT
QUIT
DO T5SH
+48 WRITE !,$$LOW^XLFSTR(BUDL),".",?6,$PIECE(^BUDGTFIV(BUDY,0),U,2)
IF $PIECE(^BUDGTFIV(BUDY,0),U,3)]""
WRITE !?6,$PIECE(^BUDGTFIV(BUDY,0),U,3)
+49 WRITE ?60,$$C($PIECE(BUDTAB5(BUDL),U,1),2)
+50 WRITE ?71,$$C($PIECE(BUDTAB5(BUDL),U,2),2)
+51 WRITE !,BUD80L
End DoDot:1
+52 IF $Y>(IOSL-3)
DO HEADER
IF BUDQUIT
QUIT
DO T5SH
+53 WRITE !,"30.",?10,"Total Administrative Staff",!?10,"(Lines 30a-30c)"
+54 WRITE ?60,$$C($PIECE(BUDTAB5(33),U,1),2),?71,$$C($PIECE(BUDTAB5(33),U,2),2),!,BUD80L
+55 IF $Y>(IOSL-3)
DO HEADER
IF BUDQUIT
QUIT
DO T5SH
+56 FOR BUDL=31,32
SET BUDY=$ORDER(^BUDGTFIV("B",BUDL,0))
IF BUDQUIT
QUIT
Begin DoDot:1
+57 IF $Y>(IOSL-3)
DO HEADER
IF BUDQUIT
QUIT
DO T5SH
+58 WRITE !,$$LOW^XLFSTR(BUDL),".",?6,$PIECE(^BUDGTFIV(BUDY,0),U,2)
IF $PIECE(^BUDGTFIV(BUDY,0),U,3)]""
WRITE !?6,$PIECE(^BUDGTFIV(BUDY,0),U,3)
+59 WRITE ?60,$$C($PIECE(BUDTAB5(BUDL),U,1),2)
+60 WRITE ?71,$$C($PIECE(BUDTAB5(BUDL),U,2),2)
+61 WRITE !,BUD80L
End DoDot:1
+62 IF $Y>(IOSL-3)
DO HEADER
IF BUDQUIT
QUIT
DO T5SH
+63 WRITE !,"33.",?10,"TOTAL ADMINISTRATION AND FACILITY",!?10,"(TOTAL LINES 30+31+32)"
+64 WRITE ?60,$$C($PIECE(BUDTAB5(33),U,1),2),?71,$$C($PIECE(BUDTAB5(33),U,2),2),!,BUD80L
+65 IF $Y>(IOSL-3)
DO HEADER
IF BUDQUIT
QUIT
DO T5SH
+66 WRITE !,"34.",?10,"GRAND TOTAL: (TOTAL LINES",!?10,"(15+19+20+21+22+23+29+29A+33)"
+67 SET Y=0
FOR X=15,19,20,21,22,29
SET Y=Y+$PIECE(BUDTAB5(X),U)
+68 WRITE ?60,$$C(Y),?71,$$C(Y,2),!,BUD80L
+69 IF $PIECE(BUDTAB5(35),U)
Begin DoDot:1
+70 IF $Y>(IOSL-3)
DO HEADER
IF BUDQUIT
QUIT
DO T5SH
+71 WRITE !!,$PIECE(BUDTAB5(35),U)," encounters did not fit into any of the above categories",!
End DoDot:1
+72 WRITE !
+73 QUIT
T5SH ;
+1 WRITE !,$$CTR("TABLE 5 - STAFFING AND UTILIZATION",80)
+2 ;W !,$$CTR("STAFFING AND UTILIZATION",80),!
+3 WRITE !,$TRANSLATE($JUSTIFY("",80)," ","-")
+4 WRITE !,?54,"FTEs",?60,"ENCOUNTERS",?71,"PATIENTS"
+5 WRITE !,"PERSONNEL BY MAJOR SERVICE CATEGORY",?54,"(a)",?64,"(b)",?73,"(c)"
+6 WRITE !,$TRANSLATE($JUSTIFY("",80)," ","-")
+7 QUIT
T6 ;
+1 DO T6^BUD8RPP1
+2 QUIT
+1 IF 'BUDPG
GOTO HEADER1
+2 KILL DIR
IF $EXTRACT(IOST)="C"
IF IO=IO(0)
WRITE !
SET DIR(0)="EO"
DO ^DIR
KILL DIR
IF Y=0!(Y="^")!($DATA(DTOUT))
SET BUDQUIT=1
QUIT
+1 IF BUDPG!($GET(BUDFNP))
IF $DATA(IOF)
WRITE @IOF
+2 SET BUDPG=BUDPG+1
+3 SET X=$$CTR($PIECE(^DIC(4,BUDSITE,0),U),60)
SET $EXTRACT(X,3)=$PIECE(^VA(200,DUZ,0),U,2)
SET $EXTRACT(X,10)="UDS 2008"
SET $EXTRACT(X,70)="Page "
SET $EXTRACT(X,75)=BUDPG
WRITE !,X
+4 ;W !?3,$P(^VA(200,DUZ,0),U,2),?10,"UDS 2008",$$CTR($P(^DIC(4,BUDSITE,0),U),80),?70,"Page ",BUDPG
+5 ;W $$CTR($P(^DIC(4,BUDSITE,0),U),80),!
+6 WRITE !,"UDS No. ",$PIECE(^BUDGSITE(BUDSITE,0),U,2),?50,"Date Run: ",$$FMTE^XLFDT(DT)
+7 WRITE !,"Reporting Period: ",$$FMTE^XLFDT(BUDBD)," through ",$$FMTE^XLFDT(BUDED)
+8 WRITE !
+9 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
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 ;----------