CompassV2TestPages:v2.X: Difference between revisions

From Discovery Data Service
Jump to navigation Jump to search
No edit summary
No edit summary
Line 1: Line 1:
<h1 id="firstHeading" class="firstHeading" lang="en-GB">Remote Subscriber Database (RSD) Schema (Compass 2) Version: v2.1.1</h1>
<h1 id="firstHeading" class="firstHeading" lang="en-GB">Remote Subscriber Database (RSD) Schema (Compass 2) Version: v2.1.2</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>
<h2><span class="mw-headline" id="Sortable_tables">allergy_intolerance</span></h2>
<table class="sortable" border="1" style="border-collapse:collapse">
<table class="sortable" border="1" style="border-collapse:collapse">
<tr>
<tr>
Line 11: Line 11:
<th scope="col" width="10%">Constraint</th>
<th scope="col" width="10%">Constraint</th>
<th scope="col" width="10%">Comment</th>
<th scope="col" width="10%">Comment</th>
<th scope="col" width="10%">Sql</th>
</tr>
</tr>
<tbody>
<tbody>
<tr>
<tr>
<td>is_review</td>
<td>encounter_id</td>
<td>tinyint(1)</td>
<td>bigint</td>
<td>NOT NULL</td>
<td>DEFAULT NULL</td>
<td> COMMENT 'Is this instance of the code a review of a previous encounter',</td>
<td> COMMENT 'Reference to the encounter this allergy was record in',</td>
<td>  is_review tinyint(1) NOT NULL COMMENT 'Is this instance of the code a review of a previous encounter',</td>
</tr>
</tr>
<tr>
<tr>
Line 26: Line 24:
<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> 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>
<tr>
<tr>
<td>practitioner_id</td>
<td>non_core_concept_id</td>
<td>int</td>
<td>DEFAULT NULL</td>
<td> COMMENT 'Reference to the clinical coding of the allergy',</td>
</tr>
<tr>
<td>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> COMMENT 'Unique Id of the allergy',</td>
<td> practitioner_id bigint  NULL COMMENT 'The clinician the activity is recorded against',</td>
</tr>
<tr>
<td>date_recorded</td>
<td>datetime</td>
<td>NOT NULL</td>
<td> COMMENT 'The date the allergy was recorded',</td>
</tr>
</tr>
<tr>
<tr>
Line 40: Line 48:
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> COMMENT 'Reference to the clinical coding of the allergy',</td>
<td> COMMENT 'Reference to the clinical coding of the allergy',</td>
<td>  core_concept_id int  NULL COMMENT 'Reference to the clinical coding of the allergy',</td>
</tr>
</tr>
<tr>
<tr>
<td>clinical_effective_date</td>
<td>person_id</td>
<td>date</td>
<td>DEFAULT NULL</td>
<td> COMMENT 'The date the clinical code is recorded for',</td>
<td>  clinical_effective_date date  NULL COMMENT 'The date the clinical code is recorded for',</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> COMMENT 'Unique individual across all organisations',</td>
<td>  organization_id bigint NOT NULL COMMENT 'Owning organisation (i.e. publisher)',</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> COMMENT 'The clinician the activity is recorded against',</td>
<td>  age_at_event decimal(5,2)  NULL COMMENT 'The age the patient was at the time of this event',</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 allergy',</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>  non_core_concept_id int  NULL COMMENT 'Reference to the clinical coding of the allergy',</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 allergy',</td>
<td> COMMENT 'Is this instance of the code a review of a previous encounter',</td>
<td>  id bigint NOT NULL COMMENT 'Unique Id of the allergy',</td>
</tr>
</tr>
<tr>
<tr>
<td>date_recorded</td>
<td>organization_id</td>
<td>datetime</td>
<td>NOT NULL</td>
<td> COMMENT 'The date the allergy was recorded',</td>
<td>  date_recorded datetime NOT NULL COMMENT 'The date the allergy was recorded',</td>
</tr>
<tr>
<td>person_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> COMMENT 'Owning organisation (i.e. publisher)',</td>
<td>  person_id bigint NOT NULL COMMENT 'Unique individual across all organisations',</td>
</tr>
</tr>
<tr>
<tr>
<td>date_precision_concept_id</td>
<td>clinical_effective_date</td>
<td>int</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> COMMENT 'The date the clinical code is recorded for',</td>
<td>  date_precision_concept_id int  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>
<td>encounter_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 'Reference to the encounter this allergy was record in',</td>
<td> COMMENT 'The age the patient was at the time of this event',</td>
<td>  encounter_id bigint  NULL COMMENT 'Reference to the encounter this allergy was record in',</td>
</tr>
</tr>
</tbody>
<tr>
<td>PRIMARY KEY CONSTRAINT(s) `organization_id`,`person_id`,`id`),</td> </tr> </tbody>
</table>
</table>
<h2><span class="mw-headline" id="Sortable_tables">Appointment</span></h2>
<h2><span class="mw-headline" id="Sortable_tables">appointment</span></h2>
<table class="sortable" border="1" style="border-collapse:collapse">
<table class="sortable" border="1" style="border-collapse:collapse">
<tr>
<tr>
Line 114: Line 101:
<th scope="col" width="10%">Constraint</th>
<th scope="col" width="10%">Constraint</th>
<th scope="col" width="10%">Comment</th>
<th scope="col" width="10%">Comment</th>
<th scope="col" width="10%">Sql</th>
</tr>
</tr>
<tbody>
<tbody>
<tr>
<td>patient_delay</td>
<td>int</td>
<td>DEFAULT NULL</td>
<td> COMMENT 'How long the patient was delayed for',</td>
<td>  patient_delay int  NULL COMMENT 'How long the patient was delayed for',</td>
</tr>
<tr>
<tr>
<td>patient_id</td>
<td>patient_id</td>
Line 129: Line 108:
<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> 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>
<tr>
<tr>
<td>source_id</td>
<td>appointment_status_concept_id</td>
<td>varchar(36)</td>
<td>int</td>
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> COMMENT 'Unique reference to the source of the appointment',</td>
<td> COMMENT 'The status of the appointment e.g. arrived/sent in/left/DNA',</td>
<td>  source_id varchar(36)  NULL COMMENT 'Unique reference to the source of the appointment',</td>
</tr>
</tr>
<tr>
<tr>
<td>planned_duration</td>
<td>patient_wait</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> COMMENT 'How long the patient waited from being marked as arrived to being sent in',</td>
<td>  planned_duration int  NULL COMMENT 'The time allocated for the appointment, not necessarily the actual duration always in minutes',</td>
</tr>
</tr>
<tr>
<tr>
<td>practitioner_id</td>
<td>date_time_sent_in</td>
<td>bigint</td>
<td>datetime</td>
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> COMMENT 'The clinician the activity is recorded against',</td>
<td> COMMENT 'Date and time the patient was sent into the practitioner',</td>
<td>  practitioner_id bigint  NULL COMMENT 'The clinician the activity is recorded against',</td>
</tr>
</tr>
<tr>
<tr>
<td>start_date</td>
<td>id</td>
<td>date</td>
<td>bigint</td>
<td>NOT NULL</td>
<td> COMMENT 'Unique Id of the appointment',</td>
</tr>
<tr>
<td>source_id</td>
<td>varchar(36)</td>
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> COMMENT 'The start date of the appointment',</td>
<td> COMMENT 'Unique reference to the source of the appointment',</td>
<td>  start_date date  NULL COMMENT 'The start date of the appointment',</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> COMMENT 'Unique individual across all organisations',</td>
<td>  organization_id bigint NOT NULL COMMENT 'Owning organisation (i.e. publisher)',</td>
</tr>
</tr>
<tr>
<tr>
<td>id</td>
<td>practitioner_id</td>
<td>bigint</td>
<td>bigint</td>
<td>NOT NULL</td>
<td> COMMENT 'Unique Id of the appointment',</td>
<td>  id bigint NOT NULL COMMENT 'Unique Id of the appointment',</td>
</tr>
<tr>
<td>date_time_sent_in</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> COMMENT 'The clinician the activity is recorded against',</td>
<td>  date_time_sent_in datetime  NULL COMMENT 'Date and time the patient was sent into the practitioner',</td>
</tr>
</tr>
<tr>
<tr>
Line 185: Line 156:
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> COMMENT 'Time between sent in and left always in minutes',</td>
<td> COMMENT 'Time between sent in and left always in minutes',</td>
<td>  actual_duration int  NULL COMMENT 'Time between sent in and left always in minutes',</td>
</tr>
</tr>
<tr>
<tr>
<td>schedule_id</td>
<td>planned_duration</td>
<td>bigint</td>
<td>int</td>
<td>DEFAULT NULL</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> COMMENT 'The time allocated for the appointment, not necessarily the actual duration always in minutes',</td>
<td>  schedule_id bigint  NULL COMMENT 'The schedule the patient was put on to book multiple appointments. ID unique to the applied schedule',</td>
</tr>
</tr>
<tr>
<tr>
<td>person_id</td>
<td>start_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> COMMENT 'The start date of the appointment',</td>
<td> person_id bigint NOT NULL COMMENT 'Unique individual across all organisations',</td>
</tr>
<tr>
<td>organization_id</td>
<td>bigint</td>
<td>NOT NULL</td>
<td> COMMENT 'Owning organisation (i.e. publisher)',</td>
</tr>
</tr>
<tr>
<tr>
<td>patient_wait</td>
<td>patient_delay</td>
<td>int</td>
<td>int</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> COMMENT 'How long the patient was delayed for',</td>
<td>  patient_wait int  NULL COMMENT 'How long the patient waited from being marked as arrived to being sent in',</td>
</tr>
</tr>
<tr>
<tr>
Line 213: Line 186:
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> COMMENT 'Date and time the patient left the practitioner',</td>
<td> COMMENT 'Date and time the patient left the practitioner',</td>
<td> date_time_left datetime  NULL COMMENT 'Date and time the patient left the practitioner',</td>
</tr>
<tr>
<td>schedule_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>
</tr>
</tr>
<tr>
<tr>
Line 220: Line 198:
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> COMMENT 'The date the appointment was cancelled',</td>
<td> COMMENT 'The date the appointment was cancelled',</td>
<td>  cancelled_date datetime  NULL COMMENT 'The date the appointment was cancelled',</td>
</tr>
</tr>
<tr>
<tr>
<td>appointment_status_concept_id</td>
<td>PRIMARY KEY CONSTRAINT(s) `organization_id`,`person_id`,`id`),</td> </tr> </tbody>
<td>int</td>
<td>DEFAULT NULL</td>
<td> COMMENT 'The status of the appointment e.g. arrived/sent in/left/DNA',</td>
<td>  appointment_status_concept_id int  NULL COMMENT 'The status of the appointment e.g. arrived/sent in/left/DNA',</td>
</tr>
</tbody>
</table>
</table>
<h2><span class="mw-headline" id="Sortable_tables">Appointment_additional</span></h2>
<h2><span class="mw-headline" id="Sortable_tables">appointment_additional</span></h2>
<table class="sortable" border="1" style="border-collapse:collapse">
<table class="sortable" border="1" style="border-collapse:collapse">
<tr>
<tr>
Line 238: Line 209:
<th scope="col" width="10%">Constraint</th>
<th scope="col" width="10%">Constraint</th>
<th scope="col" width="10%">Comment</th>
<th scope="col" width="10%">Comment</th>
<th scope="col" width="10%">Sql</th>
</tr>
</tr>
<tbody>
<tbody>
<tr>
<tr>
<td>text_value</td>
<td>json_value</td>
<td>varchar(255)</td>
<td>json</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> COMMENT 'where there is no mapped value_id, just raw JSON',</td>
<td>  text_value varchar(255)  NULL COMMENT 'where there is no mapped value_id or raw JSON, just a basic text value (i.e. GP Practitioner number)',</td>
</tr>
</tr>
<tr>
<tr>
<td>property_id</td>
<td>id</td>
<td>int</td>
<td>bigint</td>
<td>NOT NULL</td>
<td>NOT NULL</td>
<td> COMMENT 'IM reference (e.g. appointment type)',</td>
<td> COMMENT 'same as the id column on the patient table ',</td>
<td>  property_id int NOT NULL COMMENT 'IM reference (e.g. appointment type)',</td>
</tr>
</tr>
<tr>
<tr>
<td>value_id</td>
<td>text_value</td>
<td>int</td>
<td>varchar(255)</td>
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> COMMENT 'IM reference (e.g. Appointment Type)',</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>  value_id int  NULL COMMENT 'IM reference (e.g. Appointment Type)',</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 'same as the id column on the patient table ',</td>
<td> COMMENT 'IM reference (e.g. appointment type)',</td>
<td>  id bigint NOT NULL COMMENT 'same as the id column on the patient table ',</td>
</tr>
</tr>
<tr>
<tr>
<td>json_value</td>
<td>value_id</td>
<td>json</td>
<td>int</td>
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> COMMENT 'where there is no mapped value_id, just raw JSON',</td>
<td> COMMENT 'IM reference (e.g. Appointment Type)',</td>
<td>  json_value json  NULL COMMENT 'where there is no mapped value_id, just raw JSON',</td>
</tr>
</tr>
</tbody>
<tr>
<td>PRIMARY KEY CONSTRAINT(s) `id`,`property_id`),</td> </tr> </tbody>
</table>
</table>
<h2><span class="mw-headline" id="Sortable_tables">Concept</span></h2>
<h2><span class="mw-headline" id="Sortable_tables">concept</span></h2>
<table class="sortable" border="1" style="border-collapse:collapse">
<table class="sortable" border="1" style="border-collapse:collapse">
<tr>
<tr>
Line 285: Line 251:
<th scope="col" width="10%">Constraint</th>
<th scope="col" width="10%">Constraint</th>
<th scope="col" width="10%">Comment</th>
<th scope="col" width="10%">Comment</th>
<th scope="col" width="10%">Sql</th>
</tr>
</tr>
<tbody>
<tbody>
<tr>
<tr>
<td>Name</td>
<td>Code</td>
<td>varchar(255)</td>
<td>varchar(40)</td>
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> COMMENT 'Short name',</td>
<td> COMMENT 'The code (non-unique unless coupled with a scheme)',</td>
<td>  Name varchar(255)  NULL COMMENT 'Short name',</td>
</tr>
<tr>
<td>Scheme</td>
<td>bigint</td>
<td>DEFAULT NULL</td>
<td> COMMENT 'The coding scheme for the code (Read, CTV3, SNOMED etc)',</td>
<td>  Scheme bigint  NULL COMMENT 'The coding scheme for the code (Read, CTV3, SNOMED etc)',</td>
</tr>
</tr>
<tr>
<tr>
Line 307: Line 264:
<td>NOT NULL</td>
<td>NOT NULL</td>
<td> COMMENT 'Unique concept identifier',</td>
<td> COMMENT 'Unique concept identifier',</td>
<td>  Id varchar(150) NOT NULL COMMENT 'Unique concept identifier',</td>
</tr>
<tr>
<td>use_count</td>
<td>bigint</td>
<td>NOT NULL</td>
<td> DEFAULT '0' COMMENT 'Rough indicator of number of occurences of the concept',</td>
<td>  use_count bigint NOT NULL  '0' COMMENT 'Rough indicator of number of occurences of the concept',</td>
</tr>
</tr>
<tr>
<tr>
Line 321: Line 270:
<td>NOT NULL</td>
<td>NOT NULL</td>
<td> COMMENT 'Unique Id of the concept',</td>
<td> COMMENT 'Unique Id of the concept',</td>
<td>  dbid int NOT NULL COMMENT 'Unique Id of the concept',</td>
</tr>
</tr>
<tr>
<tr>
Line 328: Line 276:
<td>NOT NULL</td>
<td>NOT NULL</td>
<td> COMMENT 'Concept grouping construct, deprecated',</td>
<td> COMMENT 'Concept grouping construct, deprecated',</td>
<td> Document int NOT NULL COMMENT 'Concept grouping construct, deprecated',</td>
</tr>
<tr>
<td>Scheme</td>
<td>bigint</td>
<td>DEFAULT NULL</td>
<td> COMMENT 'The coding scheme for the code (Read, CTV3, SNOMED etc)',</td>
</tr>
<tr>
<td>Draft</td>
<td>tinyint(1)</td>
<td>NOT NULL</td>
<td> COMMENT 'Whether its draft/autocreated or confirmed as a "proper" concept',</td>
</tr>
</tr>
<tr>
<tr>
Line 335: Line 294:
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> COMMENT 'Full name (or term for ontological concepts)',</td>
<td> COMMENT 'Full name (or term for ontological concepts)',</td>
<td>  Description varchar(400)  NULL COMMENT 'Full name (or term for ontological concepts)',</td>
</tr>
</tr>
<tr>
<tr>
<td>Code</td>
<td>use_count</td>
<td>varchar(40)</td>
<td>bigint</td>
<td>DEFAULT NULL</td>
<td>NOT NULL</td>
<td> COMMENT 'The code (non-unique unless coupled with a scheme)',</td>
<td> DEFAULT '0' COMMENT 'Rough indicator of number of occurences of the concept',</td>
<td>  Code varchar(40)  NULL COMMENT 'The code (non-unique unless coupled with a scheme)',</td>
</tr>
</tr>
<tr>
<tr>
Line 349: Line 306:
<td>NOT NULL</td>
<td>NOT NULL</td>
<td> COMMENT 'The timestamp of the last update to the concept',</td>
<td> COMMENT '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>
</tr>
</tr>
<tr>
<tr>
<td>Draft</td>
<td>Name</td>
<td>tinyint(1)</td>
<td>varchar(255)</td>
<td>NOT NULL</td>
<td>DEFAULT NULL</td>
<td> COMMENT 'Whether its draft/autocreated or confirmed as a "proper" concept',</td>
<td> COMMENT 'Short name',</td>
<td>  Draft tinyint(1) NOT NULL COMMENT 'Whether its draft/autocreated or confirmed as a "proper" concept',</td>
</tr>
</tr>
</tbody>
<tr>
<td>PRIMARY KEY CONSTRAINT(s) `dbid`),</td> </tr> </tbody>
</table>
</table>
<h2><span class="mw-headline" id="Sortable_tables">Concept_map</span></h2>
<h2><span class="mw-headline" id="Sortable_tables">concept_map</span></h2>
<table class="sortable" border="1" style="border-collapse:collapse">
<table class="sortable" border="1" style="border-collapse:collapse">
<tr>
<tr>
Line 367: Line 323:
<th scope="col" width="10%">Constraint</th>
<th scope="col" width="10%">Constraint</th>
<th scope="col" width="10%">Comment</th>
<th scope="col" width="10%">Comment</th>
<th scope="col" width="10%">Sql</th>
</tr>
</tr>
<tbody>
<tbody>
<tr>
<tr>
<td>id</td>
<td>legacy</td>
<td>int</td>
<td>int</td>
<td>NOT NULL,</td>
<td>NOT NULL</td>
<td></td>
<td> COMMENT 'the legacy (read 2, ctv3, icd10, opcs4, emis local, etc) concept',</td>
<td>  id int NOT NULL,</td>
</tr>
<tr>
<td>deleted</td>
<td>tinyint(1)</td>
<td>DEFAULT NULL,</td>
<td></td>
<td>  deleted tinyint(1) NULL,</td>
</tr>
</tr>
<tr>
<tr>
Line 389: Line 336:
<td>NOT NULL</td>
<td>NOT NULL</td>
<td> COMMENT 'Timestamp the map was last updated/added',</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>
<tr>
<td>legacy</td>
<td>core</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> COMMENT 'the core (snomed, discovery) concept that the legacy concept maps to',</td>
<td>  legacy int NOT NULL COMMENT 'the legacy (read 2, ctv3, icd10, opcs4, emis local, etc) concept',</td>
</tr>
</tr>
<tr>
<tr>
<td>core</td>
<td>id</td>
<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></td>
<td> core int NOT NULL COMMENT 'the core (snomed, discovery) concept that the legacy concept maps to',</td>
</tr>
<tr>
<td>deleted</td>
<td>tinyint(1)</td>
<td>DEFAULT NULL,</td>
<td></td>
</tr>
</tr>
</tbody>
<tr>
<td>PRIMARY KEY CONSTRAINT(s) `id`),</td> </tr> </tbody>
</table>
</table>
<h2><span class="mw-headline" id="Sortable_tables">Diagnostic_order</span></h2>
<h2><span class="mw-headline" id="Sortable_tables">diagnostic_order</span></h2>
<table class="sortable" border="1" style="border-collapse:collapse">
<table class="sortable" border="1" style="border-collapse:collapse">
<tr>
<tr>
Line 414: Line 365:
<th scope="col" width="10%">Constraint</th>
<th scope="col" width="10%">Constraint</th>
<th scope="col" width="10%">Comment</th>
<th scope="col" width="10%">Comment</th>
<th scope="col" width="10%">Sql</th>
</tr>
</tr>
<tbody>
<tbody>
<tr>
<tr>
<td>result_date</td>
<td>problem_end_date</td>
<td>date</td>
<td>date</td>
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> COMMENT 'The date of the result',</td>
<td> COMMENT 'The end date of the problem',</td>
<td>  result_date date  NULL COMMENT 'The date of the result',</td>
</tr>
<tr>
<td>practitioner_id</td>
<td>bigint</td>
<td>DEFAULT NULL</td>
<td> COMMENT 'The clinician the activity is recorded against',</td>
<td>  practitioner_id bigint  NULL COMMENT 'The clinician the activity is recorded against',</td>
</tr>
<tr>
<td>encounter_id</td>
<td>bigint</td>
<td>DEFAULT NULL</td>
<td> COMMENT 'Reference to the encounter the observation was recorded at',</td>
<td>  encounter_id bigint  NULL COMMENT 'Reference to the encounter the observation was recorded at',</td>
</tr>
</tr>
<tr>
<tr>
Line 443: Line 378:
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> COMMENT 'Whether the diagnostic order is a primary order',</td>
<td> COMMENT 'Whether the diagnostic order is a primary order',</td>
<td>  is_primary tinyint(1)  NULL COMMENT 'Whether the diagnostic order is a primary order',</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>DEFAULT NULL</td>
<td> COMMENT 'Reference to the clinical coding of the result',</td>
<td> COMMENT 'The units of the result of the observation',</td>
<td>  result_concept_id int  NULL COMMENT 'Reference to the clinical coding of the result',</td>
</tr>
<tr>
<td>age_at_event</td>
<td>decimal(5,2)</td>
<td>DEFAULT NULL</td>
<td> COMMENT 'The age of the patient at the time of the observation',</td>
<td>  age_at_event decimal(5,2)  NULL COMMENT 'The age of the patient at the time of the observation',</td>
</tr>
</tr>
<tr>
<tr>
Line 464: Line 390:
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> COMMENT 'Reference to the episodicity of the problem eg First, review, flare',</td>
<td> COMMENT 'Reference to the episodicity of the problem eg First, review, flare',</td>
<td>  episodicity_concept_id int  NULL COMMENT 'Reference to the episodicity of the problem eg First, review, flare',</td>
</tr>
</tr>
<tr>
<tr>
<td>result_value_units</td>
<td>clinical_effective_date</td>
<td>varchar(50)</td>
<td>date</td>
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> COMMENT 'The units of the result of the observation',</td>
<td> COMMENT 'The date the diagnostic order was identified by a clinician',</td>
<td>  result_value_units varchar(50)  NULL COMMENT 'The units of the result of the observation',</td>
</tr>
</tr>
<tr>
<tr>
<td>date_recorded</td>
<td>result_text</td>
<td>datetime</td>
<td>text</td>
<td>DEFAULT NULL,</td>
<td>COMMENT 'Any</td>
<td></td>
<td> text associated with the result',</td>
<td>  date_recorded datetime  NULL,</td>
</tr>
</tr>
<tr>
<tr>
<td>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> COMMENT 'Unique Id of the diagnostic order',</td>
<td>  core_concept_id int  NULL COMMENT 'Reference to the clinical coding of the observation',</td>
</tr>
</tr>
<tr>
<tr>
<td>clinical_effective_date</td>
<td>result_concept_id</td>
<td>date</td>
<td>DEFAULT NULL</td>
<td> COMMENT 'The date the diagnostic order was identified by a clinician',</td>
<td>  clinical_effective_date date  NULL COMMENT 'The date the diagnostic order was identified by a clinician',</td>
</tr>
<tr>
<td>date_precision_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> COMMENT 'Reference to the clinical coding of the result',</td>
<td>  date_precision_concept_id int  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>
<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> COMMENT '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>
</tr>
</tr>
<tr>
<tr>
<td>organization_id</td>
<td>practitioner_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> COMMENT 'The clinician the activity is recorded against',</td>
<td>  organization_id bigint NOT NULL COMMENT 'Owning organisation (i.e. publisher)',</td>
</tr>
</tr>
<tr>
<tr>
Line 520: Line 432:
<td>NOT NULL</td>
<td>NOT NULL</td>
<td> COMMENT 'Whether the observation is marked as a problem',</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>
<tr>
<tr>
<td>parent_observation_id</td>
<td>result_value</td>
<td>bigint</td>
<td>double</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> COMMENT 'The value of the result of the observation',</td>
<td>  parent_observation_id bigint  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>
</tr>
</tr>
<tr>
<tr>
<td>result_text</td>
<td>result_date</td>
<td>text</td>
<td>COMMENT 'Any</td>
<td> text associated with the result',</td>
<td>  result_text text COMMENT 'Any text associated with the result',</td>
</tr>
<tr>
<td>problem_end_date</td>
<td>date</td>
<td>date</td>
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> COMMENT 'The end date of the problem',</td>
<td> COMMENT 'The date of the result',</td>
<td>  problem_end_date date  NULL COMMENT 'The end date of the problem',</td>
</tr>
</tr>
<tr>
<tr>
<td>is_review</td>
<td>non_core_concept_id</td>
<td>tinyint(1)</td>
<td>int</td>
<td>NOT NULL</td>
<td>DEFAULT NULL</td>
<td> COMMENT 'Whether the observation is a review of an existing problem',</td>
<td> COMMENT 'Reference to the clinical coding of the observation',</td>
<td>  is_review tinyint(1) NOT NULL COMMENT 'Whether the observation is a review of an existing problem',</td>
</tr>
</tr>
<tr>
<tr>
<td>result_value</td>
<td>core_concept_id</td>
<td>double</td>
<td>int</td>
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> COMMENT 'The value of the result of the observation',</td>
<td> COMMENT 'Reference to the clinical coding of the observation',</td>
<td>  result_value double  NULL COMMENT 'The value of the result of the observation',</td>
</tr>
</tr>
<tr>
<tr>
<td>person_id</td>
<td>patient_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> 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>  person_id bigint NOT NULL COMMENT 'Unique individual across all organisations',</td>
</tr>
</tr>
<tr>
<tr>
<td>id</td>
<td>date_recorded</td>
<td>bigint</td>
<td>datetime</td>
<td>DEFAULT NULL,</td>
<td></td>
</tr>
<tr>
<td>is_review</td>
<td>tinyint(1)</td>
<td>NOT NULL</td>
<td>NOT NULL</td>
<td> COMMENT 'Unique Id of the diagnostic order',</td>
<td> COMMENT 'Whether the observation is a review of an existing problem',</td>
<td>  id bigint NOT NULL COMMENT 'Unique Id of the diagnostic order',</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> 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>  non_core_concept_id int  NULL COMMENT 'Reference to the clinical coding of the observation',</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>parent_observation_id</td>
<td>bigint</td>
<td>bigint</td>
<td>NOT NULL</td>
<td>DEFAULT NULL</td>
<td> COMMENT 'Unique Id of the encounter',</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>  id bigint NOT NULL COMMENT 'Unique Id of the encounter',</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> COMMENT '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>
</tr>
</tr>
<tr>
<tr>
<td>date_precision_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 precision of the date of the encounter',</td>
<td> COMMENT 'The age of the patient at the time of the observation',</td>
<td>  date_precision_concept_id int  NULL COMMENT 'Reference to the precision of the date of the encounter',</td>
</tr>
</tr>
<tr>
<tr>
<td>date_recorded</td>
<td>encounter_id</td>
<td>datetime</td>
<td>bigint</td>
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> COMMENT 'The date the encounter was recorded',</td>
<td> COMMENT 'Reference to the encounter the observation was recorded at',</td>
<td>  date_recorded datetime  NULL COMMENT 'The date the encounter was recorded',</td>
</tr>
</tr>
<tr>
<td>PRIMARY KEY CONSTRAINT(s) `organization_id`,`person_id`,`id`),</td> </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>
</tr>
<tbody>
<tr>
<tr>
<td>appointment_id</td>
<td>appointment_id</td>
Line 623: Line 522:
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> COMMENT 'Reference to the appointment this encounter took part on',</td>
<td> COMMENT 'Reference to the appointment this encounter took part on',</td>
<td>  appointment_id bigint  NULL COMMENT 'Reference to the appointment this encounter took part on',</td>
</tr>
</tr>
<tr>
<tr>
<td>non_core_concept_id</td>
<td>sub_type</td>
<td>int</td>
<td>text</td>
<td>DEFAULT NULL</td>
<td>COMMENT 'Unused',</td>
<td> COMMENT 'Reference to the type of encounter',</td>
<td></td>
<td> non_core_concept_id int  NULL COMMENT 'Reference to the type of encounter',</td>
</tr>
</tr>
<tr>
<tr>
<td>practitioner_id</td>
<td>institution_location_id</td>
<td>text</td>
<td>COMMENT 'Reference</td>
<td> to the institution the encounter took place at',</td>
</tr>
<tr>
<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> 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>  practitioner_id bigint  NULL COMMENT 'The clinician the activity is recorded against',</td>
</tr>
</tr>
<tr>
<tr>
<td>service_provider_organization_id</td>
<td>core_concept_id</td>
<td>bigint</td>
<td>int</td>
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> COMMENT 'Reference to the service provider organisation',</td>
<td> COMMENT 'Reference to the type of encounter',</td>
<td>  service_provider_organization_id bigint  NULL COMMENT 'Reference to the service provider organisation',</td>
</tr>
</tr>
<tr>
<tr>
<td>clinical_effective_date</td>
<td>non_core_concept_id</td>
<td>date</td>
<td>int</td>
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> COMMENT 'The date the clinical code is recorded for',</td>
<td> COMMENT 'Reference to the type of encounter',</td>
<td>  clinical_effective_date date  NULL COMMENT 'The date the clinical code is recorded for',</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> COMMENT 'Unique individual across all organisations',</td>
<td>  organization_id bigint NOT NULL COMMENT 'Owning organisation (i.e. publisher)',</td>
</tr>
</tr>
<tr>
<tr>
<td>core_concept_id</td>
<td>practitioner_id</td>
<td>int</td>
<td>bigint</td>
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> COMMENT 'Reference to the type of encounter',</td>
<td> COMMENT 'The clinician the activity is recorded against',</td>
<td>  core_concept_id int  NULL COMMENT 'Reference to the type of encounter',</td>
</tr>
</tr>
<tr>
<tr>
<td>admission_method</td>
<td>date_recorded</td>
<td>varchar(40)</td>
<td>datetime</td>
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> COMMENT 'The admission method of the encounter',</td>
<td> COMMENT 'The date the encounter was recorded',</td>
<td>  admission_method varchar(40)  NULL COMMENT 'The admission method of the encounter',</td>
</tr>
</tr>
<tr>
<tr>
<td>age_at_event</td>
<td>date_precision_concept_id</td>
<td>decimal(5,2)</td>
<td>int</td>
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> COMMENT 'The age the patient was when this encounter took place',</td>
<td> COMMENT 'Reference to the precision of the date of the encounter',</td>
<td>  age_at_event decimal(5,2)  NULL COMMENT 'The age the patient was when this encounter took place',</td>
</tr>
</tr>
<tr>
<tr>
<td>institution_location_id</td>
<td>admission_method</td>
<td>text</td>
<td>varchar(40)</td>
<td>COMMENT 'Reference</td>
<td>DEFAULT NULL</td>
<td> to the institution the encounter took place at',</td>
<td> COMMENT 'The admission method of the encounter',</td>
<td> institution_location_id text COMMENT 'Reference to the institution the encounter took place at',</td>
</tr>
</tr>
<tr>
<tr>
<td>sub_type</td>
<td>episode_of_care_id</td>
<td>text</td>
<td>bigint</td>
<td>COMMENT 'Unused',</td>
<td>DEFAULT NULL</td>
<td></td>
<td> COMMENT 'Is this instance of the code a review of a previous encounter',</td>
<td> sub_type text COMMENT 'Unused',</td>
</tr>
</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> COMMENT 'Unique Id of the encounter',</td>
<td>  person_id bigint NOT NULL COMMENT 'Unique individual across all organisations',</td>
</tr>
</tr>
<tr>
<tr>
<td>Type</td>
<td>organization_id</td>
<td>text</td>
<td>bigint</td>
<td>COMMENT 'Unused',</td>
<td>NOT NULL</td>
<td></td>
<td> COMMENT 'Owning organisation (i.e. publisher)',</td>
<td> Type text COMMENT 'Unused',</td>
</tr>
<tr>
<td>age_at_event</td>
<td>decimal(5,2)</td>
<td>DEFAULT NULL</td>
<td> COMMENT 'The age the patient was when this encounter took place',</td>
</tr>
<tr>
<td>clinical_effective_date</td>
<td>date</td>
<td>DEFAULT NULL</td>
<td> COMMENT 'The date the clinical code is recorded for',</td>
</tr>
</tr>
<tr>
<tr>
<td>episode_of_care_id</td>
<td>service_provider_organization_id</td>
<td>bigint</td>
<td>bigint</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> COMMENT 'Reference to the service provider organisation',</td>
<td>  episode_of_care_id bigint  NULL COMMENT 'Is this instance of the code a review of a previous encounter',</td>
</tr>
</tr>
<tr>
<tr>
Line 721: Line 624:
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> COMMENT 'The end date of the encounter',</td>
<td> COMMENT 'The end date of the encounter',</td>
<td>  end_date date  NULL COMMENT 'The end date of the encounter',</td>
</tr>
</tr>
</tbody>
<tr>
<td>Type</td>
<td>text</td>
<td>COMMENT 'Unused',</td>
<td></td>
</tr>
<tr>
<td>PRIMARY KEY CONSTRAINT(s) `organization_id`,`person_id`,`id`),</td> </tr> </tbody>
</table>
</table>
<h2><span class="mw-headline" id="Sortable_tables">Encounter_additional</span></h2>
<h2><span class="mw-headline" id="Sortable_tables">encounter_additional</span></h2>
<table class="sortable" border="1" style="border-collapse:collapse">
<table class="sortable" border="1" style="border-collapse:collapse">
<tr>
<tr>
Line 732: Line 641:
<th scope="col" width="10%">Constraint</th>
<th scope="col" width="10%">Constraint</th>
<th scope="col" width="10%">Comment</th>
<th scope="col" width="10%">Comment</th>
<th scope="col" width="10%">Sql</th>
</tr>
</tr>
<tbody>
<tbody>
<tr>
<tr>
<td>id</td>
<td>text_value</td>
<td>bigint</td>
<td>varchar(255)</td>
<td>NOT NULL</td>
<td>DEFAULT NULL</td>
<td> COMMENT 'same as the id column on the encounter table',</td>
<td> COMMENT 'where there is no mapped value_id, or raw JSON, just a basic text value (i.e. FIN number)',</td>
<td> id bigint NOT NULL COMMENT 'same as the id column on the encounter table',</td>
</tr>
<tr>
<td>json_value</td>
<td>json</td>
<td>DEFAULT NULL</td>
<td> COMMENT 'where there is no mapped value_id, just raw JSON (i.e. birth delivery details)',</td>
</tr>
</tr>
<tr>
<tr>
<td>property_id</td>
<td>id</td>
<td>int</td>
<td>bigint</td>
<td>NOT NULL</td>
<td>NOT NULL</td>
<td> COMMENT 'IM concept id reference (i.e. Admission method)',</td>
<td> COMMENT 'same as the id column on the encounter table',</td>
<td>  property_id int NOT NULL COMMENT 'IM concept id reference (i.e. Admission method)',</td>
</tr>
</tr>
<tr>
<tr>
Line 754: Line 666:
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> COMMENT 'IM concept id reference (i.e. Emergency admission)',</td>
<td> COMMENT 'IM concept id reference (i.e. Emergency admission)',</td>
<td>  value_id int  NULL COMMENT 'IM concept id reference (i.e. Emergency admission)',</td>
</tr>
</tr>
<tr>
<tr>
<td>text_value</td>
<td>property_id</td>
<td>varchar(255)</td>
<td>int</td>
<td>DEFAULT NULL</td>
<td>NOT 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> COMMENT 'IM concept id reference (i.e. Admission method)',</td>
<td>  text_value varchar(255)  NULL COMMENT 'where there is no mapped value_id, or raw JSON, just a basic text value (i.e. FIN number)',</td>
</tr>
</tr>
<tr>
<tr>
<td>json_value</td>
<td>PRIMARY KEY CONSTRAINT(s) `id`,`property_id`),</td> </tr> </tbody>
<td>json</td>
<td>DEFAULT NULL</td>
<td> COMMENT 'where there is no mapped value_id, just raw JSON (i.e. birth delivery details)',</td>
<td>  json_value json  NULL COMMENT 'where there is no mapped value_id, just raw JSON (i.e. birth delivery details)',</td>
</tr>
</tbody>
</table>
</table>
<h2><span class="mw-headline" id="Sortable_tables">Encounter_event</span></h2>
<h2><span class="mw-headline" id="Sortable_tables">encounter_event</span></h2>
<table class="sortable" border="1" style="border-collapse:collapse">
<table class="sortable" border="1" style="border-collapse:collapse">
<tr>
<tr>
Line 779: Line 683:
<th scope="col" width="10%">Constraint</th>
<th scope="col" width="10%">Constraint</th>
<th scope="col" width="10%">Comment</th>
<th scope="col" width="10%">Comment</th>
<th scope="col" width="10%">Sql</th>
</tr>
</tr>
<tbody>
<tbody>
<tr>
<tr>
<td>date_precision_concept_id</td>
<td>appointment_id</td>
<td>int</td>
<td>bigint</td>
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> COMMENT 'Reference to the precision of the date of the encounter',</td>
<td> COMMENT 'Reference to the appointment this encounter took part on',</td>
<td>  date_precision_concept_id int  NULL COMMENT 'Reference to the precision of the date of the encounter',</td>
</tr>
</tr>
<tr>
<tr>
<td>date_recorded</td>
<td>id</td>
<td>datetime</td>
<td>bigint</td>
<td>NOT NULL</td>
<td> COMMENT 'Unique Id of the encounter event',</td>
</tr>
<tr>
<td>sub_type</td>
<td>text</td>
<td>COMMENT 'Unused',</td>
<td></td>
</tr>
<tr>
<td>episode_of_care_id</td>
<td>bigint</td>
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> COMMENT 'The date the encounter was recorded',</td>
<td> COMMENT 'Reference to the episode of care this encounter belongs to',</td>
<td>  date_recorded datetime  NULL COMMENT 'The date the encounter was recorded',</td>
</tr>
</tr>
<tr>
<tr>
<td>appointment_id</td>
<td>core_concept_id</td>
<td>bigint</td>
<td>int</td>
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> COMMENT 'Reference to the appointment this encounter took part on',</td>
<td> COMMENT 'Reference to the type of encounter',</td>
<td>  appointment_id bigint  NULL COMMENT 'Reference to the appointment this encounter took part on',</td>
</tr>
</tr>
<tr>
<tr>
Line 808: Line 720:
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> COMMENT 'Reference to the type of encounter',</td>
<td> COMMENT 'Reference to the type of encounter',</td>
<td>  non_core_concept_id int  NULL COMMENT 'Reference to the type of encounter',</td>
</tr>
</tr>
<tr>
<tr>
<td>age_at_event</td>
<td>clinical_effective_date</td>
<td>decimal(5,2)</td>
<td>datetime</td>
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> COMMENT 'The age of the patient at the time of the encounter',</td>
<td> COMMENT 'The date the encounter took place',</td>
<td>  age_at_event decimal(5,2)  NULL COMMENT 'The age of the patient at the time of the encounter',</td>
</tr>
</tr>
<tr>
<tr>
Line 822: Line 732:
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> COMMENT 'The clinician the activity is recorded against',</td>
<td> COMMENT 'The clinician the activity is recorded against',</td>
<td>  practitioner_id bigint  NULL COMMENT 'The clinician the activity is recorded against',</td>
</tr>
</tr>
<tr>
<tr>
<td>service_provider_organization_id</td>
<td>date_recorded</td>
<td>bigint</td>
<td>datetime</td>
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> COMMENT 'Reference to the service provider organisation',</td>
<td> COMMENT 'The date the encounter was recorded',</td>
<td>  service_provider_organization_id bigint  NULL COMMENT 'Reference to the service provider organisation',</td>
</tr>
</tr>
<tr>
<tr>
<td>organization_id</td>
<td>date_precision_concept_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>
<td>person_id</td>
<td>bigint</td>
<td>NOT NULL</td>
<td> COMMENT 'The person this event belongs to',</td>
<td>  person_id bigint NOT NULL COMMENT 'The person this event belongs to',</td>
</tr>
<tr>
<td>core_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> COMMENT 'Reference to the precision of the date of the encounter',</td>
<td>  core_concept_id int  NULL COMMENT 'Reference to the type of encounter',</td>
</tr>
<tr>
<td>finished</td>
<td>tinyint(1)</td>
<td>DEFAULT NULL</td>
<td> COMMENT 'Whether the encounter is finished',</td>
<td>  finished tinyint(1)  NULL COMMENT 'Whether the encounter is finished',</td>
</tr>
</tr>
<tr>
<tr>
Line 864: Line 750:
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> COMMENT 'The admission method of the encounter',</td>
<td> COMMENT 'The admission method of the encounter',</td>
<td>  admission_method varchar(40)  NULL COMMENT 'The admission method of the encounter',</td>
</tr>
</tr>
<tr>
<tr>
Line 871: Line 756:
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> COMMENT 'Reference to the institution the encounter took place at',</td>
<td> COMMENT 'Reference to the institution the encounter took place at',</td>
<td>  institution_location_id bigint  NULL COMMENT 'Reference to the institution the encounter took place at',</td>
</tr>
</tr>
<tr>
<tr>
<td>episode_of_care_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 'Reference to the episode of care this encounter belongs to',</td>
<td> COMMENT 'The age of the patient at the time of the encounter',</td>
<td>  episode_of_care_id bigint  NULL COMMENT 'Reference to the episode of care this encounter belongs to',</td>
</tr>
</tr>
<tr>
<tr>
<td>id</td>
<td>type</td>
<td>bigint</td>
<td>text</td>
<td>COMMENT 'Unused',</td>
<td></td>
</tr>
<tr>
<td>organization_id</td>
<td>bigint</td>
<td>NOT NULL</td>
<td>NOT NULL</td>
<td> COMMENT 'Unique Id of the encounter event',</td>
<td> COMMENT 'Owning organisation (i.e. publisher)',</td>
<td>  id bigint NOT NULL COMMENT 'Unique Id of the encounter event',</td>
</tr>
</tr>
<tr>
<tr>
<td>clinical_effective_date</td>
<td>person_id</td>
<td>datetime</td>
<td>bigint</td>
<td>DEFAULT NULL</td>
<td>NOT NULL</td>
<td> COMMENT 'The date the encounter took place',</td>
<td> COMMENT 'The person this event belongs to',</td>
<td>  clinical_effective_date datetime  NULL COMMENT 'The date the encounter took place',</td>
</tr>
</tr>
<tr>
<tr>
<td>sub_type</td>
<td>service_provider_organization_id</td>
<td>text</td>
<td>bigint</td>
<td>COMMENT 'Unused',</td>
<td>DEFAULT NULL</td>
<td></td>
<td> COMMENT 'Reference to the service provider organisation',</td>
<td> sub_type text COMMENT 'Unused',</td>
</tr>
</tr>
<tr>
<tr>
Line 906: Line 792:
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> COMMENT 'The end date of the encounter',</td>
<td> COMMENT 'The end date of the encounter',</td>
<td>  end_date date  NULL COMMENT 'The end date of the encounter',</td>
</tr>
</tr>
<tr>
<tr>
Line 913: Line 798:
<td>NOT NULL</td>
<td>NOT NULL</td>
<td> COMMENT 'Reference to the parent encounter record',</td>
<td> COMMENT 'Reference to the parent encounter record',</td>
<td>  encounter_id bigint NOT NULL COMMENT 'Reference to the parent encounter record',</td>
</tr>
</tr>
<tr>
<tr>
Line 920: Line 804:
<td>NOT NULL</td>
<td>NOT NULL</td>
<td> COMMENT 'The patient this event belongs to',</td>
<td> COMMENT 'The patient this event belongs to',</td>
<td>  patient_id bigint NOT NULL COMMENT 'The patient this event belongs to',</td>
</tr>
</tr>
<tr>
<tr>
<td>type</td>
<td>finished</td>
<td>text</td>
<td>tinyint(1)</td>
<td>COMMENT 'Unused',</td>
<td>DEFAULT NULL</td>
<td></td>
<td> COMMENT 'Whether the encounter is finished',</td>
<td> type text COMMENT 'Unused',</td>
</tr>
</tr>
</tbody>
<tr>
<td>PRIMARY KEY CONSTRAINT(s) `organization_id`,`person_id`,`id`),</td> </tr> </tbody>
</table>
</table>
<h2><span class="mw-headline" id="Sortable_tables">Episode_of_care</span></h2>
<h2><span class="mw-headline" id="Sortable_tables">episode_of_care</span></h2>
<table class="sortable" border="1" style="border-collapse:collapse">
<table class="sortable" border="1" style="border-collapse:collapse">
<tr>
<tr>
Line 938: Line 821:
<th scope="col" width="10%">Constraint</th>
<th scope="col" width="10%">Constraint</th>
<th scope="col" width="10%">Comment</th>
<th scope="col" width="10%">Comment</th>
<th scope="col" width="10%">Sql</th>
</tr>
</tr>
<tbody>
<tbody>
Line 946: Line 828:
<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> 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>
<tr>
<tr>
<td>id</td>
<td>usual_gp_practitioner_id</td>
<td>bigint</td>
<td>bigint</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>date_registered</td>
<td>date</td>
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> COMMENT 'The date the registration was started  for this episode of care',</td>
<td> COMMENT 'Reference to the usual GP for this episode of care',</td>
<td>  date_registered date  NULL COMMENT 'The date the registration was started  for this episode of care',</td>
</tr>
</tr>
<tr>
<tr>
Line 967: Line 840:
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> COMMENT 'Reference to the registration status of the patient',</td>
<td> COMMENT 'Reference to the registration status of the patient',</td>
<td>  registration_status_concept_id int  NULL COMMENT 'Reference to the registration status of the patient',</td>
</tr>
</tr>
<tr>
<tr>
Line 974: Line 846:
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> COMMENT 'The date the registration was ended  for this episode of care',</td>
<td> COMMENT 'The date the registration was ended  for this episode of care',</td>
<td>  date_registered_end date  NULL COMMENT 'The date the registration was ended  for this episode of care',</td>
</tr>
</tr>
<tr>
<tr>
Line 981: Line 852:
<td>NOT NULL</td>
<td>NOT NULL</td>
<td> COMMENT 'Owning organisation (i.e. publisher)',</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>
<td>usual_gp_practitioner_id</td>
<td>date_registered</td>
<td>bigint</td>
<td>date</td>
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> COMMENT 'Reference to the usual GP for this episode of care',</td>
<td> COMMENT 'The date the registration was started  for this episode of care',</td>
<td>  usual_gp_practitioner_id bigint  NULL COMMENT 'Reference to the usual GP for this episode of care',</td>
</tr>
</tr>
<tr>
<tr>
Line 995: Line 864:
<td>NOT NULL</td>
<td>NOT NULL</td>
<td> COMMENT 'Unique individual across all organisations',</td>
<td> COMMENT 'Unique individual across all organisations',</td>
<td> person_id bigint NOT NULL COMMENT 'Unique individual across all organisations',</td>
</tr>
<tr>
<td>id</td>
<td>bigint</td>
<td>NOT NULL</td>
<td> COMMENT 'Unique Id of the episode of care',</td>
</tr>
</tr>
<tr>
<tr>
Line 1,002: Line 876:
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> COMMENT 'Reference to the registration type of the patient',</td>
<td> COMMENT 'Reference to the registration type of the patient',</td>
<td>  registration_type_concept_id int  NULL COMMENT 'Reference to the registration type of the patient',</td>
</tr>
</tr>
</tbody>
<tr>
<td>PRIMARY KEY CONSTRAINT(s) `organization_id`,`person_id`,`id`),</td> </tr> </tbody>
</table>
</table>
<h2><span class="mw-headline" id="Sortable_tables">Event_log</span></h2>
<h2><span class="mw-headline" id="Sortable_tables">event_log</span></h2>
<table class="sortable" border="1" style="border-collapse:collapse">
<table class="sortable" border="1" style="border-collapse:collapse">
<tr>
<tr>
Line 1,013: Line 887:
<th scope="col" width="10%">Constraint</th>
<th scope="col" width="10%">Constraint</th>
<th scope="col" width="10%">Comment</th>
<th scope="col" width="10%">Comment</th>
<th scope="col" width="10%">Sql</th>
</tr>
</tr>
<tbody>
<tbody>
<tr>
<td>table_id</td>
<td>tinyint</td>
<td>NOT NULL</td>
<td> COMMENT 'identifier of the table changed',</td>
</tr>
<tr>
<tr>
<td>dt_change</td>
<td>dt_change</td>
Line 1,021: Line 900:
<td>NOT NULL</td>
<td>NOT NULL</td>
<td> COMMENT 'date time the change was made to this DB',</td>
<td> COMMENT 'date time the change was made to this DB',</td>
<td>  dt_change datetime(3) NOT NULL COMMENT 'date time the change was made to this DB',</td>
</tr>
</tr>
<tr>
<tr>
Line 1,028: Line 906:
<td>NOT NULL</td>
<td>NOT NULL</td>
<td> COMMENT 'type of transaction 0=insert, 1=update, 2=delete',</td>
<td> COMMENT 'type of transaction 0=insert, 1=update, 2=delete',</td>
<td>  change_type tinyint NOT NULL COMMENT 'type of transaction 0=insert, 1=update, 2=delete',</td>
</tr>
</tr>
<tr>
<tr>
<td>table_id</td>
<td>record_id</td>
<td>tinyint</td>
<td>bigint</td>
<td>NOT NULL</td>
<td> COMMENT 'identifier of the table changed',</td>
<td>  table_id tinyint NOT NULL COMMENT 'identifier of the table changed',</td>
</tr>
<tr>
<td>record_id</td>
<td>bigint</td>
<td>NOT NULL</td>
<td>NOT NULL</td>
<td> COMMENT 'id of the record changed'</td>
<td> COMMENT 'id of the record changed'</td>
<td>  record_id bigint NOT NULL COMMENT 'id of the record changed'</td>
</tr>
</tr>
</tbody>
</tbody>
</table>
</table>
<h2><span class="mw-headline" id="Sortable_tables">Flag</span></h2>
<h2><span class="mw-headline" id="Sortable_tables">flag</span></h2>
<table class="sortable" border="1" style="border-collapse:collapse">
<table class="sortable" border="1" style="border-collapse:collapse">
<tr>
<tr>
Line 1,053: Line 922:
<th scope="col" width="10%">Constraint</th>
<th scope="col" width="10%">Constraint</th>
<th scope="col" width="10%">Comment</th>
<th scope="col" width="10%">Comment</th>
<th scope="col" width="10%">Sql</th>
</tr>
</tr>
<tbody>
<tbody>
<tr>
<td>flag_text</td>
<td>text</td>
<td>COMMENT 'This</td>
<td> is a warning set by the publisher regarding he patient',</td>
</tr>
<tr>
<tr>
<td>patient_id</td>
<td>patient_id</td>
Line 1,061: Line 935:
<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> 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>
<tr>
<tr>
Line 1,068: Line 941:
<td>NOT NULL</td>
<td>NOT NULL</td>
<td> COMMENT 'Whether the flag is active or not',</td>
<td> COMMENT 'Whether the flag is active or not',</td>
<td> is_active tinyint(1) NOT NULL COMMENT 'Whether the flag is active or not',</td>
</tr>
<tr>
<td>organization_id</td>
<td>bigint</td>
<td>NOT NULL</td>
<td> COMMENT 'Owning organisation (i.e. publisher)',</td>
</tr>
</tr>
<tr>
<tr>
Line 1,075: Line 953:
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> COMMENT 'The date the flag was entered onto the patients record',</td>
<td> COMMENT 'The date the flag was entered onto the patients record',</td>
<td>  effective_date date  NULL COMMENT 'The date the flag was entered onto the patients record',</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> COMMENT 'Unique individual across all organisations',</td>
<td>  organization_id bigint NOT NULL COMMENT 'Owning organisation (i.e. publisher)',</td>
</tr>
</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> COMMENT 'Unique Id of the flag',</td>
<td>  person_id bigint NOT NULL COMMENT 'Unique individual across all organisations',</td>
</tr>
<tr>
<td>flag_text</td>
<td>text</td>
<td>COMMENT 'This</td>
<td> is a warning set by the publisher regarding he patient',</td>
<td>  flag_text text COMMENT 'This is a warning set by the publisher regarding he patient',</td>
</tr>
</tr>
<tr>
<tr>
Line 1,103: Line 971:
<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> 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  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>
<td>id</td>
<td>PRIMARY KEY CONSTRAINT(s) `organization_id`,`person_id`,`id`),</td> </tr> </tbody>
<td>bigint</td>
</table>
<td>NOT NULL</td>
<h2><span class="mw-headline" id="Sortable_tables">location</span></h2>
<td> COMMENT 'Unique Id of the flag',</td>
<td>  id bigint NOT NULL COMMENT 'Unique Id of the flag',</td>
</tr>
</tbody>
</table>
<h2><span class="mw-headline" id="Sortable_tables">Location</span></h2>
<table class="sortable" border="1" style="border-collapse:collapse">
<table class="sortable" border="1" style="border-collapse:collapse">
<tr>
<tr>
Line 1,121: Line 982:
<th scope="col" width="10%">Constraint</th>
<th scope="col" width="10%">Constraint</th>
<th scope="col" width="10%">Comment</th>
<th scope="col" width="10%">Comment</th>
<th scope="col" width="10%">Sql</th>
</tr>
</tr>
<tbody>
<tbody>
<tr>
<tr>
<td>type_code</td>
<td>type_desc</td>
<td>varchar(50)</td>
<td>DEFAULT NULL</td>
<td> COMMENT 'The type of location',</td>
<td>  type_code varchar(50)  NULL COMMENT 'The type of location',</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 name of a location set by the publisher. E.g. ward, clinic, domiciliary',</td>
<td> COMMENT 'Textual description of the type of location eg GP Practice',</td>
<td>  name varchar(255)  NULL COMMENT 'The name of a location set by the publisher. E.g. ward, clinic, domiciliary',</td>
</tr>
</tr>
<tr>
<tr>
<td>id</td>
<td>managing_organization_id</td>
<td>bigint</td>
<td>bigint</td>
<td>NOT NULL</td>
<td>DEFAULT NULL</td>
<td> COMMENT 'Unique Id of the location',</td>
<td> COMMENT 'Reference to the managing organisation of the location',</td>
<td>  id bigint NOT NULL COMMENT 'Unique Id of the location',</td>
</tr>
</tr>
<tr>
<tr>
<td>type_desc</td>
<td>name</td>
<td>varchar(255)</td>
<td>varchar(255)</td>
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> COMMENT 'Textual description of the type of location eg GP Practice',</td>
<td> COMMENT 'The name of a location set by the publisher. E.g. ward, clinic, domiciliary',</td>
<td>  type_desc varchar(255)  NULL COMMENT 'Textual description of the type of location eg GP Practice',</td>
</tr>
</tr>
<tr>
<tr>
Line 1,157: Line 1,007:
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> COMMENT 'The postcode of the location',</td>
<td> COMMENT 'The postcode of the location',</td>
<td>  postcode varchar(10)  NULL COMMENT 'The postcode of the location',</td>
</tr>
</tr>
<tr>
<tr>
<td>managing_organization_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 managing organisation of the location',</td>
<td> COMMENT 'The type of location',</td>
<td>  managing_organization_id bigint  NULL COMMENT 'Reference to the managing organisation of the location',</td>
</tr>
</tr>
</tbody>
<tr>
<td>id</td>
<td>bigint</td>
<td>NOT NULL</td>
<td> COMMENT 'Unique Id of the location',</td>
</tr>
<tr>
<td>PRIMARY KEY CONSTRAINT(s) `id`),</td> </tr> </tbody>
</table>
</table>
<h2><span class="mw-headline" id="Sortable_tables">Medication_order</span></h2>
<h2><span class="mw-headline" id="Sortable_tables">medication_order</span></h2>
<table class="sortable" border="1" style="border-collapse:collapse">
<table class="sortable" border="1" style="border-collapse:collapse">
<tr>
<tr>
Line 1,175: Line 1,030:
<th scope="col" width="10%">Constraint</th>
<th scope="col" width="10%">Constraint</th>
<th scope="col" width="10%">Comment</th>
<th scope="col" width="10%">Comment</th>
<th scope="col" width="10%">Sql</th>
</tr>
</tr>
<tbody>
<tbody>
<tr>
<td>clinical_effective_date</td>
<td>date</td>
<td>DEFAULT NULL</td>
<td> COMMENT 'The date the medication order was issued',</td>
<td>  clinical_effective_date date  NULL COMMENT 'The date the medication order was issued',</td>
</tr>
<tr>
<tr>
<td>patient_id</td>
<td>patient_id</td>
Line 1,190: Line 1,037:
<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> 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>
<tr>
<tr>
<td>practitioner_id</td>
<td>core_concept_id</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> COMMENT 'Reference to the clinical coding of the medication',</td>
<td>  practitioner_id bigint  NULL COMMENT 'The clinician the activity is recorded against',</td>
</tr>
</tr>
<tr>
<tr>
<td>non_core_concept_id</td>
<td>duration_days</td>
<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> COMMENT 'How many days the medication is prescribed for',</td>
<td>  non_core_concept_id int  NULL COMMENT 'Reference to the clinical coding of the medication',</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> COMMENT 'Owning organisation (i.e. publisher)',</td>
<td>  organization_id bigint NOT NULL COMMENT 'Owning organisation (i.e. publisher)',</td>
</tr>
<tr>
<td>dose</td>
<td>varchar(1000)</td>
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> COMMENT 'Textual description of the dose',</td>
<td> COMMENT 'A reference to the drug in the BNF dictionary',</td>
<td>  dose varchar(1000)  NULL COMMENT 'Textual description of the dose',</td>
</tr>
</tr>
<tr>
<tr>
<td>quantity_unit</td>
<td>issue_method</td>
<td>varchar(255)</td>
<td>text</td>
<td>DEFAULT NULL</td>
<td>COMMENT 'The</td>
<td> COMMENT 'The unit of the medication that was prescribed eg tablets',</td>
<td> issue method of the medication eg hand written',</td>
<td> quantity_unit varchar(255)  NULL COMMENT 'The unit of the medication that was prescribed eg tablets',</td>
</tr>
</tr>
<tr>
<tr>
<td>age_at_event</td>
<td>dose</td>
<td>decimal(5,2)</td>
<td>varchar(1000)</td>
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> COMMENT 'The age the patient was at the time of this event',</td>
<td> COMMENT 'Textual description of the dose',</td>
<td>  age_at_event decimal(5,2)  NULL COMMENT 'The age the patient was at the time of this event',</td>
</tr>
</tr>
<tr>
<tr>
<td>core_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 clinical coding of the medication',</td>
<td> COMMENT 'The estimated cost of the medication',</td>
<td>  core_concept_id int  NULL COMMENT 'Reference to the clinical coding of the medication',</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 medication order',</td>
<td> COMMENT 'Unique individual across all organisations',</td>
<td>  id bigint NOT NULL COMMENT 'Unique Id of the medication order',</td>
</tr>
</tr>
<tr>
<tr>
<td>bnf_reference</td>
<td>practitioner_id</td>
<td>varchar(6)</td>
<td>bigint</td>
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> COMMENT 'A reference to the drug in the BNF dictionary',</td>
<td> COMMENT 'The clinician the activity is recorded against',</td>
<td>  bnf_reference varchar(6)  NULL COMMENT 'A reference to the drug in the BNF dictionary',</td>
</tr>
</tr>
<tr>
<tr>
<td>duration_days</td>
<td>medication_statement_id</td>
<td>int</td>
<td>bigint</td>
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> COMMENT 'How many days the medication is prescribed for',</td>
<td> COMMENT 'Reference to the medication statement.  A medication statement can have many medication orders',</td>
<td>  duration_days int  NULL COMMENT 'How many days the medication is prescribed for',</td>
</tr>
</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> COMMENT 'Unique Id of the medication order',</td>
<td>  person_id bigint NOT NULL COMMENT 'Unique individual across all organisations',</td>
</tr>
<tr>
<td>issue_method</td>
<td>text</td>
<td>COMMENT 'The</td>
<td> issue method of the medication eg hand written',</td>
<td>  issue_method text COMMENT 'The issue method of the medication eg hand written',</td>
</tr>
<tr>
<td>encounter_id</td>
<td>bigint</td>
<td>DEFAULT NULL</td>
<td> COMMENT 'Reference to the encounter the medication order was issued in',</td>
<td>  encounter_id bigint  NULL COMMENT 'Reference to the encounter the medication order was issued in',</td>
</tr>
</tr>
<tr>
<tr>
Line 1,288: Line 1,103:
<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> 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  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>
<td>medication_statement_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 medication statement.  A medication statement can have many medication orders',</td>
<td> COMMENT 'Reference to the clinical coding of the medication',</td>
<td>  medication_statement_id bigint  NULL COMMENT 'Reference to the medication statement.  A medication statement can have many medication orders',</td>
</tr>
</tr>
<tr>
<tr>
Line 1,302: Line 1,115:
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> COMMENT 'The value of the medication that was prescribed eg 50',</td>
<td> COMMENT 'The value of the medication that was prescribed eg 50',</td>
<td>  quantity_value double  NULL COMMENT 'The value of the medication that was prescribed eg 50',</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> COMMENT 'Owning organisation (i.e. publisher)',</td>
<td>  estimated_cost double  NULL COMMENT 'The estimated cost of the medication',</td>
</tr>
</tr>
</tbody>
<tr>
<td>clinical_effective_date</td>
<td>date</td>
<td>DEFAULT NULL</td>
<td> COMMENT 'The date the medication order was issued',</td>
</tr>
<tr>
<td>encounter_id</td>
<td>bigint</td>
<td>DEFAULT NULL</td>
<td> COMMENT 'Reference to the encounter the medication order was issued in',</td>
</tr>
<tr>
<td>age_at_event</td>
<td>decimal(5,2)</td>
<td>DEFAULT NULL</td>
<td> COMMENT 'The age the patient was at the time of this event',</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>
</tr>
<tr>
<td>PRIMARY KEY CONSTRAINT(s) `organization_id`,`person_id`,`id`),</td> </tr> </tbody>
</table>
</table>
<h2><span class="mw-headline" id="Sortable_tables">Medication_statement</span></h2>
<h2><span class="mw-headline" id="Sortable_tables">medication_statement</span></h2>
<table class="sortable" border="1" style="border-collapse:collapse">
<table class="sortable" border="1" style="border-collapse:collapse">
<tr>
<tr>
Line 1,320: Line 1,156:
<th scope="col" width="10%">Constraint</th>
<th scope="col" width="10%">Constraint</th>
<th scope="col" width="10%">Comment</th>
<th scope="col" width="10%">Comment</th>
<th scope="col" width="10%">Sql</th>
</tr>
</tr>
<tbody>
<tbody>
<tr>
<tr>
<td>dose</td>
<td>cancellation_date</td>
<td>varchar(1000)</td>
<td>date</td>
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> COMMENT 'Texual description of the dose of the medication',</td>
<td> COMMENT 'The date the medication was cancelled',</td>
<td>  dose varchar(1000)  NULL COMMENT 'Texual description of the dose of the medication',</td>
</tr>
</tr>
<tr>
<tr>
<td>patient_id</td>
<td>Issue_method</td>
<td>bigint</td>
<td>text</td>
<td>NOT NULL</td>
<td>COMMENT 'The</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> issue method of the medication eg hand written',</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>
<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> 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>  practitioner_id bigint  NULL COMMENT 'The clinician the activity is recorded against',</td>
</tr>
</tr>
<tr>
<tr>
<td>Issue_method</td>
<td>date_recorded</td>
<td>text</td>
<td>datetime</td>
<td>COMMENT 'The</td>
<td>DEFAULT NULL,</td>
<td> issue method of the medication eg hand written',</td>
<td></td>
<td> Issue_method text COMMENT 'The issue method of the medication eg hand written',</td>
</tr>
</tr>
<tr>
<tr>
<td>non_core_concept_id</td>
<td>core_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 medication',</td>
<td> COMMENT 'Reference to the clinical coding of the medication',</td>
<td>  non_core_concept_id int  NULL COMMENT 'Reference to the clinical coding of the medication',</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> COMMENT 'A reference to the drug in the BNF dictionary',</td>
<td>  organization_id bigint NOT NULL COMMENT 'Owning organisation (i.e. publisher)',</td>
</tr>
</tr>
<tr>
<tr>
<td>clinical_effective_date</td>
<td>dose</td>
<td>date</td>
<td>varchar(1000)</td>
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> COMMENT 'The date the medication was clinical relevant',</td>
<td> COMMENT 'Texual description of the dose of the medication',</td>
<td>  clinical_effective_date date  NULL COMMENT 'The date the medication was clinical relevant',</td>
</tr>
</tr>
<tr>
<tr>
<td>cancellation_date</td>
<td>person_id</td>
<td>date</td>
<td>bigint</td>
<td>NOT NULL</td>
<td> COMMENT 'Unique individual across all organisations',</td>
</tr>
<tr>
<td>authorisation_type_concept_id</td>
<td>int</td>
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> COMMENT 'The date the medication was cancelled',</td>
<td> COMMENT 'Reference to the authorisation type',</td>
<td>  cancellation_date date  NULL COMMENT 'The date the medication was cancelled',</td>
</tr>
</tr>
<tr>
<tr>
<td>quantity_unit</td>
<td>practitioner_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> COMMENT 'The clinician the activity is recorded against',</td>
<td>  quantity_unit varchar(255)  NULL COMMENT 'The unit of the medication that was prescribed eg tablets',</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> COMMENT 'The date the medication was clinical relevant',</td>
<td>  age_at_event decimal(5,2)  NULL COMMENT 'The age the patient was at the time of this event',</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 medication',</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>  core_concept_id int  NULL COMMENT 'Reference to the clinical coding of the medication',</td>
</tr>
</tr>
<tr>
<tr>
<td>bnf_reference</td>
<td>non_core_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> COMMENT 'Reference to the clinical coding of the medication',</td>
<td>  bnf_reference varchar(6)  NULL COMMENT 'A reference to the drug in the BNF dictionary',</td>
</tr>
<tr>
<td>authorisation_type_concept_id</td>
<td>int</td>
<td>DEFAULT NULL</td>
<td> COMMENT 'Reference to the authorisation type',</td>
<td>  authorisation_type_concept_id int  NULL COMMENT 'Reference to the authorisation type',</td>
</tr>
<tr>
<td>encounter_id</td>
<td>bigint</td>
<td>DEFAULT NULL</td>
<td> COMMENT 'Reference to the encounter this medication was recorded in',</td>
<td>  encounter_id bigint  NULL COMMENT 'Reference to the encounter this medication was recorded in',</td>
</tr>
</tr>
<tr>
<tr>
Line 1,426: Line 1,241:
<td>NOT NULL</td>
<td>NOT NULL</td>
<td> COMMENT 'Unique Id of the medication',</td>
<td> COMMENT 'Unique Id of the medication',</td>
<td>  id bigint NOT NULL COMMENT 'Unique Id of the medication',</td>
</tr>
</tr>
<tr>
<tr>
Line 1,433: Line 1,247:
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> COMMENT 'Whether the medication is active or not',</td>
<td> COMMENT 'Whether the medication is active or not',</td>
<td>  is_active tinyint(1)  NULL COMMENT 'Whether the medication is active or not',</td>
</tr>
</tr>
<tr>
<tr>
<td>date_recorded</td>
<td>quantity_value</td>
<td>datetime</td>
<td>double</td>
<td>DEFAULT NULL,</td>
<td>DEFAULT NULL</td>
<td></td>
<td> COMMENT 'The value of the medication that was prescribed eg 50',</td>
<td>  date_recorded datetime  NULL,</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 'Unique individual across all organisations',</td>
<td> COMMENT 'Owning organisation (i.e. publisher)',</td>
<td>  person_id bigint NOT NULL COMMENT 'Unique individual across all organisations',</td>
</tr>
</tr>
<tr>
<tr>
<td>date_precision_concept_id</td>
<td>encounter_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> COMMENT 'Reference to the encounter this medication was recorded in',</td>
<td>  date_precision_concept_id int  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>
<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> COMMENT 'The age the patient was at the time of this event',</td>
<td> quantity_value double  NULL COMMENT 'The value of the medication that was prescribed eg 50',</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>
</tr>
</tr>
</tbody>
<tr>
<td>PRIMARY KEY CONSTRAINT(s) `organization_id`,`person_id`,`id`),</td> </tr> </tbody>
</table>
</table>
<h2><span class="mw-headline" id="Sortable_tables">Observation</span></h2>
<h2><span class="mw-headline" id="Sortable_tables">observation</span></h2>
<table class="sortable" border="1" style="border-collapse:collapse">
<table class="sortable" border="1" style="border-collapse:collapse">
<tr>
<tr>
Line 1,472: Line 1,288:
<th scope="col" width="10%">Constraint</th>
<th scope="col" width="10%">Constraint</th>
<th scope="col" width="10%">Comment</th>
<th scope="col" width="10%">Comment</th>
<th scope="col" width="10%">Sql</th>
</tr>
</tr>
<tbody>
<tbody>
<tr>
<tr>
<td>result_date</td>
<td>problem_end_date</td>
<td>date</td>
<td>date</td>
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> COMMENT 'The date of the result',</td>
<td> COMMENT 'The end date of the problem',</td>
<td>  result_date date  NULL COMMENT 'The date of the result',</td>
</tr>
</tr>
<tr>
<tr>
<td>practitioner_id</td>
<td>is_primary</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> COMMENT 'Whether the observation is a primary observation',</td>
<td>  practitioner_id bigint  NULL COMMENT 'The clinician the activity is recorded against',</td>
</tr>
</tr>
<tr>
<tr>
<td>encounter_id</td>
<td>episodicity_concept_id</td>
<td>bigint</td>
<td>int</td>
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> COMMENT 'Reference to the encounter the observation was recorded at',</td>
<td> COMMENT 'Reference to the episodicity of the problem eg First, review, flare',</td>
<td>  encounter_id bigint  NULL COMMENT 'Reference to the encounter the observation was recorded at',</td>
</tr>
</tr>
<tr>
<tr>
<td>date_recorded</td>
<td>result_value_units</td>
<td>datetime</td>
<td>varchar(50)</td>
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> COMMENT 'The date the observation was recorded in the system',</td>
<td> COMMENT 'The units of the result of the observation',</td>
<td>  date_recorded datetime  NULL COMMENT 'The date the observation was recorded in the system',</td>
</tr>
</tr>
<tr>
<tr>
<td>id</td>
<td>result_text</td>
<td>bigint</td>
<td>text</td>
<td>NOT NULL</td>
<td>COMMENT 'Any</td>
<td> COMMENT 'Unique Id of the observation',</td>
<td> text associated with the result',</td>
<td> id bigint NOT NULL COMMENT 'Unique Id of the observation',</td>
</tr>
</tr>
<tr>
<tr>
Line 1,515: Line 1,325:
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> COMMENT 'Reference to the clinical coding of the result',</td>
<td> COMMENT 'Reference to the clinical coding of the result',</td>
<td>  result_concept_id int  NULL COMMENT 'Reference to the clinical coding of the result',</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 observation',</td>
<td> COMMENT 'Unique individual across all organisations',</td>
<td>  age_at_event decimal(5,2)  NULL COMMENT 'The age of the patient at the time of the observation',</td>
</tr>
</tr>
<tr>
<tr>
<td>episodicity_concept_id</td>
<td>practitioner_id</td>
<td>int</td>
<td>bigint</td>
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> COMMENT 'Reference to the episodicity of the problem eg First, review, flare',</td>
<td> COMMENT 'The clinician the activity is recorded against',</td>
<td>  episodicity_concept_id int  NULL COMMENT 'Reference to the episodicity of the problem eg First, review, flare',</td>
</tr>
</tr>
<tr>
<tr>
<td>result_value_units</td>
<td>is_problem</td>
<td>varchar(50)</td>
<td>tinyint(1)</td>
<td>DEFAULT NULL</td>
<td>NOT NULL</td>
<td> COMMENT 'The units of the result of the observation',</td>
<td> COMMENT 'Whether the observation is marked as a problem',</td>
<td>  result_value_units varchar(50)  NULL COMMENT 'The units of the result of the observation',</td>
</tr>
</tr>
<tr>
<tr>
<td>core_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 clinical coding of the observation',</td>
<td> COMMENT 'The value of the result of the observation',</td>
<td>  core_concept_id int  NULL COMMENT 'Reference to the clinical coding of the observation',</td>
</tr>
</tr>
<tr>
<tr>
<td>date_precision_concept_id</td>
<td>result_date</td>
<td>date</td>
<td>DEFAULT NULL</td>
<td> COMMENT 'The date of the result',</td>
</tr>
<tr>
<td>non_core_concept_id</td>
<td>int</td>
<td>DEFAULT NULL</td>
<td> COMMENT 'Reference to the clinical coding of the observation',</td>
</tr>
<tr>
<td>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> COMMENT 'Reference to the clinical coding of the observation',</td>
<td>  date_precision_concept_id int  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,557: Line 1,373:
<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> 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>
<tr>
<tr>
<td>organization_id</td>
<td>date_recorded</td>
<td>bigint</td>
<td>datetime</td>
<td>NOT NULL</td>
<td>DEFAULT NULL</td>
<td> COMMENT 'Owning organisation (i.e. publisher)',</td>
<td> COMMENT 'The date the observation was recorded in the system',</td>
<td>  organization_id bigint NOT NULL COMMENT 'Owning organisation (i.e. publisher)',</td>
</tr>
</tr>
<tr>
<tr>
<td>is_problem</td>
<td>is_review</td>
<td>tinyint(1)</td>
<td>tinyint(1)</td>
<td>NOT NULL</td>
<td>NOT NULL</td>
<td> COMMENT 'Whether the observation is marked as a problem',</td>
<td> COMMENT 'Whether the observation is a review of an existing problem',</td>
<td> is_problem tinyint(1) NOT NULL COMMENT 'Whether the observation is marked as a problem',</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>
</tr>
</tr>
<tr>
<tr>
Line 1,578: Line 1,397:
<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> 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>  parent_observation_id bigint  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>
</tr>
</tr>
<tr>
<tr>
<td>result_text</td>
<td>organization_id</td>
<td>text</td>
<td>bigint</td>
<td>COMMENT 'Any</td>
<td>NOT NULL</td>
<td> text associated with the result',</td>
<td> COMMENT 'Owning organisation (i.e. publisher)',</td>
<td> result_text text COMMENT 'Any text associated with the result',</td>
</tr>
<tr>
<td>id</td>
<td>bigint</td>
<td>NOT NULL</td>
<td> COMMENT 'Unique Id of the observation',</td>
</tr>
</tr>
<tr>
<tr>
<td>is_primary</td>
<td>age_at_event</td>
<td>tinyint(1)</td>
<td>decimal(5,2)</td>
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> COMMENT 'Whether the observation is a primary observation',</td>
<td> COMMENT 'The age of the patient at the time of the observation',</td>
<td>  is_primary tinyint(1)  NULL COMMENT 'Whether the observation is a primary observation',</td>
</tr>
</tr>
<tr>
<tr>
<td>clinical_effective_date</td>
<td>encounter_id</td>
<td>date</td>
<td>bigint</td>
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> COMMENT 'The date the observation was identified by a clinician',</td>
<td> COMMENT 'Reference to the encounter the observation was recorded at',</td>
<td>  clinical_effective_date date  NULL COMMENT 'The date the observation was identified by a clinician',</td>
</tr>
</tr>
<tr>
<tr>
<td>problem_end_date</td>
<td>clinical_effective_date</td>
<td>date</td>
<td>date</td>
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> COMMENT 'The end date of the problem',</td>
<td> COMMENT 'The date the observation was identified by a clinician',</td>
<td>  problem_end_date date  NULL COMMENT 'The end date of the problem',</td>
</tr>
</tr>
<tr>
<tr>
<td>is_review</td>
<td>PRIMARY KEY CONSTRAINT(s) `organization_id`,`person_id`,`id`),</td> </tr> </tbody>
<td>tinyint(1)</td>
</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>
</tr>
<tbody>
<tr>
<td>property_id</td>
<td>int</td>
<td>NOT NULL</td>
<td>NOT NULL</td>
<td> COMMENT 'Whether the observation is a review of an existing problem',</td>
<td> COMMENT 'IM reference (i.e. significance)',</td>
<td>  is_review tinyint(1) NOT NULL COMMENT 'Whether the observation is a review of an existing problem',</td>
</tr>
</tr>
<tr>
<tr>
<td>result_value</td>
<td>text_value</td>
<td>double</td>
<td>varchar(255)</td>
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> COMMENT 'The value of the result of the observation',</td>
<td> COMMENT 'where there is no mapped value_id or raw JSON, just a basic text value',</td>
<td>  result_value double  NULL COMMENT 'The value of the result of the observation',</td>
</tr>
</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> COMMENT 'same as the id column on the observation table',</td>
<td> person_id bigint NOT NULL COMMENT 'Unique individual across all organisations',</td>
</tr>
<tr>
<td>json_value</td>
<td>json</td>
<td>DEFAULT NULL</td>
<td> COMMENT 'the JSON data itself ',</td>
</tr>
</tr>
<tr>
<tr>
<td>non_core_concept_id</td>
<td>value_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> COMMENT 'IM reference (i.e. minor, significant)',</td>
<td>  non_core_concept_id int  NULL COMMENT 'Reference to the clinical coding of the observation',</td>
</tr>
</tr>
</tbody>
<tr>
<td>PRIMARY KEY CONSTRAINT(s) `id`,`property_id`),</td> </tr> </tbody>
</table>
</table>
<h2><span class="mw-headline" id="Sortable_tables">Observation_additional</span></h2>
<h2><span class="mw-headline" id="Sortable_tables">organization</span></h2>
<table class="sortable" border="1" style="border-collapse:collapse">
<table class="sortable" border="1" style="border-collapse:collapse">
<tr>
<tr>
Line 1,645: Line 1,480:
<th scope="col" width="10%">Constraint</th>
<th scope="col" width="10%">Constraint</th>
<th scope="col" width="10%">Comment</th>
<th scope="col" width="10%">Comment</th>
<th scope="col" width="10%">Sql</th>
</tr>
</tr>
<tbody>
<tbody>
<tr>
<tr>
<td>json_value</td>
<td>id</td>
<td>json</td>
<td>bigint</td>
<td>NOT NULL</td>
<td> COMMENT 'Unique Id of the organisation',</td>
</tr>
<tr>
<td>Name</td>
<td>varchar(255)</td>
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> COMMENT 'the JSON data itself ',</td>
<td> COMMENT 'Name of the organisation',</td>
<td>  json_value json  NULL COMMENT 'the JSON data itself ',</td>
</tr>
</tr>
<tr>
<tr>
<td>text_value</td>
<td>type_desc</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',</td>
<td> COMMENT 'Textual description of the type of organisation eg GP Practice',</td>
<td>  text_value varchar(255)  NULL COMMENT 'where there is no mapped value_id or raw JSON, just a basic text value',</td>
</tr>
</tr>
<tr>
<tr>
<td>id</td>
<td>ods_code</td>
<td>bigint</td>
<td>varchar(50)</td>
<td>NOT NULL</td>
<td>DEFAULT NULL</td>
<td> COMMENT 'same as the id column on the observation table',</td>
<td> COMMENT 'ODS Code of the organisation',</td>
<td>  id bigint NOT NULL COMMENT 'same as the id column on the observation table',</td>
</tr>
</tr>
<tr>
<tr>
<td>value_id</td>
<td>type_code</td>
<td>int</td>
<td>varchar(50)</td>
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> COMMENT 'IM reference (i.e. minor, significant)',</td>
<td> COMMENT 'The type of organisation',</td>
<td>  value_id int  NULL COMMENT 'IM reference (i.e. minor, significant)',</td>
</tr>
</tr>
<tr>
<tr>
<td>property_id</td>
<td>Postcode</td>
<td>int</td>
<td>varchar(10)</td>
<td>NOT NULL</td>
<td>DEFAULT NULL</td>
<td> COMMENT 'IM reference (i.e. significance)',</td>
<td> COMMENT 'The postcode of the organisation',</td>
<td> property_id int NOT NULL COMMENT 'IM reference (i.e. significance)',</td>
</tr>
<tr>
<td>parent_organization_id</td>
<td>bigint</td>
<td>DEFAULT NULL</td>
<td> COMMENT 'The id of the parent organisation',</td>
</tr>
</tr>
</tbody>
<tr>
<td>PRIMARY KEY CONSTRAINT(s) `id`),</td> </tr> </tbody>
</table>
</table>
<h2><span class="mw-headline" id="Sortable_tables">Organization</span></h2>
<h2><span class="mw-headline" id="Sortable_tables">organization_metadata</span></h2>
<table class="sortable" border="1" style="border-collapse:collapse">
<table class="sortable" border="1" style="border-collapse:collapse">
<tr>
<tr>
Line 1,692: Line 1,534:
<th scope="col" width="10%">Constraint</th>
<th scope="col" width="10%">Constraint</th>
<th scope="col" width="10%">Comment</th>
<th scope="col" width="10%">Comment</th>
<th scope="col" width="10%">Sql</th>
</tr>
</tr>
<tbody>
<tbody>
<tr>
<tr>
<td>type_code</td>
<td>last_data_to_dds</td>
<td>datetime</td>
<td>DEFAULT NULL</td>
<td> COMMENT 'date time data was last sent to DDS',</td>
</tr>
<tr>
<td>publishing_software</td>
<td>varchar(50)</td>
<td>varchar(50)</td>
<td>DEFAULT NULL</td>
<td>NOT NULL</td>
<td> COMMENT 'The type of organisation',</td>
<td> COMMENT 'software name of publishing system, i.e. SystmOne',</td>
<td>  type_code varchar(50)  NULL COMMENT 'The type of organisation',</td>
</tr>
</tr>
<tr>
<tr>
<td>parent_organization_id</td>
<td>id</td>
<td>bigint</td>
<td>bigint</td>
<td>DEFAULT NULL</td>
<td>NOT NULL</td>
<td> COMMENT 'The id of the parent organisation',</td>
<td> COMMENT 'organisation ID, corresponds to same ID in the organizaton table',</td>
<td>  parent_organization_id bigint  NULL COMMENT 'The id of the parent organisation',</td>
</tr>
</tr>
<tr>
<tr>
<td>Postcode</td>
<td>last_data_cutoff</td>
<td>varchar(10)</td>
<td>datetime</td>
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> COMMENT 'The postcode of the organisation',</td>
<td> COMMENT 'cutoff date time of the last extract from the publishing system',</td>
<td>  Postcode varchar(10)  NULL COMMENT 'The postcode of the organisation',</td>
</tr>
</tr>
<tr>
<tr>
<td>ods_code</td>
<td>PRIMARY KEY CONSTRAINT(s) `id`,`publishing_software`)</td> </tr> </tbody>
<td>varchar(50)</td>
</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>
</tr>
<tbody>
<tr>
<td>date_of_death</td>
<td>date</td>
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> COMMENT 'ODS Code of the organisation',</td>
<td> COMMENT 'The date of death of the patient',</td>
<td>  ods_code varchar(50)  NULL COMMENT 'ODS Code of the organisation',</td>
</tr>
</tr>
<tr>
<tr>
<td>id</td>
<td>current_address_id</td>
<td>bigint</td>
<td>bigint</td>
<td>NOT NULL</td>
<td>DEFAULT NULL</td>
<td> COMMENT 'Unique Id of the organisation',</td>
<td> COMMENT 'Reference to the current address of the patient',</td>
<td>  id bigint NOT NULL COMMENT 'Unique Id of the organisation',</td>
</tr>
</tr>
<tr>
<tr>
<td>Name</td>
<td>date_of_birth</td>
<td>varchar(255)</td>
<td>date</td>
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> COMMENT 'Name of the organisation',</td>
<td> COMMENT 'The date of birth of the patient',</td>
<td>  Name varchar(255)  NULL COMMENT 'Name of the organisation',</td>
</tr>
</tr>
<tr>
<tr>
<td>type_desc</td>
<td>title</td>
<td>varchar(255)</td>
<td>varchar(255)</td>
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> COMMENT 'Textual description of the type of organisation eg GP Practice',</td>
<td> COMMENT 'The title of the patient',</td>
<td>  type_desc varchar(255)  NULL COMMENT 'Textual description of the type of organisation eg GP Practice',</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>id</td>
<td>person_id</td>
<td>bigint</td>
<td>bigint</td>
<td>NOT NULL</td>
<td>NOT NULL</td>
<td> COMMENT 'organisation ID, corresponds to same ID in the organizaton table',</td>
<td> COMMENT 'Unique individual across all organisations',</td>
<td>  id bigint NOT NULL COMMENT 'organisation ID, corresponds to same ID in the organizaton table',</td>
</tr>
</tr>
<tr>
<tr>
<td>last_data_to_dds</td>
<td>nhs_number</td>
<td>datetime</td>
<td>varchar(255)</td>
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> COMMENT 'date time data was last sent to DDS',</td>
<td> COMMENT 'The NHS number of the patient',</td>
<td>  last_data_to_dds datetime  NULL COMMENT 'date time data was last sent to DDS',</td>
</tr>
</tr>
<tr>
<tr>
<td>last_data_cutoff</td>
<td>gender_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> COMMENT 'Reference to the gender of the patient',</td>
<td>  last_data_cutoff datetime  NULL COMMENT 'cutoff date time of the last extract from the publishing system',</td>
</tr>
</tr>
<tr>
<tr>
<td>publishing_software</td>
<td>birth_week</td>
<td>varchar(50)</td>
<td>tinyint</td>
<td>NOT NULL</td>
<td>DEFAULT NULL,</td>
<td> COMMENT 'software name of publishing system, i.e. SystmOne',</td>
<td></td>
<td> publishing_software varchar(50) NOT NULL COMMENT 'software name of publishing system, i.e. SystmOne',</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>birth_month</td>
<td>first_names</td>
<td>tinyint</td>
<td>varchar(255)</td>
<td>DEFAULT NULL,</td>
<td>DEFAULT NULL</td>
<td></td>
<td> COMMENT 'The first names of the patient',</td>
<td>  birth_month tinyint  NULL,</td>
</tr>
</tr>
<tr>
<tr>
<td>birth_week</td>
<td>last_name</td>
<td>tinyint</td>
<td>varchar(255)</td>
<td>DEFAULT NULL,</td>
<td>DEFAULT NULL</td>
<td></td>
<td> COMMENT 'The last name of the patient',</td>
<td>  birth_week tinyint  NULL,</td>
</tr>
</tr>
<tr>
<tr>
<td>organization_id</td>
<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> COMMENT 'Unique Id of the patient',</td>
<td>  organization_id bigint NOT NULL COMMENT 'Owning organisation (i.e. publisher)',</td>
</tr>
</tr>
<tr>
<tr>
<td>id</td>
<td>organization_id</td>
<td>bigint</td>
<td>bigint</td>
<td>NOT NULL</td>
<td>NOT NULL</td>
<td> COMMENT 'Unique Id of the patient',</td>
<td> COMMENT 'Owning organisation (i.e. publisher)',</td>
<td>  id bigint NOT NULL COMMENT 'Unique Id of the patient',</td>
</tr>
</tr>
<tr>
<tr>
<td>first_names</td>
<td>birth_year</td>
<td>varchar(255)</td>
<td>smallint</td>
<td>DEFAULT NULL</td>
<td>DEFAULT NULL,</td>
<td> COMMENT 'The first names of the patient',</td>
<td></td>
<td> first_names varchar(255)  NULL COMMENT 'The first names of the patient',</td>
</tr>
</tr>
<tr>
<tr>
<td>current_address_id</td>
<td>ethnic_code_concept_id</td>
<td>bigint</td>
<td>int</td>
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> COMMENT 'Reference to the current address of the patient',</td>
<td> COMMENT 'Reference to the ethnicity of the patient',</td>
<td>  current_address_id bigint  NULL COMMENT 'Reference to the current address of the patient',</td>
</tr>
</tr>
<tr>
<tr>
<td>last_name</td>
<td>birth_month</td>
<td>varchar(255)</td>
<td>tinyint</td>
<td>DEFAULT NULL</td>
<td>DEFAULT NULL,</td>
<td> COMMENT 'The last name of the patient',</td>
<td></td>
<td> last_name varchar(255)  NULL COMMENT 'The last name of the patient',</td>
</tr>
</tr>
<tr>
<tr>
<td>date_of_birth</td>
<td>registered_practice_organization_id</td>
<td>date</td>
<td>bigint</td>
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> COMMENT 'The date of birth of the patient',</td>
<td> COMMENT 'Reference to the organisation the patient is registered at',</td>
<td>  date_of_birth date  NULL COMMENT 'The date of birth of the patient',</td>
</tr>
</tr>
<tr>
<tr>
<td>date_of_death</td>
<td>PRIMARY KEY CONSTRAINT(s) `organization_id`,`person_id`,`id`),</td> </tr> </tbody>
<td>date</td>
</table>
<td>DEFAULT NULL</td>
<h2><span class="mw-headline" id="Sortable_tables">patient_additional</span></h2>
<td> COMMENT 'The date of death of the patient',</td>
<table class="sortable" border="1" style="border-collapse:collapse">
<td> date_of_death date  NULL COMMENT 'The date of death of the patient',</td>
<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>
</tr>
<tbody>
<tr>
<td>json_value</td>
<td>json</td>
<td>DEFAULT NULL</td>
<td> COMMENT 'where there is no mapped value_id, just raw JSON',</td>
</tr>
</tr>
<tr>
<tr>
<td>title</td>
<td>id</td>
<td>varchar(255)</td>
<td>bigint</td>
<td>DEFAULT NULL</td>
<td>NOT NULL</td>
<td> COMMENT 'The title of the patient',</td>
<td> COMMENT 'same as the id column on the patient table ',</td>
<td>  title varchar(255)  NULL COMMENT 'The title of the patient',</td>
</tr>
</tr>
<tr>
<tr>
<td>nhs_number</td>
<td>property_id</td>
<td>varchar(255)</td>
<td>int</td>
<td>DEFAULT NULL</td>
<td>NOT NULL</td>
<td> COMMENT 'The NHS number of the patient',</td>
<td> COMMENT 'IM reference (e.g. Cause of death)',</td>
<td>  nhs_number varchar(255) NULL COMMENT 'The NHS number of the patient',</td>
</tr>
</tr>
<tr>
<tr>
<td>ethnic_code_concept_id</td>
<td>value_id</td>
<td>int</td>
<td>int</td>
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> COMMENT 'Reference to the ethnicity of the patient',</td>
<td> COMMENT 'IM reference (e.g. COVID)',</td>
<td>  ethnic_code_concept_id int  NULL COMMENT 'Reference to the ethnicity of the patient',</td>
</tr>
</tr>
<tr>
<tr>
<td>birth_year</td>
<td>text_value</td>
<td>smallint</td>
<td>varchar(255)</td>
<td>DEFAULT NULL,</td>
<td></td>
<td>  birth_year smallint  NULL,</td>
</tr>
<tr>
<td>person_id</td>
<td>bigint</td>
<td>NOT NULL</td>
<td> COMMENT 'Unique individual across all organisations',</td>
<td>  person_id bigint NOT NULL COMMENT 'Unique individual across all organisations',</td>
</tr>
<tr>
<td>gender_concept_id</td>
<td>int</td>
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> COMMENT 'Reference to the gender of the patient',</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>  gender_concept_id int  NULL COMMENT 'Reference to the gender of the patient',</td>
</tr>
</tr>
<tr>
<tr>
<td>registered_practice_organization_id</td>
<td>PRIMARY KEY CONSTRAINT(s) `id`,`property_id`),</td> </tr> </tbody>
<td>bigint</td>
<td>DEFAULT NULL</td>
<td> COMMENT 'Reference to the organisation the patient is registered at',</td>
<td>  registered_practice_organization_id bigint  NULL COMMENT 'Reference to the organisation the patient is registered at',</td>
</tr>
</tbody>
</table>
</table>
<h2><span class="mw-headline" id="Sortable_tables">Patient_additional</span></h2>
<h2><span class="mw-headline" id="Sortable_tables">patient_address</span></h2>
<table class="sortable" border="1" style="border-collapse:collapse">
<table class="sortable" border="1" style="border-collapse:collapse">
<tr>
<tr>
Line 1,917: Line 1,720:
<th scope="col" width="10%">Constraint</th>
<th scope="col" width="10%">Constraint</th>
<th scope="col" width="10%">Comment</th>
<th scope="col" width="10%">Comment</th>
<th scope="col" width="10%">Sql</th>
</tr>
</tr>
<tbody>
<tbody>
<tr>
<tr>
<td>text_value</td>
<td>address_line_2</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> COMMENT 'The second line of the address',</td>
<td>  text_value varchar(255)  NULL COMMENT 'where there is no mapped value_id or raw JSON, just a basic text value (i.e. GP Practitioner number)',</td>
</tr>
</tr>
<tr>
<tr>
<td>value_id</td>
<td>patient_id</td>
<td>int</td>
<td>bigint</td>
<td>DEFAULT NULL</td>
<td>NOT NULL</td>
<td> COMMENT 'IM reference (e.g. COVID)',</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>  value_id int  NULL COMMENT 'IM reference (e.g. COVID)',</td>
</tr>
</tr>
<tr>
<tr>
<td>id</td>
<td>lsoa_2001_code</td>
<td>bigint</td>
<td>varchar(9)</td>
<td>NOT NULL</td>
<td>DEFAULT NULL</td>
<td> COMMENT 'same as the id column on the patient table ',</td>
<td> COMMENT 'A reference to the LSOA_2001 code',</td>
<td>  id bigint NOT NULL COMMENT 'same as the id column on the patient table ',</td>
</tr>
</tr>
<tr>
<tr>
<td>property_id</td>
<td>city</td>
<td>int</td>
<td>varchar(255)</td>
<td>NOT NULL</td>
<td>DEFAULT NULL</td>
<td> COMMENT 'IM reference (e.g. Cause of death)',</td>
<td> COMMENT 'The city',</td>
<td>  property_id int NOT NULL COMMENT 'IM reference (e.g. Cause of death)',</td>
</tr>
</tr>
<tr>
<tr>
<td>json_value</td>
<td>address_line_4</td>
<td>json</td>
<td>varchar(255)</td>
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> COMMENT 'where there is no mapped value_id, just raw JSON',</td>
<td> COMMENT 'The fourth line of the address',</td>
<td>  json_value json  NULL COMMENT 'where there is no mapped value_id, just raw JSON',</td>
</tr>
</tr>
</tbody>
</table>
<h2><span class="mw-headline" id="Sortable_tables">Patient_address</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>start_date</td>
<td>msoa_2001_code</td>
<td>date</td>
<td>NOT NULL</td>
<td> COMMENT 'The start date of this address being relevant',</td>
<td>  start_date date NOT NULL COMMENT 'The start date of this address being relevant',</td>
</tr>
<tr>
<td>patient_id</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>msoa_2011_code</td>
<td>varchar(9)</td>
<td>varchar(9)</td>
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> COMMENT 'A reference to the MSOA_2011 code',</td>
<td> COMMENT 'A reference to the MSOA_2001 code',</td>
<td>  msoa_2011_code varchar(9)  NULL COMMENT 'A reference to the MSOA_2011 code',</td>
</tr>
</tr>
<tr>
<tr>
<td>address_line_4</td>
<td>postcode</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> COMMENT 'The postcode',</td>
<td>  address_line_4 varchar(255)  NULL COMMENT 'The fourth line of the address',</td>
</tr>
</tr>
<tr>
<tr>
<td>lsoa_2011_code</td>
<td>Id</td>
<td>varchar(9)</td>
<td>bigint</td>
<td>DEFAULT NULL</td>
<td>NOT NULL</td>
<td> COMMENT 'A reference to the LSOA_2011 code',</td>
<td> COMMENT 'Unique Id of the address',</td>
<td>  lsoa_2011_code varchar(9)  NULL COMMENT 'A reference to the LSOA_2011 code',</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> COMMENT 'Unique individual across all organisations',</td>
<td>  organization_id bigint NOT NULL COMMENT 'Owning organisation (i.e. publisher)',</td>
</tr>
</tr>
<tr>
<tr>
<td>city</td>
<td>address_line_3</td>
<td>varchar(255)</td>
<td>varchar(255)</td>
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> COMMENT 'The city',</td>
<td> COMMENT 'The third line of the address',</td>
<td>  city varchar(255)  NULL COMMENT 'The city',</td>
</tr>
</tr>
<tr>
<tr>
<td>lsoa_2001_code</td>
<td>townsend_deprivation_index</td>
<td>varchar(9)</td>
<td>double</td>
<td>DEFAULT NULL</td>
<td>DEFAULT NULL,</td>
<td> COMMENT 'A reference to the LSOA_2001 code',</td>
<td></td>
<td> lsoa_2001_code varchar(9)  NULL COMMENT 'A reference to the LSOA_2001 code',</td>
</tr>
</tr>
<tr>
<tr>
<td>local_authority_code</td>
<td>msoa_2011_code</td>
<td>varchar(9)</td>
<td>varchar(9)</td>
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> COMMENT 'The local authority the address belongs to',</td>
<td> COMMENT 'A reference to the MSOA_2011 code',</td>
<td>  local_authority_code varchar(9)  NULL COMMENT 'The local authority the address belongs to',</td>
</tr>
</tr>
<tr>
<tr>
<td>address_line_2</td>
<td>start_date</td>
<td>varchar(255)</td>
<td>date</td>
<td>DEFAULT NULL</td>
<td>NOT NULL</td>
<td> COMMENT 'The second line of the address',</td>
<td> COMMENT 'The start date of this address being relevant',</td>
<td>  address_line_2 varchar(255)  NULL COMMENT 'The second line of the address',</td>
</tr>
</tr>
<tr>
<tr>
Line 2,042: Line 1,805:
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> COMMENT 'The end date of this address being relevant',</td>
<td> COMMENT 'The end date of this address being relevant',</td>
<td>  end_date date  NULL COMMENT 'The end date of this address being relevant',</td>
</tr>
</tr>
<tr>
<tr>
<td>msoa_2001_code</td>
<td>ward_code</td>
<td>varchar(9)</td>
<td>varchar(9)</td>
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> COMMENT 'A reference to the MSOA_2001 code',</td>
<td> COMMENT 'The ward the address belongs to',</td>
<td>  msoa_2001_code varchar(9)  NULL COMMENT 'A reference to the MSOA_2001 code',</td>
</tr>
</tr>
<tr>
<tr>
<td>Id</td>
<td>use_concept_id</td>
<td>bigint</td>
<td>int</td>
<td>NOT NULL</td>
<td>NOT NULL</td>
<td> COMMENT 'Unique Id of the address',</td>
<td> COMMENT 'use of address (e.g. home, temporary)',</td>
<td>  Id bigint NOT NULL COMMENT 'Unique Id of the address',</td>
</tr>
</tr>
<tr>
<tr>
<td>address_line_3</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 third line of the address',</td>
<td> COMMENT 'The first line of the address',</td>
<td>  address_line_3 varchar(255)  NULL COMMENT 'The third line of the address',</td>
</tr>
</tr>
<tr>
<tr>
<td>use_concept_id</td>
<td>organization_id</td>
<td>int</td>
<td>bigint</td>
<td>NOT NULL</td>
<td>NOT NULL</td>
<td> COMMENT 'use of address (e.g. home, temporary)',</td>
<td> COMMENT 'Owning organisation (i.e. publisher)',</td>
<td>  use_concept_id int NOT NULL COMMENT 'use of address (e.g. home, temporary)',</td>
</tr>
</tr>
<tr>
<tr>
<td>postcode</td>
<td>lsoa_2011_code</td>
<td>varchar(255)</td>
<td>varchar(9)</td>
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> COMMENT 'The postcode',</td>
<td> COMMENT 'A reference to the LSOA_2011 code',</td>
<td>  postcode varchar(255)  NULL COMMENT 'The postcode',</td>
</tr>
</tr>
<tr>
<tr>
<td>ward_code</td>
<td>local_authority_code</td>
<td>varchar(9)</td>
<td>varchar(9)</td>
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> COMMENT 'The ward the address belongs to',</td>
<td> COMMENT 'The local authority the address belongs to',</td>
<td>  ward_code varchar(9)  NULL COMMENT 'The ward the address belongs to',</td>
</tr>
<tr>
<td>address_line_1</td>
<td>varchar(255)</td>
<td>DEFAULT NULL</td>
<td> COMMENT 'The first line of the address',</td>
<td>  address_line_1 varchar(255)  NULL COMMENT 'The first line of the address',</td>
</tr>
</tr>
<tr>
<tr>
<td>person_id</td>
<td>PRIMARY KEY CONSTRAINT(s) `organization_id`,`Id`,`patient_id`,`person_id`),</td> </tr> </tbody>
<td>bigint</td>
<td>NOT NULL</td>
<td> COMMENT 'Unique individual across all organisations',</td>
<td>  person_id bigint NOT NULL COMMENT 'Unique individual across all organisations',</td>
</tr>
<tr>
<td>townsend_deprivation_index</td>
<td>double</td>
<td>DEFAULT NULL,</td>
<td></td>
<td>  townsend_deprivation_index double  NULL,</td>
</tr>
</tbody>
</table>
</table>
<h2><span class="mw-headline" id="Sortable_tables">Patient_address_match</span></h2>
<h2><span class="mw-headline" id="Sortable_tables">patient_address_match</span></h2>
<table class="sortable" border="1" style="border-collapse:collapse">
<table class="sortable" border="1" style="border-collapse:collapse">
<tr>
<tr>
Line 2,116: Line 1,852:
<th scope="col" width="10%">Constraint</th>
<th scope="col" width="10%">Constraint</th>
<th scope="col" width="10%">Comment</th>
<th scope="col" width="10%">Comment</th>
<th scope="col" width="10%">Sql</th>
</tr>
</tr>
<tbody>
<tbody>
<tr>
<tr>
<td>patient_address_id</td>
<td>latitude</td>
<td>bigint</td>
<td>double</td>
<td>NOT NULL,</td>
<td></td>
<td>  patient_address_id bigint NOT NULL,</td>
</tr>
<tr>
<td>match_date</td>
<td>datetime</td>
<td>DEFAULT NULL,</td>
<td>DEFAULT NULL,</td>
<td></td>
<td></td>
<td>  match_date datetime  NULL,</td>
</tr>
</tr>
<tr>
<tr>
<td>abp_address_locality</td>
<td>match_pattern_street</td>
<td>varchar(255)</td>
<td>varchar(255)</td>
<td>CHARACTER SET</td>
<td>CHARACTER SET</td>
<td> utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL,</td>
<td> utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL,</td>
<td>  abp_address_locality varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci  NULL,</td>
</tr>
</tr>
<tr>
<tr>
<td>status</td>
<td>abp_address_postcode</td>
<td>tinyint(1)</td>
<td>varchar(10)</td>
<td>DEFAULT NULL,</td>
<td></td>
<td>  status tinyint(1)  NULL,</td>
</tr>
<tr>
<td>match_pattern_street</td>
<td>varchar(255)</td>
<td>CHARACTER SET</td>
<td>CHARACTER SET</td>
<td> utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL,</td>
<td> utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL,</td>
<td>  match_pattern_street varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci  NULL,</td>
</tr>
</tr>
<tr>
<tr>
<td>id</td>
<td>abp_address_organization</td>
<td>bigint</td>
<td>NOT NULL</td>
<td> AUTO_INCREMENT,</td>
<td>  id bigint NOT NULL AUTO_INCREMENT,</td>
</tr>
<tr>
<td>match_pattern_postcode</td>
<td>varchar(255)</td>
<td>varchar(255)</td>
<td>CHARACTER SET</td>
<td>CHARACTER SET</td>
<td> utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL,</td>
<td> utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL,</td>
<td>  match_pattern_postcode varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci  NULL,</td>
</tr>
</tr>
<tr>
<tr>
<td>uprn_property_classification</td>
<td>abp_address_street</td>
<td>varchar(45)</td>
<td>varchar(255)</td>
<td>CHARACTER SET</td>
<td>CHARACTER SET</td>
<td> utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL,</td>
<td> utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL,</td>
<td>  uprn_property_classification varchar(45) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci  NULL,</td>
</tr>
</tr>
<tr>
<tr>
<td>abp_address_town</td>
<td>longitude</td>
<td>double</td>
<td>DEFAULT NULL,</td>
<td></td>
</tr>
<tr>
<td>match_date</td>
<td>datetime</td>
<td>DEFAULT NULL,</td>
<td></td>
</tr>
<tr>
<td>match_pattern_postcode</td>
<td>varchar(255)</td>
<td>varchar(255)</td>
<td>CHARACTER SET</td>
<td>CHARACTER SET</td>
<td> utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL,</td>
<td> utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL,</td>
<td>  abp_address_town varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci  NULL,</td>
</tr>
</tr>
<tr>
<tr>
<td>algorithm_version</td>
<td>patient_address_id</td>
<td>varchar(255)</td>
<td>bigint</td>
<td>NOT NULL,</td>
<td></td>
</tr>
<tr>
<td>qualifier</td>
<td>varchar(50)</td>
<td>CHARACTER SET</td>
<td>CHARACTER SET</td>
<td> utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL,</td>
<td> utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL,</td>
<td>  algorithm_version varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci  NULL,</td>
</tr>
</tr>
<tr>
<tr>
<td>qualifier</td>
<td>algorithm_version</td>
<td>varchar(50)</td>
<td>varchar(255)</td>
<td>CHARACTER SET</td>
<td>CHARACTER SET</td>
<td> utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL,</td>
<td> utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL,</td>
<td>  qualifier varchar(50) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci  NULL,</td>
</tr>
</tr>
<tr>
<tr>
<td>uprn_ycoordinate</td>
<td>uprn_xcoordinate</td>
<td>double</td>
<td>double</td>
<td>DEFAULT NULL,</td>
<td>DEFAULT NULL,</td>
<td></td>
<td></td>
<td>  uprn_ycoordinate double  NULL,</td>
</tr>
</tr>
<tr>
<tr>
<td>uprn_ralf00</td>
<td>uprn_ycoordinate</td>
<td>varchar(255)</td>
<td>double</td>
<td>DEFAULT NULL,</td>
<td>DEFAULT NULL,</td>
<td></td>
<td></td>
<td>  uprn_ralf00 varchar(255)  NULL,</td>
</tr>
</tr>
<tr>
<tr>
<td>abp_address_street</td>
<td>match_pattern_building</td>
<td>varchar(255)</td>
<td>varchar(255)</td>
<td>CHARACTER SET</td>
<td>CHARACTER SET</td>
<td> utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL,</td>
<td> utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL,</td>
<td>  abp_address_street varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci  NULL,</td>
</tr>
</tr>
<tr>
<tr>
<td>uprn_xcoordinate</td>
<td>uprn_property_classification</td>
<td>double</td>
<td>varchar(45)</td>
<td>CHARACTER SET</td>
<td> utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL,</td>
</tr>
<tr>
<td>status</td>
<td>tinyint(1)</td>
<td>DEFAULT NULL,</td>
<td>DEFAULT NULL,</td>
<td></td>
<td></td>
<td>  uprn_xcoordinate double  NULL,</td>
</tr>
</tr>
<tr>
<tr>
<td>abp_address_postcode</td>
<td>abp_address_locality</td>
<td>varchar(10)</td>
<td>varchar(255)</td>
<td>CHARACTER SET</td>
<td>CHARACTER SET</td>
<td> utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL,</td>
<td> utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL,</td>
<td>  abp_address_postcode varchar(10) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci  NULL,</td>
</tr>
</tr>
<tr>
<tr>
<td>epoch</td>
<td>uprn</td>
<td>varchar(255)</td>
<td>varchar(255)</td>
<td>CHARACTER SET</td>
<td>CHARACTER SET</td>
<td> utf8mb3 COLLATE utf8mb3_bin DEFAULT NULL,</td>
<td> utf8mb3 COLLATE utf8mb3_bin DEFAULT NULL,</td>
<td>  epoch varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_bin  NULL,</td>
</tr>
</tr>
<tr>
<tr>
<td>latitude</td>
<td>id</td>
<td>double</td>
<td>bigint</td>
<td>DEFAULT NULL,</td>
<td>NOT NULL</td>
<td></td>
<td> AUTO_INCREMENT,</td>
<td>  latitude double  NULL,</td>
</tr>
</tr>
<tr>
<tr>
Line 2,250: Line 1,973:
<td>CHARACTER SET</td>
<td>CHARACTER SET</td>
<td> utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL,</td>
<td> utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL,</td>
<td>  match_pattern_number varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci  NULL,</td>
</tr>
</tr>
<tr>
<tr>
Line 2,257: Line 1,979:
<td>CHARACTER SET</td>
<td>CHARACTER SET</td>
<td> utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL,</td>
<td> utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL,</td>
<td>  match_rule varchar(4096) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci  NULL,</td>
</tr>
</tr>
<tr>
<tr>
<td>match_pattern_flat</td>
<td>uprn_ralf00</td>
<td>varchar(255)</td>
<td>varchar(255)</td>
<td>CHARACTER SET</td>
<td>DEFAULT NULL,</td>
<td> utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL,</td>
<td></td>
<td> match_pattern_flat varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci  NULL,</td>
</tr>
</tr>
<tr>
<tr>
<td>abp_address_number</td>
<td>abp_address_town</td>
<td>varchar(255)</td>
<td>varchar(255)</td>
<td>CHARACTER SET</td>
<td>CHARACTER SET</td>
<td> utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL,</td>
<td> utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL,</td>
<td>  abp_address_number varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci  NULL,</td>
</tr>
</tr>
<tr>
<tr>
<td>abp_address_organization</td>
<td>epoch</td>
<td>varchar(255)</td>
<td>varchar(255)</td>
<td>CHARACTER SET</td>
<td>CHARACTER SET</td>
<td> utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL,</td>
<td> utf8mb3 COLLATE utf8mb3_bin DEFAULT NULL,</td>
<td>  abp_address_organization varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci  NULL,</td>
</tr>
</tr>
<tr>
<tr>
<td>longitude</td>
<td>match_pattern_flat</td>
<td>double</td>
<td>DEFAULT NULL,</td>
<td></td>
<td>  longitude double  NULL,</td>
</tr>
<tr>
<td>match_pattern_building</td>
<td>varchar(255)</td>
<td>varchar(255)</td>
<td>CHARACTER SET</td>
<td>CHARACTER SET</td>
<td> utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL,</td>
<td> utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL,</td>
<td>  match_pattern_building varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci  NULL,</td>
</tr>
</tr>
<tr>
<tr>
<td>uprn</td>
<td>abp_address_number</td>
<td>varchar(255)</td>
<td>varchar(255)</td>
<td>CHARACTER SET</td>
<td>CHARACTER SET</td>
<td> utf8mb3 COLLATE utf8mb3_bin DEFAULT NULL,</td>
<td> utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL,</td>
<td>  uprn varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_bin  NULL,</td>
</tr>
</tr>
</tbody>
<tr>
<td>PRIMARY KEY CONSTRAINT(s) `id`),</td> </tr> </tbody>
</table>
</table>
<h2><span class="mw-headline" id="Sortable_tables">Patient_address_ralf</span></h2>
<h2><span class="mw-headline" id="Sortable_tables">patient_address_ralf</span></h2>
<table class="sortable" border="1" style="border-collapse:collapse">
<table class="sortable" border="1" style="border-collapse:collapse">
<tr>
<tr>
Line 2,310: Line 2,020:
<th scope="col" width="10%">Constraint</th>
<th scope="col" width="10%">Constraint</th>
<th scope="col" width="10%">Comment</th>
<th scope="col" width="10%">Comment</th>
<th scope="col" width="10%">Sql</th>
</tr>
</tr>
<tbody>
<tbody>
<tr>
<tr>
<td>patient_address_id</td>
<td>organization_id</td>
<td>bigint</td>
<td>bigint</td>
<td>NOT NULL,</td>
<td>NOT NULL,</td>
<td></td>
<td></td>
<td>  patient_address_id bigint NOT NULL,</td>
</tr>
</tr>
<tr>
<tr>
<td>salt_name</td>
<td>patient_address_match_uprn_ralf00</td>
<td>varchar(50)</td>
<td>varchar(255)</td>
<td>NOT NULL,</td>
<td>NOT NULL,</td>
<td></td>
<td></td>
<td>  salt_name varchar(50) NOT NULL,</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></td>
<td></td>
<td>  organization_id bigint NOT NULL,</td>
</tr>
</tr>
<tr>
<tr>
<td>id</td>
<td>ralf</td>
<td>bigint</td>
<td>varchar(255)</td>
<td>NOT NULL,</td>
<td>NOT NULL,</td>
<td></td>
<td></td>
<td>  id bigint NOT NULL,</td>
</tr>
</tr>
<tr>
<tr>
<td>person_id</td>
<td>patient_id</td>
<td>bigint</td>
<td>bigint</td>
<td>NOT NULL,</td>
<td>NOT NULL,</td>
<td></td>
<td></td>
<td>  person_id bigint NOT NULL,</td>
</tr>
</tr>
<tr>
<tr>
<td>patient_address_match_uprn_ralf00</td>
<td>patient_address_id</td>
<td>varchar(255)</td>
<td>bigint</td>
<td>NOT NULL,</td>
<td>NOT NULL,</td>
<td></td>
<td></td>
<td>  patient_address_match_uprn_ralf00 varchar(255) NOT NULL,</td>
</tr>
</tr>
<tr>
<tr>
<td>patient_id</td>
<td>salt_name</td>
<td>bigint</td>
<td>varchar(50)</td>
<td>NOT NULL,</td>
<td>NOT NULL,</td>
<td></td>
<td></td>
<td>  patient_id bigint NOT NULL,</td>
</tr>
</tr>
<tr>
<tr>
<td>ralf</td>
<td>id</td>
<td>varchar(255)</td>
<td>bigint</td>
<td>NOT NULL,</td>
<td>NOT NULL,</td>
<td></td>
<td></td>
<td>  ralf varchar(255) NOT NULL,</td>
</tr>
</tr>
</tbody>
<tr>
<td>PRIMARY KEY CONSTRAINT(s) `id`,`patient_address_id`,`patient_address_match_uprn_ralf00`),</td> </tr> </tbody>
</table>
</table>
<h2><span class="mw-headline" id="Sortable_tables">Patient_contact</span></h2>
<h2><span class="mw-headline" id="Sortable_tables">patient_contact</span></h2>
<table class="sortable" border="1" style="border-collapse:collapse">
<table class="sortable" border="1" style="border-collapse:collapse">
<tr>
<tr>
Line 2,378: Line 2,080:
<th scope="col" width="10%">Constraint</th>
<th scope="col" width="10%">Constraint</th>
<th scope="col" width="10%">Comment</th>
<th scope="col" width="10%">Comment</th>
<th scope="col" width="10%">Sql</th>
</tr>
</tr>
<tbody>
<tbody>
<tr>
<td>value</td>
<td>varchar(255)</td>
<td>DEFAULT NULL</td>
<td> COMMENT 'The value of the contact information eg phone number, email address',</td>
</tr>
<tr>
<tr>
<td>patient_id</td>
<td>patient_id</td>
Line 2,386: Line 2,093:
<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> 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>
<tr>
<tr>
<td>start_date</td>
<td>end_date</td>
<td>date</td>
<td>date</td>
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> COMMENT 'The start date of the contact being valid',</td>
<td> COMMENT 'The end date of the contact being valid',</td>
<td>  start_date date  NULL COMMENT 'The start date of the contact being valid',</td>
</tr>
</tr>
<tr>
<tr>
<td>value</td>
<td>organization_id</td>
<td>varchar(255)</td>
<td>bigint</td>
<td>DEFAULT NULL</td>
<td>NOT NULL</td>
<td> COMMENT 'The value of the contact information eg phone number, email address',</td>
<td> COMMENT 'Owning organisation (i.e. publisher)',</td>
<td>  value varchar(255) NULL COMMENT 'The value of the contact information eg phone number, email address',</td>
</tr>
</tr>
<tr>
<tr>
<td>use_concept_id</td>
<td>person_id</td>
<td>int</td>
<td>bigint</td>
<td>NOT NULL</td>
<td> COMMENT 'Unique individual across all organisations',</td>
</tr>
<tr>
<td>id</td>
<td>bigint</td>
<td>NOT NULL</td>
<td> COMMENT 'Unique Id of the patient contact',</td>
</tr>
<tr>
<td>use_concept_id</td>
<td>int</td>
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> COMMENT 'use of contact (e.g. mobile, home,work',</td>
<td> COMMENT 'use of contact (e.g. mobile, home,work',</td>
<td>  use_concept_id int  NULL COMMENT 'use of contact (e.g. mobile, home,work',</td>
</tr>
</tr>
<tr>
<tr>
Line 2,414: Line 2,129:
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> COMMENT 'type of contact (e.g. phone, email)',</td>
<td> COMMENT 'type of contact (e.g. phone, email)',</td>
<td>  type_concept_id int  NULL COMMENT 'type of contact (e.g. phone, email)',</td>
</tr>
</tr>
<tr>
<tr>
<td>organization_id</td>
<td>start_date</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>
<td>end_date</td>
<td>date</td>
<td>date</td>
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> COMMENT 'The end date of the contact being valid',</td>
<td> COMMENT 'The start date of the contact being valid',</td>
<td>  end_date date  NULL COMMENT 'The end date of the contact being valid',</td>
</tr>
</tr>
<tr>
<tr>
<td>id</td>
<td>PRIMARY KEY CONSTRAINT(s) `organization_id`,`id`,`patient_id`,`person_id`),</td> </tr> </tbody>
<td>bigint</td>
<td>NOT NULL</td>
<td> COMMENT 'Unique Id of the patient contact',</td>
<td>  id bigint NOT NULL COMMENT 'Unique Id of the patient contact',</td>
</tr>
<tr>
<td>person_id</td>
<td>bigint</td>
<td>NOT NULL</td>
<td> COMMENT 'Unique individual across all organisations',</td>
<td>  person_id bigint NOT NULL COMMENT 'Unique individual across all organisations',</td>
</tr>
</tbody>
</table>
</table>
<h2><span class="mw-headline" id="Sortable_tables">Patient_pseudo_id</span></h2>
<h2><span class="mw-headline" id="Sortable_tables">patient_pseudo_id</span></h2>
<table class="sortable" border="1" style="border-collapse:collapse">
<table class="sortable" border="1" style="border-collapse:collapse">
<tr>
<tr>
Line 2,453: Line 2,146:
<th scope="col" width="10%">Constraint</th>
<th scope="col" width="10%">Constraint</th>
<th scope="col" width="10%">Comment</th>
<th scope="col" width="10%">Comment</th>
<th scope="col" width="10%">Sql</th>
</tr>
</tr>
<tbody>
<tbody>
<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 patient pseudo id',</td>
<td> COMMENT 'Reference to the person this registration status history belongs to',</td>
<td>  id bigint NOT NULL COMMENT 'Unique Id of the patient pseudo id',</td>
</tr>
</tr>
<tr>
<tr>
<td>Skid</td>
<td>is_nhs_number_verified_by_publisher</td>
<td>varchar(255)</td>
<td>tinyint(1)</td>
<td>NOT NULL</td>
<td>NOT 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> COMMENT 'Whether the nhs number has been verified by the publisher',</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>
</tr>
</tr>
<tr>
<tr>
<td>salt_name</td>
<td>id</td>
<td>varchar(50)</td>
<td>bigint</td>
<td>NOT NULL</td>
<td>NOT NULL</td>
<td> COMMENT 'The name of the salt used to create the pseudo id',</td>
<td> COMMENT 'Unique Id of the patient pseudo id',</td>
<td>  salt_name varchar(50) NOT NULL COMMENT 'The name of the salt used to create the pseudo id',</td>
</tr>
</tr>
<tr>
<tr>
Line 2,482: Line 2,171:
<td>NOT NULL</td>
<td>NOT NULL</td>
<td> COMMENT 'Owning organisation (i.e. publisher)',</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>
<td>person_id</td>
<td>Skid</td>
<td>bigint</td>
<td>varchar(255)</td>
<td>NOT NULL</td>
<td>NOT NULL</td>
<td> COMMENT 'Reference to the person this registration status history belongs to',</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>  person_id bigint NOT NULL COMMENT 'Reference to the person this registration status history belongs to',</td>
</tr>
<tr>
<td>is_nhs_number_valid</td>
<td>tinyint(1)</td>
<td>NOT NULL</td>
<td> COMMENT 'Whether the nhs number is valid',</td>
<td>  is_nhs_number_valid tinyint(1) NOT NULL COMMENT 'Whether the nhs number is valid',</td>
</tr>
</tr>
<tr>
<tr>
Line 2,503: Line 2,183:
<td>NOT NULL</td>
<td>NOT NULL</td>
<td> COMMENT 'Reference to the patient this registration status history belongs to',</td>
<td> COMMENT 'Reference to the patient this registration status history belongs to',</td>
<td>  patient_id bigint NOT NULL COMMENT 'Reference to the patient this registration status history belongs to',</td>
</tr>
</tr>
<tr>
<tr>
<td>is_nhs_number_verified_by_publisher</td>
<td>salt_name</td>
<td>tinyint(1)</td>
<td>varchar(50)</td>
<td>NOT NULL</td>
<td>NOT NULL</td>
<td> COMMENT 'Whether the nhs number has been verified by the publisher',</td>
<td> COMMENT 'The name of the salt used to create the pseudo id',</td>
<td>  is_nhs_number_verified_by_publisher tinyint(1) NOT NULL COMMENT 'Whether the nhs number has been verified by the publisher',</td>
</tr>
</tr>
</tbody>
<tr>
<td>is_nhs_number_valid</td>
<td>tinyint(1)</td>
<td>NOT NULL</td>
<td> COMMENT 'Whether the nhs number is valid',</td>
</tr>
<tr>
<td>PRIMARY KEY CONSTRAINT(s) `organization_id`,`person_id`,`id`),</td> </tr> </tbody>
</table>
</table>
<h2><span class="mw-headline" id="Sortable_tables">Patient_uprn</span></h2>
<h2><span class="mw-headline" id="Sortable_tables">patient_uprn</span></h2>
<table class="sortable" border="1" style="border-collapse:collapse">
<table class="sortable" border="1" style="border-collapse:collapse">
<tr>
<tr>
Line 2,521: Line 2,206:
<th scope="col" width="10%">Constraint</th>
<th scope="col" width="10%">Constraint</th>
<th scope="col" width="10%">Comment</th>
<th scope="col" width="10%">Comment</th>
<th scope="col" width="10%">Sql</th>
</tr>
</tr>
<tbody>
<tbody>
Line 2,529: Line 2,213:
<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> 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>
<tr>
<tr>
<td>uprn</td>
<td>match</td>
<td>bigint</td>
<td>DEFAULT NULL,</td>
<td></td>
<td>  uprn bigint  NULL,</td>
</tr>
<tr>
<td>algorithm</td>
<td>varchar(255)</td>
<td>varchar(255)</td>
<td>DEFAULT NULL,</td>
<td>DEFAULT NULL,</td>
<td></td>
<td></td>
<td>  algorithm varchar(255)  NULL,</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> COMMENT 'Unique individual across all organisations',</td>
<td>  organization_id bigint NOT NULL COMMENT 'Owning organisation (i.e. publisher)',</td>
</tr>
</tr>
<tr>
<tr>
<td>match</td>
<td>algorithm</td>
<td>varchar(255)</td>
<td>varchar(255)</td>
<td>DEFAULT NULL,</td>
<td>DEFAULT NULL,</td>
<td></td>
<td></td>
<td>  match varchar(255)  NULL,</td>
</tr>
</tr>
<tr>
<tr>
Line 2,564: Line 2,237:
<td>DEFAULT NULL,</td>
<td>DEFAULT NULL,</td>
<td></td>
<td></td>
<td>  no_address tinyint(1)  NULL,</td>
</tr>
</tr>
<tr>
<tr>
<td>invalid_postcode</td>
<td>uprn</td>
<td>tinyint(1)</td>
<td>bigint</td>
<td>DEFAULT NULL,</td>
<td>DEFAULT NULL,</td>
<td></td>
<td></td>
<td>  invalid_postcode tinyint(1)  NULL,</td>
</tr>
</tr>
<tr>
<tr>
<td>missing_postcode</td>
<td>qualifier</td>
<td>tinyint(1)</td>
<td>varchar(50)</td>
<td>DEFAULT NULL,</td>
<td>DEFAULT NULL,</td>
<td></td>
<td></td>
<td>  missing_postcode tinyint(1)  NULL,</td>
</tr>
</tr>
<tr>
<tr>
<td>invalid_address</td>
<td>missing_postcode</td>
<td>tinyint(1)</td>
<td>tinyint(1)</td>
<td>DEFAULT NULL,</td>
<td>DEFAULT NULL,</td>
<td></td>
<td></td>
<td>  invalid_address tinyint(1)  NULL,</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 'Unique individual across all organisations',</td>
<td> COMMENT 'Owning organisation (i.e. publisher)',</td>
<td> person_id bigint NOT NULL COMMENT 'Unique individual across all organisations',</td>
</tr>
<tr>
<td>invalid_address</td>
<td>tinyint(1)</td>
<td>DEFAULT NULL,</td>
<td></td>
</tr>
</tr>
<tr>
<tr>
<td>qualifier</td>
<td>invalid_postcode</td>
<td>varchar(50)</td>
<td>tinyint(1)</td>
<td>DEFAULT NULL,</td>
<td>DEFAULT NULL,</td>
<td></td>
<td></td>
<td>  qualifier varchar(50)  NULL,</td>
</tr>
</tr>
</tbody>
<tr>
<td>PRIMARY KEY CONSTRAINT(s) `organization_id`,`person_id`,`patient_id`),</td> </tr> </tbody>
</table>
</table>
<h2><span class="mw-headline" id="Sortable_tables">Person</span></h2>
<h2><span class="mw-headline" id="Sortable_tables">person</span></h2>
<table class="sortable" border="1" style="border-collapse:collapse">
<table class="sortable" border="1" style="border-collapse:collapse">
<tr>
<tr>
Line 2,610: Line 2,284:
<th scope="col" width="10%">Constraint</th>
<th scope="col" width="10%">Constraint</th>
<th scope="col" width="10%">Comment</th>
<th scope="col" width="10%">Comment</th>
<th scope="col" width="10%">Sql</th>
</tr>
</tr>
<tbody>
<tbody>
<tr>
<td>last_name</td>
<td>varchar(255)</td>
<td>DEFAULT NULL</td>
<td> COMMENT 'The last name of the person',</td>
</tr>
<tr>
<tr>
<td>title</td>
<td>title</td>
Line 2,618: Line 2,297:
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> COMMENT 'The title of the person',</td>
<td> COMMENT 'The title of the person',</td>
<td>  title varchar(255)  NULL COMMENT 'The title of the person',</td>
</tr>
</tr>
<tr>
<tr>
<td>birth_month</td>
<td>date_of_death</td>
<td>tinyint</td>
<td>date</td>
<td>DEFAULT NULL,</td>
<td>DEFAULT NULL</td>
<td></td>
<td> COMMENT 'The date of death of the person',</td>
<td>  birth_month tinyint  NULL,</td>
</tr>
</tr>
<tr>
<tr>
<td>birth_week</td>
<td>registered_practice_organization_id</td>
<td>tinyint</td>
<td>bigint</td>
<td>DEFAULT NULL,</td>
<td>DEFAULT NULL</td>
<td></td>
<td> COMMENT 'Reference to the organisation the person is registered at',</td>
<td>  birth_week tinyint  NULL,</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>
<td>gender_concept_id</td>
<td>int</td>
<td>DEFAULT NULL</td>
<td> COMMENT 'Reference to the gender of the person',</td>
<td>  gender_concept_id int  NULL COMMENT 'Reference to the gender of the person',</td>
</tr>
</tr>
<tr>
<tr>
Line 2,653: Line 2,315:
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> COMMENT 'The date of birth of the person',</td>
<td> COMMENT 'The date of birth of the person',</td>
<td>  date_of_birth date  NULL COMMENT 'The date of birth of the person',</td>
</tr>
</tr>
<tr>
<tr>
<td>first_names</td>
<td>birth_week</td>
<td>varchar(255)</td>
<td>tinyint</td>
<td>DEFAULT NULL</td>
<td>DEFAULT NULL,</td>
<td> COMMENT 'The first names of the person',</td>
<td></td>
<td> first_names varchar(255)  NULL COMMENT 'The first names of the person',</td>
</tr>
</tr>
<tr>
<tr>
Line 2,667: Line 2,327:
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> COMMENT 'The NHS number of the person',</td>
<td> COMMENT 'The NHS number of the person',</td>
<td>  nhs_number varchar(255)  NULL COMMENT 'The NHS number of the person',</td>
</tr>
</tr>
<tr>
<tr>
<td>ethnic_code_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 ethnicity of the person',</td>
<td> COMMENT 'Owning organisation (i.e. publisher)',</td>
<td>  ethnic_code_concept_id int  NULL COMMENT 'Reference to the ethnicity of the person',</td>
</tr>
</tr>
<tr>
<tr>
<td>last_name</td>
<td>first_names</td>
<td>varchar(255)</td>
<td>varchar(255)</td>
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> COMMENT 'The last name of the person',</td>
<td> COMMENT 'The first names of the person',</td>
<td>  last_name varchar(255)  NULL COMMENT 'The last name of the person',</td>
</tr>
</tr>
<tr>
<tr>
Line 2,688: Line 2,345:
<td>DEFAULT NULL,</td>
<td>DEFAULT NULL,</td>
<td></td>
<td></td>
<td>  birth_year smallint  NULL,</td>
</tr>
</tr>
<tr>
<tr>
<td>date_of_death</td>
<td>ethnic_code_concept_id</td>
<td>date</td>
<td>int</td>
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> COMMENT 'The date of death of the person',</td>
<td> COMMENT 'Reference to the ethnicity of the person',</td>
<td>  date_of_death date  NULL COMMENT 'The date of death of the person',</td>
</tr>
</tr>
<tr>
<tr>
<td>current_address_id</td>
<td>id</td>
<td>bigint</td>
<td>bigint</td>
<td>NOT NULL</td>
<td>NOT NULL</td>
<td> COMMENT 'Reference to the current address of the person',</td>
<td> COMMENT 'Unique Id of the person',</td>
<td>  current_address_id bigint NOT NULL COMMENT 'Reference to the current address of the person',</td>
</tr>
</tr>
<tr>
<tr>
<td>id</td>
<td>current_address_id</td>
<td>bigint</td>
<td>bigint</td>
<td>NOT NULL</td>
<td>NOT NULL</td>
<td> COMMENT 'Unique Id of the person',</td>
<td> COMMENT 'Reference to the current address of the person',</td>
<td>  id bigint NOT NULL COMMENT 'Unique Id of the person',</td>
</tr>
</tr>
<tr>
<tr>
<td>registered_practice_organization_id</td>
<td>gender_concept_id</td>
<td>bigint</td>
<td>int</td>
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> COMMENT 'Reference to the organisation the person is registered at',</td>
<td> COMMENT 'Reference to the gender of the person',</td>
<td> registered_practice_organization_id bigint  NULL COMMENT 'Reference to the organisation the person is registered at',</td>
</tr>
<tr>
<td>birth_month</td>
<td>tinyint</td>
<td>DEFAULT NULL,</td>
<td></td>
</tr>
</tr>
</tbody>
<tr>
<td>PRIMARY KEY CONSTRAINT(s) `id`),</td> </tr> </tbody>
</table>
</table>
<h2><span class="mw-headline" id="Sortable_tables">Practitioner</span></h2>
<h2><span class="mw-headline" id="Sortable_tables">practitioner</span></h2>
<table class="sortable" border="1" style="border-collapse:collapse">
<table class="sortable" border="1" style="border-collapse:collapse">
<tr>
<tr>
Line 2,727: Line 2,386:
<th scope="col" width="10%">Constraint</th>
<th scope="col" width="10%">Constraint</th>
<th scope="col" width="10%">Comment</th>
<th scope="col" width="10%">Comment</th>
<th scope="col" width="10%">Sql</th>
</tr>
</tr>
<tbody>
<tbody>
<tr>
<tr>
<td>organization_id</td>
<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> COMMENT 'Unique Id of the practitioner',</td>
<td>  organization_id bigint NOT NULL COMMENT 'Owning organisation (i.e. publisher)',</td>
</tr>
</tr>
<tr>
<tr>
Line 2,742: Line 2,399:
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> COMMENT 'Name of the practitioner',</td>
<td> COMMENT 'Name of the practitioner',</td>
<td>  name varchar(1024)  NULL COMMENT 'Name of the practitioner',</td>
</tr>
</tr>
<tr>
<tr>
<td>role_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 role of the practitioner eg General Medical Practitioner',</td>
<td> COMMENT 'Owning organisation (i.e. publisher)',</td>
<td>  role_desc varchar(255) NULL COMMENT 'Textual description of the role of the practitioner eg General Medical Practitioner',</td>
</tr>
</tr>
<tr>
<tr>
Line 2,756: Line 2,411:
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> COMMENT 'The GMC code of the practitioner',</td>
<td> COMMENT 'The GMC code of the practitioner',</td>
<td>  gmc_code varchar(50)  NULL COMMENT 'The GMC code of the practitioner',</td>
</tr>
<tr>
<td>id</td>
<td>bigint</td>
<td>NOT NULL</td>
<td> COMMENT 'Unique Id of the practitioner',</td>
<td>  id bigint NOT NULL COMMENT 'Unique Id of the practitioner',</td>
</tr>
</tr>
<tr>
<tr>
Line 2,770: Line 2,417:
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> COMMENT 'The code representing the role of the practitioner',</td>
<td> COMMENT 'The code representing the role of the practitioner',</td>
<td>  role_code varchar(50)  NULL COMMENT 'The code representing the role of the practitioner',</td>
</tr>
</tr>
</tbody>
<tr>
<td>role_desc</td>
<td>varchar(255)</td>
<td>DEFAULT NULL</td>
<td> COMMENT 'Textual description of the role of the practitioner eg General Medical Practitioner',</td>
</tr>
<tr>
<td>PRIMARY KEY CONSTRAINT(s) `id`),</td> </tr> </tbody>
</table>
</table>
<h2><span class="mw-headline" id="Sortable_tables">Procedure_request</span></h2>
<h2><span class="mw-headline" id="Sortable_tables">procedure_request</span></h2>
<table class="sortable" border="1" style="border-collapse:collapse">
<table class="sortable" border="1" style="border-collapse:collapse">
<tr>
<tr>
Line 2,781: Line 2,434:
<th scope="col" width="10%">Constraint</th>
<th scope="col" width="10%">Constraint</th>
<th scope="col" width="10%">Comment</th>
<th scope="col" width="10%">Comment</th>
<th scope="col" width="10%">Sql</th>
</tr>
</tr>
<tbody>
<tbody>
<tr>
<td>clinical_effective_date</td>
<td>date</td>
<td>DEFAULT NULL</td>
<td> COMMENT 'The date the procedure was administered by a clinician',</td>
</tr>
<tr>
<tr>
<td>patient_id</td>
<td>patient_id</td>
Line 2,789: Line 2,447:
<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> 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>
<tr>
<tr>
<td>age_at_event</td>
<td>core_concept_id</td>
<td>decimal(5,2)</td>
<td>int</td>
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> COMMENT 'The age of the patient at the time of the procedure',</td>
<td> COMMENT 'Reference to the clinical coding of the procedure',</td>
<td>  age_at_event decimal(5,2)  NULL COMMENT 'The age of the patient at the time of the procedure',</td>
</tr>
</tr>
<tr>
<tr>
<td>encounter_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 encounter the procedure was administered at',</td>
<td> COMMENT 'Unique individual across all organisations',</td>
<td>  encounter_id bigint  NULL COMMENT 'Reference to the encounter the procedure was administered at',</td>
</tr>
</tr>
<tr>
<tr>
Line 2,810: Line 2,465:
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> COMMENT 'The clinician the activity is recorded against',</td>
<td> COMMENT 'The clinician the activity is recorded against',</td>
<td>  practitioner_id bigint  NULL COMMENT 'The clinician the activity is recorded against',</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 procedure',</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>  non_core_concept_id int  NULL COMMENT 'Reference to the clinical coding of the procedure',</td>
</tr>
</tr>
<tr>
<tr>
<td>id</td>
<td>encounter_id</td>
<td>bigint</td>
<td>bigint</td>
<td>NOT NULL</td>
<td>DEFAULT NULL</td>
<td> COMMENT 'Unique Id of the procedure',</td>
<td> COMMENT 'Reference to the encounter the procedure was administered at',</td>
<td> id bigint NOT NULL COMMENT 'Unique Id of the procedure',</td>
</tr>
<tr>
<td>status_concept_id</td>
<td>int</td>
<td>DEFAULT NULL</td>
<td> COMMENT 'Reference to the status of the procedure',</td>
</tr>
<tr>
<td>non_core_concept_id</td>
<td>int</td>
<td>DEFAULT NULL</td>
<td> COMMENT 'Reference to the clinical coding of the procedure',</td>
</tr>
</tr>
<tr>
<tr>
Line 2,831: Line 2,495:
<td>NOT NULL</td>
<td>NOT NULL</td>
<td> COMMENT 'Owning organisation (i.e. publisher)',</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>
<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 procedure was administered by a clinician',</td>
<td> COMMENT 'The age of the patient at the time of the procedure',</td>
<td>  clinical_effective_date date  NULL COMMENT 'The date the procedure was administered by a clinician',</td>
</tr>
</tr>
<tr>
<tr>
Line 2,845: Line 2,507:
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> COMMENT 'The date the procedure was recorded in the source system',</td>
<td> COMMENT 'The date the procedure was recorded in the source system',</td>
<td>  date_recorded datetime  NULL COMMENT 'The date the procedure was recorded in the source system',</td>
</tr>
</tr>
<tr>
<tr>
<td>status_concept_id</td>
<td>id</td>
<td>int</td>
<td>DEFAULT NULL</td>
<td> COMMENT 'Reference to the status of the procedure',</td>
<td>  status_concept_id int  NULL COMMENT 'Reference to the status of the procedure',</td>
</tr>
<tr>
<td>core_concept_id</td>
<td>int</td>
<td>DEFAULT NULL</td>
<td> COMMENT 'Reference to the clinical coding of the procedure',</td>
<td>  core_concept_id int  NULL COMMENT 'Reference to the clinical coding of the procedure',</td>
</tr>
<tr>
<td>person_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> COMMENT 'Unique Id of the procedure',</td>
<td>  person_id bigint NOT NULL COMMENT 'Unique individual across all organisations',</td>
</tr>
</tr>
<tr>
<tr>
<td>date_precision_concept_id</td>
<td>PRIMARY KEY CONSTRAINT(s) `organization_id`,`person_id`,`id`),</td> </tr> </tbody>
<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  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>
</tbody>
</table>
</table>
<h2><span class="mw-headline" id="Sortable_tables">Referral_request</span></h2>
<h2><span class="mw-headline" id="Sortable_tables">referral_request</span></h2>
<table class="sortable" border="1" style="border-collapse:collapse">
<table class="sortable" border="1" style="border-collapse:collapse">
<tr>
<tr>
Line 2,884: Line 2,524:
<th scope="col" width="10%">Constraint</th>
<th scope="col" width="10%">Constraint</th>
<th scope="col" width="10%">Comment</th>
<th scope="col" width="10%">Comment</th>
<th scope="col" width="10%">Sql</th>
</tr>
</tr>
<tbody>
<tbody>
<tr>
<td>patient_id</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>
<tr>
<td>clinical_effective_date</td>
<td>clinical_effective_date</td>
Line 2,899: Line 2,531:
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> COMMENT 'The date the referral was made',</td>
<td> COMMENT 'The date the referral was made',</td>
<td>  clinical_effective_date date  NULL COMMENT 'The date the referral was made',</td>
</tr>
</tr>
<tr>
<tr>
<td>practitioner_id</td>
<td>is_review</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> COMMENT 'Whether this referral is a review',</td>
<td>  practitioner_id bigint  NULL COMMENT 'The clinician the activity is recorded against',</td>
</tr>
</tr>
<tr>
<tr>
<td>outgoing_referral</td>
<td>patient_id</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>
</tr>
<tr>
<td>requester_organization_id</td>
<td>bigint</td>
<td>DEFAULT NULL</td>
<td> COMMENT 'Reference to the organisation that made the refereral request',</td>
</tr>
<tr>
<td>outgoing_referral</td>
<td>tinyint(1)</td>
<td>tinyint(1)</td>
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> COMMENT 'Whether this is an outgoing referral',</td>
<td> COMMENT 'Whether this is an outgoing referral',</td>
<td>  outgoing_referral tinyint(1)  NULL COMMENT 'Whether this is an outgoing referral',</td>
</tr>
</tr>
<tr>
<tr>
Line 2,920: Line 2,561:
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> COMMENT 'Reference to the clinical coding of the referral',</td>
<td> COMMENT 'Reference to the clinical coding of the referral',</td>
<td>  non_core_concept_id int  NULL COMMENT 'Reference to the clinical coding of the referral',</td>
</tr>
</tr>
<tr>
<tr>
<td>age_at_event</td>
<td>referral_request_type_concept_id</td>
<td>decimal(5,2)</td>
<td>DEFAULT NULL</td>
<td> COMMENT 'The age of the patient at the time of the referral',</td>
<td>  age_at_event decimal(5,2)  NULL COMMENT 'The age of the patient at the time of the referral',</td>
</tr>
<tr>
<td>requester_organization_id</td>
<td>bigint</td>
<td>DEFAULT NULL</td>
<td> COMMENT 'Reference to the organisation that made the refereral request',</td>
<td>  requester_organization_id bigint  NULL COMMENT 'Reference to the organisation that made the refereral request',</td>
</tr>
<tr>
<td>core_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 referral',</td>
<td> COMMENT 'Reference to the type of referral request',</td>
<td>  core_concept_id int  NULL COMMENT 'Reference to the clinical coding of the referral',</td>
</tr>
</tr>
<tr>
<tr>
Line 2,948: Line 2,573:
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> COMMENT 'Reference to the priority of the referral',</td>
<td> COMMENT 'Reference to the priority of the referral',</td>
<td>  referral_request_priority_concept_id smallint  NULL COMMENT 'Reference to the priority of the referral',</td>
</tr>
</tr>
<tr>
<tr>
<td>organization_id</td>
<td>encounter_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> COMMENT 'Reference to the encounter the referral was made in',</td>
<td>  organization_id bigint NOT NULL COMMENT 'Owning organisation (i.e. publisher)',</td>
</tr>
</tr>
<tr>
<tr>
<td>referral_request_type_concept_id</td>
<td>person_id</td>
<td>int</td>
<td>bigint</td>
<td>NOT NULL</td>
<td> COMMENT 'Unique individual across all organisations',</td>
</tr>
<tr>
<td>Mode</td>
<td>varchar(50)</td>
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> COMMENT 'Reference to the type of referral request',</td>
<td> COMMENT 'The mode of the referral',</td>
<td>  referral_request_type_concept_id int  NULL COMMENT 'Reference to the type of referral request',</td>
</tr>
</tr>
<tr>
<tr>
<td>recipient_organization_id</td>
<td>practitioner_id</td>
<td>bigint</td>
<td>bigint</td>
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> COMMENT 'Reference to the organization receiving the referral',</td>
<td> COMMENT 'The clinician the activity is recorded against',</td>
<td>  recipient_organization_id bigint  NULL COMMENT 'Reference to the organization receiving the referral',</td>
</tr>
</tr>
<tr>
<tr>
<td>id</td>
<td>recipient_organization_id</td>
<td>bigint</td>
<td>bigint</td>
<td>NOT NULL</td>
<td> COMMENT 'Unique Id of the referral',</td>
<td>  id bigint NOT NULL COMMENT 'Unique Id of the referral',</td>
</tr>
<tr>
<td>is_review</td>
<td>tinyint(1)</td>
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> COMMENT 'Whether this referral is a review',</td>
<td> COMMENT 'Reference to the organization receiving the referral',</td>
<td>  is_review tinyint(1)  NULL COMMENT 'Whether this referral is a review',</td>
</tr>
</tr>
<tr>
<tr>
Line 2,990: Line 2,609:
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> COMMENT 'The date the referral request was added to the source system',</td>
<td> COMMENT 'The date the referral request was added to the source system',</td>
<td> date_recorded datetime  NULL COMMENT 'The date the referral request was added to the source system',</td>
</tr>
<tr>
<td>age_at_event</td>
<td>decimal(5,2)</td>
<td>DEFAULT NULL</td>
<td> COMMENT 'The age of the patient at the time of the referral',</td>
</tr>
</tr>
<tr>
<tr>
Line 2,997: Line 2,621:
<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> 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 smallint  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>
<td>person_id</td>
<td>organization_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> COMMENT 'Owning organisation (i.e. publisher)',</td>
<td>  person_id bigint NOT NULL COMMENT 'Unique individual across all organisations',</td>
</tr>
</tr>
<tr>
<tr>
<td>Mode</td>
<td>core_concept_id</td>
<td>varchar(50)</td>
<td>int</td>
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> COMMENT 'The mode of the referral',</td>
<td> COMMENT 'Reference to the clinical coding of the referral',</td>
<td>  Mode varchar(50)  NULL COMMENT 'The mode of the referral',</td>
</tr>
</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> COMMENT 'Unique Id of the referral',</td>
<td>  encounter_id bigint  NULL COMMENT 'Reference to the encounter the referral was made in',</td>
</tr>
</tr>
</tbody>
<tr>
<td>PRIMARY KEY CONSTRAINT(s) `organization_id`,`person_id`,`id`),</td> </tr> </tbody>
</table>
</table>
<h2><span class="mw-headline" id="Sortable_tables">Registration_status_history</span></h2>
<h2><span class="mw-headline" id="Sortable_tables">registration_status_history</span></h2>
<table class="sortable" border="1" style="border-collapse:collapse">
<table class="sortable" border="1" style="border-collapse:collapse">
<tr>
<tr>
Line 3,029: Line 2,650:
<th scope="col" width="10%">Constraint</th>
<th scope="col" width="10%">Constraint</th>
<th scope="col" width="10%">Comment</th>
<th scope="col" width="10%">Comment</th>
<th scope="col" width="10%">Sql</th>
</tr>
</tr>
<tbody>
<tbody>
<tr>
<tr>
<td>episode_of_care_id</td>
<td>person_id</td>
<td>bigint</td>
<td>bigint</td>
<td>NOT NULL</td>
<td> COMMENT 'Reference to the person this registration status history belongs to',</td>
</tr>
<tr>
<td>start_date</td>
<td>datetime</td>
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> COMMENT 'Reference to the episode of care this status history belongs to',</td>
<td> COMMENT 'The start date for the period this registration status history was valid',</td>
<td>  episode_of_care_id bigint  NULL COMMENT 'Reference to the episode of care this status history belongs to',</td>
</tr>
</tr>
<tr>
<tr>
<td>registration_status_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 registration status',</td>
<td> COMMENT 'Unique Id of the registration status history',</td>
<td>  registration_status_concept_id int  NULL COMMENT 'Reference to the registration status',</td>
</tr>
</tr>
<tr>
<tr>
Line 3,051: Line 2,675:
<td>NOT NULL</td>
<td>NOT NULL</td>
<td> COMMENT 'Owning organisation (i.e. publisher)',</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>
<td>start_date</td>
<td>registration_status_concept_id</td>
<td>datetime</td>
<td>int</td>
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> COMMENT 'The start date for the period this registration status history was valid',</td>
<td> COMMENT 'Reference to the registration status',</td>
<td>  start_date datetime  NULL COMMENT 'The start date for the period this registration status history was valid',</td>
</tr>
<tr>
<td>person_id</td>
<td>bigint</td>
<td>NOT NULL</td>
<td> COMMENT 'Reference to the person this registration status history belongs to',</td>
<td>  person_id bigint NOT NULL COMMENT 'Reference to the person this registration status history belongs to',</td>
</tr>
<tr>
<td>id</td>
<td>bigint</td>
<td>NOT NULL</td>
<td> COMMENT 'Unique Id of the registration status history',</td>
<td>  id bigint NOT NULL COMMENT 'Unique Id of the registration status history',</td>
</tr>
</tr>
<tr>
<tr>
Line 3,079: Line 2,687:
<td>NOT NULL</td>
<td>NOT NULL</td>
<td> COMMENT 'Reference to the patient this registration status history belongs to',</td>
<td> COMMENT 'Reference to the patient this registration status history belongs to',</td>
<td>  patient_id bigint NOT NULL COMMENT 'Reference to the patient this registration status history belongs to',</td>
</tr>
</tr>
<tr>
<tr>
Line 3,086: Line 2,693:
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> COMMENT 'The end date for the period this registration status history was valid',</td>
<td> COMMENT 'The end date for the period this registration status history was valid',</td>
<td>  end_date datetime  NULL COMMENT 'The end date for the period this registration status history was valid',</td>
</tr>
</tr>
</tbody>
<tr>
<td>episode_of_care_id</td>
<td>bigint</td>
<td>DEFAULT NULL</td>
<td> COMMENT 'Reference to the episode of care this status history belongs to',</td>
</tr>
<tr>
<td>PRIMARY KEY CONSTRAINT(s) `organization_id`,`id`,`patient_id`,`person_id`),</td> </tr> </tbody>
</table>
</table>
<h2><span class="mw-headline" id="Sortable_tables">Schedule</span></h2>
<h2><span class="mw-headline" id="Sortable_tables">schedule</span></h2>
<table class="sortable" border="1" style="border-collapse:collapse">
<table class="sortable" border="1" style="border-collapse:collapse">
<tr>
<tr>
Line 3,097: Line 2,710:
<th scope="col" width="10%">Constraint</th>
<th scope="col" width="10%">Constraint</th>
<th scope="col" width="10%">Comment</th>
<th scope="col" width="10%">Comment</th>
<th scope="col" width="10%">Sql</th>
</tr>
</tr>
<tbody>
<tbody>
<tr>
<td>id</td>
<td>bigint</td>
<td>NOT NULL</td>
<td> COMMENT 'Unique Id of the schedule',</td>
</tr>
<tr>
<td>practitioner_id</td>
<td>bigint</td>
<td>DEFAULT NULL</td>
<td> COMMENT 'Reference to the practitioner who owns the schedule',</td>
</tr>
<tr>
<tr>
<td>start_date</td>
<td>start_date</td>
Line 3,105: Line 2,729:
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> COMMENT 'The start date of the schedule',</td>
<td> COMMENT 'The start date of the schedule',</td>
<td>  start_date date  NULL COMMENT 'The start date of the schedule',</td>
</tr>
</tr>
<tr>
<tr>
<td>id</td>
<td>organization_id</td>
<td>bigint</td>
<td>bigint</td>
<td>NOT NULL</td>
<td>NOT NULL</td>
<td> COMMENT 'Unique Id of the schedule',</td>
<td> COMMENT 'Owning organisation (i.e. publisher)',</td>
<td>  id bigint NOT NULL COMMENT 'Unique Id of the schedule',</td>
</tr>
</tr>
<tr>
<tr>
Line 3,119: Line 2,741:
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> COMMENT 'The name of the schedule',</td>
<td> COMMENT 'The name of the schedule',</td>
<td>  name varchar(150)  NULL COMMENT 'The name of the schedule',</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 3,133: Line 2,747:
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> COMMENT 'The type of schedule eg Timed Appointments',</td>
<td> COMMENT 'The type of schedule eg Timed Appointments',</td>
<td>  type varchar(255)  NULL COMMENT 'The type of schedule eg Timed Appointments',</td>
</tr>
<tr>
<td>practitioner_id</td>
<td>bigint</td>
<td>DEFAULT NULL</td>
<td> COMMENT 'Reference to the practitioner who owns the schedule',</td>
<td>  practitioner_id bigint  NULL COMMENT 'Reference to the practitioner who owns the schedule',</td>
</tr>
</tr>
<tr>
<tr>
Line 3,147: Line 2,753:
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> COMMENT 'Textual description of the location the schedule was held at',</td>
<td> COMMENT 'Textual description of the location the schedule was held at',</td>
<td>  location varchar(255)  NULL COMMENT 'Textual description of the location the schedule was held at',</td>
</tr>
</tr>
</tbody>
<tr>
<td>PRIMARY KEY CONSTRAINT(s) `organization_id`,`id`),</td> </tr> </tbody>
</table>
</table>

