generated from opensafely/research-template
/
project.yaml
151 lines (135 loc) · 5.43 KB
/
project.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
version: '3.0'
expectations:
population_size: 1000
actions:
generate_study_population_report_ethnicity:
run: cohortextractor:latest generate_cohort
--study-definition study_definition_ethnicity_report --output-dir output/report --output-format=csv.gz
outputs:
highly_sensitive:
cohort: output/report/input_ethnicity_report.csv.gz
### Curation check ###
curation_monthly:
run: cohortextractor:latest generate_cohort
--study-definition study_definition_report
--index-date-range "2019-01-01 to 2019-01-01 by month"
--param frequency=monthly
--output-dir=output/curation
--output-format=csv.gz
outputs:
highly_sensitive:
cohort: output/curation/input_report_2019-01-01.csv.gz
dataset_report_monthly:
run: python:latest python analysis/dataset_report.py
--input-files output/curation/input_report_2019-01-01.csv.gz
--output-dir output/curation/
--granularity "year"
needs: [curation_monthly]
outputs:
moderately_sensitive:
# Only output the single summary file
cohort_report: output/curation/input_report_2019-01-01.html
curation_weekly:
run: cohortextractor:latest generate_cohort
--study-definition study_definition_report
--index-date-range "2022-07-01 to 2022-07-01 by week"
--param frequency=weekly
--output-dir=output/curation
--output-format=csv.gz
outputs:
highly_sensitive:
cohort: output/curation/input_report_2022-07-01.csv.gz
dataset_report_weekly:
run: python:latest python analysis/dataset_report.py
--input-files output/curation/input_report_2022-07-01.csv.gz
--output-dir output/curation/
--granularity "day"
needs: [curation_weekly]
outputs:
moderately_sensitive:
# Only output the single summary file
cohort_report: output/curation/input_report_2022-07-01.html
### End curation check
generate_study_population_report_monthly:
run: cohortextractor:latest generate_cohort
--study-definition study_definition_report
--index-date-range "2019-01-01 to 2022-06-01 by month"
--param frequency=monthly
--output-dir=output/report
--output-format=csv.gz
outputs:
highly_sensitive:
cohort: output/report/input_*-01.csv.gz
generate_study_population_report_weekly:
run: cohortextractor:latest generate_cohort
--study-definition study_definition_report
--index-date-range "2022-07-01 to 2023-01-08 by week"
--param frequency=weekly
--output-dir=output/report
--output-format=csv.gz
outputs:
highly_sensitive:
cohort: output/report/input_*.csv.gz
join_cohorts_report:
run: >
cohort-joiner:v0.0.38
--lhs output/report/input_report_20*.csv.gz
--rhs output/report/input_ethnicity_report.csv.gz
--output-dir output/report/joined
needs: [generate_study_population_report_monthly, generate_study_population_report_weekly, generate_study_population_report_ethnicity]
outputs:
highly_sensitive:
cohort: output/report/joined/input_report_20*.csv.gz
generate_measures_report:
run: cohortextractor:latest generate_measures --study-definition study_definition_report --output-dir=output/report/joined
needs: [join_cohorts_report]
outputs:
moderately_sensitive:
measure_csv: output/report/joined/measure_event_*_rate.csv
join_measures:
run: python:latest python analysis/join_and_round.py
--input-files output/report/joined/measure_*_rate.csv
--output-dir output/report/joined
--output-name "measure_all.csv"
--skip-round
needs: [generate_measures_report]
outputs:
moderately_sensitive:
# Only output the single summary file
measure_csv: output/report/joined/measure_all.csv
top_5_table_report:
run: >
python:latest python analysis/report/top_5_report.py
--input-file output/report/joined/measure_all.csv
--output-dir output/report/joined
needs: [join_measures]
outputs:
moderately_sensitive:
tables: output/report/joined/top_5*.csv
plot_measure_report:
run: >
python:latest python analysis/report/plot_measures_report.py
--measure-path output/report/joined/measure_all.csv
--output-dir output/report/joined
needs: [join_measures]
outputs:
moderately_sensitive:
measure: output/report/joined/*measures*.jpeg
event_counts_report:
run: >
python:latest python analysis/report/event_counts.py --input-dir="output/report/joined" --output-dir="output/report" --measures="amoxicillin,azithromycin,clarithromycin,erythromycin,phenoxymethypenicillin"
needs: [join_cohorts_report]
outputs:
moderately_sensitive:
measure: output/report/event_counts_*.json
# create_notebook:
# run: python:latest python analysis/report/create_notebook.py
# outputs:
# moderately_sensitive:
# notebook: output/report/report.ipynb
# generate_notebook:
# run: jupyter:latest jupyter nbconvert /workspace/output/report/report.ipynb --execute --to html --output-dir=/workspace/output/report --ExecutePreprocessor.timeout=86400 --no-input
# needs: [create_notebook, event_counts_report, deciles_chart_report, top_5_table_report, plot_measure_report]
# outputs:
# moderately_sensitive:
# notebook: output/report/report.html