CompassV2TestPages:v2.X: Difference between revisions

From Discovery Data Service
Jump to navigation Jump to search
No edit summary
No edit summary
 
(20 intermediate revisions by the same user not shown)
Line 1: Line 1:
<meta charset="UTF-8"/>
<h1 id="firstHeading" class="firstHeading" lang="en-GB">Remote Subscriber Database (RSD) Schema (Compass 2) Version: v231321e3242432</h1>
<title>Discovery Data Service Compass v2.1.1 Database Dump</title>
<div id="mw-head-base" class="noprint"></div>
<div id="content" class="mw-body" role="main">
<a id="top"></a>
<div class="mw-indicators mw-body-content">
</div>
 
<h1 id="firstHeading" class="firstHeading" lang="en-GB">Remote Subscriber Database (RSD) Schema (Compass 2) Version: v2.1.1</h1>
<div id="bodyContent" class="mw-body-content">
<div id="bodyContent" class="mw-body-content">
<div id="siteSub" class="noprint">From Discovery Data Service</div>
<div id="siteSub" class="noprint">From Discovery Data Service</div>
<div id="contentSub"></div>
<div id="contentSub"></div>
<h2><span class="mw-headline" id="Sortable_tables">Allergy_intolerance</span></h2>
<h1><span class="mw-headline" id="Sortable_tables">allergy_intolerance</span></h1>
<table class="sortable" border="1" style="border-collapse:collapse">
<table class="mw-collapsible" border="1" style="border-collapse:collapse">
<tr>
<tr>
<th scope="col" width="10%">Column Name</th>
<th scope="col">Column Name</th>
<th scope="col" width="10%">Type</th>
<th scope="col">Data Type</th>
<th scope="col" width="10%">Constraint</th>
<th scope="col">Constraint</th>
<th scope="col" width="10%">Comment</th>
<th scope="col">Comment</th>
<th scope="col" width="10%">Sql</th>
<th scope="col">Foreign Key Reference</th>
</tr>
</tr>
<tbody>
<tr>
<tr>
<td>is_review</td>
<td>id</td>
<td>tinyint(1)</td>
<td>bigint</td>
<td>NOT NULL</td>
<td>NOT NULL</td>
<td> COMMENT 'Is this instance of the code a review of a previous encounter',</td>
<td> 'Unique Id of the allergy'</td>
<td> is_review tinyint(1) NOT NULL COMMENT 'Is this instance of the code a review of a previous encounter',</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
<td>patient_id</td>
<td>organization_id</td>
<td>bigint</td>
<td>bigint</td>
<td>NOT NULL</td>
<td>NOT NULL</td>
<td> COMMENT 'The organisations record for this person’s registration. Patients may have multiple records across clinical systems and may have registered at an organisation multiple times',</td>
<td> 'Owning organisation (i.e. publisher)'</td>
<td> patient_id bigint NOT NULL COMMENT 'The organisations record for this person’s registration. Patients may have multiple records across clinical systems and may have registered at an organisation multiple times',</td>
<td>patient.organization_id</td>
</tr>
</tr>
<tr>
<tr>
<td>clinical_effective_date</td>
<td>patient_id</td>
<td>date</td>
<td>bigint</td>
<td>DEFAULT NULL</td>
<td>NOT NULL</td>
<td> COMMENT 'The date the clinical code is recorded for',</td>
<td> 'The organisations record for this person’s registration. Patients may have multiple records across clinical systems and may have registered at an organisation multiple times'</td>
<td> clinical_effective_date date DEFAULT NULL COMMENT 'The date the clinical code is recorded for',</td>
<td>patient.id</td>
</tr>
</tr>
<tr>
<tr>
<td>organization_id</td>
<td>person_id</td>
<td>bigint</td>
<td>bigint</td>
<td>NOT NULL</td>
<td>NOT NULL</td>
<td> COMMENT 'Owning organisation (i.e. publisher)',</td>
<td> 'Unique individual across all organisations'</td>
<td> organization_id bigint NOT NULL COMMENT 'Owning organisation (i.e. publisher)',</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
<td>non_core_concept_id</td>
<td>encounter_id</td>
<td>int</td>
<td>bigint</td>
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> COMMENT 'Reference to the clinical coding of the allergy',</td>
<td> 'Reference to the encounter this allergy was record in'</td>
<td> non_core_concept_id int DEFAULT NULL COMMENT 'Reference to the clinical coding of the allergy',</td>
<td>encounter.id</td>
</tr>
</tr>
<tr>
<tr>
<td>id</td>
<td>practitioner_id</td>
<td>bigint</td>
<td>bigint</td>
<td>NOT NULL</td>
<td>DEFAULT NULL</td>
<td> COMMENT 'Unique Id of the allergy',</td>
<td> 'The clinician the activity is recorded against'</td>
<td> id bigint NOT NULL COMMENT 'Unique Id of the allergy',</td>
<td>practitioner.id</td>
</tr>
</tr>
<tr>
<tr>
<td>age_at_event</td>
<td>clinical_effective_date</td>
<td>decimal(5,2)</td>
<td>date</td>
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> COMMENT 'The age the patient was at the time of this event',</td>
<td> 'The date the clinical code is recorded for'</td>
<td> age_at_event decimal(5,2) DEFAULT NULL COMMENT 'The age the patient was at the time of this event',</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
<td>core_concept_id</td>
<td>date_precision_concept_id</td>
<td>int</td>
<td>int</td>
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> COMMENT 'Reference to the clinical coding of the allergy',</td>
<td> 'Identifies the precision of the clinical effectiveness date to either year (1) month (2) day (5) minute (12) second (13) millisecond (14)'</td>
<td> core_concept_id int DEFAULT NULL COMMENT 'Reference to the clinical coding of the allergy',</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
<td>date_precision_concept_id</td>
<td>is_review</td>
<td>tinyint(1)</td>
<td>NOT NULL</td>
<td> 'Is this instance of the code a review of a previous encounter'</td>
<td>No Foreign Key reference</td>
</tr>
<tr>
<td>core_concept_id</td>
<td>int</td>
<td>DEFAULT NULL</td>
<td> 'Reference to the clinical coding of the allergy'</td>
<td>No Foreign Key reference</td>
</tr>
<tr>
<td>non_core_concept_id</td>
<td>int</td>
<td>int</td>
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> COMMENT 'Identifies the precision of the clinical effectiveness date to either year (1) month (2) day (5) minute (12) second (13) millisecond (14)',</td>
<td> 'Reference to the clinical coding of the allergy'</td>
<td> date_precision_concept_id int DEFAULT NULL COMMENT 'Identifies the precision of the clinical effectiveness date to either year (1) month (2) day (5) minute (12) second (13) millisecond (14)',</td>
<td>No Foreign Key reference</td>
</tr>
<tr>
<td>age_at_event</td>
<td>decimal(5,2)</td>
<td>DEFAULT NULL</td>
<td> 'The age the patient was at the time of this event'</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
Line 90: Line 101:
<td>datetime</td>
<td>datetime</td>
<td>NOT NULL</td>
<td>NOT NULL</td>
<td> COMMENT 'The date the allergy was recorded',</td>
<td> 'The date the allergy was recorded'</td>
<td> date_recorded datetime NOT NULL COMMENT 'The date the allergy was recorded',</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
<td>person_id</td>
<td colspan="5">Unique index name: `allergy_intolerance_id` Index Columns: (id)</td> </tr> <tr>
<td colspan="5">Index name: `fk_allergy_intolerance_encounter_id` Index Columns: (encounter_id)</td> </tr> <tr>
<td colspan="5">Index name: `fk_allergy_intolerance_patient_id_organization_id` Index Columns: (patient_id,organization_id)</td> </tr> <tr>
<td colspan="5">Index name: `fk_allergy_intolerance_practitioner_id` Index Columns: (practitioner_id)</td> </tr> <tr>
<td colspan="5">Index name: `allergy_intolerance_patient_id` Index Columns: (patient_id)</td> </tr> <tr>
<td colspan="5">Index name: `allergy_intolerance_core_concept_id` Index Columns: (core_concept_id)</td> </tr> <tr>
<td colspan="5">PRIMARY KEY CONSTRAINT(s) (`organization_id`,`person_id`,`id`)</td> </tr> </table>
<h1><span class="mw-headline" id="Sortable_tables">appointment</span></h1>
<table class="mw-collapsible" border="1" style="border-collapse:collapse">
<tr>
<th scope="col">Column Name</th>
<th scope="col">Data Type</th>
<th scope="col">Constraint</th>
<th scope="col">Comment</th>
<th scope="col">Foreign Key Reference</th>
</tr>
<tr>
<td>id</td>
<td>bigint</td>
<td>bigint</td>
<td>NOT NULL</td>
<td>NOT NULL</td>
<td> COMMENT 'Unique individual across all organisations',</td>
<td> 'Unique Id of the appointment'</td>
<td> person_id bigint NOT NULL COMMENT 'Unique individual across all organisations',</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
<td>encounter_id</td>
<td>organization_id</td>
<td>bigint</td>
<td>bigint</td>
<td>DEFAULT NULL</td>
<td>NOT NULL</td>
<td> COMMENT 'Reference to the encounter this allergy was record in',</td>
<td> 'Owning organisation (i.e. publisher)'</td>
<td> encounter_id bigint DEFAULT NULL COMMENT 'Reference to the encounter this allergy was record in',</td>
<td>organization.id</td>
</tr>
</tr>
<tr>
<tr>
<td>practitioner_id</td>
<td>patient_id</td>
<td>bigint</td>
<td>bigint</td>
<td>DEFAULT NULL</td>
<td>NOT NULL</td>
<td> COMMENT 'The clinician the activity is recorded against',</td>
<td> 'The organisations record for this person’s registration. Patients may have multiple records across clinical systems and may have registered at an organisation multiple times'</td>
<td> practitioner_id bigint DEFAULT NULL COMMENT 'The clinician the activity is recorded against',</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
</tbody>
</table>
<h2><span class="mw-headline" id="Sortable_tables">Appointment</span></h2>
<table class="sortable" border="1" style="border-collapse:collapse">
<tr>
<th scope="col" width="10%">Column Name</th>
<th scope="col" width="10%">Type</th>
<th scope="col" width="10%">Constraint</th>
<th scope="col" width="10%">Comment</th>
<th scope="col" width="10%">Sql</th>
</tr>
<tbody>
<tr>
<tr>
<td>patient_id</td>
<td>person_id</td>
<td>bigint</td>
<td>bigint</td>
<td>NOT NULL</td>
<td>NOT NULL</td>
<td> COMMENT 'The organisations record for this person’s registration. Patients may have multiple records across clinical systems and may have registered at an organisation multiple times',</td>
<td> 'Unique individual across all organisations'</td>
<td> patient_id bigint NOT NULL COMMENT 'The organisations record for this person’s registration. Patients may have multiple records across clinical systems and may have registered at an organisation multiple times',</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
<td>start_date</td>
<td>practitioner_id</td>
<td>date</td>
<td>bigint</td>
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> COMMENT 'The start date of the appointment',</td>
<td> 'The clinician the activity is recorded against'</td>
<td> start_date date DEFAULT NULL COMMENT 'The start date of the appointment',</td>
<td>practitioner.id</td>
</tr>
</tr>
<tr>
<tr>
<td>organization_id</td>
<td>schedule_id</td>
<td>bigint</td>
<td>bigint</td>
<td>NOT NULL</td>
<td>DEFAULT NULL</td>
<td> COMMENT 'Owning organisation (i.e. publisher)',</td>
<td> 'The schedule the patient was put on to book multiple appointments. ID unique to the applied schedule'</td>
<td> organization_id bigint NOT NULL COMMENT 'Owning organisation (i.e. publisher)',</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
<td>id</td>
<td>start_date</td>
<td>bigint</td>
<td>date</td>
<td>NOT NULL</td>
<td>DEFAULT NULL</td>
<td> COMMENT 'Unique Id of the appointment',</td>
<td> 'The start date of the appointment'</td>
<td> id bigint NOT NULL COMMENT 'Unique Id of the appointment',</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
<td>appointment_status_concept_id</td>
<td>planned_duration</td>
<td>int</td>
<td>int</td>
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> COMMENT 'The status of the appointment e.g. arrived/sent in/left/DNA',</td>
<td> 'The time allocated for the appointment, not necessarily the actual duration always in minutes'</td>
<td> appointment_status_concept_id int DEFAULT NULL COMMENT 'The status of the appointment e.g. arrived/sent in/left/DNA',</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
<td>date_time_left</td>
<td>actual_duration</td>
<td>datetime</td>
<td>int</td>
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> COMMENT 'Date and time the patient left the practitioner',</td>
<td> 'Time between sent in and left always in minutes'</td>
<td> date_time_left datetime DEFAULT NULL COMMENT 'Date and time the patient left the practitioner',</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
<td>planned_duration</td>
<td>appointment_status_concept_id</td>
<td>int</td>
<td>int</td>
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> COMMENT 'The time allocated for the appointment, not necessarily the actual duration always in minutes',</td>
<td> 'The status of the appointment e.g. arrived/sent in/left/DNA'</td>
<td> planned_duration int DEFAULT NULL COMMENT 'The time allocated for the appointment, not necessarily the actual duration always in minutes',</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
<td>date_time_sent_in</td>
<td>patient_wait</td>
<td>int</td>
<td>DEFAULT NULL</td>
<td> 'How long the patient waited from being marked as arrived to being sent in'</td>
<td>No Foreign Key reference</td>
</tr>
<tr>
<td>patient_delay</td>
<td>int</td>
<td>DEFAULT NULL</td>
<td> 'How long the patient was delayed for'</td>
<td>No Foreign Key reference</td>
</tr>
<tr>
<td>date_time_sent_in</td>
<td>datetime</td>
<td>datetime</td>
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> COMMENT 'Date and time the patient was sent into the practitioner',</td>
<td> 'Date and time the patient was sent into the practitioner'</td>
<td> date_time_sent_in datetime DEFAULT NULL COMMENT 'Date and time the patient was sent into the practitioner',</td>
<td>No Foreign Key reference</td>
</tr>
<tr>
<td>date_time_left</td>
<td>datetime</td>
<td>DEFAULT NULL</td>
<td> 'Date and time the patient left the practitioner'</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
Line 186: Line 223:
<td>varchar(36)</td>
<td>varchar(36)</td>
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> COMMENT 'Unique reference to the source of the appointment',</td>
<td> 'Unique reference to the source of the appointment'</td>
<td> source_id varchar(36) DEFAULT NULL COMMENT 'Unique reference to the source of the appointment',</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
Line 193: Line 230:
<td>datetime</td>
<td>datetime</td>
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> COMMENT 'The date the appointment was cancelled',</td>
<td> 'The date the appointment was cancelled'</td>
<td> cancelled_date datetime DEFAULT NULL COMMENT 'The date the appointment was cancelled',</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
<td>patient_delay</td>
<td colspan="5">Unique index name: `appointment_id` Index Columns: (id)</td> </tr> <tr>
<td>int</td>
<td colspan="5">Index name: `fk_appointment_practitioner_id` Index Columns: (practitioner_id)</td> </tr> <tr>
<td>DEFAULT NULL</td>
<td colspan="5">Index name: `appointment_patient_id` Index Columns: (patient_id)</td> </tr> <tr>
<td> COMMENT 'How long the patient was delayed for',</td>
<td colspan="5">PRIMARY KEY CONSTRAINT(s) (`organization_id`,`person_id`,`id`)</td> </tr> </table>
<td> patient_delay int DEFAULT NULL COMMENT 'How long the patient was delayed for',</td>
<h1><span class="mw-headline" id="Sortable_tables">appointment_additional</span></h1>
</tr>
<table class="mw-collapsible" border="1" style="border-collapse:collapse">
<tr>
<th scope="col">Column Name</th>
<th scope="col">Data Type</th>
<th scope="col">Constraint</th>
<th scope="col">Comment</th>
<th scope="col">Foreign Key Reference</th>
</tr>
<tr>
<tr>
<td>person_id</td>
<td>id</td>
<td>bigint</td>
<td>bigint</td>
<td>NOT NULL</td>
<td>NOT NULL</td>
<td> COMMENT 'Unique individual across all organisations',</td>
<td> 'same as the id column on the patient table '</td>
<td> person_id bigint NOT NULL COMMENT 'Unique individual across all organisations',</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
<td>practitioner_id</td>
<td>property_id</td>
<td>bigint</td>
<td>int</td>
<td>DEFAULT NULL</td>
<td>NOT NULL</td>
<td> COMMENT 'The clinician the activity is recorded against',</td>
<td> 'IM reference (e.g. appointment type)'</td>
<td> practitioner_id bigint DEFAULT NULL COMMENT 'The clinician the activity is recorded against',</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
<td>schedule_id</td>
<td>value_id</td>
<td>bigint</td>
<td>DEFAULT NULL</td>
<td> COMMENT 'The schedule the patient was put on to book multiple appointments. ID unique to the applied schedule',</td>
<td>  schedule_id bigint DEFAULT NULL COMMENT 'The schedule the patient was put on to book multiple appointments. ID unique to the applied schedule',</td>
</tr>
<tr>
<td>actual_duration</td>
<td>int</td>
<td>int</td>
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> COMMENT 'Time between sent in and left always in minutes',</td>
<td> 'IM reference (e.g. appointment type)'</td>
<td> actual_duration int DEFAULT NULL COMMENT 'Time between sent in and left always in minutes',</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
<td>patient_wait</td>
<td>json_value</td>
<td>int</td>
<td>json</td>
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> COMMENT 'How long the patient waited from being marked as arrived to being sent in',</td>
<td> 'where there is no mapped value_id, just raw JSON'</td>
<td> patient_wait int DEFAULT NULL COMMENT 'How long the patient waited from being marked as arrived to being sent in',</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
</tbody>
</table>
<h2><span class="mw-headline" id="Sortable_tables">Appointment_additional</span></h2>
<table class="sortable" border="1" style="border-collapse:collapse">
<tr>
<th scope="col" width="10%">Column Name</th>
<th scope="col" width="10%">Type</th>
<th scope="col" width="10%">Constraint</th>
<th scope="col" width="10%">Comment</th>
<th scope="col" width="10%">Sql</th>
</tr>
<tbody>
<tr>
<tr>
<td>text_value</td>
<td>text_value</td>
<td>varchar(255)</td>
<td>varchar(255)</td>
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> COMMENT 'where there is no mapped value_id or raw JSON, just a basic text value (i.e. GP Practitioner number)',</td>
<td> 'where there is no mapped value_id or raw JSON, just a basic text value (i.e. GP Practitioner number)'</td>
<td> text_value varchar(255) DEFAULT NULL COMMENT 'where there is no mapped value_id or raw JSON, just a basic text value (i.e. GP Practitioner number)',</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
<td>property_id</td>
<td colspan="5">Index name: `appointment_additional_value_id` Index Columns: (value_id)</td> </tr> <tr>
<td colspan="5">PRIMARY KEY CONSTRAINT(s) (`id`,`property_id`)</td> </tr> </table>
<h1><span class="mw-headline" id="Sortable_tables">concept</span></h1>
<table class="mw-collapsible" border="1" style="border-collapse:collapse">
<tr>
<th scope="col">Column Name</th>
<th scope="col">Data Type</th>
<th scope="col">Constraint</th>
<th scope="col">Comment</th>
<th scope="col">Foreign Key Reference</th>
</tr>
<tr>
<td>dbid</td>
<td>int</td>
<td>int</td>
<td>NOT NULL</td>
<td>NOT NULL</td>
<td> COMMENT 'IM reference (e.g. appointment type)',</td>
<td> 'Unique concept int DB identifier'</td>
<td> property_id int NOT NULL COMMENT 'IM reference (e.g. appointment type)',</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
<td>value_id</td>
<td>document</td>
<td>int</td>
<td>int</td>
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> COMMENT 'IM reference (e.g. Appointment Type)',</td>
<td> 'Document this concept originated from'</td>
<td> value_id int DEFAULT NULL COMMENT 'IM reference (e.g. Appointment Type)',</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
<td>id</td>
<td>id</td>
<td>bigint</td>
<td>varchar(150)</td>
<td>NOT NULL</td>
<td>CHARACTER SET</td>
<td> COMMENT 'same as the id column on the patient table ',</td>
<td> 'Unique human-readable concept id'</td>
<td> id bigint NOT NULL COMMENT 'same as the id column on the patient table ',</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
<td>json_value</td>
<td>draft</td>
<td>json</td>
<td>tinyint(1)</td>
<td>DEFAULT NULL</td>
<td>DEFAULT NULL,</td>
<td> COMMENT 'where there is no mapped value_id, just raw JSON',</td>
<td>No comment yet added</td>
<td> json_value json DEFAULT NULL COMMENT 'where there is no mapped value_id, just raw JSON',</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
</tbody>
</table>
<h2><span class="mw-headline" id="Sortable_tables">Concept</span></h2>
<table class="sortable" border="1" style="border-collapse:collapse">
<tr>
<th scope="col" width="10%">Column Name</th>
<th scope="col" width="10%">Type</th>
<th scope="col" width="10%">Constraint</th>
<th scope="col" width="10%">Comment</th>
<th scope="col" width="10%">Sql</th>
</tr>
<tbody>
<tr>
<tr>
<td>Name</td>
<td>name</td>
<td>varchar(255)</td>
<td>varchar(255)</td>
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> COMMENT 'Short name',</td>
<td> 'Short name'</td>
<td> Name varchar(255) DEFAULT NULL COMMENT 'Short name',</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
<td>Description</td>
<td>description</td>
<td>varchar(400)</td>
<td>varchar(400)</td>
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> COMMENT 'Full name (or term for ontological concepts)',</td>
<td> 'Full name (or term for ontological concepts)'</td>
<td> Description varchar(400) DEFAULT NULL COMMENT 'Full name (or term for ontological concepts)',</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
<td>Id</td>
<td>scheme</td>
<td>varchar(150)</td>
<td>NOT NULL</td>
<td> COMMENT 'Unique concept identifier',</td>
<td>  Id varchar(150) NOT NULL COMMENT 'Unique concept identifier',</td>
</tr>
<tr>
<td>dbid</td>
<td>int</td>
<td>NOT NULL</td>
<td> COMMENT 'Unique Id of the concept',</td>
<td>  dbid int NOT NULL COMMENT 'Unique Id of the concept',</td>
</tr>
<tr>
<td>Scheme</td>
<td>bigint</td>
<td>bigint</td>
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> COMMENT 'The coding scheme for the code (Read, CTV3, SNOMED etc)',</td>
<td> 'The coding scheme for the code (Read, CTV3, SNOMED etc)'</td>
<td> Scheme bigint DEFAULT NULL COMMENT 'The coding scheme for the code (Read, CTV3, SNOMED etc)',</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
<td>Code</td>
<td>code</td>
<td>varchar(40)</td>
<td>varchar(40)</td>
<td>DEFAULT NULL</td>
<td>CHARACTER SET</td>
<td> COMMENT 'The code (non-unique unless coupled with a scheme)',</td>
<td> 'The code (non-unique unless coupled with a scheme)'</td>
<td> Code varchar(40) DEFAULT NULL COMMENT 'The code (non-unique unless coupled with a scheme)',</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
<td>Document</td>
<td>use_count</td>
<td>int</td>
<td>bigint</td>
<td>NOT NULL</td>
<td>No Constraint</td>
<td> COMMENT 'Concept grouping construct, deprecated',</td>
<td> 'Rough indicator of number of occurences of the concept'</td>
<td> Document int NOT NULL COMMENT 'Concept grouping construct, deprecated',</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
Line 350: Line 361:
<td>datetime</td>
<td>datetime</td>
<td>NOT NULL</td>
<td>NOT NULL</td>
<td> COMMENT 'The timestamp of the last update to the concept',</td>
<td> 'The timestamp of the last update to the concept'</td>
<td> updated datetime NOT NULL COMMENT 'The timestamp of the last update to the concept',</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
<td>Draft</td>
<td colspan="5">Index name: `ix_scheme_code` Index Columns: (scheme,code)</td> </tr> <tr>
<td>tinyint(1)</td>
<td colspan="5">Index name: `ix_code` Index Columns: (code)</td> </tr> <tr>
<td>NOT NULL</td>
<td colspan="5">Index name: `ix_dbid_code` Index Columns: (dbid,code)</td> </tr> <tr>
<td> COMMENT 'Whether its draft/autocreated or confirmed as a "proper" concept',</td>
<td colspan="5">PRIMARY KEY CONSTRAINT(s) (`dbid`)</td> </tr> </table>
<td> Draft tinyint(1) NOT NULL COMMENT 'Whether its draft/autocreated or confirmed as a "proper" concept',</td>
<h1><span class="mw-headline" id="Sortable_tables">concept_map</span></h1>
</tr>
<table class="mw-collapsible" border="1" style="border-collapse:collapse">
</tbody>
</table>
<h2><span class="mw-headline" id="Sortable_tables">Concept_map</span></h2>
<table class="sortable" border="1" style="border-collapse:collapse">
<tr>
<tr>
<th scope="col" width="10%">Column Name</th>
<th scope="col">Column Name</th>
<th scope="col" width="10%">Type</th>
<th scope="col">Data Type</th>
<th scope="col" width="10%">Constraint</th>
<th scope="col">Constraint</th>
<th scope="col" width="10%">Comment</th>
<th scope="col">Comment</th>
<th scope="col" width="10%">Sql</th>
<th scope="col">Foreign Key Reference</th>
</tr>
</tr>
<tbody>
<tr>
<td>updated</td>
<td>datetime</td>
<td>NOT NULL</td>
<td> COMMENT 'Timestamp the map was last updated/added',</td>
<td>  updated datetime NOT NULL COMMENT 'Timestamp the map was last updated/added',</td>
</tr>
<tr>
<tr>
<td>legacy</td>
<td>legacy</td>
<td>int</td>
<td>int</td>
<td>NOT NULL</td>
<td>NOT NULL</td>
<td> COMMENT 'the legacy (read 2, ctv3, icd10, opcs4, emis local, etc) concept',</td>
<td> 'the legacy (read 2, ctv3, icd10, opcs4, emis local, etc) concept'</td>
<td> legacy int NOT NULL COMMENT 'the legacy (read 2, ctv3, icd10, opcs4, emis local, etc) concept',</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
Line 390: Line 389:
<td>int</td>
<td>int</td>
<td>NOT NULL</td>
<td>NOT NULL</td>
<td> COMMENT 'the core (snomed, discovery) concept that the legacy concept maps to',</td>
<td> 'the core (snomed, discovery) concept that the legacy concept maps to'</td>
<td> core int NOT NULL COMMENT 'the core (snomed, discovery) concept that the legacy concept maps to',</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
</tbody>
</table>
<h2><span class="mw-headline" id="Sortable_tables">Diagnostic_order</span></h2>
<table class="sortable" border="1" style="border-collapse:collapse">
<tr>
<th scope="col" width="10%">Column Name</th>
<th scope="col" width="10%">Type</th>
<th scope="col" width="10%">Constraint</th>
<th scope="col" width="10%">Comment</th>
<th scope="col" width="10%">Sql</th>
</tr>
<tbody>
<tr>
<tr>
<td>parent_observation_id</td>
<td>updated</td>
<td>bigint</td>
<td>datetime</td>
<td>DEFAULT NULL</td>
<td>NOT NULL</td>
<td> COMMENT 'Reference to the parent observation in a complex observation eg systolic and diastolic blood pressures will have a parent observation of Blood pressure',</td>
<td> 'Timestamp the map was last updated/added'</td>
<td> parent_observation_id bigint DEFAULT NULL COMMENT 'Reference to the parent observation in a complex observation eg systolic and diastolic blood pressures will have a parent observation of Blood pressure',</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
<td>patient_id</td>
<td>id</td>
<td>bigint</td>
<td>int</td>
<td>NOT NULL</td>
<td>NOT NULL,</td>
<td> COMMENT 'The organisations record for this person’s registration. Patients may have multiple records across clinical systems and may have registered at an organisation multiple times',</td>
<td>No comment yet added</td>
<td> patient_id bigint NOT NULL COMMENT 'The organisations record for this person’s registration. Patients may have multiple records across clinical systems and may have registered at an organisation multiple times',</td>
<td>No Foreign Key reference</td>
</tr>
<tr>
<td>deleted</td>
<td>tinyint(1)</td>
<td>DEFAULT NULL,</td>
<td>No comment yet added</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
<td>result_value</td>
<td colspan="5">Unique index name: `concept_map_uq` Index Columns: (legacy,deleted,updated)</td> </tr> <tr>
<td>double</td>
<td colspan="5">Index name: `ix_legacy_core` Index Columns: (legacy,core)</td> </tr> <tr>
<td>DEFAULT NULL</td>
<td colspan="5">PRIMARY KEY CONSTRAINT(s) (`id`)</td> </tr> </table>
<td> COMMENT 'The value of the result of the observation',</td>
<h1><span class="mw-headline" id="Sortable_tables">database_version</span></h1>
<td> result_value double DEFAULT NULL COMMENT 'The value of the result of the observation',</td>
<table class="mw-collapsible" border="1" style="border-collapse:collapse">
<tr>
<th scope="col">Column Name</th>
<th scope="col">Data Type</th>
<th scope="col">Constraint</th>
<th scope="col">Comment</th>
<th scope="col">Foreign Key Reference</th>
</tr>
<tr>
<td>version</td>
<td>varchar(255)</td>
<td>NOT NULL</td>
<td> 'version of the database'</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
<td>problem_end_date</td>
<td>valid_from</td>
<td>date</td>
<td>date</td>
<td>DEFAULT NULL</td>
<td>NOT NULL</td>
<td> COMMENT 'The end date of the problem',</td>
<td> 'date that the version was updated'</td>
<td> problem_end_date date DEFAULT NULL COMMENT 'The end date of the problem',</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
<td>result_date</td>
<td>valid_to</td>
<td>date</td>
<td>date</td>
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> COMMENT 'The date of the result',</td>
<td> 'date that the version was made outdated'</td>
<td> result_date date DEFAULT NULL COMMENT 'The date of the result',</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
<td>clinical_effective_date</td>
<td colspan="5">Unique index name: `valid_to_uq` Index Columns: (valid_to)</td> </tr> <tr>
<td>date</td>
<td colspan="5">PRIMARY KEY CONSTRAINT(s) (`valid_from`)</td> </tr> </table>
<td>DEFAULT NULL</td>
<h1><span class="mw-headline" id="Sortable_tables">diagnostic_order</span></h1>
<td> COMMENT 'The date the diagnostic order was identified by a clinician',</td>
<table class="mw-collapsible" border="1" style="border-collapse:collapse">
<td> clinical_effective_date date DEFAULT NULL COMMENT 'The date the diagnostic order was identified by a clinician',</td>
<tr>
<th scope="col">Column Name</th>
<th scope="col">Data Type</th>
<th scope="col">Constraint</th>
<th scope="col">Comment</th>
<th scope="col">Foreign Key Reference</th>
</tr>
<tr>
<td>id</td>
<td>bigint</td>
<td>NOT NULL</td>
<td> 'Unique Id of the diagnostic order'</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
Line 451: Line 470:
<td>bigint</td>
<td>bigint</td>
<td>NOT NULL</td>
<td>NOT NULL</td>
<td> COMMENT 'Owning organisation (i.e. publisher)',</td>
<td> 'Owning organisation (i.e. publisher)'</td>
<td> organization_id bigint NOT NULL COMMENT 'Owning organisation (i.e. publisher)',</td>
<td>patient.organization_id</td>
</tr>
</tr>
<tr>
<tr>
<td>core_concept_id</td>
<td>patient_id</td>
<td>int</td>
<td>bigint</td>
<td>DEFAULT NULL</td>
<td>NOT NULL</td>
<td> COMMENT 'Reference to the clinical coding of the observation',</td>
<td> 'The organisations record for this person’s registration. Patients may have multiple records across clinical systems and may have registered at an organisation multiple times'</td>
<td> core_concept_id int DEFAULT NULL COMMENT 'Reference to the clinical coding of the observation',</td>
<td>patient.id</td>
</tr>
</tr>
<tr>
<tr>
<td>is_problem</td>
<td>person_id</td>
<td>tinyint(1)</td>
<td>bigint</td>
<td>NOT NULL</td>
<td>NOT NULL</td>
<td> COMMENT 'Whether the observation is marked as a problem',</td>
<td> 'Unique individual across all organisations'</td>
<td> is_problem tinyint(1) NOT NULL COMMENT 'Whether the observation is marked as a problem',</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
<td>age_at_event</td>
<td>encounter_id</td>
<td>decimal(5,2)</td>
<td>bigint</td>
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> COMMENT 'The age of the patient at the time of the observation',</td>
<td> 'Reference to the encounter the observation was recorded at'</td>
<td> age_at_event decimal(5,2) DEFAULT NULL COMMENT 'The age of the patient at the time of the observation',</td>
<td>encounter.id</td>
</tr>
</tr>
<tr>
<tr>
<td>is_primary</td>
<td>practitioner_id</td>
<td>tinyint(1)</td>
<td>bigint</td>
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> COMMENT 'Whether the diagnostic order is a primary order',</td>
<td> 'The clinician the activity is recorded against'</td>
<td> is_primary tinyint(1) DEFAULT NULL COMMENT 'Whether the diagnostic order is a primary order',</td>
<td>practitioner.id</td>
</tr>
</tr>
<tr>
<tr>
<td>result_value_units</td>
<td>clinical_effective_date</td>
<td>varchar(50)</td>
<td>datetime</td>
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> COMMENT 'The units of the result of the observation',</td>
<td> 'The date the diagnostic order was identified by a clinician'</td>
<td> result_value_units varchar(50) DEFAULT NULL COMMENT 'The units of the result of the observation',</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
<td>non_core_concept_id</td>
<td>date_precision_concept_id</td>
<td>int</td>
<td>int</td>
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> COMMENT 'Reference to the clinical coding of the observation',</td>
<td> 'Identifies the precision of the clinical effectiveness date to either year (1) month (2) day (5) minute (12) second (13) millisecond (14)'</td>
<td> non_core_concept_id int DEFAULT NULL COMMENT 'Reference to the clinical coding of the observation',</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
<td>episodicity_concept_id</td>
<td>result_value</td>
<td>int</td>
<td>double</td>
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> COMMENT 'Reference to the episodicity of the problem eg First, review, flare',</td>
<td> 'The value of the result of the observation'</td>
<td> episodicity_concept_id int DEFAULT NULL COMMENT 'Reference to the episodicity of the problem eg First, review, flare',</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
<td>result_concept_id</td>
<td>result_value_units</td>
<td>int</td>
<td>varchar(50)</td>
<td>DEFAULT NULL</td>
<td> 'The units of the result of the observation'</td>
<td>No Foreign Key reference</td>
</tr>
<tr>
<td>result_date</td>
<td>date</td>
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> COMMENT 'Reference to the clinical coding of the result',</td>
<td> 'The date of the result'</td>
<td> result_concept_id int DEFAULT NULL COMMENT 'Reference to the clinical coding of the result',</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
<td>is_review</td>
<td>result_text</td>
<td>tinyint(1)</td>
<td>text</td>
<td>NOT NULL</td>
<td>No Constraint</td>
<td> COMMENT 'Whether the observation is a review of an existing problem',</td>
<td> 'Any text associated with the result'</td>
<td> is_review tinyint(1) NOT NULL COMMENT 'Whether the observation is a review of an existing problem',</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
<td>date_precision_concept_id</td>
<td>result_concept_id</td>
<td>int</td>
<td>int</td>
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> COMMENT 'Identifies the precision of the clinical effectiveness date to either year (1) month (2) day (5) minute (12) second (13) millisecond (14)',</td>
<td> 'Reference to the clinical coding of the result'</td>
<td> date_precision_concept_id int DEFAULT NULL COMMENT 'Identifies the precision of the clinical effectiveness date to either year (1) month (2) day (5) minute (12) second (13) millisecond (14)',</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
<td>person_id</td>
<td>is_problem</td>
<td>bigint</td>
<td>tinyint(1)</td>
<td>NOT NULL</td>
<td>NOT NULL</td>
<td> COMMENT 'Unique individual across all organisations',</td>
<td> 'Whether the observation is marked as a problem'</td>
<td> person_id bigint NOT NULL COMMENT 'Unique individual across all organisations',</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
<td>id</td>
<td>is_review</td>
<td>bigint</td>
<td>tinyint(1)</td>
<td>NOT NULL</td>
<td>NOT NULL</td>
<td> COMMENT 'Unique Id of the diagnostic order',</td>
<td> 'Whether the observation is a review of an existing problem'</td>
<td> id bigint NOT NULL COMMENT 'Unique Id of the diagnostic order',</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
<td>encounter_id</td>
<td>problem_end_date</td>
<td>bigint</td>
<td>date</td>
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> COMMENT 'Reference to the encounter the observation was recorded at',</td>
<td> 'The end date of the problem'</td>
<td> encounter_id bigint DEFAULT NULL COMMENT 'Reference to the encounter the observation was recorded at',</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
<td>practitioner_id</td>
<td>parent_observation_id</td>
<td>bigint</td>
<td>bigint</td>
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> COMMENT 'The clinician the activity is recorded against',</td>
<td> 'Reference to the parent observation in a complex observation eg systolic and diastolic blood pressures will have a parent observation of Blood pressure'</td>
<td> practitioner_id bigint DEFAULT NULL COMMENT 'The clinician the activity is recorded against',</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
</tbody>
</table>
<h2><span class="mw-headline" id="Sortable_tables">Encounter</span></h2>
<table class="sortable" border="1" style="border-collapse:collapse">
<tr>
<th scope="col" width="10%">Column Name</th>
<th scope="col" width="10%">Type</th>
<th scope="col" width="10%">Constraint</th>
<th scope="col" width="10%">Comment</th>
<th scope="col" width="10%">Sql</th>
</tr>
<tbody>
<tr>
<tr>
<td>id</td>
<td>core_concept_id</td>
<td>bigint</td>
<td>int</td>
<td>NOT NULL</td>
<td>DEFAULT NULL</td>
<td> COMMENT 'Unique Id of the encounter',</td>
<td> 'Reference to the clinical coding of the observation'</td>
<td> id bigint NOT NULL COMMENT 'Unique Id of the encounter',</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
<td>date_precision_concept_id</td>
<td>non_core_concept_id</td>
<td>int</td>
<td>int</td>
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> COMMENT 'Reference to the precision of the date of the encounter',</td>
<td> 'Reference to the clinical coding of the observation'</td>
<td> date_precision_concept_id int DEFAULT NULL COMMENT 'Reference to the precision of the date of the encounter',</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
<td>clinical_effective_date</td>
<td>age_at_event</td>
<td>date</td>
<td>decimal(5,2)</td>
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> COMMENT 'The date the clinical code is recorded for',</td>
<td> 'The age of the patient at the time of the observation'</td>
<td> clinical_effective_date date DEFAULT NULL COMMENT 'The date the clinical code is recorded for',</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
<td>patient_id</td>
<td>episodicity_concept_id</td>
<td>bigint</td>
<td>int</td>
<td>NOT NULL</td>
<td>DEFAULT NULL</td>
<td> COMMENT 'The organisations record for this person’s registration. Patients may have multiple records across clinical systems and may have registered at an organisation multiple times',</td>
<td> 'Reference to the episodicity of the problem eg First, review, flare'</td>
<td> patient_id bigint NOT NULL COMMENT 'The organisations record for this person’s registration. Patients may have multiple records across clinical systems and may have registered at an organisation multiple times',</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
<td>end_date</td>
<td>is_primary</td>
<td>date</td>
<td>tinyint(1)</td>
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> COMMENT 'The end date of the encounter',</td>
<td> 'Whether the diagnostic order is a primary order'</td>
<td> end_date date DEFAULT NULL COMMENT 'The end date of the encounter',</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
<td>date_recorded</td>
<td>date_recorded</td>
<td>datetime</td>
<td>datetime</td>
<td>DEFAULT NULL</td>
<td>DEFAULT NULL,</td>
<td> COMMENT 'The date the encounter was recorded',</td>
<td>No comment yet added</td>
<td> date_recorded datetime DEFAULT NULL COMMENT 'The date the encounter was recorded',</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
<td>organization_id</td>
<td colspan="5">Unique index name: `diagnostic_order_id` Index Columns: (id)</td> </tr> <tr>
<td colspan="5">Index name: `fk_diagnostic_order_encounter_id` Index Columns: (encounter_id)</td> </tr> <tr>
<td colspan="5">Index name: `fk_diagnostic_order_patient_id_organization_id` Index Columns: (patient_id,organization_id)</td> </tr> <tr>
<td colspan="5">Index name: `fk_diagnostic_order_practitioner_id` Index Columns: (practitioner_id)</td> </tr> <tr>
<td colspan="5">Index name: `diagnostic_order_patient_id` Index Columns: (patient_id)</td> </tr> <tr>
<td colspan="5">Index name: `diagnostic_order_core_concept_id` Index Columns: (core_concept_id)</td> </tr> <tr>
<td colspan="5">Index name: `diagnostic_order_core_concept_id_is_problem` Index Columns: (core_concept_id,is_problem)</td> </tr> <tr>
<td colspan="5">Index name: `diagnostic_order_core_concept_id_result_value` Index Columns: (core_concept_id,result_value)</td> </tr> <tr>
<td colspan="5">Index name: `diagnostic_order_non_core_concept_id` Index Columns: (non_core_concept_id)</td> </tr> <tr>
<td colspan="5">Index name: `ix_diagnostic_order_organization_id` Index Columns: (organization_id)</td> </tr> <tr>
<td colspan="5">Index name: `ix_diagnostic_order_clinical_effective_date` Index Columns: (clinical_effective_date)</td> </tr> <tr>
<td colspan="5">Index name: `ix_diagnostic_order_person_id` Index Columns: (person_id)</td> </tr> <tr>
<td colspan="5">PRIMARY KEY CONSTRAINT(s) (`organization_id`,`person_id`,`id`)</td> </tr> </table>
<h1><span class="mw-headline" id="Sortable_tables">encounter</span></h1>
<table class="mw-collapsible" border="1" style="border-collapse:collapse">
<tr>
<th scope="col">Column Name</th>
<th scope="col">Data Type</th>
<th scope="col">Constraint</th>
<th scope="col">Comment</th>
<th scope="col">Foreign Key Reference</th>
</tr>
<tr>
<td>id</td>
<td>bigint</td>
<td>bigint</td>
<td>NOT NULL</td>
<td>NOT NULL</td>
<td> COMMENT 'Owning organisation (i.e. publisher)',</td>
<td> 'Unique Id of the encounter'</td>
<td> organization_id bigint NOT NULL COMMENT 'Owning organisation (i.e. publisher)',</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
<td>admission_method</td>
<td>organization_id</td>
<td>varchar(40)</td>
<td>bigint</td>
<td>NOT NULL</td>
<td> 'Owning organisation (i.e. publisher)'</td>
<td>patient.organization_id</td>
</tr>
<tr>
<td>patient_id</td>
<td>bigint</td>
<td>NOT NULL</td>
<td> 'The organisations record for this person’s registration. Patients may have multiple records across clinical systems and may have registered at an organisation multiple times'</td>
<td>patient.id</td>
</tr>
<tr>
<td>person_id</td>
<td>bigint</td>
<td>NOT NULL</td>
<td> 'Unique individual across all organisations'</td>
<td>No Foreign Key reference</td>
</tr>
<tr>
<td>practitioner_id</td>
<td>bigint</td>
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> COMMENT 'The admission method of the encounter',</td>
<td> 'The clinician the activity is recorded against'</td>
<td> admission_method varchar(40) DEFAULT NULL COMMENT 'The admission method of the encounter',</td>
<td>practitioner.id</td>
</tr>
</tr>
<tr>
<tr>
Line 624: Line 682:
<td>bigint</td>
<td>bigint</td>
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> COMMENT 'Reference to the appointment this encounter took part on',</td>
<td> 'Reference to the appointment this encounter took part on'</td>
<td> appointment_id bigint DEFAULT NULL COMMENT 'Reference to the appointment this encounter took part on',</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
<td>episode_of_care_id</td>
<td>clinical_effective_date</td>
<td>bigint</td>
<td>date</td>
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> COMMENT 'Is this instance of the code a review of a previous encounter',</td>
<td> 'The date the clinical code is recorded for'</td>
<td> episode_of_care_id bigint DEFAULT NULL COMMENT 'Is this instance of the code a review of a previous encounter',</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
<td>non_core_concept_id</td>
<td>date_precision_concept_id</td>
<td>int</td>
<td>int</td>
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> COMMENT 'Reference to the type of encounter',</td>
<td> 'Reference to the precision of the date of the encounter'</td>
<td> non_core_concept_id int DEFAULT NULL COMMENT 'Reference to the type of encounter',</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
<td>age_at_event</td>
<td>episode_of_care_id</td>
<td>decimal(5,2)</td>
<td>bigint</td>
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> COMMENT 'The age the patient was when this encounter took place',</td>
<td> 'Is this instance of the code a review of a previous encounter'</td>
<td> age_at_event decimal(5,2) DEFAULT NULL COMMENT 'The age the patient was when this encounter took place',</td>
<td>episode_of_care.id</td>
</tr>
</tr>
<tr>
<tr>
Line 652: Line 710:
<td>bigint</td>
<td>bigint</td>
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> COMMENT 'Reference to the service provider organisation',</td>
<td> 'Reference to the service provider organisation'</td>
<td> service_provider_organization_id bigint DEFAULT NULL COMMENT 'Reference to the service provider organisation',</td>
<td>organization.id</td>
</tr>
</tr>
<tr>
<tr>
Line 659: Line 717:
<td>int</td>
<td>int</td>
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> COMMENT 'Reference to the type of encounter',</td>
<td> 'Reference to the type of encounter'</td>
<td> core_concept_id int DEFAULT NULL COMMENT 'Reference to the type of encounter',</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
<td>person_id</td>
<td>non_core_concept_id</td>
<td>bigint</td>
<td>int</td>
<td>NOT NULL</td>
<td>DEFAULT NULL</td>
<td> COMMENT 'Unique individual across all organisations',</td>
<td> 'Reference to the type of encounter'</td>
<td> person_id bigint NOT NULL COMMENT 'Unique individual across all organisations',</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
<td>practitioner_id</td>
<td>age_at_event</td>
<td>bigint</td>
<td>decimal(5,2)</td>
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> COMMENT 'The clinician the activity is recorded against',</td>
<td> 'The age the patient was when this encounter took place'</td>
<td> practitioner_id bigint DEFAULT NULL COMMENT 'The clinician the activity is recorded against',</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
</tbody>
</table>
<h2><span class="mw-headline" id="Sortable_tables">Encounter_additional</span></h2>
<table class="sortable" border="1" style="border-collapse:collapse">
<tr>
<th scope="col" width="10%">Column Name</th>
<th scope="col" width="10%">Type</th>
<th scope="col" width="10%">Constraint</th>
<th scope="col" width="10%">Comment</th>
<th scope="col" width="10%">Sql</th>
</tr>
<tbody>
<tr>
<tr>
<td>id</td>
<td>type</td>
<td>bigint</td>
<td>text</td>
<td>NOT NULL</td>
<td>No Constraint</td>
<td> COMMENT 'same as the id column on the encounter table',</td>
<td> 'Unused'</td>
<td> id bigint NOT NULL COMMENT 'same as the id column on the encounter table',</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
<td>property_id</td>
<td>sub_type</td>
<td>int</td>
<td>text</td>
<td>NOT NULL</td>
<td>No Constraint</td>
<td> COMMENT 'IM concept id reference (i.e. Admission method)',</td>
<td> 'Unused'</td>
<td> property_id int NOT NULL COMMENT 'IM concept id reference (i.e. Admission method)',</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
<td>json_value</td>
<td>admission_method</td>
<td>json</td>
<td>varchar(40)</td>
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> COMMENT 'where there is no mapped value_id, just raw JSON (i.e. birth delivery details)',</td>
<td> 'The admission method of the encounter'</td>
<td> json_value json DEFAULT NULL COMMENT 'where there is no mapped value_id, just raw JSON (i.e. birth delivery details)',</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
<td>value_id</td>
<td>end_date</td>
<td>int</td>
<td>date</td>
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> COMMENT 'IM concept id reference (i.e. Emergency admission)',</td>
<td> 'The end date of the encounter'</td>
<td> value_id int DEFAULT NULL COMMENT 'IM concept id reference (i.e. Emergency admission)',</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
<td>text_value</td>
<td>institution_location_id</td>
<td>varchar(255)</td>
<td>text</td>
<td>No Constraint</td>
<td> 'Reference to the institution the encounter took place at'</td>
<td>No Foreign Key reference</td>
</tr>
<tr>
<td>date_recorded</td>
<td>datetime</td>
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> COMMENT 'where there is no mapped value_id, or raw JSON, just a basic text value (i.e. FIN number)',</td>
<td> 'The date the encounter was recorded'</td>
<td> text_value varchar(255) DEFAULT NULL COMMENT 'where there is no mapped value_id, or raw JSON, just a basic text value (i.e. FIN number)',</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
</tbody>
<tr>
</table>
<td colspan="5">Unique index name: `encounter_id` Index Columns: (id)</td> </tr> <tr>
<h2><span class="mw-headline" id="Sortable_tables">Encounter_event</span></h2>
<td colspan="5">Index name: `fk_encounter_practitioner_id` Index Columns: (practitioner_id)</td> </tr> <tr>
<table class="sortable" border="1" style="border-collapse:collapse">
<td colspan="5">Index name: `fk_encounter_episode_of_care_id` Index Columns: (episode_of_care_id)</td> </tr> <tr>
<td colspan="5">Index name: `fk_encounter_service_provider_organization_id` Index Columns: (service_provider_organization_id)</td> </tr> <tr>
<td colspan="5">Index name: `encounter_patient_id` Index Columns: (patient_id)</td> </tr> <tr>
<td colspan="5">Index name: `fki_encounter_appointment_id` Index Columns: (appointment_id)</td> </tr> <tr>
<td colspan="5">Index name: `fki_encounter_patient_id_organization_id` Index Columns: (patient_id,organization_id)</td> </tr> <tr>
<td colspan="5">Index name: `encounter_core_concept_id_clinical_effective_date` Index Columns: (core_concept_id,clinical_effective_date)</td> </tr> <tr>
<td colspan="5">PRIMARY KEY CONSTRAINT(s) (`organization_id`,`person_id`,`id`)</td> </tr> </table>
<h1><span class="mw-headline" id="Sortable_tables">encounter_additional</span></h1>
<table class="mw-collapsible" border="1" style="border-collapse:collapse">
<tr>
<tr>
<th scope="col" width="10%">Column Name</th>
<th scope="col">Column Name</th>
<th scope="col" width="10%">Type</th>
<th scope="col">Data Type</th>
<th scope="col" width="10%">Constraint</th>
<th scope="col">Constraint</th>
<th scope="col" width="10%">Comment</th>
<th scope="col">Comment</th>
<th scope="col" width="10%">Sql</th>
<th scope="col">Foreign Key Reference</th>
</tr>
</tr>
<tbody>
<tr>
<tr>
<td>date_precision_concept_id</td>
<td>id</td>
<td>bigint</td>
<td>NOT NULL</td>
<td> 'same as the id column on the encounter table'</td>
<td>No Foreign Key reference</td>
</tr>
<tr>
<td>property_id</td>
<td>int</td>
<td>int</td>
<td>DEFAULT NULL</td>
<td>NOT NULL</td>
<td> COMMENT 'Reference to the precision of the date of the encounter',</td>
<td> 'IM concept id reference (i.e. Admission method)'</td>
<td> date_precision_concept_id int DEFAULT NULL COMMENT 'Reference to the precision of the date of the encounter',</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
<td>end_date</td>
<td>value_id</td>
<td>date</td>
<td>int</td>
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> COMMENT 'The end date of the encounter',</td>
<td> 'IM concept id reference (i.e. Emergency admission)'</td>
<td> end_date date DEFAULT NULL COMMENT 'The end date of the encounter',</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
<td>date_recorded</td>
<td>json_value</td>
<td>datetime</td>
<td>json</td>
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> COMMENT 'The date the encounter was recorded',</td>
<td> 'where there is no mapped value_id, just raw JSON (i.e. birth delivery details)'</td>
<td> date_recorded datetime DEFAULT NULL COMMENT 'The date the encounter was recorded',</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
<td>organization_id</td>
<td>text_value</td>
<td>bigint</td>
<td>varchar(255)</td>
<td>NOT NULL</td>
<td>DEFAULT NULL</td>
<td> COMMENT 'Owning organisation (i.e. publisher)',</td>
<td> 'where there is no mapped value_id, or raw JSON, just a basic text value (i.e. FIN number)'</td>
<td> organization_id bigint NOT NULL COMMENT 'Owning organisation (i.e. publisher)',</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
<td>person_id</td>
<td colspan="5">Index name: `encounter_additional_value_id` Index Columns: (value_id)</td> </tr> <tr>
<td colspan="5">PRIMARY KEY CONSTRAINT(s) (`id`,`property_id`)</td> </tr> </table>
<h1><span class="mw-headline" id="Sortable_tables">encounter_event</span></h1>
<table class="mw-collapsible" border="1" style="border-collapse:collapse">
<tr>
<th scope="col">Column Name</th>
<th scope="col">Data Type</th>
<th scope="col">Constraint</th>
<th scope="col">Comment</th>
<th scope="col">Foreign Key Reference</th>
</tr>
<tr>
<td>id</td>
<td>bigint</td>
<td>bigint</td>
<td>NOT NULL</td>
<td>NOT NULL</td>
<td> COMMENT 'The person this event belongs to',</td>
<td> 'Unique Id of the encounter event'</td>
<td> person_id bigint NOT NULL COMMENT 'The person this event belongs to',</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
<td>admission_method</td>
<td>organization_id</td>
<td>varchar(40)</td>
<td>bigint</td>
<td>DEFAULT NULL</td>
<td>NOT NULL</td>
<td> COMMENT 'The admission method of the encounter',</td>
<td> 'Owning organisation (i.e. publisher)'</td>
<td> admission_method varchar(40) DEFAULT NULL COMMENT 'The admission method of the encounter',</td>
<td>patient.organization_id</td>
</tr>
</tr>
<tr>
<tr>
<td>appointment_id</td>
<td>patient_id</td>
<td>bigint</td>
<td>bigint</td>
<td>DEFAULT NULL</td>
<td>NOT NULL</td>
<td> COMMENT 'Reference to the appointment this encounter took part on',</td>
<td> 'The patient this event belongs to'</td>
<td> appointment_id bigint DEFAULT NULL COMMENT 'Reference to the appointment this encounter took part on',</td>
<td>patient.id</td>
</tr>
</tr>
<tr>
<tr>
<td>age_at_event</td>
<td>person_id</td>
<td>decimal(5,2)</td>
<td>bigint</td>
<td>DEFAULT NULL</td>
<td>NOT NULL</td>
<td> COMMENT 'The age of the patient at the time of the encounter',</td>
<td> 'The person this event belongs to'</td>
<td> age_at_event decimal(5,2) DEFAULT NULL COMMENT 'The age of the patient at the time of the encounter',</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
<td>finished</td>
<td>encounter_id</td>
<td>tinyint(1)</td>
<td>DEFAULT NULL</td>
<td> COMMENT 'Whether the encounter is finished',</td>
<td>  finished tinyint(1) DEFAULT NULL COMMENT 'Whether the encounter is finished',</td>
</tr>
<tr>
<td>id</td>
<td>bigint</td>
<td>bigint</td>
<td>NOT NULL</td>
<td>NOT NULL</td>
<td> COMMENT 'Unique Id of the encounter event',</td>
<td> 'Reference to the parent encounter record'</td>
<td> id bigint NOT NULL COMMENT 'Unique Id of the encounter event',</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
<td>clinical_effective_date</td>
<td>practitioner_id</td>
<td>bigint</td>
<td>DEFAULT NULL</td>
<td> 'The clinician the activity is recorded against'</td>
<td>practitioner.id</td>
</tr>
<tr>
<td>appointment_id</td>
<td>bigint</td>
<td>DEFAULT NULL</td>
<td> 'Reference to the appointment this encounter took part on'</td>
<td>No Foreign Key reference</td>
</tr>
<tr>
<td>clinical_effective_date</td>
<td>datetime</td>
<td>datetime</td>
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> COMMENT 'The date the encounter took place',</td>
<td> 'The date the encounter took place'</td>
<td> clinical_effective_date datetime DEFAULT NULL COMMENT 'The date the encounter took place',</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
<td>non_core_concept_id</td>
<td>date_precision_concept_id</td>
<td>int</td>
<td>int</td>
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> COMMENT 'Reference to the type of encounter',</td>
<td> 'Reference to the precision of the date of the encounter'</td>
<td> non_core_concept_id int DEFAULT NULL COMMENT 'Reference to the type of encounter',</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
Line 823: Line 909:
<td>bigint</td>
<td>bigint</td>
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> COMMENT 'Reference to the episode of care this encounter belongs to',</td>
<td> 'Reference to the episode of care this encounter belongs to'</td>
<td> episode_of_care_id bigint DEFAULT NULL COMMENT 'Reference to the episode of care this encounter belongs to',</td>
<td>episode_of_care.id</td>
</tr>
</tr>
<tr>
<tr>
Line 830: Line 916:
<td>bigint</td>
<td>bigint</td>
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> COMMENT 'Reference to the service provider organisation',</td>
<td> 'Reference to the service provider organisation'</td>
<td> service_provider_organization_id bigint DEFAULT NULL COMMENT 'Reference to the service provider organisation',</td>
<td>organization.id</td>
</tr>
</tr>
<tr>
<tr>
Line 837: Line 923:
<td>int</td>
<td>int</td>
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> COMMENT 'Reference to the type of encounter',</td>
<td> 'Reference to the type of encounter'</td>
<td> core_concept_id int DEFAULT NULL COMMENT 'Reference to the type of encounter',</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
<td>institution_location_id</td>
<td>non_core_concept_id</td>
<td>bigint</td>
<td>int</td>
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> COMMENT 'Reference to the institution the encounter took place at',</td>
<td> 'Reference to the type of encounter'</td>
<td> institution_location_id bigint DEFAULT NULL COMMENT 'Reference to the institution the encounter took place at',</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
<td>practitioner_id</td>
<td>age_at_event</td>
<td>bigint</td>
<td>decimal(5,2)</td>
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> COMMENT 'The clinician the activity is recorded against',</td>
<td> 'The age of the patient at the time of the encounter'</td>
<td> practitioner_id bigint DEFAULT NULL COMMENT 'The clinician the activity is recorded against',</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
<td>patient_id</td>
<td>type</td>
<td>bigint</td>
<td>text</td>
<td>NOT NULL</td>
<td>No Constraint</td>
<td> COMMENT 'The patient this event belongs to',</td>
<td> 'Unused'</td>
<td> patient_id bigint NOT NULL COMMENT 'The patient this event belongs to',</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
<td>encounter_id</td>
<td>sub_type</td>
<td>bigint</td>
<td>text</td>
<td>NOT NULL</td>
<td>No Constraint</td>
<td> COMMENT 'Reference to the parent encounter record',</td>
<td> 'Unused'</td>
<td> encounter_id bigint NOT NULL COMMENT 'Reference to the parent encounter record',</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
</tbody>
</table>
<h2><span class="mw-headline" id="Sortable_tables">Episode_of_care</span></h2>
<table class="sortable" border="1" style="border-collapse:collapse">
<tr>
<th scope="col" width="10%">Column Name</th>
<th scope="col" width="10%">Type</th>
<th scope="col" width="10%">Constraint</th>
<th scope="col" width="10%">Comment</th>
<th scope="col" width="10%">Sql</th>
</tr>
<tbody>
<tr>
<tr>
<td>patient_id</td>
<td>admission_method</td>
<td>bigint</td>
<td>varchar(40)</td>
<td>NOT NULL</td>
<td>DEFAULT NULL</td>
<td> COMMENT 'The organisations record for this person’s registration. Patients may have multiple records across clinical systems and may have registered at an organisation multiple times',</td>
<td> 'The admission method of the encounter'</td>
<td> patient_id bigint NOT NULL COMMENT 'The organisations record for this person’s registration. Patients may have multiple records across clinical systems and may have registered at an organisation multiple times',</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
<td>id</td>
<td>end_date</td>
<td>bigint</td>
<td>date</td>
<td>NOT NULL</td>
<td> COMMENT 'Unique Id of the episode of care',</td>
<td>  id bigint NOT NULL COMMENT 'Unique Id of the episode of care',</td>
</tr>
<tr>
<td>registration_status_concept_id</td>
<td>int</td>
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> COMMENT 'Reference to the registration status of the patient',</td>
<td> 'The end date of the encounter'</td>
<td> registration_status_concept_id int DEFAULT NULL COMMENT 'Reference to the registration status of the patient',</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
<td>organization_id</td>
<td>institution_location_id</td>
<td>bigint</td>
<td>bigint</td>
<td>NOT NULL</td>
<td>DEFAULT NULL</td>
<td> COMMENT 'Owning organisation (i.e. publisher)',</td>
<td> 'Reference to the institution the encounter took place at'</td>
<td> organization_id bigint NOT NULL COMMENT 'Owning organisation (i.e. publisher)',</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
<td>registration_type_concept_id</td>
<td>date_recorded</td>
<td>int</td>
<td>datetime</td>
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> COMMENT 'Reference to the registration type of the patient',</td>
<td> 'The date the encounter was recorded'</td>
<td> registration_type_concept_id int DEFAULT NULL COMMENT 'Reference to the registration type of the patient',</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
<td>date_registered</td>
<td>finished</td>
<td>date</td>
<td>tinyint(1)</td>
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> COMMENT 'The date the registration was started  for this episode of care',</td>
<td> 'Whether the encounter is finished'</td>
<td> date_registered date DEFAULT NULL COMMENT 'The date the registration was started  for this episode of care',</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
<td>person_id</td>
<td colspan="5">Unique index name: `encounter_event_id` Index Columns: (id)</td> </tr> <tr>
<td colspan="5">Index name: `fk_encounter_event_patient_id_organization_id` Index Columns: (patient_id,organization_id)</td> </tr> <tr>
<td colspan="5">Index name: `fk_encounter_event_practitioner_id` Index Columns: (practitioner_id)</td> </tr> <tr>
<td colspan="5">Index name: `fk_encounter_event_episode_of_care_id` Index Columns: (episode_of_care_id)</td> </tr> <tr>
<td colspan="5">Index name: `fk_encounter_event_service_provider_organization_id` Index Columns: (service_provider_organization_id)</td> </tr> <tr>
<td colspan="5">PRIMARY KEY CONSTRAINT(s) (`organization_id`,`person_id`,`id`)</td> </tr> </table>
<h1><span class="mw-headline" id="Sortable_tables">episode_of_care</span></h1>
<table class="mw-collapsible" border="1" style="border-collapse:collapse">
<tr>
<th scope="col">Column Name</th>
<th scope="col">Data Type</th>
<th scope="col">Constraint</th>
<th scope="col">Comment</th>
<th scope="col">Foreign Key Reference</th>
</tr>
<tr>
<td>id</td>
<td>bigint</td>
<td>bigint</td>
<td>NOT NULL</td>
<td>NOT NULL</td>
<td> COMMENT 'Unique individual across all organisations',</td>
<td> 'Unique Id of the episode of care'</td>
<td> person_id bigint NOT NULL COMMENT 'Unique individual across all organisations',</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
<td>date_registered_end</td>
<td>organization_id</td>
<td>date</td>
<td>bigint</td>
<td>DEFAULT NULL</td>
<td>NOT NULL</td>
<td> COMMENT 'The date the registration was ended  for this episode of care',</td>
<td> 'Owning organisation (i.e. publisher)'</td>
<td> date_registered_end date DEFAULT NULL COMMENT 'The date the registration was ended  for this episode of care',</td>
<td>patient.organization_id</td>
</tr>
</tr>
<tr>
<tr>
<td>usual_gp_practitioner_id</td>
<td>patient_id</td>
<td>bigint</td>
<td>bigint</td>
<td>DEFAULT NULL</td>
<td> COMMENT 'Reference to the usual GP for this episode of care',</td>
<td>  usual_gp_practitioner_id bigint DEFAULT NULL COMMENT 'Reference to the usual GP for this episode of care',</td>
</tr>
</tbody>
</table>
<h2><span class="mw-headline" id="Sortable_tables">Event_log</span></h2>
<table class="sortable" border="1" style="border-collapse:collapse">
<tr>
<th scope="col" width="10%">Column Name</th>
<th scope="col" width="10%">Type</th>
<th scope="col" width="10%">Constraint</th>
<th scope="col" width="10%">Comment</th>
<th scope="col" width="10%">Sql</th>
</tr>
<tbody>
<tr>
<td>dt_change</td>
<td>datetime(3)</td>
<td>NOT NULL</td>
<td>NOT NULL</td>
<td> COMMENT 'date time the change was made to this DB',</td>
<td> 'The organisations record for this person’s registration. Patients may have multiple records across clinical systems and may have registered at an organisation multiple times'</td>
<td> dt_change datetime(3) NOT NULL COMMENT 'date time the change was made to this DB',</td>
<td>patient.id</td>
</tr>
</tr>
<tr>
<tr>
<td>change_type</td>
<td>person_id</td>
<td>tinyint</td>
<td>bigint</td>
<td>NOT NULL</td>
<td>NOT NULL</td>
<td> COMMENT 'type of transaction 0=insert, 1=update, 2=delete',</td>
<td> 'Unique individual across all organisations'</td>
<td> change_type tinyint NOT NULL COMMENT 'type of transaction 0=insert, 1=update, 2=delete',</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
<td>table_id</td>
<td>registration_type_concept_id</td>
<td>tinyint</td>
<td>int</td>
<td>NOT NULL</td>
<td>DEFAULT NULL</td>
<td> COMMENT 'identifier of the table changed',</td>
<td> 'Reference to the registration type of the patient'</td>
<td> table_id tinyint NOT NULL COMMENT 'identifier of the table changed',</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
<td>record_id</td>
<td>registration_status_concept_id</td>
<td>bigint</td>
<td>int</td>
<td>NOT NULL</td>
<td>DEFAULT NULL</td>
<td> COMMENT 'id of the record changed'</td>
<td> 'Reference to the registration status of the patient'</td>
<td> record_id bigint NOT NULL COMMENT 'id of the record changed'</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
</tbody>
</table>
<h2><span class="mw-headline" id="Sortable_tables">Flag</span></h2>
<table class="sortable" border="1" style="border-collapse:collapse">
<tr>
<th scope="col" width="10%">Column Name</th>
<th scope="col" width="10%">Type</th>
<th scope="col" width="10%">Constraint</th>
<th scope="col" width="10%">Comment</th>
<th scope="col" width="10%">Sql</th>
</tr>
<tbody>
<tr>
<tr>
<td>patient_id</td>
<td>date_registered</td>
<td>bigint</td>
<td>date</td>
<td>NOT NULL</td>
<td>DEFAULT NULL</td>
<td> COMMENT 'The organisations record for this person’s registration. Patients may have multiple records across clinical systems and may have registered at an organisation multiple times',</td>
<td> 'The date the registration was started  for this episode of care'</td>
<td> patient_id bigint NOT NULL COMMENT 'The organisations record for this person’s registration. Patients may have multiple records across clinical systems and may have registered at an organisation multiple times',</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
<td>effective_date</td>
<td>date_registered_end</td>
<td>date</td>
<td>date</td>
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> COMMENT 'The date the flag was entered onto the patients record',</td>
<td> 'The date the registration was ended  for this episode of care'</td>
<td> effective_date date DEFAULT NULL COMMENT 'The date the flag was entered onto the patients record',</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
<td>is_active</td>
<td>usual_gp_practitioner_id</td>
<td>tinyint(1)</td>
<td>bigint</td>
<td>NOT NULL</td>
<td>DEFAULT NULL</td>
<td> COMMENT 'Whether the flag is active or not',</td>
<td> 'Reference to the usual GP for this episode of care'</td>
<td> is_active tinyint(1) NOT NULL COMMENT 'Whether the flag is active or not',</td>
<td>practitioner.id</td>
</tr>
</tr>
<tr>
<tr>
<td>organization_id</td>
<td colspan="5">Unique index name: `episode_of_care_id` Index Columns: (id)</td> </tr> <tr>
<td>bigint</td>
<td colspan="5">Index name: `fk_episode_of_care_patient_id_organisation_id` Index Columns: (patient_id,organization_id)</td> </tr> <tr>
<td colspan="5">Index name: `fk_episode_of_care_practitioner_id` Index Columns: (usual_gp_practitioner_id)</td> </tr> <tr>
<td colspan="5">Index name: `episode_of_care_patient_id` Index Columns: (patient_id)</td> </tr> <tr>
<td colspan="5">Index name: `episode_of_care_registration_type_concept_id` Index Columns: (registration_type_concept_id)</td> </tr> <tr>
<td colspan="5">Index name: `episode_of_care_date_registered` Index Columns: (date_registered)</td> </tr> <tr>
<td colspan="5">Index name: `episode_of_care_date_registered_end` Index Columns: (date_registered_end)</td> </tr> <tr>
<td colspan="5">Index name: `episode_of_care_person_id` Index Columns: (person_id)</td> </tr> <tr>
<td colspan="5">Index name: `episode_of_care_organization_id` Index Columns: (organization_id)</td> </tr> <tr>
<td colspan="5">PRIMARY KEY CONSTRAINT(s) (`organization_id`,`person_id`,`id`)</td> </tr> </table>
<h1><span class="mw-headline" id="Sortable_tables">event_log</span></h1>
<table class="mw-collapsible" border="1" style="border-collapse:collapse">
<tr>
<th scope="col">Column Name</th>
<th scope="col">Data Type</th>
<th scope="col">Constraint</th>
<th scope="col">Comment</th>
<th scope="col">Foreign Key Reference</th>
</tr>
<tr>
<td>dt_change</td>
<td>datetime(3)</td>
<td>NOT NULL</td>
<td>NOT NULL</td>
<td> COMMENT 'Owning organisation (i.e. publisher)',</td>
<td> 'date time the change was made to this DB'</td>
<td> organization_id bigint NOT NULL COMMENT 'Owning organisation (i.e. publisher)',</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
<td>date_precision_concept_id</td>
<td>change_type</td>
<td>int</td>
<td>tinyint</td>
<td>DEFAULT NULL</td>
<td>NOT NULL</td>
<td> COMMENT 'Identifies the precision of the clinical effectiveness date to either year (1) month (2) day (5) minute (12) second (13) millisecond (14)',</td>
<td> 'type of transaction 0=insert, 1=update, 2=delete'</td>
<td> date_precision_concept_id int DEFAULT NULL COMMENT 'Identifies the precision of the clinical effectiveness date to either year (1) month (2) day (5) minute (12) second (13) millisecond (14)',</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
<td>person_id</td>
<td>table_id</td>
<td>bigint</td>
<td>tinyint</td>
<td>NOT NULL</td>
<td>NOT NULL</td>
<td> COMMENT 'Unique individual across all organisations',</td>
<td> 'identifier of the table changed'</td>
<td> person_id bigint NOT NULL COMMENT 'Unique individual across all organisations',</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
<td>id</td>
<td>record_id</td>
<td>bigint</td>
<td>bigint</td>
<td>NOT NULL</td>
<td>NOT NULL</td>
<td> COMMENT 'Unique Id of the flag',</td>
<td> 'id of the record changed'</td>
<td> id bigint NOT NULL COMMENT 'Unique Id of the flag',</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
</tbody>
</table>
</table>
<h1><span class="mw-headline" id="Sortable_tables">flag</span></h1>
<h2><span class="mw-headline" id="Sortable_tables">Location</span></h2>
<table class="mw-collapsible" border="1" style="border-collapse:collapse">
<table class="sortable" border="1" style="border-collapse:collapse">
<tr>
<tr>
<th scope="col" width="10%">Column Name</th>
<th scope="col">Column Name</th>
<th scope="col" width="10%">Type</th>
<th scope="col">Data Type</th>
<th scope="col" width="10%">Constraint</th>
<th scope="col">Constraint</th>
<th scope="col" width="10%">Comment</th>
<th scope="col">Comment</th>
<th scope="col" width="10%">Sql</th>
<th scope="col">Foreign Key Reference</th>
</tr>
</tr>
<tbody>
<tr>
<tr>
<td>name</td>
<td>id</td>
<td>varchar(255)</td>
<td>bigint</td>
<td>DEFAULT NULL</td>
<td>NOT NULL</td>
<td> COMMENT 'The name of a location set by the publisher. E.g. ward, clinic, domiciliary',</td>
<td> 'Unique Id of the flag'</td>
<td> name varchar(255) DEFAULT NULL COMMENT 'The name of a location set by the publisher. E.g. ward, clinic, domiciliary',</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
<td>type_desc</td>
<td>organization_id</td>
<td>varchar(255)</td>
<td>bigint</td>
<td>DEFAULT NULL</td>
<td>NOT NULL</td>
<td> COMMENT 'Textual description of the type of location eg GP Practice',</td>
<td> 'Owning organisation (i.e. publisher)'</td>
<td> type_desc varchar(255) DEFAULT NULL COMMENT 'Textual description of the type of location eg GP Practice',</td>
<td>patient.organization_id</td>
</tr>
</tr>
<tr>
<tr>
<td>postcode</td>
<td>patient_id</td>
<td>varchar(10)</td>
<td>bigint</td>
<td>DEFAULT NULL</td>
<td>NOT NULL</td>
<td> COMMENT 'The postcode of the location',</td>
<td> 'The organisations record for this person’s registration. Patients may have multiple records across clinical systems and may have registered at an organisation multiple times'</td>
<td> postcode varchar(10) DEFAULT NULL COMMENT 'The postcode of the location',</td>
<td>patient.id</td>
</tr>
</tr>
<tr>
<tr>
<td>managing_organization_id</td>
<td>person_id</td>
<td>bigint</td>
<td>bigint</td>
<td>NOT NULL</td>
<td> 'Unique individual across all organisations'</td>
<td>No Foreign Key reference</td>
</tr>
<tr>
<td>effective_date</td>
<td>datetime</td>
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> COMMENT 'Reference to the managing organisation of the location',</td>
<td> 'The date the flag was entered onto the patients record'</td>
<td> managing_organization_id bigint DEFAULT NULL COMMENT 'Reference to the managing organisation of the location',</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
<td>id</td>
<td>date_precision_concept_id</td>
<td>bigint</td>
<td>int</td>
<td>DEFAULT NULL</td>
<td> 'Identifies the precision of the clinical effectiveness date to either year (1) month (2) day (5) minute (12) second (13) millisecond (14)'</td>
<td>No Foreign Key reference</td>
</tr>
<tr>
<td>is_active</td>
<td>tinyint(1)</td>
<td>NOT NULL</td>
<td>NOT NULL</td>
<td> COMMENT 'Unique Id of the location',</td>
<td> 'Whether the flag is active or not'</td>
<td> id bigint NOT NULL COMMENT 'Unique Id of the location',</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
<td>type_code</td>
<td>flag_text</td>
<td>varchar(50)</td>
<td>text</td>
<td>DEFAULT NULL</td>
<td>No Constraint</td>
<td> COMMENT 'The type of location',</td>
<td> 'This is a warning set by the publisher regarding he patient'</td>
<td> type_code varchar(50) DEFAULT NULL COMMENT 'The type of location',</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
</tbody>
<tr>
</table>
<td colspan="5">Unique index name: `flag_id` Index Columns: (id)</td> </tr> <tr>
<h2><span class="mw-headline" id="Sortable_tables">Medication_order</span></h2>
<td colspan="5">Index name: `fk_flag_patient_id_organization_id` Index Columns: (patient_id,organization_id)</td> </tr> <tr>
<table class="sortable" border="1" style="border-collapse:collapse">
<td colspan="5">Index name: `flag_patient_id` Index Columns: (patient_id)</td> </tr> <tr>
<td colspan="5">PRIMARY KEY CONSTRAINT(s) (`organization_id`,`person_id`,`id`)</td> </tr> </table>
<h1><span class="mw-headline" id="Sortable_tables">location</span></h1>
<table class="mw-collapsible" border="1" style="border-collapse:collapse">
<tr>
<tr>
<th scope="col" width="10%">Column Name</th>
<th scope="col">Column Name</th>
<th scope="col" width="10%">Type</th>
<th scope="col">Data Type</th>
<th scope="col" width="10%">Constraint</th>
<th scope="col">Constraint</th>
<th scope="col" width="10%">Comment</th>
<th scope="col">Comment</th>
<th scope="col" width="10%">Sql</th>
<th scope="col">Foreign Key Reference</th>
</tr>
</tr>
<tbody>
<tr>
<tr>
<td>patient_id</td>
<td>id</td>
<td>bigint</td>
<td>bigint</td>
<td>NOT NULL</td>
<td>NOT NULL</td>
<td> COMMENT 'The organisations record for this person’s registration. Patients may have multiple records across clinical systems and may have registered at an organisation multiple times',</td>
<td> 'Unique Id of the location'</td>
<td> patient_id bigint NOT NULL COMMENT 'The organisations record for this person’s registration. Patients may have multiple records across clinical systems and may have registered at an organisation multiple times',</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
<td>core_concept_id</td>
<td>name</td>
<td>int</td>
<td>varchar(255)</td>
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> COMMENT 'Reference to the clinical coding of the medication',</td>
<td> 'The name of a location set by the publisher. E.g. ward, clinic, domiciliary'</td>
<td> core_concept_id int DEFAULT NULL COMMENT 'Reference to the clinical coding of the medication',</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
<td>encounter_id</td>
<td>type_code</td>
<td>bigint</td>
<td>varchar(50)</td>
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> COMMENT 'Reference to the encounter the medication order was issued in',</td>
<td> 'The type of location'</td>
<td> encounter_id bigint DEFAULT NULL COMMENT 'Reference to the encounter the medication order was issued in',</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
<td>non_core_concept_id</td>
<td>type_desc</td>
<td>int</td>
<td>varchar(255)</td>
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> COMMENT 'Reference to the clinical coding of the medication',</td>
<td> 'Textual description of the type of location eg GP Practice'</td>
<td> non_core_concept_id int DEFAULT NULL COMMENT 'Reference to the clinical coding of the medication',</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
<td>organization_id</td>
<td>postcode</td>
<td>bigint</td>
<td>varchar(10)</td>
<td>NOT NULL</td>
<td>DEFAULT NULL</td>
<td> COMMENT 'Owning organisation (i.e. publisher)',</td>
<td> 'The postcode of the location'</td>
<td> organization_id bigint NOT NULL COMMENT 'Owning organisation (i.e. publisher)',</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
<td>quantity_value</td>
<td>managing_organization_id</td>
<td>double</td>
<td>bigint</td>
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> COMMENT 'The value of the medication that was prescribed eg 50',</td>
<td> 'Reference to the managing organisation of the location'</td>
<td> quantity_value double DEFAULT NULL COMMENT 'The value of the medication that was prescribed eg 50',</td>
<td>organization.id</td>
</tr>
</tr>
<tr>
<td colspan="5">Unique index name: `location_id` Index Columns: (id)</td> </tr> <tr>
<td colspan="5">Index name: `fk_location_managing_organisation_id` Index Columns: (managing_organization_id)</td> </tr> <tr>
<td colspan="5">PRIMARY KEY CONSTRAINT(s) (`id`)</td> </tr> </table>
<h1><span class="mw-headline" id="Sortable_tables">medication_order</span></h1>
<table class="mw-collapsible" border="1" style="border-collapse:collapse">
<tr>
<th scope="col">Column Name</th>
<th scope="col">Data Type</th>
<th scope="col">Constraint</th>
<th scope="col">Comment</th>
<th scope="col">Foreign Key Reference</th>
</tr>
<tr>
<tr>
<td>id</td>
<td>id</td>
<td>bigint</td>
<td>bigint</td>
<td>NOT NULL</td>
<td>NOT NULL</td>
<td> COMMENT 'Unique Id of the medication order',</td>
<td> 'Unique Id of the medication order'</td>
<td> id bigint NOT NULL COMMENT 'Unique Id of the medication order',</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
<td>estimated_cost</td>
<td>organization_id</td>
<td>double</td>
<td>bigint</td>
<td>DEFAULT NULL</td>
<td>NOT NULL</td>
<td> COMMENT 'The estimated cost of the medication',</td>
<td> 'Owning organisation (i.e. publisher)'</td>
<td> estimated_cost double DEFAULT NULL COMMENT 'The estimated cost of the medication',</td>
<td>patient.organization_id</td>
</tr>
</tr>
<tr>
<tr>
<td>dose</td>
<td>patient_id</td>
<td>varchar(1000)</td>
<td>bigint</td>
<td>DEFAULT NULL</td>
<td>NOT NULL</td>
<td> COMMENT 'Textual description of the dose',</td>
<td> 'The organisations record for this person’s registration. Patients may have multiple records across clinical systems and may have registered at an organisation multiple times'</td>
<td> dose varchar(1000) DEFAULT NULL COMMENT 'Textual description of the dose',</td>
<td>patient.id</td>
</tr>
<tr>
<td>person_id</td>
<td>bigint</td>
<td>NOT NULL</td>
<td> 'Unique individual across all organisations'</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
<td>medication_statement_id</td>
<td>encounter_id</td>
<td>bigint</td>
<td>bigint</td>
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> COMMENT 'Reference to the medication statement.  A medication statement can have many medication orders',</td>
<td> 'Reference to the encounter the medication order was issued in'</td>
<td> medication_statement_id bigint DEFAULT NULL COMMENT 'Reference to the medication statement.  A medication statement can have many medication orders',</td>
<td>encounter.id</td>
</tr>
</tr>
<tr>
<tr>
<td>age_at_event</td>
<td>practitioner_id</td>
<td>decimal(5,2)</td>
<td>bigint</td>
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> COMMENT 'The age the patient was at the time of this event',</td>
<td> 'The clinician the activity is recorded against'</td>
<td> age_at_event decimal(5,2) DEFAULT NULL COMMENT 'The age the patient was at the time of this event',</td>
<td>practitioner.id</td>
</tr>
</tr>
<tr>
<tr>
Line 1,191: Line 1,297:
<td>date</td>
<td>date</td>
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> COMMENT 'The date the medication order was issued',</td>
<td> 'The date the medication order was issued'</td>
<td> clinical_effective_date date DEFAULT NULL COMMENT 'The date the medication order was issued',</td>
<td>No Foreign Key reference</td>
</tr>
<tr>
<td>quantity_unit</td>
<td>varchar(255)</td>
<td>DEFAULT NULL</td>
<td> COMMENT 'The unit of the medication that was prescribed eg tablets',</td>
<td>  quantity_unit varchar(255) DEFAULT NULL COMMENT 'The unit of the medication that was prescribed eg tablets',</td>
</tr>
</tr>
<tr>
<tr>
Line 1,205: Line 1,304:
<td>int</td>
<td>int</td>
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> COMMENT 'Identifies the precision of the clinical effectiveness date to either year (1) month (2) day (5) minute (12) second (13) millisecond (14)',</td>
<td> 'Identifies the precision of the clinical effectiveness date to either year (1) month (2) day (5) minute (12) second (13) millisecond (14)'</td>
<td> date_precision_concept_id int DEFAULT NULL COMMENT 'Identifies the precision of the clinical effectiveness date to either year (1) month (2) day (5) minute (12) second (13) millisecond (14)',</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
<td>duration_days</td>
<td>dose</td>
<td>int</td>
<td>varchar(1000)</td>
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> COMMENT 'How many days the medication is prescribed for',</td>
<td> 'Textual description of the dose'</td>
<td> duration_days int DEFAULT NULL COMMENT 'How many days the medication is prescribed for',</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
<td>person_id</td>
<td>quantity_value</td>
<td>bigint</td>
<td>double</td>
<td>NOT NULL</td>
<td>DEFAULT NULL</td>
<td> COMMENT 'Unique individual across all organisations',</td>
<td> 'The value of the medication that was prescribed eg 50'</td>
<td> person_id bigint NOT NULL COMMENT 'Unique individual across all organisations',</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
<td>bnf_reference</td>
<td>quantity_unit</td>
<td>varchar(6)</td>
<td>varchar(255)</td>
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> COMMENT 'A reference to the drug in the BNF dictionary',</td>
<td> 'The unit of the medication that was prescribed eg tablets'</td>
<td> bnf_reference varchar(6) DEFAULT NULL COMMENT 'A reference to the drug in the BNF dictionary',</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
<td>practitioner_id</td>
<td>duration_days</td>
<td>bigint</td>
<td>int</td>
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> COMMENT 'The clinician the activity is recorded against',</td>
<td> 'How many days the medication is prescribed for'</td>
<td> practitioner_id bigint DEFAULT NULL COMMENT 'The clinician the activity is recorded against',</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
</tbody>
</table>
<h2><span class="mw-headline" id="Sortable_tables">Medication_statement</span></h2>
<table class="sortable" border="1" style="border-collapse:collapse">
<tr>
<th scope="col" width="10%">Column Name</th>
<th scope="col" width="10%">Type</th>
<th scope="col" width="10%">Constraint</th>
<th scope="col" width="10%">Comment</th>
<th scope="col" width="10%">Sql</th>
</tr>
<tbody>
<tr>
<tr>
<td>authorisation_type_concept_id</td>
<td>estimated_cost</td>
<td>int</td>
<td>double</td>
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> COMMENT 'Reference to the authorisation type',</td>
<td> 'The estimated cost of the medication'</td>
<td> authorisation_type_concept_id int DEFAULT NULL COMMENT 'Reference to the authorisation type',</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
<td>patient_id</td>
<td>medication_statement_id</td>
<td>bigint</td>
<td>bigint</td>
<td>NOT NULL</td>
<td>DEFAULT NULL</td>
<td> COMMENT 'The organisations record for this person’s registration. Patients may have multiple records across clinical systems and may have registered at an organisation multiple times',</td>
<td> 'Reference to the medication statement.  A medication statement can have many medication orders'</td>
<td> patient_id bigint NOT NULL COMMENT 'The organisations record for this person’s registration. Patients may have multiple records across clinical systems and may have registered at an organisation multiple times',</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
Line 1,266: Line 1,353:
<td>int</td>
<td>int</td>
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> COMMENT 'Reference to the clinical coding of the medication',</td>
<td> 'Reference to the clinical coding of the medication'</td>
<td> core_concept_id int DEFAULT NULL COMMENT 'Reference to the clinical coding of the medication',</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
Line 1,273: Line 1,360:
<td>int</td>
<td>int</td>
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> COMMENT 'Reference to the clinical coding of the medication',</td>
<td> 'Reference to the clinical coding of the medication'</td>
<td> non_core_concept_id int DEFAULT NULL COMMENT 'Reference to the clinical coding of the medication',</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
<td>organization_id</td>
<td>bnf_reference</td>
<td>bigint</td>
<td>varchar(6)</td>
<td>NOT NULL</td>
<td>DEFAULT NULL</td>
<td> COMMENT 'Owning organisation (i.e. publisher)',</td>
<td> 'A reference to the drug in the BNF dictionary'</td>
<td> organization_id bigint NOT NULL COMMENT 'Owning organisation (i.e. publisher)',</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
<td>quantity_value</td>
<td>age_at_event</td>
<td>double</td>
<td>decimal(5,2)</td>
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> COMMENT 'The value of the medication that was prescribed eg 50',</td>
<td> 'The age the patient was at the time of this event'</td>
<td> quantity_value double DEFAULT NULL COMMENT 'The value of the medication that was prescribed eg 50',</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
<td>cancellation_date</td>
<td>issue_method</td>
<td>date</td>
<td>text</td>
<td>DEFAULT NULL</td>
<td>No Constraint</td>
<td> COMMENT 'The date the medication was cancelled',</td>
<td> 'The issue method of the medication eg hand written'</td>
<td> cancellation_date date DEFAULT NULL COMMENT 'The date the medication was cancelled',</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
<td>is_active</td>
<td>date_recorded</td>
<td>tinyint(1)</td>
<td>datetime</td>
<td>DEFAULT NULL</td>
<td>DEFAULT NULL,</td>
<td> COMMENT 'Whether the medication is active or not',</td>
<td>No comment yet added</td>
<td> is_active tinyint(1) DEFAULT NULL COMMENT 'Whether the medication is active or not',</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
<td>age_at_event</td>
<td colspan="5">Unique index name: `medication_order_id` Index Columns: (id)</td> </tr> <tr>
<td>decimal(5,2)</td>
<td colspan="5">Index name: `fk_medication_order_encounter_id` Index Columns: (encounter_id)</td> </tr> <tr>
<td>DEFAULT NULL</td>
<td colspan="5">Index name: `fk_medication_order_patient_id_organization_id` Index Columns: (patient_id,organization_id)</td> </tr> <tr>
<td> COMMENT 'The age the patient was at the time of this event',</td>
<td colspan="5">Index name: `fk_medication_order_practitioner_id` Index Columns: (practitioner_id)</td> </tr> <tr>
<td> age_at_event decimal(5,2) DEFAULT NULL COMMENT 'The age the patient was at the time of this event',</td>
<td colspan="5">Index name: `medication_order_patient_id` Index Columns: (patient_id)</td> </tr> <tr>
<td colspan="5">Index name: `medication_order_core_concept_id` Index Columns: (core_concept_id)</td> </tr> <tr>
<td colspan="5">PRIMARY KEY CONSTRAINT(s) (`organization_id`,`person_id`,`id`)</td> </tr> </table>
<h1><span class="mw-headline" id="Sortable_tables">medication_statement</span></h1>
<table class="mw-collapsible" border="1" style="border-collapse:collapse">
<tr>
<th scope="col">Column Name</th>
<th scope="col">Data Type</th>
<th scope="col">Constraint</th>
<th scope="col">Comment</th>
<th scope="col">Foreign Key Reference</th>
</tr>
<tr>
<td>id</td>
<td>bigint</td>
<td>NOT NULL</td>
<td> 'Unique Id of the medication'</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
<td>dose</td>
<td>organization_id</td>
<td>varchar(1000)</td>
<td>bigint</td>
<td>DEFAULT NULL</td>
<td>NOT NULL</td>
<td> COMMENT 'Texual description of the dose of the medication',</td>
<td> 'Owning organisation (i.e. publisher)'</td>
<td> dose varchar(1000) DEFAULT NULL COMMENT 'Texual description of the dose of the medication',</td>
<td>patient.organization_id</td>
</tr>
</tr>
<tr>
<tr>
<td>id</td>
<td>patient_id</td>
<td>bigint</td>
<td>bigint</td>
<td>NOT NULL</td>
<td>NOT NULL</td>
<td> COMMENT 'Unique Id of the medication',</td>
<td> 'The organisations record for this person’s registration. Patients may have multiple records across clinical systems and may have registered at an organisation multiple times'</td>
<td> id bigint NOT NULL COMMENT 'Unique Id of the medication',</td>
<td>patient.id</td>
</tr>
</tr>
<tr>
<tr>
<td>clinical_effective_date</td>
<td>person_id</td>
<td>date</td>
<td>bigint</td>
<td>DEFAULT NULL</td>
<td>NOT NULL</td>
<td> COMMENT 'The date the medication was clinical relevant',</td>
<td> 'Unique individual across all organisations'</td>
<td> clinical_effective_date date DEFAULT NULL COMMENT 'The date the medication was clinical relevant',</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
<td>quantity_unit</td>
<td>encounter_id</td>
<td>varchar(255)</td>
<td>bigint</td>
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> COMMENT 'The unit of the medication that was prescribed eg tablets',</td>
<td> 'Reference to the encounter this medication was recorded in'</td>
<td> quantity_unit varchar(255) DEFAULT NULL COMMENT 'The unit of the medication that was prescribed eg tablets',</td>
<td>encounter.id</td>
</tr>
</tr>
<tr>
<tr>
<td>date_precision_concept_id</td>
<td>practitioner_id</td>
<td>int</td>
<td>bigint</td>
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> COMMENT 'Identifies the precision of the clinical effectiveness date to either year (1) month (2) day (5) minute (12) second (13) millisecond (14)',</td>
<td> 'The clinician the activity is recorded against'</td>
<td> date_precision_concept_id int DEFAULT NULL COMMENT 'Identifies the precision of the clinical effectiveness date to either year (1) month (2) day (5) minute (12) second (13) millisecond (14)',</td>
<td>practitioner.id</td>
</tr>
</tr>
<tr>
<tr>
<td>person_id</td>
<td>clinical_effective_date</td>
<td>bigint</td>
<td>date</td>
<td>NOT NULL</td>
<td>DEFAULT NULL</td>
<td> COMMENT 'Unique individual across all organisations',</td>
<td> 'The date the medication was clinical relevant'</td>
<td> person_id bigint NOT NULL COMMENT 'Unique individual across all organisations',</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
<td>bnf_reference</td>
<td>date_precision_concept_id</td>
<td>varchar(6)</td>
<td>int</td>
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> COMMENT 'A reference to the drug in the BNF dictionary',</td>
<td> 'Identifies the precision of the clinical effectiveness date to either year (1) month (2) day (5) minute (12) second (13) millisecond (14)'</td>
<td> bnf_reference varchar(6) DEFAULT NULL COMMENT 'A reference to the drug in the BNF dictionary',</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
<td>practitioner_id</td>
<td>is_active</td>
<td>bigint</td>
<td>tinyint(1)</td>
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> COMMENT 'The clinician the activity is recorded against',</td>
<td> 'Whether the medication is active or not'</td>
<td> practitioner_id bigint DEFAULT NULL COMMENT 'The clinician the activity is recorded against',</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
<td>encounter_id</td>
<td>cancellation_date</td>
<td>bigint</td>
<td>date</td>
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> COMMENT 'Reference to the encounter this medication was recorded in',</td>
<td> 'The date the medication was cancelled'</td>
<td> encounter_id bigint DEFAULT NULL COMMENT 'Reference to the encounter this medication was recorded in',</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
</tbody>
</table>
<h2><span class="mw-headline" id="Sortable_tables">Observation</span></h2>
<table class="sortable" border="1" style="border-collapse:collapse">
<tr>
<th scope="col" width="10%">Column Name</th>
<th scope="col" width="10%">Type</th>
<th scope="col" width="10%">Constraint</th>
<th scope="col" width="10%">Comment</th>
<th scope="col" width="10%">Sql</th>
</tr>
<tbody>
<tr>
<tr>
<td>parent_observation_id</td>
<td>dose</td>
<td>bigint</td>
<td>varchar(1000)</td>
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> COMMENT 'Reference to the parent observation in a complex observation eg systolic and diastolic blood pressures will have a parent observation of Blood pressure',</td>
<td> 'Texual description of the dose of the medication'</td>
<td> parent_observation_id bigint DEFAULT NULL COMMENT 'Reference to the parent observation in a complex observation eg systolic and diastolic blood pressures will have a parent observation of Blood pressure',</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
<td>patient_id</td>
<td>quantity_value</td>
<td>bigint</td>
<td>NOT NULL</td>
<td> COMMENT 'The organisations record for this person’s registration. Patients may have multiple records across clinical systems and may have registered at an organisation multiple times',</td>
<td>  patient_id bigint NOT NULL COMMENT 'The organisations record for this person’s registration. Patients may have multiple records across clinical systems and may have registered at an organisation multiple times',</td>
</tr>
<tr>
<td>result_value</td>
<td>double</td>
<td>double</td>
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> COMMENT 'The value of the result of the observation',</td>
<td> 'The value of the medication that was prescribed eg 50'</td>
<td> result_value double DEFAULT NULL COMMENT 'The value of the result of the observation',</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
<td>problem_end_date</td>
<td>quantity_unit</td>
<td>date</td>
<td>varchar(255)</td>
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> COMMENT 'The end date of the problem',</td>
<td> 'The unit of the medication that was prescribed eg tablets'</td>
<td> problem_end_date date DEFAULT NULL COMMENT 'The end date of the problem',</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
<td>result_date</td>
<td>authorisation_type_concept_id</td>
<td>date</td>
<td>int</td>
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> COMMENT 'The date of the result',</td>
<td> 'Reference to the authorisation type'</td>
<td> result_date date DEFAULT NULL COMMENT 'The date of the result',</td>
<td>No Foreign Key reference</td>
</tr>
<tr>
<td>organization_id</td>
<td>bigint</td>
<td>NOT NULL</td>
<td> COMMENT 'Owning organisation (i.e. publisher)',</td>
<td>  organization_id bigint NOT NULL COMMENT 'Owning organisation (i.e. publisher)',</td>
</tr>
</tr>
<tr>
<tr>
Line 1,432: Line 1,510:
<td>int</td>
<td>int</td>
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> COMMENT 'Reference to the clinical coding of the observation',</td>
<td> 'Reference to the clinical coding of the medication'</td>
<td> core_concept_id int DEFAULT NULL COMMENT 'Reference to the clinical coding of the observation',</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
<td>id</td>
<td>non_core_concept_id</td>
<td>bigint</td>
<td>int</td>
<td>NOT NULL</td>
<td>DEFAULT NULL</td>
<td> COMMENT 'Unique Id of the observation',</td>
<td> 'Reference to the clinical coding of the medication'</td>
<td> id bigint NOT NULL COMMENT 'Unique Id of the observation',</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
<td>is_problem</td>
<td>bnf_reference</td>
<td>tinyint(1)</td>
<td>varchar(6)</td>
<td>NOT NULL</td>
<td> COMMENT 'Whether the observation is marked as a problem',</td>
<td>  is_problem tinyint(1) NOT NULL COMMENT 'Whether the observation is marked as a problem',</td>
</tr>
<tr>
<td>date_recorded</td>
<td>datetime</td>
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> COMMENT 'The date the observation was recorded in the system',</td>
<td> 'A reference to the drug in the BNF dictionary'</td>
<td> date_recorded datetime DEFAULT NULL COMMENT 'The date the observation was recorded in the system',</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
Line 1,460: Line 1,531:
<td>decimal(5,2)</td>
<td>decimal(5,2)</td>
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> COMMENT 'The age of the patient at the time of the observation',</td>
<td> 'The age the patient was at the time of this event'</td>
<td> age_at_event decimal(5,2) DEFAULT NULL COMMENT 'The age of the patient at the time of the observation',</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
<td>clinical_effective_date</td>
<td>issue_method</td>
<td>date</td>
<td>text</td>
<td>DEFAULT NULL</td>
<td>No Constraint</td>
<td> COMMENT 'The date the observation was identified by a clinician',</td>
<td> 'The issue method of the medication eg hand written'</td>
<td> clinical_effective_date date DEFAULT NULL COMMENT 'The date the observation was identified by a clinician',</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
<td>is_primary</td>
<td>date_recorded</td>
<td>tinyint(1)</td>
<td>datetime</td>
<td>DEFAULT NULL</td>
<td>DEFAULT NULL,</td>
<td> COMMENT 'Whether the observation is a primary observation',</td>
<td>No comment yet added</td>
<td> is_primary tinyint(1) DEFAULT NULL COMMENT 'Whether the observation is a primary observation',</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
<td>result_value_units</td>
<td colspan="5">Unique index name: `medication_statement_id` Index Columns: (id)</td> </tr> <tr>
<td>varchar(50)</td>
<td colspan="5">Index name: `fk_medication_statement_encounter_id` Index Columns: (encounter_id)</td> </tr> <tr>
<td>DEFAULT NULL</td>
<td colspan="5">Index name: `fk_medication_statement_patient_id_organization_id` Index Columns: (patient_id,organization_id)</td> </tr> <tr>
<td> COMMENT 'The units of the result of the observation',</td>
<td colspan="5">Index name: `fk_medication_statement_practitioner_id` Index Columns: (practitioner_id)</td> </tr> <tr>
<td> result_value_units varchar(50) DEFAULT NULL COMMENT 'The units of the result of the observation',</td>
<td colspan="5">Index name: `medication_statement_patient_id` Index Columns: (patient_id)</td> </tr> <tr>
</tr>
<td colspan="5">Index name: `medication_statement_dmd_id` Index Columns: (patient_id)</td> </tr> <tr>
<td colspan="5">PRIMARY KEY CONSTRAINT(s) (`organization_id`,`person_id`,`id`)</td> </tr> </table>
<h1><span class="mw-headline" id="Sortable_tables">observation</span></h1>
<table class="mw-collapsible" border="1" style="border-collapse:collapse">
<tr>
<th scope="col">Column Name</th>
<th scope="col">Data Type</th>
<th scope="col">Constraint</th>
<th scope="col">Comment</th>
<th scope="col">Foreign Key Reference</th>
</tr>
<tr>
<tr>
<td>non_core_concept_id</td>
<td>id</td>
<td>int</td>
<td>bigint</td>
<td>DEFAULT NULL</td>
<td>NOT NULL</td>
<td> COMMENT 'Reference to the clinical coding of the observation',</td>
<td> 'Unique Id of the observation'</td>
<td> non_core_concept_id int DEFAULT NULL COMMENT 'Reference to the clinical coding of the observation',</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
<td>episodicity_concept_id</td>
<td>organization_id</td>
<td>int</td>
<td>bigint</td>
<td>DEFAULT NULL</td>
<td>NOT NULL</td>
<td> COMMENT 'Reference to the episodicity of the problem eg First, review, flare',</td>
<td> 'Owning organisation (i.e. publisher)'</td>
<td> episodicity_concept_id int DEFAULT NULL COMMENT 'Reference to the episodicity of the problem eg First, review, flare',</td>
<td>patient.organization_id</td>
</tr>
</tr>
<tr>
<tr>
<td>result_concept_id</td>
<td>patient_id</td>
<td>int</td>
<td>bigint</td>
<td>DEFAULT NULL</td>
<td> COMMENT 'Reference to the clinical coding of the result',</td>
<td>  result_concept_id int DEFAULT NULL COMMENT 'Reference to the clinical coding of the result',</td>
</tr>
<tr>
<td>is_review</td>
<td>tinyint(1)</td>
<td>NOT NULL</td>
<td>NOT NULL</td>
<td> COMMENT 'Whether the observation is a review of an existing problem',</td>
<td> 'The organisations record for this person’s registration. Patients may have multiple records across clinical systems and may have registered at an organisation multiple times'</td>
<td>  is_review tinyint(1) NOT NULL COMMENT 'Whether the observation is a review of an existing problem',</td>
<td>patient.id</td>
</tr>
<tr>
<td>date_precision_concept_id</td>
<td>int</td>
<td>DEFAULT NULL</td>
<td> COMMENT 'Identifies the precision of the clinical effectiveness date to either year (1) month (2) day (5) minute (12) second (13) millisecond (14)',</td>
<td> date_precision_concept_id int DEFAULT NULL COMMENT 'Identifies the precision of the clinical effectiveness date to either year (1) month (2) day (5) minute (12) second (13) millisecond (14)',</td>
</tr>
</tr>
<tr>
<tr>
Line 1,523: Line 1,590:
<td>bigint</td>
<td>bigint</td>
<td>NOT NULL</td>
<td>NOT NULL</td>
<td> COMMENT 'Unique individual across all organisations',</td>
<td> 'Unique individual across all organisations'</td>
<td> person_id bigint NOT NULL COMMENT 'Unique individual across all organisations',</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
Line 1,530: Line 1,597:
<td>bigint</td>
<td>bigint</td>
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> COMMENT 'Reference to the encounter the observation was recorded at',</td>
<td> 'Reference to the encounter the observation was recorded at'</td>
<td> encounter_id bigint DEFAULT NULL COMMENT 'Reference to the encounter the observation was recorded at',</td>
<td>encounter.id</td>
</tr>
</tr>
<tr>
<tr>
Line 1,537: Line 1,604:
<td>bigint</td>
<td>bigint</td>
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> COMMENT 'The clinician the activity is recorded against',</td>
<td> 'The clinician the activity is recorded against'</td>
<td> practitioner_id bigint DEFAULT NULL COMMENT 'The clinician the activity is recorded against',</td>
<td>practitioner.id</td>
</tr>
</tr>
</tbody>
</table>
<h2><span class="mw-headline" id="Sortable_tables">Observation_additional</span></h2>
<table class="sortable" border="1" style="border-collapse:collapse">
<tr>
<th scope="col" width="10%">Column Name</th>
<th scope="col" width="10%">Type</th>
<th scope="col" width="10%">Constraint</th>
<th scope="col" width="10%">Comment</th>
<th scope="col" width="10%">Sql</th>
</tr>
<tbody>
<tr>
<tr>
<td>json_value</td>
<td>clinical_effective_date</td>
<td>json</td>
<td>date</td>
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> COMMENT 'the JSON data itself ',</td>
<td> 'The date the observation was identified by a clinician'</td>
<td> json_value json DEFAULT NULL COMMENT 'the JSON data itself ',</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
<td>value_id</td>
<td>date_precision_concept_id</td>
<td>int</td>
<td>int</td>
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> COMMENT 'IM reference (i.e. minor, significant)',</td>
<td> 'Identifies the precision of the clinical effectiveness date to either year (1) month (2) day (5) minute (12) second (13) millisecond (14)'</td>
<td> value_id int DEFAULT NULL COMMENT 'IM reference (i.e. minor, significant)',</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
<td>text_value</td>
<td>result_value</td>
<td>varchar(255)</td>
<td>double</td>
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> COMMENT 'where there is no mapped value_id or raw JSON, just a basic text value',</td>
<td> 'The value of the result of the observation'</td>
<td> text_value varchar(255) DEFAULT NULL COMMENT 'where there is no mapped value_id or raw JSON, just a basic text value',</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
<td>id</td>
<td>result_value_units</td>
<td>bigint</td>
<td>NOT NULL</td>
<td> COMMENT 'same as the id column on the observation table',</td>
<td>  id bigint NOT NULL COMMENT 'same as the id column on the observation table',</td>
</tr>
<tr>
<td>property_id</td>
<td>int</td>
<td>NOT NULL</td>
<td> COMMENT 'IM reference (i.e. significance)',</td>
<td>  property_id int NOT NULL COMMENT 'IM reference (i.e. significance)',</td>
</tr>
</tbody>
</table>
<h2><span class="mw-headline" id="Sortable_tables">Organization</span></h2>
<table class="sortable" border="1" style="border-collapse:collapse">
<tr>
<th scope="col" width="10%">Column Name</th>
<th scope="col" width="10%">Type</th>
<th scope="col" width="10%">Constraint</th>
<th scope="col" width="10%">Comment</th>
<th scope="col" width="10%">Sql</th>
</tr>
<tbody>
<tr>
<td>type_code</td>
<td>varchar(50)</td>
<td>varchar(50)</td>
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> COMMENT 'The type of organisation',</td>
<td> 'The units of the result of the observation'</td>
<td> type_code varchar(50) DEFAULT NULL COMMENT 'The type of organisation',</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
<td>parent_organization_id</td>
<td>result_date</td>
<td>bigint</td>
<td>date</td>
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> COMMENT 'The id of the parent organisation',</td>
<td> 'The date of the result'</td>
<td> parent_organization_id bigint DEFAULT NULL COMMENT 'The id of the parent organisation',</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
<td>Postcode</td>
<td>result_text</td>
<td>varchar(10)</td>
<td>text</td>
<td>DEFAULT NULL</td>
<td>No Constraint</td>
<td> COMMENT 'The postcode of the organisation',</td>
<td> 'Any text associated with the result'</td>
<td> Postcode varchar(10) DEFAULT NULL COMMENT 'The postcode of the organisation',</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
<td>ods_code</td>
<td>result_concept_id</td>
<td>varchar(50)</td>
<td>int</td>
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> COMMENT 'ODS Code of the organisation',</td>
<td> 'Reference to the clinical coding of the result'</td>
<td> ods_code varchar(50) DEFAULT NULL COMMENT 'ODS Code of the organisation',</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
<td>Name</td>
<td>is_problem</td>
<td>varchar(255)</td>
<td>tinyint(1)</td>
<td>DEFAULT NULL</td>
<td>NOT NULL</td>
<td> COMMENT 'Name of the organisation',</td>
<td> 'Whether the observation is marked as a problem'</td>
<td> Name varchar(255) DEFAULT NULL COMMENT 'Name of the organisation',</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
<td>type_desc</td>
<td>is_review</td>
<td>varchar(255)</td>
<td>tinyint(1)</td>
<td>DEFAULT NULL</td>
<td> COMMENT 'Textual description of the type of organisation eg GP Practice',</td>
<td>  type_desc varchar(255) DEFAULT NULL COMMENT 'Textual description of the type of organisation eg GP Practice',</td>
</tr>
<tr>
<td>id</td>
<td>bigint</td>
<td>NOT NULL</td>
<td>NOT NULL</td>
<td> COMMENT 'Unique Id of the organisation',</td>
<td> 'Whether the observation is a review of an existing problem'</td>
<td> id bigint NOT NULL COMMENT 'Unique Id of the organisation',</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
</tbody>
</table>
<h2><span class="mw-headline" id="Sortable_tables">Organization_metadata</span></h2>
<table class="sortable" border="1" style="border-collapse:collapse">
<tr>
<th scope="col" width="10%">Column Name</th>
<th scope="col" width="10%">Type</th>
<th scope="col" width="10%">Constraint</th>
<th scope="col" width="10%">Comment</th>
<th scope="col" width="10%">Sql</th>
</tr>
<tbody>
<tr>
<tr>
<td>last_data_to_dds</td>
<td>problem_end_date</td>
<td>datetime</td>
<td>date</td>
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> COMMENT 'date time data was last sent to DDS',</td>
<td> 'The end date of the problem'</td>
<td> last_data_to_dds datetime DEFAULT NULL COMMENT 'date time data was last sent to DDS',</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
<td>id</td>
<td>parent_observation_id</td>
<td>bigint</td>
<td>bigint</td>
<td>NOT NULL</td>
<td>DEFAULT NULL</td>
<td> COMMENT 'organisation ID, corresponds to same ID in the organizaton table',</td>
<td> 'Reference to the parent observation in a complex observation eg systolic and diastolic blood pressures will have a parent observation of Blood pressure'</td>
<td> id bigint NOT NULL COMMENT 'organisation ID, corresponds to same ID in the organizaton table',</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
<td>last_data_cutoff</td>
<td>core_concept_id</td>
<td>datetime</td>
<td>int</td>
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> COMMENT 'cutoff date time of the last extract from the publishing system',</td>
<td> 'Reference to the clinical coding of the observation'</td>
<td> last_data_cutoff datetime DEFAULT NULL COMMENT 'cutoff date time of the last extract from the publishing system',</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
<td>publishing_software</td>
<td>non_core_concept_id</td>
<td>varchar(50)</td>
<td>int</td>
<td>NOT NULL</td>
<td>DEFAULT NULL</td>
<td> COMMENT 'software name of publishing system, i.e. SystmOne',</td>
<td> 'Reference to the clinical coding of the observation'</td>
<td> publishing_software varchar(50) NOT NULL COMMENT 'software name of publishing system, i.e. SystmOne',</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
</tbody>
</table>
<h2><span class="mw-headline" id="Sortable_tables">Patient</span></h2>
<table class="sortable" border="1" style="border-collapse:collapse">
<tr>
<th scope="col" width="10%">Column Name</th>
<th scope="col" width="10%">Type</th>
<th scope="col" width="10%">Constraint</th>
<th scope="col" width="10%">Comment</th>
<th scope="col" width="10%">Sql</th>
</tr>
<tbody>
<tr>
<tr>
<td>ethnic_code_concept_id</td>
<td>age_at_event</td>
<td>int</td>
<td>decimal(5,2)</td>
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> COMMENT 'Reference to the ethnicity of the patient',</td>
<td> 'The age of the patient at the time of the observation'</td>
<td> ethnic_code_concept_id int DEFAULT NULL COMMENT 'Reference to the ethnicity of the patient',</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
<td>nhs_number</td>
<td>episodicity_concept_id</td>
<td>varchar(255)</td>
<td>int</td>
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> COMMENT 'The NHS number of the patient',</td>
<td> 'Reference to the episodicity of the problem eg First, review, flare'</td>
<td> nhs_number varchar(255) DEFAULT NULL COMMENT 'The NHS number of the patient',</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
<td>date_of_birth</td>
<td>is_primary</td>
<td>date</td>
<td>tinyint(1)</td>
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> COMMENT 'The date of birth of the patient',</td>
<td> 'Whether the observation is a primary observation'</td>
<td> date_of_birth date DEFAULT NULL COMMENT 'The date of birth of the patient',</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
<td>gender_concept_id</td>
<td>date_recorded</td>
<td>int</td>
<td>datetime</td>
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> COMMENT 'Reference to the gender of the patient',</td>
<td> 'The date the observation was recorded in the system'</td>
<td> gender_concept_id int DEFAULT NULL COMMENT 'Reference to the gender of the patient',</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
<td>organization_id</td>
<td colspan="5">Unique index name: `observation_id` Index Columns: (id)</td> </tr> <tr>
<td colspan="5">Index name: `fk_observation_encounter_id` Index Columns: (encounter_id)</td> </tr> <tr>
<td colspan="5">Index name: `fk_observation_patient_id_organization_id` Index Columns: (patient_id,organization_id)</td> </tr> <tr>
<td colspan="5">Index name: `fk_observation_practitioner_id` Index Columns: (practitioner_id)</td> </tr> <tr>
<td colspan="5">Index name: `observation_patient_id` Index Columns: (patient_id)</td> </tr> <tr>
<td colspan="5">Index name: `observation_core_concept_id` Index Columns: (core_concept_id)</td> </tr> <tr>
<td colspan="5">Index name: `observation_core_concept_id_is_problem` Index Columns: (core_concept_id,is_problem)</td> </tr> <tr>
<td colspan="5">Index name: `observation_core_concept_id_result_value` Index Columns: (core_concept_id,result_value)</td> </tr> <tr>
<td colspan="5">Index name: `observation_non_core_concept_id` Index Columns: (non_core_concept_id)</td> </tr> <tr>
<td colspan="5">Index name: `ix_observation_organization_id` Index Columns: (organization_id)</td> </tr> <tr>
<td colspan="5">Index name: `ix_observation_clinical_effective_date` Index Columns: (clinical_effective_date)</td> </tr> <tr>
<td colspan="5">Index name: `ix_observation_person_id` Index Columns: (person_id)</td> </tr> <tr>
<td colspan="5">PRIMARY KEY CONSTRAINT(s) (`organization_id`,`person_id`,`id`)</td> </tr> </table>
<h1><span class="mw-headline" id="Sortable_tables">observation_additional</span></h1>
<table class="mw-collapsible" border="1" style="border-collapse:collapse">
<tr>
<th scope="col">Column Name</th>
<th scope="col">Data Type</th>
<th scope="col">Constraint</th>
<th scope="col">Comment</th>
<th scope="col">Foreign Key Reference</th>
</tr>
<tr>
<td>id</td>
<td>bigint</td>
<td>bigint</td>
<td>NOT NULL</td>
<td>NOT NULL</td>
<td> COMMENT 'Owning organisation (i.e. publisher)',</td>
<td> 'same as the id column on the observation table'</td>
<td> organization_id bigint NOT NULL COMMENT 'Owning organisation (i.e. publisher)',</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
<td>id</td>
<td>property_id</td>
<td>bigint</td>
<td>int</td>
<td>NOT NULL</td>
<td>NOT NULL</td>
<td> COMMENT 'Unique Id of the patient',</td>
<td> 'IM reference (i.e. significance)'</td>
<td> id bigint NOT NULL COMMENT 'Unique Id of the patient',</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
<td>registered_practice_organization_id</td>
<td>value_id</td>
<td>bigint</td>
<td>int</td>
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> COMMENT 'Reference to the organisation the patient is registered at',</td>
<td> 'IM reference (i.e. minor, significant)'</td>
<td> registered_practice_organization_id bigint DEFAULT NULL COMMENT 'Reference to the organisation the patient is registered at',</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
<td>current_address_id</td>
<td>json_value</td>
<td>bigint</td>
<td>json</td>
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> COMMENT 'Reference to the current address of the patient',</td>
<td> 'the JSON data itself '</td>
<td> current_address_id bigint DEFAULT NULL COMMENT 'Reference to the current address of the patient',</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
<td>last_name</td>
<td>text_value</td>
<td>varchar(255)</td>
<td>varchar(255)</td>
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> COMMENT 'The last name of the patient',</td>
<td> 'where there is no mapped value_id or raw JSON, just a basic text value'</td>
<td> last_name varchar(255) DEFAULT NULL COMMENT 'The last name of the patient',</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
<td>person_id</td>
<td colspan="5">Index name: `observation_additional_value_id` Index Columns: (value_id)</td> </tr> <tr>
<td colspan="5">PRIMARY KEY CONSTRAINT(s) (`id`,`property_id`)</td> </tr> </table>
<h1><span class="mw-headline" id="Sortable_tables">organization</span></h1>
<table class="mw-collapsible" border="1" style="border-collapse:collapse">
<tr>
<th scope="col">Column Name</th>
<th scope="col">Data Type</th>
<th scope="col">Constraint</th>
<th scope="col">Comment</th>
<th scope="col">Foreign Key Reference</th>
</tr>
<tr>
<td>id</td>
<td>bigint</td>
<td>bigint</td>
<td>NOT NULL</td>
<td>NOT NULL</td>
<td> COMMENT 'Unique individual across all organisations',</td>
<td> 'Unique Id of the organisation'</td>
<td> person_id bigint NOT NULL COMMENT 'Unique individual across all organisations',</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
<td>first_names</td>
<td>ods_code</td>
<td>varchar(50)</td>
<td>DEFAULT NULL</td>
<td> 'ODS Code of the organisation'</td>
<td>No Foreign Key reference</td>
</tr>
<tr>
<td>name</td>
<td>varchar(255)</td>
<td>varchar(255)</td>
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> COMMENT 'The first names of the patient',</td>
<td> 'Name of the organisation'</td>
<td> first_names varchar(255) DEFAULT NULL COMMENT 'The first names of the patient',</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
<td>date_of_death</td>
<td>type_code</td>
<td>date</td>
<td>varchar(50)</td>
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> COMMENT 'The date of death of the patient',</td>
<td> 'The type of organisation'</td>
<td> date_of_death date DEFAULT NULL COMMENT 'The date of death of the patient',</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
<td>title</td>
<td>type_desc</td>
<td>varchar(255)</td>
<td>varchar(255)</td>
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> COMMENT 'The title of the patient',</td>
<td> 'Textual description of the type of organisation eg GP Practice'</td>
<td> title varchar(255) DEFAULT NULL COMMENT 'The title of the patient',</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
</tbody>
<tr>
</table>
<td>postcode</td>
<h2><span class="mw-headline" id="Sortable_tables">Patient_additional</span></h2>
<td>varchar(10)</td>
<table class="sortable" border="1" style="border-collapse:collapse">
<tr>
<th scope="col" width="10%">Column Name</th>
<th scope="col" width="10%">Type</th>
<th scope="col" width="10%">Constraint</th>
<th scope="col" width="10%">Comment</th>
<th scope="col" width="10%">Sql</th>
</tr>
<tbody>
<tr>
<td>text_value</td>
<td>varchar(255)</td>
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> COMMENT 'where there is no mapped value_id or raw JSON, just a basic text value (i.e. GP Practitioner number)',</td>
<td> 'The postcode of the organisation'</td>
<td> text_value varchar(255) DEFAULT NULL COMMENT 'where there is no mapped value_id or raw JSON, just a basic text value (i.e. GP Practitioner number)',</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
<td>value_id</td>
<td>parent_organization_id</td>
<td>int</td>
<td>bigint</td>
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> COMMENT 'IM reference (e.g. COVID)',</td>
<td> 'The id of the parent organisation'</td>
<td> value_id int DEFAULT NULL COMMENT 'IM reference (e.g. COVID)',</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<td colspan="5">Unique index name: `organization_id` Index Columns: (id)</td> </tr> <tr>
<td colspan="5">Index name: `fki_organization_parent_organization_id` Index Columns: (parent_organization_id)</td> </tr> <tr>
<td colspan="5">PRIMARY KEY CONSTRAINT(s) (`id`)</td> </tr> </table>
<h1><span class="mw-headline" id="Sortable_tables">organization_metadata</span></h1>
<table class="mw-collapsible" border="1" style="border-collapse:collapse">
<tr>
<th scope="col">Column Name</th>
<th scope="col">Data Type</th>
<th scope="col">Constraint</th>
<th scope="col">Comment</th>
<th scope="col">Foreign Key Reference</th>
</tr>
<tr>
<tr>
<td>id</td>
<td>id</td>
<td>bigint</td>
<td>bigint</td>
<td>NOT NULL</td>
<td>NOT NULL</td>
<td> COMMENT 'same as the id column on the patient table ',</td>
<td> 'organisation ID, corresponds to same ID in the organizaton table'</td>
<td> id bigint NOT NULL COMMENT 'same as the id column on the patient table ',</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
<td>property_id</td>
<td>publishing_software</td>
<td>int</td>
<td>varchar(50)</td>
<td>NOT NULL</td>
<td>NOT NULL</td>
<td> COMMENT 'IM reference (e.g. Cause of death)',</td>
<td> 'software name of publishing system, i.e. SystmOne'</td>
<td> property_id int NOT NULL COMMENT 'IM reference (e.g. Cause of death)',</td>
<td>No Foreign Key reference</td>
</tr>
<tr>
<td>last_data_to_dds</td>
<td>datetime</td>
<td>DEFAULT NULL</td>
<td> 'date time data was last sent to DDS'</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
<td>json_value</td>
<td>last_data_cutoff</td>
<td>json</td>
<td>datetime</td>
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> COMMENT 'where there is no mapped value_id, just raw JSON',</td>
<td> 'cutoff date time of the last extract from the publishing system'</td>
<td> json_value json DEFAULT NULL COMMENT 'where there is no mapped value_id, just raw JSON',</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
</tbody>
<tr>
</table>
<td colspan="5">PRIMARY KEY CONSTRAINT(s) (`id`,`publishing_software`)</td> </tr> </table>
<h2><span class="mw-headline" id="Sortable_tables">Patient_address</span></h2>
<h1><span class="mw-headline" id="Sortable_tables">patient</span></h1>
<table class="sortable" border="1" style="border-collapse:collapse">
<table class="mw-collapsible" border="1" style="border-collapse:collapse">
<tr>
<tr>
<th scope="col" width="10%">Column Name</th>
<th scope="col">Column Name</th>
<th scope="col" width="10%">Type</th>
<th scope="col">Data Type</th>
<th scope="col" width="10%">Constraint</th>
<th scope="col">Constraint</th>
<th scope="col" width="10%">Comment</th>
<th scope="col">Comment</th>
<th scope="col" width="10%">Sql</th>
<th scope="col">Foreign Key Reference</th>
</tr>
</tr>
<tbody>
<tr>
<tr>
<td>start_date</td>
<td>id</td>
<td>date</td>
<td>bigint</td>
<td>NOT NULL</td>
<td>NOT NULL</td>
<td> COMMENT 'The start date of this address being relevant',</td>
<td> 'Unique Id of the patient'</td>
<td> start_date date NOT NULL COMMENT 'The start date of this address being relevant',</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
<td>patient_id</td>
<td>organization_id</td>
<td>bigint</td>
<td>bigint</td>
<td>NOT NULL</td>
<td>NOT NULL</td>
<td> COMMENT 'The organisations record for this person’s registration. Patients may have multiple records across clinical systems and may have registered at an organisation multiple times',</td>
<td> 'Owning organisation (i.e. publisher)'</td>
<td> patient_id bigint NOT NULL COMMENT 'The organisations record for this person’s registration. Patients may have multiple records across clinical systems and may have registered at an organisation multiple times',</td>
<td>organization.id</td>
</tr>
</tr>
<tr>
<tr>
<td>lsoa_2001_code</td>
<td>person_id</td>
<td>varchar(9)</td>
<td>DEFAULT NULL</td>
<td> COMMENT 'A reference to the LSOA_2001 code',</td>
<td>  lsoa_2001_code varchar(9) DEFAULT NULL COMMENT 'A reference to the LSOA_2001 code',</td>
</tr>
<tr>
<td>organization_id</td>
<td>bigint</td>
<td>bigint</td>
<td>NOT NULL</td>
<td>NOT NULL</td>
<td> COMMENT 'Owning organisation (i.e. publisher)',</td>
<td> 'Unique individual across all organisations'</td>
<td> organization_id bigint NOT NULL COMMENT 'Owning organisation (i.e. publisher)',</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
<td>address_line_4</td>
<td>title</td>
<td>varchar(255)</td>
<td>varchar(255)</td>
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> COMMENT 'The fourth line of the address',</td>
<td> 'The title of the patient'</td>
<td> address_line_4 varchar(255) DEFAULT NULL COMMENT 'The fourth line of the address',</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
<td>postcode</td>
<td>first_names</td>
<td>varchar(255)</td>
<td>varchar(255)</td>
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> COMMENT 'The postcode',</td>
<td> 'The first names of the patient'</td>
<td> postcode varchar(255) DEFAULT NULL COMMENT 'The postcode',</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
<td>Id</td>
<td>last_name</td>
<td>bigint</td>
<td>varchar(255)</td>
<td>NOT NULL</td>
<td>DEFAULT NULL</td>
<td> COMMENT 'Unique Id of the address',</td>
<td> 'The last name of the patient'</td>
<td> Id bigint NOT NULL COMMENT 'Unique Id of the address',</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
<td>lsoa_2011_code</td>
<td>gender_concept_id</td>
<td>varchar(9)</td>
<td>int</td>
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> COMMENT 'A reference to the LSOA_2011 code',</td>
<td> 'Reference to the gender of the patient'</td>
<td> lsoa_2011_code varchar(9) DEFAULT NULL COMMENT 'A reference to the LSOA_2011 code',</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
<td>ward_code</td>
<td>nhs_number</td>
<td>varchar(9)</td>
<td>varchar(255)</td>
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> COMMENT 'The ward the address belongs to',</td>
<td> 'The NHS number of the patient'</td>
<td> ward_code varchar(9) DEFAULT NULL COMMENT 'The ward the address belongs to',</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
<td>use_concept_id</td>
<td>date_of_birth</td>
<td>int</td>
<td>date</td>
<td>NOT NULL</td>
<td> COMMENT 'use of address (e.g. home, temporary)',</td>
<td>  use_concept_id int NOT NULL COMMENT 'use of address (e.g. home, temporary)',</td>
</tr>
<tr>
<td>msoa_2011_code</td>
<td>varchar(9)</td>
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> COMMENT 'A reference to the MSOA_2011 code',</td>
<td> 'The date of birth of the patient'</td>
<td> msoa_2011_code varchar(9) DEFAULT NULL COMMENT 'A reference to the MSOA_2011 code',</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
<td>address_line_2</td>
<td>date_of_death</td>
<td>varchar(255)</td>
<td>date</td>
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> COMMENT 'The second line of the address',</td>
<td> 'The date of death of the patient'</td>
<td> address_line_2 varchar(255) DEFAULT NULL COMMENT 'The second line of the address',</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
<td>msoa_2001_code</td>
<td>current_address_id</td>
<td>varchar(9)</td>
<td>bigint</td>
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> COMMENT 'A reference to the MSOA_2001 code',</td>
<td> 'Reference to the current address of the patient'</td>
<td> msoa_2001_code varchar(9) DEFAULT NULL COMMENT 'A reference to the MSOA_2001 code',</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
<td>address_line_1</td>
<td>ethnic_code_concept_id</td>
<td>varchar(255)</td>
<td>int</td>
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> COMMENT 'The first line of the address',</td>
<td> 'Reference to the ethnicity of the patient'</td>
<td> address_line_1 varchar(255) DEFAULT NULL COMMENT 'The first line of the address',</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
<td>person_id</td>
<td>registered_practice_organization_id</td>
<td>bigint</td>
<td>bigint</td>
<td>NOT NULL</td>
<td>DEFAULT NULL</td>
<td> COMMENT 'Unique individual across all organisations',</td>
<td> 'Reference to the organisation the patient is registered at'</td>
<td> person_id bigint NOT NULL COMMENT 'Unique individual across all organisations',</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
<td>city</td>
<td>birth_year</td>
<td>varchar(255)</td>
<td>smallint</td>
<td>DEFAULT NULL</td>
<td>DEFAULT NULL,</td>
<td> COMMENT 'The city',</td>
<td>No comment yet added</td>
<td> city varchar(255) DEFAULT NULL COMMENT 'The city',</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
<td>end_date</td>
<td>birth_month</td>
<td>date</td>
<td>tinyint</td>
<td>DEFAULT NULL</td>
<td>DEFAULT NULL,</td>
<td> COMMENT 'The end date of this address being relevant',</td>
<td>No comment yet added</td>
<td> end_date date DEFAULT NULL COMMENT 'The end date of this address being relevant',</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
<td>local_authority_code</td>
<td>birth_week</td>
<td>varchar(9)</td>
<td>tinyint</td>
<td>DEFAULT NULL</td>
<td>DEFAULT NULL,</td>
<td> COMMENT 'The local authority the address belongs to',</td>
<td>No comment yet added</td>
<td> local_authority_code varchar(9) DEFAULT NULL COMMENT 'The local authority the address belongs to',</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
<td>address_line_3</td>
<td colspan="5">Unique index name: `patient_id` Index Columns: (id)</td> </tr> <tr>
<td>varchar(255)</td>
<td colspan="5">Index name: `patient_person_id` Index Columns: (person_id)</td> </tr> <tr>
<td>DEFAULT NULL</td>
<td colspan="5">PRIMARY KEY CONSTRAINT(s) (`organization_id`,`person_id`,`id`)</td> </tr> </table>
<td> COMMENT 'The third line of the address',</td>
<h1><span class="mw-headline" id="Sortable_tables">patient_additional</span></h1>
<td> address_line_3 varchar(255) DEFAULT NULL COMMENT 'The third line of the address',</td>
<table class="mw-collapsible" border="1" style="border-collapse:collapse">
</tr>
</tbody>
</table>
<h2><span class="mw-headline" id="Sortable_tables">Patient_address_match</span></h2>
<table class="sortable" border="1" style="border-collapse:collapse">
<tr>
<tr>
<th scope="col" width="10%">Column Name</th>
<th scope="col">Column Name</th>
<th scope="col" width="10%">Type</th>
<th scope="col">Data Type</th>
<th scope="col" width="10%">Constraint</th>
<th scope="col">Constraint</th>
<th scope="col" width="10%">Comment</th>
<th scope="col">Comment</th>
<th scope="col" width="10%">Sql</th>
<th scope="col">Foreign Key Reference</th>
</tr>
</tr>
<tbody>
</tbody>
</table>
<h2><span class="mw-headline" id="Sortable_tables">Patient_address_ralf</span></h2>
<table class="sortable" border="1" style="border-collapse:collapse">
<tr>
<th scope="col" width="10%">Column Name</th>
<th scope="col" width="10%">Type</th>
<th scope="col" width="10%">Constraint</th>
<th scope="col" width="10%">Comment</th>
<th scope="col" width="10%">Sql</th>
</tr>
<tbody>
</tbody>
</table>
<h2><span class="mw-headline" id="Sortable_tables">Patient_contact</span></h2>
<table class="sortable" border="1" style="border-collapse:collapse">
<tr>
<th scope="col" width="10%">Column Name</th>
<th scope="col" width="10%">Type</th>
<th scope="col" width="10%">Constraint</th>
<th scope="col" width="10%">Comment</th>
<th scope="col" width="10%">Sql</th>
</tr>
<tbody>
<tr>
<tr>
<td>patient_id</td>
<td>id</td>
<td>bigint</td>
<td>bigint</td>
<td>NOT NULL</td>
<td>NOT NULL</td>
<td> COMMENT 'The organisations record for this person’s registration. Patients may have multiple records across clinical systems and may have registered at an organisation multiple times',</td>
<td> 'same as the id column on the patient table '</td>
<td> patient_id bigint NOT NULL COMMENT 'The organisations record for this person’s registration. Patients may have multiple records across clinical systems and may have registered at an organisation multiple times',</td>
<td>No Foreign Key reference</td>
</tr>
<tr>
<td>property_id</td>
<td>int</td>
<td>NOT NULL</td>
<td> 'IM reference (e.g. Cause of death)'</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
<td>type_concept_id</td>
<td>value_id</td>
<td>int</td>
<td>int</td>
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> COMMENT 'type of contact (e.g. phone, email)',</td>
<td> 'IM reference (e.g. COVID)'</td>
<td> type_concept_id int DEFAULT NULL COMMENT 'type of contact (e.g. phone, email)',</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
<td>start_date</td>
<td>json_value</td>
<td>date</td>
<td>json</td>
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> COMMENT 'The start date of the contact being valid',</td>
<td> 'where there is no mapped value_id, just raw JSON'</td>
<td> start_date date DEFAULT NULL COMMENT 'The start date of the contact being valid',</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
<td>organization_id</td>
<td>text_value</td>
<td>varchar(255)</td>
<td>DEFAULT NULL</td>
<td> 'where there is no mapped value_id or raw JSON, just a basic text value (i.e. GP Practitioner number)'</td>
<td>No Foreign Key reference</td>
</tr>
<tr>
<td colspan="5">Index name: `ix_patient_additional_id` Index Columns: (value_id)</td> </tr> <tr>
<td colspan="5">PRIMARY KEY CONSTRAINT(s) (`id`,`property_id`)</td> </tr> </table>
<h1><span class="mw-headline" id="Sortable_tables">patient_address</span></h1>
<table class="mw-collapsible" border="1" style="border-collapse:collapse">
<tr>
<th scope="col">Column Name</th>
<th scope="col">Data Type</th>
<th scope="col">Constraint</th>
<th scope="col">Comment</th>
<th scope="col">Foreign Key Reference</th>
</tr>
<tr>
<td>id</td>
<td>bigint</td>
<td>bigint</td>
<td>NOT NULL</td>
<td>NOT NULL</td>
<td> COMMENT 'Owning organisation (i.e. publisher)',</td>
<td> 'Unique Id of the address'</td>
<td> organization_id bigint NOT NULL COMMENT 'Owning organisation (i.e. publisher)',</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
<td>use_concept_id</td>
<td>organization_id</td>
<td>int</td>
<td>bigint</td>
<td>DEFAULT NULL</td>
<td>NOT NULL</td>
<td> COMMENT 'use of contact (e.g. mobile, home,work',</td>
<td> 'Owning organisation (i.e. publisher)'</td>
<td> use_concept_id int DEFAULT NULL COMMENT 'use of contact (e.g. mobile, home,work',</td>
<td>patient.organization_id</td>
</tr>
</tr>
<tr>
<tr>
<td>id</td>
<td>patient_id</td>
<td>bigint</td>
<td>bigint</td>
<td>NOT NULL</td>
<td>NOT NULL</td>
<td> COMMENT 'Unique Id of the patient contact',</td>
<td> 'The organisations record for this person’s registration. Patients may have multiple records across clinical systems and may have registered at an organisation multiple times'</td>
<td> id bigint NOT NULL COMMENT 'Unique Id of the patient contact',</td>
<td>patient.id</td>
</tr>
</tr>
<tr>
<tr>
Line 2,065: Line 2,094:
<td>bigint</td>
<td>bigint</td>
<td>NOT NULL</td>
<td>NOT NULL</td>
<td> COMMENT 'Unique individual across all organisations',</td>
<td> 'Unique individual across all organisations'</td>
<td> person_id bigint NOT NULL COMMENT 'Unique individual across all organisations',</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
<td>value</td>
<td>address_line_1</td>
<td>varchar(255)</td>
<td>varchar(255)</td>
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> COMMENT 'The value of the contact information eg phone number, email address',</td>
<td> 'The first line of the address'</td>
<td> value varchar(255) DEFAULT NULL COMMENT 'The value of the contact information eg phone number, email address',</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
<td>end_date</td>
<td>address_line_2</td>
<td>date</td>
<td>varchar(255)</td>
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> COMMENT 'The end date of the contact being valid',</td>
<td> 'The second line of the address'</td>
<td> end_date date DEFAULT NULL COMMENT 'The end date of the contact being valid',</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
</tbody>
</table>
<h2><span class="mw-headline" id="Sortable_tables">Patient_pseudo_id</span></h2>
<table class="sortable" border="1" style="border-collapse:collapse">
<tr>
<th scope="col" width="10%">Column Name</th>
<th scope="col" width="10%">Type</th>
<th scope="col" width="10%">Constraint</th>
<th scope="col" width="10%">Comment</th>
<th scope="col" width="10%">Sql</th>
</tr>
<tbody>
<tr>
<tr>
<td>id</td>
<td>address_line_3</td>
<td>bigint</td>
<td>varchar(255)</td>
<td>NOT NULL</td>
<td>DEFAULT NULL</td>
<td> COMMENT 'Unique Id of the patient pseudo id',</td>
<td> 'The third line of the address'</td>
<td> id bigint NOT NULL COMMENT 'Unique Id of the patient pseudo id',</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
<td>Skid</td>
<td>address_line_4</td>
<td>varchar(255)</td>
<td>varchar(255)</td>
<td>NOT NULL</td>
<td>DEFAULT NULL</td>
<td> COMMENT '"Secure Key IDentifier" - the pseudonymised ID generated for this patient using the salt specified in the salt_name column. Typically generated from patient NHS number, but is configurable on a case by case basis (e.g. may include date of birth)',</td>
<td> 'The fourth line of the address'</td>
<td> Skid varchar(255) NOT NULL COMMENT '"Secure Key IDentifier" - the pseudonymised ID generated for this patient using the salt specified in the salt_name column. Typically generated from patient NHS number, but is configurable on a case by case basis (e.g. may include date of birth)',</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
<td>salt_name</td>
<td>city</td>
<td>varchar(50)</td>
<td>varchar(255)</td>
<td>NOT NULL</td>
<td>DEFAULT NULL</td>
<td> COMMENT 'The name of the salt used to create the pseudo id',</td>
<td> 'The city'</td>
<td> salt_name varchar(50) NOT NULL COMMENT 'The name of the salt used to create the pseudo id',</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
<td>organization_id</td>
<td>postcode</td>
<td>bigint</td>
<td>varchar(255)</td>
<td>NOT NULL</td>
<td>DEFAULT NULL</td>
<td> COMMENT 'Owning organisation (i.e. publisher)',</td>
<td> 'The postcode'</td>
<td> organization_id bigint NOT NULL COMMENT 'Owning organisation (i.e. publisher)',</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
<td>person_id</td>
<td>use_concept_id</td>
<td>bigint</td>
<td>int</td>
<td>NOT NULL</td>
<td>NOT NULL</td>
<td> COMMENT 'Reference to the person this registration status history belongs to',</td>
<td> 'use of address (e.g. home, temporary)'</td>
<td> person_id bigint NOT NULL COMMENT 'Reference to the person this registration status history belongs to',</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
<td>is_nhs_number_valid</td>
<td>start_date</td>
<td>tinyint(1)</td>
<td>date</td>
<td>NOT NULL</td>
<td>NOT NULL</td>
<td> COMMENT 'Whether the nhs number is valid',</td>
<td> 'The start date of this address being relevant'</td>
<td> is_nhs_number_valid tinyint(1) NOT NULL COMMENT 'Whether the nhs number is valid',</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
<td>patient_id</td>
<td>end_date</td>
<td>bigint</td>
<td>date</td>
<td>NOT NULL</td>
<td>DEFAULT NULL</td>
<td> COMMENT 'Reference to the patient this registration status history belongs to',</td>
<td> 'The end date of this address being relevant'</td>
<td> patient_id bigint NOT NULL COMMENT 'Reference to the patient this registration status history belongs to',</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
<td>is_nhs_number_verified_by_publisher</td>
<td>lsoa_2001_code</td>
<td>tinyint(1)</td>
<td>varchar(9)</td>
<td>NOT NULL</td>
<td>DEFAULT NULL</td>
<td> COMMENT 'Whether the nhs number has been verified by the publisher',</td>
<td> 'A reference to the LSOA_2001 code'</td>
<td> is_nhs_number_verified_by_publisher tinyint(1) NOT NULL COMMENT 'Whether the nhs number has been verified by the publisher',</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
</tbody>
</table>
<h2><span class="mw-headline" id="Sortable_tables">Patient_uprn</span></h2>
<table class="sortable" border="1" style="border-collapse:collapse">
<tr>
<th scope="col" width="10%">Column Name</th>
<th scope="col" width="10%">Type</th>
<th scope="col" width="10%">Constraint</th>
<th scope="col" width="10%">Comment</th>
<th scope="col" width="10%">Sql</th>
</tr>
<tbody>
<tr>
<tr>
<td>patient_id</td>
<td>lsoa_2011_code</td>
<td>bigint</td>
<td>varchar(9)</td>
<td>NOT NULL</td>
<td>DEFAULT NULL</td>
<td> COMMENT 'The organisations record for this person’s registration. Patients may have multiple records across clinical systems and may have registered at an organisation multiple times',</td>
<td> 'A reference to the LSOA_2011 code'</td>
<td> patient_id bigint NOT NULL COMMENT 'The organisations record for this person’s registration. Patients may have multiple records across clinical systems and may have registered at an organisation multiple times',</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
<td>organization_id</td>
<td>msoa_2001_code</td>
<td>bigint</td>
<td>varchar(9)</td>
<td>NOT NULL</td>
<td>DEFAULT NULL</td>
<td> COMMENT 'Owning organisation (i.e. publisher)',</td>
<td> 'A reference to the MSOA_2001 code'</td>
<td> organization_id bigint NOT NULL COMMENT 'Owning organisation (i.e. publisher)',</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
<td>person_id</td>
<td>msoa_2011_code</td>
<td>bigint</td>
<td>varchar(9)</td>
<td>NOT NULL</td>
<td>DEFAULT NULL</td>
<td> COMMENT 'Unique individual across all organisations',</td>
<td> 'A reference to the MSOA_2011 code'</td>
<td> person_id bigint NOT NULL COMMENT 'Unique individual across all organisations',</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
</tbody>
</table>
<h2><span class="mw-headline" id="Sortable_tables">Person</span></h2>
<table class="sortable" border="1" style="border-collapse:collapse">
<tr>
<th scope="col" width="10%">Column Name</th>
<th scope="col" width="10%">Type</th>
<th scope="col" width="10%">Constraint</th>
<th scope="col" width="10%">Comment</th>
<th scope="col" width="10%">Sql</th>
</tr>
<tbody>
<tr>
<tr>
<td>gender_concept_id</td>
<td>ward_code</td>
<td>int</td>
<td>varchar(9)</td>
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> COMMENT 'Reference to the gender of the person',</td>
<td> 'The ward the address belongs to'</td>
<td> gender_concept_id int DEFAULT NULL COMMENT 'Reference to the gender of the person',</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
<td>first_names</td>
<td>local_authority_code</td>
<td>varchar(255)</td>
<td>varchar(9)</td>
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> COMMENT 'The first names of the person',</td>
<td> 'The local authority the address belongs to'</td>
<td> first_names varchar(255) DEFAULT NULL COMMENT 'The first names of the person',</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
<td>date_of_death</td>
<td>townsend_deprivation_index</td>
<td>date</td>
<td>double</td>
<td>DEFAULT NULL</td>
<td>DEFAULT NULL,</td>
<td> COMMENT 'The date of death of the person',</td>
<td>No comment yet added</td>
<td> date_of_death date DEFAULT NULL COMMENT 'The date of death of the person',</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
<td>organization_id</td>
<td colspan="5">Unique index name: `ux_patient_address_id` Index Columns: (id)</td> </tr> <tr>
<td colspan="5">Index name: `fk_patient_address_patient_id_organization_id` Index Columns: (patient_id,organization_id)</td> </tr> <tr>
<td colspan="5">PRIMARY KEY CONSTRAINT(s) (`organization_id`,`id`,`patient_id`,`person_id`)</td> </tr> </table>
<h1><span class="mw-headline" id="Sortable_tables">patient_address_match</span></h1>
<table class="mw-collapsible" border="1" style="border-collapse:collapse">
<tr>
<th scope="col">Column Name</th>
<th scope="col">Data Type</th>
<th scope="col">Constraint</th>
<th scope="col">Comment</th>
<th scope="col">Foreign Key Reference</th>
</tr>
<tr>
<td>id</td>
<td>bigint</td>
<td>bigint</td>
<td>NOT NULL</td>
<td>NOT NULL</td>
<td> COMMENT 'Owning organisation (i.e. publisher)',</td>
<td>No comment yet added</td>
<td> organization_id bigint NOT NULL COMMENT 'Owning organisation (i.e. publisher)',</td>
<td>No Foreign Key reference</td>
</tr>
<tr>
<td>ethnic_code_concept_id</td>
<td>int</td>
<td>DEFAULT NULL</td>
<td> COMMENT 'Reference to the ethnicity of the person',</td>
<td>  ethnic_code_concept_id int DEFAULT NULL COMMENT 'Reference to the ethnicity of the person',</td>
</tr>
</tr>
<tr>
<tr>
<td>registered_practice_organization_id</td>
<td>patient_address_id</td>
<td>bigint</td>
<td>bigint</td>
<td>DEFAULT NULL</td>
<td>NOT NULL,</td>
<td> COMMENT 'Reference to the organisation the person is registered at',</td>
<td>No comment yet added</td>
<td> registered_practice_organization_id bigint DEFAULT NULL COMMENT 'Reference to the organisation the person is registered at',</td>
<td>patient_address.id</td>
</tr>
</tr>
<tr>
<tr>
<td>last_name</td>
<td>uprn</td>
<td>varchar(255)</td>
<td>varchar(255)</td>
<td>DEFAULT NULL</td>
<td>CHARACTER SET</td>
<td> COMMENT 'The last name of the person',</td>
<td>No comment yet added</td>
<td> last_name varchar(255) DEFAULT NULL COMMENT 'The last name of the person',</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
<td>title</td>
<td>uprn_ralf00</td>
<td>varchar(255)</td>
<td>varchar(255)</td>
<td>DEFAULT NULL</td>
<td>DEFAULT NULL,</td>
<td> COMMENT 'The title of the person',</td>
<td>No comment yet added</td>
<td> title varchar(255) DEFAULT NULL COMMENT 'The title of the person',</td>
<td>No Foreign Key reference</td>
</tr>
<tr>
<td>status</td>
<td>tinyint(1)</td>
<td>DEFAULT NULL,</td>
<td>No comment yet added</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
<td>date_of_birth</td>
<td>uprn_property_classification</td>
<td>date</td>
<td>varchar(45)</td>
<td>DEFAULT NULL</td>
<td>CHARACTER SET</td>
<td> COMMENT 'The date of birth of the person',</td>
<td>No comment yet added</td>
<td> date_of_birth date DEFAULT NULL COMMENT 'The date of birth of the person',</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
<td>current_address_id</td>
<td>latitude</td>
<td>bigint</td>
<td>double</td>
<td>NOT NULL</td>
<td>DEFAULT NULL,</td>
<td> COMMENT 'Reference to the current address of the person',</td>
<td>No comment yet added</td>
<td> current_address_id bigint NOT NULL COMMENT 'Reference to the current address of the person',</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
<td>id</td>
<td>longitude</td>
<td>bigint</td>
<td>double</td>
<td>NOT NULL</td>
<td>DEFAULT NULL,</td>
<td> COMMENT 'Unique Id of the person',</td>
<td>No comment yet added</td>
<td> id bigint NOT NULL COMMENT 'Unique Id of the person',</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
<td>nhs_number</td>
<td>uprn_xcoordinate</td>
<td>varchar(255)</td>
<td>double</td>
<td>DEFAULT NULL</td>
<td>DEFAULT NULL,</td>
<td> COMMENT 'The NHS number of the person',</td>
<td>No comment yet added</td>
<td> nhs_number varchar(255) DEFAULT NULL COMMENT 'The NHS number of the person',</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
</tbody>
</table>
<h2><span class="mw-headline" id="Sortable_tables">Practitioner</span></h2>
<table class="sortable" border="1" style="border-collapse:collapse">
<tr>
<th scope="col" width="10%">Column Name</th>
<th scope="col" width="10%">Type</th>
<th scope="col" width="10%">Constraint</th>
<th scope="col" width="10%">Comment</th>
<th scope="col" width="10%">Sql</th>
</tr>
<tbody>
<tr>
<tr>
<td>gmc_code</td>
<td>uprn_ycoordinate</td>
<td>varchar(50)</td>
<td>double</td>
<td>DEFAULT NULL</td>
<td>DEFAULT NULL,</td>
<td> COMMENT 'The GMC code of the practitioner',</td>
<td>No comment yet added</td>
<td> gmc_code varchar(50) DEFAULT NULL COMMENT 'The GMC code of the practitioner',</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
<td>role_code</td>
<td>qualifier</td>
<td>varchar(50)</td>
<td>varchar(50)</td>
<td>DEFAULT NULL</td>
<td>CHARACTER SET</td>
<td> COMMENT 'The code representing the role of the practitioner',</td>
<td>No comment yet added</td>
<td> role_code varchar(50) DEFAULT NULL COMMENT 'The code representing the role of the practitioner',</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
<td>role_desc</td>
<td>match_rule</td>
<td>varchar(4096)</td>
<td>CHARACTER SET</td>
<td>No comment yet added</td>
<td>No Foreign Key reference</td>
</tr>
<tr>
<td>match_date</td>
<td>datetime</td>
<td>DEFAULT NULL,</td>
<td>No comment yet added</td>
<td>No Foreign Key reference</td>
</tr>
<tr>
<td>abp_address_number</td>
<td>varchar(255)</td>
<td>varchar(255)</td>
<td>DEFAULT NULL</td>
<td>CHARACTER SET</td>
<td> COMMENT 'Textual description of the role of the practitioner eg General Medical Practitioner',</td>
<td>No comment yet added</td>
<td> role_desc varchar(255) DEFAULT NULL COMMENT 'Textual description of the role of the practitioner eg General Medical Practitioner',</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
<td>organization_id</td>
<td>abp_address_street</td>
<td>bigint</td>
<td>varchar(255)</td>
<td>NOT NULL</td>
<td>CHARACTER SET</td>
<td> COMMENT 'Owning organisation (i.e. publisher)',</td>
<td>No comment yet added</td>
<td> organization_id bigint NOT NULL COMMENT 'Owning organisation (i.e. publisher)',</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
<td>id</td>
<td>abp_address_locality</td>
<td>bigint</td>
<td>varchar(255)</td>
<td>NOT NULL</td>
<td>CHARACTER SET</td>
<td> COMMENT 'Unique Id of the practitioner',</td>
<td>No comment yet added</td>
<td> id bigint NOT NULL COMMENT 'Unique Id of the practitioner',</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
<td>name</td>
<td>abp_address_town</td>
<td>varchar(1024)</td>
<td>varchar(255)</td>
<td>DEFAULT NULL</td>
<td>CHARACTER SET</td>
<td> COMMENT 'Name of the practitioner',</td>
<td>No comment yet added</td>
<td> name varchar(1024) DEFAULT NULL COMMENT 'Name of the practitioner',</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
</tbody>
</table>
<h2><span class="mw-headline" id="Sortable_tables">Procedure_request</span></h2>
<table class="sortable" border="1" style="border-collapse:collapse">
<tr>
<th scope="col" width="10%">Column Name</th>
<th scope="col" width="10%">Type</th>
<th scope="col" width="10%">Constraint</th>
<th scope="col" width="10%">Comment</th>
<th scope="col" width="10%">Sql</th>
</tr>
<tbody>
<tr>
<tr>
<td>date_recorded</td>
<td>abp_address_postcode</td>
<td>datetime</td>
<td>varchar(10)</td>
<td>DEFAULT NULL</td>
<td>CHARACTER SET</td>
<td> COMMENT 'The date the procedure was recorded in the source system',</td>
<td>No comment yet added</td>
<td> date_recorded datetime DEFAULT NULL COMMENT 'The date the procedure was recorded in the source system',</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
<td>patient_id</td>
<td>abp_address_organization</td>
<td>bigint</td>
<td>varchar(255)</td>
<td>NOT NULL</td>
<td>CHARACTER SET</td>
<td> COMMENT 'The organisations record for this person’s registration. Patients may have multiple records across clinical systems and may have registered at an organisation multiple times',</td>
<td>No comment yet added</td>
<td> patient_id bigint NOT NULL COMMENT 'The organisations record for this person’s registration. Patients may have multiple records across clinical systems and may have registered at an organisation multiple times',</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
<td>encounter_id</td>
<td>match_pattern_postcode</td>
<td>bigint</td>
<td>varchar(255)</td>
<td>DEFAULT NULL</td>
<td>CHARACTER SET</td>
<td> COMMENT 'Reference to the encounter the procedure was administered at',</td>
<td>No comment yet added</td>
<td> encounter_id bigint DEFAULT NULL COMMENT 'Reference to the encounter the procedure was administered at',</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
<td>id</td>
<td>match_pattern_street</td>
<td>bigint</td>
<td>varchar(255)</td>
<td>NOT NULL</td>
<td>CHARACTER SET</td>
<td> COMMENT 'Unique Id of the procedure',</td>
<td>No comment yet added</td>
<td> id bigint NOT NULL COMMENT 'Unique Id of the procedure',</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
<td>age_at_event</td>
<td>match_pattern_number</td>
<td>decimal(5,2)</td>
<td>varchar(255)</td>
<td>DEFAULT NULL</td>
<td>CHARACTER SET</td>
<td> COMMENT 'The age of the patient at the time of the procedure',</td>
<td>No comment yet added</td>
<td> age_at_event decimal(5,2) DEFAULT NULL COMMENT 'The age of the patient at the time of the procedure',</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
<td>organization_id</td>
<td>match_pattern_building</td>
<td>bigint</td>
<td>varchar(255)</td>
<td>NOT NULL</td>
<td>CHARACTER SET</td>
<td> COMMENT 'Owning organisation (i.e. publisher)',</td>
<td>No comment yet added</td>
<td> organization_id bigint NOT NULL COMMENT 'Owning organisation (i.e. publisher)',</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
<td>non_core_concept_id</td>
<td>match_pattern_flat</td>
<td>int</td>
<td>varchar(255)</td>
<td>DEFAULT NULL</td>
<td>CHARACTER SET</td>
<td> COMMENT 'Reference to the clinical coding of the procedure',</td>
<td>No comment yet added</td>
<td> non_core_concept_id int DEFAULT NULL COMMENT 'Reference to the clinical coding of the procedure',</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
<td>status_concept_id</td>
<td>algorithm_version</td>
<td>int</td>
<td>varchar(255)</td>
<td>DEFAULT NULL</td>
<td>CHARACTER SET</td>
<td> COMMENT 'Reference to the status of the procedure',</td>
<td>No comment yet added</td>
<td> status_concept_id int DEFAULT NULL COMMENT 'Reference to the status of the procedure',</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
<td>date_precision_concept_id</td>
<td>epoch</td>
<td>int</td>
<td>varchar(255)</td>
<td>DEFAULT NULL</td>
<td>CHARACTER SET</td>
<td> COMMENT 'Identifies the precision of the clinical effectiveness date to either year (1) month (2) day (5) minute (12) second (13) millisecond (14)',</td>
<td>No comment yet added</td>
<td> date_precision_concept_id int DEFAULT NULL COMMENT 'Identifies the precision of the clinical effectiveness date to either year (1) month (2) day (5) minute (12) second (13) millisecond (14)',</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
<td>core_concept_id</td>
<td colspan="5">Index name: `patient_address_uprn_index` Index Columns: (uprn)</td> </tr> <tr>
<td>int</td>
<td colspan="5">Index name: `patient_address_patient_address_id` Index Columns: (id,uprn)</td> </tr> <tr>
<td>DEFAULT NULL</td>
<td colspan="5">Index name: `patient_address_uprn_patient_address_id_fk` Index Columns: (patient_address_id)</td> </tr> <tr>
<td> COMMENT 'Reference to the clinical coding of the procedure',</td>
<td colspan="5">PRIMARY KEY CONSTRAINT(s) (`id`)</td> </tr> </table>
<td> core_concept_id int DEFAULT NULL COMMENT 'Reference to the clinical coding of the procedure',</td>
<h1><span class="mw-headline" id="Sortable_tables">patient_address_ralf</span></h1>
</tr>
<table class="mw-collapsible" border="1" style="border-collapse:collapse">
<tr>
<th scope="col">Column Name</th>
<th scope="col">Data Type</th>
<th scope="col">Constraint</th>
<th scope="col">Comment</th>
<th scope="col">Foreign Key Reference</th>
</tr>
<tr>
<tr>
<td>person_id</td>
<td>id</td>
<td>bigint</td>
<td>bigint</td>
<td>NOT NULL</td>
<td>NOT NULL,</td>
<td> COMMENT 'Unique individual across all organisations',</td>
<td>No comment yet added</td>
<td> person_id bigint NOT NULL COMMENT 'Unique individual across all organisations',</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
<td>clinical_effective_date</td>
<td>organization_id</td>
<td>date</td>
<td>bigint</td>
<td>DEFAULT NULL</td>
<td>NOT NULL,</td>
<td> COMMENT 'The date the procedure was administered by a clinician',</td>
<td>No comment yet added</td>
<td> clinical_effective_date date DEFAULT NULL COMMENT 'The date the procedure was administered by a clinician',</td>
<td>organization.id</td>
</tr>
</tr>
<tr>
<tr>
<td>practitioner_id</td>
<td>patient_id</td>
<td>bigint</td>
<td>bigint</td>
<td>DEFAULT NULL</td>
<td>NOT NULL,</td>
<td> COMMENT 'The clinician the activity is recorded against',</td>
<td>No comment yet added</td>
<td> practitioner_id bigint DEFAULT NULL COMMENT 'The clinician the activity is recorded against',</td>
<td>patient.id</td>
</tr>
</tr>
</tbody>
</table>
<h2><span class="mw-headline" id="Sortable_tables">Referral_request</span></h2>
<table class="sortable" border="1" style="border-collapse:collapse">
<tr>
<th scope="col" width="10%">Column Name</th>
<th scope="col" width="10%">Type</th>
<th scope="col" width="10%">Constraint</th>
<th scope="col" width="10%">Comment</th>
<th scope="col" width="10%">Sql</th>
</tr>
<tbody>
<tr>
<tr>
<td>recipient_organization_id</td>
<td>person_id</td>
<td>bigint</td>
<td>bigint</td>
<td>DEFAULT NULL</td>
<td>NOT NULL,</td>
<td> COMMENT 'Reference to the organization receiving the referral',</td>
<td>No comment yet added</td>
<td> recipient_organization_id bigint DEFAULT NULL COMMENT 'Reference to the organization receiving the referral',</td>
<td>person.id</td>
</tr>
</tr>
<tr>
<tr>
<td>patient_id</td>
<td>patient_address_id</td>
<td>bigint</td>
<td>bigint</td>
<td>NOT NULL</td>
<td>NOT NULL,</td>
<td> COMMENT 'The organisations record for this person’s registration. Patients may have multiple records across clinical systems and may have registered at an organisation multiple times',</td>
<td>No comment yet added</td>
<td> patient_id bigint NOT NULL COMMENT 'The organisations record for this person’s registration. Patients may have multiple records across clinical systems and may have registered at an organisation multiple times',</td>
<td>patient_address.id</td>
</tr>
</tr>
<tr>
<tr>
<td>referral_request_priority_concept_id</td>
<td>patient_address_match_uprn_ralf00</td>
<td>smallint</td>
<td>varchar(255)</td>
<td>DEFAULT NULL</td>
<td>NOT NULL,</td>
<td> COMMENT 'Reference to the priority of the referral',</td>
<td>No comment yet added</td>
<td> referral_request_priority_concept_id smallint DEFAULT NULL COMMENT 'Reference to the priority of the referral',</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
<td>age_at_event</td>
<td>salt_name</td>
<td>decimal(5,2)</td>
<td>varchar(50)</td>
<td>DEFAULT NULL</td>
<td>NOT NULL,</td>
<td> COMMENT 'The age of the patient at the time of the referral',</td>
<td>No comment yet added</td>
<td> age_at_event decimal(5,2) DEFAULT NULL COMMENT 'The age of the patient at the time of the referral',</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
<td>Mode</td>
<td>ralf</td>
<td>varchar(50)</td>
<td>varchar(255)</td>
<td>DEFAULT NULL</td>
<td>NOT NULL,</td>
<td> COMMENT 'The mode of the referral',</td>
<td>No comment yet added</td>
<td> Mode varchar(50) DEFAULT NULL COMMENT 'The mode of the referral',</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
<td>core_concept_id</td>
<td colspan="5">Index name: `fk_patient_address_ralf_organization_id` Index Columns: (organization_id)</td> </tr> <tr>
<td>int</td>
<td colspan="5">Index name: `fk_patient_address_ralf_person_id` Index Columns: (person_id)</td> </tr> <tr>
<td>DEFAULT NULL</td>
<td colspan="5">Index name: `ux_patient_address_ralf_id` Index Columns: (id)</td> </tr> <tr>
<td> COMMENT 'Reference to the clinical coding of the referral',</td>
<td colspan="5">Index name: `patient_address_ralf_patient_id` Index Columns: (patient_id)</td> </tr> <tr>
<td> core_concept_id int DEFAULT NULL COMMENT 'Reference to the clinical coding of the referral',</td>
<td colspan="5">Index name: `patient_address_ralf_patient_address_id` Index Columns: (patient_address_id)</td> </tr> <tr>
</tr>
<td colspan="5">Index name: `patient_address_ralf_patient_address_match_uprn_ralf_00` Index Columns: (patient_address_match_uprn_ralf00)</td> </tr> <tr>
<td colspan="5">PRIMARY KEY CONSTRAINT(s) (`id`,`patient_address_id`,`patient_address_match_uprn_ralf00`)</td> </tr> </table>
<h1><span class="mw-headline" id="Sortable_tables">patient_contact</span></h1>
<table class="mw-collapsible" border="1" style="border-collapse:collapse">
<tr>
<th scope="col">Column Name</th>
<th scope="col">Data Type</th>
<th scope="col">Constraint</th>
<th scope="col">Comment</th>
<th scope="col">Foreign Key Reference</th>
</tr>
<tr>
<tr>
<td>encounter_id</td>
<td>id</td>
<td>bigint</td>
<td>bigint</td>
<td>DEFAULT NULL</td>
<td>NOT NULL</td>
<td> COMMENT 'Reference to the encounter the referral was made in',</td>
<td> 'Unique Id of the patient contact'</td>
<td> encounter_id bigint DEFAULT NULL COMMENT 'Reference to the encounter the referral was made in',</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
Line 2,501: Line 2,502:
<td>bigint</td>
<td>bigint</td>
<td>NOT NULL</td>
<td>NOT NULL</td>
<td> COMMENT 'Owning organisation (i.e. publisher)',</td>
<td> 'Owning organisation (i.e. publisher)'</td>
<td> organization_id bigint NOT NULL COMMENT 'Owning organisation (i.e. publisher)',</td>
<td>patient.organization_id</td>
</tr>
</tr>
<tr>
<tr>
<td>requester_organization_id</td>
<td>patient_id</td>
<td>bigint</td>
<td>bigint</td>
<td>DEFAULT NULL</td>
<td>NOT NULL</td>
<td> COMMENT 'Reference to the organisation that made the refereral request',</td>
<td> 'The organisations record for this person’s registration. Patients may have multiple records across clinical systems and may have registered at an organisation multiple times'</td>
<td> requester_organization_id bigint DEFAULT NULL COMMENT 'Reference to the organisation that made the refereral request',</td>
<td>patient.id</td>
</tr>
</tr>
<tr>
<tr>
<td>id</td>
<td>person_id</td>
<td>bigint</td>
<td>bigint</td>
<td>NOT NULL</td>
<td>NOT NULL</td>
<td> COMMENT 'Unique Id of the referral',</td>
<td> 'Unique individual across all organisations'</td>
<td> id bigint NOT NULL COMMENT 'Unique Id of the referral',</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
<td>is_review</td>
<td>use_concept_id</td>
<td>tinyint(1)</td>
<td>int</td>
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> COMMENT 'Whether this referral is a review',</td>
<td> 'use of contact (e.g. mobile, home,work'</td>
<td> is_review tinyint(1) DEFAULT NULL COMMENT 'Whether this referral is a review',</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
<td>clinical_effective_date</td>
<td>type_concept_id</td>
<td>date</td>
<td>int</td>
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> COMMENT 'The date the referral was made',</td>
<td> 'type of contact (e.g. phone, email)'</td>
<td> clinical_effective_date date DEFAULT NULL COMMENT 'The date the referral was made',</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
<td>date_precision_concept_id</td>
<td>start_date</td>
<td>smallint</td>
<td>date</td>
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> COMMENT 'Identifies the precision of the clinical effectiveness date to either year (1) month (2) day (5) minute (12) second (13) millisecond (14)',</td>
<td> 'The start date of the contact being valid'</td>
<td> date_precision_concept_id smallint DEFAULT NULL COMMENT 'Identifies the precision of the clinical effectiveness date to either year (1) month (2) day (5) minute (12) second (13) millisecond (14)',</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
<td>referral_request_type_concept_id</td>
<td>end_date</td>
<td>int</td>
<td>date</td>
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> COMMENT 'Reference to the type of referral request',</td>
<td> 'The end date of the contact being valid'</td>
<td> referral_request_type_concept_id int DEFAULT NULL COMMENT 'Reference to the type of referral request',</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
<td>date_recorded</td>
<td>value</td>
<td>datetime</td>
<td>varchar(255)</td>
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> COMMENT 'The date the referral request was added to the source system',</td>
<td> 'The value of the contact information eg phone number, email address'</td>
<td> date_recorded datetime DEFAULT NULL COMMENT 'The date the referral request was added to the source system',</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
<td>person_id</td>
<td colspan="5">Unique index name: `ux_patient_contact_id` Index Columns: (id)</td> </tr> <tr>
<td colspan="5">Index name: `fk_patient_contact_patient_id_organisation_id` Index Columns: (patient_id,organization_id)</td> </tr> <tr>
<td colspan="5">PRIMARY KEY CONSTRAINT(s) (`organization_id`,`id`,`patient_id`,`person_id`)</td> </tr> </table>
<h1><span class="mw-headline" id="Sortable_tables">patient_pseudo_id</span></h1>
<table class="mw-collapsible" border="1" style="border-collapse:collapse">
<tr>
<th scope="col">Column Name</th>
<th scope="col">Data Type</th>
<th scope="col">Constraint</th>
<th scope="col">Comment</th>
<th scope="col">Foreign Key Reference</th>
</tr>
<tr>
<td>id</td>
<td>bigint</td>
<td>bigint</td>
<td>NOT NULL</td>
<td>NOT NULL</td>
<td> COMMENT 'Unique individual across all organisations',</td>
<td> 'Unique Id of the patient pseudo id'</td>
<td> person_id bigint NOT NULL COMMENT 'Unique individual across all organisations',</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
<td>outgoing_referral</td>
<td>organization_id</td>
<td>tinyint(1)</td>
<td>bigint</td>
<td>DEFAULT NULL</td>
<td>NOT NULL</td>
<td> COMMENT 'Whether this is an outgoing referral',</td>
<td> 'Owning organisation (i.e. publisher)'</td>
<td> outgoing_referral tinyint(1) DEFAULT NULL COMMENT 'Whether this is an outgoing referral',</td>
<td>patient.organization_id</td>
</tr>
</tr>
<tr>
<tr>
<td>non_core_concept_id</td>
<td>patient_id</td>
<td>int</td>
<td>bigint</td>
<td>DEFAULT NULL</td>
<td>NOT NULL</td>
<td> COMMENT 'Reference to the clinical coding of the referral',</td>
<td> 'Reference to the patient this registration status history belongs to'</td>
<td> non_core_concept_id int DEFAULT NULL COMMENT 'Reference to the clinical coding of the referral',</td>
<td>patient.id</td>
</tr>
</tr>
<tr>
<tr>
<td>practitioner_id</td>
<td>person_id</td>
<td>bigint</td>
<td>bigint</td>
<td>DEFAULT NULL</td>
<td>NOT NULL</td>
<td> COMMENT 'The clinician the activity is recorded against',</td>
<td> 'Reference to the person this registration status history belongs to'</td>
<td> practitioner_id bigint DEFAULT NULL COMMENT 'The clinician the activity is recorded against',</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
</tbody>
</table>
<h2><span class="mw-headline" id="Sortable_tables">Registration_status_history</span></h2>
<table class="sortable" border="1" style="border-collapse:collapse">
<tr>
<th scope="col" width="10%">Column Name</th>
<th scope="col" width="10%">Type</th>
<th scope="col" width="10%">Constraint</th>
<th scope="col" width="10%">Comment</th>
<th scope="col" width="10%">Sql</th>
</tr>
<tbody>
<tr>
<tr>
<td>end_date</td>
<td>salt_name</td>
<td>datetime</td>
<td>varchar(50)</td>
<td>DEFAULT NULL</td>
<td>NOT NULL</td>
<td> COMMENT 'The end date for the period this registration status history was valid',</td>
<td> 'The name of the salt used to create the pseudo id'</td>
<td> end_date datetime DEFAULT NULL COMMENT 'The end date for the period this registration status history was valid',</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
<td>registration_status_concept_id</td>
<td>Skid</td>
<td>int</td>
<td>varchar(255)</td>
<td>DEFAULT NULL</td>
<td>NOT NULL</td>
<td> COMMENT 'Reference to the registration status',</td>
<td> '"Secure Key IDentifier" - the pseudonymised ID generated for this patient using the salt specified in the salt_name column. Typically generated from patient NHS number, but is configurable on a case by case basis (e.g. may include date of birth)'</td>
<td> registration_status_concept_id int DEFAULT NULL COMMENT 'Reference to the registration status',</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
<td>start_date</td>
<td>is_nhs_number_valid</td>
<td>datetime</td>
<td>tinyint(1)</td>
<td>DEFAULT NULL</td>
<td>NOT NULL</td>
<td> COMMENT 'The start date for the period this registration status history was valid',</td>
<td> 'Whether the nhs number is valid'</td>
<td> start_date datetime DEFAULT NULL COMMENT 'The start date for the period this registration status history was valid',</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
<td>organization_id</td>
<td>is_nhs_number_verified_by_publisher</td>
<td>bigint</td>
<td>tinyint(1)</td>
<td>NOT NULL</td>
<td>NOT NULL</td>
<td> COMMENT 'Owning organisation (i.e. publisher)',</td>
<td> 'Whether the nhs number has been verified by the publisher'</td>
<td> organization_id bigint NOT NULL COMMENT 'Owning organisation (i.e. publisher)',</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
<td>episode_of_care_id</td>
<td colspan="5">Unique index name: `ux_patient_pseudo_id` Index Columns: (id)</td> </tr> <tr>
<td colspan="5">Index name: `fk_patient_pseudo_id` Index Columns: (patient_id,organization_id)</td> </tr> <tr>
<td colspan="5">Index name: `patient_pseudo_id_patient` Index Columns: (patient_id)</td> </tr> <tr>
<td colspan="5">PRIMARY KEY CONSTRAINT(s) (`organization_id`,`person_id`,`id`)</td> </tr> </table>
<h1><span class="mw-headline" id="Sortable_tables">patient_uprn</span></h1>
<table class="mw-collapsible" border="1" style="border-collapse:collapse">
<tr>
<th scope="col">Column Name</th>
<th scope="col">Data Type</th>
<th scope="col">Constraint</th>
<th scope="col">Comment</th>
<th scope="col">Foreign Key Reference</th>
</tr>
<tr>
<td>patient_id</td>
<td>bigint</td>
<td>bigint</td>
<td>DEFAULT NULL</td>
<td>NOT NULL</td>
<td> COMMENT 'Reference to the episode of care this status history belongs to',</td>
<td> 'The organisations record for this person’s registration. Patients may have multiple records across clinical systems and may have registered at an organisation multiple times'</td>
<td> episode_of_care_id bigint DEFAULT NULL COMMENT 'Reference to the episode of care this status history belongs to',</td>
<td>patient.id</td>
</tr>
</tr>
<tr>
<tr>
<td>person_id</td>
<td>organization_id</td>
<td>bigint</td>
<td>bigint</td>
<td>NOT NULL</td>
<td>NOT NULL</td>
<td> COMMENT 'Reference to the person this registration status history belongs to',</td>
<td> 'Owning organisation (i.e. publisher)'</td>
<td> person_id bigint NOT NULL COMMENT 'Reference to the person this registration status history belongs to',</td>
<td>patient.organization_id</td>
</tr>
</tr>
<tr>
<tr>
<td>id</td>
<td>person_id</td>
<td>bigint</td>
<td>bigint</td>
<td>NOT NULL</td>
<td>NOT NULL</td>
<td> COMMENT 'Unique Id of the registration status history',</td>
<td> 'Unique individual across all organisations'</td>
<td> id bigint NOT NULL COMMENT 'Unique Id of the registration status history',</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
<td>patient_id</td>
<td>uprn</td>
<td>bigint</td>
<td>bigint</td>
<td>NOT NULL</td>
<td>DEFAULT NULL,</td>
<td> COMMENT 'Reference to the patient this registration status history belongs to',</td>
<td>No comment yet added</td>
<td> patient_id bigint NOT NULL COMMENT 'Reference to the patient this registration status history belongs to',</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
</tbody>
</table>
<h2><span class="mw-headline" id="Sortable_tables">Schedule</span></h2>
<table class="sortable" border="1" style="border-collapse:collapse">
<tr>
<th scope="col" width="10%">Column Name</th>
<th scope="col" width="10%">Type</th>
<th scope="col" width="10%">Constraint</th>
<th scope="col" width="10%">Comment</th>
<th scope="col" width="10%">Sql</th>
</tr>
<tbody>
<tr>
<tr>
<td>id</td>
<td>qualifier</td>
<td>bigint</td>
<td>varchar(50)</td>
<td>NOT NULL</td>
<td>DEFAULT NULL,</td>
<td> COMMENT 'Unique Id of the schedule',</td>
<td>No comment yet added</td>
<td> id bigint NOT NULL COMMENT 'Unique Id of the schedule',</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
<td>type</td>
<td>algorithm</td>
<td>varchar(255)</td>
<td>varchar(255)</td>
<td>DEFAULT NULL</td>
<td>DEFAULT NULL,</td>
<td> COMMENT 'The type of schedule eg Timed Appointments',</td>
<td>No comment yet added</td>
<td> type varchar(255) DEFAULT NULL COMMENT 'The type of schedule eg Timed Appointments',</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
<td>name</td>
<td>match</td>
<td>varchar(150)</td>
<td>varchar(255)</td>
<td>DEFAULT NULL</td>
<td>DEFAULT NULL,</td>
<td> COMMENT 'The name of the schedule',</td>
<td>No comment yet added</td>
<td> name varchar(150) DEFAULT NULL COMMENT 'The name of the schedule',</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
<td>organization_id</td>
<td>no_address</td>
<td>bigint</td>
<td>tinyint(1)</td>
<td>NOT NULL</td>
<td>DEFAULT NULL,</td>
<td> COMMENT 'Owning organisation (i.e. publisher)',</td>
<td>No comment yet added</td>
<td> organization_id bigint NOT NULL COMMENT 'Owning organisation (i.e. publisher)',</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
<td>location</td>
<td>invalid_address</td>
<td>varchar(255)</td>
<td>tinyint(1)</td>
<td>DEFAULT NULL</td>
<td>DEFAULT NULL,</td>
<td> COMMENT 'Textual description of the location the schedule was held at',</td>
<td>No comment yet added</td>
<td> location varchar(255) DEFAULT NULL COMMENT 'Textual description of the location the schedule was held at',</td>
<td>No Foreign Key reference</td>
</tr>
<tr>
<td>missing_postcode</td>
<td>tinyint(1)</td>
<td>DEFAULT NULL,</td>
<td>No comment yet added</td>
<td>No Foreign Key reference</td>
</tr>
<tr>
<td>invalid_postcode</td>
<td>tinyint(1)</td>
<td>DEFAULT NULL,</td>
<td>No comment yet added</td>
<td>No Foreign Key reference</td>
</tr>
<tr>
<td colspan="5">Unique index name: `patient_uprn_id` Index Columns: (patient_id)</td> </tr> <tr>
<td colspan="5">Index name: `fk_patient_uprn_patient_id_organisation_id` Index Columns: (patient_id,organization_id)</td> </tr> <tr>
<td colspan="5">PRIMARY KEY CONSTRAINT(s) (`organization_id`,`person_id`,`patient_id`)</td> </tr> </table>
<h1><span class="mw-headline" id="Sortable_tables">person</span></h1>
<table class="mw-collapsible" border="1" style="border-collapse:collapse">
<tr>
<th scope="col">Column Name</th>
<th scope="col">Data Type</th>
<th scope="col">Constraint</th>
<th scope="col">Comment</th>
<th scope="col">Foreign Key Reference</th>
</tr>
<tr>
<td>id</td>
<td>bigint</td>
<td>NOT NULL</td>
<td> 'Unique Id of the person'</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
<td>practitioner_id</td>
<td>organization_id</td>
<td>bigint</td>
<td>bigint</td>
<td>NOT NULL</td>
<td> 'Owning organisation (i.e. publisher)'</td>
<td>No Foreign Key reference</td>
</tr>
<tr>
<td>title</td>
<td>varchar(255)</td>
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> COMMENT 'Reference to the practitioner who owns the schedule',</td>
<td> 'The title of the person'</td>
<td> practitioner_id bigint DEFAULT NULL COMMENT 'Reference to the practitioner who owns the schedule',</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
<td>start_date</td>
<td>first_names</td>
<td>date</td>
<td>varchar(255)</td>
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> COMMENT 'The start date of the schedule',</td>
<td> 'The first names of the person'</td>
<td> start_date date DEFAULT NULL COMMENT 'The start date of the schedule',</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
</tbody>
<tr>
</table>
<td>last_name</td>
<td>varchar(255)</td>
<td>DEFAULT NULL</td>
<td> 'The last name of the person'</td>
<td>No Foreign Key reference</td>
</tr>
<tr>
<td>gender_concept_id</td>
<td>int</td>
<td>DEFAULT NULL</td>
<td> 'Reference to the gender of the person'</td>
<td>No Foreign Key reference</td>
</tr>
<tr>
<td>nhs_number</td>
<td>varchar(255)</td>
<td>DEFAULT NULL</td>
<td> 'The NHS number of the person'</td>
<td>No Foreign Key reference</td>
</tr>
<tr>
<td>date_of_birth</td>
<td>date</td>
<td>DEFAULT NULL</td>
<td> 'The date of birth of the person'</td>
<td>No Foreign Key reference</td>
</tr>
<tr>
<td>date_of_death</td>
<td>date</td>
<td>DEFAULT NULL</td>
<td> 'The date of death of the person'</td>
<td>No Foreign Key reference</td>
</tr>
<tr>
<td>current_address_id</td>
<td>bigint</td>
<td>NOT NULL</td>
<td> 'Reference to the current address of the person'</td>
<td>No Foreign Key reference</td>
</tr>
<tr>
<td>ethnic_code_concept_id</td>
<td>int</td>
<td>DEFAULT NULL</td>
<td> 'Reference to the ethnicity of the person'</td>
<td>No Foreign Key reference</td>
</tr>
<tr>
<td>registered_practice_organization_id</td>
<td>bigint</td>
<td>DEFAULT NULL</td>
<td> 'Reference to the organisation the person is registered at'</td>
<td>No Foreign Key reference</td>
</tr>
<tr>
<td>birth_year</td>
<td>smallint</td>
<td>DEFAULT NULL,</td>
<td>No comment yet added</td>
<td>No Foreign Key reference</td>
</tr>
<tr>
<td>birth_month</td>
<td>tinyint</td>
<td>DEFAULT NULL,</td>
<td>No comment yet added</td>
<td>No Foreign Key reference</td>
</tr>
<tr>
<td>birth_week</td>
<td>tinyint</td>
<td>DEFAULT NULL,</td>
<td>No comment yet added</td>
<td>No Foreign Key reference</td>
</tr>
<tr>
<td colspan="5">Unique index name: `person_id` Index Columns: (id)</td> </tr> <tr>
<td colspan="5">PRIMARY KEY CONSTRAINT(s) (`id`)</td> </tr> </table>
<h1><span class="mw-headline" id="Sortable_tables">practitioner</span></h1>
<table class="mw-collapsible" border="1" style="border-collapse:collapse">
<tr>
<th scope="col">Column Name</th>
<th scope="col">Data Type</th>
<th scope="col">Constraint</th>
<th scope="col">Comment</th>
<th scope="col">Foreign Key Reference</th>
</tr>
<tr>
<td>id</td>
<td>bigint</td>
<td>NOT NULL</td>
<td> 'Unique Id of the practitioner'</td>
<td>No Foreign Key reference</td>
</tr>
<tr>
<td>organization_id</td>
<td>bigint</td>
<td>NOT NULL</td>
<td> 'Owning organisation (i.e. publisher)'</td>
<td>organization.id</td>
</tr>
<tr>
<td>name</td>
<td>varchar(1024)</td>
<td>DEFAULT NULL</td>
<td> 'Name of the practitioner'</td>
<td>No Foreign Key reference</td>
</tr>
<tr>
<td>role_code</td>
<td>varchar(50)</td>
<td>DEFAULT NULL</td>
<td> 'The code representing the role of the practitioner'</td>
<td>No Foreign Key reference</td>
</tr>
<tr>
<td>role_desc</td>
<td>varchar(255)</td>
<td>DEFAULT NULL</td>
<td> 'Textual description of the role of the practitioner eg General Medical Practitioner'</td>
<td>No Foreign Key reference</td>
</tr>
<tr>
<td>gmc_code</td>
<td>varchar(50)</td>
<td>DEFAULT NULL</td>
<td> 'The GMC code of the practitioner'</td>
<td>No Foreign Key reference</td>
</tr>
<tr>
<td colspan="5">Unique index name: `practitioner_id` Index Columns: (id)</td> </tr> <tr>
<td colspan="5">Index name: `fk_practitioner_organisation_id` Index Columns: (organization_id)</td> </tr> <tr>
<td colspan="5">PRIMARY KEY CONSTRAINT(s) (`id`)</td> </tr> </table>
<h1><span class="mw-headline" id="Sortable_tables">procedure_request</span></h1>
<table class="mw-collapsible" border="1" style="border-collapse:collapse">
<tr>
<th scope="col">Column Name</th>
<th scope="col">Data Type</th>
<th scope="col">Constraint</th>
<th scope="col">Comment</th>
<th scope="col">Foreign Key Reference</th>
</tr>
<tr>
<td>id</td>
<td>bigint</td>
<td>NOT NULL</td>
<td> 'Unique Id of the procedure'</td>
<td>No Foreign Key reference</td>
</tr>
<tr>
<td>organization_id</td>
<td>bigint</td>
<td>NOT NULL</td>
<td> 'Owning organisation (i.e. publisher)'</td>
<td>patient.organization_id</td>
</tr>
<tr>
<td>patient_id</td>
<td>bigint</td>
<td>NOT NULL</td>
<td> 'The organisations record for this person’s registration. Patients may have multiple records across clinical systems and may have registered at an organisation multiple times'</td>
<td>patient.id</td>
</tr>
<tr>
<td>person_id</td>
<td>bigint</td>
<td>NOT NULL</td>
<td> 'Unique individual across all organisations'</td>
<td>No Foreign Key reference</td>
</tr>
<tr>
<td>encounter_id</td>
<td>bigint</td>
<td>DEFAULT NULL</td>
<td> 'Reference to the encounter the procedure was administered at'</td>
<td>No Foreign Key reference</td>
</tr>
<tr>
<td>practitioner_id</td>
<td>bigint</td>
<td>DEFAULT NULL</td>
<td> 'The clinician the activity is recorded against'</td>
<td>practitioner.id</td>
</tr>
<tr>
<td>clinical_effective_date</td>
<td>datetime</td>
<td>DEFAULT NULL</td>
<td> 'The date the procedure was administered by a clinician'</td>
<td>No Foreign Key reference</td>
</tr>
<tr>
<td>date_precision_concept_id</td>
<td>int</td>
<td>DEFAULT NULL</td>
<td> 'Identifies the precision of the clinical effectiveness date to either year (1) month (2) day (5) minute (12) second (13) millisecond (14)'</td>
<td>No Foreign Key reference</td>
</tr>
<tr>
<td>status_concept_id</td>
<td>int</td>
<td>DEFAULT NULL</td>
<td> 'Reference to the status of the procedure'</td>
<td>No Foreign Key reference</td>
</tr>
<tr>
<td>core_concept_id</td>
<td>int</td>
<td>DEFAULT NULL</td>
<td> 'Reference to the clinical coding of the procedure'</td>
<td>No Foreign Key reference</td>
</tr>
<tr>
<td>non_core_concept_id</td>
<td>int</td>
<td>DEFAULT NULL</td>
<td> 'Reference to the clinical coding of the procedure'</td>
<td>No Foreign Key reference</td>
</tr>
<tr>
<td>age_at_event</td>
<td>decimal(5,2)</td>
<td>DEFAULT NULL</td>
<td> 'The age of the patient at the time of the procedure'</td>
<td>No Foreign Key reference</td>
</tr>
<tr>
<td>date_recorded</td>
<td>datetime</td>
<td>DEFAULT NULL</td>
<td> 'The date the procedure was recorded in the source system'</td>
<td>No Foreign Key reference</td>
</tr>
<tr>
<td colspan="5">Unique index name: `procedure_request_id` Index Columns: (id)</td> </tr> <tr>
<td colspan="5">Index name: `fk_procedure_request_patient_id_organization_id` Index Columns: (patient_id,organization_id)</td> </tr> <tr>
<td colspan="5">Index name: `fk_procedure_request_practitioner_id` Index Columns: (practitioner_id)</td> </tr> <tr>
<td colspan="5">Index name: `procedure_request_patient_id` Index Columns: (patient_id)</td> </tr> <tr>
<td colspan="5">PRIMARY KEY CONSTRAINT(s) (`organization_id`,`person_id`,`id`)</td> </tr> </table>
<h1><span class="mw-headline" id="Sortable_tables">referral_request</span></h1>
<table class="mw-collapsible" border="1" style="border-collapse:collapse">
<tr>
<th scope="col">Column Name</th>
<th scope="col">Data Type</th>
<th scope="col">Constraint</th>
<th scope="col">Comment</th>
<th scope="col">Foreign Key Reference</th>
</tr>
<tr>
<td>id</td>
<td>bigint</td>
<td>NOT NULL</td>
<td> 'Unique Id of the referral'</td>
<td>No Foreign Key reference</td>
</tr>
<tr>
<td>organization_id</td>
<td>bigint</td>
<td>NOT NULL</td>
<td> 'Owning organisation (i.e. publisher)'</td>
<td>patient.organization_id</td>
</tr>
<tr>
<td>patient_id</td>
<td>bigint</td>
<td>NOT NULL</td>
<td> 'The organisations record for this person’s registration. Patients may have multiple records across clinical systems and may have registered at an organisation multiple times'</td>
<td>patient.id</td>
</tr>
<tr>
<td>person_id</td>
<td>bigint</td>
<td>NOT NULL</td>
<td> 'Unique individual across all organisations'</td>
<td>No Foreign Key reference</td>
</tr>
<tr>
<td>encounter_id</td>
<td>bigint</td>
<td>DEFAULT NULL</td>
<td> 'Reference to the encounter the referral was made in'</td>
<td>No Foreign Key reference</td>
</tr>
<tr>
<td>practitioner_id</td>
<td>bigint</td>
<td>DEFAULT NULL</td>
<td> 'The clinician the activity is recorded against'</td>
<td>practitioner.id</td>
</tr>
<tr>
<td>clinical_effective_date</td>
<td>datetime</td>
<td>DEFAULT NULL</td>
<td> 'The date the referral was made'</td>
<td>No Foreign Key reference</td>
</tr>
<tr>
<td>date_precision_concept_id</td>
<td>int</td>
<td>DEFAULT NULL</td>
<td> 'Identifies the precision of the clinical effectiveness date to either year (1) month (2) day (5) minute (12) second (13) millisecond (14)'</td>
<td>No Foreign Key reference</td>
</tr>
<tr>
<td>requester_organization_id</td>
<td>bigint</td>
<td>DEFAULT NULL</td>
<td> 'Reference to the organisation that made the refereral request'</td>
<td>organization.id</td>
</tr>
<tr>
<td>recipient_organization_id</td>
<td>bigint</td>
<td>DEFAULT NULL</td>
<td> 'Reference to the organization receiving the referral'</td>
<td>organization.id</td>
</tr>
<tr>
<td>referral_request_priority_concept_id</td>
<td>int</td>
<td>DEFAULT NULL</td>
<td> 'Reference to the priority of the referral'</td>
<td>No Foreign Key reference</td>
</tr>
<tr>
<td>referral_request_type_concept_id</td>
<td>int</td>
<td>DEFAULT NULL</td>
<td> 'Reference to the type of referral request'</td>
<td>No Foreign Key reference</td>
</tr>
<tr>
<td>mode</td>
<td>varchar(50)</td>
<td>DEFAULT NULL</td>
<td> 'The mode of the referral'</td>
<td>No Foreign Key reference</td>
</tr>
<tr>
<td>outgoing_referral</td>
<td>tinyint(1)</td>
<td>DEFAULT NULL</td>
<td> 'Whether this is an outgoing referral'</td>
<td>No Foreign Key reference</td>
</tr>
<tr>
<td>is_review</td>
<td>tinyint(1)</td>
<td>NOT NULL</td>
<td> 'Whether this referral is a review'</td>
<td>No Foreign Key reference</td>
</tr>
<tr>
<td>core_concept_id</td>
<td>int</td>
<td>DEFAULT NULL</td>
<td> 'Reference to the clinical coding of the referral'</td>
<td>No Foreign Key reference</td>
</tr>
<tr>
<td>non_core_concept_id</td>
<td>int</td>
<td>DEFAULT NULL</td>
<td> 'Reference to the clinical coding of the referral'</td>
<td>No Foreign Key reference</td>
</tr>
<tr>
<td>age_at_event</td>
<td>decimal(5,2)</td>
<td>DEFAULT NULL</td>
<td> 'The age of the patient at the time of the referral'</td>
<td>No Foreign Key reference</td>
</tr>
<tr>
<td>date_recorded</td>
<td>datetime</td>
<td>DEFAULT NULL</td>
<td> 'The date the referral request was added to the source system'</td>
<td>No Foreign Key reference</td>
</tr>
<tr>
<td colspan="5">Unique index name: `referral_request_id` Index Columns: (id)</td> </tr> <tr>
<td colspan="5">Index name: `fk_referral_request_patient_id_organization_id` Index Columns: (patient_id,organization_id)</td> </tr> <tr>
<td colspan="5">Index name: `fk_referral_request_practitioner_id` Index Columns: (practitioner_id)</td> </tr> <tr>
<td colspan="5">Index name: `fk_referral_request_recipient_organization_id` Index Columns: (recipient_organization_id)</td> </tr> <tr>
<td colspan="5">Index name: `fk_referral_request_requester_organization_id` Index Columns: (requester_organization_id)</td> </tr> <tr>
<td colspan="5">Index name: `referral_request_patient_id` Index Columns: (patient_id)</td> </tr> <tr>
<td colspan="5">Index name: `referral_request_core_concept_id` Index Columns: (core_concept_id)</td> </tr> <tr>
<td colspan="5">PRIMARY KEY CONSTRAINT(s) (`organization_id`,`person_id`,`id`)</td> </tr> </table>
<h1><span class="mw-headline" id="Sortable_tables">registration_status_history</span></h1>
<table class="mw-collapsible" border="1" style="border-collapse:collapse">
<tr>
<th scope="col">Column Name</th>
<th scope="col">Data Type</th>
<th scope="col">Constraint</th>
<th scope="col">Comment</th>
<th scope="col">Foreign Key Reference</th>
</tr>
<tr>
<td>id</td>
<td>bigint</td>
<td>NOT NULL</td>
<td> 'Unique Id of the registration status history'</td>
<td>No Foreign Key reference</td>
</tr>
<tr>
<td>organization_id</td>
<td>bigint</td>
<td>NOT NULL</td>
<td> 'Owning organisation (i.e. publisher)'</td>
<td>No Foreign Key reference</td>
</tr>
<tr>
<td>patient_id</td>
<td>bigint</td>
<td>NOT NULL</td>
<td> 'Reference to the patient this registration status history belongs to'</td>
<td>No Foreign Key reference</td>
</tr>
<tr>
<td>person_id</td>
<td>bigint</td>
<td>NOT NULL</td>
<td> 'Reference to the person this registration status history belongs to'</td>
<td>No Foreign Key reference</td>
</tr>
<tr>
<td>episode_of_care_id</td>
<td>bigint</td>
<td>DEFAULT NULL</td>
<td> 'Reference to the episode of care this status history belongs to'</td>
<td>episode_of_care.id</td>
</tr>
<tr>
<td>registration_status_concept_id</td>
<td>int</td>
<td>DEFAULT NULL</td>
<td> 'Reference to the registration status'</td>
<td>No Foreign Key reference</td>
</tr>
<tr>
<td>start_date</td>
<td>datetime</td>
<td>DEFAULT NULL</td>
<td> 'The start date for the period this registration status history was valid'</td>
<td>No Foreign Key reference</td>
</tr>
<tr>
<td>end_date</td>
<td>datetime</td>
<td>DEFAULT NULL</td>
<td> 'The end date for the period this registration status history was valid'</td>
<td>No Foreign Key reference</td>
</tr>
<tr>
<td colspan="5">Unique index name: `ux_registration_status_history_id` Index Columns: (id)</td> </tr> <tr>
<td colspan="5">Index name: `fk_registration_status_history_episode_id` Index Columns: (episode_of_care_id)</td> </tr> <tr>
<td colspan="5">PRIMARY KEY CONSTRAINT(s) (`organization_id`,`id`,`patient_id`,`person_id`)</td> </tr> </table>
<h1><span class="mw-headline" id="Sortable_tables">schedule</span></h1>
<table class="mw-collapsible" border="1" style="border-collapse:collapse">
<tr>
<th scope="col">Column Name</th>
<th scope="col">Data Type</th>
<th scope="col">Constraint</th>
<th scope="col">Comment</th>
<th scope="col">Foreign Key Reference</th>
</tr>
<tr>
<td>id</td>
<td>bigint</td>
<td>NOT NULL</td>
<td> 'Unique Id of the schedule'</td>
<td>No Foreign Key reference</td>
</tr>
<tr>
<td>organization_id</td>
<td>bigint</td>
<td>NOT NULL</td>
<td> 'Owning organisation (i.e. publisher)'</td>
<td>organization.id</td>
</tr>
<tr>
<td>practitioner_id</td>
<td>bigint</td>
<td>DEFAULT NULL</td>
<td> 'Reference to the practitioner who owns the schedule'</td>
<td>No Foreign Key reference</td>
</tr>
<tr>
<td>start_date</td>
<td>datetime</td>
<td>DEFAULT NULL</td>
<td> 'The start date of the schedule'</td>
<td>No Foreign Key reference</td>
</tr>
<tr>
<td>type</td>
<td>varchar(255)</td>
<td>DEFAULT NULL</td>
<td> 'The type of schedule eg Timed Appointments'</td>
<td>No Foreign Key reference</td>
</tr>
<tr>
<td>location</td>
<td>varchar(255)</td>
<td>DEFAULT NULL</td>
<td> 'Textual description of the location the schedule was held at'</td>
<td>No Foreign Key reference</td>
</tr>
<tr>
<td>name</td>
<td>varchar(150)</td>
<td>DEFAULT NULL</td>
<td> 'The name of the schedule'</td>
<td>No Foreign Key reference</td>
</tr>
<tr>
<td colspan="5">Unique index name: `schedule_id` Index Columns: (id)</td> </tr> <tr>
<td colspan="5">PRIMARY KEY CONSTRAINT(s) (`organization_id`,`id`)</td> </tr> </table>
<h1><span class="mw-headline" id="Sortable_tables">DATABASE UPDATE INFO</span></h1>
<table class="mw-collapsible" border="1" style="border-collapse:collapse">
<tr>
<th scope="col">New Version</th>
<th scope="col">Date Updated</th>
</tr>
<tr>
<td>v231321e3242432</td>
<td>2022-12-16T10:49:45.099510800</td>
</tr></table>

