Skip to content

Commit

Permalink
Update colours, grapha and code to work with new released output
Browse files Browse the repository at this point in the history
  • Loading branch information
viv3ckj committed Oct 18, 2024
1 parent d360dc2 commit 2064d96
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 21 deletions.
2 changes: 1 addition & 1 deletion lib/functions/function_plot_measures.R
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ plot_measures <- function(
scale_colour_manual(values = c(
"navy", "red", "#3cb44b", "#ff00ff",
"#f58231",
"#dcdc00", "#911eb4", "#469990", "#8000009d", "grey50"
"#dcdc00", "#911eb4", "#469990", "#8000009d", "grey"
), na.value = "grey50")

# Automatically change y scale depending selected value
Expand Down
39 changes: 19 additions & 20 deletions reports/pharmacy_first_report.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ if (Sys.getenv("OPENSAFELY_BACKEND") != "") {
pf_measures_name_dict <- list(
consultation_service = "Consultation Service",
pharmacy_first_service = "Pharmacy First Service",
# combined_service = "Pharmacy First Services",
combined_pf_service = "Pharmacy First Services",
acute_otitis_media = "Acute Otitis Media",
herpes_zoster = "Herpes Zoster",
acute_sinusitis = "Acute Sinusitis",
Expand All @@ -49,7 +49,7 @@ pf_measures_name_dict <- list(
pf_measures_name_mapping <- list(
consultation_service = "clinical_service",
pharmacy_first_service = "clinical_service",
# combined_pf_service = "pharmacy_first_services",
combined_pf_service = "pharmacy_first_services",
acute_otitis_media = "clinical_condition",
herpes_zoster = "clinical_condition",
acute_sinusitis = "clinical_condition",
Expand Down Expand Up @@ -148,8 +148,8 @@ plot_measures(
select_interval_date = interval_end,
colour_var = NULL,
guide_nrow = 1,
facet_wrap = FALSE,
facet_var = NULL,
facet_wrap = TRUE,
facet_var = measure,
title = "Number of consultations for each clinical service per month",
y_label = "Number of codes for consultations",
)
Expand All @@ -160,7 +160,7 @@ plot_measures(
```{r, message=FALSE, warning=FALSE, fig.height=8, fig.width=8}
# Select measures and breakdown
df_measures_selected <- df_measures %>%
filter(measure_desc == "clinical_service") %>%
filter(measure_desc == "pharmacy_first_services") %>%
filter(group_by == "Age band")
# Create visualisation
Expand All @@ -174,7 +174,7 @@ plot_measures(
facet_var = measure,
title = "Number of consultations for each clinical service by age band per month",
y_label = "Number of codes for consultations",
) + scale_color_manual(values = c("#FFCCCC", "#fa7070", "#fc0e0e", "#9c0000", "#4c0000", "grey"))
) + scale_color_manual(values = c("#001F4D", "#0056B3", "#007BFF", "#66B3E2", "#A4D8E1", "grey"))
```

Expand All @@ -183,7 +183,7 @@ plot_measures(
```{r, message=FALSE, warning=FALSE, fig.height=8, fig.width=8}
# Select measures and breakdown
df_measures_selected <- df_measures %>%
filter(measure_desc == "clinical_service") %>%
filter(measure_desc == "pharmacy_first_services") %>%
filter(group_by == "Sex")
# Create visualisation
Expand All @@ -197,15 +197,15 @@ plot_measures(
facet_var = measure,
title = "Number of consultations for each clinical service by sex per month",
y_label = "Number of codes for consultations",
)
) + scale_color_manual(values = c("red", "blue"))
```

### Breakdown by IMD

```{r, message=FALSE, warning=FALSE, fig.height=8, fig.width=8}
# Select measures and breakdown
df_measures_selected <- df_measures %>%
filter(measure_desc == "clinical_service") %>%
filter(measure_desc == "pharmacy_first_services") %>%
filter(group_by == "IMD")
# Create visualisation
Expand All @@ -227,7 +227,7 @@ plot_measures(
```{r, message=FALSE, warning=FALSE, fig.height=8, fig.width=8}
# Select measures and breakdown
df_measures_selected <- df_measures %>%
filter(measure_desc == "clinical_service") %>%
filter(measure_desc == "pharmacy_first_services") %>%
filter(group_by == "Region")
# Create visualisation
Expand All @@ -241,15 +241,15 @@ plot_measures(
facet_var = measure,
title = "Number of consultations for each clinical service by region per month",
y_label = "Number of codes for consultations",
)
) + scale_color_manual(values = c("red", "navy", "#018701", "#ffa600ca", "purple", "brown", "#f4a5b2", "cyan", "green", "grey"))
```

### Clinical Services by ethnicity

```{r, message=FALSE, warning=FALSE}
# Select measures and breakdown
df_measures_selected <- df_measures %>%
filter(measure_desc == "clinical_service") %>%
filter(measure_desc == "pharmacy_first_services") %>%
filter(group_by == "Ethnicity")
# Create visualisation
Expand All @@ -263,7 +263,7 @@ plot_measures(
facet_var = measure,
title = "Number of consultations for each clinical service by ethnicity per month",
y_label = "Number of codes for consultations",
)
) + scale_color_manual(values = c("#42db0188", "#0056B3", "#ff0000c2", "#a52a2a5a", "purple", "grey"))
```

## Clinical Condition
Expand All @@ -285,8 +285,8 @@ plot_measures(
select_value = numerator,
select_interval_date = interval_end,
guide_nrow = 1,
facet_wrap = FALSE,
facet_var = NULL,
facet_wrap = TRUE,
facet_var = measure,
title = "Number of consultations for each clinical condition per month",
y_label = "Number of codes for consultations",
)
Expand All @@ -311,8 +311,7 @@ plot_measures(
facet_var = measure,
title = "Number of consultations for each clinical condition by age band per month",
y_label = "Number of codes for consultations",
) + scale_color_manual(values = c("#FFCCCC", "#fa7070", "#fc0e0e", "#9c0000", "#4c0000", "grey"))
) + scale_color_manual(values = c("#001F4D", "#0056B3", "#007BFF", "#66B3E2", "#A4D8E1", "grey"))
```

### Breakdown by sex
Expand All @@ -334,7 +333,7 @@ plot_measures(
facet_var = measure,
title = "Number of consultations for each clinical condition by sex per month",
y_label = "Number of codes for consultations",
)
) + scale_color_manual(values = c("red", "blue"))
```

### Breakdown by IMD
Expand Down Expand Up @@ -378,7 +377,7 @@ plot_measures(
facet_var = measure,
title = "Number of consultations for each clinical condition by region per month",
y_label = "Number of codes for consultations",
)
) + scale_color_manual(values = c("red", "navy", "#018701", "#ffa600ca", "purple", "brown", "#f4a5b2", "cyan", "green", "grey"))
```

### Clinical Conditions by ethnicity
Expand All @@ -400,5 +399,5 @@ plot_measures(
facet_var = measure,
title = "Number of consultations for each clinical condition by ethnicity per month",
y_label = "Number of codes for consultations",
)
) + scale_color_manual(values = c("#42db0188", "#0056B3", "#ff0000c2", "#a52a2a5a", "purple", "grey"))
```

0 comments on commit 2064d96

Please sign in to comment.