Skip to content

Commit

Permalink
Merge pull request #35 from opensafely/add-16-17s
Browse files Browse the repository at this point in the history
Add 16-17s and update report
  • Loading branch information
HelenCEBM authored Sep 7, 2021
2 parents ddc4edd + c63b522 commit 6fef31e
Show file tree
Hide file tree
Showing 67 changed files with 40,991 additions and 37,623 deletions.
44 changes: 20 additions & 24 deletions analysis/study_definition_delivery_common.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,6 @@
age <= 120
AND
age>=16
AND
(age >=18
OR
shielded
OR
LD)
""",
registered=patients.registered_as_of(
index_date,
Expand Down Expand Up @@ -73,7 +67,7 @@
"50-59": """ age >= 50 AND age < 60""",
"60-69": """ age >= 60 AND age < 70""",
"70-79": """ age >= 70 AND age < 80""",
"80+": """ age >= 80 AND age < 120""", # age eligibility currently set at 80
"80+": """ age >= 80 AND age < 120""",
},
return_expectations={
"rate": "universal",
Expand All @@ -96,7 +90,8 @@
{
"0" : "DEFAULT",
"0-15": """ age >= 0 AND age < 16 """,
"16-29": """ age >= 16 AND age < 30 """,
"16-17": """ age >= 16 AND age < 18 """,
"18-29": """ age >= 18 AND age < 30 """,
"30-34": """ age >= 30 AND age < 35 """,
"35-39": """ age >= 35 AND age < 40 """,
"40-44": """ age >= 40 AND age < 45 """,
Expand All @@ -115,22 +110,23 @@
"rate": "universal",
"category": {
"ratios": {
"0":0.0625,
"0-15": 0.0625,
"16-29": 0.0625,
"30-34": 0.0625,
"35-39": 0.0625,
"40-44": 0.0625,
"45-49": 0.0625,
"50-54": 0.0625,
"55-59": 0.0625,
"60-64": 0.0625,
"65-69": 0.0625,
"70-74": 0.0625,
"75-79": 0.0625,
"80-84": 0.0625,
"85-89": 0.0625,
"90+": 0.0625
"0":0.0125,
"0-15": 0.065,
"16-17": 0.065,
"18-29": 0.065,
"30-34": 0.065,
"35-39": 0.065,
"40-44": 0.065,
"45-49": 0.065,
"50-54": 0.065,
"55-59": 0.065,
"60-64": 0.065,
"65-69": 0.065,
"70-74": 0.065,
"75-79": 0.065,
"80-84": 0.065,
"85-89": 0.065,
"90+": 0.0125
}
},
},
Expand Down
5 changes: 3 additions & 2 deletions lib/data_processing.py
Original file line number Diff line number Diff line change
Expand Up @@ -151,8 +151,9 @@ def load_data(input_file='input_delivery.csv.gz', input_path="output"):
(df["age"]>=55),
(df["age"]>=50),
(df["age"]>=40),
(df["age"]>=30)]
choices = [3,1,2,4,5,6,7,8,9,10,11]
(df["age"]>=30),
(df["age"]>=18)]
choices = [3,1,2,4,5,6,7,8,9,10,11,12]
# note the numbers here denote the desired sort order in which we want to look at these groups, not the priority order

# create field "priority_group" which uses the appropriate value from `choices` according to the `conditions` met by each line of data. If none are met, assigns 0.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@
# <br>
# - **<a href=#tables>Current vaccination coverage of each eligible population group, according to demographic/clinical features</a>**
# - Includes each of the groups above, plus <a href=#Cumulative-vaccination-figures-among-care-home-population>care home (65+)</a> and <a href=#Cumulative-vaccination-figures-among-Learning-Disabilities-(aged-16-64)-population>LD (aged 16-64)</a> populations.
# - **NEW** - tables now include <a href=#Cumulative-vaccination-figures-among-30-39-population>30-39</a> and <a href=#Cumulative-vaccination-figures-among-18-29-population>18-29</a> populations
# - **NEW** - tables now include <a href=#Cumulative-vaccination-figures-among-16-17-population>16-17</a> population
# <br>
# <br>
# - Appendix: <a href=#ethnicity>Proportion of each population group for whom ethnicity is known</a>
Expand Down
6 changes: 5 additions & 1 deletion notebooks/diffable_python/population_characteristics.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,8 @@
"50-54": 9,
"40-49": 10,
"30-39": 11,
"18-29": 0
"18-29": 12,
"16-17": 0
# NB if the population denominator is not included for the final group (0), the key must contain phrase "not in other eligible groups" so that data is presented appropriately
}

Expand Down Expand Up @@ -115,6 +116,7 @@
"40-49": u50,
"30-39": u50,
"18-29": u50,
"16-17": ["sex", "ethnicity_6_groups", "imd_categories"],
"LD (aged 16-64)": ["sex", "ageband_5yr", "ethnicity_6_groups"],
"DEFAULT": DEFAULT # other age groups
}
Expand Down Expand Up @@ -240,9 +242,11 @@

second_dose_summarised_data_dict = summarise_data_by_group(df_dict_cum_second_dose, latest_date=latest_date, groups=groups)

# + collapsed=true jupyter={"outputs_hidden": true}
create_detailed_summary_uptake(second_dose_summarised_data_dict, formatted_latest_date,
groups=groups,
savepath=savepath, vaccine_type="second_dose")
# -

# ## For comparison look at first doses UP TO 14 WEEKS AGO
#
Expand Down
4 changes: 2 additions & 2 deletions notebooks/diffable_python/second_doses.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,14 +84,14 @@
tablelist = find_and_sort_filenames("tables", by_demographics_or_population="population",
pre_string="among ", tail_string=" population.csv",
population_subset="Cumulative first dose 14w ago",
files_to_exclude=["Cumulative first dose 14w ago vaccination figures among 16-64, not in other eligible groups shown population.csv"],
files_to_exclude=["Cumulative first dose 14w ago vaccination figures among 16-17 population.csv"],
)

# get 2nd dose figures for each group
tablelist_2nd = find_and_sort_filenames("tables", by_demographics_or_population="population",
pre_string="among ", tail_string=" population.csv",
population_subset="Cumulative second dose vaccination",
files_to_exclude=["Cumulative second dose vaccination figures among 16-64, not in other eligible groups shown population.cscv"],
files_to_exclude=["Cumulative second dose vaccination figures among 16-17 population.csv"],
)


Expand Down
9,662 changes: 5,119 additions & 4,543 deletions notebooks/opensafely_vaccine_report_overall.ipynb

Large diffs are not rendered by default.

32,619 changes: 17,314 additions & 15,305 deletions notebooks/population_characteristics.ipynb

Large diffs are not rendered by default.

Loading

0 comments on commit 6fef31e

Please sign in to comment.