Latest revision as of 10:50, 16 December 2022

Remote Subscriber Database (RSD) Schema (Compass 2) Version: v231321e3242432

From Discovery Data Service

allergy_intolerance

Column Name Data Type Constraint Comment Foreign Key Reference
id bigint NOT NULL 'Unique Id of the allergy' No Foreign Key reference
organization_id bigint NOT NULL 'Owning organisation (i.e. publisher)' patient.organization_id
patient_id bigint NOT NULL 'The organisations record for this person’s registration. Patients may have multiple records across clinical systems and may have registered at an organisation multiple times' patient.id
person_id bigint NOT NULL 'Unique individual across all organisations' No Foreign Key reference
encounter_id bigint DEFAULT NULL 'Reference to the encounter this allergy was record in' encounter.id
practitioner_id bigint DEFAULT NULL 'The clinician the activity is recorded against' practitioner.id
clinical_effective_date date DEFAULT NULL 'The date the clinical code is recorded for' No Foreign Key reference
date_precision_concept_id int DEFAULT NULL 'Identifies the precision of the clinical effectiveness date to either year (1) month (2) day (5) minute (12) second (13) millisecond (14)' No Foreign Key reference
is_review tinyint(1) NOT NULL 'Is this instance of the code a review of a previous encounter' No Foreign Key reference
core_concept_id int DEFAULT NULL 'Reference to the clinical coding of the allergy' No Foreign Key reference
non_core_concept_id int DEFAULT NULL 'Reference to the clinical coding of the allergy' No Foreign Key reference
age_at_event decimal(5,2) DEFAULT NULL 'The age the patient was at the time of this event' No Foreign Key reference
date_recorded datetime NOT NULL 'The date the allergy was recorded' No Foreign Key reference
Unique index name: `allergy_intolerance_id` Index Columns: (id)
Index name: `fk_allergy_intolerance_encounter_id` Index Columns: (encounter_id)
Index name: `fk_allergy_intolerance_patient_id_organization_id` Index Columns: (patient_id,organization_id)
Index name: `fk_allergy_intolerance_practitioner_id` Index Columns: (practitioner_id)
Index name: `allergy_intolerance_patient_id` Index Columns: (patient_id)
Index name: `allergy_intolerance_core_concept_id` Index Columns: (core_concept_id)
PRIMARY KEY CONSTRAINT(s) (`organization_id`,`person_id`,`id`)