Revision as of 13:28, 23 November 2022

Remote Subscriber Database (RSD) Schema (Compass 2) Version: v2.1.2

From Discovery Data Service

allergy_intolerance

<tbody> </tbody>
Column Name Type Constraint Comment
encounter_id bigint DEFAULT NULL COMMENT 'Reference to the encounter this allergy was record in',
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',
non_core_concept_id int DEFAULT NULL COMMENT 'Reference to the clinical coding of the allergy',
id bigint NOT NULL COMMENT 'Unique Id of the allergy',
date_recorded datetime NOT NULL COMMENT 'The date the allergy was recorded',
core_concept_id int DEFAULT NULL COMMENT 'Reference to the clinical coding of the allergy',
person_id bigint NOT NULL COMMENT 'Unique individual across all organisations',
practitioner_id bigint DEFAULT NULL COMMENT 'The clinician the activity is recorded against',
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)',
is_review tinyint(1) NOT NULL COMMENT 'Is this instance of the code a review of a previous encounter',
organization_id bigint NOT NULL COMMENT 'Owning organisation (i.e. publisher)',
clinical_effective_date date DEFAULT NULL COMMENT 'The date the clinical code is recorded for',
age_at_event decimal(5,2) DEFAULT NULL COMMENT 'The age the patient was at the time of this event',
PRIMARY KEY CONSTRAINT(s) `organization_id`,`person_id`,`id`),

