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

Download this file

15 lines (11 with data), 355 Bytes

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
# noqa: INP001
from ehrql import INTERVAL, Measures, years
from ehrql.tables.core import patients
measures = Measures()
measures.define_measure(
"births",
numerator=patients.date_of_birth.is_during(INTERVAL),
denominator=patients.exists_for_patient(),
group_by={"sex": patients.sex},
intervals=years(2).starting_on("2020-01-01"),
)