appointment

Column Name Data Type Constraint Comment Foreign Key Reference
id bigint NOT NULL 'Unique Id of the appointment' No Foreign Key reference
organization_id bigint NOT NULL 'Owning organisation (i.e. publisher)' organization.id
patient_id bigint NOT NULL 'The organisations record for this person’s registration. Patients may have multiple records across clinical systems and may have registered at an organisation multiple times' No Foreign Key reference
person_id bigint NOT NULL 'Unique individual across all organisations' No Foreign Key reference
practitioner_id bigint DEFAULT NULL 'The clinician the activity is recorded against' practitioner.id
schedule_id bigint DEFAULT NULL 'The schedule the patient was put on to book multiple appointments. ID unique to the applied schedule' No Foreign Key reference
start_date date DEFAULT NULL 'The start date of the appointment' No Foreign Key reference
planned_duration int DEFAULT NULL 'The time allocated for the appointment, not necessarily the actual duration always in minutes' No Foreign Key reference
actual_duration int DEFAULT NULL 'Time between sent in and left always in minutes' No Foreign Key reference
appointment_status_concept_id int DEFAULT NULL 'The status of the appointment e.g. arrived/sent in/left/DNA' No Foreign Key reference
patient_wait int DEFAULT NULL 'How long the patient waited from being marked as arrived to being sent in' No Foreign Key reference
patient_delay int DEFAULT NULL 'How long the patient was delayed for' No Foreign Key reference
date_time_sent_in datetime DEFAULT NULL 'Date and time the patient was sent into the practitioner' No Foreign Key reference
date_time_left datetime DEFAULT NULL 'Date and time the patient left the practitioner' No Foreign Key reference
source_id varchar(36) DEFAULT NULL 'Unique reference to the source of the appointment' No Foreign Key reference
cancelled_date datetime DEFAULT NULL 'The date the appointment was cancelled' No Foreign Key reference
Unique index name: `appointment_id` Index Columns: (id)
Index name: `fk_appointment_practitioner_id` Index Columns: (practitioner_id)
Index name: `appointment_patient_id` Index Columns: (patient_id)
PRIMARY KEY CONSTRAINT(s) (`organization_id`,`person_id`,`id`)