appointment

<tbody> </tbody>
Column Name Type Constraint Comment
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',
appointment_status_concept_id int DEFAULT NULL COMMENT 'The status of the appointment e.g. arrived/sent in/left/DNA',
patient_wait int DEFAULT NULL COMMENT 'How long the patient waited from being marked as arrived to being sent in',
date_time_sent_in datetime DEFAULT NULL COMMENT 'Date and time the patient was sent into the practitioner',
id bigint NOT NULL COMMENT 'Unique Id of the appointment',
source_id varchar(36) DEFAULT NULL COMMENT 'Unique reference to the source of the appointment',
person_id bigint NOT NULL COMMENT 'Unique individual across all organisations',
practitioner_id bigint DEFAULT NULL COMMENT 'The clinician the activity is recorded against',
actual_duration int DEFAULT NULL COMMENT 'Time between sent in and left always in minutes',
planned_duration int DEFAULT NULL COMMENT 'The time allocated for the appointment, not necessarily the actual duration always in minutes',
start_date date DEFAULT NULL COMMENT 'The start date of the appointment',
organization_id bigint NOT NULL COMMENT 'Owning organisation (i.e. publisher)',
patient_delay int DEFAULT NULL COMMENT 'How long the patient was delayed for',
date_time_left datetime DEFAULT NULL COMMENT 'Date and time the patient left the practitioner',
schedule_id bigint DEFAULT NULL COMMENT 'The schedule the patient was put on to book multiple appointments. ID unique to the applied schedule',
cancelled_date datetime DEFAULT NULL COMMENT 'The date the appointment was cancelled',
PRIMARY KEY CONSTRAINT(s) `organization_id`,`person_id`,`id`),

