Skip to content

Commit

Permalink
Use recipient title as per meeting result.
Browse files Browse the repository at this point in the history
Correct title date backing data.
  • Loading branch information
grosscol committed May 19, 2020
1 parent f41f466 commit 7aa57f6
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 8 deletions.
17 changes: 11 additions & 6 deletions main.R
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,10 @@ REPORT_PAL <- c(medicaid=DL_GREEN,
PPTL=DL_LIGHT_BLUE,
Other=DL_GRAY)

ASCRIBEE_TITLES <- c(UMich="Michgan Medicine",
Hurely="Hurley Medical Center",
Munson="Munson Healthcare")

MEASURE_NAMES <- tibble( measure = c("M1", "M2", "M3", "M4", "M5",
"M6", "M7", "M8", "M9", "M10",
"M11", "M12", "M13", "M14", "M15",
Expand Down Expand Up @@ -146,22 +150,23 @@ line_plot <- function(maptg_data, measure_id){
numerator = sum(numerator, na.rm=TRUE),
denominator = sum(denominator, na.rm=TRUE),
rate = numerator/denominator,
ascribee = "MICCA")
ascribee = "MICCA Average")

recipient_title <- ASCRIBEE_TITLES[RECIP]
plot_data <- maptg_data %>%
filter(measure == measure_id, ascribee == RECIP) %>%
mutate(ascribee = ASCRIBEE_TITLES[ascribee]) %>%
bind_rows(micca_data) %>%
group_by(ascribee, time) %>%
summarize(
numerator = sum(numerator, na.rm=TRUE),
denominator = sum(denominator, na.rm=TRUE),
rate = numerator/denominator) %>%
mutate(
recipient = ifelse(ascribee == RECIP, T, F),
recipient = ifelse(ascribee == recipient_title, T, F),
perf_label = ifelse(recipient, paste(numerator, denominator, sep="/"), NA),
arrow = ifelse(recipient, "show", "noshow"),
pcolor = ifelse(recipient, DL_DARK_BLUE, DL_GRAY)
)
pcolor = ifelse(recipient, DL_DARK_BLUE, DL_GRAY))

# y axis labels
breaks_y <- c(0.20, 0.4, 0.6, 0.8, 1.0)
Expand Down Expand Up @@ -195,8 +200,8 @@ maptg_data <- full_maptg_data %>% filter( time >= START_DATE, time < END_DATE)
OBS_END_DATE <- maptg_data$time %>% max

START_MONTH <- format(START_DATE, "%b")
END_MONTH <- format(END_DATE, "%b")
END_YEAR <- format(END_DATE, "%Y")
END_MONTH <- format(OBS_END_DATE, "%b")
END_YEAR <- format(OBS_END_DATE, "%Y")

# Set recipient of report
RECIP <- "UMich"
Expand Down
2 changes: 0 additions & 2 deletions umich_ingest.R
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@ library(stringr)
library(zoo)

read_umich_data <- function(filename){

# Ingest hurley data
col_classes <- cols_only(col_character(), col_date(), col_character(),
col_character(),col_character(),col_character(),
col_character(),col_character(),col_character(),
Expand Down

0 comments on commit 7aa57f6

Please sign in to comment.