appointment_additional

Column Name Data Type Constraint Comment Foreign Key Reference
id bigint NOT NULL 'same as the id column on the patient table ' No Foreign Key reference
property_id int NOT NULL 'IM reference (e.g. appointment type)' No Foreign Key reference
value_id int DEFAULT NULL 'IM reference (e.g. appointment type)' No Foreign Key reference
json_value json DEFAULT NULL 'where there is no mapped value_id, just raw JSON' No Foreign Key reference
text_value varchar(255) DEFAULT NULL 'where there is no mapped value_id or raw JSON, just a basic text value (i.e. GP Practitioner number)' No Foreign Key reference
Index name: `appointment_additional_value_id` Index Columns: (value_id)
PRIMARY KEY CONSTRAINT(s) (`id`,`property_id`)

concept

Column Name Data Type Constraint Comment Foreign Key Reference
dbid int NOT NULL 'Unique concept int DB identifier' No Foreign Key reference
document int DEFAULT NULL 'Document this concept originated from' No Foreign Key reference
id varchar(150) CHARACTER SET 'Unique human-readable concept id' No Foreign Key reference
draft tinyint(1) DEFAULT NULL, No comment yet added No Foreign Key reference
name varchar(255) DEFAULT NULL 'Short name' No Foreign Key reference
description varchar(400) DEFAULT NULL 'Full name (or term for ontological concepts)' No Foreign Key reference
scheme bigint DEFAULT NULL 'The coding scheme for the code (Read, CTV3, SNOMED etc)' No Foreign Key reference
code varchar(40) CHARACTER SET 'The code (non-unique unless coupled with a scheme)' No Foreign Key reference
use_count bigint No Constraint 'Rough indicator of number of occurences of the concept' No Foreign Key reference
updated datetime NOT NULL 'The timestamp of the last update to the concept' No Foreign Key reference
Index name: `ix_scheme_code` Index Columns: (scheme,code)
Index name: `ix_code` Index Columns: (code)
Index name: `ix_dbid_code` Index Columns: (dbid,code)
PRIMARY KEY CONSTRAINT(s) (`dbid`)