appointment_additional

<tbody> </tbody>
Column Name Type Constraint Comment
json_value json DEFAULT NULL COMMENT 'where there is no mapped value_id, just raw JSON',
id bigint NOT NULL COMMENT 'same as the id column on the patient table ',
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)',
property_id int NOT NULL COMMENT 'IM reference (e.g. appointment type)',
value_id int DEFAULT NULL COMMENT 'IM reference (e.g. Appointment Type)',
PRIMARY KEY CONSTRAINT(s) `id`,`property_id`),

concept

<tbody> </tbody>
Column Name Type Constraint Comment
Code varchar(40) DEFAULT NULL COMMENT 'The code (non-unique unless coupled with a scheme)',
Id varchar(150) NOT NULL COMMENT 'Unique concept identifier',
dbid int NOT NULL COMMENT 'Unique Id of the concept',
Document int NOT NULL COMMENT 'Concept grouping construct, deprecated',
Scheme bigint DEFAULT NULL COMMENT 'The coding scheme for the code (Read, CTV3, SNOMED etc)',
Draft tinyint(1) NOT NULL COMMENT 'Whether its draft/autocreated or confirmed as a "proper" concept',
Description varchar(400) DEFAULT NULL COMMENT 'Full name (or term for ontological concepts)',
use_count bigint NOT NULL DEFAULT '0' COMMENT 'Rough indicator of number of occurences of the concept',
updated datetime NOT NULL COMMENT 'The timestamp of the last update to the concept',
Name varchar(255) DEFAULT NULL COMMENT 'Short name',
PRIMARY KEY CONSTRAINT(s) `dbid`),

