beta.core schema🔗
Available on backends: TPP, EMIS
This schema defines the core tables and columns which should be available in any backend providing primary care data, allowing dataset definitions written using this schema to run across multiple backends.
Warning
This schema is still a work-in-progress while the EMIS backend remains under development. Projects requiring EMIS data should continue to use the Cohort Extractor tool.
from ehrql.tables.beta.core import (
clinical_events,
medications,
ons_deaths,
patients,
)
many rows per patient
clinical_events🔗
many rows per patient
medications🔗
many rows per patient
ons_deaths🔗
-
date
🔗
date
-
place
🔗
string
-
- Possible values:
Care Home
,Elsewhere
,Home
,Hospice
,Hospital
,Other communal establishment
- Possible values:
-
underlying_cause_of_death
🔗
ICD-10 code
-
cause_of_death_01
🔗
ICD-10 code
-
cause_of_death_02
🔗
ICD-10 code
-
cause_of_death_03
🔗
ICD-10 code
-
cause_of_death_04
🔗
ICD-10 code
-
cause_of_death_05
🔗
ICD-10 code
-
cause_of_death_06
🔗
ICD-10 code
-
cause_of_death_07
🔗
ICD-10 code
-
cause_of_death_08
🔗
ICD-10 code
-
cause_of_death_09
🔗
ICD-10 code
-
cause_of_death_10
🔗
ICD-10 code
-
cause_of_death_11
🔗
ICD-10 code
-
cause_of_death_12
🔗
ICD-10 code
-
cause_of_death_13
🔗
ICD-10 code
-
cause_of_death_14
🔗
ICD-10 code
-
cause_of_death_15
🔗
ICD-10 code
one row per patient
patients🔗
-
age_on(date)
🔗
-
Patient's age as an integer, in whole elapsed calendar years, as it would be on the supplied date.
Note that this takes no account of whether the patient is alive at the given date. In particular, it may return negative values if the date is before the patient's date of birth.
View method definition
return (date - patients.date_of_birth).years