From ae27de5dfc2db41cd354e62c6e1258fe734f545a Mon Sep 17 00:00:00 2001 From: Peter Inglesby Date: Tue, 7 Nov 2023 13:19:58 +0000 Subject: [PATCH 1/2] Tweak dataset definition The Getting Started guide talks about adding an age column --- analysis/dataset_definition.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/analysis/dataset_definition.py b/analysis/dataset_definition.py index 8ca2273..fed420b 100644 --- a/analysis/dataset_definition.py +++ b/analysis/dataset_definition.py @@ -9,6 +9,6 @@ index_date ).exists_for_patient() -dataset.age = patients.age_on(index_date) +dataset.define_population(has_registration) -dataset.define_population(has_registration & (dataset.age > 17)) +dataset.sex = patients.sex From c84e02ad257098cb6b5d3f3956f23469d89099b8 Mon Sep 17 00:00:00 2001 From: Peter Inglesby Date: Tue, 7 Nov 2023 14:30:03 +0000 Subject: [PATCH 2/2] s/Dataset/create_dataset/ --- analysis/dataset_definition.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/analysis/dataset_definition.py b/analysis/dataset_definition.py index fed420b..35da695 100644 --- a/analysis/dataset_definition.py +++ b/analysis/dataset_definition.py @@ -1,7 +1,7 @@ -from ehrql import Dataset +from ehrql import create_dataset from ehrql.tables.beta.tpp import patients, practice_registrations -dataset = Dataset() +dataset = create_dataset() index_date = "2020-03-31"