concept_map

<tbody> </tbody>
Column Name Type Constraint Comment
legacy int NOT NULL COMMENT 'the legacy (read 2, ctv3, icd10, opcs4, emis local, etc) concept',
updated datetime NOT NULL COMMENT 'Timestamp the map was last updated/added',
core int NOT NULL COMMENT 'the core (snomed, discovery) concept that the legacy concept maps to',
id int NOT NULL,
deleted tinyint(1) DEFAULT NULL,
PRIMARY KEY CONSTRAINT(s) `id`),

diagnostic_order

<tbody> </tbody>
Column Name Type Constraint Comment
problem_end_date date DEFAULT NULL COMMENT 'The end date of the problem',
is_primary tinyint(1) DEFAULT NULL COMMENT 'Whether the diagnostic order is a primary order',
result_value_units varchar(50) DEFAULT NULL COMMENT 'The units of the result of the observation',
episodicity_concept_id int DEFAULT NULL COMMENT 'Reference to the episodicity of the problem eg First, review, flare',
clinical_effective_date date DEFAULT NULL COMMENT 'The date the diagnostic order was identified by a clinician',
result_text text COMMENT 'Any text associated with the result',
id bigint NOT NULL COMMENT 'Unique Id of the diagnostic order',
result_concept_id int DEFAULT NULL COMMENT 'Reference to the clinical coding of the result',
person_id bigint NOT NULL COMMENT 'Unique individual across all organisations',
practitioner_id bigint DEFAULT NULL COMMENT 'The clinician the activity is recorded against',
is_problem tinyint(1) NOT NULL COMMENT 'Whether the observation is marked as a problem',
result_value double DEFAULT NULL COMMENT 'The value of the result of the observation',
result_date date DEFAULT NULL COMMENT 'The date of the result',
non_core_concept_id int DEFAULT NULL COMMENT 'Reference to the clinical coding of the observation',
core_concept_id int DEFAULT NULL COMMENT 'Reference to the clinical coding of the observation',
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',
date_recorded datetime DEFAULT NULL,
is_review tinyint(1) NOT NULL COMMENT 'Whether the observation is a review of an existing problem',
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)',
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',
organization_id bigint NOT NULL COMMENT 'Owning organisation (i.e. publisher)',
age_at_event decimal(5,2) DEFAULT NULL COMMENT 'The age of the patient at the time of the observation',
encounter_id bigint DEFAULT NULL COMMENT 'Reference to the encounter the observation was recorded at',
PRIMARY KEY CONSTRAINT(s) `organization_id`,`person_id`,`id`),

