Skip to content

OpenSAFELY Contracts reference🔗

Danger

This page discusses the new OpenSAFELY Data Builder for accessing OpenSAFELY data sources.

Use OpenSAFELY cohort-extractor, unless you are specifically involved in the development or testing of Data Builder.

OpenSAFELY Data Builder and its documentation are still undergoing extensive development. We will announce when Data Builder is ready for general use on the Platform News page.

This page will be a reference for OpenSAFELY Contracts.

It is likely that much or all of this content will be automatically generated from the Data Builder contracts code.

Universal/patients🔗

Column name Description Type Constraints
date_of_birth Patient's date of birth, rounded to first of month date Must be the first day of a month, must have a value.
sex Patient's sex str Must have a value, must be one of: 'female', 'male', 'intersex', 'unknown'.
date_of_death Patient's date of death date .

Wip/clinical_events🔗

TODO.

Column name Description Type Constraints
code str .
system str .
date date .
numeric_value float .

Wip/covid_test_results🔗

TODO.

Column name Description Type Constraints
date date .
positive_result bool .

Wip/hospital_admissions🔗

TODO.

Column name Description Type Constraints
admission_date date .
primary_diagnosis str .
admission_method int .
episode_is_finished bool .
spell_id int .

Wip/hospitalisations🔗

TODO.

Column name Description Type Constraints
date date .
code str .
system str .

Wip/hospitalisations_without_system🔗

TODO.

Column name Description Type Constraints
code str .

Wip/patient_address🔗

TODO.

Column name Description Type Constraints
patientaddress_id int .
date_start date .
date_end date .
index_of_multiple_deprivation_rounded int .
has_postcode bool .

Wip/patients🔗

TODO.

Column name Description Type Constraints
date_of_birth date .

Wip/practice_registrations🔗

TODO.

Column name Description Type Constraints
pseudo_id int .
nuts1_region_name str .
date_start date .
date_end date .

Wip/prescriptions🔗

TODO.

Column name Description Type Constraints
prescribed_dmd_code str .
processing_date date .

TO BE REPLACED IN FULL DOCS BUILD

This snippet will be replaced in the main docs with the parent file 'includes/glossary.md'