concept_map

Column Name Data Type Constraint Comment Foreign Key Reference
legacy int NOT NULL 'the legacy (read 2, ctv3, icd10, opcs4, emis local, etc) concept' No Foreign Key reference
core int NOT NULL 'the core (snomed, discovery) concept that the legacy concept maps to' No Foreign Key reference
updated datetime NOT NULL 'Timestamp the map was last updated/added' No Foreign Key reference
id int NOT NULL, No comment yet added No Foreign Key reference
deleted tinyint(1) DEFAULT NULL, No comment yet added No Foreign Key reference
Unique index name: `concept_map_uq` Index Columns: (legacy,deleted,updated)
Index name: `ix_legacy_core` Index Columns: (legacy,core)
PRIMARY KEY CONSTRAINT(s) (`id`)

database_version

Column Name Data Type Constraint Comment Foreign Key Reference
version varchar(255) NOT NULL 'version of the database' No Foreign Key reference
valid_from date NOT NULL 'date that the version was updated' No Foreign Key reference
valid_to date DEFAULT NULL 'date that the version was made outdated' No Foreign Key reference
Unique index name: `valid_to_uq` Index Columns: (valid_to)
PRIMARY KEY CONSTRAINT(s) (`valid_from`)

diagnostic_order

Column Name Data Type Constraint Comment Foreign Key Reference
id bigint NOT NULL 'Unique Id of the diagnostic order' No Foreign Key reference
organization_id bigint NOT NULL 'Owning organisation (i.e. publisher)' patient.organization_id
patient_id bigint NOT NULL 'The organisations record for this person’s registration. Patients may have multiple records across clinical systems and may have registered at an organisation multiple times' patient.id
person_id bigint NOT NULL 'Unique individual across all organisations' No Foreign Key reference
encounter_id bigint DEFAULT NULL 'Reference to the encounter the observation was recorded at' encounter.id
practitioner_id bigint DEFAULT NULL 'The clinician the activity is recorded against' practitioner.id
clinical_effective_date datetime DEFAULT NULL 'The date the diagnostic order was identified by a clinician' No Foreign Key reference
date_precision_concept_id int DEFAULT NULL 'Identifies the precision of the clinical effectiveness date to either year (1) month (2) day (5) minute (12) second (13) millisecond (14)' No Foreign Key reference
result_value double DEFAULT NULL 'The value of the result of the observation' No Foreign Key reference
result_value_units varchar(50) DEFAULT NULL 'The units of the result of the observation' No Foreign Key reference
result_date date DEFAULT NULL 'The date of the result' No Foreign Key reference
result_text text No Constraint 'Any text associated with the result' No Foreign Key reference
result_concept_id int DEFAULT NULL 'Reference to the clinical coding of the result' No Foreign Key reference
is_problem tinyint(1) NOT NULL 'Whether the observation is marked as a problem' No Foreign Key reference
is_review tinyint(1) NOT NULL 'Whether the observation is a review of an existing problem' No Foreign Key reference
problem_end_date date DEFAULT NULL 'The end date of the problem' No Foreign Key reference
parent_observation_id bigint DEFAULT NULL 'Reference to the parent observation in a complex observation eg systolic and diastolic blood pressures will have a parent observation of Blood pressure' No Foreign Key reference
core_concept_id int DEFAULT NULL 'Reference to the clinical coding of the observation' No Foreign Key reference
non_core_concept_id int DEFAULT NULL 'Reference to the clinical coding of the observation' No Foreign Key reference
age_at_event decimal(5,2) DEFAULT NULL 'The age of the patient at the time of the observation' No Foreign Key reference
episodicity_concept_id int DEFAULT NULL 'Reference to the episodicity of the problem eg First, review, flare' No Foreign Key reference
is_primary tinyint(1) DEFAULT NULL 'Whether the diagnostic order is a primary order' No Foreign Key reference
date_recorded datetime DEFAULT NULL, No comment yet added No Foreign Key reference
Unique index name: `diagnostic_order_id` Index Columns: (id)
Index name: `fk_diagnostic_order_encounter_id` Index Columns: (encounter_id)
Index name: `fk_diagnostic_order_patient_id_organization_id` Index Columns: (patient_id,organization_id)
Index name: `fk_diagnostic_order_practitioner_id` Index Columns: (practitioner_id)
Index name: `diagnostic_order_patient_id` Index Columns: (patient_id)
Index name: `diagnostic_order_core_concept_id` Index Columns: (core_concept_id)
Index name: `diagnostic_order_core_concept_id_is_problem` Index Columns: (core_concept_id,is_problem)
Index name: `diagnostic_order_core_concept_id_result_value` Index Columns: (core_concept_id,result_value)
Index name: `diagnostic_order_non_core_concept_id` Index Columns: (non_core_concept_id)
Index name: `ix_diagnostic_order_organization_id` Index Columns: (organization_id)
Index name: `ix_diagnostic_order_clinical_effective_date` Index Columns: (clinical_effective_date)
Index name: `ix_diagnostic_order_person_id` Index Columns: (person_id)
PRIMARY KEY CONSTRAINT(s) (`organization_id`,`person_id`,`id`)