encounter

<tbody> </tbody>
Column Name Type Constraint Comment
appointment_id bigint DEFAULT NULL COMMENT 'Reference to the appointment this encounter took part on',
sub_type text COMMENT 'Unused',
institution_location_id text COMMENT 'Reference to the institution the encounter took place at',
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',
core_concept_id int DEFAULT NULL COMMENT 'Reference to the type of encounter',
non_core_concept_id int DEFAULT NULL COMMENT 'Reference to the type of encounter',
person_id bigint NOT NULL COMMENT 'Unique individual across all organisations',
practitioner_id bigint DEFAULT NULL COMMENT 'The clinician the activity is recorded against',
date_recorded datetime DEFAULT NULL COMMENT 'The date the encounter was recorded',
date_precision_concept_id int DEFAULT NULL COMMENT 'Reference to the precision of the date of the encounter',
admission_method varchar(40) DEFAULT NULL COMMENT 'The admission method of the encounter',
episode_of_care_id bigint DEFAULT NULL COMMENT 'Is this instance of the code a review of a previous encounter',
id bigint NOT NULL COMMENT 'Unique Id of the encounter',
organization_id bigint NOT NULL COMMENT 'Owning organisation (i.e. publisher)',
age_at_event decimal(5,2) DEFAULT NULL COMMENT 'The age the patient was when this encounter took place',
clinical_effective_date date DEFAULT NULL COMMENT 'The date the clinical code is recorded for',
service_provider_organization_id bigint DEFAULT NULL COMMENT 'Reference to the service provider organisation',
end_date date DEFAULT NULL COMMENT 'The end date of the encounter',
Type text COMMENT 'Unused',
PRIMARY KEY CONSTRAINT(s) `organization_id`,`person_id`,`id`),

