diff --git a/docs/explanation/selecting-populations-for-study.md b/docs/explanation/selecting-populations-for-study.md index fa6b5d51b..ddd6ada23 100644 --- a/docs/explanation/selecting-populations-for-study.md +++ b/docs/explanation/selecting-populations-for-study.md @@ -26,4 +26,4 @@ for further details of this transfer process. a patient did not change practice during a time period of interest. For TPP, - there is a [method to select patients with a continuous registration](../reference/schemas/tpp.md#practice_registrations.has_a_continuous_practice_registration_spanning). + there is a [method to select patients with a continuous registration](../reference/schemas/tpp.md#practice_registrations.spanning). diff --git a/docs/includes/generated_docs/language__dataset.md b/docs/includes/generated_docs/language__dataset.md index 0a8c68275..a993a944f 100644 --- a/docs/includes/generated_docs/language__dataset.md +++ b/docs/includes/generated_docs/language__dataset.md @@ -38,7 +38,7 @@ dataset.define_population(patients.date_of_birth < "1990-01-01") ``` For more detail see the how-to guide on [defining -populations](../../how-to/define-population/). +populations](../how-to/define-population.md).
diff --git a/docs/includes/generated_docs/schemas.md b/docs/includes/generated_docs/schemas.md index 0bec3d566..1bee8df14 100644 --- a/docs/includes/generated_docs/schemas.md +++ b/docs/includes/generated_docs/schemas.md @@ -31,15 +31,6 @@ This schema defines the data (both primary care and externally linked) available OpenSAFELY-EMIS backend. For more information about this backend, see "[EMIS Primary Care](https://docs.opensafely.org/data-sources/emis/)". -## [examples.tutorial](schemas/examples.tutorial.md) - - view details → - - -_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. - ## [raw.core](schemas/raw.core.md) view details → diff --git a/docs/includes/generated_docs/schemas/examples.tutorial.md b/docs/includes/generated_docs/schemas/examples.tutorial.md deleted file mode 100644 index 416307963..000000000 --- a/docs/includes/generated_docs/schemas/examples.tutorial.md +++ /dev/null @@ -1,277 +0,0 @@ -# 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. - -``` {.python .copy title='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 -
-
- - -
-
- -
-
diff --git a/docs/includes/generated_docs/schemas/tpp.md b/docs/includes/generated_docs/schemas/tpp.md index 5c341515a..1a75eee61 100644 --- a/docs/includes/generated_docs/schemas/tpp.md +++ b/docs/includes/generated_docs/schemas/tpp.md @@ -3035,7 +3035,7 @@ The priority type. Note that a small number of rows contain values which are not in the list below. These are converted to NULL in this representation of the data. If you need to access the original values, please see the corresponding [raw -table](../raw.tpp/#wl_clockstops). +table](raw.tpp.md#wl_clockstops). * Possible values: `routine`, `urgent`, `two week wait` @@ -3137,7 +3137,7 @@ The waiting list type on completion of the pathway. Note that a small number of rows contain values which are not in the list below. These are converted to NULL in this representation of the data. If you need to access the original values, please see the corresponding [raw -table](../raw.tpp/#wl_clockstops). +table](raw.tpp.md#wl_clockstops). * Possible values: `ORTT`, `IRTT`, `PTLO`, `PTLI`, `RTTO`, `RTTI` @@ -3222,7 +3222,7 @@ The priority type. Note that a small number of rows contain values which are not in the list below. These are converted to NULL in this representation of the data. If you need to access the original values, please see the corresponding [raw -table](../raw.tpp/#wl_openpathways). +table](raw.tpp.md#wl_openpathways). * Possible values: `routine`, `urgent`, `two week wait` @@ -3325,7 +3325,7 @@ The waiting list type. Note that a small number of rows contain values which are not in the list below. These are converted to NULL in this representation of the data. If you need to access the original values, please see the corresponding [raw -table](../raw.tpp/#wl_openpathways). +table](raw.tpp.md#wl_openpathways). * Possible values: `ORTT`, `IRTT`, `ONON`, `INON`, `PTLO`, `PTLI`, `RTTO`, `RTTI` diff --git a/ehrql/docs/render_includes/schemas.py b/ehrql/docs/render_includes/schemas.py index 984845ca3..d4fbbf0b1 100644 --- a/ehrql/docs/render_includes/schemas.py +++ b/ehrql/docs/render_includes/schemas.py @@ -21,11 +21,7 @@ def render_schema_index(schemas): def implemented_by_list(backends, depth=1): - if not backends: - return ( - "_This schema is for development or testing purposes and is not" - " available on any backend._" - ) + assert len(backends) > 0 if depth > 1: url_prefix = "/".join([".."] * (depth - 1)) + "/" else: diff --git a/ehrql/query_language.py b/ehrql/query_language.py index 6044e6052..41c6bba00 100644 --- a/ehrql/query_language.py +++ b/ehrql/query_language.py @@ -68,7 +68,7 @@ def define_population(self, population_condition): ``` For more detail see the how-to guide on [defining - populations](../../how-to/define-population/). + populations](../how-to/define-population.md). """ if "population" in self.variables: raise AttributeError( diff --git a/ehrql/tables/examples/__init__.py b/ehrql/tables/examples/__init__.py deleted file mode 100644 index e69de29bb..000000000 diff --git a/ehrql/tables/examples/tutorial.py b/ehrql/tables/examples/tutorial.py deleted file mode 100644 index 57d790fe4..000000000 --- a/ehrql/tables/examples/tutorial.py +++ /dev/null @@ -1,78 +0,0 @@ -""" -This example schema is for use in the ehrQL tutorial. -""" - -import datetime - -from ehrql.tables import Constraint, EventFrame, PatientFrame, Series, table - - -__all__ = [ - "clinical_events", - "hospitalisations", - "patient_address", - "patients", - "prescriptions", -] - - -@table -class clinical_events(EventFrame): - """TODO.""" - - code = Series(str) - system = Series(str) - date = Series(datetime.date) - numeric_value = Series(float) - - -@table -class hospitalisations(EventFrame): - """TODO.""" - - date = Series(datetime.date) - code = Series(str) - system = Series(str) - - -@table -class patient_address(EventFrame): - """TODO.""" - - patientaddress_id = Series(int) - date_start = Series(datetime.date) - date_end = Series(datetime.date) - index_of_multiple_deprivation_rounded = Series(int) - has_postcode = Series(bool) - - -@table -class patients(PatientFrame): - date_of_birth = Series( - datetime.date, - description="Patient's date of birth, rounded to first of month", - constraints=[Constraint.FirstOfMonth(), Constraint.NotNull()], - ) - sex = Series( - str, - description="Patient's sex", - implementation_notes_to_add_to_description=( - 'Specify how this has been determined, e.g. "sex at birth", or "current sex".' - ), - constraints=[ - Constraint.NotNull(), - Constraint.Categorical(["female", "male", "intersex", "unknown"]), - ], - ) - date_of_death = Series( - datetime.date, - description="Patient's date of death", - ) - - -@table -class prescriptions(EventFrame): - """TODO.""" - - prescribed_dmd_code = Series(str) - processing_date = Series(datetime.date) diff --git a/ehrql/tables/tpp.py b/ehrql/tables/tpp.py index 8831d6dcd..b64ce9e47 100644 --- a/ehrql/tables/tpp.py +++ b/ehrql/tables/tpp.py @@ -1577,7 +1577,7 @@ class wl_clockstops(EventFrame): Note that a small number of rows contain values which are not in the list below. These are converted to NULL in this representation of the data. If you need to access the original values, please see the corresponding [raw - table](../raw.tpp/#wl_clockstops). + table](raw.tpp.md#wl_clockstops). """, constraints=[Constraint.Categorical(["routine", "urgent", "two week wait"])], ) @@ -1608,7 +1608,7 @@ class wl_clockstops(EventFrame): Note that a small number of rows contain values which are not in the list below. These are converted to NULL in this representation of the data. If you need to access the original values, please see the corresponding [raw - table](../raw.tpp/#wl_clockstops). + table](raw.tpp.md#wl_clockstops). """, constraints=[ Constraint.Categorical( @@ -1664,7 +1664,7 @@ class wl_openpathways(EventFrame): Note that a small number of rows contain values which are not in the list below. These are converted to NULL in this representation of the data. If you need to access the original values, please see the corresponding [raw - table](../raw.tpp/#wl_openpathways). + table](raw.tpp.md#wl_openpathways). """, constraints=[Constraint.Categorical(["routine", "urgent", "two week wait"])], ) @@ -1705,7 +1705,7 @@ class wl_openpathways(EventFrame): Note that a small number of rows contain values which are not in the list below. These are converted to NULL in this representation of the data. If you need to access the original values, please see the corresponding [raw - table](../raw.tpp/#wl_openpathways). + table](raw.tpp.md#wl_openpathways). """, constraints=[ Constraint.Categorical(