Skip to content

examples.tutorial schema🔗

This schema is for development or testing purposes and is not available on any backend.

This example schema is for use in the ehrQL tutorial.

To use this schema in an ehrQL file:
from ehrql.tables.examples.tutorial import (
    clinical_events,
    hospitalisations,
    patient_address,
    patients,
    prescriptions,
)

many rows per patient

clinical_events🔗

TODO.

Columns
code 🔗 string
system 🔗 string
date 🔗 date
numeric_value 🔗 float

many rows per patient

hospitalisations🔗

TODO.

Columns
date 🔗 date
code 🔗 string
system 🔗 string

many rows per patient

patient_address🔗

TODO.

Columns
patientaddress_id 🔗 integer
date_start 🔗 date
date_end 🔗 date
index_of_multiple_deprivation_rounded 🔗 integer
has_postcode 🔗 boolean

one row per patient

patients🔗

Columns
date_of_birth 🔗 date

Patient's date of birth, rounded to first of month

  • Always the first day of a month
  • Never NULL
sex 🔗 string

Patient's sex

  • Never NULL
  • Possible values: female, male, intersex, unknown
date_of_death 🔗 date

Patient's date of death

many rows per patient

prescriptions🔗

TODO.

Columns
prescribed_dmd_code 🔗 string
processing_date 🔗 date