encounter_additional

<tbody> </tbody>
Column Name Type Constraint Comment
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)',
json_value json DEFAULT NULL COMMENT 'where there is no mapped value_id, just raw JSON (i.e. birth delivery details)',
id bigint NOT NULL COMMENT 'same as the id column on the encounter table',
value_id int DEFAULT NULL COMMENT 'IM concept id reference (i.e. Emergency admission)',
property_id int NOT NULL COMMENT 'IM concept id reference (i.e. Admission method)',
PRIMARY KEY CONSTRAINT(s) `id`,`property_id`),

encounter_event

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

episode_of_care

<tbody> </tbody>
Column Name Type Constraint Comment
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',
usual_gp_practitioner_id bigint DEFAULT NULL COMMENT 'Reference to the usual GP for this episode of care',
registration_status_concept_id int DEFAULT NULL COMMENT 'Reference to the registration status of the patient',
date_registered_end date DEFAULT NULL COMMENT 'The date the registration was ended  for this episode of care',
organization_id bigint NOT NULL COMMENT 'Owning organisation (i.e. publisher)',
date_registered date DEFAULT NULL COMMENT 'The date the registration was started  for this episode of care',
person_id bigint NOT NULL COMMENT 'Unique individual across all organisations',
id bigint NOT NULL COMMENT 'Unique Id of the episode of care',
registration_type_concept_id int DEFAULT NULL COMMENT 'Reference to the registration type of the patient',
PRIMARY KEY CONSTRAINT(s) `organization_id`,`person_id`,`id`),

