Skip to content

Commit

Permalink
Merge pull request #3 from opensafely/covid-vaccine-counts
Browse files Browse the repository at this point in the history
add script to report frequency of covid-19 vaccine product names
  • Loading branch information
wjchulme authored Feb 7, 2023
2 parents c26ebda + aa685b2 commit ddb68d8
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 0 deletions.
1 change: 1 addition & 0 deletions analysis/dummy_vaccination_name_frequency.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
VaccinationName_ID,VaccinationName,Frequency
14 changes: 14 additions & 0 deletions analysis/extract_covid_vaccination_name_frequency.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
SELECT
VaccinationName_ID,
VaccinationName,
CEILING(COUNT(VaccinationName) / 100.0) * 100 AS Frequency
FROM Vaccination
WHERE
VaccinationName_ID IN (
SELECT VaccinationName_ID
FROM
VaccinationReference
WHERE VaccinationContent = 'SARS-2 Coronavirus'
)
GROUP BY VaccinationName_ID, VaccinationName
ORDER BY Frequency DESC;
11 changes: 11 additions & 0 deletions project.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ actions:
run: >
sqlrunner:latest
--output output/vaccination_names.csv
--dummy-data-file analysis/dummy.csv
analysis/extract_vaccination_names.sql
outputs:
moderately_sensitive:
Expand All @@ -26,3 +27,13 @@ actions:
outputs:
moderately_sensitive:
html: output/vaccination_names.html

extract_covid_vaccination_name_frequency:
run: >
sqlrunner:latest
--output output/covid_vaccination_name_frequency.csv
--dummy-data-file analysis/dummy_vaccination_name_frequency.csv
analysis/extract_covid_vaccination_name_frequency.sql
outputs:
moderately_sensitive:
rows: output/covid_vaccination_name_frequency.csv

0 comments on commit ddb68d8

Please sign in to comment.