encounter

Column Name Data Type Constraint Comment Foreign Key Reference
id bigint NOT NULL 'Unique Id of the encounter' No Foreign Key reference
organization_id bigint NOT NULL 'Owning organisation (i.e. publisher)' patient.organization_id
patient_id bigint NOT NULL 'The organisations record for this person’s registration. Patients may have multiple records across clinical systems and may have registered at an organisation multiple times' patient.id
person_id bigint NOT NULL 'Unique individual across all organisations' No Foreign Key reference
practitioner_id bigint DEFAULT NULL 'The clinician the activity is recorded against' practitioner.id
appointment_id bigint DEFAULT NULL 'Reference to the appointment this encounter took part on' No Foreign Key reference
clinical_effective_date date DEFAULT NULL 'The date the clinical code is recorded for' No Foreign Key reference
date_precision_concept_id int DEFAULT NULL 'Reference to the precision of the date of the encounter' No Foreign Key reference
episode_of_care_id bigint DEFAULT NULL 'Is this instance of the code a review of a previous encounter' episode_of_care.id
service_provider_organization_id bigint DEFAULT NULL 'Reference to the service provider organisation' organization.id
core_concept_id int DEFAULT NULL 'Reference to the type of encounter' No Foreign Key reference
non_core_concept_id int DEFAULT NULL 'Reference to the type of encounter' No Foreign Key reference
age_at_event decimal(5,2) DEFAULT NULL 'The age the patient was when this encounter took place' No Foreign Key reference
type text No Constraint 'Unused' No Foreign Key reference
sub_type text No Constraint 'Unused' No Foreign Key reference
admission_method varchar(40) DEFAULT NULL 'The admission method of the encounter' No Foreign Key reference
end_date date DEFAULT NULL 'The end date of the encounter' No Foreign Key reference
institution_location_id text No Constraint 'Reference to the institution the encounter took place at' No Foreign Key reference
date_recorded datetime DEFAULT NULL 'The date the encounter was recorded' No Foreign Key reference
Unique index name: `encounter_id` Index Columns: (id)
Index name: `fk_encounter_practitioner_id` Index Columns: (practitioner_id)
Index name: `fk_encounter_episode_of_care_id` Index Columns: (episode_of_care_id)
Index name: `fk_encounter_service_provider_organization_id` Index Columns: (service_provider_organization_id)
Index name: `encounter_patient_id` Index Columns: (patient_id)
Index name: `fki_encounter_appointment_id` Index Columns: (appointment_id)
Index name: `fki_encounter_patient_id_organization_id` Index Columns: (patient_id,organization_id)
Index name: `encounter_core_concept_id_clinical_effective_date` Index Columns: (core_concept_id,clinical_effective_date)
PRIMARY KEY CONSTRAINT(s) (`organization_id`,`person_id`,`id`)

