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.2test</h1>
<h1 id="firstHeading" class="firstHeading" lang="en-GB">Remote Subscriber Database (RSD) Schema (Compass 2) Version: v2.1.3</h1>
<div id="bodyContent" class="mw-body-content">
<div id="bodyContent" class="mw-body-content">
Line 11: Line 11:
<th scope="col">Constraint</th>
<th scope="col">Constraint</th>
<th scope="col">Comment</th>
<th scope="col">Comment</th>
<th scope="col">Foreign Key Reference</th>
</tr>
</tr>
<tr>
<tr>
Line 17: Line 18:
<td>NOT NULL</td>
<td>NOT NULL</td>
<td> 'Unique Id of the allergy'</td>
<td> 'Unique Id of the allergy'</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
Line 23: Line 25:
<td>NOT NULL</td>
<td>NOT NULL</td>
<td> 'Owning organisation (i.e. publisher)'</td>
<td> 'Owning organisation (i.e. publisher)'</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
Line 29: Line 32:
<td>NOT NULL</td>
<td>NOT NULL</td>
<td> 'The organisations record for this person’s registration. Patients may have multiple records across clinical systems and may have registered at an organisation multiple times'</td>
<td> 'The organisations record for this person’s registration. Patients may have multiple records across clinical systems and may have registered at an organisation multiple times'</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
Line 35: Line 39:
<td>NOT NULL</td>
<td>NOT NULL</td>
<td> 'Unique individual across all organisations'</td>
<td> 'Unique individual across all organisations'</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
Line 41: Line 46:
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> 'Reference to the encounter this allergy was record in'</td>
<td> 'Reference to the encounter this allergy was record in'</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
Line 47: Line 53:
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> 'The clinician the activity is recorded against'</td>
<td> 'The clinician the activity is recorded against'</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
Line 53: Line 60:
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> 'The date the clinical code is recorded for'</td>
<td> 'The date the clinical code is recorded for'</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
Line 59: Line 67:
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> 'Identifies the precision of the clinical effectiveness date to either year (1) month (2) day (5) minute (12) second (13) millisecond (14)'</td>
<td> 'Identifies the precision of the clinical effectiveness date to either year (1) month (2) day (5) minute (12) second (13) millisecond (14)'</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
Line 65: Line 74:
<td>NOT NULL</td>
<td>NOT NULL</td>
<td> 'Is this instance of the code a review of a previous encounter'</td>
<td> 'Is this instance of the code a review of a previous encounter'</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
Line 71: Line 81:
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> 'Reference to the clinical coding of the allergy'</td>
<td> 'Reference to the clinical coding of the allergy'</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
Line 77: Line 88:
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> 'Reference to the clinical coding of the allergy'</td>
<td> 'Reference to the clinical coding of the allergy'</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
Line 83: Line 95:
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> 'The age the patient was at the time of this event'</td>
<td> 'The age the patient was at the time of this event'</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
Line 89: Line 102:
<td>NOT NULL</td>
<td>NOT NULL</td>
<td> 'The date the allergy was recorded'</td>
<td> 'The date the allergy was recorded'</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
<td colspan="5">Unique index name: `allergy_intolerance_id` Index Columns: (id)</td> </tr> <tr>
<td colspan="5">Unique index name: `allergy_intolerance_id` Index Columns: (id)</td> </tr> <tr>
<td colspan="5">Index name: `fk_allergy_intolerance_encounter_id` Index Columns: (encounter_id)</td> </tr> <tr>
<td colspan="5">Index name: `fk_allergy_intolerance_patient_id_organization_id` Index Columns: (patient_id,organization_id)</td> </tr> <tr>
<td colspan="5">Index name: `fk_allergy_intolerance_practitioner_id` Index Columns: (practitioner_id)</td> </tr> <tr>
<td colspan="5">Index name: `allergy_intolerance_patient_id` Index Columns: (patient_id)</td> </tr> <tr>
<td colspan="5">Index name: `allergy_intolerance_patient_id` Index Columns: (patient_id)</td> </tr> <tr>
<td colspan="5">Index name: `allergy_intolerance_core_concept_id` Index Columns: (core_concept_id)</td> </tr> <tr>
<td colspan="5">Index name: `allergy_intolerance_core_concept_id` Index Columns: (core_concept_id)</td> </tr> <tr>
Line 102: Line 119:
<th scope="col">Constraint</th>
<th scope="col">Constraint</th>
<th scope="col">Comment</th>
<th scope="col">Comment</th>
<th scope="col">Foreign Key Reference</th>
</tr>
</tr>
<tr>
<tr>
Line 108: Line 126:
<td>NOT NULL</td>
<td>NOT NULL</td>
<td> 'Unique Id of the appointment'</td>
<td> 'Unique Id of the appointment'</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
Line 114: Line 133:
<td>NOT NULL</td>
<td>NOT NULL</td>
<td> 'Owning organisation (i.e. publisher)'</td>
<td> 'Owning organisation (i.e. publisher)'</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
Line 120: Line 140:
<td>NOT NULL</td>
<td>NOT NULL</td>
<td> 'The organisations record for this person’s registration. Patients may have multiple records across clinical systems and may have registered at an organisation multiple times'</td>
<td> 'The organisations record for this person’s registration. Patients may have multiple records across clinical systems and may have registered at an organisation multiple times'</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
Line 126: Line 147:
<td>NOT NULL</td>
<td>NOT NULL</td>
<td> 'Unique individual across all organisations'</td>
<td> 'Unique individual across all organisations'</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
Line 132: Line 154:
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> 'The clinician the activity is recorded against'</td>
<td> 'The clinician the activity is recorded against'</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
Line 138: Line 161:
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> 'The schedule the patient was put on to book multiple appointments. ID unique to the applied schedule'</td>
<td> 'The schedule the patient was put on to book multiple appointments. ID unique to the applied schedule'</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
Line 144: Line 168:
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> 'The start date of the appointment'</td>
<td> 'The start date of the appointment'</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
Line 150: Line 175:
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> 'The time allocated for the appointment, not necessarily the actual duration always in minutes'</td>
<td> 'The time allocated for the appointment, not necessarily the actual duration always in minutes'</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
Line 156: Line 182:
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> 'Time between sent in and left always in minutes'</td>
<td> 'Time between sent in and left always in minutes'</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
Line 162: Line 189:
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> 'The status of the appointment e.g. arrived/sent in/left/DNA'</td>
<td> 'The status of the appointment e.g. arrived/sent in/left/DNA'</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
Line 168: Line 196:
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> 'How long the patient waited from being marked as arrived to being sent in'</td>
<td> 'How long the patient waited from being marked as arrived to being sent in'</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
Line 174: Line 203:
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> 'How long the patient was delayed for'</td>
<td> 'How long the patient was delayed for'</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
Line 180: Line 210:
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> 'Date and time the patient was sent into the practitioner'</td>
<td> 'Date and time the patient was sent into the practitioner'</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
Line 186: Line 217:
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> 'Date and time the patient left the practitioner'</td>
<td> 'Date and time the patient left the practitioner'</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
Line 192: Line 224:
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> 'Unique reference to the source of the appointment'</td>
<td> 'Unique reference to the source of the appointment'</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
Line 198: Line 231:
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> 'The date the appointment was cancelled'</td>
<td> 'The date the appointment was cancelled'</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
<td colspan="5">Unique index name: `appointment_id` Index Columns: (id)</td> </tr> <tr>
<td colspan="5">Unique index name: `appointment_id` Index Columns: (id)</td> </tr> <tr>
<td colspan="5">Index name: `fk_appointment_practitioner_id` Index Columns: (practitioner_id)</td> </tr> <tr>
<td colspan="5">Index name: `appointment_patient_id` Index Columns: (patient_id)</td> </tr> <tr>
<td colspan="5">Index name: `appointment_patient_id` Index Columns: (patient_id)</td> </tr> <tr>
<td colspan="5">PRIMARY KEY CONSTRAINT(s) (`organization_id`,`person_id`,`id`)</td> </tr> </table>
<td colspan="5">PRIMARY KEY CONSTRAINT(s) (`organization_id`,`person_id`,`id`)</td> </tr> </table>
Line 210: Line 245:
<th scope="col">Constraint</th>
<th scope="col">Constraint</th>
<th scope="col">Comment</th>
<th scope="col">Comment</th>
<th scope="col">Foreign Key Reference</th>
</tr>
</tr>
<tr>
<tr>
Line 216: Line 252:
<td>NOT NULL</td>
<td>NOT NULL</td>
<td> 'same as the id column on the patient table '</td>
<td> 'same as the id column on the patient table '</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
Line 222: Line 259:
<td>NOT NULL</td>
<td>NOT NULL</td>
<td> 'IM reference (e.g. appointment type)'</td>
<td> 'IM reference (e.g. appointment type)'</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
Line 227: Line 265:
<td>int</td>
<td>int</td>
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> 'IM reference (e.g. Appointment Type)'</td>
<td> 'IM reference (e.g. appointment type)'</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
Line 234: Line 273:
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> 'where there is no mapped value_id, just raw JSON'</td>
<td> 'where there is no mapped value_id, just raw JSON'</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
Line 240: Line 280:
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> 'where there is no mapped value_id or raw JSON, just a basic text value (i.e. GP Practitioner number)'</td>
<td> 'where there is no mapped value_id or raw JSON, just a basic text value (i.e. GP Practitioner number)'</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
Line 251: Line 292:
<th scope="col">Constraint</th>
<th scope="col">Constraint</th>
<th scope="col">Comment</th>
<th scope="col">Comment</th>
<th scope="col">Foreign Key Reference</th>
</tr>
</tr>
<tr>
<tr>
Line 256: Line 298:
<td>int</td>
<td>int</td>
<td>NOT NULL</td>
<td>NOT NULL</td>
<td> 'Unique Id of the concept'</td>
<td> 'Unique concept int DB identifier'</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
<td>Document</td>
<td>document</td>
<td>int</td>
<td>int</td>
<td>NOT NULL</td>
<td>DEFAULT NULL</td>
<td> 'Concept grouping construct, deprecated'</td>
<td> 'Document this concept originated from'</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
<td>Id</td>
<td>id</td>
<td>varchar(150)</td>
<td>varchar(150)</td>
<td>NOT NULL</td>
<td>CHARACTER SET</td>
<td> 'Unique concept identifier'</td>
<td> 'Unique human-readable concept id'</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
<td>Draft</td>
<td>draft</td>
<td>tinyint(1)</td>
<td>tinyint(1)</td>
<td>NOT NULL</td>
<td>DEFAULT NULL,</td>
<td> 'Whether its draft/autocreated or confirmed as a "proper" concept'</td>
<td>No comment yet added</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
<td>Name</td>
<td>name</td>
<td>varchar(255)</td>
<td>varchar(255)</td>
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> 'Short name'</td>
<td> 'Short name'</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
<td>Description</td>
<td>description</td>
<td>varchar(400)</td>
<td>varchar(400)</td>
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> 'Full name (or term for ontological concepts)'</td>
<td> 'Full name (or term for ontological concepts)'</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
<td>Scheme</td>
<td>scheme</td>
<td>bigint</td>
<td>bigint</td>
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> 'The coding scheme for the code (Read, CTV3, SNOMED etc)'</td>
<td> 'The coding scheme for the code (Read, CTV3, SNOMED etc)'</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
<td>Code</td>
<td>code</td>
<td>varchar(40)</td>
<td>varchar(40)</td>
<td>DEFAULT NULL</td>
<td>CHARACTER SET</td>
<td> 'The code (non-unique unless coupled with a scheme)'</td>
<td> 'The code (non-unique unless coupled with a scheme)'</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
<td>use_count</td>
<td>use_count</td>
<td>bigint</td>
<td>bigint</td>
<td>NOT NULL</td>
<td>No Constraint</td>
<td> 'Rough indicator of number of occurences of the concept'</td>
<td> 'Rough indicator of number of occurences of the concept'</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
Line 311: Line 362:
<td>NOT NULL</td>
<td>NOT NULL</td>
<td> 'The timestamp of the last update to the concept'</td>
<td> 'The timestamp of the last update to the concept'</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
<td colspan="5">Index name: `ix_scheme_code` Index Columns: (Scheme,Code)</td> </tr> <tr>
<td colspan="5">Index name: `ix_scheme_code` Index Columns: (scheme,code)</td> </tr> <tr>
<td colspan="5">Index name: `ix_code` Index Columns: (Code)</td> </tr> <tr>
<td colspan="5">Index name: `ix_code` Index Columns: (code)</td> </tr> <tr>
<td colspan="5">Index name: `ix_dbid_code` Index Columns: (dbid,Code)</td> </tr> <tr>
<td colspan="5">Index name: `ix_dbid_code` Index Columns: (dbid,code)</td> </tr> <tr>
<td colspan="5">PRIMARY KEY CONSTRAINT(s) (`dbid`)</td> </tr> </table>
<td colspan="5">PRIMARY KEY CONSTRAINT(s) (`dbid`)</td> </tr> </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>
Line 324: Line 376:
<th scope="col">Constraint</th>
<th scope="col">Constraint</th>
<th scope="col">Comment</th>
<th scope="col">Comment</th>
<th scope="col">Foreign Key Reference</th>
</tr>
</tr>
<tr>
<tr>
Line 330: Line 383:
<td>NOT NULL</td>
<td>NOT NULL</td>
<td> 'the legacy (read 2, ctv3, icd10, opcs4, emis local, etc) concept'</td>
<td> 'the legacy (read 2, ctv3, icd10, opcs4, emis local, etc) concept'</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
Line 336: Line 390:
<td>NOT NULL</td>
<td>NOT NULL</td>
<td> 'the core (snomed, discovery) concept that the legacy concept maps to'</td>
<td> 'the core (snomed, discovery) concept that the legacy concept maps to'</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
Line 342: Line 397:
<td>NOT NULL</td>
<td>NOT NULL</td>
<td> 'Timestamp the map was last updated/added'</td>
<td> 'Timestamp the map was last updated/added'</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
Line 348: Line 404:
<td>NOT NULL,</td>
<td>NOT NULL,</td>
<td>No comment yet added</td>
<td>No comment yet added</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
Line 354: Line 411:
<td>DEFAULT NULL,</td>
<td>DEFAULT NULL,</td>
<td>No comment yet added</td>
<td>No comment yet added</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
Line 366: Line 424:
<th scope="col">Constraint</th>
<th scope="col">Constraint</th>
<th scope="col">Comment</th>
<th scope="col">Comment</th>
<th scope="col">Foreign Key Reference</th>
</tr>
</tr>
<tr>
<tr>
Line 372: Line 431:
<td>NOT NULL</td>
<td>NOT NULL</td>
<td> 'Unique Id of the diagnostic order'</td>
<td> 'Unique Id of the diagnostic order'</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
Line 378: Line 438:
<td>NOT NULL</td>
<td>NOT NULL</td>
<td> 'Owning organisation (i.e. publisher)'</td>
<td> 'Owning organisation (i.e. publisher)'</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
Line 384: Line 445:
<td>NOT NULL</td>
<td>NOT NULL</td>
<td> 'The organisations record for this person’s registration. Patients may have multiple records across clinical systems and may have registered at an organisation multiple times'</td>
<td> 'The organisations record for this person’s registration. Patients may have multiple records across clinical systems and may have registered at an organisation multiple times'</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
Line 390: Line 452:
<td>NOT NULL</td>
<td>NOT NULL</td>
<td> 'Unique individual across all organisations'</td>
<td> 'Unique individual across all organisations'</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
Line 396: Line 459:
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> 'Reference to the encounter the observation was recorded at'</td>
<td> 'Reference to the encounter the observation was recorded at'</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
Line 402: Line 466:
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> 'The clinician the activity is recorded against'</td>
<td> 'The clinician the activity is recorded against'</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
<td>clinical_effective_date</td>
<td>clinical_effective_date</td>
<td>date</td>
<td>datetime</td>
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> 'The date the diagnostic order was identified by a clinician'</td>
<td> 'The date the diagnostic order was identified by a clinician'</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
Line 414: Line 480:
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> 'Identifies the precision of the clinical effectiveness date to either year (1) month (2) day (5) minute (12) second (13) millisecond (14)'</td>
<td> 'Identifies the precision of the clinical effectiveness date to either year (1) month (2) day (5) minute (12) second (13) millisecond (14)'</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
Line 420: Line 487:
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> 'The value of the result of the observation'</td>
<td> 'The value of the result of the observation'</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
Line 426: Line 494:
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> 'The units of the result of the observation'</td>
<td> 'The units of the result of the observation'</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
Line 432: Line 501:
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> 'The date of the result'</td>
<td> 'The date of the result'</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
Line 438: Line 508:
<td>No Constraint</td>
<td>No Constraint</td>
<td> 'Any text associated with the result'</td>
<td> 'Any text associated with the result'</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
Line 444: Line 515:
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> 'Reference to the clinical coding of the result'</td>
<td> 'Reference to the clinical coding of the result'</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
Line 450: Line 522:
<td>NOT NULL</td>
<td>NOT NULL</td>
<td> 'Whether the observation is marked as a problem'</td>
<td> 'Whether the observation is marked as a problem'</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
Line 456: Line 529:
<td>NOT NULL</td>
<td>NOT NULL</td>
<td> 'Whether the observation is a review of an existing problem'</td>
<td> 'Whether the observation is a review of an existing problem'</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
Line 462: Line 536:
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> 'The end date of the problem'</td>
<td> 'The end date of the problem'</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
Line 468: Line 543:
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> 'Reference to the parent observation in a complex observation eg systolic and diastolic blood pressures will have a parent observation of Blood pressure'</td>
<td> 'Reference to the parent observation in a complex observation eg systolic and diastolic blood pressures will have a parent observation of Blood pressure'</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
Line 474: Line 550:
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> 'Reference to the clinical coding of the observation'</td>
<td> 'Reference to the clinical coding of the observation'</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
Line 480: Line 557:
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> 'Reference to the clinical coding of the observation'</td>
<td> 'Reference to the clinical coding of the observation'</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
Line 486: Line 564:
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> 'The age of the patient at the time of the observation'</td>
<td> 'The age of the patient at the time of the observation'</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
Line 492: Line 571:
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> 'Reference to the episodicity of the problem eg First, review, flare'</td>
<td> 'Reference to the episodicity of the problem eg First, review, flare'</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
Line 498: Line 578:
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> 'Whether the diagnostic order is a primary order'</td>
<td> 'Whether the diagnostic order is a primary order'</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
Line 504: Line 585:
<td>DEFAULT NULL,</td>
<td>DEFAULT NULL,</td>
<td>No comment yet added</td>
<td>No comment yet added</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
<td colspan="5">Unique index name: `diagnostic_order_id` Index Columns: (id)</td> </tr> <tr>
<td colspan="5">Unique index name: `diagnostic_order_id` Index Columns: (id)</td> </tr> <tr>
<td colspan="5">Index name: `fk_diagnostic_order_encounter_id` Index Columns: (encounter_id)</td> </tr> <tr>
<td colspan="5">Index name: `fk_diagnostic_order_patient_id_organization_id` Index Columns: (patient_id,organization_id)</td> </tr> <tr>
<td colspan="5">Index name: `fk_diagnostic_order_practitioner_id` Index Columns: (practitioner_id)</td> </tr> <tr>
<td colspan="5">Index name: `diagnostic_order_patient_id` Index Columns: (patient_id)</td> </tr> <tr>
<td colspan="5">Index name: `diagnostic_order_patient_id` Index Columns: (patient_id)</td> </tr> <tr>
<td colspan="5">Index name: `diagnostic_order_core_concept_id` Index Columns: (core_concept_id)</td> </tr> <tr>
<td colspan="5">Index name: `diagnostic_order_core_concept_id` Index Columns: (core_concept_id)</td> </tr> <tr>
Line 523: Line 608:
<th scope="col">Constraint</th>
<th scope="col">Constraint</th>
<th scope="col">Comment</th>
<th scope="col">Comment</th>
<th scope="col">Foreign Key Reference</th>
</tr>
</tr>
<tr>
<tr>
Line 529: Line 615:
<td>NOT NULL</td>
<td>NOT NULL</td>
<td> 'Unique Id of the encounter'</td>
<td> 'Unique Id of the encounter'</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
Line 535: Line 622:
<td>NOT NULL</td>
<td>NOT NULL</td>
<td> 'Owning organisation (i.e. publisher)'</td>
<td> 'Owning organisation (i.e. publisher)'</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
Line 541: Line 629:
<td>NOT NULL</td>
<td>NOT NULL</td>
<td> 'The organisations record for this person’s registration. Patients may have multiple records across clinical systems and may have registered at an organisation multiple times'</td>
<td> 'The organisations record for this person’s registration. Patients may have multiple records across clinical systems and may have registered at an organisation multiple times'</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
Line 547: Line 636:
<td>NOT NULL</td>
<td>NOT NULL</td>
<td> 'Unique individual across all organisations'</td>
<td> 'Unique individual across all organisations'</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
Line 553: Line 643:
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> 'The clinician the activity is recorded against'</td>
<td> 'The clinician the activity is recorded against'</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
Line 559: Line 650:
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> 'Reference to the appointment this encounter took part on'</td>
<td> 'Reference to the appointment this encounter took part on'</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
Line 565: Line 657:
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> 'The date the clinical code is recorded for'</td>
<td> 'The date the clinical code is recorded for'</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
Line 571: Line 664:
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> 'Reference to the precision of the date of the encounter'</td>
<td> 'Reference to the precision of the date of the encounter'</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
Line 577: Line 671:
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> 'Is this instance of the code a review of a previous encounter'</td>
<td> 'Is this instance of the code a review of a previous encounter'</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
Line 583: Line 678:
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> 'Reference to the service provider organisation'</td>
<td> 'Reference to the service provider organisation'</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
Line 589: Line 685:
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> 'Reference to the type of encounter'</td>
<td> 'Reference to the type of encounter'</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
Line 595: Line 692:
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> 'Reference to the type of encounter'</td>
<td> 'Reference to the type of encounter'</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
Line 601: Line 699:
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> 'The age the patient was when this encounter took place'</td>
<td> 'The age the patient was when this encounter took place'</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
<td>Type</td>
<td>type</td>
<td>text</td>
<td>text</td>
<td>No Constraint</td>
<td>No Constraint</td>
<td> 'Unused'</td>
<td> 'Unused'</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
Line 613: Line 713:
<td>No Constraint</td>
<td>No Constraint</td>
<td> 'Unused'</td>
<td> 'Unused'</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
Line 619: Line 720:
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> 'The admission method of the encounter'</td>
<td> 'The admission method of the encounter'</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
Line 625: Line 727:
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> 'The end date of the encounter'</td>
<td> 'The end date of the encounter'</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
Line 631: Line 734:
<td>No Constraint</td>
<td>No Constraint</td>
<td> 'Reference to the institution the encounter took place at'</td>
<td> 'Reference to the institution the encounter took place at'</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
Line 637: Line 741:
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> 'The date the encounter was recorded'</td>
<td> 'The date the encounter was recorded'</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
<td colspan="5">Unique index name: `encounter_id` Index Columns: (id)</td> </tr> <tr>
<td colspan="5">Unique index name: `encounter_id` Index Columns: (id)</td> </tr> <tr>
<td colspan="5">Index name: `fk_encounter_practitioner_id` Index Columns: (practitioner_id)</td> </tr> <tr>
<td colspan="5">Index name: `fk_encounter_episode_of_care_id` Index Columns: (episode_of_care_id)</td> </tr> <tr>
<td colspan="5">Index name: `fk_encounter_service_provider_organization_id` Index Columns: (service_provider_organization_id)</td> </tr> <tr>
<td colspan="5">Index name: `encounter_patient_id` Index Columns: (patient_id)</td> </tr> <tr>
<td colspan="5">Index name: `encounter_patient_id` Index Columns: (patient_id)</td> </tr> <tr>
<td colspan="5">Index name: `fki_encounter_appointment_id` Index Columns: (appointment_id)</td> </tr> <tr>
<td colspan="5">Index name: `fki_encounter_appointment_id` Index Columns: (appointment_id)</td> </tr> <tr>
Line 652: Line 760:
<th scope="col">Constraint</th>
<th scope="col">Constraint</th>
<th scope="col">Comment</th>
<th scope="col">Comment</th>
<th scope="col">Foreign Key Reference</th>
</tr>
</tr>
<tr>
<tr>
Line 658: Line 767:
<td>NOT NULL</td>
<td>NOT NULL</td>
<td> 'same as the id column on the encounter table'</td>
<td> 'same as the id column on the encounter table'</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
Line 664: Line 774:
<td>NOT NULL</td>
<td>NOT NULL</td>
<td> 'IM concept id reference (i.e. Admission method)'</td>
<td> 'IM concept id reference (i.e. Admission method)'</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
Line 670: Line 781:
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> 'IM concept id reference (i.e. Emergency admission)'</td>
<td> 'IM concept id reference (i.e. Emergency admission)'</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
Line 676: Line 788:
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> 'where there is no mapped value_id, just raw JSON (i.e. birth delivery details)'</td>
<td> 'where there is no mapped value_id, just raw JSON (i.e. birth delivery details)'</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
Line 682: Line 795:
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> 'where there is no mapped value_id, or raw JSON, just a basic text value (i.e. FIN number)'</td>
<td> 'where there is no mapped value_id, or raw JSON, just a basic text value (i.e. FIN number)'</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
Line 693: Line 807:
<th scope="col">Constraint</th>
<th scope="col">Constraint</th>
<th scope="col">Comment</th>
<th scope="col">Comment</th>
<th scope="col">Foreign Key Reference</th>
</tr>
</tr>
<tr>
<tr>
Line 699: Line 814:
<td>NOT NULL</td>
<td>NOT NULL</td>
<td> 'Unique Id of the encounter event'</td>
<td> 'Unique Id of the encounter event'</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
Line 705: Line 821:
<td>NOT NULL</td>
<td>NOT NULL</td>
<td> 'Owning organisation (i.e. publisher)'</td>
<td> 'Owning organisation (i.e. publisher)'</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
Line 711: Line 828:
<td>NOT NULL</td>
<td>NOT NULL</td>
<td> 'The patient this event belongs to'</td>
<td> 'The patient this event belongs to'</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
Line 717: Line 835:
<td>NOT NULL</td>
<td>NOT NULL</td>
<td> 'The person this event belongs to'</td>
<td> 'The person this event belongs to'</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
Line 723: Line 842:
<td>NOT NULL</td>
<td>NOT NULL</td>
<td> 'Reference to the parent encounter record'</td>
<td> 'Reference to the parent encounter record'</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
Line 729: Line 849:
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> 'The clinician the activity is recorded against'</td>
<td> 'The clinician the activity is recorded against'</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
Line 735: Line 856:
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> 'Reference to the appointment this encounter took part on'</td>
<td> 'Reference to the appointment this encounter took part on'</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
Line 741: Line 863:
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> 'The date the encounter took place'</td>
<td> 'The date the encounter took place'</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
Line 747: Line 870:
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> 'Reference to the precision of the date of the encounter'</td>
<td> 'Reference to the precision of the date of the encounter'</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
Line 753: Line 877:
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> 'Reference to the episode of care this encounter belongs to'</td>
<td> 'Reference to the episode of care this encounter belongs to'</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
Line 759: Line 884:
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> 'Reference to the service provider organisation'</td>
<td> 'Reference to the service provider organisation'</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
Line 765: Line 891:
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> 'Reference to the type of encounter'</td>
<td> 'Reference to the type of encounter'</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
Line 771: Line 898:
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> 'Reference to the type of encounter'</td>
<td> 'Reference to the type of encounter'</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
Line 777: Line 905:
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> 'The age of the patient at the time of the encounter'</td>
<td> 'The age of the patient at the time of the encounter'</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
Line 783: Line 912:
<td>No Constraint</td>
<td>No Constraint</td>
<td> 'Unused'</td>
<td> 'Unused'</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
Line 789: Line 919:
<td>No Constraint</td>
<td>No Constraint</td>
<td> 'Unused'</td>
<td> 'Unused'</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
Line 795: Line 926:
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> 'The admission method of the encounter'</td>
<td> 'The admission method of the encounter'</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
Line 801: Line 933:
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> 'The end date of the encounter'</td>
<td> 'The end date of the encounter'</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
Line 807: Line 940:
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> 'Reference to the institution the encounter took place at'</td>
<td> 'Reference to the institution the encounter took place at'</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
Line 813: Line 947:
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> 'The date the encounter was recorded'</td>
<td> 'The date the encounter was recorded'</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
Line 819: Line 954:
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> 'Whether the encounter is finished'</td>
<td> 'Whether the encounter is finished'</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
<td colspan="5">Unique index name: `encounter_event_id` Index Columns: (id)</td> </tr> <tr>
<td colspan="5">Unique index name: `encounter_event_id` Index Columns: (id)</td> </tr> <tr>
<td colspan="5">Index name: `fk_encounter_event_patient_id_organization_id` Index Columns: (patient_id,organization_id)</td> </tr> <tr>
<td colspan="5">Index name: `fk_encounter_event_practitioner_id` Index Columns: (practitioner_id)</td> </tr> <tr>
<td colspan="5">Index name: `fk_encounter_event_episode_of_care_id` Index Columns: (episode_of_care_id)</td> </tr> <tr>
<td colspan="5">Index name: `fk_encounter_event_service_provider_organization_id` Index Columns: (service_provider_organization_id)</td> </tr> <tr>
<td colspan="5">PRIMARY KEY CONSTRAINT(s) (`organization_id`,`person_id`,`id`)</td> </tr> </table>
<td colspan="5">PRIMARY KEY CONSTRAINT(s) (`organization_id`,`person_id`,`id`)</td> </tr> </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>
Line 830: Line 970:
<th scope="col">Constraint</th>
<th scope="col">Constraint</th>
<th scope="col">Comment</th>
<th scope="col">Comment</th>
<th scope="col">Foreign Key Reference</th>
</tr>
</tr>
<tr>
<tr>
Line 836: Line 977:
<td>NOT NULL</td>
<td>NOT NULL</td>
<td> 'Unique Id of the episode of care'</td>
<td> 'Unique Id of the episode of care'</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
Line 842: Line 984:
<td>NOT NULL</td>
<td>NOT NULL</td>
<td> 'Owning organisation (i.e. publisher)'</td>
<td> 'Owning organisation (i.e. publisher)'</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
Line 848: Line 991:
<td>NOT NULL</td>
<td>NOT NULL</td>
<td> 'The organisations record for this person’s registration. Patients may have multiple records across clinical systems and may have registered at an organisation multiple times'</td>
<td> 'The organisations record for this person’s registration. Patients may have multiple records across clinical systems and may have registered at an organisation multiple times'</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
Line 854: Line 998:
<td>NOT NULL</td>
<td>NOT NULL</td>
<td> 'Unique individual across all organisations'</td>
<td> 'Unique individual across all organisations'</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
Line 860: Line 1,005:
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> 'Reference to the registration type of the patient'</td>
<td> 'Reference to the registration type of the patient'</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
Line 866: Line 1,012:
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> 'Reference to the registration status of the patient'</td>
<td> 'Reference to the registration status of the patient'</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
Line 872: Line 1,019:
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> 'The date the registration was started  for this episode of care'</td>
<td> 'The date the registration was started  for this episode of care'</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
Line 878: Line 1,026:
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> 'The date the registration was ended  for this episode of care'</td>
<td> 'The date the registration was ended  for this episode of care'</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
Line 884: Line 1,033:
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> 'Reference to the usual GP for this episode of care'</td>
<td> 'Reference to the usual GP for this episode of care'</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
<td colspan="5">Unique index name: `episode_of_care_id` Index Columns: (id)</td> </tr> <tr>
<td colspan="5">Unique index name: `episode_of_care_id` Index Columns: (id)</td> </tr> <tr>
<td colspan="5">Index name: `fk_episode_of_care_patient_id_organisation_id` Index Columns: (patient_id,organization_id)</td> </tr> <tr>
<td colspan="5">Index name: `fk_episode_of_care_practitioner_id` Index Columns: (usual_gp_practitioner_id)</td> </tr> <tr>
<td colspan="5">Index name: `episode_of_care_patient_id` Index Columns: (patient_id)</td> </tr> <tr>
<td colspan="5">Index name: `episode_of_care_patient_id` Index Columns: (patient_id)</td> </tr> <tr>
<td colspan="5">Index name: `episode_of_care_registration_type_concept_id` Index Columns: (registration_type_concept_id)</td> </tr> <tr>
<td colspan="5">Index name: `episode_of_care_registration_type_concept_id` Index Columns: (registration_type_concept_id)</td> </tr> <tr>
Line 901: Line 1,053:
<th scope="col">Constraint</th>
<th scope="col">Constraint</th>
<th scope="col">Comment</th>
<th scope="col">Comment</th>
<th scope="col">Foreign Key Reference</th>
</tr>
</tr>
<tr>
<tr>
Line 907: Line 1,060:
<td>NOT NULL</td>
<td>NOT NULL</td>
<td> 'date time the change was made to this DB'</td>
<td> 'date time the change was made to this DB'</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
Line 913: Line 1,067:
<td>NOT NULL</td>
<td>NOT NULL</td>
<td> 'type of transaction 0=insert, 1=update, 2=delete'</td>
<td> 'type of transaction 0=insert, 1=update, 2=delete'</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
Line 919: Line 1,074:
<td>NOT NULL</td>
<td>NOT NULL</td>
<td> 'identifier of the table changed'</td>
<td> 'identifier of the table changed'</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
Line 925: Line 1,081:
<td>NOT NULL</td>
<td>NOT NULL</td>
<td> 'id of the record changed'</td>
<td> 'id of the record changed'</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
</table>
</table>
Line 934: Line 1,091:
<th scope="col">Constraint</th>
<th scope="col">Constraint</th>
<th scope="col">Comment</th>
<th scope="col">Comment</th>
<th scope="col">Foreign Key Reference</th>
</tr>
</tr>
<tr>
<tr>
Line 940: Line 1,098:
<td>NOT NULL</td>
<td>NOT NULL</td>
<td> 'Unique Id of the flag'</td>
<td> 'Unique Id of the flag'</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
Line 946: Line 1,105:
<td>NOT NULL</td>
<td>NOT NULL</td>
<td> 'Owning organisation (i.e. publisher)'</td>
<td> 'Owning organisation (i.e. publisher)'</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
Line 952: Line 1,112:
<td>NOT NULL</td>
<td>NOT NULL</td>
<td> 'The organisations record for this person’s registration. Patients may have multiple records across clinical systems and may have registered at an organisation multiple times'</td>
<td> 'The organisations record for this person’s registration. Patients may have multiple records across clinical systems and may have registered at an organisation multiple times'</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
Line 958: Line 1,119:
<td>NOT NULL</td>
<td>NOT NULL</td>
<td> 'Unique individual across all organisations'</td>
<td> 'Unique individual across all organisations'</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
<td>effective_date</td>
<td>effective_date</td>
<td>date</td>
<td>datetime</td>
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> 'The date the flag was entered onto the patients record'</td>
<td> 'The date the flag was entered onto the patients record'</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
Line 970: Line 1,133:
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> 'Identifies the precision of the clinical effectiveness date to either year (1) month (2) day (5) minute (12) second (13) millisecond (14)'</td>
<td> 'Identifies the precision of the clinical effectiveness date to either year (1) month (2) day (5) minute (12) second (13) millisecond (14)'</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
Line 976: Line 1,140:
<td>NOT NULL</td>
<td>NOT NULL</td>
<td> 'Whether the flag is active or not'</td>
<td> 'Whether the flag is active or not'</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
Line 982: Line 1,147:
<td>No Constraint</td>
<td>No Constraint</td>
<td> 'This is a warning set by the publisher regarding he patient'</td>
<td> 'This is a warning set by the publisher regarding he patient'</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
<td colspan="5">Unique index name: `flag_id` Index Columns: (id)</td> </tr> <tr>
<td colspan="5">Unique index name: `flag_id` Index Columns: (id)</td> </tr> <tr>
<td colspan="5">Index name: `fk_flag_patient_id_organization_id` Index Columns: (patient_id,organization_id)</td> </tr> <tr>
<td colspan="5">Index name: `flag_patient_id` Index Columns: (patient_id)</td> </tr> <tr>
<td colspan="5">Index name: `flag_patient_id` Index Columns: (patient_id)</td> </tr> <tr>
<td colspan="5">PRIMARY KEY CONSTRAINT(s) (`organization_id`,`person_id`,`id`)</td> </tr> </table>
<td colspan="5">PRIMARY KEY CONSTRAINT(s) (`organization_id`,`person_id`,`id`)</td> </tr> </table>
Line 994: Line 1,161:
<th scope="col">Constraint</th>
<th scope="col">Constraint</th>
<th scope="col">Comment</th>
<th scope="col">Comment</th>
<th scope="col">Foreign Key Reference</th>
</tr>
</tr>
<tr>
<tr>
Line 1,000: Line 1,168:
<td>NOT NULL</td>
<td>NOT NULL</td>
<td> 'Unique Id of the location'</td>
<td> 'Unique Id of the location'</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
Line 1,006: Line 1,175:
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> 'The name of a location set by the publisher. E.g. ward, clinic, domiciliary'</td>
<td> 'The name of a location set by the publisher. E.g. ward, clinic, domiciliary'</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
Line 1,012: Line 1,182:
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> 'The type of location'</td>
<td> 'The type of location'</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
Line 1,018: Line 1,189:
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> 'Textual description of the type of location eg GP Practice'</td>
<td> 'Textual description of the type of location eg GP Practice'</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
Line 1,024: Line 1,196:
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> 'The postcode of the location'</td>
<td> 'The postcode of the location'</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
Line 1,030: Line 1,203:
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> 'Reference to the managing organisation of the location'</td>
<td> 'Reference to the managing organisation of the location'</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
Line 1,042: Line 1,216:
<th scope="col">Constraint</th>
<th scope="col">Constraint</th>
<th scope="col">Comment</th>
<th scope="col">Comment</th>
<th scope="col">Foreign Key Reference</th>
</tr>
</tr>
<tr>
<tr>
Line 1,048: Line 1,223:
<td>NOT NULL</td>
<td>NOT NULL</td>
<td> 'Unique Id of the medication order'</td>
<td> 'Unique Id of the medication order'</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
Line 1,054: Line 1,230:
<td>NOT NULL</td>
<td>NOT NULL</td>
<td> 'Owning organisation (i.e. publisher)'</td>
<td> 'Owning organisation (i.e. publisher)'</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
Line 1,060: Line 1,237:
<td>NOT NULL</td>
<td>NOT NULL</td>
<td> 'The organisations record for this person’s registration. Patients may have multiple records across clinical systems and may have registered at an organisation multiple times'</td>
<td> 'The organisations record for this person’s registration. Patients may have multiple records across clinical systems and may have registered at an organisation multiple times'</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
Line 1,066: Line 1,244:
<td>NOT NULL</td>
<td>NOT NULL</td>
<td> 'Unique individual across all organisations'</td>
<td> 'Unique individual across all organisations'</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
Line 1,072: Line 1,251:
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> 'Reference to the encounter the medication order was issued in'</td>
<td> 'Reference to the encounter the medication order was issued in'</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
Line 1,078: Line 1,258:
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> 'The clinician the activity is recorded against'</td>
<td> 'The clinician the activity is recorded against'</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
Line 1,084: Line 1,265:
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> 'The date the medication order was issued'</td>
<td> 'The date the medication order was issued'</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
Line 1,090: Line 1,272:
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> 'Identifies the precision of the clinical effectiveness date to either year (1) month (2) day (5) minute (12) second (13) millisecond (14)'</td>
<td> 'Identifies the precision of the clinical effectiveness date to either year (1) month (2) day (5) minute (12) second (13) millisecond (14)'</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
Line 1,096: Line 1,279:
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> 'Textual description of the dose'</td>
<td> 'Textual description of the dose'</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
Line 1,102: Line 1,286:
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> 'The value of the medication that was prescribed eg 50'</td>
<td> 'The value of the medication that was prescribed eg 50'</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
Line 1,108: Line 1,293:
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> 'The unit of the medication that was prescribed eg tablets'</td>
<td> 'The unit of the medication that was prescribed eg tablets'</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
Line 1,114: Line 1,300:
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> 'How many days the medication is prescribed for'</td>
<td> 'How many days the medication is prescribed for'</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
Line 1,120: Line 1,307:
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> 'The estimated cost of the medication'</td>
<td> 'The estimated cost of the medication'</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
Line 1,126: Line 1,314:
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> 'Reference to the medication statement.  A medication statement can have many medication orders'</td>
<td> 'Reference to the medication statement.  A medication statement can have many medication orders'</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
Line 1,132: Line 1,321:
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> 'Reference to the clinical coding of the medication'</td>
<td> 'Reference to the clinical coding of the medication'</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
Line 1,138: Line 1,328:
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> 'Reference to the clinical coding of the medication'</td>
<td> 'Reference to the clinical coding of the medication'</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
Line 1,144: Line 1,335:
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> 'A reference to the drug in the BNF dictionary'</td>
<td> 'A reference to the drug in the BNF dictionary'</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
Line 1,150: Line 1,342:
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> 'The age the patient was at the time of this event'</td>
<td> 'The age the patient was at the time of this event'</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
Line 1,156: Line 1,349:
<td>No Constraint</td>
<td>No Constraint</td>
<td> 'The issue method of the medication eg hand written'</td>
<td> 'The issue method of the medication eg hand written'</td>
<td>No Foreign Key reference</td>
</tr>
<tr>
<td>date_recorded</td>
<td>datetime</td>
<td>DEFAULT NULL,</td>
<td>No comment yet added</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
<td colspan="5">Unique index name: `medication_order_id` Index Columns: (id)</td> </tr> <tr>
<td colspan="5">Unique index name: `medication_order_id` Index Columns: (id)</td> </tr> <tr>
<td colspan="5">Index name: `fk_medication_order_encounter_id` Index Columns: (encounter_id)</td> </tr> <tr>
<td colspan="5">Index name: `fk_medication_order_patient_id_organization_id` Index Columns: (patient_id,organization_id)</td> </tr> <tr>
<td colspan="5">Index name: `fk_medication_order_practitioner_id` Index Columns: (practitioner_id)</td> </tr> <tr>
<td colspan="5">Index name: `medication_order_patient_id` Index Columns: (patient_id)</td> </tr> <tr>
<td colspan="5">Index name: `medication_order_patient_id` Index Columns: (patient_id)</td> </tr> <tr>
<td colspan="5">Index name: `medication_order_core_concept_id` Index Columns: (core_concept_id)</td> </tr> <tr>
<td colspan="5">Index name: `medication_order_core_concept_id` Index Columns: (core_concept_id)</td> </tr> <tr>
Line 1,169: Line 1,373:
<th scope="col">Constraint</th>
<th scope="col">Constraint</th>
<th scope="col">Comment</th>
<th scope="col">Comment</th>
<th scope="col">Foreign Key Reference</th>
</tr>
</tr>
<tr>
<tr>
Line 1,175: Line 1,380:
<td>NOT NULL</td>
<td>NOT NULL</td>
<td> 'Unique Id of the medication'</td>
<td> 'Unique Id of the medication'</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
Line 1,181: Line 1,387:
<td>NOT NULL</td>
<td>NOT NULL</td>
<td> 'Owning organisation (i.e. publisher)'</td>
<td> 'Owning organisation (i.e. publisher)'</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
Line 1,187: Line 1,394:
<td>NOT NULL</td>
<td>NOT NULL</td>
<td> 'The organisations record for this person’s registration. Patients may have multiple records across clinical systems and may have registered at an organisation multiple times'</td>
<td> 'The organisations record for this person’s registration. Patients may have multiple records across clinical systems and may have registered at an organisation multiple times'</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
Line 1,193: Line 1,401:
<td>NOT NULL</td>
<td>NOT NULL</td>
<td> 'Unique individual across all organisations'</td>
<td> 'Unique individual across all organisations'</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
Line 1,199: Line 1,408:
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> 'Reference to the encounter this medication was recorded in'</td>
<td> 'Reference to the encounter this medication was recorded in'</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
Line 1,205: Line 1,415:
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> 'The clinician the activity is recorded against'</td>
<td> 'The clinician the activity is recorded against'</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
Line 1,211: Line 1,422:
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> 'The date the medication was clinical relevant'</td>
<td> 'The date the medication was clinical relevant'</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
Line 1,217: Line 1,429:
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> 'Identifies the precision of the clinical effectiveness date to either year (1) month (2) day (5) minute (12) second (13) millisecond (14)'</td>
<td> 'Identifies the precision of the clinical effectiveness date to either year (1) month (2) day (5) minute (12) second (13) millisecond (14)'</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
Line 1,223: Line 1,436:
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> 'Whether the medication is active or not'</td>
<td> 'Whether the medication is active or not'</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
Line 1,229: Line 1,443:
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> 'The date the medication was cancelled'</td>
<td> 'The date the medication was cancelled'</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
Line 1,235: Line 1,450:
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> 'Texual description of the dose of the medication'</td>
<td> 'Texual description of the dose of the medication'</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
Line 1,241: Line 1,457:
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> 'The value of the medication that was prescribed eg 50'</td>
<td> 'The value of the medication that was prescribed eg 50'</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
Line 1,247: Line 1,464:
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> 'The unit of the medication that was prescribed eg tablets'</td>
<td> 'The unit of the medication that was prescribed eg tablets'</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
Line 1,253: Line 1,471:
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> 'Reference to the authorisation type'</td>
<td> 'Reference to the authorisation type'</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
Line 1,259: Line 1,478:
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> 'Reference to the clinical coding of the medication'</td>
<td> 'Reference to the clinical coding of the medication'</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
Line 1,265: Line 1,485:
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> 'Reference to the clinical coding of the medication'</td>
<td> 'Reference to the clinical coding of the medication'</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
Line 1,271: Line 1,492:
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> 'A reference to the drug in the BNF dictionary'</td>
<td> 'A reference to the drug in the BNF dictionary'</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
Line 1,277: Line 1,499:
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> 'The age the patient was at the time of this event'</td>
<td> 'The age the patient was at the time of this event'</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
<td>Issue_method</td>
<td>issue_method</td>
<td>text</td>
<td>text</td>
<td>No Constraint</td>
<td>No Constraint</td>
<td> 'The issue method of the medication eg hand written'</td>
<td> 'The issue method of the medication eg hand written'</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
Line 1,289: Line 1,513:
<td>DEFAULT NULL,</td>
<td>DEFAULT NULL,</td>
<td>No comment yet added</td>
<td>No comment yet added</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
<td colspan="5">Unique index name: `medication_statement_id` Index Columns: (id)</td> </tr> <tr>
<td colspan="5">Unique index name: `medication_statement_id` Index Columns: (id)</td> </tr> <tr>
<td colspan="5">Index name: `fk_medication_statement_encounter_id` Index Columns: (encounter_id)</td> </tr> <tr>
<td colspan="5">Index name: `fk_medication_statement_patient_id_organization_id` Index Columns: (patient_id,organization_id)</td> </tr> <tr>
<td colspan="5">Index name: `fk_medication_statement_practitioner_id` Index Columns: (practitioner_id)</td> </tr> <tr>
<td colspan="5">Index name: `medication_statement_patient_id` Index Columns: (patient_id)</td> </tr> <tr>
<td colspan="5">Index name: `medication_statement_patient_id` Index Columns: (patient_id)</td> </tr> <tr>
<td colspan="5">Index name: `medication_statement_dmd_id` Index Columns: (patient_id)</td> </tr> <tr>
<td colspan="5">Index name: `medication_statement_dmd_id` Index Columns: (patient_id)</td> </tr> <tr>
Line 1,302: Line 1,530:
<th scope="col">Constraint</th>
<th scope="col">Constraint</th>
<th scope="col">Comment</th>
<th scope="col">Comment</th>
<th scope="col">Foreign Key Reference</th>
</tr>
</tr>
<tr>
<tr>
Line 1,308: Line 1,537:
<td>NOT NULL</td>
<td>NOT NULL</td>
<td> 'Unique Id of the observation'</td>
<td> 'Unique Id of the observation'</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
Line 1,314: Line 1,544:
<td>NOT NULL</td>
<td>NOT NULL</td>
<td> 'Owning organisation (i.e. publisher)'</td>
<td> 'Owning organisation (i.e. publisher)'</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
Line 1,320: Line 1,551:
<td>NOT NULL</td>
<td>NOT NULL</td>
<td> 'The organisations record for this person’s registration. Patients may have multiple records across clinical systems and may have registered at an organisation multiple times'</td>
<td> 'The organisations record for this person’s registration. Patients may have multiple records across clinical systems and may have registered at an organisation multiple times'</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
Line 1,326: Line 1,558:
<td>NOT NULL</td>
<td>NOT NULL</td>
<td> 'Unique individual across all organisations'</td>
<td> 'Unique individual across all organisations'</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
Line 1,332: Line 1,565:
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> 'Reference to the encounter the observation was recorded at'</td>
<td> 'Reference to the encounter the observation was recorded at'</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
Line 1,338: Line 1,572:
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> 'The clinician the activity is recorded against'</td>
<td> 'The clinician the activity is recorded against'</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
Line 1,344: Line 1,579:
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> 'The date the observation was identified by a clinician'</td>
<td> 'The date the observation was identified by a clinician'</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
Line 1,350: Line 1,586:
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> 'Identifies the precision of the clinical effectiveness date to either year (1) month (2) day (5) minute (12) second (13) millisecond (14)'</td>
<td> 'Identifies the precision of the clinical effectiveness date to either year (1) month (2) day (5) minute (12) second (13) millisecond (14)'</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
Line 1,356: Line 1,593:
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> 'The value of the result of the observation'</td>
<td> 'The value of the result of the observation'</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
Line 1,362: Line 1,600:
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> 'The units of the result of the observation'</td>
<td> 'The units of the result of the observation'</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
Line 1,368: Line 1,607:
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> 'The date of the result'</td>
<td> 'The date of the result'</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
Line 1,374: Line 1,614:
<td>No Constraint</td>
<td>No Constraint</td>
<td> 'Any text associated with the result'</td>
<td> 'Any text associated with the result'</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
Line 1,380: Line 1,621:
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> 'Reference to the clinical coding of the result'</td>
<td> 'Reference to the clinical coding of the result'</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
Line 1,386: Line 1,628:
<td>NOT NULL</td>
<td>NOT NULL</td>
<td> 'Whether the observation is marked as a problem'</td>
<td> 'Whether the observation is marked as a problem'</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
Line 1,392: Line 1,635:
<td>NOT NULL</td>
<td>NOT NULL</td>
<td> 'Whether the observation is a review of an existing problem'</td>
<td> 'Whether the observation is a review of an existing problem'</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
Line 1,398: Line 1,642:
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> 'The end date of the problem'</td>
<td> 'The end date of the problem'</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
Line 1,404: Line 1,649:
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> 'Reference to the parent observation in a complex observation eg systolic and diastolic blood pressures will have a parent observation of Blood pressure'</td>
<td> 'Reference to the parent observation in a complex observation eg systolic and diastolic blood pressures will have a parent observation of Blood pressure'</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
Line 1,410: Line 1,656:
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> 'Reference to the clinical coding of the observation'</td>
<td> 'Reference to the clinical coding of the observation'</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
Line 1,416: Line 1,663:
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> 'Reference to the clinical coding of the observation'</td>
<td> 'Reference to the clinical coding of the observation'</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
Line 1,422: Line 1,670:
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> 'The age of the patient at the time of the observation'</td>
<td> 'The age of the patient at the time of the observation'</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
Line 1,428: Line 1,677:
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> 'Reference to the episodicity of the problem eg First, review, flare'</td>
<td> 'Reference to the episodicity of the problem eg First, review, flare'</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
Line 1,434: Line 1,684:
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> 'Whether the observation is a primary observation'</td>
<td> 'Whether the observation is a primary observation'</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
Line 1,440: Line 1,691:
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> 'The date the observation was recorded in the system'</td>
<td> 'The date the observation was recorded in the system'</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
<td colspan="5">Unique index name: `observation_id` Index Columns: (id)</td> </tr> <tr>
<td colspan="5">Unique index name: `observation_id` Index Columns: (id)</td> </tr> <tr>
<td colspan="5">Index name: `fk_observation_encounter_id` Index Columns: (encounter_id)</td> </tr> <tr>
<td colspan="5">Index name: `fk_observation_patient_id_organization_id` Index Columns: (patient_id,organization_id)</td> </tr> <tr>
<td colspan="5">Index name: `fk_observation_practitioner_id` Index Columns: (practitioner_id)</td> </tr> <tr>
<td colspan="5">Index name: `observation_patient_id` Index Columns: (patient_id)</td> </tr> <tr>
<td colspan="5">Index name: `observation_patient_id` Index Columns: (patient_id)</td> </tr> <tr>
<td colspan="5">Index name: `observation_core_concept_id` Index Columns: (core_concept_id)</td> </tr> <tr>
<td colspan="5">Index name: `observation_core_concept_id` Index Columns: (core_concept_id)</td> </tr> <tr>
Line 1,459: Line 1,714:
<th scope="col">Constraint</th>
<th scope="col">Constraint</th>
<th scope="col">Comment</th>
<th scope="col">Comment</th>
<th scope="col">Foreign Key Reference</th>
</tr>
</tr>
<tr>
<tr>
Line 1,465: Line 1,721:
<td>NOT NULL</td>
<td>NOT NULL</td>
<td> 'same as the id column on the observation table'</td>
<td> 'same as the id column on the observation table'</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
Line 1,471: Line 1,728:
<td>NOT NULL</td>
<td>NOT NULL</td>
<td> 'IM reference (i.e. significance)'</td>
<td> 'IM reference (i.e. significance)'</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
Line 1,477: Line 1,735:
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> 'IM reference (i.e. minor, significant)'</td>
<td> 'IM reference (i.e. minor, significant)'</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
Line 1,483: Line 1,742:
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> 'the JSON data itself '</td>
<td> 'the JSON data itself '</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
Line 1,489: Line 1,749:
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> 'where there is no mapped value_id or raw JSON, just a basic text value'</td>
<td> 'where there is no mapped value_id or raw JSON, just a basic text value'</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
Line 1,500: Line 1,761:
<th scope="col">Constraint</th>
<th scope="col">Constraint</th>
<th scope="col">Comment</th>
<th scope="col">Comment</th>
<th scope="col">Foreign Key Reference</th>
</tr>
</tr>
<tr>
<tr>
Line 1,506: Line 1,768:
<td>NOT NULL</td>
<td>NOT NULL</td>
<td> 'Unique Id of the organisation'</td>
<td> 'Unique Id of the organisation'</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
Line 1,512: Line 1,775:
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> 'ODS Code of the organisation'</td>
<td> 'ODS Code of the organisation'</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
<td>Name</td>
<td>name</td>
<td>varchar(255)</td>
<td>varchar(255)</td>
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> 'Name of the organisation'</td>
<td> 'Name of the organisation'</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
Line 1,524: Line 1,789:
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> 'The type of organisation'</td>
<td> 'The type of organisation'</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
Line 1,530: Line 1,796:
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> 'Textual description of the type of organisation eg GP Practice'</td>
<td> 'Textual description of the type of organisation eg GP Practice'</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
<td>Postcode</td>
<td>postcode</td>
<td>varchar(10)</td>
<td>varchar(10)</td>
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> 'The postcode of the organisation'</td>
<td> 'The postcode of the organisation'</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
Line 1,542: Line 1,810:
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> 'The id of the parent organisation'</td>
<td> 'The id of the parent organisation'</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
Line 1,554: Line 1,823:
<th scope="col">Constraint</th>
<th scope="col">Constraint</th>
<th scope="col">Comment</th>
<th scope="col">Comment</th>
<th scope="col">Foreign Key Reference</th>
</tr>
</tr>
<tr>
<tr>
Line 1,560: Line 1,830:
<td>NOT NULL</td>
<td>NOT NULL</td>
<td> 'organisation ID, corresponds to same ID in the organizaton table'</td>
<td> 'organisation ID, corresponds to same ID in the organizaton table'</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
Line 1,566: Line 1,837:
<td>NOT NULL</td>
<td>NOT NULL</td>
<td> 'software name of publishing system, i.e. SystmOne'</td>
<td> 'software name of publishing system, i.e. SystmOne'</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
Line 1,572: Line 1,844:
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> 'date time data was last sent to DDS'</td>
<td> 'date time data was last sent to DDS'</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
Line 1,578: Line 1,851:
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> 'cutoff date time of the last extract from the publishing system'</td>
<td> 'cutoff date time of the last extract from the publishing system'</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
Line 1,588: Line 1,862:
<th scope="col">Constraint</th>
<th scope="col">Constraint</th>
<th scope="col">Comment</th>
<th scope="col">Comment</th>
<th scope="col">Foreign Key Reference</th>
</tr>
</tr>
<tr>
<tr>
Line 1,594: Line 1,869:
<td>NOT NULL</td>
<td>NOT NULL</td>
<td> 'Unique Id of the patient'</td>
<td> 'Unique Id of the patient'</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
Line 1,600: Line 1,876:
<td>NOT NULL</td>
<td>NOT NULL</td>
<td> 'Owning organisation (i.e. publisher)'</td>
<td> 'Owning organisation (i.e. publisher)'</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
Line 1,606: Line 1,883:
<td>NOT NULL</td>
<td>NOT NULL</td>
<td> 'Unique individual across all organisations'</td>
<td> 'Unique individual across all organisations'</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
Line 1,612: Line 1,890:
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> 'The title of the patient'</td>
<td> 'The title of the patient'</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
Line 1,618: Line 1,897:
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> 'The first names of the patient'</td>
<td> 'The first names of the patient'</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
Line 1,624: Line 1,904:
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> 'The last name of the patient'</td>
<td> 'The last name of the patient'</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
Line 1,630: Line 1,911:
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> 'Reference to the gender of the patient'</td>
<td> 'Reference to the gender of the patient'</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
Line 1,636: Line 1,918:
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> 'The NHS number of the patient'</td>
<td> 'The NHS number of the patient'</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
Line 1,642: Line 1,925:
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> 'The date of birth of the patient'</td>
<td> 'The date of birth of the patient'</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
Line 1,648: Line 1,932:
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> 'The date of death of the patient'</td>
<td> 'The date of death of the patient'</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
Line 1,654: Line 1,939:
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> 'Reference to the current address of the patient'</td>
<td> 'Reference to the current address of the patient'</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
Line 1,660: Line 1,946:
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> 'Reference to the ethnicity of the patient'</td>
<td> 'Reference to the ethnicity of the patient'</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
Line 1,666: Line 1,953:
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> 'Reference to the organisation the patient is registered at'</td>
<td> 'Reference to the organisation the patient is registered at'</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
Line 1,672: Line 1,960:
<td>DEFAULT NULL,</td>
<td>DEFAULT NULL,</td>
<td>No comment yet added</td>
<td>No comment yet added</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
Line 1,678: Line 1,967:
<td>DEFAULT NULL,</td>
<td>DEFAULT NULL,</td>
<td>No comment yet added</td>
<td>No comment yet added</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
Line 1,684: Line 1,974:
<td>DEFAULT NULL,</td>
<td>DEFAULT NULL,</td>
<td>No comment yet added</td>
<td>No comment yet added</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
Line 1,696: Line 1,987:
<th scope="col">Constraint</th>
<th scope="col">Constraint</th>
<th scope="col">Comment</th>
<th scope="col">Comment</th>
<th scope="col">Foreign Key Reference</th>
</tr>
</tr>
<tr>
<tr>
Line 1,702: Line 1,994:
<td>NOT NULL</td>
<td>NOT NULL</td>
<td> 'same as the id column on the patient table '</td>
<td> 'same as the id column on the patient table '</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
Line 1,708: Line 2,001:
<td>NOT NULL</td>
<td>NOT NULL</td>
<td> 'IM reference (e.g. Cause of death)'</td>
<td> 'IM reference (e.g. Cause of death)'</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
Line 1,714: Line 2,008:
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> 'IM reference (e.g. COVID)'</td>
<td> 'IM reference (e.g. COVID)'</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
Line 1,720: Line 2,015:
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> 'where there is no mapped value_id, just raw JSON'</td>
<td> 'where there is no mapped value_id, just raw JSON'</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
Line 1,726: Line 2,022:
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> 'where there is no mapped value_id or raw JSON, just a basic text value (i.e. GP Practitioner number)'</td>
<td> 'where there is no mapped value_id or raw JSON, just a basic text value (i.e. GP Practitioner number)'</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
Line 1,737: Line 2,034:
<th scope="col">Constraint</th>
<th scope="col">Constraint</th>
<th scope="col">Comment</th>
<th scope="col">Comment</th>
<th scope="col">Foreign Key Reference</th>
</tr>
</tr>
<tr>
<tr>
<td>Id</td>
<td>id</td>
<td>bigint</td>
<td>bigint</td>
<td>NOT NULL</td>
<td>NOT NULL</td>
<td> 'Unique Id of the address'</td>
<td> 'Unique Id of the address'</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
Line 1,749: Line 2,048:
<td>NOT NULL</td>
<td>NOT NULL</td>
<td> 'Owning organisation (i.e. publisher)'</td>
<td> 'Owning organisation (i.e. publisher)'</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
Line 1,755: Line 2,055:
<td>NOT NULL</td>
<td>NOT NULL</td>
<td> 'The organisations record for this person’s registration. Patients may have multiple records across clinical systems and may have registered at an organisation multiple times'</td>
<td> 'The organisations record for this person’s registration. Patients may have multiple records across clinical systems and may have registered at an organisation multiple times'</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
Line 1,761: Line 2,062:
<td>NOT NULL</td>
<td>NOT NULL</td>
<td> 'Unique individual across all organisations'</td>
<td> 'Unique individual across all organisations'</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
Line 1,767: Line 2,069:
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> 'The first line of the address'</td>
<td> 'The first line of the address'</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
Line 1,773: Line 2,076:
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> 'The second line of the address'</td>
<td> 'The second line of the address'</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
Line 1,779: Line 2,083:
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> 'The third line of the address'</td>
<td> 'The third line of the address'</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
Line 1,785: Line 2,090:
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> 'The fourth line of the address'</td>
<td> 'The fourth line of the address'</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
Line 1,791: Line 2,097:
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> 'The city'</td>
<td> 'The city'</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
Line 1,797: Line 2,104:
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> 'The postcode'</td>
<td> 'The postcode'</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
Line 1,803: Line 2,111:
<td>NOT NULL</td>
<td>NOT NULL</td>
<td> 'use of address (e.g. home, temporary)'</td>
<td> 'use of address (e.g. home, temporary)'</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
Line 1,809: Line 2,118:
<td>NOT NULL</td>
<td>NOT NULL</td>
<td> 'The start date of this address being relevant'</td>
<td> 'The start date of this address being relevant'</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
Line 1,815: Line 2,125:
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> 'The end date of this address being relevant'</td>
<td> 'The end date of this address being relevant'</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
Line 1,821: Line 2,132:
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> 'A reference to the LSOA_2001 code'</td>
<td> 'A reference to the LSOA_2001 code'</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
Line 1,827: Line 2,139:
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> 'A reference to the LSOA_2011 code'</td>
<td> 'A reference to the LSOA_2011 code'</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
Line 1,833: Line 2,146:
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> 'A reference to the MSOA_2001 code'</td>
<td> 'A reference to the MSOA_2001 code'</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
Line 1,839: Line 2,153:
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> 'A reference to the MSOA_2011 code'</td>
<td> 'A reference to the MSOA_2011 code'</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
Line 1,845: Line 2,160:
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> 'The ward the address belongs to'</td>
<td> 'The ward the address belongs to'</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
Line 1,851: Line 2,167:
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> 'The local authority the address belongs to'</td>
<td> 'The local authority the address belongs to'</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
Line 1,857: Line 2,174:
<td>DEFAULT NULL,</td>
<td>DEFAULT NULL,</td>
<td>No comment yet added</td>
<td>No comment yet added</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
<td colspan="5">Unique index name: `ux_patient_address_id` Index Columns: (Id)</td> </tr> <tr>
<td colspan="5">Unique index name: `ux_patient_address_id` Index Columns: (id)</td> </tr> <tr>
<td colspan="5">PRIMARY KEY CONSTRAINT(s) (`organization_id`,`Id`,`patient_id`,`person_id`)</td> </tr> </table>
<td colspan="5">Index name: `fk_patient_address_patient_id_organization_id` Index Columns: (patient_id,organization_id)</td> </tr> <tr>
<td colspan="5">PRIMARY KEY CONSTRAINT(s) (`organization_id`,`id`,`patient_id`,`person_id`)</td> </tr> </table>
<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="mw-collapsible" border="1" style="border-collapse:collapse">
<table class="mw-collapsible" border="1" style="border-collapse:collapse">
Line 1,868: Line 2,187:
<th scope="col">Constraint</th>
<th scope="col">Constraint</th>
<th scope="col">Comment</th>
<th scope="col">Comment</th>
<th scope="col">Foreign Key Reference</th>
</tr>
</tr>
<tr>
<tr>
Line 1,874: Line 2,194:
<td>NOT NULL</td>
<td>NOT NULL</td>
<td>No comment yet added</td>
<td>No comment yet added</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
Line 1,880: Line 2,201:
<td>NOT NULL,</td>
<td>NOT NULL,</td>
<td>No comment yet added</td>
<td>No comment yet added</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
Line 1,886: Line 2,208:
<td>CHARACTER SET</td>
<td>CHARACTER SET</td>
<td>No comment yet added</td>
<td>No comment yet added</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
Line 1,892: Line 2,215:
<td>DEFAULT NULL,</td>
<td>DEFAULT NULL,</td>
<td>No comment yet added</td>
<td>No comment yet added</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
Line 1,898: Line 2,222:
<td>DEFAULT NULL,</td>
<td>DEFAULT NULL,</td>
<td>No comment yet added</td>
<td>No comment yet added</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
Line 1,904: Line 2,229:
<td>CHARACTER SET</td>
<td>CHARACTER SET</td>
<td>No comment yet added</td>
<td>No comment yet added</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
Line 1,910: Line 2,236:
<td>DEFAULT NULL,</td>
<td>DEFAULT NULL,</td>
<td>No comment yet added</td>
<td>No comment yet added</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
Line 1,916: Line 2,243:
<td>DEFAULT NULL,</td>
<td>DEFAULT NULL,</td>
<td>No comment yet added</td>
<td>No comment yet added</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
Line 1,922: Line 2,250:
<td>DEFAULT NULL,</td>
<td>DEFAULT NULL,</td>
<td>No comment yet added</td>
<td>No comment yet added</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
Line 1,928: Line 2,257:
<td>DEFAULT NULL,</td>
<td>DEFAULT NULL,</td>
<td>No comment yet added</td>
<td>No comment yet added</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
Line 1,934: Line 2,264:
<td>CHARACTER SET</td>
<td>CHARACTER SET</td>
<td>No comment yet added</td>
<td>No comment yet added</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
Line 1,940: Line 2,271:
<td>CHARACTER SET</td>
<td>CHARACTER SET</td>
<td>No comment yet added</td>
<td>No comment yet added</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
Line 1,946: Line 2,278:
<td>DEFAULT NULL,</td>
<td>DEFAULT NULL,</td>
<td>No comment yet added</td>
<td>No comment yet added</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
Line 1,952: Line 2,285:
<td>CHARACTER SET</td>
<td>CHARACTER SET</td>
<td>No comment yet added</td>
<td>No comment yet added</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
Line 1,958: Line 2,292:
<td>CHARACTER SET</td>
<td>CHARACTER SET</td>
<td>No comment yet added</td>
<td>No comment yet added</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
Line 1,964: Line 2,299:
<td>CHARACTER SET</td>
<td>CHARACTER SET</td>
<td>No comment yet added</td>
<td>No comment yet added</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
Line 1,970: Line 2,306:
<td>CHARACTER SET</td>
<td>CHARACTER SET</td>
<td>No comment yet added</td>
<td>No comment yet added</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
Line 1,976: Line 2,313:
<td>CHARACTER SET</td>
<td>CHARACTER SET</td>
<td>No comment yet added</td>
<td>No comment yet added</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
Line 1,982: Line 2,320:
<td>CHARACTER SET</td>
<td>CHARACTER SET</td>
<td>No comment yet added</td>
<td>No comment yet added</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
Line 1,988: Line 2,327:
<td>CHARACTER SET</td>
<td>CHARACTER SET</td>
<td>No comment yet added</td>
<td>No comment yet added</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
Line 1,994: Line 2,334:
<td>CHARACTER SET</td>
<td>CHARACTER SET</td>
<td>No comment yet added</td>
<td>No comment yet added</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
Line 2,000: Line 2,341:
<td>CHARACTER SET</td>
<td>CHARACTER SET</td>
<td>No comment yet added</td>
<td>No comment yet added</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
Line 2,006: Line 2,348:
<td>CHARACTER SET</td>
<td>CHARACTER SET</td>
<td>No comment yet added</td>
<td>No comment yet added</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
Line 2,012: Line 2,355:
<td>CHARACTER SET</td>
<td>CHARACTER SET</td>
<td>No comment yet added</td>
<td>No comment yet added</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
Line 2,018: Line 2,362:
<td>CHARACTER SET</td>
<td>CHARACTER SET</td>
<td>No comment yet added</td>
<td>No comment yet added</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
Line 2,024: Line 2,369:
<td>CHARACTER SET</td>
<td>CHARACTER SET</td>
<td>No comment yet added</td>
<td>No comment yet added</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
<td colspan="5">Index name: `patient_address_uprn_index` Index Columns: (uprn)</td> </tr> <tr>
<td colspan="5">Index name: `patient_address_uprn_index` Index Columns: (uprn)</td> </tr> <tr>
<td colspan="5">Index name: `patient_address_patient_address_id` Index Columns: (id,uprn)</td> </tr> <tr>
<td colspan="5">Index name: `patient_address_patient_address_id` Index Columns: (id,uprn)</td> </tr> <tr>
<td colspan="5">Index name: `patient_address_uprn_patient_address_id_fk` Index Columns: (patient_address_id)</td> </tr> <tr>
<td colspan="5">PRIMARY KEY CONSTRAINT(s) (`id`)</td> </tr> </table>
<td colspan="5">PRIMARY KEY CONSTRAINT(s) (`id`)</td> </tr> </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>
Line 2,036: Line 2,383:
<th scope="col">Constraint</th>
<th scope="col">Constraint</th>
<th scope="col">Comment</th>
<th scope="col">Comment</th>
<th scope="col">Foreign Key Reference</th>
</tr>
</tr>
<tr>
<tr>
Line 2,042: Line 2,390:
<td>NOT NULL,</td>
<td>NOT NULL,</td>
<td>No comment yet added</td>
<td>No comment yet added</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
Line 2,048: Line 2,397:
<td>NOT NULL,</td>
<td>NOT NULL,</td>
<td>No comment yet added</td>
<td>No comment yet added</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
Line 2,054: Line 2,404:
<td>NOT NULL,</td>
<td>NOT NULL,</td>
<td>No comment yet added</td>
<td>No comment yet added</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
Line 2,060: Line 2,411:
<td>NOT NULL,</td>
<td>NOT NULL,</td>
<td>No comment yet added</td>
<td>No comment yet added</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
Line 2,066: Line 2,418:
<td>NOT NULL,</td>
<td>NOT NULL,</td>
<td>No comment yet added</td>
<td>No comment yet added</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
Line 2,072: Line 2,425:
<td>NOT NULL,</td>
<td>NOT NULL,</td>
<td>No comment yet added</td>
<td>No comment yet added</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
Line 2,078: Line 2,432:
<td>NOT NULL,</td>
<td>NOT NULL,</td>
<td>No comment yet added</td>
<td>No comment yet added</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
Line 2,084: Line 2,439:
<td>NOT NULL,</td>
<td>NOT NULL,</td>
<td>No comment yet added</td>
<td>No comment yet added</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
<td colspan="5">Index name: `fk_patient_address_ralf_organization_id` Index Columns: (organization_id)</td> </tr> <tr>
<td colspan="5">Index name: `fk_patient_address_ralf_person_id` Index Columns: (person_id)</td> </tr> <tr>
<td colspan="5">Index name: `ux_patient_address_ralf_id` Index Columns: (id)</td> </tr> <tr>
<td colspan="5">Index name: `ux_patient_address_ralf_id` Index Columns: (id)</td> </tr> <tr>
<td colspan="5">Index name: `patient_address_ralf_patient_id` Index Columns: (patient_id)</td> </tr> <tr>
<td colspan="5">Index name: `patient_address_ralf_patient_id` Index Columns: (patient_id)</td> </tr> <tr>
Line 2,098: Line 2,456:
<th scope="col">Constraint</th>
<th scope="col">Constraint</th>
<th scope="col">Comment</th>
<th scope="col">Comment</th>
<th scope="col">Foreign Key Reference</th>
</tr>
</tr>
<tr>
<tr>
Line 2,104: Line 2,463:
<td>NOT NULL</td>
<td>NOT NULL</td>
<td> 'Unique Id of the patient contact'</td>
<td> 'Unique Id of the patient contact'</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
Line 2,110: Line 2,470:
<td>NOT NULL</td>
<td>NOT NULL</td>
<td> 'Owning organisation (i.e. publisher)'</td>
<td> 'Owning organisation (i.e. publisher)'</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
Line 2,116: Line 2,477:
<td>NOT NULL</td>
<td>NOT NULL</td>
<td> 'The organisations record for this person’s registration. Patients may have multiple records across clinical systems and may have registered at an organisation multiple times'</td>
<td> 'The organisations record for this person’s registration. Patients may have multiple records across clinical systems and may have registered at an organisation multiple times'</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
Line 2,122: Line 2,484:
<td>NOT NULL</td>
<td>NOT NULL</td>
<td> 'Unique individual across all organisations'</td>
<td> 'Unique individual across all organisations'</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
Line 2,128: Line 2,491:
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> 'use of contact (e.g. mobile, home,work'</td>
<td> 'use of contact (e.g. mobile, home,work'</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
Line 2,134: Line 2,498:
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> 'type of contact (e.g. phone, email)'</td>
<td> 'type of contact (e.g. phone, email)'</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
Line 2,140: Line 2,505:
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> 'The start date of the contact being valid'</td>
<td> 'The start date of the contact being valid'</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
Line 2,146: Line 2,512:
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> 'The end date of the contact being valid'</td>
<td> 'The end date of the contact being valid'</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
Line 2,152: Line 2,519:
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> 'The value of the contact information eg phone number, email address'</td>
<td> 'The value of the contact information eg phone number, email address'</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
<td colspan="5">Unique index name: `ux_patient_contact_id` Index Columns: (id)</td> </tr> <tr>
<td colspan="5">Unique index name: `ux_patient_contact_id` Index Columns: (id)</td> </tr> <tr>
<td colspan="5">Index name: `fk_patient_contact_patient_id_organisation_id` Index Columns: (patient_id,organization_id)</td> </tr> <tr>
<td colspan="5">PRIMARY KEY CONSTRAINT(s) (`organization_id`,`id`,`patient_id`,`person_id`)</td> </tr> </table>
<td colspan="5">PRIMARY KEY CONSTRAINT(s) (`organization_id`,`id`,`patient_id`,`person_id`)</td> </tr> </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>
Line 2,163: Line 2,532:
<th scope="col">Constraint</th>
<th scope="col">Constraint</th>
<th scope="col">Comment</th>
<th scope="col">Comment</th>
<th scope="col">Foreign Key Reference</th>
</tr>
</tr>
<tr>
<tr>
Line 2,169: Line 2,539:
<td>NOT NULL</td>
<td>NOT NULL</td>
<td> 'Unique Id of the patient pseudo id'</td>
<td> 'Unique Id of the patient pseudo id'</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
Line 2,175: Line 2,546:
<td>NOT NULL</td>
<td>NOT NULL</td>
<td> 'Owning organisation (i.e. publisher)'</td>
<td> 'Owning organisation (i.e. publisher)'</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
Line 2,181: Line 2,553:
<td>NOT NULL</td>
<td>NOT NULL</td>
<td> 'Reference to the patient this registration status history belongs to'</td>
<td> 'Reference to the patient this registration status history belongs to'</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
Line 2,187: Line 2,560:
<td>NOT NULL</td>
<td>NOT NULL</td>
<td> 'Reference to the person this registration status history belongs to'</td>
<td> 'Reference to the person this registration status history belongs to'</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
Line 2,193: Line 2,567:
<td>NOT NULL</td>
<td>NOT NULL</td>
<td> 'The name of the salt used to create the pseudo id'</td>
<td> 'The name of the salt used to create the pseudo id'</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
Line 2,199: Line 2,574:
<td>NOT NULL</td>
<td>NOT NULL</td>
<td> '"Secure Key IDentifier" - the pseudonymised ID generated for this patient using the salt specified in the salt_name column. Typically generated from patient NHS number, but is configurable on a case by case basis (e.g. may include date of birth)'</td>
<td> '"Secure Key IDentifier" - the pseudonymised ID generated for this patient using the salt specified in the salt_name column. Typically generated from patient NHS number, but is configurable on a case by case basis (e.g. may include date of birth)'</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
Line 2,205: Line 2,581:
<td>NOT NULL</td>
<td>NOT NULL</td>
<td> 'Whether the nhs number is valid'</td>
<td> 'Whether the nhs number is valid'</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
Line 2,211: Line 2,588:
<td>NOT NULL</td>
<td>NOT NULL</td>
<td> 'Whether the nhs number has been verified by the publisher'</td>
<td> 'Whether the nhs number has been verified by the publisher'</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
<td colspan="5">Unique index name: `ux_patient_pseudo_id` Index Columns: (id)</td> </tr> <tr>
<td colspan="5">Unique index name: `ux_patient_pseudo_id` Index Columns: (id)</td> </tr> <tr>
<td colspan="5">Index name: `fk_patient_pseudo_id` Index Columns: (patient_id,organization_id)</td> </tr> <tr>
<td colspan="5">Index name: `patient_pseudo_id_patient` Index Columns: (patient_id)</td> </tr> <tr>
<td colspan="5">Index name: `patient_pseudo_id_patient` Index Columns: (patient_id)</td> </tr> <tr>
<td colspan="5">PRIMARY KEY CONSTRAINT(s) (`organization_id`,`person_id`,`id`)</td> </tr> </table>
<td colspan="5">PRIMARY KEY CONSTRAINT(s) (`organization_id`,`person_id`,`id`)</td> </tr> </table>
Line 2,223: Line 2,602:
<th scope="col">Constraint</th>
<th scope="col">Constraint</th>
<th scope="col">Comment</th>
<th scope="col">Comment</th>
<th scope="col">Foreign Key Reference</th>
</tr>
</tr>
<tr>
<tr>
Line 2,229: Line 2,609:
<td>NOT NULL</td>
<td>NOT NULL</td>
<td> 'The organisations record for this person’s registration. Patients may have multiple records across clinical systems and may have registered at an organisation multiple times'</td>
<td> 'The organisations record for this person’s registration. Patients may have multiple records across clinical systems and may have registered at an organisation multiple times'</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
Line 2,235: Line 2,616:
<td>NOT NULL</td>
<td>NOT NULL</td>
<td> 'Owning organisation (i.e. publisher)'</td>
<td> 'Owning organisation (i.e. publisher)'</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
Line 2,241: Line 2,623:
<td>NOT NULL</td>
<td>NOT NULL</td>
<td> 'Unique individual across all organisations'</td>
<td> 'Unique individual across all organisations'</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
Line 2,247: Line 2,630:
<td>DEFAULT NULL,</td>
<td>DEFAULT NULL,</td>
<td>No comment yet added</td>
<td>No comment yet added</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
Line 2,253: Line 2,637:
<td>DEFAULT NULL,</td>
<td>DEFAULT NULL,</td>
<td>No comment yet added</td>
<td>No comment yet added</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
Line 2,259: Line 2,644:
<td>DEFAULT NULL,</td>
<td>DEFAULT NULL,</td>
<td>No comment yet added</td>
<td>No comment yet added</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
Line 2,265: Line 2,651:
<td>DEFAULT NULL,</td>
<td>DEFAULT NULL,</td>
<td>No comment yet added</td>
<td>No comment yet added</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
Line 2,271: Line 2,658:
<td>DEFAULT NULL,</td>
<td>DEFAULT NULL,</td>
<td>No comment yet added</td>
<td>No comment yet added</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
Line 2,277: Line 2,665:
<td>DEFAULT NULL,</td>
<td>DEFAULT NULL,</td>
<td>No comment yet added</td>
<td>No comment yet added</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
Line 2,283: Line 2,672:
<td>DEFAULT NULL,</td>
<td>DEFAULT NULL,</td>
<td>No comment yet added</td>
<td>No comment yet added</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
Line 2,289: Line 2,679:
<td>DEFAULT NULL,</td>
<td>DEFAULT NULL,</td>
<td>No comment yet added</td>
<td>No comment yet added</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
<td colspan="5">Unique index name: `patient_uprn_id` Index Columns: (patient_id)</td> </tr> <tr>
<td colspan="5">Unique index name: `patient_uprn_id` Index Columns: (patient_id)</td> </tr> <tr>
<td colspan="5">Index name: `fk_patient_uprn_patient_id_organisation_id` Index Columns: (patient_id,organization_id)</td> </tr> <tr>
<td colspan="5">PRIMARY KEY CONSTRAINT(s) (`organization_id`,`person_id`,`patient_id`)</td> </tr> </table>
<td colspan="5">PRIMARY KEY CONSTRAINT(s) (`organization_id`,`person_id`,`patient_id`)</td> </tr> </table>
<h2><span class="mw-headline" id="Sortable_tables">person</span></h2>
<h2><span class="mw-headline" id="Sortable_tables">person</span></h2>
Line 2,300: Line 2,692:
<th scope="col">Constraint</th>
<th scope="col">Constraint</th>
<th scope="col">Comment</th>
<th scope="col">Comment</th>
<th scope="col">Foreign Key Reference</th>
</tr>
</tr>
<tr>
<tr>
Line 2,306: Line 2,699:
<td>NOT NULL</td>
<td>NOT NULL</td>
<td> 'Unique Id of the person'</td>
<td> 'Unique Id of the person'</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
Line 2,312: Line 2,706:
<td>NOT NULL</td>
<td>NOT NULL</td>
<td> 'Owning organisation (i.e. publisher)'</td>
<td> 'Owning organisation (i.e. publisher)'</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
Line 2,318: Line 2,713:
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> 'The title of the person'</td>
<td> 'The title of the person'</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
Line 2,324: Line 2,720:
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> 'The first names of the person'</td>
<td> 'The first names of the person'</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
Line 2,330: Line 2,727:
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> 'The last name of the person'</td>
<td> 'The last name of the person'</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
Line 2,336: Line 2,734:
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> 'Reference to the gender of the person'</td>
<td> 'Reference to the gender of the person'</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
Line 2,342: Line 2,741:
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> 'The NHS number of the person'</td>
<td> 'The NHS number of the person'</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
Line 2,348: Line 2,748:
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> 'The date of birth of the person'</td>
<td> 'The date of birth of the person'</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
Line 2,354: Line 2,755:
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> 'The date of death of the person'</td>
<td> 'The date of death of the person'</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
Line 2,360: Line 2,762:
<td>NOT NULL</td>
<td>NOT NULL</td>
<td> 'Reference to the current address of the person'</td>
<td> 'Reference to the current address of the person'</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
Line 2,366: Line 2,769:
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> 'Reference to the ethnicity of the person'</td>
<td> 'Reference to the ethnicity of the person'</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
Line 2,372: Line 2,776:
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> 'Reference to the organisation the person is registered at'</td>
<td> 'Reference to the organisation the person is registered at'</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
Line 2,378: Line 2,783:
<td>DEFAULT NULL,</td>
<td>DEFAULT NULL,</td>
<td>No comment yet added</td>
<td>No comment yet added</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
Line 2,384: Line 2,790:
<td>DEFAULT NULL,</td>
<td>DEFAULT NULL,</td>
<td>No comment yet added</td>
<td>No comment yet added</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
Line 2,390: Line 2,797:
<td>DEFAULT NULL,</td>
<td>DEFAULT NULL,</td>
<td>No comment yet added</td>
<td>No comment yet added</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
Line 2,401: Line 2,809:
<th scope="col">Constraint</th>
<th scope="col">Constraint</th>
<th scope="col">Comment</th>
<th scope="col">Comment</th>
<th scope="col">Foreign Key Reference</th>
</tr>
</tr>
<tr>
<tr>
Line 2,407: Line 2,816:
<td>NOT NULL</td>
<td>NOT NULL</td>
<td> 'Unique Id of the practitioner'</td>
<td> 'Unique Id of the practitioner'</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
Line 2,413: Line 2,823:
<td>NOT NULL</td>
<td>NOT NULL</td>
<td> 'Owning organisation (i.e. publisher)'</td>
<td> 'Owning organisation (i.e. publisher)'</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
Line 2,419: Line 2,830:
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> 'Name of the practitioner'</td>
<td> 'Name of the practitioner'</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
Line 2,425: Line 2,837:
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> 'The code representing the role of the practitioner'</td>
<td> 'The code representing the role of the practitioner'</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
Line 2,431: Line 2,844:
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> 'Textual description of the role of the practitioner eg General Medical Practitioner'</td>
<td> 'Textual description of the role of the practitioner eg General Medical Practitioner'</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
Line 2,437: Line 2,851:
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> 'The GMC code of the practitioner'</td>
<td> 'The GMC code of the practitioner'</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
<td colspan="5">Unique index name: `practitioner_id` Index Columns: (id)</td> </tr> <tr>
<td colspan="5">Unique index name: `practitioner_id` Index Columns: (id)</td> </tr> <tr>
<td colspan="5">Index name: `fk_practitioner_organisation_id` Index Columns: (organization_id)</td> </tr> <tr>
<td colspan="5">PRIMARY KEY CONSTRAINT(s) (`id`)</td> </tr> </table>
<td colspan="5">PRIMARY KEY CONSTRAINT(s) (`id`)</td> </tr> </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>
Line 2,448: Line 2,864:
<th scope="col">Constraint</th>
<th scope="col">Constraint</th>
<th scope="col">Comment</th>
<th scope="col">Comment</th>
<th scope="col">Foreign Key Reference</th>
</tr>
</tr>
<tr>
<tr>
Line 2,454: Line 2,871:
<td>NOT NULL</td>
<td>NOT NULL</td>
<td> 'Unique Id of the procedure'</td>
<td> 'Unique Id of the procedure'</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
Line 2,460: Line 2,878:
<td>NOT NULL</td>
<td>NOT NULL</td>
<td> 'Owning organisation (i.e. publisher)'</td>
<td> 'Owning organisation (i.e. publisher)'</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
Line 2,466: Line 2,885:
<td>NOT NULL</td>
<td>NOT NULL</td>
<td> 'The organisations record for this person’s registration. Patients may have multiple records across clinical systems and may have registered at an organisation multiple times'</td>
<td> 'The organisations record for this person’s registration. Patients may have multiple records across clinical systems and may have registered at an organisation multiple times'</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
Line 2,472: Line 2,892:
<td>NOT NULL</td>
<td>NOT NULL</td>
<td> 'Unique individual across all organisations'</td>
<td> 'Unique individual across all organisations'</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
Line 2,478: Line 2,899:
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> 'Reference to the encounter the procedure was administered at'</td>
<td> 'Reference to the encounter the procedure was administered at'</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
Line 2,484: Line 2,906:
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> 'The clinician the activity is recorded against'</td>
<td> 'The clinician the activity is recorded against'</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
<td>clinical_effective_date</td>
<td>clinical_effective_date</td>
<td>date</td>
<td>datetime</td>
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> 'The date the procedure was administered by a clinician'</td>
<td> 'The date the procedure was administered by a clinician'</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
Line 2,496: Line 2,920:
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> 'Identifies the precision of the clinical effectiveness date to either year (1) month (2) day (5) minute (12) second (13) millisecond (14)'</td>
<td> 'Identifies the precision of the clinical effectiveness date to either year (1) month (2) day (5) minute (12) second (13) millisecond (14)'</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
Line 2,502: Line 2,927:
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> 'Reference to the status of the procedure'</td>
<td> 'Reference to the status of the procedure'</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
Line 2,508: Line 2,934:
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> 'Reference to the clinical coding of the procedure'</td>
<td> 'Reference to the clinical coding of the procedure'</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
Line 2,514: Line 2,941:
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> 'Reference to the clinical coding of the procedure'</td>
<td> 'Reference to the clinical coding of the procedure'</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
Line 2,520: Line 2,948:
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> 'The age of the patient at the time of the procedure'</td>
<td> 'The age of the patient at the time of the procedure'</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
Line 2,526: Line 2,955:
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> 'The date the procedure was recorded in the source system'</td>
<td> 'The date the procedure was recorded in the source system'</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
<td colspan="5">Unique index name: `procedure_request_id` Index Columns: (id)</td> </tr> <tr>
<td colspan="5">Unique index name: `procedure_request_id` Index Columns: (id)</td> </tr> <tr>
<td colspan="5">Index name: `fk_procedure_request_patient_id_organization_id` Index Columns: (patient_id,organization_id)</td> </tr> <tr>
<td colspan="5">Index name: `fk_procedure_request_practitioner_id` Index Columns: (practitioner_id)</td> </tr> <tr>
<td colspan="5">Index name: `procedure_request_patient_id` Index Columns: (patient_id)</td> </tr> <tr>
<td colspan="5">Index name: `procedure_request_patient_id` Index Columns: (patient_id)</td> </tr> <tr>
<td colspan="5">PRIMARY KEY CONSTRAINT(s) (`organization_id`,`person_id`,`id`)</td> </tr> </table>
<td colspan="5">PRIMARY KEY CONSTRAINT(s) (`organization_id`,`person_id`,`id`)</td> </tr> </table>
Line 2,538: Line 2,970:
<th scope="col">Constraint</th>
<th scope="col">Constraint</th>
<th scope="col">Comment</th>
<th scope="col">Comment</th>
<th scope="col">Foreign Key Reference</th>
</tr>
</tr>
<tr>
<tr>
Line 2,544: Line 2,977:
<td>NOT NULL</td>
<td>NOT NULL</td>
<td> 'Unique Id of the referral'</td>
<td> 'Unique Id of the referral'</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
Line 2,550: Line 2,984:
<td>NOT NULL</td>
<td>NOT NULL</td>
<td> 'Owning organisation (i.e. publisher)'</td>
<td> 'Owning organisation (i.e. publisher)'</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
Line 2,556: Line 2,991:
<td>NOT NULL</td>
<td>NOT NULL</td>
<td> 'The organisations record for this person’s registration. Patients may have multiple records across clinical systems and may have registered at an organisation multiple times'</td>
<td> 'The organisations record for this person’s registration. Patients may have multiple records across clinical systems and may have registered at an organisation multiple times'</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
Line 2,562: Line 2,998:
<td>NOT NULL</td>
<td>NOT NULL</td>
<td> 'Unique individual across all organisations'</td>
<td> 'Unique individual across all organisations'</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
Line 2,568: Line 3,005:
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> 'Reference to the encounter the referral was made in'</td>
<td> 'Reference to the encounter the referral was made in'</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
Line 2,574: Line 3,012:
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> 'The clinician the activity is recorded against'</td>
<td> 'The clinician the activity is recorded against'</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
<td>clinical_effective_date</td>
<td>clinical_effective_date</td>
<td>date</td>
<td>datetime</td>
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> 'The date the referral was made'</td>
<td> 'The date the referral was made'</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
<td>date_precision_concept_id</td>
<td>date_precision_concept_id</td>
<td>smallint</td>
<td>int</td>
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> 'Identifies the precision of the clinical effectiveness date to either year (1) month (2) day (5) minute (12) second (13) millisecond (14)'</td>
<td> 'Identifies the precision of the clinical effectiveness date to either year (1) month (2) day (5) minute (12) second (13) millisecond (14)'</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
Line 2,592: Line 3,033:
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> 'Reference to the organisation that made the refereral request'</td>
<td> 'Reference to the organisation that made the refereral request'</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
Line 2,598: Line 3,040:
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> 'Reference to the organization receiving the referral'</td>
<td> 'Reference to the organization receiving the referral'</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
<td>referral_request_priority_concept_id</td>
<td>referral_request_priority_concept_id</td>
<td>smallint</td>
<td>int</td>
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> 'Reference to the priority of the referral'</td>
<td> 'Reference to the priority of the referral'</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
Line 2,610: Line 3,054:
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> 'Reference to the type of referral request'</td>
<td> 'Reference to the type of referral request'</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
<td>Mode</td>
<td>mode</td>
<td>varchar(50)</td>
<td>varchar(50)</td>
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> 'The mode of the referral'</td>
<td> 'The mode of the referral'</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
Line 2,622: Line 3,068:
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> 'Whether this is an outgoing referral'</td>
<td> 'Whether this is an outgoing referral'</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
<td>is_review</td>
<td>is_review</td>
<td>tinyint(1)</td>
<td>tinyint(1)</td>
<td>DEFAULT NULL</td>
<td>NOT NULL</td>
<td> 'Whether this referral is a review'</td>
<td> 'Whether this referral is a review'</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
Line 2,634: Line 3,082:
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> 'Reference to the clinical coding of the referral'</td>
<td> 'Reference to the clinical coding of the referral'</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
Line 2,640: Line 3,089:
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> 'Reference to the clinical coding of the referral'</td>
<td> 'Reference to the clinical coding of the referral'</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
Line 2,646: Line 3,096:
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> 'The age of the patient at the time of the referral'</td>
<td> 'The age of the patient at the time of the referral'</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
Line 2,652: Line 3,103:
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> 'The date the referral request was added to the source system'</td>
<td> 'The date the referral request was added to the source system'</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
<td colspan="5">Unique index name: `referral_request_id` Index Columns: (id)</td> </tr> <tr>
<td colspan="5">Unique index name: `referral_request_id` Index Columns: (id)</td> </tr> <tr>
<td colspan="5">Index name: `fk_referral_request_patient_id_organization_id` Index Columns: (patient_id,organization_id)</td> </tr> <tr>
<td colspan="5">Index name: `fk_referral_request_practitioner_id` Index Columns: (practitioner_id)</td> </tr> <tr>
<td colspan="5">Index name: `fk_referral_request_recipient_organization_id` Index Columns: (recipient_organization_id)</td> </tr> <tr>
<td colspan="5">Index name: `fk_referral_request_requester_organization_id` Index Columns: (requester_organization_id)</td> </tr> <tr>
<td colspan="5">Index name: `referral_request_patient_id` Index Columns: (patient_id)</td> </tr> <tr>
<td colspan="5">Index name: `referral_request_patient_id` Index Columns: (patient_id)</td> </tr> <tr>
<td colspan="5">Index name: `referral_request_core_concept_id` Index Columns: (core_concept_id)</td> </tr> <tr>
<td colspan="5">Index name: `referral_request_core_concept_id` Index Columns: (core_concept_id)</td> </tr> <tr>
Line 2,665: Line 3,121:
<th scope="col">Constraint</th>
<th scope="col">Constraint</th>
<th scope="col">Comment</th>
<th scope="col">Comment</th>
<th scope="col">Foreign Key Reference</th>
</tr>
</tr>
<tr>
<tr>
Line 2,671: Line 3,128:
<td>NOT NULL</td>
<td>NOT NULL</td>
<td> 'Unique Id of the registration status history'</td>
<td> 'Unique Id of the registration status history'</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
Line 2,677: Line 3,135:
<td>NOT NULL</td>
<td>NOT NULL</td>
<td> 'Owning organisation (i.e. publisher)'</td>
<td> 'Owning organisation (i.e. publisher)'</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
Line 2,683: Line 3,142:
<td>NOT NULL</td>
<td>NOT NULL</td>
<td> 'Reference to the patient this registration status history belongs to'</td>
<td> 'Reference to the patient this registration status history belongs to'</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
Line 2,689: Line 3,149:
<td>NOT NULL</td>
<td>NOT NULL</td>
<td> 'Reference to the person this registration status history belongs to'</td>
<td> 'Reference to the person this registration status history belongs to'</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
Line 2,695: Line 3,156:
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> 'Reference to the episode of care this status history belongs to'</td>
<td> 'Reference to the episode of care this status history belongs to'</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
Line 2,701: Line 3,163:
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> 'Reference to the registration status'</td>
<td> 'Reference to the registration status'</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
Line 2,707: Line 3,170:
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> 'The start date for the period this registration status history was valid'</td>
<td> 'The start date for the period this registration status history was valid'</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
Line 2,713: Line 3,177:
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> 'The end date for the period this registration status history was valid'</td>
<td> 'The end date for the period this registration status history was valid'</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
<td colspan="5">Unique index name: `ux_registration_status_history_id` Index Columns: (id)</td> </tr> <tr>
<td colspan="5">Unique index name: `ux_registration_status_history_id` Index Columns: (id)</td> </tr> <tr>
<td colspan="5">Index name: `fk_registration_status_history_episode_id` Index Columns: (episode_of_care_id)</td> </tr> <tr>
<td colspan="5">PRIMARY KEY CONSTRAINT(s) (`organization_id`,`id`,`patient_id`,`person_id`)</td> </tr> </table>
<td colspan="5">PRIMARY KEY CONSTRAINT(s) (`organization_id`,`id`,`patient_id`,`person_id`)</td> </tr> </table>
<h2><span class="mw-headline" id="Sortable_tables">schedule</span></h2>
<h2><span class="mw-headline" id="Sortable_tables">schedule</span></h2>
Line 2,724: Line 3,190:
<th scope="col">Constraint</th>
<th scope="col">Constraint</th>
<th scope="col">Comment</th>
<th scope="col">Comment</th>
<th scope="col">Foreign Key Reference</th>
</tr>
</tr>
<tr>
<tr>
Line 2,730: Line 3,197:
<td>NOT NULL</td>
<td>NOT NULL</td>
<td> 'Unique Id of the schedule'</td>
<td> 'Unique Id of the schedule'</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
Line 2,736: Line 3,204:
<td>NOT NULL</td>
<td>NOT NULL</td>
<td> 'Owning organisation (i.e. publisher)'</td>
<td> 'Owning organisation (i.e. publisher)'</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
Line 2,742: Line 3,211:
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> 'Reference to the practitioner who owns the schedule'</td>
<td> 'Reference to the practitioner who owns the schedule'</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
<td>start_date</td>
<td>start_date</td>
<td>date</td>
<td>datetime</td>
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> 'The start date of the schedule'</td>
<td> 'The start date of the schedule'</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
Line 2,754: Line 3,225:
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> 'The type of schedule eg Timed Appointments'</td>
<td> 'The type of schedule eg Timed Appointments'</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
Line 2,760: Line 3,232:
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> 'Textual description of the location the schedule was held at'</td>
<td> 'Textual description of the location the schedule was held at'</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
Line 2,766: Line 3,239:
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> 'The name of the schedule'</td>
<td> 'The name of the schedule'</td>
<td>No Foreign Key reference</td>
</tr>
</tr>
<tr>
<tr>
<td colspan="5">Unique index name: `schedule_id` Index Columns: (id)</td> </tr> <tr>
<td colspan="5">Unique index name: `schedule_id` Index Columns: (id)</td> </tr> <tr>
<td colspan="5">PRIMARY KEY CONSTRAINT(s) (`organization_id`,`id`)</td> </tr> </table>
<td colspan="5">PRIMARY KEY CONSTRAINT(s) (`organization_id`,`id`)</td> </tr> </table>

Revision as of 13:59, 30 November 2022

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

From Discovery Data Service

allergy_intolerance

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

appointment

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

appointment_additional

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

concept

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

concept_map

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

diagnostic_order

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

encounter

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

encounter_additional

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

encounter_event

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

episode_of_care

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

event_log

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

flag

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

location

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

medication_order

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

medication_statement

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

observation

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

observation_additional

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

organization

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

organization_metadata

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

patient

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

patient_additional

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

patient_address

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

patient_address_match

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

patient_address_ralf

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

patient_contact

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

patient_pseudo_id

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

patient_uprn

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

person

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

practitioner

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

procedure_request

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

referral_request

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

registration_status_history

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

schedule

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