BUD8RP7 ; IHS/CMI/LAB - UDS REPORT DRIVER TABLE 6B 12 Dec 2008 6:51 AM 30 Dec 2008 8:19 PM ;
;;10.0;IHS/RPMS UNIFORM DATA SYSTEM;;FEB 04, 2016;Build 50
;
;
T7 ;
D EOJ
EN ;
D GENI
D T7I
D PAUSE
D PRENATT
D PAUSE
;
EN1 ;
PNC ;
S BUDPREN=""
S DIR(0)="Y",DIR("A")="Does your facility provide prenatal care",DIR("B")="N" KILL DA D ^DIR KILL DIR
I $D(DIRUT) D EOJ Q
S BUDPREN=Y
;
EN2 ;
S BUDSITE=""
S DIC="^BUDGSITE(",DIC(0)="AEMQ",DIC("A")="Enter your site: " D ^DIC
I Y=-1 G PNC
S BUDSITE=+Y
I '$O(^BUDGSITE(BUDSITE,11,0)) W !!,"Warning: There are no locations defined in the site parameter file for this",!,"site. Report will not be accurate!" G EN
S BUDTAXT="7" D TAXCHK^BUD8XTCH
S BUDYEAR=3080000,BUDBD=3080101,BUDED=3081231
S BUDCAD=3080630
S BUDYEAR=3030000,BUDBD=3030101,BUDED=3031231
S BUDCAD=3030630
W !!,"Your report will be run for the time period: ",$$FMTE^XLFDT(BUDBD)," to ",$$FMTE^XLFDT(BUDED)
ZIS ;call to XBDBQUE
K IOP,%ZIS
W !! S %ZIS="PQM" D ^%ZIS
I POP D EOJ Q
ZIS1 ;
I $D(IO("Q")) G TSKMN
DRIVER ;
D PROC
U IO
D PRINT
D ^%ZISC
D EOJ
Q
TSKMN ;EP ENTRY POINT FROM TASKMAN
S ZTIO=$S($D(ION):ION,1:IO) I $D(IOST)#2,IOST]"" S ZTIO=ZTIO_";"_IOST
I $G(IO("DOC"))]"" S ZTIO=ZTIO_";"_$G(IO("DOC"))
I $D(IOM)#2,IOM S ZTIO=ZTIO_";"_IOM I $D(IOSL)#2,IOSL S ZTIO=ZTIO_";"_IOSL
K ZTSAVE S ZTSAVE("BUD*")=""
S ZTCPU=$G(IOCPU),ZTRTN="DRIVER^BUD8RP7",ZTDTH="",ZTDESC="UDS 08 REPORT TABLE 7" D ^%ZTLOAD D EOJ Q
Q
EOJ ;
D EN^XBVK("BUD")
Q
PRGHLIST ;EP
D EOJ
S BUDPRGHL=1
D PRGH^BUD8RP7I
G EN1
;
PRGRLIST ;EP
D EOJ
S BUDPRGRL=1
D PRGR^BUD8RP7I
G EN1
;
PRGELIST ;EP
D EOJ
S BUDPRGEL=1
D PRGE^BUD8RP7I
G EN1
;
HTRLIST ;EP
D EOJ
S BUDHTRL=1
D HTR^BUD8RP7J
G EN1
;
HTCRLIST ;EP
D EOJ
S BUDHTCRL=1
D HTCR^BUD8RP7J
G EN1
;
HTURLIST ;EP
D EOJ
S BUDHTURL=1
D HTUR^BUD8RP7J
G EN1
;
HTELIST ;EP
D EOJ
S BUDHTEL=1
D HTE^BUD8RP7K
G EN1
;
HTCELIST ;EP
D EOJ
S BUDHTCEL=1
D HTCE^BUD8RP7K
G EN1
;
HTUELIST ;EP
D EOJ
S BUDHTUEL=1
D HTUE^BUD8RP7K
G EN1
;
;
MHT ;EP
D EOJ
D GENI^BUD8RP7I
S (BUDHTRL,BUDHTCRL,BUDHTURL,BUDHTEL,BUDHTCEL,BUDHTUEL)=0
W !!,"UDS Table 7 Hypertension Patient List Selection"
W !!?5,"1 All HTN Patients by Race"
W !?5,"2 All HTN Patients by Ethnicity"
W !?5,"3 All HTN Patients w/Controlled BP by Race"
W !?5,"4 All HTN Patients w/Uncontrolled BP by Race"
W !?5,"5 All HTN Patients w/Controlled BP by Ethnicity"
W !?5,"6 All HTN Patients w/Uncontrolled BP by Ethnicity"
W !?5,"7 ALL Lists for HTN Patients"
S DIR(0)="L^1:7",DIR("A")="Include which Tables",DIR("B")=1 KILL DA D ^DIR KILL DIR
I $D(DIRUT) D EOJ Q
I Y[7 S (BUDHTRL,BUDHTCRL,BUDHTURL,BUDHTEL,BUDHTCEL,BUDHTUEL)=1
I Y[1 S BUDHTRL=1
I Y[2 S BUDHTEL=1
I Y[3 S BUDHTCRL=1
I Y[4 S BUDHTURL=1
I Y[5 S BUDHTCEL=1
I Y[6 S BUDHTUEL=1
G EN1
LIST ;
DMRLIST ;EP
D EOJ
S BUDDMRL=1
D DMR^BUD8RP7L
G EN1
;
DMR1LIST ;EP
D EOJ
S BUDDMR1L=1
D DMR1^BUD8RP7L
G EN1
;
DMR2LIST ;EP
D EOJ
S BUDDMR2L=1
D DMR2^BUD8RP7L
G EN1
;
DMR3LIST ;EP
D EOJ
S BUDDMR3L=1
D DMR3^BUD8RP7T
G EN1
;
DMELIST ;EP
D EOJ
S BUDDMEL=1
D DME^BUD8RP7M
G EN1
;
DME1LIST ;EP
D EOJ
S BUDDME1L=1
D DME1^BUD8RP7M
G EN1
;
DME2LIST ;EP
D EOJ
S BUDDME2L=1
D DME2^BUD8RP7M
G EN1
;
DME3LIST ;EP
D EOJ
S BUDDME3L=1
D DME3^BUD8RP7S
G EN1
;
MDM ;EP
D EOJ
D GENI^BUD8RP7I
S (BUDHTRL,BUDDMR1L,BUDHTURL,BUDHTEL,BUDHTCEL,BUDHTUEL)=0
W !!,"UDS Table 7 Diabetes Patient List Selection"
W !!?5,"1 All Patients w/DM by Race"
W !?5,"2 All Patients w/DM by Ethnicity"
W !?5,"3 All Patients w/DM and A1c <7 by Race"
W !?5,"4 All Patients w/DM and A1c >=7 and <=9 by Race"
W !?5,"5 All Patients w/DM and A1c >9 by Race"
W !?5,"6 All Patients w/DM and A1c <7 by Ethnicity"
W !?5,"7 All Patients w/DM and A1c >=7 and <=9 by Ethnicity"
W !?5,"8 All Patients w/DM and A1c >9 by Ethnicity"
W !?5,"9 ALL Lists for DM Patients"
S DIR(0)="L^1:9",DIR("A")="Include which Tables",DIR("B")=1 KILL DA D ^DIR KILL DIR
I $D(DIRUT) D EOJ Q
I Y[9 S (BUDDMRL,BUDDMR1L,BUDDMR2L,BUDDMR3L,BUDDMEL,BUDDME1L,BUDDME2L,BUDDME3L)=1
I Y[1 S BUDDMRL=1
I Y[2 S BUDDMEL=1
I Y[3 S BUDDMR1L=1
I Y[4 S BUDDMR2L=1
I Y[5 S BUDDMR3L=1
I Y[6 S BUDDME1L=1
I Y[7 S BUDDME2L=1
I Y[8 S BUDDME3L=1
G EN1
MPRG ;EP - called from option
D EOJ
D GENI^BUD8RP7I
S (BUDPRGHL,BUDPRGRL,BUDPRGEL)=0
W !!,"UDS Table 7 Pregnant Patient List Selection"
W !!?5,"1 All Pregnant Patients w/HIV"
W !?5,"2 All Pregnant Patients by Race"
W !?5,"3 All Pregnant Patients by Ethnicity"
W !?5,"4 ALL Lists"
S DIR(0)="L^1:4",DIR("A")="Include which Tables",DIR("B")=1 KILL DA D ^DIR KILL DIR
I $D(DIRUT) D EOJ Q
I Y[4 S (BUDPRGHL,BUDPRGRL,BUDPRGEL)=1
I Y[1 S BUDPRGHL=1
I Y[2 S BUDPRGRL=1
I Y[3 S BUDPRGEL=1
G EN1
;
PROC ;EP - called from taskman
S BUDJ=$J,BUDH=$H
S ^XTMP("BUD8RP7B",0)=$$FMADD^XLFDT(DT,14)_"^"_DT_"^BUD TABLE 7 LISTS"
;NOW LOOP THROUGH PATIENT FILE for imms and paps
S DFN=0 F S DFN=$O(^AUPNPAT(DFN)) Q:DFN'=+DFN D
.;Q:'$D(^DIBT(4485,1,DFN))
.;Q:DFN'=122700
.K ^TMP($J)
.Q:'$D(^AUPNPAT(DFN,0))
.Q:'$D(^DPT(DFN,0))
.Q:$P(^DPT(DFN,0),U,19) ;merged away
.Q:$P(^DPT(DFN,0),U,1)["DEMO,PATIENT"
.Q:$P(^DPT(DFN,0),U,1)["PATIENT,CRS"
.S C=$$COMMRES^AUPNPAT(DFN,"E")
.;I C'="COWETA",C'="TULSA,URBAN" Q
.;;I C'="BARTLESVILLE" Q
.S BUDSEX=$P(^DPT(DFN,0),U,2)
.S BUDCOM=$$COMMRES^AUPNPAT(DFN,"E") I BUDCOM="" S BUDCOM="UNKNOWN"
.S BUDAGE=$$AGE^AUPNPAT(DFN,BUDED) ;age at end of time period
.S BUDAGEP=$$AGE^AUPNPAT(DFN,BUDCAD) ;age on june 30 for pregnancy
.D GETV^BUD8RPTD ;get visits that meet criteria
.I BUDT35V=0 Q ;user doesn't have any countable visits and is not considered a user
.I $G(BUDPRGHL) D PRGHLST^BUD8RP7A
.I $G(BUDPRGRL) D PRGRLST^BUD8RP7A
.I $G(BUDPRGEL) D PRGELST^BUD8RP7A
.D HTN^BUD8RP7B
.D DM^BUD8RP7C
Q
;
PRINT ;EP - called from taskman
D PRINT^BUD8RP71
Q
;
T7H ;
W !,$$CTR("TABLE 7 - HEALTH OUTCOMES AND DISPARITIES"),!,$$REPEAT^XLFSTR("_",79),!
Q
LINE ;
W $$REPEAT^XLFSTR("_",79),?79,"|",!
Q
LINE1 ;
W $$REPEAT^XLFSTR("_",29),?29,"|",$$REPEAT^XLFSTR("_",9),?39,"|",$$REPEAT^XLFSTR("_",9),?49,"|",$$REPEAT^XLFSTR("_",9),?59,"|",$$REPEAT^XLFSTR("_",9),?69,"|",$$REPEAT^XLFSTR("_",9),?79,"|",!
Q
LINE2 ;
W $$REPEAT^XLFSTR("_",29),?29,"|",$$REPEAT^XLFSTR("_",39),?69,"|_________",?79,"|",!
Q
;
LINE3 ;
W $$REPEAT^XLFSTR("_",29),?29,"|",$$REPEAT^XLFSTR("_",49),?79,"|",!
Q
T7I ;
W !!,"TABLE 7: HEALTH OUTCOMES AND DISPARITIES"
W !,"This report will produce UDS Table 7, health outcomes indicators by race"
W !,"and ethnicity for deliveries and low birth weights, hypertension, and "
W !,"diabetes Glycemic control. Patients must meet additional criteria as"
W !,"specified for each indicator."
W !
Q
GENI ;general introductions
W:$D(IOF) @(IOF)
W !!,$$CTR($$LOC,80),!,$$CTR("UDS 2008",80),!
W !,"UDS searches your database to find all patients reported for the quality"
W !,"of care indicators during the time period January 1, 2008 through"
W !,"December 31, 2008. Based on the UDS defintion, to be considered a"
W !,"patient, the patient must have had at least one visit meeting the"
W !,"following criteria:"
W !?4,"- must be to a location specified in your visit location setup"
W !?4,"- must be to Service Category Ambulatory (A), Hospitalization (H), Day"
W !?6,"Surgery (S), Observation (O), Nursing home visit (R), "
W !?6,"or In-Hospital (I) visit"
W !?4,"- must NOT have an excluded clinic code (see User Manual for a list)"
W !?4,"- must have a primary provider and a coded purpose of visit"
W !
Q
;
PRENATT ;
W !!,"UDS does not calculate the deliveries and low birth weight indicators"
W !,"in Sections A and D. However, you can run a list of patients identified "
W !,"by UDS as pregnant to determine which of them received prenatal care at"
W !,"your facility to assist you with completing Table 7, Sections A and D."
W !,"The menu options you would select to run the patient list are: LST, LST3,"
W !,"PRGR (list by race) and PRGE (list by ethnicity)."
W !
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
BUD8RP7 ; IHS/CMI/LAB - UDS REPORT DRIVER TABLE 6B 12 Dec 2008 6:51 AM 30 Dec 2008 8:19 PM ;
+1 ;;10.0;IHS/RPMS UNIFORM DATA SYSTEM;;FEB 04, 2016;Build 50
+2 ;
+3 ;
T7 ;
+1 DO EOJ
EN ;
+1 DO GENI
+2 DO T7I
+3 DO PAUSE
+4 DO PRENATT
+5 DO PAUSE
+6 ;
EN1 ;
PNC ;
+1 SET BUDPREN=""
+2 SET DIR(0)="Y"
SET DIR("A")="Does your facility provide prenatal care"
SET DIR("B")="N"
KILL DA
DO ^DIR
KILL DIR
+3 IF $DATA(DIRUT)
DO EOJ
QUIT
+4 SET BUDPREN=Y
+5 ;
EN2 ;
+1 SET BUDSITE=""
+2 SET DIC="^BUDGSITE("
SET DIC(0)="AEMQ"
SET DIC("A")="Enter your site: "
DO ^DIC
+3 IF Y=-1
GOTO PNC
+4 SET BUDSITE=+Y
+5 IF '$ORDER(^BUDGSITE(BUDSITE,11,0))
WRITE !!,"Warning: There are no locations defined in the site parameter file for this",!,"site. Report will not be accurate!"
GOTO EN
+6 SET BUDTAXT="7"
DO TAXCHK^BUD8XTCH
+7 SET BUDYEAR=3080000
SET BUDBD=3080101
SET BUDED=3081231
+8 SET BUDCAD=3080630
+9 SET BUDYEAR=3030000
SET BUDBD=3030101
SET BUDED=3031231
+10 SET BUDCAD=3030630
+11 WRITE !!,"Your report will be run for the time period: ",$$FMTE^XLFDT(BUDBD)," to ",$$FMTE^XLFDT(BUDED)
ZIS ;call to XBDBQUE
+1 KILL IOP,%ZIS
+2 WRITE !!
SET %ZIS="PQM"
DO ^%ZIS
+3 IF POP
DO EOJ
QUIT
ZIS1 ;
+1 IF $DATA(IO("Q"))
GOTO TSKMN
DRIVER ;
+1 DO PROC
+2 USE IO
+3 DO PRINT
+4 DO ^%ZISC
+5 DO EOJ
+6 QUIT
TSKMN ;EP ENTRY POINT FROM TASKMAN
+1 SET ZTIO=$SELECT($DATA(ION):ION,1:IO)
IF $DATA(IOST)#2
IF IOST]""
SET ZTIO=ZTIO_";"_IOST
+2 IF $GET(IO("DOC"))]""
SET ZTIO=ZTIO_";"_$GET(IO("DOC"))
+3 IF $DATA(IOM)#2
IF IOM
SET ZTIO=ZTIO_";"_IOM
IF $DATA(IOSL)#2
IF IOSL
SET ZTIO=ZTIO_";"_IOSL
+4 KILL ZTSAVE
SET ZTSAVE("BUD*")=""
+5 SET ZTCPU=$GET(IOCPU)
SET ZTRTN="DRIVER^BUD8RP7"
SET ZTDTH=""
SET ZTDESC="UDS 08 REPORT TABLE 7"
DO ^%ZTLOAD
DO EOJ
QUIT
+6 QUIT
EOJ ;
+1 DO EN^XBVK("BUD")
+2 QUIT
PRGHLIST ;EP
+1 DO EOJ
+2 SET BUDPRGHL=1
+3 DO PRGH^BUD8RP7I
+4 GOTO EN1
+5 ;
PRGRLIST ;EP
+1 DO EOJ
+2 SET BUDPRGRL=1
+3 DO PRGR^BUD8RP7I
+4 GOTO EN1
+5 ;
PRGELIST ;EP
+1 DO EOJ
+2 SET BUDPRGEL=1
+3 DO PRGE^BUD8RP7I
+4 GOTO EN1
+5 ;
HTRLIST ;EP
+1 DO EOJ
+2 SET BUDHTRL=1
+3 DO HTR^BUD8RP7J
+4 GOTO EN1
+5 ;
HTCRLIST ;EP
+1 DO EOJ
+2 SET BUDHTCRL=1
+3 DO HTCR^BUD8RP7J
+4 GOTO EN1
+5 ;
HTURLIST ;EP
+1 DO EOJ
+2 SET BUDHTURL=1
+3 DO HTUR^BUD8RP7J
+4 GOTO EN1
+5 ;
HTELIST ;EP
+1 DO EOJ
+2 SET BUDHTEL=1
+3 DO HTE^BUD8RP7K
+4 GOTO EN1
+5 ;
HTCELIST ;EP
+1 DO EOJ
+2 SET BUDHTCEL=1
+3 DO HTCE^BUD8RP7K
+4 GOTO EN1
+5 ;
HTUELIST ;EP
+1 DO EOJ
+2 SET BUDHTUEL=1
+3 DO HTUE^BUD8RP7K
+4 GOTO EN1
+5 ;
+6 ;
MHT ;EP
+1 DO EOJ
+2 DO GENI^BUD8RP7I
+3 SET (BUDHTRL,BUDHTCRL,BUDHTURL,BUDHTEL,BUDHTCEL,BUDHTUEL)=0
+4 WRITE !!,"UDS Table 7 Hypertension Patient List Selection"
+5 WRITE !!?5,"1 All HTN Patients by Race"
+6 WRITE !?5,"2 All HTN Patients by Ethnicity"
+7 WRITE !?5,"3 All HTN Patients w/Controlled BP by Race"
+8 WRITE !?5,"4 All HTN Patients w/Uncontrolled BP by Race"
+9 WRITE !?5,"5 All HTN Patients w/Controlled BP by Ethnicity"
+10 WRITE !?5,"6 All HTN Patients w/Uncontrolled BP by Ethnicity"
+11 WRITE !?5,"7 ALL Lists for HTN Patients"
+12 SET DIR(0)="L^1:7"
SET DIR("A")="Include which Tables"
SET DIR("B")=1
KILL DA
DO ^DIR
KILL DIR
+13 IF $DATA(DIRUT)
DO EOJ
QUIT
+14 IF Y[7
SET (BUDHTRL,BUDHTCRL,BUDHTURL,BUDHTEL,BUDHTCEL,BUDHTUEL)=1
+15 IF Y[1
SET BUDHTRL=1
+16 IF Y[2
SET BUDHTEL=1
+17 IF Y[3
SET BUDHTCRL=1
+18 IF Y[4
SET BUDHTURL=1
+19 IF Y[5
SET BUDHTCEL=1
+20 IF Y[6
SET BUDHTUEL=1
+21 GOTO EN1
LIST ;
DMRLIST ;EP
+1 DO EOJ
+2 SET BUDDMRL=1
+3 DO DMR^BUD8RP7L
+4 GOTO EN1
+5 ;
DMR1LIST ;EP
+1 DO EOJ
+2 SET BUDDMR1L=1
+3 DO DMR1^BUD8RP7L
+4 GOTO EN1
+5 ;
DMR2LIST ;EP
+1 DO EOJ
+2 SET BUDDMR2L=1
+3 DO DMR2^BUD8RP7L
+4 GOTO EN1
+5 ;
DMR3LIST ;EP
+1 DO EOJ
+2 SET BUDDMR3L=1
+3 DO DMR3^BUD8RP7T
+4 GOTO EN1
+5 ;
DMELIST ;EP
+1 DO EOJ
+2 SET BUDDMEL=1
+3 DO DME^BUD8RP7M
+4 GOTO EN1
+5 ;
DME1LIST ;EP
+1 DO EOJ
+2 SET BUDDME1L=1
+3 DO DME1^BUD8RP7M
+4 GOTO EN1
+5 ;
DME2LIST ;EP
+1 DO EOJ
+2 SET BUDDME2L=1
+3 DO DME2^BUD8RP7M
+4 GOTO EN1
+5 ;
DME3LIST ;EP
+1 DO EOJ
+2 SET BUDDME3L=1
+3 DO DME3^BUD8RP7S
+4 GOTO EN1
+5 ;
MDM ;EP
+1 DO EOJ
+2 DO GENI^BUD8RP7I
+3 SET (BUDHTRL,BUDDMR1L,BUDHTURL,BUDHTEL,BUDHTCEL,BUDHTUEL)=0
+4 WRITE !!,"UDS Table 7 Diabetes Patient List Selection"
+5 WRITE !!?5,"1 All Patients w/DM by Race"
+6 WRITE !?5,"2 All Patients w/DM by Ethnicity"
+7 WRITE !?5,"3 All Patients w/DM and A1c <7 by Race"
+8 WRITE !?5,"4 All Patients w/DM and A1c >=7 and <=9 by Race"
+9 WRITE !?5,"5 All Patients w/DM and A1c >9 by Race"
+10 WRITE !?5,"6 All Patients w/DM and A1c <7 by Ethnicity"
+11 WRITE !?5,"7 All Patients w/DM and A1c >=7 and <=9 by Ethnicity"
+12 WRITE !?5,"8 All Patients w/DM and A1c >9 by Ethnicity"
+13 WRITE !?5,"9 ALL Lists for DM Patients"
+14 SET DIR(0)="L^1:9"
SET DIR("A")="Include which Tables"
SET DIR("B")=1
KILL DA
DO ^DIR
KILL DIR
+15 IF $DATA(DIRUT)
DO EOJ
QUIT
+16 IF Y[9
SET (BUDDMRL,BUDDMR1L,BUDDMR2L,BUDDMR3L,BUDDMEL,BUDDME1L,BUDDME2L,BUDDME3L)=1
+17 IF Y[1
SET BUDDMRL=1
+18 IF Y[2
SET BUDDMEL=1
+19 IF Y[3
SET BUDDMR1L=1
+20 IF Y[4
SET BUDDMR2L=1
+21 IF Y[5
SET BUDDMR3L=1
+22 IF Y[6
SET BUDDME1L=1
+23 IF Y[7
SET BUDDME2L=1
+24 IF Y[8
SET BUDDME3L=1
+25 GOTO EN1
MPRG ;EP - called from option
+1 DO EOJ
+2 DO GENI^BUD8RP7I
+3 SET (BUDPRGHL,BUDPRGRL,BUDPRGEL)=0
+4 WRITE !!,"UDS Table 7 Pregnant Patient List Selection"
+5 WRITE !!?5,"1 All Pregnant Patients w/HIV"
+6 WRITE !?5,"2 All Pregnant Patients by Race"
+7 WRITE !?5,"3 All Pregnant Patients by Ethnicity"
+8 WRITE !?5,"4 ALL Lists"
+9 SET DIR(0)="L^1:4"
SET DIR("A")="Include which Tables"
SET DIR("B")=1
KILL DA
DO ^DIR
KILL DIR
+10 IF $DATA(DIRUT)
DO EOJ
QUIT
+11 IF Y[4
SET (BUDPRGHL,BUDPRGRL,BUDPRGEL)=1
+12 IF Y[1
SET BUDPRGHL=1
+13 IF Y[2
SET BUDPRGRL=1
+14 IF Y[3
SET BUDPRGEL=1
+15 GOTO EN1
+16 ;
PROC ;EP - called from taskman
+1 SET BUDJ=$JOB
SET BUDH=$HOROLOG
+2 SET ^XTMP("BUD8RP7B",0)=$$FMADD^XLFDT(DT,14)_"^"_DT_"^BUD TABLE 7 LISTS"
+3 ;NOW LOOP THROUGH PATIENT FILE for imms and paps
+4 SET DFN=0
FOR
SET DFN=$ORDER(^AUPNPAT(DFN))
IF DFN'=+DFN
QUIT
Begin DoDot:1
+5 ;Q:'$D(^DIBT(4485,1,DFN))
+6 ;Q:DFN'=122700
+7 KILL ^TMP($JOB)
+8 IF '$DATA(^AUPNPAT(DFN,0))
QUIT
+9 IF '$DATA(^DPT(DFN,0))
QUIT
+10 ;merged away
IF $PIECE(^DPT(DFN,0),U,19)
QUIT
+11 IF $PIECE(^DPT(DFN,0),U,1)["DEMO,PATIENT"
QUIT
+12 IF $PIECE(^DPT(DFN,0),U,1)["PATIENT,CRS"
QUIT
+13 SET C=$$COMMRES^AUPNPAT(DFN,"E")
+14 ;I C'="COWETA",C'="TULSA,URBAN" Q
+15 ;;I C'="BARTLESVILLE" Q
+16 SET BUDSEX=$PIECE(^DPT(DFN,0),U,2)
+17 SET BUDCOM=$$COMMRES^AUPNPAT(DFN,"E")
IF BUDCOM=""
SET BUDCOM="UNKNOWN"
+18 ;age at end of time period
SET BUDAGE=$$AGE^AUPNPAT(DFN,BUDED)
+19 ;age on june 30 for pregnancy
SET BUDAGEP=$$AGE^AUPNPAT(DFN,BUDCAD)
+20 ;get visits that meet criteria
DO GETV^BUD8RPTD
+21 ;user doesn't have any countable visits and is not considered a user
IF BUDT35V=0
QUIT
+22 IF $GET(BUDPRGHL)
DO PRGHLST^BUD8RP7A
+23 IF $GET(BUDPRGRL)
DO PRGRLST^BUD8RP7A
+24 IF $GET(BUDPRGEL)
DO PRGELST^BUD8RP7A
+25 DO HTN^BUD8RP7B
+26 DO DM^BUD8RP7C
End DoDot:1
+27 QUIT
+28 ;
PRINT ;EP - called from taskman
+1 DO PRINT^BUD8RP71
+2 QUIT
+3 ;
T7H ;
+1 WRITE !,$$CTR("TABLE 7 - HEALTH OUTCOMES AND DISPARITIES"),!,$$REPEAT^XLFSTR("_",79),!
+2 QUIT
LINE ;
+1 WRITE $$REPEAT^XLFSTR("_",79),?79,"|",!
+2 QUIT
LINE1 ;
+1 WRITE $$REPEAT^XLFSTR("_",29),?29,"|",$$REPEAT^XLFSTR("_",9),?39,"|",$$REPEAT^XLFSTR("_",9),?49,"|",$$REPEAT^XLFSTR("_",9),?59,"|",$$REPEAT^XLFSTR("_",9),?69,"|",$$REPEAT^XLFSTR("_",9),?79,"|",!
+2 QUIT
LINE2 ;
+1 WRITE $$REPEAT^XLFSTR("_",29),?29,"|",$$REPEAT^XLFSTR("_",39),?69,"|_________",?79,"|",!
+2 QUIT
+3 ;
LINE3 ;
+1 WRITE $$REPEAT^XLFSTR("_",29),?29,"|",$$REPEAT^XLFSTR("_",49),?79,"|",!
+2 QUIT
T7I ;
+1 WRITE !!,"TABLE 7: HEALTH OUTCOMES AND DISPARITIES"
+2 WRITE !,"This report will produce UDS Table 7, health outcomes indicators by race"
+3 WRITE !,"and ethnicity for deliveries and low birth weights, hypertension, and "
+4 WRITE !,"diabetes Glycemic control. Patients must meet additional criteria as"
+5 WRITE !,"specified for each indicator."
+6 WRITE !
+7 QUIT
GENI ;general introductions
+1 IF $DATA(IOF)
WRITE @(IOF)
+2 WRITE !!,$$CTR($$LOC,80),!,$$CTR("UDS 2008",80),!
+3 WRITE !,"UDS searches your database to find all patients reported for the quality"
+4 WRITE !,"of care indicators during the time period January 1, 2008 through"
+5 WRITE !,"December 31, 2008. Based on the UDS defintion, to be considered a"
+6 WRITE !,"patient, the patient must have had at least one visit meeting the"
+7 WRITE !,"following criteria:"
+8 WRITE !?4,"- must be to a location specified in your visit location setup"
+9 WRITE !?4,"- must be to Service Category Ambulatory (A), Hospitalization (H), Day"
+10 WRITE !?6,"Surgery (S), Observation (O), Nursing home visit (R), "
+11 WRITE !?6,"or In-Hospital (I) visit"
+12 WRITE !?4,"- must NOT have an excluded clinic code (see User Manual for a list)"
+13 WRITE !?4,"- must have a primary provider and a coded purpose of visit"
+14 WRITE !
+15 QUIT
+16 ;
PRENATT ;
+1 WRITE !!,"UDS does not calculate the deliveries and low birth weight indicators"
+2 WRITE !,"in Sections A and D. However, you can run a list of patients identified "
+3 WRITE !,"by UDS as pregnant to determine which of them received prenatal care at"
+4 WRITE !,"your facility to assist you with completing Table 7, Sections A and D."
+5 WRITE !,"The menu options you would select to run the patient list are: LST, LST3,"
+6 WRITE !,"PRGR (list by race) and PRGE (list by ethnicity)."
+7 WRITE !
+8 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