Skip to content

Commit

Permalink
added age grouping to clinical conditions
Browse files Browse the repository at this point in the history
  • Loading branch information
viv3ckj committed Sep 26, 2024
1 parent 23cc8e9 commit 20e5797
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 0 deletions.
10 changes: 10 additions & 0 deletions analysis/measures_definition_pf_codes_conditions.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,3 +96,13 @@
denominator=denominator,
intervals=months(monthly_intervals).starting_on(start_date),
)

measures.define_measure(
name=f"count_{condition_name}_by_age",
numerator=numerator,
denominator=denominator,
group_by={
"age_band": age_band,
},
intervals=months(monthly_intervals).starting_on(start_date),
)
25 changes: 25 additions & 0 deletions reports/pharmacy_first_report.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,17 @@ pf_clinical_condition_dict <- c(
"count_uncomplicated_urinary_tract_infection" = "UTI"
)
# Define the custom labels for clinical conditions by age
pf_clinical_condition_dict_by_age <- c(
"count_acute_otitis_media_by_age" = "Acute Otitis Media",
"count_herpes_zoster_by_age" = "Herpes Zoster",
"count_acute_sinusitis_by_age" = "Acute Sinusitis",
"count_impetigo_by_age" = "Impetigo",
"count_infected_insect_bite_by_age" = "Infected Insect Bite",
"count_acute_pharyngitis_by_age" = "Acute Pharyngitis",
"count_uncomplicated_urinary_tract_infection_by_age" = "UTI"
)
# Define the custom labels for clinical services
pf_clinical_service_dict <- c(
"count_blood_pressure_service" = "Blood Pressure Service",
Expand Down Expand Up @@ -114,3 +125,17 @@ plot_measures(df_measures,
y_label = "Number of codes for consultations",
)
```

### Clinical Conditions by Age

```{r, message=FALSE, warning=FALSE}
plot_measures(df_measures,
title = "Number of consultations for each clinical condition by age per month",
measure_names = names(pf_clinical_condition_dict_by_age),
custom_labels = pf_clinical_condition_dict_by_age,
y_label = "Number of codes for consultations",
facet_var = "age_band",
rotate_x_labels = TRUE
)
```

0 comments on commit 20e5797

Please sign in to comment.