Skip to content

Commit

Permalink
Merge pull request #1741 from opensafely-core/document-core-clinical-…
Browse files Browse the repository at this point in the history
…events-table

Document beta.core.clinical_events table
  • Loading branch information
rebkwok authored Nov 17, 2023
2 parents 2232acb + 38ba9f3 commit e72c228
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
4 changes: 4 additions & 0 deletions docs/includes/generated_docs/schemas/beta.core.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,11 @@ from ehrql.tables.beta.core import (
<p class="dimension-indicator"><code>many rows per patient</code></p>
## clinical_events

Each record corresponds to a single clinical or consultation event for a patient.

Note that event codes do not change in this table. If an event code in the coding
system becomes inactive, the event will still be coded to the inactive code.
As such, codelists should include all relevant inactive codes.
<div markdown="block" class="definition-list-wrapper">
<div class="title">Columns</div>
<dl markdown="block">
Expand Down
9 changes: 9 additions & 0 deletions ehrql/tables/beta/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,15 @@ class ons_deaths(PatientFrame):

@table
class clinical_events(EventFrame):
"""
Each record corresponds to a single clinical or consultation event for a patient.
Note that event codes do not change in this table. If an event code in the coding
system becomes inactive, the event will still be coded to the inactive code.
As such, codelists should include all relevant inactive codes.
"""

date = Series(datetime.date)
snomedct_code = Series(SNOMEDCTCode)
numeric_value = Series(float)
Expand Down

0 comments on commit e72c228

Please sign in to comment.