BUD1RP7N ; IHS/CMI/LAB - UDS REPORT DRIVER TABLE 6B ;
;;10.0;IHS/RPMS UNIFORM DATA SYSTEM;;FEB 04, 2016;Build 50
;
;
;
ETHN ;EP - called from taskman
;S BUDPG=0
;W:$D(IOF) @IOF
S BUDQUIT=0
D HEADER^BUD1RPTP Q:BUDQUIT D T7H
W ?33,"|",?48,"|",?50,"All Other",?63,"|",?78,"|",!
W ?33,"|",?48,"|",?50,"including",?63,"|",?78,"|",!
W ?33,"|",?48,"|",?50,"Unreported/",?63,"|",?78,"|",!
W ?33,"|",?35,"Hispanic",?48,"|",?51,"Refused to",?63,"|",?78,"|",!
W ?33,"|",?35,"or Latino",?48,"|",?51,"Report",?63,"|",?67,"TOTAL",?78,"|",!
W ?33,"|",?37,"(i)",?48,"|",?52,"(j)",?63,"|",?67,"(k)",?78,"|",!
D LINE1
W $$CTR("SECTION D: DELIVERIES AND BIRTH WEIGHT BY ETHNICITY"),?78,"|",!
D LINE
;W $$CTR("Deliveries and Babies by birth weight"),?78,"|",!
;D LINE
W ?2,"1",?5,"Prenatal care patients",?33,"|",?48,"|",?63,"|",?78,"|",!
W ?5,"who delivered during",?33,"|",?48,"|",?63,"|",?78,"|",!
W ?5,"the year",?33,"|",?48,"|",?63,"|",?78,"|",!
D LINE1
I $Y>(IOSL-3) D HEADER^BUD1RPTP Q:BUDQUIT D T7H
W ?2,"2",?5,"Live Births ",?33,"|",?48,"|",?63,"|",?78,"|",!
W ?5,"< 1500 grams",?33,"|",?48,"|",?63,"|",?78,"|",!
D LINE1
I $Y>(IOSL-3) D HEADER^BUD1RPTP Q:BUDQUIT D T7H
W ?2,"3",?5,"Live Births 1500-",?33,"|",?48,"|",?63,"|",?78,"|",!
W ?5,"2400 grams",?33,"|",?48,"|",?63,"|",?78,"|",!
D LINE1
I $Y>(IOSL-3) D HEADER^BUD1RPTP Q:BUDQUIT D T7H
W ?2,"4",?5,"Live Births ",?33,"|",?48,"|",?63,"|",?78,"|",!
W ?5,">= 2400 grams",?33,"|",?48,"|",?63,"|",?78,"|",!
D LINE1
W $$CTR("SECTION E: HYPERTENSION BY ETHNICITY"),?78,"|",!
D LINE
W $$CTR("Patients diagnosed with hypertension whose last blood pressure"),?78,"|",!
W $$CTR("was less than 140/90"),?78,"|",!
D LINE
W ?2,"6",?5,"Total patients aged",?33,"|",?48,"|",?63,"|",?78,"|",!
W ?5,"18 + with hypertension",?33,"|",$$C($P($G(BUDSECTE(6)),U)),?48,"|",$$C($P($G(BUDSECTE(6)),U,2)),?63,"|",$$C($P($G(BUDSECTE(6)),U,3)),?78,"|",!
D LINE1
I $Y>(IOSL-3) D HEADER^BUD1RPTP Q:BUDQUIT D T7H
W ?2,"7",?5,"Charts sampled / EHR Total",?33,"|",$$C($P($G(BUDSECTE(7)),U)),?48,"|",$$C($P($G(BUDSECTE(7)),U,2)),?63,"|",$$C($P($G(BUDSECTE(7)),U,3)),?78,"|",!
D LINE1
I $Y>(IOSL-3) D HEADER^BUD1RPTP Q:BUDQUIT D T7H
W ?2,"8",?5,"Patients with controlled",?33,"|",?48,"|",?63,"|",?78,"|",!
W ?5,"blood pressure",?33,"|",$$C($P($G(BUDSECTE(8)),U)),?48,"|",$$C($P($G(BUDSECTE(8)),U,2)),?63,"|",$$C($P($G(BUDSECTE(8)),U,3)),?78,"|",!
D LINE1
;DM
D HEADER^BUD1RPTP Q:BUDQUIT D T7H
W ?33,"|",?48,"|",?50,"All Other",?63,"|",?78,"|",!
W ?33,"|",?48,"|",?50,"including",?63,"|",?78,"|",!
W ?33,"|",?48,"|",?50,"Unreported/",?63,"|",?78,"|",!
W ?33,"|",?35,"Hispanic",?48,"|",?51,"Refused to",?63,"|",?78,"|",!
W ?33,"|",?35,"or Latino",?48,"|",?51,"Report",?63,"|",?67,"TOTAL",?78,"|",!
W ?33,"|",?37,"(i)",?48,"|",?52,"(j)",?63,"|",?67,"(k)",?78,"|",!
D LINE1
W $$CTR("SECTION F: DIABETES BY ETHNICITY"),?78,"|",!
D LINE
W $$CTR("Patients diagnosed with Type I or Type II diabetes: Most recent test results"),?78,"|",!
D LINE
W ?2,"9",?5,"Total patients aged",?33,"|",?48,"|",?63,"|",?78,"|",!
W ?5,"18 + with Type I or II",?33,"|",?48,"|",?63,"|",?78,"|",!
W ?5,"diabetes",?33,"|",$$C($P($G(BUDSECTF(9)),U)),?48,"|",$$C($P($G(BUDSECTF(9)),U,2)),?63,"|",$$C($P($G(BUDSECTF(9)),U,3)),?78,"|",!
D LINE1
I $Y>(IOSL-3) D HEADER^BUD1RPTP Q:BUDQUIT D T7H
W ?1,"10",?5,"Charts sampled / EHR Total",?33,"|",$$C($P($G(BUDSECTF(10)),U)),?48,"|",$$C($P($G(BUDSECTF(10)),U,2)),?63,"|",$$C($P($G(BUDSECTF(10)),U,3)),?78,"|",!
D LINE1
I $Y>(IOSL-3) D HEADER^BUD1RPTP Q:BUDQUIT D T7H
W ?1,"11",?5,"Patients with HBA1c < 7%",?33,"|",$$C($P($G(BUDSECTF(11)),U)),?48,"|",$$C($P($G(BUDSECTF(11)),U,2)),?63,"|",$$C($P($G(BUDSECTF(11)),U,3)),?78,"|",!
D LINE1
I $Y>(IOSL-3) D HEADER^BUD1RPTP Q:BUDQUIT D T7H
W ?1,"12",?5,"Patients with ",?33,"|",?48,"|",?63,"|",?78,"|",!
W ?5,"7% >= HBA1c <= 9%",?33,"|",$$C($P($G(BUDSECTF(12)),U)),?48,"|",$$C($P($G(BUDSECTF(12)),U,2)),?63,"|",$$C($P($G(BUDSECTF(12)),U,3)),?78,"|",!
D LINE1
I $Y>(IOSL-3) D HEADER^BUD1RPTP Q:BUDQUIT D T7H
W ?1,"13",?5,"Patients with HBA1c > 9%",?33,"|",$$C($P($G(BUDSECTF(13)),U)),?48,"|",$$C($P($G(BUDSECTF(13)),U,2)),?63,"|",$$C($P($G(BUDSECTF(13)),U,3)),?78,"|",!
D LINE1
Q
T7H ;
W !,$$CTR("TABLE 7 - HEALTH OUTCOMES AND DISPARITIES"),!,$$REPEAT^XLFSTR("_",79),!
Q
LINE ;
W $$REPEAT^XLFSTR("_",78),?78,"|",!
Q
LINE1 ;
W $$REPEAT^XLFSTR("_",33),?33,"|",$$REPEAT^XLFSTR("_",14),?48,"|",$$REPEAT^XLFSTR("_",14),?63,"|",$$REPEAT^XLFSTR("_",14),?78,"|",!
Q
LINE2 ;
W $$REPEAT^XLFSTR("_",33),?33,"|",$$REPEAT^XLFSTR("_",39),?63,"|_________",?78,"|",!
Q
;
LINE3 ;
W $$REPEAT^XLFSTR("_",33),?33,"|",$$REPEAT^XLFSTR("_",49),?78,"|",!
Q
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")
;----------
PAUSE ;
K DIR S DIR(0)="E",DIR("A")="PRESS ENTER" KILL DA D ^DIR KILL DIR
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
BUD1RP7N ; IHS/CMI/LAB - UDS REPORT DRIVER TABLE 6B ;
+1 ;;10.0;IHS/RPMS UNIFORM DATA SYSTEM;;FEB 04, 2016;Build 50
+2 ;
+3 ;
+4 ;
ETHN ;EP - called from taskman
+1 ;S BUDPG=0
+2 ;W:$D(IOF) @IOF
+3 SET BUDQUIT=0
+4 DO HEADER^BUD1RPTP
IF BUDQUIT
QUIT
DO T7H
+5 WRITE ?33,"|",?48,"|",?50,"All Other",?63,"|",?78,"|",!
+6 WRITE ?33,"|",?48,"|",?50,"including",?63,"|",?78,"|",!
+7 WRITE ?33,"|",?48,"|",?50,"Unreported/",?63,"|",?78,"|",!
+8 WRITE ?33,"|",?35,"Hispanic",?48,"|",?51,"Refused to",?63,"|",?78,"|",!
+9 WRITE ?33,"|",?35,"or Latino",?48,"|",?51,"Report",?63,"|",?67,"TOTAL",?78,"|",!
+10 WRITE ?33,"|",?37,"(i)",?48,"|",?52,"(j)",?63,"|",?67,"(k)",?78,"|",!
+11 DO LINE1
+12 WRITE $$CTR("SECTION D: DELIVERIES AND BIRTH WEIGHT BY ETHNICITY"),?78,"|",!
+13 DO LINE
+14 ;W $$CTR("Deliveries and Babies by birth weight"),?78,"|",!
+15 ;D LINE
+16 WRITE ?2,"1",?5,"Prenatal care patients",?33,"|",?48,"|",?63,"|",?78,"|",!
+17 WRITE ?5,"who delivered during",?33,"|",?48,"|",?63,"|",?78,"|",!
+18 WRITE ?5,"the year",?33,"|",?48,"|",?63,"|",?78,"|",!
+19 DO LINE1
+20 IF $Y>(IOSL-3)
DO HEADER^BUD1RPTP
IF BUDQUIT
QUIT
DO T7H
+21 WRITE ?2,"2",?5,"Live Births ",?33,"|",?48,"|",?63,"|",?78,"|",!
+22 WRITE ?5,"< 1500 grams",?33,"|",?48,"|",?63,"|",?78,"|",!
+23 DO LINE1
+24 IF $Y>(IOSL-3)
DO HEADER^BUD1RPTP
IF BUDQUIT
QUIT
DO T7H
+25 WRITE ?2,"3",?5,"Live Births 1500-",?33,"|",?48,"|",?63,"|",?78,"|",!
+26 WRITE ?5,"2400 grams",?33,"|",?48,"|",?63,"|",?78,"|",!
+27 DO LINE1
+28 IF $Y>(IOSL-3)
DO HEADER^BUD1RPTP
IF BUDQUIT
QUIT
DO T7H
+29 WRITE ?2,"4",?5,"Live Births ",?33,"|",?48,"|",?63,"|",?78,"|",!
+30 WRITE ?5,">= 2400 grams",?33,"|",?48,"|",?63,"|",?78,"|",!
+31 DO LINE1
+32 WRITE $$CTR("SECTION E: HYPERTENSION BY ETHNICITY"),?78,"|",!
+33 DO LINE
+34 WRITE $$CTR("Patients diagnosed with hypertension whose last blood pressure"),?78,"|",!
+35 WRITE $$CTR("was less than 140/90"),?78,"|",!
+36 DO LINE
+37 WRITE ?2,"6",?5,"Total patients aged",?33,"|",?48,"|",?63,"|",?78,"|",!
+38 WRITE ?5,"18 + with hypertension",?33,"|",$$C($PIECE($GET(BUDSECTE(6)),U)),?48,"|",$$C($PIECE($GET(BUDSECTE(6)),U,2)),?63,"|",$$C($PIECE($GET(BUDSECTE(6)),U,3)),?78,"|",!
+39 DO LINE1
+40 IF $Y>(IOSL-3)
DO HEADER^BUD1RPTP
IF BUDQUIT
QUIT
DO T7H
+41 WRITE ?2,"7",?5,"Charts sampled / EHR Total",?33,"|",$$C($PIECE($GET(BUDSECTE(7)),U)),?48,"|",$$C($PIECE($GET(BUDSECTE(7)),U,2)),?63,"|",$$C($PIECE($GET(BUDSECTE(7)),U,3)),?78,"|",!
+42 DO LINE1
+43 IF $Y>(IOSL-3)
DO HEADER^BUD1RPTP
IF BUDQUIT
QUIT
DO T7H
+44 WRITE ?2,"8",?5,"Patients with controlled",?33,"|",?48,"|",?63,"|",?78,"|",!
+45 WRITE ?5,"blood pressure",?33,"|",$$C($PIECE($GET(BUDSECTE(8)),U)),?48,"|",$$C($PIECE($GET(BUDSECTE(8)),U,2)),?63,"|",$$C($PIECE($GET(BUDSECTE(8)),U,3)),?78,"|",!
+46 DO LINE1
+47 ;DM
+48 DO HEADER^BUD1RPTP
IF BUDQUIT
QUIT
DO T7H
+49 WRITE ?33,"|",?48,"|",?50,"All Other",?63,"|",?78,"|",!
+50 WRITE ?33,"|",?48,"|",?50,"including",?63,"|",?78,"|",!
+51 WRITE ?33,"|",?48,"|",?50,"Unreported/",?63,"|",?78,"|",!
+52 WRITE ?33,"|",?35,"Hispanic",?48,"|",?51,"Refused to",?63,"|",?78,"|",!
+53 WRITE ?33,"|",?35,"or Latino",?48,"|",?51,"Report",?63,"|",?67,"TOTAL",?78,"|",!
+54 WRITE ?33,"|",?37,"(i)",?48,"|",?52,"(j)",?63,"|",?67,"(k)",?78,"|",!
+55 DO LINE1
+56 WRITE $$CTR("SECTION F: DIABETES BY ETHNICITY"),?78,"|",!
+57 DO LINE
+58 WRITE $$CTR("Patients diagnosed with Type I or Type II diabetes: Most recent test results"),?78,"|",!
+59 DO LINE
+60 WRITE ?2,"9",?5,"Total patients aged",?33,"|",?48,"|",?63,"|",?78,"|",!
+61 WRITE ?5,"18 + with Type I or II",?33,"|",?48,"|",?63,"|",?78,"|",!
+62 WRITE ?5,"diabetes",?33,"|",$$C($PIECE($GET(BUDSECTF(9)),U)),?48,"|",$$C($PIECE($GET(BUDSECTF(9)),U,2)),?63,"|",$$C($PIECE($GET(BUDSECTF(9)),U,3)),?78,"|",!
+63 DO LINE1
+64 IF $Y>(IOSL-3)
DO HEADER^BUD1RPTP
IF BUDQUIT
QUIT
DO T7H
+65 WRITE ?1,"10",?5,"Charts sampled / EHR Total",?33,"|",$$C($PIECE($GET(BUDSECTF(10)),U)),?48,"|",$$C($PIECE($GET(BUDSECTF(10)),U,2)),?63,"|",$$C($PIECE($GET(BUDSECTF(10)),U,3)),?78,"|",!
+66 DO LINE1
+67 IF $Y>(IOSL-3)
DO HEADER^BUD1RPTP
IF BUDQUIT
QUIT
DO T7H
+68 WRITE ?1,"11",?5,"Patients with HBA1c < 7%",?33,"|",$$C($PIECE($GET(BUDSECTF(11)),U)),?48,"|",$$C($PIECE($GET(BUDSECTF(11)),U,2)),?63,"|",$$C($PIECE($GET(BUDSECTF(11)),U,3)),?78,"|",!
+69 DO LINE1
+70 IF $Y>(IOSL-3)
DO HEADER^BUD1RPTP
IF BUDQUIT
QUIT
DO T7H
+71 WRITE ?1,"12",?5,"Patients with ",?33,"|",?48,"|",?63,"|",?78,"|",!
+72 WRITE ?5,"7% >= HBA1c <= 9%",?33,"|",$$C($PIECE($GET(BUDSECTF(12)),U)),?48,"|",$$C($PIECE($GET(BUDSECTF(12)),U,2)),?63,"|",$$C($PIECE($GET(BUDSECTF(12)),U,3)),?78,"|",!
+73 DO LINE1
+74 IF $Y>(IOSL-3)
DO HEADER^BUD1RPTP
IF BUDQUIT
QUIT
DO T7H
+75 WRITE ?1,"13",?5,"Patients with HBA1c > 9%",?33,"|",$$C($PIECE($GET(BUDSECTF(13)),U)),?48,"|",$$C($PIECE($GET(BUDSECTF(13)),U,2)),?63,"|",$$C($PIECE($GET(BUDSECTF(13)),U,3)),?78,"|",!
+76 DO LINE1
+77 QUIT
T7H ;
+1 WRITE !,$$CTR("TABLE 7 - HEALTH OUTCOMES AND DISPARITIES"),!,$$REPEAT^XLFSTR("_",79),!
+2 QUIT
LINE ;
+1 WRITE $$REPEAT^XLFSTR("_",78),?78,"|",!
+2 QUIT
LINE1 ;
+1 WRITE $$REPEAT^XLFSTR("_",33),?33,"|",$$REPEAT^XLFSTR("_",14),?48,"|",$$REPEAT^XLFSTR("_",14),?63,"|",$$REPEAT^XLFSTR("_",14),?78,"|",!
+2 QUIT
LINE2 ;
+1 WRITE $$REPEAT^XLFSTR("_",33),?33,"|",$$REPEAT^XLFSTR("_",39),?63,"|_________",?78,"|",!
+2 QUIT
+3 ;
LINE3 ;
+1 WRITE $$REPEAT^XLFSTR("_",33),?33,"|",$$REPEAT^XLFSTR("_",49),?78,"|",!
+2 QUIT
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 ;----------
PAUSE ;
+1 KILL DIR
SET DIR(0)="E"
SET DIR("A")="PRESS ENTER"
KILL DA
DO ^DIR
KILL DIR
+2 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