generated from opensafely/research-template
/
project.yaml
108 lines (97 loc) · 3.48 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
version: "3.0"
expectations:
population_size: 5000
actions:
# Other data
# ----------
# Add actions for other data to this section. Prefix them with a suitable name; place
# scripts in a similarly named sub-directory of the analysis directory; write outputs
# to a similarly named sub-directory of the output directory.
#
# For example, let's call our other data "metrics". We would prefix our actions
# "metrics_"; we would place our scripts in analysis/metrics; we would write outputs
# to output/metrics.
# Metrics data
# ------------
metrics_generate_study_dataset_winter:
run: cohortextractor:latest generate_cohort --study-definition study_definition
--index-date-range '2021-12-01 to 2022-03-30 by month' --output-dir=output/metrics
--output-format=feather
outputs:
highly_sensitive:
extract: output/metrics/input_*.feather
metrics_generate_study_dataset_summer:
run: cohortextractor:latest generate_cohort --study-definition study_definition
--index-date-range '2021-06-01 to 2021-09-30 by month' --output-dir=output/metrics
--output-format=feather
outputs:
highly_sensitive:
extract: output/metrics/input*.feather
metrics_generate_measures:
run: cohortextractor:latest generate_measures --study-definition study_definition
--output-dir=output/metrics
needs:
- metrics_generate_study_dataset_summer
- metrics_generate_study_dataset_winter
outputs:
highly_sensitive:
measure_csv: output/metrics/measure_*_rate.csv
# Appointments data
# -----------------
appointments_generate_dataset_sql:
run: >
sqlrunner:latest
analysis/appointments/dataset_query.sql
--output output/appointments/dataset_long.csv.gz
--dummy-data-file analysis/appointments/dummy_dataset_long.csv.gz
outputs:
highly_sensitive:
dataset: output/appointments/dataset_long.csv.gz
# appointments_generate_dataset:
# run: >
# databuilder:v0
# generate-dataset
# analysis/appointments/dataset_definition.py
# --output output/appointments/dataset_wide.arrow
# outputs:
# highly_sensitive:
# dataset: output/appointments/dataset_wide.arrow
# appointments_get_freq_na_values:
# run: >
# python:latest
# python
# -m analysis.appointments.get_freq_na_values
# needs: [appointments_generate_dataset]
# outputs:
# moderately_sensitive:
# dataset: output/appointments/freq_na_values.csv
# appointments_reshape_dataset:
# run: >
# python:latest
# python
# -m analysis.appointments.reshape_dataset
# needs: [appointments_generate_dataset]
# outputs:
# highly_sensitive:
# dataset: output/appointments/dataset_long.arrow
appointments_generate_measure:
run: >
python:latest
python
-m analysis.appointments.generate_measure
needs: [appointments_generate_dataset_sql]
outputs:
moderately_sensitive:
measure: output/appointments/measure_median_lead_time_in_days.csv
appointments_generate_deciles_charts:
run: >
deciles-charts:v0.0.33
--input-files output/appointments/measure_*.csv
--output-dir output/appointments
config:
show_outer_percentiles: true
needs: [appointments_generate_measure]
outputs:
moderately_sensitive:
deciles_charts: output/appointments/deciles_chart_*.png
deciles_tables: output/appointments/deciles_table_*.csv