BUDERP7 ;IHS/CMI/LAB - UDS REPORT DRIVER TABLE 7;
;;12.0;IHS/RPMS UNIFORM DATA SYSTEM;;NOV 22, 2017;Build 75
;
;
T7 ;
D EOJ
EN ;
S BUDNOLI=1
D GENI
D T7I
D PAUSE
D PRENATT
D PAUSE
;
EN1 ;
EN2 ;
S BUDSITE=""
S DIC="^BUDESITE(",DIC(0)="AEMQ",DIC("A")="Enter your site: " D ^DIC
I Y=-1 D EOJ Q
S BUDSITE=+Y
I '$O(^BUDESITE(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^BUDEXTCH
S BUDYEAR=""
D YEAR
I BUDYEAR="" D EOJ Q
W !!,"Your report will be run for the time period: ",$$FMTE^XLFDT(BUDBD)," to ",$$FMTE^XLFDT(BUDED)
;get indian or not
S BUDBEN=""
S DIR(0)="S^1:Indian/Alaskan Native (Classification 01);2:Not Indian Alaskan/Native (Not Classification 01);3:All (both Indian/Alaskan Natives and Non 01)",DIR("A")="Select Beneficiary Population to include in this report"
S DIR("B")="1" KILL DA D ^DIR KILL DIR
I $D(DIRUT) W !!,"Classification not entered." D EOJ Q
S BUDBEN=Y
I $G(BUDNOLI) S BUDROT="P",BUDDELT="" G ZIS
D PT^BUDERPTE
I BUDROT="" G EN1
ZIS ;call to XBDBQUE
K IOP,%ZIS I BUDROT="D",BUDDELT="F" D NODEV,EOJ Q
W !! S %ZIS=$S(BUDDELT'="S":"PQM",1:"PM") D ^%ZIS
ZIS1 ;
I POP W !,"Report Aborted" D EOJ Q
I $D(IO("Q")) G TSKMN
DRIVER ;
D PROC
U IO
D PRINT
D ^%ZISC
D EOJ
Q
NODEV ;
S XBRP="",XBRC="NODEV1^BUDERP7",XBRX="EOJ^BUDERP7",XBNS="BUD"
D ^XBDBQUE
Q
NODEV1 ;
D PROC^BUDERP7
D PRINT^BUDERP7
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^BUDERP7",ZTDTH="",ZTDESC="UDS 17 REPORT TABLE 7" D ^%ZTLOAD D EOJ Q
Q
EOJ ;
D EN^XBVK("BUD")
Q
PRGHLIST ;EP
D EOJ
S BUDPRGHL=1
D PRGH^BUDERP7I
G EN1
;
PRGRLIST ;EP
D EOJ
S BUDPRGRL=1
D PRGR^BUDERP7I
G EN1
;
HTRLIST ;EP
D EOJ
S BUDHTRL=1
D HTR^BUDERP7J
G EN1
;
HTCRLIST ;EP
D EOJ
S BUDHTCRL=1
D HTCR^BUDERP7J
G EN1
;
HTURLIST ;EP
D EOJ
S BUDHTURL=1
D HTUR^BUDERP7U
G EN1
;
;
MHT ;EP
D EOJ
D GENI^BUDERP7I
S (BUDHTRL,BUDHTCRL,BUDHTURL,BUDHTEL,BUDHTCEL,BUDHTUEL)=0
W !!,"UDS Table 7 Hypertension Patient List Selection"
W !!?5,"1 All HTN Patients by Race and Hispanic or Latino Identity"
W !?5,"2 All HTN Pts w/Controlled BP by Race and Hispanic or Latino Identity"
W !?5,"3 All HTN Pts w/Uncontrolled BP by Race and Hispanic or Latino Identity"
W !?5,"4 ALL Lists for HTN Patients"
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 (BUDHTRL,BUDHTCRL,BUDHTURL)=1
I Y[1 S BUDHTRL=1
I Y[2 S BUDHTCRL=1
I Y[3 S BUDHTURL=1
G EN1
LIST ;
DMRLIST ;EP
D EOJ
S BUDDMRL=1
D DMR^BUDERP7L
G EN1
;
DMR1LIST ;EP
D EOJ
S BUDDMR1L=1
D DMR1^BUDERP7L
G EN1
;
DMR2LIST ;EP
D EOJ
S BUDDMR2L=1
D DMR2^BUDERP7T
G EN1
;
;
MDM ;EP
D EOJ
D GENI^BUDERP7I
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 and Hispanic or Latino Identity"
W !?5,"2 All Patients w/DM and A1c <8 by Race and Hispanic or Latino Identity"
W !?5,"3 All Patients w/DM and A1c >9 or No Test by Race and Hispanic or Latino Identity"
W !?5,"4 ALL Lists for DM Patients"
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 (BUDDMRL,BUDDMR1L,BUDDMR2L)=1
I Y[1 S BUDDMRL=1
I Y[2 S BUDDMR1L=1
I Y[3 S BUDDMR2L=1
G EN1
MPRG ;EP - called from option
D EOJ
D GENI^BUDERP7I
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 Lists"
S DIR(0)="L^1:3",DIR("A")="Include which Tables",DIR("B")=1 KILL DA D ^DIR KILL DIR
I $D(DIRUT) D EOJ Q
I Y[3 S (BUDPRGHL,BUDPRGRL)=1
I Y[1 S BUDPRGHL=1
I Y[2 S BUDPRGRL=1
G EN1
;
PROC ;EP - called from taskman
S BUDJ=$J,BUDH=$H
S ^XTMP("BUDERP7B",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
.K ^TMP($J)
.Q:'$D(^AUPNPAT(DFN,0))
.Q:'$D(^DPT(DFN,0))
.Q:$P(^DPT(DFN,0),U,19) ;merged away
.Q:$$DEMO^BUDEDU(DFN,"E")
.;I DUZ=2881,$$HRN^AUPNPAT(DFN,DUZ(2))'=142692 Q
LORIN .;DO NOT COUNT BASED ON CLASSIFICATION IN V6.0
.I BUDBEN=1,$$BEN^AUPNPAT(DFN,"C")'="01" Q ;must be Indian/Alaskan Native
.I BUDBEN=2,$$BEN^AUPNPAT(DFN,"C")="01" Q ;must not be I/A
.S BUDSEX=$P(^DPT(DFN,0),U,2)
.I BUDSEX'="F",BUDSEX'="M" Q ;valid gender
.S BUDCCOM=$$COMMRES^AUPNPAT(DFN,"E") I BUDCCOM="" S BUDCCOM="UNKNOWN"
.S BUDAGE=$$AGE^AUPNPAT(DFN,BUDED) ;age at end of time period
.S BUDAGEP=$$AGE^AUPNPAT(DFN,BUDCCAD) ;age on june 30 for pregnancy
.D GETV^BUDERPTD ;get visits that meet criteria
.I BUDUDSPT=0 Q ;user doesn't have any countable visits and is not considered a user
.D PRGHLST^BUDERP7A
.D PRGRLST^BUDERP7A
.D HTN^BUDERP7B
.D DM^BUDERP7C
Q
;
PRINT ;EP - called from taskman
D PRINT^BUDERP71
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 ;EP
W !!,"TABLE 7: HEALTH OUTCOMES AND DISPARITIES"
W !,"This report will produce UDS Table 7, health outcomes indicators by race"
W !,"and Hispanic/Latino identity for deliveries and birth weights, controlled"
W !,"hypertension, and controlled diabetes Glycemic control. Patients must meet "
W !,"additional criteria as specified for each indicator."
W !
Q
GENI ;general introductions
W:$D(IOF) @(IOF)
W !!,$$CTR($$LOC,80),!,$$CTR("UDS 2017",80),!
W !,"UDS searches your database to find all patients reported for the quality"
W !,"of care indicators during the time period January 1 - December 31, 2017."
W !,"Based on the UDS definition, to be considered a patient, the patient must"
W !,"have had at least one visit meeting the 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), Telemedicine (M), 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 !?4,"- the patient must NOT have a gender of 'Unknown'"
W !
Q
;
PRENATT ;EP
W !!,"UDS does not calculate the deliveries and birth weight indicators"
W !,"in Section A. 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 or were referred elsewhere by your facility for prenatal"
W !,"and perinatal services to assist you with completing Table 7, Section A."
W !,"The menu options you would select to run the patient list are: LST, LST3,"
W !,"PRG, PRGR (list by race and Hispanic or Latino identity)."
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 ;EP
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
YEAR ;
S BUDYEAR=""
W !
W !,"Enter the Calendar Year. Use a 4 digit year, e.g. 2017"
S DIR(0)="D^::EP"
S DIR("A")="Enter Calendar Year"
S DIR("?")="This report is compiled for a period. Enter a valid date."
D ^DIR KILL DIR
K DIC
I $D(DUOUT) S DIRUT=1 Q
I $D(DIRUT) Q
I $E(Y,4,7)'="0000" W !!,"Please enter a year only!",! G YEAR
S BUDYEAR=Y,BUDBD=$E(BUDYEAR,1,3)_"0101",BUDED=$E(BUDYEAR,1,3)_"1231"
S BUDCCAD=$E(BUDYEAR,1,3)_"0630"
Q
BUDERP7 ;IHS/CMI/LAB - UDS REPORT DRIVER TABLE 7;
+1 ;;12.0;IHS/RPMS UNIFORM DATA SYSTEM;;NOV 22, 2017;Build 75
+2 ;
+3 ;
T7 ;
+1 DO EOJ
EN ;
+1 SET BUDNOLI=1
+2 DO GENI
+3 DO T7I
+4 DO PAUSE
+5 DO PRENATT
+6 DO PAUSE
+7 ;
EN1 ;
EN2 ;
+1 SET BUDSITE=""
+2 SET DIC="^BUDESITE("
SET DIC(0)="AEMQ"
SET DIC("A")="Enter your site: "
DO ^DIC
+3 IF Y=-1
DO EOJ
QUIT
+4 SET BUDSITE=+Y
+5 IF '$ORDER(^BUDESITE(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^BUDEXTCH
+7 SET BUDYEAR=""
+8 DO YEAR
+9 IF BUDYEAR=""
DO EOJ
QUIT
+10 WRITE !!,"Your report will be run for the time period: ",$$FMTE^XLFDT(BUDBD)," to ",$$FMTE^XLFDT(BUDED)
+11 ;get indian or not
+12 SET BUDBEN=""
+13 SET DIR(0)="S^1:Indian/Alaskan Native (Classification 01);2:Not Indian Alaskan/Native (Not Classification 01);3:All (both Indian/Alaskan Natives and Non 01)"
SET DIR("A")="Select Beneficiary Population to include in this report"
+14 SET DIR("B")="1"
KILL DA
DO ^DIR
KILL DIR
+15 IF $DATA(DIRUT)
WRITE !!,"Classification not entered."
DO EOJ
QUIT
+16 SET BUDBEN=Y
+17 IF $GET(BUDNOLI)
SET BUDROT="P"
SET BUDDELT=""
GOTO ZIS
+18 DO PT^BUDERPTE
+19 IF BUDROT=""
GOTO EN1
ZIS ;call to XBDBQUE
+1 KILL IOP,%ZIS
IF BUDROT="D"
IF BUDDELT="F"
DO NODEV
DO EOJ
QUIT
+2 WRITE !!
SET %ZIS=$SELECT(BUDDELT'="S":"PQM",1:"PM")
DO ^%ZIS
ZIS1 ;
+1 IF POP
WRITE !,"Report Aborted"
DO EOJ
QUIT
+2 IF $DATA(IO("Q"))
GOTO TSKMN
DRIVER ;
+1 DO PROC
+2 USE IO
+3 DO PRINT
+4 DO ^%ZISC
+5 DO EOJ
+6 QUIT
NODEV ;
+1 SET XBRP=""
SET XBRC="NODEV1^BUDERP7"
SET XBRX="EOJ^BUDERP7"
SET XBNS="BUD"
+2 DO ^XBDBQUE
+3 QUIT
NODEV1 ;
+1 DO PROC^BUDERP7
+2 DO PRINT^BUDERP7
+3 DO ^%ZISC
+4 DO EOJ
+5 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^BUDERP7"
SET ZTDTH=""
SET ZTDESC="UDS 17 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^BUDERP7I
+4 GOTO EN1
+5 ;
PRGRLIST ;EP
+1 DO EOJ
+2 SET BUDPRGRL=1
+3 DO PRGR^BUDERP7I
+4 GOTO EN1
+5 ;
HTRLIST ;EP
+1 DO EOJ
+2 SET BUDHTRL=1
+3 DO HTR^BUDERP7J
+4 GOTO EN1
+5 ;
HTCRLIST ;EP
+1 DO EOJ
+2 SET BUDHTCRL=1
+3 DO HTCR^BUDERP7J
+4 GOTO EN1
+5 ;
HTURLIST ;EP
+1 DO EOJ
+2 SET BUDHTURL=1
+3 DO HTUR^BUDERP7U
+4 GOTO EN1
+5 ;
+6 ;
MHT ;EP
+1 DO EOJ
+2 DO GENI^BUDERP7I
+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 and Hispanic or Latino Identity"
+6 WRITE !?5,"2 All HTN Pts w/Controlled BP by Race and Hispanic or Latino Identity"
+7 WRITE !?5,"3 All HTN Pts w/Uncontrolled BP by Race and Hispanic or Latino Identity"
+8 WRITE !?5,"4 ALL Lists for HTN Patients"
+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 (BUDHTRL,BUDHTCRL,BUDHTURL)=1
+12 IF Y[1
SET BUDHTRL=1
+13 IF Y[2
SET BUDHTCRL=1
+14 IF Y[3
SET BUDHTURL=1
+15 GOTO EN1
LIST ;
DMRLIST ;EP
+1 DO EOJ
+2 SET BUDDMRL=1
+3 DO DMR^BUDERP7L
+4 GOTO EN1
+5 ;
DMR1LIST ;EP
+1 DO EOJ
+2 SET BUDDMR1L=1
+3 DO DMR1^BUDERP7L
+4 GOTO EN1
+5 ;
DMR2LIST ;EP
+1 DO EOJ
+2 SET BUDDMR2L=1
+3 DO DMR2^BUDERP7T
+4 GOTO EN1
+5 ;
+6 ;
MDM ;EP
+1 DO EOJ
+2 DO GENI^BUDERP7I
+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 and Hispanic or Latino Identity"
+6 WRITE !?5,"2 All Patients w/DM and A1c <8 by Race and Hispanic or Latino Identity"
+7 WRITE !?5,"3 All Patients w/DM and A1c >9 or No Test by Race and Hispanic or Latino Identity"
+8 WRITE !?5,"4 ALL Lists for DM Patients"
+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 (BUDDMRL,BUDDMR1L,BUDDMR2L)=1
+12 IF Y[1
SET BUDDMRL=1
+13 IF Y[2
SET BUDDMR1L=1
+14 IF Y[3
SET BUDDMR2L=1
+15 GOTO EN1
MPRG ;EP - called from option
+1 DO EOJ
+2 DO GENI^BUDERP7I
+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 Lists"
+8 SET DIR(0)="L^1:3"
SET DIR("A")="Include which Tables"
SET DIR("B")=1
KILL DA
DO ^DIR
KILL DIR
+9 IF $DATA(DIRUT)
DO EOJ
QUIT
+10 IF Y[3
SET (BUDPRGHL,BUDPRGRL)=1
+11 IF Y[1
SET BUDPRGHL=1
+12 IF Y[2
SET BUDPRGRL=1
+13 GOTO EN1
+14 ;
PROC ;EP - called from taskman
+1 SET BUDJ=$JOB
SET BUDH=$HOROLOG
+2 SET ^XTMP("BUDERP7B",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 KILL ^TMP($JOB)
+6 IF '$DATA(^AUPNPAT(DFN,0))
QUIT
+7 IF '$DATA(^DPT(DFN,0))
QUIT
+8 ;merged away
IF $PIECE(^DPT(DFN,0),U,19)
QUIT
+9 IF $$DEMO^BUDEDU(DFN,"E")
QUIT
+10 ;I DUZ=2881,$$HRN^AUPNPAT(DFN,DUZ(2))'=142692 Q
LORIN ;DO NOT COUNT BASED ON CLASSIFICATION IN V6.0
+1 ;must be Indian/Alaskan Native
IF BUDBEN=1
IF $$BEN^AUPNPAT(DFN,"C")'="01"
QUIT
+2 ;must not be I/A
IF BUDBEN=2
IF $$BEN^AUPNPAT(DFN,"C")="01"
QUIT
+3 SET BUDSEX=$PIECE(^DPT(DFN,0),U,2)
+4 ;valid gender
IF BUDSEX'="F"
IF BUDSEX'="M"
QUIT
+5 SET BUDCCOM=$$COMMRES^AUPNPAT(DFN,"E")
IF BUDCCOM=""
SET BUDCCOM="UNKNOWN"
+6 ;age at end of time period
SET BUDAGE=$$AGE^AUPNPAT(DFN,BUDED)
+7 ;age on june 30 for pregnancy
SET BUDAGEP=$$AGE^AUPNPAT(DFN,BUDCCAD)
+8 ;get visits that meet criteria
DO GETV^BUDERPTD
+9 ;user doesn't have any countable visits and is not considered a user
IF BUDUDSPT=0
QUIT
+10 DO PRGHLST^BUDERP7A
+11 DO PRGRLST^BUDERP7A
+12 DO HTN^BUDERP7B
+13 DO DM^BUDERP7C
End DoDot:1
+14 QUIT
+15 ;
PRINT ;EP - called from taskman
+1 DO PRINT^BUDERP71
+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 ;EP
+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 Hispanic/Latino identity for deliveries and birth weights, controlled"
+4 WRITE !,"hypertension, and controlled diabetes Glycemic control. Patients must meet "
+5 WRITE !,"additional criteria as specified for each indicator."
+6 WRITE !
+7 QUIT
GENI ;general introductions
+1 IF $DATA(IOF)
WRITE @(IOF)
+2 WRITE !!,$$CTR($$LOC,80),!,$$CTR("UDS 2017",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 - December 31, 2017."
+5 WRITE !,"Based on the UDS definition, to be considered a patient, the patient must"
+6 WRITE !,"have had at least one visit meeting the following criteria:"
+7 WRITE !?4,"- must be to a location specified in your visit location setup"
+8 WRITE !?4,"- must be to Service Category Ambulatory (A), Hospitalization (H), Day"
+9 WRITE !?6,"Surgery (S), Observation (O), Telemedicine (M), Nursing home visit (R), "
+10 WRITE !?6,"or In-Hospital (I) visit"
+11 WRITE !?4,"- must NOT have an excluded clinic code (see User Manual for a list)"
+12 WRITE !?4,"- must have a primary provider and a coded purpose of visit"
+13 WRITE !?4,"- the patient must NOT have a gender of 'Unknown'"
+14 WRITE !
+15 QUIT
+16 ;
PRENATT ;EP
+1 WRITE !!,"UDS does not calculate the deliveries and birth weight indicators"
+2 WRITE !,"in Section A. 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 or were referred elsewhere by your facility for prenatal"
+5 WRITE !,"and perinatal services to assist you with completing Table 7, Section A."
+6 WRITE !,"The menu options you would select to run the patient list are: LST, LST3,"
+7 WRITE !,"PRG, PRGR (list by race and Hispanic or Latino identity)."
+8 WRITE !
+9 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 ;EP
+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
YEAR ;
+1 SET BUDYEAR=""
+2 WRITE !
+3 WRITE !,"Enter the Calendar Year. Use a 4 digit year, e.g. 2017"
+4 SET DIR(0)="D^::EP"
+5 SET DIR("A")="Enter Calendar Year"
+6 SET DIR("?")="This report is compiled for a period. Enter a valid date."
+7 DO ^DIR
KILL DIR
+8 KILL DIC
+9 IF $DATA(DUOUT)
SET DIRUT=1
QUIT
+10 IF $DATA(DIRUT)
QUIT
+11 IF $EXTRACT(Y,4,7)'="0000"
WRITE !!,"Please enter a year only!",!
GOTO YEAR
+12 SET BUDYEAR=Y
SET BUDBD=$EXTRACT(BUDYEAR,1,3)_"0101"
SET BUDED=$EXTRACT(BUDYEAR,1,3)_"1231"
+13 SET BUDCCAD=$EXTRACT(BUDYEAR,1,3)_"0630"
+14 QUIT