event_log

<tbody> </tbody>
Column Name Type Constraint Comment
table_id tinyint NOT NULL COMMENT 'identifier of the table changed',
dt_change datetime(3) NOT NULL COMMENT 'date time the change was made to this DB',
change_type tinyint NOT NULL COMMENT 'type of transaction 0=insert, 1=update, 2=delete',
record_id bigint NOT NULL COMMENT 'id of the record changed'

flag

<tbody> </tbody>
Column Name Type Constraint Comment
flag_text text COMMENT 'This is a warning set by the publisher regarding he patient',
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',
is_active tinyint(1) NOT NULL COMMENT 'Whether the flag is active or not',
organization_id bigint NOT NULL COMMENT 'Owning organisation (i.e. publisher)',
effective_date date DEFAULT NULL COMMENT 'The date the flag was entered onto the patients record',
person_id bigint NOT NULL COMMENT 'Unique individual across all organisations',
id bigint NOT NULL COMMENT 'Unique Id of the flag',
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)',
PRIMARY KEY CONSTRAINT(s) `organization_id`,`person_id`,`id`),

location

<tbody> </tbody>
Column Name Type Constraint Comment
type_desc varchar(255) DEFAULT NULL COMMENT 'Textual description of the type of location eg GP Practice',
managing_organization_id bigint DEFAULT NULL COMMENT 'Reference to the managing organisation of the location',
name varchar(255) DEFAULT NULL COMMENT 'The name of a location set by the publisher. E.g. ward, clinic, domiciliary',
postcode varchar(10) DEFAULT NULL COMMENT 'The postcode of the location',
type_code varchar(50) DEFAULT NULL COMMENT 'The type of location',
id bigint NOT NULL COMMENT 'Unique Id of the location',
PRIMARY KEY CONSTRAINT(s) `id`),

medication_order

<tbody> </tbody>
Column Name Type Constraint Comment
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',
core_concept_id int DEFAULT NULL COMMENT 'Reference to the clinical coding of the medication',
duration_days int DEFAULT NULL COMMENT 'How many days the medication is prescribed for',
bnf_reference varchar(6) DEFAULT NULL COMMENT 'A reference to the drug in the BNF dictionary',
issue_method text COMMENT 'The issue method of the medication eg hand written',
dose varchar(1000) DEFAULT NULL COMMENT 'Textual description of the dose',
estimated_cost double DEFAULT NULL COMMENT 'The estimated cost of the medication',
person_id bigint NOT NULL COMMENT 'Unique individual across all organisations',
practitioner_id bigint DEFAULT NULL COMMENT 'The clinician the activity is recorded against',
medication_statement_id bigint DEFAULT NULL COMMENT 'Reference to the medication statement.  A medication statement can have many medication orders',
id bigint NOT NULL COMMENT 'Unique Id of the medication order',
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)',
non_core_concept_id int DEFAULT NULL COMMENT 'Reference to the clinical coding of the medication',
quantity_value double DEFAULT NULL COMMENT 'The value of the medication that was prescribed eg 50',
organization_id bigint NOT NULL COMMENT 'Owning organisation (i.e. publisher)',
clinical_effective_date date DEFAULT NULL COMMENT 'The date the medication order was issued',
encounter_id bigint DEFAULT NULL COMMENT 'Reference to the encounter the medication order was issued in',
age_at_event decimal(5,2) DEFAULT NULL COMMENT 'The age the patient was at the time of this event',
quantity_unit varchar(255) DEFAULT NULL COMMENT 'The unit of the medication that was prescribed eg tablets',
PRIMARY KEY CONSTRAINT(s) `organization_id`,`person_id`,`id`),

medication_statement

<tbody> </tbody>
Column Name Type Constraint Comment
cancellation_date date DEFAULT NULL COMMENT 'The date the medication was cancelled',
Issue_method text COMMENT 'The issue method of the medication eg hand written',
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',
date_recorded datetime DEFAULT NULL,
core_concept_id int DEFAULT NULL COMMENT 'Reference to the clinical coding of the medication',
bnf_reference varchar(6) DEFAULT NULL COMMENT 'A reference to the drug in the BNF dictionary',
dose varchar(1000) DEFAULT NULL COMMENT 'Texual description of the dose of the medication',
person_id bigint NOT NULL COMMENT 'Unique individual across all organisations',
authorisation_type_concept_id int DEFAULT NULL COMMENT 'Reference to the authorisation type',
practitioner_id bigint DEFAULT NULL COMMENT 'The clinician the activity is recorded against',
clinical_effective_date date DEFAULT NULL COMMENT 'The date the medication was clinical relevant',
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)',
non_core_concept_id int DEFAULT NULL COMMENT 'Reference to the clinical coding of the medication',
id bigint NOT NULL COMMENT 'Unique Id of the medication',
is_active tinyint(1) DEFAULT NULL COMMENT 'Whether the medication is active or not',
quantity_value double DEFAULT NULL COMMENT 'The value of the medication that was prescribed eg 50',
organization_id bigint NOT NULL COMMENT 'Owning organisation (i.e. publisher)',
encounter_id bigint DEFAULT NULL COMMENT 'Reference to the encounter this medication was recorded in',
age_at_event decimal(5,2) DEFAULT NULL COMMENT 'The age the patient was at the time of this event',
quantity_unit varchar(255) DEFAULT NULL COMMENT 'The unit of the medication that was prescribed eg tablets',
PRIMARY KEY CONSTRAINT(s) `organization_id`,`person_id`,`id`),

observation

<tbody> </tbody>
Column Name Type Constraint Comment
problem_end_date date DEFAULT NULL COMMENT 'The end date of the problem',
is_primary tinyint(1) DEFAULT NULL COMMENT 'Whether the observation is a primary observation',
episodicity_concept_id int DEFAULT NULL COMMENT 'Reference to the episodicity of the problem eg First, review, flare',
result_value_units varchar(50) DEFAULT NULL COMMENT 'The units of the result of the observation',
result_text text COMMENT 'Any text associated with the result',
result_concept_id int DEFAULT NULL COMMENT 'Reference to the clinical coding of the result',
person_id bigint NOT NULL COMMENT 'Unique individual across all organisations',
practitioner_id bigint DEFAULT NULL COMMENT 'The clinician the activity is recorded against',
is_problem tinyint(1) NOT NULL COMMENT 'Whether the observation is marked as a problem',
result_value double DEFAULT NULL COMMENT 'The value of the result of the observation',
result_date date DEFAULT NULL COMMENT 'The date of the result',
non_core_concept_id int DEFAULT NULL COMMENT 'Reference to the clinical coding of the observation',
core_concept_id int DEFAULT NULL COMMENT 'Reference to the clinical coding of the observation',
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',
date_recorded datetime DEFAULT NULL COMMENT 'The date the observation was recorded in the system',
is_review tinyint(1) NOT NULL COMMENT 'Whether the observation is a review of an existing problem',
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)',
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',
organization_id bigint NOT NULL COMMENT 'Owning organisation (i.e. publisher)',
id bigint NOT NULL COMMENT 'Unique Id of the observation',
age_at_event decimal(5,2) DEFAULT NULL COMMENT 'The age of the patient at the time of the observation',
encounter_id bigint DEFAULT NULL COMMENT 'Reference to the encounter the observation was recorded at',
clinical_effective_date date DEFAULT NULL COMMENT 'The date the observation was identified by a clinician',
PRIMARY KEY CONSTRAINT(s) `organization_id`,`person_id`,`id`),

observation_additional

<tbody> </tbody>
Column Name Type Constraint Comment
property_id int NOT NULL COMMENT 'IM reference (i.e. significance)',
text_value varchar(255) DEFAULT NULL COMMENT 'where there is no mapped value_id or raw JSON, just a basic text value',
id bigint NOT NULL COMMENT 'same as the id column on the observation table',
json_value json DEFAULT NULL COMMENT 'the JSON data itself ',
value_id int DEFAULT NULL COMMENT 'IM reference (i.e. minor, significant)',
PRIMARY KEY CONSTRAINT(s) `id`,`property_id`),

organization

<tbody> </tbody>
Column Name Type Constraint Comment
id bigint NOT NULL COMMENT 'Unique Id of the organisation',
Name varchar(255) DEFAULT NULL COMMENT 'Name of the organisation',
type_desc varchar(255) DEFAULT NULL COMMENT 'Textual description of the type of organisation eg GP Practice',
ods_code varchar(50) DEFAULT NULL COMMENT 'ODS Code of the organisation',
type_code varchar(50) DEFAULT NULL COMMENT 'The type of organisation',
Postcode varchar(10) DEFAULT NULL COMMENT 'The postcode of the organisation',
parent_organization_id bigint DEFAULT NULL COMMENT 'The id of the parent organisation',
PRIMARY KEY CONSTRAINT(s) `id`),

organization_metadata

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

patient

<tbody> </tbody>
Column Name Type Constraint Comment
date_of_death date DEFAULT NULL COMMENT 'The date of death of the patient',
current_address_id bigint DEFAULT NULL COMMENT 'Reference to the current address of the patient',
date_of_birth date DEFAULT NULL COMMENT 'The date of birth of the patient',
title varchar(255) DEFAULT NULL COMMENT 'The title of the patient',
person_id bigint NOT NULL COMMENT 'Unique individual across all organisations',
nhs_number varchar(255) DEFAULT NULL COMMENT 'The NHS number of the patient',
gender_concept_id int DEFAULT NULL COMMENT 'Reference to the gender of the patient',
birth_week tinyint DEFAULT NULL,
first_names varchar(255) DEFAULT NULL COMMENT 'The first names of the patient',
last_name varchar(255) DEFAULT NULL COMMENT 'The last name of the patient',
id bigint NOT NULL COMMENT 'Unique Id of the patient',
organization_id bigint NOT NULL COMMENT 'Owning organisation (i.e. publisher)',
birth_year smallint DEFAULT NULL,
ethnic_code_concept_id int DEFAULT NULL COMMENT 'Reference to the ethnicity of the patient',
birth_month tinyint DEFAULT NULL,
registered_practice_organization_id bigint DEFAULT NULL COMMENT 'Reference to the organisation the patient is registered at',
PRIMARY KEY CONSTRAINT(s) `organization_id`,`person_id`,`id`),

patient_additional

<tbody> </tbody>
Column Name Type Constraint Comment
json_value json DEFAULT NULL COMMENT 'where there is no mapped value_id, just raw JSON',
id bigint NOT NULL COMMENT 'same as the id column on the patient table ',
property_id int NOT NULL COMMENT 'IM reference (e.g. Cause of death)',
value_id int DEFAULT NULL COMMENT 'IM reference (e.g. COVID)',
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)',
PRIMARY KEY CONSTRAINT(s) `id`,`property_id`),

patient_address

<tbody> </tbody>
Column Name Type Constraint Comment
address_line_2 varchar(255) DEFAULT NULL COMMENT 'The second line of the address',
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',
lsoa_2001_code varchar(9) DEFAULT NULL COMMENT 'A reference to the LSOA_2001 code',
city varchar(255) DEFAULT NULL COMMENT 'The city',
address_line_4 varchar(255) DEFAULT NULL COMMENT 'The fourth line of the address',
msoa_2001_code varchar(9) DEFAULT NULL COMMENT 'A reference to the MSOA_2001 code',
postcode varchar(255) DEFAULT NULL COMMENT 'The postcode',
Id bigint NOT NULL COMMENT 'Unique Id of the address',
person_id bigint NOT NULL COMMENT 'Unique individual across all organisations',
address_line_3 varchar(255) DEFAULT NULL COMMENT 'The third line of the address',
townsend_deprivation_index double DEFAULT NULL,
msoa_2011_code varchar(9) DEFAULT NULL COMMENT 'A reference to the MSOA_2011 code',
start_date date NOT NULL COMMENT 'The start date of this address being relevant',
end_date date DEFAULT NULL COMMENT 'The end date of this address being relevant',
ward_code varchar(9) DEFAULT NULL COMMENT 'The ward the address belongs to',
use_concept_id int NOT NULL COMMENT 'use of address (e.g. home, temporary)',
address_line_1 varchar(255) DEFAULT NULL COMMENT 'The first line of the address',
organization_id bigint NOT NULL COMMENT 'Owning organisation (i.e. publisher)',
lsoa_2011_code varchar(9) DEFAULT NULL COMMENT 'A reference to the LSOA_2011 code',
local_authority_code varchar(9) DEFAULT NULL COMMENT 'The local authority the address belongs to',
PRIMARY KEY CONSTRAINT(s) `organization_id`,`Id`,`patient_id`,`person_id`),

patient_address_match

<tbody> </tbody>
Column Name Type Constraint Comment
latitude double DEFAULT NULL,
match_pattern_street varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL,
abp_address_postcode varchar(10) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL,
abp_address_organization varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL,
abp_address_street varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL,
longitude double DEFAULT NULL,
match_date datetime DEFAULT NULL,
match_pattern_postcode varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL,
patient_address_id bigint NOT NULL,
qualifier varchar(50) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL,
algorithm_version varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL,
uprn_xcoordinate double DEFAULT NULL,
uprn_ycoordinate double DEFAULT NULL,
match_pattern_building varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL,
uprn_property_classification varchar(45) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL,
status tinyint(1) DEFAULT NULL,
abp_address_locality varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL,
uprn varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_bin DEFAULT NULL,
id bigint NOT NULL AUTO_INCREMENT,
match_pattern_number varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL,
match_rule varchar(4096) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL,
uprn_ralf00 varchar(255) DEFAULT NULL,
abp_address_town varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL,
epoch varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_bin DEFAULT NULL,
match_pattern_flat varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL,
abp_address_number varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL,
PRIMARY KEY CONSTRAINT(s) `id`),

patient_address_ralf

<tbody> </tbody>
Column Name Type Constraint Comment
organization_id bigint NOT NULL,
patient_address_match_uprn_ralf00 varchar(255) NOT NULL,
person_id bigint NOT NULL,
ralf varchar(255) NOT NULL,
patient_id bigint NOT NULL,
patient_address_id bigint NOT NULL,
salt_name varchar(50) NOT NULL,
id bigint NOT NULL,
PRIMARY KEY CONSTRAINT(s) `id`,`patient_address_id`,`patient_address_match_uprn_ralf00`),

patient_contact

<tbody> </tbody>
Column Name Type Constraint Comment
value varchar(255) DEFAULT NULL COMMENT 'The value of the contact information eg phone number, email address',
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',
end_date date DEFAULT NULL COMMENT 'The end date of the contact being valid',
organization_id bigint NOT NULL COMMENT 'Owning organisation (i.e. publisher)',
person_id bigint NOT NULL COMMENT 'Unique individual across all organisations',
id bigint NOT NULL COMMENT 'Unique Id of the patient contact',
use_concept_id int DEFAULT NULL COMMENT 'use of contact (e.g. mobile, home,work',
type_concept_id int DEFAULT NULL COMMENT 'type of contact (e.g. phone, email)',
start_date date DEFAULT NULL COMMENT 'The start date of the contact being valid',
PRIMARY KEY CONSTRAINT(s) `organization_id`,`id`,`patient_id`,`person_id`),

patient_pseudo_id

<tbody> </tbody>
Column Name Type Constraint Comment
person_id bigint NOT NULL COMMENT 'Reference to the person this registration status history belongs to',
is_nhs_number_verified_by_publisher tinyint(1) NOT NULL COMMENT 'Whether the nhs number has been verified by the publisher',
id bigint NOT NULL COMMENT 'Unique Id of the patient pseudo id',
organization_id bigint NOT NULL COMMENT 'Owning organisation (i.e. publisher)',
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)',
patient_id bigint NOT NULL COMMENT 'Reference to the patient this registration status history belongs to',
salt_name varchar(50) NOT NULL COMMENT 'The name of the salt used to create the pseudo id',
is_nhs_number_valid tinyint(1) NOT NULL COMMENT 'Whether the nhs number is valid',
PRIMARY KEY CONSTRAINT(s) `organization_id`,`person_id`,`id`),

patient_uprn

<tbody> </tbody>
Column Name Type Constraint Comment
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',
match varchar(255) DEFAULT NULL,
person_id bigint NOT NULL COMMENT 'Unique individual across all organisations',
algorithm varchar(255) DEFAULT NULL,
no_address tinyint(1) DEFAULT NULL,
uprn bigint DEFAULT NULL,
qualifier varchar(50) DEFAULT NULL,
missing_postcode tinyint(1) DEFAULT NULL,
organization_id bigint NOT NULL COMMENT 'Owning organisation (i.e. publisher)',
invalid_address tinyint(1) DEFAULT NULL,
invalid_postcode tinyint(1) DEFAULT NULL,
PRIMARY KEY CONSTRAINT(s) `organization_id`,`person_id`,`patient_id`),

person

<tbody> </tbody>
Column Name Type Constraint Comment
last_name varchar(255) DEFAULT NULL COMMENT 'The last name of the person',
title varchar(255) DEFAULT NULL COMMENT 'The title of the person',
date_of_death date DEFAULT NULL COMMENT 'The date of death of the person',
registered_practice_organization_id bigint DEFAULT NULL COMMENT 'Reference to the organisation the person is registered at',
date_of_birth date DEFAULT NULL COMMENT 'The date of birth of the person',
birth_week tinyint DEFAULT NULL,
nhs_number varchar(255) DEFAULT NULL COMMENT 'The NHS number of the person',
organization_id bigint NOT NULL COMMENT 'Owning organisation (i.e. publisher)',
first_names varchar(255) DEFAULT NULL COMMENT 'The first names of the person',
birth_year smallint DEFAULT NULL,
ethnic_code_concept_id int DEFAULT NULL COMMENT 'Reference to the ethnicity of the person',
id bigint NOT NULL COMMENT 'Unique Id of the person',
current_address_id bigint NOT NULL COMMENT 'Reference to the current address of the person',
gender_concept_id int DEFAULT NULL COMMENT 'Reference to the gender of the person',
birth_month tinyint DEFAULT NULL,
PRIMARY KEY CONSTRAINT(s) `id`),

practitioner

<tbody> </tbody>
Column Name Type Constraint Comment
id bigint NOT NULL COMMENT 'Unique Id of the practitioner',
name varchar(1024) DEFAULT NULL COMMENT 'Name of the practitioner',
organization_id bigint NOT NULL COMMENT 'Owning organisation (i.e. publisher)',
gmc_code varchar(50) DEFAULT NULL COMMENT 'The GMC code of the practitioner',
role_code varchar(50) DEFAULT NULL COMMENT 'The code representing the role of the practitioner',
role_desc varchar(255) DEFAULT NULL COMMENT 'Textual description of the role of the practitioner eg General Medical Practitioner',
PRIMARY KEY CONSTRAINT(s) `id`),

procedure_request

<tbody> </tbody>
Column Name Type Constraint Comment
clinical_effective_date date DEFAULT NULL COMMENT 'The date the procedure was administered by a clinician',
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',
core_concept_id int DEFAULT NULL COMMENT 'Reference to the clinical coding of the procedure',
person_id bigint NOT NULL COMMENT 'Unique individual across all organisations',
practitioner_id bigint DEFAULT NULL COMMENT 'The clinician the activity is recorded against',
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)',
encounter_id bigint DEFAULT NULL COMMENT 'Reference to the encounter the procedure was administered at',
status_concept_id int DEFAULT NULL COMMENT 'Reference to the status of the procedure',
non_core_concept_id int DEFAULT NULL COMMENT 'Reference to the clinical coding of the procedure',
organization_id bigint NOT NULL COMMENT 'Owning organisation (i.e. publisher)',
age_at_event decimal(5,2) DEFAULT NULL COMMENT 'The age of the patient at the time of the procedure',
date_recorded datetime DEFAULT NULL COMMENT 'The date the procedure was recorded in the source system',
id bigint NOT NULL COMMENT 'Unique Id of the procedure',
PRIMARY KEY CONSTRAINT(s) `organization_id`,`person_id`,`id`),

referral_request

<tbody> </tbody>
Column Name Type Constraint Comment
clinical_effective_date date DEFAULT NULL COMMENT 'The date the referral was made',
is_review tinyint(1) DEFAULT NULL COMMENT 'Whether this referral is a review',
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',
requester_organization_id bigint DEFAULT NULL COMMENT 'Reference to the organisation that made the refereral request',
outgoing_referral tinyint(1) DEFAULT NULL COMMENT 'Whether this is an outgoing referral',
non_core_concept_id int DEFAULT NULL COMMENT 'Reference to the clinical coding of the referral',
referral_request_type_concept_id int DEFAULT NULL COMMENT 'Reference to the type of referral request',
referral_request_priority_concept_id smallint DEFAULT NULL COMMENT 'Reference to the priority of the referral',
encounter_id bigint DEFAULT NULL COMMENT 'Reference to the encounter the referral was made in',
person_id bigint NOT NULL COMMENT 'Unique individual across all organisations',
Mode varchar(50) DEFAULT NULL COMMENT 'The mode of the referral',
practitioner_id bigint DEFAULT NULL COMMENT 'The clinician the activity is recorded against',
recipient_organization_id bigint DEFAULT NULL COMMENT 'Reference to the organization receiving the referral',
date_recorded datetime DEFAULT NULL COMMENT 'The date the referral request was added to the source system',
age_at_event decimal(5,2) DEFAULT NULL COMMENT 'The age of the patient at the time of the referral',
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)',
organization_id bigint NOT NULL COMMENT 'Owning organisation (i.e. publisher)',
core_concept_id int DEFAULT NULL COMMENT 'Reference to the clinical coding of the referral',
id bigint NOT NULL COMMENT 'Unique Id of the referral',
PRIMARY KEY CONSTRAINT(s) `organization_id`,`person_id`,`id`),

registration_status_history

<tbody> </tbody>
Column Name Type Constraint Comment
person_id bigint NOT NULL COMMENT 'Reference to the person this registration status history belongs to',
start_date datetime DEFAULT NULL COMMENT 'The start date for the period this registration status history was valid',
id bigint NOT NULL COMMENT 'Unique Id of the registration status history',
organization_id bigint NOT NULL COMMENT 'Owning organisation (i.e. publisher)',
registration_status_concept_id int DEFAULT NULL COMMENT 'Reference to the registration status',
patient_id bigint NOT NULL COMMENT 'Reference to the patient this registration status history belongs to',
end_date datetime DEFAULT NULL COMMENT 'The end date for the period this registration status history was valid',
episode_of_care_id bigint DEFAULT NULL COMMENT 'Reference to the episode of care this status history belongs to',
PRIMARY KEY CONSTRAINT(s) `organization_id`,`id`,`patient_id`,`person_id`),

schedule

<tbody> </tbody>
Column Name Type Constraint Comment
id bigint NOT NULL COMMENT 'Unique Id of the schedule',
practitioner_id bigint DEFAULT NULL COMMENT 'Reference to the practitioner who owns the schedule',
start_date date DEFAULT NULL COMMENT 'The start date of the schedule',
organization_id bigint NOT NULL COMMENT 'Owning organisation (i.e. publisher)',
name varchar(150) DEFAULT NULL COMMENT 'The name of the schedule',
type varchar(255) DEFAULT NULL COMMENT 'The type of schedule eg Timed Appointments',
location varchar(255) DEFAULT NULL COMMENT 'Textual description of the location the schedule was held at',
PRIMARY KEY CONSTRAINT(s) `organization_id`,`id`),