encounter_additional

Column Name Data Type Constraint Comment Foreign Key Reference
id bigint NOT NULL 'same as the id column on the encounter table' No Foreign Key reference
property_id int NOT NULL 'IM concept id reference (i.e. Admission method)' No Foreign Key reference
value_id int DEFAULT NULL 'IM concept id reference (i.e. Emergency admission)' No Foreign Key reference
json_value json DEFAULT NULL 'where there is no mapped value_id, just raw JSON (i.e. birth delivery details)' No Foreign Key reference
text_value varchar(255) DEFAULT NULL 'where there is no mapped value_id, or raw JSON, just a basic text value (i.e. FIN number)' No Foreign Key reference
Index name: `encounter_additional_value_id` Index Columns: (value_id)
PRIMARY KEY CONSTRAINT(s) (`id`,`property_id`)

encounter_event

Column Name Data Type Constraint Comment Foreign Key Reference
id bigint NOT NULL 'Unique Id of the encounter event' No Foreign Key reference
organization_id bigint NOT NULL 'Owning organisation (i.e. publisher)' patient.organization_id
patient_id bigint NOT NULL 'The patient this event belongs to' patient.id
person_id bigint NOT NULL 'The person this event belongs to' No Foreign Key reference
encounter_id bigint NOT NULL 'Reference to the parent encounter record' No Foreign Key reference
practitioner_id bigint DEFAULT NULL 'The clinician the activity is recorded against' practitioner.id
appointment_id bigint DEFAULT NULL 'Reference to the appointment this encounter took part on' No Foreign Key reference
clinical_effective_date datetime DEFAULT NULL 'The date the encounter took place' No Foreign Key reference
date_precision_concept_id int DEFAULT NULL 'Reference to the precision of the date of the encounter' No Foreign Key reference
episode_of_care_id bigint DEFAULT NULL 'Reference to the episode of care this encounter belongs to' episode_of_care.id
service_provider_organization_id bigint DEFAULT NULL 'Reference to the service provider organisation' organization.id
core_concept_id int DEFAULT NULL 'Reference to the type of encounter' No Foreign Key reference
non_core_concept_id int DEFAULT NULL 'Reference to the type of encounter' No Foreign Key reference
age_at_event decimal(5,2) DEFAULT NULL 'The age of the patient at the time of the encounter' No Foreign Key reference
type text No Constraint 'Unused' No Foreign Key reference
sub_type text No Constraint 'Unused' No Foreign Key reference
admission_method varchar(40) DEFAULT NULL 'The admission method of the encounter' No Foreign Key reference
end_date date DEFAULT NULL 'The end date of the encounter' No Foreign Key reference
institution_location_id bigint DEFAULT NULL 'Reference to the institution the encounter took place at' No Foreign Key reference
date_recorded datetime DEFAULT NULL 'The date the encounter was recorded' No Foreign Key reference
finished tinyint(1) DEFAULT NULL 'Whether the encounter is finished' No Foreign Key reference
Unique index name: `encounter_event_id` Index Columns: (id)
Index name: `fk_encounter_event_patient_id_organization_id` Index Columns: (patient_id,organization_id)
Index name: `fk_encounter_event_practitioner_id` Index Columns: (practitioner_id)
Index name: `fk_encounter_event_episode_of_care_id` Index Columns: (episode_of_care_id)
Index name: `fk_encounter_event_service_provider_organization_id` Index Columns: (service_provider_organization_id)
PRIMARY KEY CONSTRAINT(s) (`organization_id`,`person_id`,`id`)

episode_of_care

Column Name Data Type Constraint Comment Foreign Key Reference
id bigint NOT NULL 'Unique Id of the episode of care' No Foreign Key reference
organization_id bigint NOT NULL 'Owning organisation (i.e. publisher)' patient.organization_id
patient_id bigint NOT NULL 'The organisations record for this person’s registration. Patients may have multiple records across clinical systems and may have registered at an organisation multiple times' patient.id
person_id bigint NOT NULL 'Unique individual across all organisations' No Foreign Key reference
registration_type_concept_id int DEFAULT NULL 'Reference to the registration type of the patient' No Foreign Key reference
registration_status_concept_id int DEFAULT NULL 'Reference to the registration status of the patient' No Foreign Key reference
date_registered date DEFAULT NULL 'The date the registration was started  for this episode of care' No Foreign Key reference
date_registered_end date DEFAULT NULL 'The date the registration was ended  for this episode of care' No Foreign Key reference
usual_gp_practitioner_id bigint DEFAULT NULL 'Reference to the usual GP for this episode of care' practitioner.id
Unique index name: `episode_of_care_id` Index Columns: (id)
Index name: `fk_episode_of_care_patient_id_organisation_id` Index Columns: (patient_id,organization_id)
Index name: `fk_episode_of_care_practitioner_id` Index Columns: (usual_gp_practitioner_id)
Index name: `episode_of_care_patient_id` Index Columns: (patient_id)
Index name: `episode_of_care_registration_type_concept_id` Index Columns: (registration_type_concept_id)
Index name: `episode_of_care_date_registered` Index Columns: (date_registered)
Index name: `episode_of_care_date_registered_end` Index Columns: (date_registered_end)
Index name: `episode_of_care_person_id` Index Columns: (person_id)
Index name: `episode_of_care_organization_id` Index Columns: (organization_id)
PRIMARY KEY CONSTRAINT(s) (`organization_id`,`person_id`,`id`)

event_log

Column Name Data Type Constraint Comment Foreign Key Reference
dt_change datetime(3) NOT NULL 'date time the change was made to this DB' No Foreign Key reference
change_type tinyint NOT NULL 'type of transaction 0=insert, 1=update, 2=delete' No Foreign Key reference
table_id tinyint NOT NULL 'identifier of the table changed' No Foreign Key reference
record_id bigint NOT NULL 'id of the record changed' No Foreign Key reference

flag

Column Name Data Type Constraint Comment Foreign Key Reference
id bigint NOT NULL 'Unique Id of the flag' No Foreign Key reference
organization_id bigint NOT NULL 'Owning organisation (i.e. publisher)' patient.organization_id
patient_id bigint NOT NULL 'The organisations record for this person’s registration. Patients may have multiple records across clinical systems and may have registered at an organisation multiple times' patient.id
person_id bigint NOT NULL 'Unique individual across all organisations' No Foreign Key reference
effective_date datetime DEFAULT NULL 'The date the flag was entered onto the patients record' No Foreign Key reference
date_precision_concept_id int DEFAULT NULL 'Identifies the precision of the clinical effectiveness date to either year (1) month (2) day (5) minute (12) second (13) millisecond (14)' No Foreign Key reference
is_active tinyint(1) NOT NULL 'Whether the flag is active or not' No Foreign Key reference
flag_text text No Constraint 'This is a warning set by the publisher regarding he patient' No Foreign Key reference
Unique index name: `flag_id` Index Columns: (id)
Index name: `fk_flag_patient_id_organization_id` Index Columns: (patient_id,organization_id)
Index name: `flag_patient_id` Index Columns: (patient_id)
PRIMARY KEY CONSTRAINT(s) (`organization_id`,`person_id`,`id`)

location

Column Name Data Type Constraint Comment Foreign Key Reference
id bigint NOT NULL 'Unique Id of the location' No Foreign Key reference
name varchar(255) DEFAULT NULL 'The name of a location set by the publisher. E.g. ward, clinic, domiciliary' No Foreign Key reference
type_code varchar(50) DEFAULT NULL 'The type of location' No Foreign Key reference
type_desc varchar(255) DEFAULT NULL 'Textual description of the type of location eg GP Practice' No Foreign Key reference
postcode varchar(10) DEFAULT NULL 'The postcode of the location' No Foreign Key reference
managing_organization_id bigint DEFAULT NULL 'Reference to the managing organisation of the location' organization.id
Unique index name: `location_id` Index Columns: (id)
Index name: `fk_location_managing_organisation_id` Index Columns: (managing_organization_id)
PRIMARY KEY CONSTRAINT(s) (`id`)

medication_order

Column Name Data Type Constraint Comment Foreign Key Reference
id bigint NOT NULL 'Unique Id of the medication order' No Foreign Key reference
organization_id bigint NOT NULL 'Owning organisation (i.e. publisher)' patient.organization_id
patient_id bigint NOT NULL 'The organisations record for this person’s registration. Patients may have multiple records across clinical systems and may have registered at an organisation multiple times' patient.id
person_id bigint NOT NULL 'Unique individual across all organisations' No Foreign Key reference
encounter_id bigint DEFAULT NULL 'Reference to the encounter the medication order was issued in' encounter.id
practitioner_id bigint DEFAULT NULL 'The clinician the activity is recorded against' practitioner.id
clinical_effective_date date DEFAULT NULL 'The date the medication order was issued' No Foreign Key reference
date_precision_concept_id int DEFAULT NULL 'Identifies the precision of the clinical effectiveness date to either year (1) month (2) day (5) minute (12) second (13) millisecond (14)' No Foreign Key reference
dose varchar(1000) DEFAULT NULL 'Textual description of the dose' No Foreign Key reference
quantity_value double DEFAULT NULL 'The value of the medication that was prescribed eg 50' No Foreign Key reference
quantity_unit varchar(255) DEFAULT NULL 'The unit of the medication that was prescribed eg tablets' No Foreign Key reference
duration_days int DEFAULT NULL 'How many days the medication is prescribed for' No Foreign Key reference
estimated_cost double DEFAULT NULL 'The estimated cost of the medication' No Foreign Key reference
medication_statement_id bigint DEFAULT NULL 'Reference to the medication statement.  A medication statement can have many medication orders' No Foreign Key reference
core_concept_id int DEFAULT NULL 'Reference to the clinical coding of the medication' No Foreign Key reference
non_core_concept_id int DEFAULT NULL 'Reference to the clinical coding of the medication' No Foreign Key reference
bnf_reference varchar(6) DEFAULT NULL 'A reference to the drug in the BNF dictionary' No Foreign Key reference
age_at_event decimal(5,2) DEFAULT NULL 'The age the patient was at the time of this event' No Foreign Key reference
issue_method text No Constraint 'The issue method of the medication eg hand written' No Foreign Key reference
date_recorded datetime DEFAULT NULL, No comment yet added No Foreign Key reference
Unique index name: `medication_order_id` Index Columns: (id)
Index name: `fk_medication_order_encounter_id` Index Columns: (encounter_id)
Index name: `fk_medication_order_patient_id_organization_id` Index Columns: (patient_id,organization_id)
Index name: `fk_medication_order_practitioner_id` Index Columns: (practitioner_id)
Index name: `medication_order_patient_id` Index Columns: (patient_id)
Index name: `medication_order_core_concept_id` Index Columns: (core_concept_id)
PRIMARY KEY CONSTRAINT(s) (`organization_id`,`person_id`,`id`)

