[e988c2]: / tests / fixtures / good_definition_files / dataset_definition.py

Download this file

10 lines (7 with data), 274 Bytes

1
2
3
4
5
6
7
8
9
# noqa: INP001
from ehrql import create_dataset
from ehrql.tables.core import patients
dataset = create_dataset()
dataset.year_of_birth = patients.date_of_birth.year
dataset.sex = patients.sex
dataset.define_population(patients.date_of_birth.is_on_or_after("2000-01-01"))