Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace cohortextractor with ehrql #110

Merged
merged 1 commit into from
Nov 7, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 0 additions & 5 deletions analysis/dataset_definition.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,3 @@
# Note: If you are using ehrQL to define your study population you need to:
# (1) uncomment the ehrQL action in the project.yaml file (lines 14-18),
# (2) delete the cohort-extractor action from the project.yaml file (lines 8-12), and
# (3) delete the study_definition.py file.

from ehrql import Dataset
from ehrql.tables.beta.tpp import patients, practice_registrations

Expand Down
17 changes: 0 additions & 17 deletions analysis/study_definition.py

This file was deleted.

14 changes: 4 additions & 10 deletions project.yaml
Original file line number Diff line number Diff line change
@@ -1,18 +1,12 @@
version: '3.0'

# Ignore this`expectation` block. It is required but not used, and will be removed in future versions.
expectations:
population_size: 1000
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is no longer relevant with ehrQL and therefore a source of confusion to have it here. But currently the pipeline validator insists that this be defined for version 3.0 project.yaml files:
https://github.com/opensafely-core/pipeline/blob/8c706d663fb2fcae279bc0f15c1b1b3bd4314e99/pipeline/models.py#L186-L211

So I think we're going to have to move to version 4 for project.yaml files and create a new release of the pipeline library, which is incredibly tedious.

For now, I wonder if we should just stick a comment above this expectations section saying something like "Please ignore this section, it is not used and will be removed in future versions."

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!


actions:

generate_study_population:
run: cohortextractor:latest generate_cohort --output-format csv.gz --study-definition study_definition
generate_dataset:
run: ehrql:v0 generate-dataset analysis/dataset_definition.py --output output/dataset.csv.gz
outputs:
highly_sensitive:
cohort: output/input.csv.gz

# generate_dataset:
# run: ehrql:v0 generate-dataset analysis/dataset_definition.py --output output/dataset.csv.gz
# outputs:
# highly_sensitive:
# cohort: output/dataset.csv.gz
dataset: output/dataset.csv.gz