medication_statement

Column Name Data Type Constraint Comment Foreign Key Reference
id bigint NOT NULL 'Unique Id of the medication' No Foreign Key reference
organization_id bigint NOT NULL 'Owning organisation (i.e. publisher)' patient.organization_id
patient_id bigint NOT NULL 'The organisations record for this person’s registration. Patients may have multiple records across clinical systems and may have registered at an organisation multiple times' patient.id
person_id bigint NOT NULL 'Unique individual across all organisations' No Foreign Key reference
encounter_id bigint DEFAULT NULL 'Reference to the encounter this medication was recorded in' encounter.id
practitioner_id bigint DEFAULT NULL 'The clinician the activity is recorded against' practitioner.id
clinical_effective_date date DEFAULT NULL 'The date the medication was clinical relevant' No Foreign Key reference
date_precision_concept_id int DEFAULT NULL 'Identifies the precision of the clinical effectiveness date to either year (1) month (2) day (5) minute (12) second (13) millisecond (14)' No Foreign Key reference
is_active tinyint(1) DEFAULT NULL 'Whether the medication is active or not' No Foreign Key reference
cancellation_date date DEFAULT NULL 'The date the medication was cancelled' No Foreign Key reference
dose varchar(1000) DEFAULT NULL 'Texual description of the dose of the medication' No Foreign Key reference
quantity_value double DEFAULT NULL 'The value of the medication that was prescribed eg 50' No Foreign Key reference
quantity_unit varchar(255) DEFAULT NULL 'The unit of the medication that was prescribed eg tablets' No Foreign Key reference
authorisation_type_concept_id int DEFAULT NULL 'Reference to the authorisation type' No Foreign Key reference
core_concept_id int DEFAULT NULL 'Reference to the clinical coding of the medication' No Foreign Key reference
non_core_concept_id int DEFAULT NULL 'Reference to the clinical coding of the medication' No Foreign Key reference
bnf_reference varchar(6) DEFAULT NULL 'A reference to the drug in the BNF dictionary' No Foreign Key reference
age_at_event decimal(5,2) DEFAULT NULL 'The age the patient was at the time of this event' No Foreign Key reference
issue_method text No Constraint 'The issue method of the medication eg hand written' No Foreign Key reference
date_recorded datetime DEFAULT NULL, No comment yet added No Foreign Key reference
Unique index name: `medication_statement_id` Index Columns: (id)
Index name: `fk_medication_statement_encounter_id` Index Columns: (encounter_id)
Index name: `fk_medication_statement_patient_id_organization_id` Index Columns: (patient_id,organization_id)
Index name: `fk_medication_statement_practitioner_id` Index Columns: (practitioner_id)
Index name: `medication_statement_patient_id` Index Columns: (patient_id)
Index name: `medication_statement_dmd_id` Index Columns: (patient_id)
PRIMARY KEY CONSTRAINT(s) (`organization_id`,`person_id`,`id`)

observation

Column Name Data Type Constraint Comment Foreign Key Reference
id bigint NOT NULL 'Unique Id of the observation' No Foreign Key reference
organization_id bigint NOT NULL 'Owning organisation (i.e. publisher)' patient.organization_id
patient_id bigint NOT NULL 'The organisations record for this person’s registration. Patients may have multiple records across clinical systems and may have registered at an organisation multiple times' patient.id
person_id bigint NOT NULL 'Unique individual across all organisations' No Foreign Key reference
encounter_id bigint DEFAULT NULL 'Reference to the encounter the observation was recorded at' encounter.id
practitioner_id bigint DEFAULT NULL 'The clinician the activity is recorded against' practitioner.id
clinical_effective_date date DEFAULT NULL 'The date the observation was identified by a clinician' No Foreign Key reference
date_precision_concept_id int DEFAULT NULL 'Identifies the precision of the clinical effectiveness date to either year (1) month (2) day (5) minute (12) second (13) millisecond (14)' No Foreign Key reference
result_value double DEFAULT NULL 'The value of the result of the observation' No Foreign Key reference
result_value_units varchar(50) DEFAULT NULL 'The units of the result of the observation' No Foreign Key reference
result_date date DEFAULT NULL 'The date of the result' No Foreign Key reference
result_text text No Constraint 'Any text associated with the result' No Foreign Key reference
result_concept_id int DEFAULT NULL 'Reference to the clinical coding of the result' No Foreign Key reference
is_problem tinyint(1) NOT NULL 'Whether the observation is marked as a problem' No Foreign Key reference
is_review tinyint(1) NOT NULL 'Whether the observation is a review of an existing problem' No Foreign Key reference
problem_end_date date DEFAULT NULL 'The end date of the problem' No Foreign Key reference
parent_observation_id bigint DEFAULT NULL 'Reference to the parent observation in a complex observation eg systolic and diastolic blood pressures will have a parent observation of Blood pressure' No Foreign Key reference
core_concept_id int DEFAULT NULL 'Reference to the clinical coding of the observation' No Foreign Key reference
non_core_concept_id int DEFAULT NULL 'Reference to the clinical coding of the observation' No Foreign Key reference
age_at_event decimal(5,2) DEFAULT NULL 'The age of the patient at the time of the observation' No Foreign Key reference
episodicity_concept_id int DEFAULT NULL 'Reference to the episodicity of the problem eg First, review, flare' No Foreign Key reference
is_primary tinyint(1) DEFAULT NULL 'Whether the observation is a primary observation' No Foreign Key reference
date_recorded datetime DEFAULT NULL 'The date the observation was recorded in the system' No Foreign Key reference
Unique index name: `observation_id` Index Columns: (id)
Index name: `fk_observation_encounter_id` Index Columns: (encounter_id)
Index name: `fk_observation_patient_id_organization_id` Index Columns: (patient_id,organization_id)
Index name: `fk_observation_practitioner_id` Index Columns: (practitioner_id)
Index name: `observation_patient_id` Index Columns: (patient_id)
Index name: `observation_core_concept_id` Index Columns: (core_concept_id)
Index name: `observation_core_concept_id_is_problem` Index Columns: (core_concept_id,is_problem)
Index name: `observation_core_concept_id_result_value` Index Columns: (core_concept_id,result_value)
Index name: `observation_non_core_concept_id` Index Columns: (non_core_concept_id)
Index name: `ix_observation_organization_id` Index Columns: (organization_id)
Index name: `ix_observation_clinical_effective_date` Index Columns: (clinical_effective_date)
Index name: `ix_observation_person_id` Index Columns: (person_id)
PRIMARY KEY CONSTRAINT(s) (`organization_id`,`person_id`,`id`)

observation_additional

Column Name Data Type Constraint Comment Foreign Key Reference
id bigint NOT NULL 'same as the id column on the observation table' No Foreign Key reference
property_id int NOT NULL 'IM reference (i.e. significance)' No Foreign Key reference
value_id int DEFAULT NULL 'IM reference (i.e. minor, significant)' No Foreign Key reference
json_value json DEFAULT NULL 'the JSON data itself ' No Foreign Key reference
text_value varchar(255) DEFAULT NULL 'where there is no mapped value_id or raw JSON, just a basic text value' No Foreign Key reference
Index name: `observation_additional_value_id` Index Columns: (value_id)
PRIMARY KEY CONSTRAINT(s) (`id`,`property_id`)

organization

Column Name Data Type Constraint Comment Foreign Key Reference
id bigint NOT NULL 'Unique Id of the organisation' No Foreign Key reference
ods_code varchar(50) DEFAULT NULL 'ODS Code of the organisation' No Foreign Key reference
name varchar(255) DEFAULT NULL 'Name of the organisation' No Foreign Key reference
type_code varchar(50) DEFAULT NULL 'The type of organisation' No Foreign Key reference
type_desc varchar(255) DEFAULT NULL 'Textual description of the type of organisation eg GP Practice' No Foreign Key reference
postcode varchar(10) DEFAULT NULL 'The postcode of the organisation' No Foreign Key reference
parent_organization_id bigint DEFAULT NULL 'The id of the parent organisation' No Foreign Key reference
Unique index name: `organization_id` Index Columns: (id)
Index name: `fki_organization_parent_organization_id` Index Columns: (parent_organization_id)
PRIMARY KEY CONSTRAINT(s) (`id`)

organization_metadata

Column Name Data Type Constraint Comment Foreign Key Reference
id bigint NOT NULL 'organisation ID, corresponds to same ID in the organizaton table' No Foreign Key reference
publishing_software varchar(50) NOT NULL 'software name of publishing system, i.e. SystmOne' No Foreign Key reference
last_data_to_dds datetime DEFAULT NULL 'date time data was last sent to DDS' No Foreign Key reference
last_data_cutoff datetime DEFAULT NULL 'cutoff date time of the last extract from the publishing system' No Foreign Key reference
PRIMARY KEY CONSTRAINT(s) (`id`,`publishing_software`)

patient

Column Name Data Type Constraint Comment Foreign Key Reference
id bigint NOT NULL 'Unique Id of the patient' No Foreign Key reference
organization_id bigint NOT NULL 'Owning organisation (i.e. publisher)' organization.id
person_id bigint NOT NULL 'Unique individual across all organisations' No Foreign Key reference
title varchar(255) DEFAULT NULL 'The title of the patient' No Foreign Key reference
first_names varchar(255) DEFAULT NULL 'The first names of the patient' No Foreign Key reference
last_name varchar(255) DEFAULT NULL 'The last name of the patient' No Foreign Key reference
gender_concept_id int DEFAULT NULL 'Reference to the gender of the patient' No Foreign Key reference
nhs_number varchar(255) DEFAULT NULL 'The NHS number of the patient' No Foreign Key reference
date_of_birth date DEFAULT NULL 'The date of birth of the patient' No Foreign Key reference
date_of_death date DEFAULT NULL 'The date of death of the patient' No Foreign Key reference
current_address_id bigint DEFAULT NULL 'Reference to the current address of the patient' No Foreign Key reference
ethnic_code_concept_id int DEFAULT NULL 'Reference to the ethnicity of the patient' No Foreign Key reference
registered_practice_organization_id bigint DEFAULT NULL 'Reference to the organisation the patient is registered at' No Foreign Key reference
birth_year smallint DEFAULT NULL, No comment yet added No Foreign Key reference
birth_month tinyint DEFAULT NULL, No comment yet added No Foreign Key reference
birth_week tinyint DEFAULT NULL, No comment yet added No Foreign Key reference
Unique index name: `patient_id` Index Columns: (id)
Index name: `patient_person_id` Index Columns: (person_id)
PRIMARY KEY CONSTRAINT(s) (`organization_id`,`person_id`,`id`)

patient_additional

Column Name Data Type Constraint Comment Foreign Key Reference
id bigint NOT NULL 'same as the id column on the patient table ' No Foreign Key reference
property_id int NOT NULL 'IM reference (e.g. Cause of death)' No Foreign Key reference
value_id int DEFAULT NULL 'IM reference (e.g. COVID)' No Foreign Key reference
json_value json DEFAULT NULL 'where there is no mapped value_id, just raw JSON' No Foreign Key reference
text_value varchar(255) DEFAULT NULL 'where there is no mapped value_id or raw JSON, just a basic text value (i.e. GP Practitioner number)' No Foreign Key reference
Index name: `ix_patient_additional_id` Index Columns: (value_id)
PRIMARY KEY CONSTRAINT(s) (`id`,`property_id`)

patient_address

Column Name Data Type Constraint Comment Foreign Key Reference
id bigint NOT NULL 'Unique Id of the address' No Foreign Key reference
organization_id bigint NOT NULL 'Owning organisation (i.e. publisher)' patient.organization_id
patient_id bigint NOT NULL 'The organisations record for this person’s registration. Patients may have multiple records across clinical systems and may have registered at an organisation multiple times' patient.id
person_id bigint NOT NULL 'Unique individual across all organisations' No Foreign Key reference
address_line_1 varchar(255) DEFAULT NULL 'The first line of the address' No Foreign Key reference
address_line_2 varchar(255) DEFAULT NULL 'The second line of the address' No Foreign Key reference
address_line_3 varchar(255) DEFAULT NULL 'The third line of the address' No Foreign Key reference
address_line_4 varchar(255) DEFAULT NULL 'The fourth line of the address' No Foreign Key reference
city varchar(255) DEFAULT NULL 'The city' No Foreign Key reference
postcode varchar(255) DEFAULT NULL 'The postcode' No Foreign Key reference
use_concept_id int NOT NULL 'use of address (e.g. home, temporary)' No Foreign Key reference
start_date date NOT NULL 'The start date of this address being relevant' No Foreign Key reference
end_date date DEFAULT NULL 'The end date of this address being relevant' No Foreign Key reference
lsoa_2001_code varchar(9) DEFAULT NULL 'A reference to the LSOA_2001 code' No Foreign Key reference
lsoa_2011_code varchar(9) DEFAULT NULL 'A reference to the LSOA_2011 code' No Foreign Key reference
msoa_2001_code varchar(9) DEFAULT NULL 'A reference to the MSOA_2001 code' No Foreign Key reference
msoa_2011_code varchar(9) DEFAULT NULL 'A reference to the MSOA_2011 code' No Foreign Key reference
ward_code varchar(9) DEFAULT NULL 'The ward the address belongs to' No Foreign Key reference
local_authority_code varchar(9) DEFAULT NULL 'The local authority the address belongs to' No Foreign Key reference
townsend_deprivation_index double DEFAULT NULL, No comment yet added No Foreign Key reference
Unique index name: `ux_patient_address_id` Index Columns: (id)
Index name: `fk_patient_address_patient_id_organization_id` Index Columns: (patient_id,organization_id)
PRIMARY KEY CONSTRAINT(s) (`organization_id`,`id`,`patient_id`,`person_id`)

patient_address_match

Column Name Data Type Constraint Comment Foreign Key Reference
id bigint NOT NULL No comment yet added No Foreign Key reference
patient_address_id bigint NOT NULL, No comment yet added patient_address.id
uprn varchar(255) CHARACTER SET No comment yet added No Foreign Key reference
uprn_ralf00 varchar(255) DEFAULT NULL, No comment yet added No Foreign Key reference
status tinyint(1) DEFAULT NULL, No comment yet added No Foreign Key reference
uprn_property_classification varchar(45) CHARACTER SET No comment yet added No Foreign Key reference
latitude double DEFAULT NULL, No comment yet added No Foreign Key reference
longitude double DEFAULT NULL, No comment yet added No Foreign Key reference
uprn_xcoordinate double DEFAULT NULL, No comment yet added No Foreign Key reference
uprn_ycoordinate double DEFAULT NULL, No comment yet added No Foreign Key reference
qualifier varchar(50) CHARACTER SET No comment yet added No Foreign Key reference
match_rule varchar(4096) CHARACTER SET No comment yet added No Foreign Key reference
match_date datetime DEFAULT NULL, No comment yet added No Foreign Key reference
abp_address_number varchar(255) CHARACTER SET No comment yet added No Foreign Key reference
abp_address_street varchar(255) CHARACTER SET No comment yet added No Foreign Key reference
abp_address_locality varchar(255) CHARACTER SET No comment yet added No Foreign Key reference
abp_address_town varchar(255) CHARACTER SET No comment yet added No Foreign Key reference
abp_address_postcode varchar(10) CHARACTER SET No comment yet added No Foreign Key reference
abp_address_organization varchar(255) CHARACTER SET No comment yet added No Foreign Key reference
match_pattern_postcode varchar(255) CHARACTER SET No comment yet added No Foreign Key reference
match_pattern_street varchar(255) CHARACTER SET No comment yet added No Foreign Key reference
match_pattern_number varchar(255) CHARACTER SET No comment yet added No Foreign Key reference
match_pattern_building varchar(255) CHARACTER SET No comment yet added No Foreign Key reference
match_pattern_flat varchar(255) CHARACTER SET No comment yet added No Foreign Key reference
algorithm_version varchar(255) CHARACTER SET No comment yet added No Foreign Key reference
epoch varchar(255) CHARACTER SET No comment yet added No Foreign Key reference
Index name: `patient_address_uprn_index` Index Columns: (uprn)
Index name: `patient_address_patient_address_id` Index Columns: (id,uprn)
Index name: `patient_address_uprn_patient_address_id_fk` Index Columns: (patient_address_id)
PRIMARY KEY CONSTRAINT(s) (`id`)

patient_address_ralf

Column Name Data Type Constraint Comment Foreign Key Reference
id bigint NOT NULL, No comment yet added No Foreign Key reference
organization_id bigint NOT NULL, No comment yet added organization.id
patient_id bigint NOT NULL, No comment yet added patient.id
person_id bigint NOT NULL, No comment yet added person.id
patient_address_id bigint NOT NULL, No comment yet added patient_address.id
patient_address_match_uprn_ralf00 varchar(255) NOT NULL, No comment yet added No Foreign Key reference
salt_name varchar(50) NOT NULL, No comment yet added No Foreign Key reference
ralf varchar(255) NOT NULL, No comment yet added No Foreign Key reference
Index name: `fk_patient_address_ralf_organization_id` Index Columns: (organization_id)
Index name: `fk_patient_address_ralf_person_id` Index Columns: (person_id)
Index name: `ux_patient_address_ralf_id` Index Columns: (id)
Index name: `patient_address_ralf_patient_id` Index Columns: (patient_id)
Index name: `patient_address_ralf_patient_address_id` Index Columns: (patient_address_id)
Index name: `patient_address_ralf_patient_address_match_uprn_ralf_00` Index Columns: (patient_address_match_uprn_ralf00)
PRIMARY KEY CONSTRAINT(s) (`id`,`patient_address_id`,`patient_address_match_uprn_ralf00`)

patient_contact

Column Name Data Type Constraint Comment Foreign Key Reference
id bigint NOT NULL 'Unique Id of the patient contact' No Foreign Key reference
organization_id bigint NOT NULL 'Owning organisation (i.e. publisher)' patient.organization_id
patient_id bigint NOT NULL 'The organisations record for this person’s registration. Patients may have multiple records across clinical systems and may have registered at an organisation multiple times' patient.id
person_id bigint NOT NULL 'Unique individual across all organisations' No Foreign Key reference
use_concept_id int DEFAULT NULL 'use of contact (e.g. mobile, home,work' No Foreign Key reference
type_concept_id int DEFAULT NULL 'type of contact (e.g. phone, email)' No Foreign Key reference
start_date date DEFAULT NULL 'The start date of the contact being valid' No Foreign Key reference
end_date date DEFAULT NULL 'The end date of the contact being valid' No Foreign Key reference
value varchar(255) DEFAULT NULL 'The value of the contact information eg phone number, email address' No Foreign Key reference
Unique index name: `ux_patient_contact_id` Index Columns: (id)
Index name: `fk_patient_contact_patient_id_organisation_id` Index Columns: (patient_id,organization_id)
PRIMARY KEY CONSTRAINT(s) (`organization_id`,`id`,`patient_id`,`person_id`)

patient_pseudo_id

Column Name Data Type Constraint Comment Foreign Key Reference
id bigint NOT NULL 'Unique Id of the patient pseudo id' No Foreign Key reference
organization_id bigint NOT NULL 'Owning organisation (i.e. publisher)' patient.organization_id
patient_id bigint NOT NULL 'Reference to the patient this registration status history belongs to' patient.id
person_id bigint NOT NULL 'Reference to the person this registration status history belongs to' No Foreign Key reference
salt_name varchar(50) NOT NULL 'The name of the salt used to create the pseudo id' No Foreign Key reference
Skid varchar(255) NOT NULL '"Secure Key IDentifier" - the pseudonymised ID generated for this patient using the salt specified in the salt_name column. Typically generated from patient NHS number, but is configurable on a case by case basis (e.g. may include date of birth)' No Foreign Key reference
is_nhs_number_valid tinyint(1) NOT NULL 'Whether the nhs number is valid' No Foreign Key reference
is_nhs_number_verified_by_publisher tinyint(1) NOT NULL 'Whether the nhs number has been verified by the publisher' No Foreign Key reference
Unique index name: `ux_patient_pseudo_id` Index Columns: (id)
Index name: `fk_patient_pseudo_id` Index Columns: (patient_id,organization_id)
Index name: `patient_pseudo_id_patient` Index Columns: (patient_id)
PRIMARY KEY CONSTRAINT(s) (`organization_id`,`person_id`,`id`)

patient_uprn

Column Name Data Type Constraint Comment Foreign Key Reference
patient_id bigint NOT NULL 'The organisations record for this person’s registration. Patients may have multiple records across clinical systems and may have registered at an organisation multiple times' patient.id
organization_id bigint NOT NULL 'Owning organisation (i.e. publisher)' patient.organization_id
person_id bigint NOT NULL 'Unique individual across all organisations' No Foreign Key reference
uprn bigint DEFAULT NULL, No comment yet added No Foreign Key reference
qualifier varchar(50) DEFAULT NULL, No comment yet added No Foreign Key reference
algorithm varchar(255) DEFAULT NULL, No comment yet added No Foreign Key reference
match varchar(255) DEFAULT NULL, No comment yet added No Foreign Key reference
no_address tinyint(1) DEFAULT NULL, No comment yet added No Foreign Key reference
invalid_address tinyint(1) DEFAULT NULL, No comment yet added No Foreign Key reference
missing_postcode tinyint(1) DEFAULT NULL, No comment yet added No Foreign Key reference
invalid_postcode tinyint(1) DEFAULT NULL, No comment yet added No Foreign Key reference
Unique index name: `patient_uprn_id` Index Columns: (patient_id)
Index name: `fk_patient_uprn_patient_id_organisation_id` Index Columns: (patient_id,organization_id)
PRIMARY KEY CONSTRAINT(s) (`organization_id`,`person_id`,`patient_id`)

person

Column Name Data Type Constraint Comment Foreign Key Reference
id bigint NOT NULL 'Unique Id of the person' No Foreign Key reference
organization_id bigint NOT NULL 'Owning organisation (i.e. publisher)' No Foreign Key reference
title varchar(255) DEFAULT NULL 'The title of the person' No Foreign Key reference
first_names varchar(255) DEFAULT NULL 'The first names of the person' No Foreign Key reference
last_name varchar(255) DEFAULT NULL 'The last name of the person' No Foreign Key reference
gender_concept_id int DEFAULT NULL 'Reference to the gender of the person' No Foreign Key reference
nhs_number varchar(255) DEFAULT NULL 'The NHS number of the person' No Foreign Key reference
date_of_birth date DEFAULT NULL 'The date of birth of the person' No Foreign Key reference
date_of_death date DEFAULT NULL 'The date of death of the person' No Foreign Key reference
current_address_id bigint NOT NULL 'Reference to the current address of the person' No Foreign Key reference
ethnic_code_concept_id int DEFAULT NULL 'Reference to the ethnicity of the person' No Foreign Key reference
registered_practice_organization_id bigint DEFAULT NULL 'Reference to the organisation the person is registered at' No Foreign Key reference
birth_year smallint DEFAULT NULL, No comment yet added No Foreign Key reference
birth_month tinyint DEFAULT NULL, No comment yet added No Foreign Key reference
birth_week tinyint DEFAULT NULL, No comment yet added No Foreign Key reference
Unique index name: `person_id` Index Columns: (id)
PRIMARY KEY CONSTRAINT(s) (`id`)

practitioner

Column Name Data Type Constraint Comment Foreign Key Reference
id bigint NOT NULL 'Unique Id of the practitioner' No Foreign Key reference
organization_id bigint NOT NULL 'Owning organisation (i.e. publisher)' organization.id
name varchar(1024) DEFAULT NULL 'Name of the practitioner' No Foreign Key reference
role_code varchar(50) DEFAULT NULL 'The code representing the role of the practitioner' No Foreign Key reference
role_desc varchar(255) DEFAULT NULL 'Textual description of the role of the practitioner eg General Medical Practitioner' No Foreign Key reference
gmc_code varchar(50) DEFAULT NULL 'The GMC code of the practitioner' No Foreign Key reference
Unique index name: `practitioner_id` Index Columns: (id)
Index name: `fk_practitioner_organisation_id` Index Columns: (organization_id)
PRIMARY KEY CONSTRAINT(s) (`id`)

procedure_request

Column Name Data Type Constraint Comment Foreign Key Reference
id bigint NOT NULL 'Unique Id of the procedure' No Foreign Key reference
organization_id bigint NOT NULL 'Owning organisation (i.e. publisher)' patient.organization_id
patient_id bigint NOT NULL 'The organisations record for this person’s registration. Patients may have multiple records across clinical systems and may have registered at an organisation multiple times' patient.id
person_id bigint NOT NULL 'Unique individual across all organisations' No Foreign Key reference
encounter_id bigint DEFAULT NULL 'Reference to the encounter the procedure was administered at' No Foreign Key reference
practitioner_id bigint DEFAULT NULL 'The clinician the activity is recorded against' practitioner.id
clinical_effective_date datetime DEFAULT NULL 'The date the procedure was administered by a clinician' No Foreign Key reference
date_precision_concept_id int DEFAULT NULL 'Identifies the precision of the clinical effectiveness date to either year (1) month (2) day (5) minute (12) second (13) millisecond (14)' No Foreign Key reference
status_concept_id int DEFAULT NULL 'Reference to the status of the procedure' No Foreign Key reference
core_concept_id int DEFAULT NULL 'Reference to the clinical coding of the procedure' No Foreign Key reference
non_core_concept_id int DEFAULT NULL 'Reference to the clinical coding of the procedure' No Foreign Key reference
age_at_event decimal(5,2) DEFAULT NULL 'The age of the patient at the time of the procedure' No Foreign Key reference
date_recorded datetime DEFAULT NULL 'The date the procedure was recorded in the source system' No Foreign Key reference
Unique index name: `procedure_request_id` Index Columns: (id)
Index name: `fk_procedure_request_patient_id_organization_id` Index Columns: (patient_id,organization_id)
Index name: `fk_procedure_request_practitioner_id` Index Columns: (practitioner_id)
Index name: `procedure_request_patient_id` Index Columns: (patient_id)
PRIMARY KEY CONSTRAINT(s) (`organization_id`,`person_id`,`id`)

referral_request

Column Name Data Type Constraint Comment Foreign Key Reference
id bigint NOT NULL 'Unique Id of the referral' No Foreign Key reference
organization_id bigint NOT NULL 'Owning organisation (i.e. publisher)' patient.organization_id
patient_id bigint NOT NULL 'The organisations record for this person’s registration. Patients may have multiple records across clinical systems and may have registered at an organisation multiple times' patient.id
person_id bigint NOT NULL 'Unique individual across all organisations' No Foreign Key reference
encounter_id bigint DEFAULT NULL 'Reference to the encounter the referral was made in' No Foreign Key reference
practitioner_id bigint DEFAULT NULL 'The clinician the activity is recorded against' practitioner.id
clinical_effective_date datetime DEFAULT NULL 'The date the referral was made' No Foreign Key reference
date_precision_concept_id int DEFAULT NULL 'Identifies the precision of the clinical effectiveness date to either year (1) month (2) day (5) minute (12) second (13) millisecond (14)' No Foreign Key reference
requester_organization_id bigint DEFAULT NULL 'Reference to the organisation that made the refereral request' organization.id
recipient_organization_id bigint DEFAULT NULL 'Reference to the organization receiving the referral' organization.id
referral_request_priority_concept_id int DEFAULT NULL 'Reference to the priority of the referral' No Foreign Key reference
referral_request_type_concept_id int DEFAULT NULL 'Reference to the type of referral request' No Foreign Key reference
mode varchar(50) DEFAULT NULL 'The mode of the referral' No Foreign Key reference
outgoing_referral tinyint(1) DEFAULT NULL 'Whether this is an outgoing referral' No Foreign Key reference
is_review tinyint(1) NOT NULL 'Whether this referral is a review' No Foreign Key reference
core_concept_id int DEFAULT NULL 'Reference to the clinical coding of the referral' No Foreign Key reference
non_core_concept_id int DEFAULT NULL 'Reference to the clinical coding of the referral' No Foreign Key reference
age_at_event decimal(5,2) DEFAULT NULL 'The age of the patient at the time of the referral' No Foreign Key reference
date_recorded datetime DEFAULT NULL 'The date the referral request was added to the source system' No Foreign Key reference
Unique index name: `referral_request_id` Index Columns: (id)
Index name: `fk_referral_request_patient_id_organization_id` Index Columns: (patient_id,organization_id)
Index name: `fk_referral_request_practitioner_id` Index Columns: (practitioner_id)
Index name: `fk_referral_request_recipient_organization_id` Index Columns: (recipient_organization_id)
Index name: `fk_referral_request_requester_organization_id` Index Columns: (requester_organization_id)
Index name: `referral_request_patient_id` Index Columns: (patient_id)
Index name: `referral_request_core_concept_id` Index Columns: (core_concept_id)
PRIMARY KEY CONSTRAINT(s) (`organization_id`,`person_id`,`id`)

registration_status_history

Column Name Data Type Constraint Comment Foreign Key Reference
id bigint NOT NULL 'Unique Id of the registration status history' No Foreign Key reference
organization_id bigint NOT NULL 'Owning organisation (i.e. publisher)' No Foreign Key reference
patient_id bigint NOT NULL 'Reference to the patient this registration status history belongs to' No Foreign Key reference
person_id bigint NOT NULL 'Reference to the person this registration status history belongs to' No Foreign Key reference
episode_of_care_id bigint DEFAULT NULL 'Reference to the episode of care this status history belongs to' episode_of_care.id
registration_status_concept_id int DEFAULT NULL 'Reference to the registration status' No Foreign Key reference
start_date datetime DEFAULT NULL 'The start date for the period this registration status history was valid' No Foreign Key reference
end_date datetime DEFAULT NULL 'The end date for the period this registration status history was valid' No Foreign Key reference
Unique index name: `ux_registration_status_history_id` Index Columns: (id)
Index name: `fk_registration_status_history_episode_id` Index Columns: (episode_of_care_id)
PRIMARY KEY CONSTRAINT(s) (`organization_id`,`id`,`patient_id`,`person_id`)

schedule

Column Name Data Type Constraint Comment Foreign Key Reference
id bigint NOT NULL 'Unique Id of the schedule' No Foreign Key reference
organization_id bigint NOT NULL 'Owning organisation (i.e. publisher)' organization.id
practitioner_id bigint DEFAULT NULL 'Reference to the practitioner who owns the schedule' No Foreign Key reference
start_date datetime DEFAULT NULL 'The start date of the schedule' No Foreign Key reference
type varchar(255) DEFAULT NULL 'The type of schedule eg Timed Appointments' No Foreign Key reference
location varchar(255) DEFAULT NULL 'Textual description of the location the schedule was held at' No Foreign Key reference
name varchar(150) DEFAULT NULL 'The name of the schedule' No Foreign Key reference
Unique index name: `schedule_id` Index Columns: (id)
PRIMARY KEY CONSTRAINT(s) (`organization_id`,`id`)

DATABASE UPDATE INFO

New Version Date Updated
v231321e3242432 2022-12-16T10:49:45.099510800