CompassV2TestPages:v2.X: Difference between revisions

From Discovery Data Service
Jump to navigation Jump to search
No edit summary
No edit summary
Line 308: Line 308:
<td> COMMENT 'Unique concept identifier',</td>
<td> COMMENT 'Unique concept identifier',</td>
<td>  Id varchar(150) NOT NULL COMMENT 'Unique concept identifier',</td>
<td>  Id varchar(150) NOT NULL COMMENT 'Unique concept identifier',</td>
</tr>
<tr>
<td>use_count</td>
<td>bigint</td>
<td>NOT NULL</td>
<td> DEFAULT '0' COMMENT 'Rough indicator of number of occurences of the concept',</td>
<td>  use_count bigint NOT NULL  '0' COMMENT 'Rough indicator of number of occurences of the concept',</td>
</tr>
</tr>
<tr>
<tr>
Line 363: Line 370:
</tr>
</tr>
<tbody>
<tbody>
<tr>
<td>id</td>
<td>int</td>
<td>NOT NULL,</td>
<td></td>
<td>  id int NOT NULL,</td>
</tr>
<tr>
<td>deleted</td>
<td>tinyint(1)</td>
<td>DEFAULT NULL,</td>
<td></td>
<td>  deleted tinyint(1)  NULL,</td>
</tr>
<tr>
<tr>
<td>updated</td>
<td>updated</td>
Line 396: Line 417:
</tr>
</tr>
<tbody>
<tbody>
<tr>
<td>patient_id</td>
<td>bigint</td>
<td>NOT NULL</td>
<td> COMMENT 'The organisations record for this person’s registration. Patients may have multiple records across clinical systems and may have registered at an organisation multiple times',</td>
<td>  patient_id bigint NOT NULL COMMENT 'The organisations record for this person’s registration. Patients may have multiple records across clinical systems and may have registered at an organisation multiple times',</td>
</tr>
<tr>
<tr>
<td>result_date</td>
<td>result_date</td>
Line 423: Line 437:
<td> COMMENT 'Reference to the encounter the observation was recorded at',</td>
<td> COMMENT 'Reference to the encounter the observation was recorded at',</td>
<td>  encounter_id bigint  NULL COMMENT 'Reference to the encounter the observation was recorded at',</td>
<td>  encounter_id bigint  NULL COMMENT 'Reference to the encounter the observation was recorded at',</td>
</tr>
<tr>
<td>organization_id</td>
<td>bigint</td>
<td>NOT NULL</td>
<td> COMMENT 'Owning organisation (i.e. publisher)',</td>
<td>  organization_id bigint NOT NULL COMMENT 'Owning organisation (i.e. publisher)',</td>
</tr>
</tr>
<tr>
<tr>
Line 439: Line 446:
</tr>
</tr>
<tr>
<tr>
<td>is_problem</td>
<td>result_concept_id</td>
<td>tinyint(1)</td>
<td>int</td>
<td>NOT NULL</td>
<td>DEFAULT NULL</td>
<td> COMMENT 'Whether the observation is marked as a problem',</td>
<td>  is_problem tinyint(1) NOT NULL COMMENT 'Whether the observation is marked as a problem',</td>
</tr>
<tr>
<td>parent_observation_id</td>
<td>bigint</td>
<td>DEFAULT NULL</td>
<td> COMMENT 'Reference to the parent observation in a complex observation eg systolic and diastolic blood pressures will have a parent observation of Blood pressure',</td>
<td>  parent_observation_id bigint  NULL COMMENT 'Reference to the parent observation in a complex observation eg systolic and diastolic blood pressures will have a parent observation of Blood pressure',</td>
</tr>
<tr>
<td>result_concept_id</td>
<td>int</td>
<td>DEFAULT NULL</td>
<td> COMMENT 'Reference to the clinical coding of the result',</td>
<td> COMMENT 'Reference to the clinical coding of the result',</td>
<td>  result_concept_id int  NULL COMMENT 'Reference to the clinical coding of the result',</td>
<td>  result_concept_id int  NULL COMMENT 'Reference to the clinical coding of the result',</td>
Line 472: Line 465:
<td> COMMENT 'Reference to the episodicity of the problem eg First, review, flare',</td>
<td> COMMENT 'Reference to the episodicity of the problem eg First, review, flare',</td>
<td>  episodicity_concept_id int  NULL COMMENT 'Reference to the episodicity of the problem eg First, review, flare',</td>
<td>  episodicity_concept_id int  NULL COMMENT 'Reference to the episodicity of the problem eg First, review, flare',</td>
</tr>
<tr>
<td>problem_end_date</td>
<td>date</td>
<td>DEFAULT NULL</td>
<td> COMMENT 'The end date of the problem',</td>
<td>  problem_end_date date  NULL COMMENT 'The end date of the problem',</td>
</tr>
</tr>
<tr>
<tr>
Line 488: Line 474:
</tr>
</tr>
<tr>
<tr>
<td>is_review</td>
<td>date_recorded</td>
<td>tinyint(1)</td>
<td>datetime</td>
<td>NOT NULL</td>
<td>DEFAULT NULL,</td>
<td> COMMENT 'Whether the observation is a review of an existing problem',</td>
<td></td>
<td>  is_review tinyint(1) NOT NULL COMMENT 'Whether the observation is a review of an existing problem',</td>
<td>  date_recorded datetime  NULL,</td>
</tr>
</tr>
<tr>
<tr>
<td>result_value</td>
<td>core_concept_id</td>
<td>double</td>
<td>DEFAULT NULL</td>
<td> COMMENT 'The value of the result of the observation',</td>
<td>  result_value double  NULL COMMENT 'The value of the result of the observation',</td>
</tr>
<tr>
<td>person_id</td>
<td>bigint</td>
<td>NOT NULL</td>
<td> COMMENT 'Unique individual across all organisations',</td>
<td>  person_id bigint NOT NULL COMMENT 'Unique individual across all organisations',</td>
</tr>
<tr>
<td>core_concept_id</td>
<td>int</td>
<td>int</td>
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> COMMENT 'Reference to the clinical coding of the observation',</td>
<td> COMMENT 'Reference to the clinical coding of the observation',</td>
<td>  core_concept_id int  NULL COMMENT 'Reference to the clinical coding of the observation',</td>
<td>  core_concept_id int  NULL COMMENT 'Reference to the clinical coding of the observation',</td>
</tr>
<tr>
<td>id</td>
<td>bigint</td>
<td>NOT NULL</td>
<td> COMMENT 'Unique Id of the diagnostic order',</td>
<td>  id bigint NOT NULL COMMENT 'Unique Id of the diagnostic order',</td>
</tr>
<tr>
<td>non_core_concept_id</td>
<td>int</td>
<td>DEFAULT NULL</td>
<td> COMMENT 'Reference to the clinical coding of the observation',</td>
<td>  non_core_concept_id int  NULL COMMENT 'Reference to the clinical coding of the observation',</td>
</tr>
</tr>
<tr>
<tr>
Line 543: Line 501:
<td>  date_precision_concept_id int  NULL COMMENT 'Identifies the precision of the clinical effectiveness date to either year (1) month (2) day (5) minute (12) second (13) millisecond (14)',</td>
<td>  date_precision_concept_id int  NULL COMMENT 'Identifies the precision of the clinical effectiveness date to either year (1) month (2) day (5) minute (12) second (13) millisecond (14)',</td>
</tr>
</tr>
</tbody>
<tr>
</table>
<h2><span class="mw-headline" id="Sortable_tables">Encounter</span></h2>
<table class="sortable" border="1" style="border-collapse:collapse">
<tr>
<th scope="col" width="10%">Column Name</th>
<th scope="col" width="10%">Type</th>
<th scope="col" width="10%">Constraint</th>
<th scope="col" width="10%">Comment</th>
<th scope="col" width="10%">Sql</th>
</tr>
<tbody>
<tr>
<td>id</td>
<td>bigint</td>
<td>NOT NULL</td>
<td> COMMENT 'Unique Id of the encounter',</td>
<td>  id bigint NOT NULL COMMENT 'Unique Id of the encounter',</td>
</tr>
<tr>
<td>patient_id</td>
<td>patient_id</td>
<td>bigint</td>
<td>bigint</td>
Line 570: Line 509:
</tr>
</tr>
<tr>
<tr>
<td>date_precision_concept_id</td>
<td>organization_id</td>
<td>int</td>
<td>bigint</td>
<td>DEFAULT NULL</td>
<td>NOT NULL</td>
<td> COMMENT 'Reference to the precision of the date of the encounter',</td>
<td> COMMENT 'Owning organisation (i.e. publisher)',</td>
<td>  date_precision_concept_id int  NULL COMMENT 'Reference to the precision of the date of the encounter',</td>
<td>  organization_id bigint NOT NULL COMMENT 'Owning organisation (i.e. publisher)',</td>
</tr>
</tr>
<tr>
<tr>
<td>date_recorded</td>
<td>is_problem</td>
<td>datetime</td>
<td>tinyint(1)</td>
<td>DEFAULT NULL</td>
<td>NOT NULL</td>
<td> COMMENT 'The date the encounter was recorded',</td>
<td> COMMENT 'Whether the observation is marked as a problem',</td>
<td>  date_recorded datetime  NULL COMMENT 'The date the encounter was recorded',</td>
<td>  is_problem tinyint(1) NOT NULL COMMENT 'Whether the observation is marked as a problem',</td>
</tr>
</tr>
<tr>
<tr>
<td>appointment_id</td>
<td>parent_observation_id</td>
<td>bigint</td>
<td>bigint</td>
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> COMMENT 'Reference to the appointment this encounter took part on',</td>
<td> COMMENT 'Reference to the parent observation in a complex observation eg systolic and diastolic blood pressures will have a parent observation of Blood pressure',</td>
<td>  appointment_id bigint  NULL COMMENT 'Reference to the appointment this encounter took part on',</td>
<td>  parent_observation_id bigint  NULL COMMENT 'Reference to the parent observation in a complex observation eg systolic and diastolic blood pressures will have a parent observation of Blood pressure',</td>
</tr>
</tr>
<tr>
<tr>
<td>non_core_concept_id</td>
<td>result_text</td>
<td>int</td>
<td>text</td>
<td>DEFAULT NULL</td>
<td>COMMENT 'Any</td>
<td> COMMENT 'Reference to the type of encounter',</td>
<td> text associated with the result',</td>
<td>  non_core_concept_id int  NULL COMMENT 'Reference to the type of encounter',</td>
<td>  result_text text COMMENT 'Any text associated with the result',</td>
</tr>
</tr>
<tr>
<tr>
<td>practitioner_id</td>
<td>problem_end_date</td>
<td>bigint</td>
<td>date</td>
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> COMMENT 'The clinician the activity is recorded against',</td>
<td> COMMENT 'The end date of the problem',</td>
<td>  practitioner_id bigint NULL COMMENT 'The clinician the activity is recorded against',</td>
<td>  problem_end_date date NULL COMMENT 'The end date of the problem',</td>
</tr>
</tr>
<tr>
<tr>
<td>service_provider_organization_id</td>
<td>is_review</td>
<td>bigint</td>
<td>tinyint(1)</td>
<td>DEFAULT NULL</td>
<td>NOT NULL</td>
<td> COMMENT 'Reference to the service provider organisation',</td>
<td> COMMENT 'Whether the observation is a review of an existing problem',</td>
<td>  service_provider_organization_id bigint  NULL COMMENT 'Reference to the service provider organisation',</td>
<td>  is_review tinyint(1) NOT NULL COMMENT 'Whether the observation is a review of an existing problem',</td>
</tr>
</tr>
<tr>
<tr>
<td>clinical_effective_date</td>
<td>result_value</td>
<td>date</td>
<td>double</td>
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> COMMENT 'The date the clinical code is recorded for',</td>
<td> COMMENT 'The value of the result of the observation',</td>
<td>  clinical_effective_date date NULL COMMENT 'The date the clinical code is recorded for',</td>
<td>  result_value double NULL COMMENT 'The value of the result of the observation',</td>
</tr>
</tr>
<tr>
<tr>
<td>organization_id</td>
<td>person_id</td>
<td>bigint</td>
<td>bigint</td>
<td>NOT NULL</td>
<td>NOT NULL</td>
<td> COMMENT 'Owning organisation (i.e. publisher)',</td>
<td> COMMENT 'Unique individual across all organisations',</td>
<td>  organization_id bigint NOT NULL COMMENT 'Owning organisation (i.e. publisher)',</td>
<td>  person_id bigint NOT NULL COMMENT 'Unique individual across all organisations',</td>
</tr>
</tr>
<tr>
<tr>
<td>core_concept_id</td>
<td>id</td>
<td>int</td>
<td>bigint</td>
<td>DEFAULT NULL</td>
<td>NOT NULL</td>
<td> COMMENT 'Reference to the type of encounter',</td>
<td> COMMENT 'Unique Id of the diagnostic order',</td>
<td>  core_concept_id int  NULL COMMENT 'Reference to the type of encounter',</td>
<td>  id bigint NOT NULL COMMENT 'Unique Id of the diagnostic order',</td>
</tr>
</tr>
<tr>
<tr>
<td>admission_method</td>
<td>non_core_concept_id</td>
<td>varchar(40)</td>
<td>int</td>
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> COMMENT 'The admission method of the encounter',</td>
<td> COMMENT 'Reference to the clinical coding of the observation',</td>
<td>  admission_method varchar(40) NULL COMMENT 'The admission method of the encounter',</td>
<td>  non_core_concept_id int NULL COMMENT 'Reference to the clinical coding of the observation',</td>
</tr>
</tr>
</tbody>
</table>
<h2><span class="mw-headline" id="Sortable_tables">Encounter</span></h2>
<table class="sortable" border="1" style="border-collapse:collapse">
<tr>
<th scope="col" width="10%">Column Name</th>
<th scope="col" width="10%">Type</th>
<th scope="col" width="10%">Constraint</th>
<th scope="col" width="10%">Comment</th>
<th scope="col" width="10%">Sql</th>
</tr>
<tbody>
<tr>
<tr>
<td>age_at_event</td>
<td>id</td>
<td>decimal(5,2)</td>
<td>bigint</td>
<td>DEFAULT NULL</td>
<td>NOT NULL</td>
<td> COMMENT 'The age the patient was when this encounter took place',</td>
<td> COMMENT 'Unique Id of the encounter',</td>
<td>  age_at_event decimal(5,2)  NULL COMMENT 'The age the patient was when this encounter took place',</td>
<td>  id bigint NOT NULL COMMENT 'Unique Id of the encounter',</td>
</tr>
</tr>
<tr>
<tr>
<td>person_id</td>
<td>patient_id</td>
<td>bigint</td>
<td>bigint</td>
<td>NOT NULL</td>
<td>NOT NULL</td>
<td> COMMENT 'Unique individual across all organisations',</td>
<td> COMMENT 'The organisations record for this person’s registration. Patients may have multiple records across clinical systems and may have registered at an organisation multiple times',</td>
<td>  person_id bigint NOT NULL COMMENT 'Unique individual across all organisations',</td>
<td>  patient_id bigint NOT NULL COMMENT 'The organisations record for this person’s registration. Patients may have multiple records across clinical systems and may have registered at an organisation multiple times',</td>
</tr>
</tr>
<tr>
<tr>
<td>episode_of_care_id</td>
<td>date_precision_concept_id</td>
<td>bigint</td>
<td>int</td>
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> COMMENT 'Is this instance of the code a review of a previous encounter',</td>
<td> COMMENT 'Reference to the precision of the date of the encounter',</td>
<td>  episode_of_care_id bigint NULL COMMENT 'Is this instance of the code a review of a previous encounter',</td>
<td>  date_precision_concept_id int NULL COMMENT 'Reference to the precision of the date of the encounter',</td>
</tr>
</tr>
<tr>
<tr>
<td>end_date</td>
<td>date_recorded</td>
<td>date</td>
<td>datetime</td>
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> COMMENT 'The end date of the encounter',</td>
<td> COMMENT 'The date the encounter was recorded',</td>
<td>  end_date date NULL COMMENT 'The end date of the encounter',</td>
<td>  date_recorded datetime NULL COMMENT 'The date the encounter was recorded',</td>
</tr>
</tr>
</tbody>
<tr>
</table>
<td>appointment_id</td>
<h2><span class="mw-headline" id="Sortable_tables">Encounter_additional</span></h2>
<td>bigint</td>
<table class="sortable" border="1" style="border-collapse:collapse">
<td>DEFAULT NULL</td>
<tr>
<td> COMMENT 'Reference to the appointment this encounter took part on',</td>
<th scope="col" width="10%">Column Name</th>
<td>  appointment_id bigint NULL COMMENT 'Reference to the appointment this encounter took part on',</td>
<th scope="col" width="10%">Type</th>
<th scope="col" width="10%">Constraint</th>
<th scope="col" width="10%">Comment</th>
<th scope="col" width="10%">Sql</th>
</tr>
<tbody>
<tr>
<td>id</td>
<td>bigint</td>
<td>NOT NULL</td>
<td> COMMENT 'same as the id column on the encounter table',</td>
<td>  id bigint NOT NULL COMMENT 'same as the id column on the encounter table',</td>
</tr>
</tr>
<tr>
<tr>
<td>property_id</td>
<td>non_core_concept_id</td>
<td>int</td>
<td>int</td>
<td>NOT NULL</td>
<td>DEFAULT NULL</td>
<td> COMMENT 'IM concept id reference (i.e. Admission method)',</td>
<td> COMMENT 'Reference to the type of encounter',</td>
<td>  property_id int NOT NULL COMMENT 'IM concept id reference (i.e. Admission method)',</td>
<td>  non_core_concept_id int NULL COMMENT 'Reference to the type of encounter',</td>
</tr>
</tr>
<tr>
<tr>
<td>value_id</td>
<td>practitioner_id</td>
<td>int</td>
<td>bigint</td>
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> COMMENT 'IM concept id reference (i.e. Emergency admission)',</td>
<td> COMMENT 'The clinician the activity is recorded against',</td>
<td>  value_id int NULL COMMENT 'IM concept id reference (i.e. Emergency admission)',</td>
<td>  practitioner_id bigint NULL COMMENT 'The clinician the activity is recorded against',</td>
</tr>
</tr>
<tr>
<tr>
<td>text_value</td>
<td>service_provider_organization_id</td>
<td>varchar(255)</td>
<td>bigint</td>
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> COMMENT 'where there is no mapped value_id, or raw JSON, just a basic text value (i.e. FIN number)',</td>
<td> COMMENT 'Reference to the service provider organisation',</td>
<td>  text_value varchar(255) NULL COMMENT 'where there is no mapped value_id, or raw JSON, just a basic text value (i.e. FIN number)',</td>
<td>  service_provider_organization_id bigint NULL COMMENT 'Reference to the service provider organisation',</td>
</tr>
</tr>
<tr>
<tr>
<td>json_value</td>
<td>clinical_effective_date</td>
<td>json</td>
<td>date</td>
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> COMMENT 'where there is no mapped value_id, just raw JSON (i.e. birth delivery details)',</td>
<td> COMMENT 'The date the clinical code is recorded for',</td>
<td>  json_value json  NULL COMMENT 'where there is no mapped value_id, just raw JSON (i.e. birth delivery details)',</td>
<td>  clinical_effective_date date  NULL COMMENT 'The date the clinical code is recorded for',</td>
</tr>
<tr>
<td>organization_id</td>
<td>bigint</td>
<td>NOT NULL</td>
<td> COMMENT 'Owning organisation (i.e. publisher)',</td>
<td>  organization_id bigint NOT NULL COMMENT 'Owning organisation (i.e. publisher)',</td>
</tr>
</tr>
</tbody>
</table>
<h2><span class="mw-headline" id="Sortable_tables">Encounter_event</span></h2>
<table class="sortable" border="1" style="border-collapse:collapse">
<tr>
<th scope="col" width="10%">Column Name</th>
<th scope="col" width="10%">Type</th>
<th scope="col" width="10%">Constraint</th>
<th scope="col" width="10%">Comment</th>
<th scope="col" width="10%">Sql</th>
</tr>
<tbody>
<tr>
<tr>
<td>date_precision_concept_id</td>
<td>core_concept_id</td>
<td>int</td>
<td>int</td>
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> COMMENT 'Reference to the precision of the date of the encounter',</td>
<td> COMMENT 'Reference to the type of encounter',</td>
<td>  date_precision_concept_id int  NULL COMMENT 'Reference to the precision of the date of the encounter',</td>
<td>  core_concept_id int  NULL COMMENT 'Reference to the type of encounter',</td>
</tr>
</tr>
<tr>
<tr>
<td>date_recorded</td>
<td>admission_method</td>
<td>datetime</td>
<td>varchar(40)</td>
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> COMMENT 'The date the encounter was recorded',</td>
<td> COMMENT 'The admission method of the encounter',</td>
<td>  date_recorded datetime NULL COMMENT 'The date the encounter was recorded',</td>
<td>  admission_method varchar(40) NULL COMMENT 'The admission method of the encounter',</td>
</tr>
</tr>
<tr>
<tr>
<td>appointment_id</td>
<td>age_at_event</td>
<td>bigint</td>
<td>decimal(5,2)</td>
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> COMMENT 'Reference to the appointment this encounter took part on',</td>
<td> COMMENT 'The age the patient was when this encounter took place',</td>
<td>  appointment_id bigint NULL COMMENT 'Reference to the appointment this encounter took part on',</td>
<td>  age_at_event decimal(5,2) NULL COMMENT 'The age the patient was when this encounter took place',</td>
</tr>
</tr>
<tr>
<tr>
<td>non_core_concept_id</td>
<td>institution_location_id</td>
<td>int</td>
<td>text</td>
<td>DEFAULT NULL</td>
<td>COMMENT 'Reference</td>
<td> COMMENT 'Reference to the type of encounter',</td>
<td> to the institution the encounter took place at',</td>
<td>  non_core_concept_id int  NULL COMMENT 'Reference to the type of encounter',</td>
<td>  institution_location_id text COMMENT 'Reference to the institution the encounter took place at',</td>
</tr>
</tr>
<tr>
<tr>
<td>age_at_event</td>
<td>sub_type</td>
<td>decimal(5,2)</td>
<td>text</td>
<td>DEFAULT NULL</td>
<td>COMMENT 'Unused',</td>
<td> COMMENT 'The age of the patient at the time of the encounter',</td>
<td></td>
<td>  age_at_event decimal(5,2)  NULL COMMENT 'The age of the patient at the time of the encounter',</td>
<td>  sub_type text COMMENT 'Unused',</td>
</tr>
</tr>
<tr>
<tr>
<td>practitioner_id</td>
<td>person_id</td>
<td>bigint</td>
<td>bigint</td>
<td>DEFAULT NULL</td>
<td>NOT NULL</td>
<td> COMMENT 'The clinician the activity is recorded against',</td>
<td> COMMENT 'Unique individual across all organisations',</td>
<td>  practitioner_id bigint  NULL COMMENT 'The clinician the activity is recorded against',</td>
<td>  person_id bigint NOT NULL COMMENT 'Unique individual across all organisations',</td>
</tr>
<tr>
<td>Type</td>
<td>text</td>
<td>COMMENT 'Unused',</td>
<td></td>
<td> Type text COMMENT 'Unused',</td>
</tr>
</tr>
<tr>
<tr>
<td>service_provider_organization_id</td>
<td>episode_of_care_id</td>
<td>bigint</td>
<td>bigint</td>
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> COMMENT 'Reference to the service provider organisation',</td>
<td> COMMENT 'Is this instance of the code a review of a previous encounter',</td>
<td>  service_provider_organization_id bigint  NULL COMMENT 'Reference to the service provider organisation',</td>
<td>  episode_of_care_id bigint  NULL COMMENT 'Is this instance of the code a review of a previous encounter',</td>
</tr>
</tr>
<tr>
<tr>
<td>organization_id</td>
<td>end_date</td>
<td>bigint</td>
<td>date</td>
<td>NOT NULL</td>
<td>DEFAULT NULL</td>
<td> COMMENT 'Owning organisation (i.e. publisher)',</td>
<td> COMMENT 'The end date of the encounter',</td>
<td>  organization_id bigint NOT NULL COMMENT 'Owning organisation (i.e. publisher)',</td>
<td>  end_date date  NULL COMMENT 'The end date of the encounter',</td>
</tr>
</tr>
</tbody>
</table>
<h2><span class="mw-headline" id="Sortable_tables">Encounter_additional</span></h2>
<table class="sortable" border="1" style="border-collapse:collapse">
<tr>
<th scope="col" width="10%">Column Name</th>
<th scope="col" width="10%">Type</th>
<th scope="col" width="10%">Constraint</th>
<th scope="col" width="10%">Comment</th>
<th scope="col" width="10%">Sql</th>
</tr>
<tbody>
<tr>
<tr>
<td>person_id</td>
<td>id</td>
<td>bigint</td>
<td>bigint</td>
<td>NOT NULL</td>
<td>NOT NULL</td>
<td> COMMENT 'The person this event belongs to',</td>
<td> COMMENT 'same as the id column on the encounter table',</td>
<td>  person_id bigint NOT NULL COMMENT 'The person this event belongs to',</td>
<td>  id bigint NOT NULL COMMENT 'same as the id column on the encounter table',</td>
</tr>
</tr>
<tr>
<tr>
<td>core_concept_id</td>
<td>property_id</td>
<td>int</td>
<td>int</td>
<td>DEFAULT NULL</td>
<td>NOT NULL</td>
<td> COMMENT 'Reference to the type of encounter',</td>
<td> COMMENT 'IM concept id reference (i.e. Admission method)',</td>
<td>  core_concept_id int NULL COMMENT 'Reference to the type of encounter',</td>
<td>  property_id int NOT NULL COMMENT 'IM concept id reference (i.e. Admission method)',</td>
</tr>
</tr>
<tr>
<tr>
<td>finished</td>
<td>value_id</td>
<td>tinyint(1)</td>
<td>int</td>
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> COMMENT 'Whether the encounter is finished',</td>
<td> COMMENT 'IM concept id reference (i.e. Emergency admission)',</td>
<td>  finished tinyint(1) NULL COMMENT 'Whether the encounter is finished',</td>
<td>  value_id int NULL COMMENT 'IM concept id reference (i.e. Emergency admission)',</td>
</tr>
</tr>
<tr>
<tr>
<td>admission_method</td>
<td>text_value</td>
<td>varchar(40)</td>
<td>varchar(255)</td>
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> COMMENT 'The admission method of the encounter',</td>
<td> COMMENT 'where there is no mapped value_id, or raw JSON, just a basic text value (i.e. FIN number)',</td>
<td>  admission_method varchar(40)  NULL COMMENT 'The admission method of the encounter',</td>
<td>  text_value varchar(255)  NULL COMMENT 'where there is no mapped value_id, or raw JSON, just a basic text value (i.e. FIN number)',</td>
</tr>
</tr>
<tr>
<tr>
<td>institution_location_id</td>
<td>json_value</td>
<td>bigint</td>
<td>json</td>
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> COMMENT 'Reference to the institution the encounter took place at',</td>
<td> COMMENT 'where there is no mapped value_id, just raw JSON (i.e. birth delivery details)',</td>
<td>  institution_location_id bigint NULL COMMENT 'Reference to the institution the encounter took place at',</td>
<td>  json_value json NULL COMMENT 'where there is no mapped value_id, just raw JSON (i.e. birth delivery details)',</td>
</tr>
</tr>
</tbody>
</table>
<h2><span class="mw-headline" id="Sortable_tables">Encounter_event</span></h2>
<table class="sortable" border="1" style="border-collapse:collapse">
<tr>
<th scope="col" width="10%">Column Name</th>
<th scope="col" width="10%">Type</th>
<th scope="col" width="10%">Constraint</th>
<th scope="col" width="10%">Comment</th>
<th scope="col" width="10%">Sql</th>
</tr>
<tbody>
<tr>
<tr>
<td>episode_of_care_id</td>
<td>date_precision_concept_id</td>
<td>bigint</td>
<td>int</td>
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> COMMENT 'Reference to the episode of care this encounter belongs to',</td>
<td> COMMENT 'Reference to the precision of the date of the encounter',</td>
<td>  episode_of_care_id bigint NULL COMMENT 'Reference to the episode of care this encounter belongs to',</td>
<td>  date_precision_concept_id int NULL COMMENT 'Reference to the precision of the date of the encounter',</td>
</tr>
</tr>
<tr>
<tr>
<td>id</td>
<td>date_recorded</td>
<td>bigint</td>
<td>NOT NULL</td>
<td> COMMENT 'Unique Id of the encounter event',</td>
<td>  id bigint NOT NULL COMMENT 'Unique Id of the encounter event',</td>
</tr>
<tr>
<td>clinical_effective_date</td>
<td>datetime</td>
<td>datetime</td>
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> COMMENT 'The date the encounter took place',</td>
<td> COMMENT 'The date the encounter was recorded',</td>
<td>  clinical_effective_date datetime  NULL COMMENT 'The date the encounter took place',</td>
<td>  date_recorded datetime  NULL COMMENT 'The date the encounter was recorded',</td>
</tr>
<tr>
<td>appointment_id</td>
<td>bigint</td>
<td>DEFAULT NULL</td>
<td> COMMENT 'Reference to the appointment this encounter took part on',</td>
<td>  appointment_id bigint  NULL COMMENT 'Reference to the appointment this encounter took part on',</td>
</tr>
</tr>
<tr>
<tr>
<td>end_date</td>
<td>non_core_concept_id</td>
<td>date</td>
<td>int</td>
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> COMMENT 'The end date of the encounter',</td>
<td> COMMENT 'Reference to the type of encounter',</td>
<td>  end_date date NULL COMMENT 'The end date of the encounter',</td>
<td>  non_core_concept_id int NULL COMMENT 'Reference to the type of encounter',</td>
</tr>
</tr>
<tr>
<tr>
<td>encounter_id</td>
<td>age_at_event</td>
<td>bigint</td>
<td>decimal(5,2)</td>
<td>NOT NULL</td>
<td>DEFAULT NULL</td>
<td> COMMENT 'Reference to the parent encounter record',</td>
<td> COMMENT 'The age of the patient at the time of the encounter',</td>
<td>  encounter_id bigint NOT NULL COMMENT 'Reference to the parent encounter record',</td>
<td>  age_at_event decimal(5,2)  NULL COMMENT 'The age of the patient at the time of the encounter',</td>
</tr>
</tr>
<tr>
<tr>
<td>patient_id</td>
<td>practitioner_id</td>
<td>bigint</td>
<td>bigint</td>
<td>NOT NULL</td>
<td>DEFAULT NULL</td>
<td> COMMENT 'The patient this event belongs to',</td>
<td> COMMENT 'The clinician the activity is recorded against',</td>
<td>  patient_id bigint NOT NULL COMMENT 'The patient this event belongs to',</td>
<td>  practitioner_id bigint NULL COMMENT 'The clinician the activity is recorded against',</td>
</tr>
</tr>
</tbody>
</table>
<h2><span class="mw-headline" id="Sortable_tables">Episode_of_care</span></h2>
<table class="sortable" border="1" style="border-collapse:collapse">
<tr>
<th scope="col" width="10%">Column Name</th>
<th scope="col" width="10%">Type</th>
<th scope="col" width="10%">Constraint</th>
<th scope="col" width="10%">Comment</th>
<th scope="col" width="10%">Sql</th>
</tr>
<tbody>
<tr>
<tr>
<td>patient_id</td>
<td>service_provider_organization_id</td>
<td>bigint</td>
<td>bigint</td>
<td>NOT NULL</td>
<td>DEFAULT NULL</td>
<td> COMMENT 'The organisations record for this person’s registration. Patients may have multiple records across clinical systems and may have registered at an organisation multiple times',</td>
<td> COMMENT 'Reference to the service provider organisation',</td>
<td>  patient_id bigint NOT NULL COMMENT 'The organisations record for this person’s registration. Patients may have multiple records across clinical systems and may have registered at an organisation multiple times',</td>
<td>  service_provider_organization_id bigint NULL COMMENT 'Reference to the service provider organisation',</td>
</tr>
</tr>
<tr>
<tr>
<td>id</td>
<td>organization_id</td>
<td>bigint</td>
<td>bigint</td>
<td>NOT NULL</td>
<td>NOT NULL</td>
<td> COMMENT 'Unique Id of the episode of care',</td>
<td> COMMENT 'Owning organisation (i.e. publisher)',</td>
<td>  id bigint NOT NULL COMMENT 'Unique Id of the episode of care',</td>
<td>  organization_id bigint NOT NULL COMMENT 'Owning organisation (i.e. publisher)',</td>
</tr>
</tr>
<tr>
<tr>
<td>date_registered</td>
<td>person_id</td>
<td>date</td>
<td>bigint</td>
<td>DEFAULT NULL</td>
<td>NOT NULL</td>
<td> COMMENT 'The date the registration was started  for this episode of care',</td>
<td> COMMENT 'The person this event belongs to',</td>
<td>  date_registered date  NULL COMMENT 'The date the registration was started  for this episode of care',</td>
<td>  person_id bigint NOT NULL COMMENT 'The person this event belongs to',</td>
</tr>
</tr>
<tr>
<tr>
<td>registration_status_concept_id</td>
<td>core_concept_id</td>
<td>int</td>
<td>int</td>
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> COMMENT 'Reference to the registration status of the patient',</td>
<td> COMMENT 'Reference to the type of encounter',</td>
<td>  registration_status_concept_id int  NULL COMMENT 'Reference to the registration status of the patient',</td>
<td>  core_concept_id int  NULL COMMENT 'Reference to the type of encounter',</td>
</tr>
</tr>
<tr>
<tr>
<td>date_registered_end</td>
<td>finished</td>
<td>date</td>
<td>tinyint(1)</td>
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> COMMENT 'The date the registration was ended  for this episode of care',</td>
<td> COMMENT 'Whether the encounter is finished',</td>
<td>  date_registered_end date NULL COMMENT 'The date the registration was ended  for this episode of care',</td>
<td>  finished tinyint(1) NULL COMMENT 'Whether the encounter is finished',</td>
</tr>
</tr>
<tr>
<tr>
<td>organization_id</td>
<td>admission_method</td>
<td>bigint</td>
<td>varchar(40)</td>
<td>NOT NULL</td>
<td>DEFAULT NULL</td>
<td> COMMENT 'Owning organisation (i.e. publisher)',</td>
<td> COMMENT 'The admission method of the encounter',</td>
<td>  organization_id bigint NOT NULL COMMENT 'Owning organisation (i.e. publisher)',</td>
<td>  admission_method varchar(40) NULL COMMENT 'The admission method of the encounter',</td>
</tr>
<tr>
<td>institution_location_id</td>
<td>bigint</td>
<td>DEFAULT NULL</td>
<td> COMMENT 'Reference to the institution the encounter took place at',</td>
<td>  institution_location_id bigint NULL COMMENT 'Reference to the institution the encounter took place at',</td>
</tr>
</tr>
<tr>
<tr>
<td>usual_gp_practitioner_id</td>
<td>episode_of_care_id</td>
<td>bigint</td>
<td>bigint</td>
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> COMMENT 'Reference to the usual GP for this episode of care',</td>
<td> COMMENT 'Reference to the episode of care this encounter belongs to',</td>
<td>  usual_gp_practitioner_id bigint  NULL COMMENT 'Reference to the usual GP for this episode of care',</td>
<td>  episode_of_care_id bigint  NULL COMMENT 'Reference to the episode of care this encounter belongs to',</td>
</tr>
</tr>
<tr>
<tr>
<td>person_id</td>
<td>id</td>
<td>bigint</td>
<td>bigint</td>
<td>NOT NULL</td>
<td>NOT NULL</td>
<td> COMMENT 'Unique individual across all organisations',</td>
<td> COMMENT 'Unique Id of the encounter event',</td>
<td>  person_id bigint NOT NULL COMMENT 'Unique individual across all organisations',</td>
<td>  id bigint NOT NULL COMMENT 'Unique Id of the encounter event',</td>
</tr>
</tr>
<tr>
<tr>
<td>registration_type_concept_id</td>
<td>clinical_effective_date</td>
<td>int</td>
<td>datetime</td>
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> COMMENT 'Reference to the registration type of the patient',</td>
<td> COMMENT 'The date the encounter took place',</td>
<td>  registration_type_concept_id int NULL COMMENT 'Reference to the registration type of the patient',</td>
<td>  clinical_effective_date datetime  NULL COMMENT 'The date the encounter took place',</td>
</tr>
<tr>
<td>sub_type</td>
<td>text</td>
<td>COMMENT 'Unused',</td>
<td></td>
<td>  sub_type text COMMENT 'Unused',</td>
</tr>
<tr>
<td>end_date</td>
<td>date</td>
<td>DEFAULT NULL</td>
<td> COMMENT 'The end date of the encounter',</td>
<td>  end_date date NULL COMMENT 'The end date of the encounter',</td>
</tr>
<tr>
<td>encounter_id</td>
<td>bigint</td>
<td>NOT NULL</td>
<td> COMMENT 'Reference to the parent encounter record',</td>
<td>  encounter_id bigint NOT NULL COMMENT 'Reference to the parent encounter record',</td>
</tr>
<tr>
<td>patient_id</td>
<td>bigint</td>
<td>NOT NULL</td>
<td> COMMENT 'The patient this event belongs to',</td>
<td>  patient_id bigint NOT NULL COMMENT 'The patient this event belongs to',</td>
</tr>
<tr>
<td>type</td>
<td>text</td>
<td>COMMENT 'Unused',</td>
<td></td>
<td>  type text COMMENT 'Unused',</td>
</tr>
</tr>
</tbody>
</tbody>
</table>
</table>
<h2><span class="mw-headline" id="Sortable_tables">Event_log</span></h2>
<h2><span class="mw-headline" id="Sortable_tables">Episode_of_care</span></h2>
<table class="sortable" border="1" style="border-collapse:collapse">
<table class="sortable" border="1" style="border-collapse:collapse">
<tr>
<tr>
Line 947: Line 942:
<tbody>
<tbody>
<tr>
<tr>
<td>dt_change</td>
<td>patient_id</td>
<td>datetime(3)</td>
<td>bigint</td>
<td>NOT NULL</td>
<td>NOT NULL</td>
<td> COMMENT 'date time the change was made to this DB',</td>
<td> COMMENT 'The organisations record for this person’s registration. Patients may have multiple records across clinical systems and may have registered at an organisation multiple times',</td>
<td>  dt_change datetime(3) NOT NULL COMMENT 'date time the change was made to this DB',</td>
<td>  patient_id bigint NOT NULL COMMENT 'The organisations record for this person’s registration. Patients may have multiple records across clinical systems and may have registered at an organisation multiple times',</td>
</tr>
</tr>
<tr>
<tr>
<td>change_type</td>
<td>id</td>
<td>tinyint</td>
<td>bigint</td>
<td>NOT NULL</td>
<td>NOT NULL</td>
<td> COMMENT 'type of transaction 0=insert, 1=update, 2=delete',</td>
<td> COMMENT 'Unique Id of the episode of care',</td>
<td>  change_type tinyint NOT NULL COMMENT 'type of transaction 0=insert, 1=update, 2=delete',</td>
<td>  id bigint NOT NULL COMMENT 'Unique Id of the episode of care',</td>
</tr>
</tr>
<tr>
<tr>
<td>table_id</td>
<td>date_registered</td>
<td>tinyint</td>
<td>date</td>
<td>NOT NULL</td>
<td>DEFAULT NULL</td>
<td> COMMENT 'identifier of the table changed',</td>
<td> COMMENT 'The date the registration was started  for this episode of care',</td>
<td>  table_id tinyint NOT NULL COMMENT 'identifier of the table changed',</td>
<td>  date_registered date  NULL COMMENT 'The date the registration was started  for this episode of care',</td>
</tr>
</tr>
<tr>
<tr>
<td>record_id</td>
<td>registration_status_concept_id</td>
<td>bigint</td>
<td>int</td>
<td>NOT NULL</td>
<td>DEFAULT NULL</td>
<td> COMMENT 'id of the record changed'</td>
<td> COMMENT 'Reference to the registration status of the patient',</td>
<td>  record_id bigint NOT NULL COMMENT 'id of the record changed'</td>
<td>  registration_status_concept_id int  NULL COMMENT 'Reference to the registration status of the patient',</td>
</tr>
<tr>
<td>date_registered_end</td>
<td>date</td>
<td>DEFAULT NULL</td>
<td> COMMENT 'The date the registration was ended  for this episode of care',</td>
<td>  date_registered_end date  NULL COMMENT 'The date the registration was ended  for this episode of care',</td>
</tr>
</tr>
</tbody>
</table>
<h2><span class="mw-headline" id="Sortable_tables">Flag</span></h2>
<table class="sortable" border="1" style="border-collapse:collapse">
<tr>
<th scope="col" width="10%">Column Name</th>
<th scope="col" width="10%">Type</th>
<th scope="col" width="10%">Constraint</th>
<th scope="col" width="10%">Comment</th>
<th scope="col" width="10%">Sql</th>
</tr>
<tbody>
<tr>
<tr>
<td>patient_id</td>
<td>organization_id</td>
<td>bigint</td>
<td>bigint</td>
<td>NOT NULL</td>
<td>NOT NULL</td>
<td> COMMENT 'The organisations record for this person’s registration. Patients may have multiple records across clinical systems and may have registered at an organisation multiple times',</td>
<td> COMMENT 'Owning organisation (i.e. publisher)',</td>
<td>  patient_id bigint NOT NULL COMMENT 'The organisations record for this person’s registration. Patients may have multiple records across clinical systems and may have registered at an organisation multiple times',</td>
<td>  organization_id bigint NOT NULL COMMENT 'Owning organisation (i.e. publisher)',</td>
</tr>
</tr>
<tr>
<tr>
<td>is_active</td>
<td>usual_gp_practitioner_id</td>
<td>tinyint(1)</td>
<td>bigint</td>
<td>NOT NULL</td>
<td> COMMENT 'Whether the flag is active or not',</td>
<td>  is_active tinyint(1) NOT NULL COMMENT 'Whether the flag is active or not',</td>
</tr>
<tr>
<td>effective_date</td>
<td>date</td>
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> COMMENT 'The date the flag was entered onto the patients record',</td>
<td> COMMENT 'Reference to the usual GP for this episode of care',</td>
<td>  effective_date date NULL COMMENT 'The date the flag was entered onto the patients record',</td>
<td>  usual_gp_practitioner_id bigint NULL COMMENT 'Reference to the usual GP for this episode of care',</td>
</tr>
<tr>
<td>organization_id</td>
<td>bigint</td>
<td>NOT NULL</td>
<td> COMMENT 'Owning organisation (i.e. publisher)',</td>
<td>  organization_id bigint NOT NULL COMMENT 'Owning organisation (i.e. publisher)',</td>
</tr>
</tr>
<tr>
<tr>
Line 1,022: Line 998:
</tr>
</tr>
<tr>
<tr>
<td>date_precision_concept_id</td>
<td>registration_type_concept_id</td>
<td>int</td>
<td>int</td>
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> COMMENT 'Identifies the precision of the clinical effectiveness date to either year (1) month (2) day (5) minute (12) second (13) millisecond (14)',</td>
<td> COMMENT 'Reference to the registration type of the patient',</td>
<td>  date_precision_concept_id int  NULL COMMENT 'Identifies the precision of the clinical effectiveness date to either year (1) month (2) day (5) minute (12) second (13) millisecond (14)',</td>
<td>  registration_type_concept_id int  NULL COMMENT 'Reference to the registration type of the patient',</td>
</tr>
</tr>
<tr>
</tbody>
<td>id</td>
<td>bigint</td>
<td>NOT NULL</td>
<td> COMMENT 'Unique Id of the flag',</td>
<td>  id bigint NOT NULL COMMENT 'Unique Id of the flag',</td>
</tr>
</tbody>
</table>
</table>
<h2><span class="mw-headline" id="Sortable_tables">Location</span></h2>
<h2><span class="mw-headline" id="Sortable_tables">Event_log</span></h2>
<table class="sortable" border="1" style="border-collapse:collapse">
<table class="sortable" border="1" style="border-collapse:collapse">
<tr>
<tr>
Line 1,048: Line 1,017:
<tbody>
<tbody>
<tr>
<tr>
<td>type_code</td>
<td>dt_change</td>
<td>varchar(50)</td>
<td>datetime(3)</td>
<td>DEFAULT NULL</td>
<td>NOT NULL</td>
<td> COMMENT 'The type of location',</td>
<td> COMMENT 'date time the change was made to this DB',</td>
<td>  type_code varchar(50) NULL COMMENT 'The type of location',</td>
<td>  dt_change datetime(3) NOT NULL COMMENT 'date time the change was made to this DB',</td>
</tr>
</tr>
<tr>
<tr>
<td>name</td>
<td>change_type</td>
<td>varchar(255)</td>
<td>tinyint</td>
<td>DEFAULT NULL</td>
<td>NOT NULL</td>
<td> COMMENT 'The name of a location set by the publisher. E.g. ward, clinic, domiciliary',</td>
<td> COMMENT 'type of transaction 0=insert, 1=update, 2=delete',</td>
<td>  name varchar(255)  NULL COMMENT 'The name of a location set by the publisher. E.g. ward, clinic, domiciliary',</td>
<td>  change_type tinyint NOT NULL COMMENT 'type of transaction 0=insert, 1=update, 2=delete',</td>
</tr>
</tr>
<tr>
<tr>
<td>id</td>
<td>table_id</td>
<td>bigint</td>
<td>tinyint</td>
<td>NOT NULL</td>
<td>NOT NULL</td>
<td> COMMENT 'Unique Id of the location',</td>
<td> COMMENT 'identifier of the table changed',</td>
<td>  id bigint NOT NULL COMMENT 'Unique Id of the location',</td>
<td>  table_id tinyint NOT NULL COMMENT 'identifier of the table changed',</td>
</tr>
</tr>
<tr>
<tr>
<td>type_desc</td>
<td>record_id</td>
<td>varchar(255)</td>
<td>DEFAULT NULL</td>
<td> COMMENT 'Textual description of the type of location eg GP Practice',</td>
<td>  type_desc varchar(255)  NULL COMMENT 'Textual description of the type of location eg GP Practice',</td>
</tr>
<tr>
<td>postcode</td>
<td>varchar(10)</td>
<td>DEFAULT NULL</td>
<td> COMMENT 'The postcode of the location',</td>
<td>  postcode varchar(10)  NULL COMMENT 'The postcode of the location',</td>
</tr>
<tr>
<td>managing_organization_id</td>
<td>bigint</td>
<td>bigint</td>
<td>DEFAULT NULL</td>
<td>NOT NULL</td>
<td> COMMENT 'Reference to the managing organisation of the location',</td>
<td> COMMENT 'id of the record changed'</td>
<td>  managing_organization_id bigint NULL COMMENT 'Reference to the managing organisation of the location',</td>
<td>  record_id bigint NOT NULL COMMENT 'id of the record changed'</td>
</tr>
</tr>
</tbody>
</tbody>
</table>
</table>
<h2><span class="mw-headline" id="Sortable_tables">Medication_order</span></h2>
<h2><span class="mw-headline" id="Sortable_tables">Flag</span></h2>
<table class="sortable" border="1" style="border-collapse:collapse">
<table class="sortable" border="1" style="border-collapse:collapse">
<tr>
<tr>
Line 1,101: Line 1,056:
</tr>
</tr>
<tbody>
<tbody>
<tr>
<td>clinical_effective_date</td>
<td>date</td>
<td>DEFAULT NULL</td>
<td> COMMENT 'The date the medication order was issued',</td>
<td>  clinical_effective_date date  NULL COMMENT 'The date the medication order was issued',</td>
</tr>
<tr>
<tr>
<td>patient_id</td>
<td>patient_id</td>
Line 1,116: Line 1,064:
</tr>
</tr>
<tr>
<tr>
<td>practitioner_id</td>
<td>is_active</td>
<td>bigint</td>
<td>tinyint(1)</td>
<td>DEFAULT NULL</td>
<td>NOT NULL</td>
<td> COMMENT 'The clinician the activity is recorded against',</td>
<td> COMMENT 'Whether the flag is active or not',</td>
<td>  practitioner_id bigint  NULL COMMENT 'The clinician the activity is recorded against',</td>
<td>  is_active tinyint(1) NOT NULL COMMENT 'Whether the flag is active or not',</td>
</tr>
</tr>
<tr>
<tr>
<td>non_core_concept_id</td>
<td>effective_date</td>
<td>int</td>
<td>date</td>
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> COMMENT 'Reference to the clinical coding of the medication',</td>
<td> COMMENT 'The date the flag was entered onto the patients record',</td>
<td>  non_core_concept_id int NULL COMMENT 'Reference to the clinical coding of the medication',</td>
<td>  effective_date date NULL COMMENT 'The date the flag was entered onto the patients record',</td>
</tr>
</tr>
<tr>
<tr>
Line 1,137: Line 1,085:
</tr>
</tr>
<tr>
<tr>
<td>dose</td>
<td>person_id</td>
<td>varchar(1000)</td>
<td>bigint</td>
<td>DEFAULT NULL</td>
<td>NOT NULL</td>
<td> COMMENT 'Textual description of the dose',</td>
<td> COMMENT 'Unique individual across all organisations',</td>
<td>  dose varchar(1000)  NULL COMMENT 'Textual description of the dose',</td>
<td>  person_id bigint NOT NULL COMMENT 'Unique individual across all organisations',</td>
</tr>
</tr>
<tr>
<tr>
<td>quantity_unit</td>
<td>flag_text</td>
<td>varchar(255)</td>
<td>text</td>
<td>DEFAULT NULL</td>
<td>COMMENT 'This</td>
<td> COMMENT 'The unit of the medication that was prescribed eg tablets',</td>
<td> is a warning set by the publisher regarding he patient',</td>
<td>  quantity_unit varchar(255)  NULL COMMENT 'The unit of the medication that was prescribed eg tablets',</td>
<td>  flag_text text COMMENT 'This is a warning set by the publisher regarding he patient',</td>
</tr>
</tr>
<tr>
<tr>
<td>age_at_event</td>
<td>date_precision_concept_id</td>
<td>decimal(5,2)</td>
<td>DEFAULT NULL</td>
<td> COMMENT 'The age the patient was at the time of this event',</td>
<td>  age_at_event decimal(5,2)  NULL COMMENT 'The age the patient was at the time of this event',</td>
</tr>
<tr>
<td>core_concept_id</td>
<td>int</td>
<td>int</td>
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> COMMENT 'Reference to the clinical coding of the medication',</td>
<td> COMMENT 'Identifies the precision of the clinical effectiveness date to either year (1) month (2) day (5) minute (12) second (13) millisecond (14)',</td>
<td>  core_concept_id int  NULL COMMENT 'Reference to the clinical coding of the medication',</td>
<td>  date_precision_concept_id int  NULL COMMENT 'Identifies the precision of the clinical effectiveness date to either year (1) month (2) day (5) minute (12) second (13) millisecond (14)',</td>
</tr>
</tr>
<tr>
<tr>
Line 1,168: Line 1,109:
<td>bigint</td>
<td>bigint</td>
<td>NOT NULL</td>
<td>NOT NULL</td>
<td> COMMENT 'Unique Id of the medication order',</td>
<td> COMMENT 'Unique Id of the flag',</td>
<td>  id bigint NOT NULL COMMENT 'Unique Id of the medication order',</td>
<td>  id bigint NOT NULL COMMENT 'Unique Id of the flag',</td>
</tr>
</tr>
<tr>
</tbody>
<td>bnf_reference</td>
</table>
<td>varchar(6)</td>
<h2><span class="mw-headline" id="Sortable_tables">Location</span></h2>
<table class="sortable" border="1" style="border-collapse:collapse">
<tr>
<th scope="col" width="10%">Column Name</th>
<th scope="col" width="10%">Type</th>
<th scope="col" width="10%">Constraint</th>
<th scope="col" width="10%">Comment</th>
<th scope="col" width="10%">Sql</th>
</tr>
<tbody>
<tr>
<td>type_code</td>
<td>varchar(50)</td>
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> COMMENT 'A reference to the drug in the BNF dictionary',</td>
<td> COMMENT 'The type of location',</td>
<td>  bnf_reference varchar(6)  NULL COMMENT 'A reference to the drug in the BNF dictionary',</td>
<td>  type_code varchar(50)  NULL COMMENT 'The type of location',</td>
</tr>
</tr>
<tr>
<tr>
<td>duration_days</td>
<td>name</td>
<td>int</td>
<td>varchar(255)</td>
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> COMMENT 'How many days the medication is prescribed for',</td>
<td> COMMENT 'The name of a location set by the publisher. E.g. ward, clinic, domiciliary',</td>
<td>  duration_days int NULL COMMENT 'How many days the medication is prescribed for',</td>
<td>  name varchar(255) NULL COMMENT 'The name of a location set by the publisher. E.g. ward, clinic, domiciliary',</td>
</tr>
</tr>
<tr>
<tr>
<td>person_id</td>
<td>id</td>
<td>bigint</td>
<td>bigint</td>
<td>NOT NULL</td>
<td>NOT NULL</td>
<td> COMMENT 'Unique individual across all organisations',</td>
<td> COMMENT 'Unique Id of the location',</td>
<td>  person_id bigint NOT NULL COMMENT 'Unique individual across all organisations',</td>
<td>  id bigint NOT NULL COMMENT 'Unique Id of the location',</td>
</tr>
</tr>
<tr>
<tr>
<td>encounter_id</td>
<td>type_desc</td>
<td>bigint</td>
<td>varchar(255)</td>
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> COMMENT 'Reference to the encounter the medication order was issued in',</td>
<td> COMMENT 'Textual description of the type of location eg GP Practice',</td>
<td>  encounter_id bigint NULL COMMENT 'Reference to the encounter the medication order was issued in',</td>
<td>  type_desc varchar(255) NULL COMMENT 'Textual description of the type of location eg GP Practice',</td>
</tr>
</tr>
<tr>
<tr>
<td>date_precision_concept_id</td>
<td>postcode</td>
<td>int</td>
<td>varchar(10)</td>
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> COMMENT 'Identifies the precision of the clinical effectiveness date to either year (1) month (2) day (5) minute (12) second (13) millisecond (14)',</td>
<td> COMMENT 'The postcode of the location',</td>
<td>  date_precision_concept_id int NULL COMMENT 'Identifies the precision of the clinical effectiveness date to either year (1) month (2) day (5) minute (12) second (13) millisecond (14)',</td>
<td>  postcode varchar(10) NULL COMMENT 'The postcode of the location',</td>
</tr>
</tr>
<tr>
<tr>
<td>medication_statement_id</td>
<td>managing_organization_id</td>
<td>bigint</td>
<td>bigint</td>
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> COMMENT 'Reference to the medication statement.  A medication statement can have many medication orders',</td>
<td> COMMENT 'Reference to the managing organisation of the location',</td>
<td>  medication_statement_id bigint  NULL COMMENT 'Reference to the medication statement.  A medication statement can have many medication orders',</td>
<td>  managing_organization_id bigint  NULL COMMENT 'Reference to the managing organisation of the location',</td>
</tr>
</tr>
<tr>
</tbody>
<td>quantity_value</td>
</table>
<td>double</td>
<h2><span class="mw-headline" id="Sortable_tables">Medication_order</span></h2>
<td>DEFAULT NULL</td>
<td> COMMENT 'The value of the medication that was prescribed eg 50',</td>
<td>  quantity_value double  NULL COMMENT 'The value of the medication that was prescribed eg 50',</td>
</tr>
<tr>
<td>estimated_cost</td>
<td>double</td>
<td>DEFAULT NULL</td>
<td> COMMENT 'The estimated cost of the medication',</td>
<td>  estimated_cost double  NULL COMMENT 'The estimated cost of the medication',</td>
</tr>
</tbody>
</table>
<h2><span class="mw-headline" id="Sortable_tables">Medication_statement</span></h2>
<table class="sortable" border="1" style="border-collapse:collapse">
<table class="sortable" border="1" style="border-collapse:collapse">
<tr>
<tr>
Line 1,240: Line 1,179:
<tbody>
<tbody>
<tr>
<tr>
<td>dose</td>
<td>clinical_effective_date</td>
<td>varchar(1000)</td>
<td>date</td>
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> COMMENT 'Texual description of the dose of the medication',</td>
<td> COMMENT 'The date the medication order was issued',</td>
<td>  dose varchar(1000) NULL COMMENT 'Texual description of the dose of the medication',</td>
<td>  clinical_effective_date date NULL COMMENT 'The date the medication order was issued',</td>
</tr>
</tr>
<tr>
<tr>
Line 1,275: Line 1,214:
</tr>
</tr>
<tr>
<tr>
<td>clinical_effective_date</td>
<td>dose</td>
<td>date</td>
<td>varchar(1000)</td>
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> COMMENT 'The date the medication was clinical relevant',</td>
<td> COMMENT 'Textual description of the dose',</td>
<td>  clinical_effective_date date NULL COMMENT 'The date the medication was clinical relevant',</td>
<td>  dose varchar(1000) NULL COMMENT 'Textual description of the dose',</td>
</tr>
<tr>
<td>cancellation_date</td>
<td>date</td>
<td>DEFAULT NULL</td>
<td> COMMENT 'The date the medication was cancelled',</td>
<td>  cancellation_date date  NULL COMMENT 'The date the medication was cancelled',</td>
</tr>
</tr>
<tr>
<tr>
Line 1,308: Line 1,240:
<td> COMMENT 'Reference to the clinical coding of the medication',</td>
<td> COMMENT 'Reference to the clinical coding of the medication',</td>
<td>  core_concept_id int  NULL COMMENT 'Reference to the clinical coding of the medication',</td>
<td>  core_concept_id int  NULL COMMENT 'Reference to the clinical coding of the medication',</td>
</tr>
<tr>
<td>id</td>
<td>bigint</td>
<td>NOT NULL</td>
<td> COMMENT 'Unique Id of the medication order',</td>
<td>  id bigint NOT NULL COMMENT 'Unique Id of the medication order',</td>
</tr>
</tr>
<tr>
<tr>
Line 1,317: Line 1,256:
</tr>
</tr>
<tr>
<tr>
<td>authorisation_type_concept_id</td>
<td>duration_days</td>
<td>int</td>
<td>int</td>
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> COMMENT 'Reference to the authorisation type',</td>
<td> COMMENT 'How many days the medication is prescribed for',</td>
<td>  authorisation_type_concept_id int  NULL COMMENT 'Reference to the authorisation type',</td>
<td>  duration_days int  NULL COMMENT 'How many days the medication is prescribed for',</td>
</tr>
</tr>
<tr>
<tr>
<td>encounter_id</td>
<td>person_id</td>
<td>bigint</td>
<td>bigint</td>
<td>DEFAULT NULL</td>
<td>NOT NULL</td>
<td> COMMENT 'Reference to the encounter this medication was recorded in',</td>
<td> COMMENT 'Unique individual across all organisations',</td>
<td>  encounter_id bigint NULL COMMENT 'Reference to the encounter this medication was recorded in',</td>
<td>  person_id bigint NOT NULL COMMENT 'Unique individual across all organisations',</td>
</tr>
</tr>
<tr>
<tr>
<td>id</td>
<td>issue_method</td>
<td>bigint</td>
<td>text</td>
<td>NOT NULL</td>
<td>COMMENT 'The</td>
<td> COMMENT 'Unique Id of the medication',</td>
<td> issue method of the medication eg hand written',</td>
<td>  id bigint NOT NULL COMMENT 'Unique Id of the medication',</td>
<td>  issue_method text COMMENT 'The issue method of the medication eg hand written',</td>
</tr>
</tr>
<tr>
<tr>
<td>is_active</td>
<td>encounter_id</td>
<td>tinyint(1)</td>
<td>bigint</td>
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> COMMENT 'Whether the medication is active or not',</td>
<td> COMMENT 'Reference to the encounter the medication order was issued in',</td>
<td>  is_active tinyint(1) NULL COMMENT 'Whether the medication is active or not',</td>
<td>  encounter_id bigint NULL COMMENT 'Reference to the encounter the medication order was issued in',</td>
</tr>
<tr>
<td>person_id</td>
<td>bigint</td>
<td>NOT NULL</td>
<td> COMMENT 'Unique individual across all organisations',</td>
<td>  person_id bigint NOT NULL COMMENT 'Unique individual across all organisations',</td>
</tr>
</tr>
<tr>
<tr>
Line 1,357: Line 1,289:
<td> COMMENT 'Identifies the precision of the clinical effectiveness date to either year (1) month (2) day (5) minute (12) second (13) millisecond (14)',</td>
<td> COMMENT 'Identifies the precision of the clinical effectiveness date to either year (1) month (2) day (5) minute (12) second (13) millisecond (14)',</td>
<td>  date_precision_concept_id int  NULL COMMENT 'Identifies the precision of the clinical effectiveness date to either year (1) month (2) day (5) minute (12) second (13) millisecond (14)',</td>
<td>  date_precision_concept_id int  NULL COMMENT 'Identifies the precision of the clinical effectiveness date to either year (1) month (2) day (5) minute (12) second (13) millisecond (14)',</td>
</tr>
<tr>
<td>medication_statement_id</td>
<td>bigint</td>
<td>DEFAULT NULL</td>
<td> COMMENT 'Reference to the medication statement.  A medication statement can have many medication orders',</td>
<td>  medication_statement_id bigint  NULL COMMENT 'Reference to the medication statement.  A medication statement can have many medication orders',</td>
</tr>
</tr>
<tr>
<tr>
Line 1,365: Line 1,304:
<td>  quantity_value double  NULL COMMENT 'The value of the medication that was prescribed eg 50',</td>
<td>  quantity_value double  NULL COMMENT 'The value of the medication that was prescribed eg 50',</td>
</tr>
</tr>
</tbody>
<tr>
<td>estimated_cost</td>
<td>double</td>
<td>DEFAULT NULL</td>
<td> COMMENT 'The estimated cost of the medication',</td>
<td>  estimated_cost double  NULL COMMENT 'The estimated cost of the medication',</td>
</tr>
</tbody>
</table>
</table>
<h2><span class="mw-headline" id="Sortable_tables">Observation</span></h2>
<h2><span class="mw-headline" id="Sortable_tables">Medication_statement</span></h2>
<table class="sortable" border="1" style="border-collapse:collapse">
<table class="sortable" border="1" style="border-collapse:collapse">
<tr>
<tr>
Line 1,377: Line 1,323:
</tr>
</tr>
<tbody>
<tbody>
<tr>
<td>dose</td>
<td>varchar(1000)</td>
<td>DEFAULT NULL</td>
<td> COMMENT 'Texual description of the dose of the medication',</td>
<td>  dose varchar(1000)  NULL COMMENT 'Texual description of the dose of the medication',</td>
</tr>
<tr>
<tr>
<td>patient_id</td>
<td>patient_id</td>
Line 1,383: Line 1,336:
<td> COMMENT 'The organisations record for this person’s registration. Patients may have multiple records across clinical systems and may have registered at an organisation multiple times',</td>
<td> COMMENT 'The organisations record for this person’s registration. Patients may have multiple records across clinical systems and may have registered at an organisation multiple times',</td>
<td>  patient_id bigint NOT NULL COMMENT 'The organisations record for this person’s registration. Patients may have multiple records across clinical systems and may have registered at an organisation multiple times',</td>
<td>  patient_id bigint NOT NULL COMMENT 'The organisations record for this person’s registration. Patients may have multiple records across clinical systems and may have registered at an organisation multiple times',</td>
</tr>
<tr>
<td>result_date</td>
<td>date</td>
<td>DEFAULT NULL</td>
<td> COMMENT 'The date of the result',</td>
<td>  result_date date  NULL COMMENT 'The date of the result',</td>
</tr>
</tr>
<tr>
<tr>
Line 1,399: Line 1,345:
</tr>
</tr>
<tr>
<tr>
<td>encounter_id</td>
<td>Issue_method</td>
<td>bigint</td>
<td>text</td>
<td>DEFAULT NULL</td>
<td>COMMENT 'The</td>
<td> COMMENT 'Reference to the encounter the observation was recorded at',</td>
<td> issue method of the medication eg hand written',</td>
<td>  encounter_id bigint  NULL COMMENT 'Reference to the encounter the observation was recorded at',</td>
<td>  Issue_method text COMMENT 'The issue method of the medication eg hand written',</td>
</tr>
</tr>
<tr>
<tr>
<td>organization_id</td>
<td>non_core_concept_id</td>
<td>int</td>
<td>DEFAULT NULL</td>
<td> COMMENT 'Reference to the clinical coding of the medication',</td>
<td>  non_core_concept_id int  NULL COMMENT 'Reference to the clinical coding of the medication',</td>
</tr>
<tr>
<td>organization_id</td>
<td>bigint</td>
<td>bigint</td>
<td>NOT NULL</td>
<td>NOT NULL</td>
Line 1,413: Line 1,366:
</tr>
</tr>
<tr>
<tr>
<td>date_recorded</td>
<td>clinical_effective_date</td>
<td>datetime</td>
<td>date</td>
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> COMMENT 'The date the observation was recorded in the system',</td>
<td> COMMENT 'The date the medication was clinical relevant',</td>
<td>  date_recorded datetime NULL COMMENT 'The date the observation was recorded in the system',</td>
<td>  clinical_effective_date date NULL COMMENT 'The date the medication was clinical relevant',</td>
</tr>
</tr>
<tr>
<tr>
<td>id</td>
<td>cancellation_date</td>
<td>bigint</td>
<td>date</td>
<td>NOT NULL</td>
<td>DEFAULT NULL</td>
<td> COMMENT 'Unique Id of the observation',</td>
<td> COMMENT 'The date the medication was cancelled',</td>
<td>  id bigint NOT NULL COMMENT 'Unique Id of the observation',</td>
<td>  cancellation_date date  NULL COMMENT 'The date the medication was cancelled',</td>
</tr>
</tr>
<tr>
<tr>
<td>is_problem</td>
<td>quantity_unit</td>
<td>tinyint(1)</td>
<td>varchar(255)</td>
<td>NOT NULL</td>
<td>DEFAULT NULL</td>
<td> COMMENT 'Whether the observation is marked as a problem',</td>
<td> COMMENT 'The unit of the medication that was prescribed eg tablets',</td>
<td>  is_problem tinyint(1) NOT NULL COMMENT 'Whether the observation is marked as a problem',</td>
<td>  quantity_unit varchar(255) NULL COMMENT 'The unit of the medication that was prescribed eg tablets',</td>
</tr>
</tr>
<tr>
<tr>
<td>parent_observation_id</td>
<td>age_at_event</td>
<td>bigint</td>
<td>decimal(5,2)</td>
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> COMMENT 'Reference to the parent observation in a complex observation eg systolic and diastolic blood pressures will have a parent observation of Blood pressure',</td>
<td> COMMENT 'The age the patient was at the time of this event',</td>
<td>  parent_observation_id bigint NULL COMMENT 'Reference to the parent observation in a complex observation eg systolic and diastolic blood pressures will have a parent observation of Blood pressure',</td>
<td>  age_at_event decimal(5,2) NULL COMMENT 'The age the patient was at the time of this event',</td>
</tr>
</tr>
<tr>
<tr>
<td>result_concept_id</td>
<td>core_concept_id</td>
<td>int</td>
<td>int</td>
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> COMMENT 'Reference to the clinical coding of the result',</td>
<td> COMMENT 'Reference to the clinical coding of the medication',</td>
<td>  result_concept_id int  NULL COMMENT 'Reference to the clinical coding of the result',</td>
<td>  core_concept_id int  NULL COMMENT 'Reference to the clinical coding of the medication',</td>
</tr>
</tr>
<tr>
<tr>
<td>age_at_event</td>
<td>bnf_reference</td>
<td>decimal(5,2)</td>
<td>varchar(6)</td>
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> COMMENT 'The age of the patient at the time of the observation',</td>
<td> COMMENT 'A reference to the drug in the BNF dictionary',</td>
<td>  age_at_event decimal(5,2)  NULL COMMENT 'The age of the patient at the time of the observation',</td>
<td>  bnf_reference varchar(6)  NULL COMMENT 'A reference to the drug in the BNF dictionary',</td>
</tr>
</tr>
<tr>
<tr>
<td>is_primary</td>
<td>authorisation_type_concept_id</td>
<td>tinyint(1)</td>
<td>int</td>
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> COMMENT 'Whether the observation is a primary observation',</td>
<td> COMMENT 'Reference to the authorisation type',</td>
<td>  is_primary tinyint(1) NULL COMMENT 'Whether the observation is a primary observation',</td>
<td>  authorisation_type_concept_id int NULL COMMENT 'Reference to the authorisation type',</td>
</tr>
</tr>
<tr>
<tr>
<td>clinical_effective_date</td>
<td>encounter_id</td>
<td>date</td>
<td>bigint</td>
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> COMMENT 'The date the observation was identified by a clinician',</td>
<td> COMMENT 'Reference to the encounter this medication was recorded in',</td>
<td>  clinical_effective_date date NULL COMMENT 'The date the observation was identified by a clinician',</td>
<td>  encounter_id bigint NULL COMMENT 'Reference to the encounter this medication was recorded in',</td>
</tr>
</tr>
<tr>
<tr>
<td>episodicity_concept_id</td>
<td>id</td>
<td>int</td>
<td>bigint</td>
<td>DEFAULT NULL</td>
<td>NOT NULL</td>
<td> COMMENT 'Reference to the episodicity of the problem eg First, review, flare',</td>
<td> COMMENT 'Unique Id of the medication',</td>
<td>  episodicity_concept_id int  NULL COMMENT 'Reference to the episodicity of the problem eg First, review, flare',</td>
<td>  id bigint NOT NULL COMMENT 'Unique Id of the medication',</td>
</tr>
</tr>
<tr>
<tr>
<td>problem_end_date</td>
<td>is_active</td>
<td>date</td>
<td>tinyint(1)</td>
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> COMMENT 'The end date of the problem',</td>
<td> COMMENT 'Whether the medication is active or not',</td>
<td>  problem_end_date date NULL COMMENT 'The end date of the problem',</td>
<td>  is_active tinyint(1) NULL COMMENT 'Whether the medication is active or not',</td>
</tr>
</tr>
<tr>
<tr>
<td>result_value_units</td>
<td>date_recorded</td>
<td>varchar(50)</td>
<td>datetime</td>
<td>DEFAULT NULL</td>
<td>DEFAULT NULL,</td>
<td> COMMENT 'The units of the result of the observation',</td>
<td></td>
<td>  result_value_units varchar(50)  NULL COMMENT 'The units of the result of the observation',</td>
<td>  date_recorded datetime NULL,</td>
</tr>
<tr>
<td>is_review</td>
<td>tinyint(1)</td>
<td>NOT NULL</td>
<td> COMMENT 'Whether the observation is a review of an existing problem',</td>
<td> is_review tinyint(1) NOT NULL COMMENT 'Whether the observation is a review of an existing problem',</td>
</tr>
<tr>
<td>result_value</td>
<td>double</td>
<td>DEFAULT NULL</td>
<td> COMMENT 'The value of the result of the observation',</td>
<td>  result_value double NULL COMMENT 'The value of the result of the observation',</td>
</tr>
</tr>
<tr>
<tr>
Line 1,511: Line 1,450:
</tr>
</tr>
<tr>
<tr>
<td>core_concept_id</td>
<td>date_precision_concept_id</td>
<td>int</td>
<td>int</td>
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> COMMENT 'Reference to the clinical coding of the observation',</td>
<td> COMMENT 'Identifies the precision of the clinical effectiveness date to either year (1) month (2) day (5) minute (12) second (13) millisecond (14)',</td>
<td>  core_concept_id int  NULL COMMENT 'Reference to the clinical coding of the observation',</td>
<td>  date_precision_concept_id int  NULL COMMENT 'Identifies the precision of the clinical effectiveness date to either year (1) month (2) day (5) minute (12) second (13) millisecond (14)',</td>
</tr>
</tr>
<tr>
<tr>
<td>non_core_concept_id</td>
<td>quantity_value</td>
<td>int</td>
<td>double</td>
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> COMMENT 'Reference to the clinical coding of the observation',</td>
<td> COMMENT 'The value of the medication that was prescribed eg 50',</td>
<td>  non_core_concept_id int  NULL COMMENT 'Reference to the clinical coding of the observation',</td>
<td>  quantity_value double NULL COMMENT 'The value of the medication that was prescribed eg 50',</td>
</tr>
<tr>
<td>date_precision_concept_id</td>
<td>int</td>
<td>DEFAULT NULL</td>
<td> COMMENT 'Identifies the precision of the clinical effectiveness date to either year (1) month (2) day (5) minute (12) second (13) millisecond (14)',</td>
<td>  date_precision_concept_id int NULL COMMENT 'Identifies the precision of the clinical effectiveness date to either year (1) month (2) day (5) minute (12) second (13) millisecond (14)',</td>
</tr>
</tr>
</tbody>
</tbody>
</table>
</table>
<h2><span class="mw-headline" id="Sortable_tables">Observation_additional</span></h2>
<h2><span class="mw-headline" id="Sortable_tables">Observation</span></h2>
<table class="sortable" border="1" style="border-collapse:collapse">
<table class="sortable" border="1" style="border-collapse:collapse">
<tr>
<tr>
Line 1,544: Line 1,476:
<tbody>
<tbody>
<tr>
<tr>
<td>json_value</td>
<td>result_date</td>
<td>json</td>
<td>date</td>
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> COMMENT 'the JSON data itself ',</td>
<td> COMMENT 'The date of the result',</td>
<td>  json_value json NULL COMMENT 'the JSON data itself ',</td>
<td>  result_date date NULL COMMENT 'The date of the result',</td>
</tr>
</tr>
<tr>
<tr>
<td>text_value</td>
<td>practitioner_id</td>
<td>varchar(255)</td>
<td>bigint</td>
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> COMMENT 'where there is no mapped value_id or raw JSON, just a basic text value',</td>
<td> COMMENT 'The clinician the activity is recorded against',</td>
<td>  text_value varchar(255) NULL COMMENT 'where there is no mapped value_id or raw JSON, just a basic text value',</td>
<td>  practitioner_id bigint  NULL COMMENT 'The clinician the activity is recorded against',</td>
</tr>
<tr>
<td>encounter_id</td>
<td>bigint</td>
<td>DEFAULT NULL</td>
<td> COMMENT 'Reference to the encounter the observation was recorded at',</td>
<td>  encounter_id bigint NULL COMMENT 'Reference to the encounter the observation was recorded at',</td>
</tr>
<tr>
<td>date_recorded</td>
<td>datetime</td>
<td>DEFAULT NULL</td>
<td> COMMENT 'The date the observation was recorded in the system',</td>
<td>  date_recorded datetime  NULL COMMENT 'The date the observation was recorded in the system',</td>
</tr>
</tr>
<tr>
<tr>
Line 1,561: Line 1,507:
<td>bigint</td>
<td>bigint</td>
<td>NOT NULL</td>
<td>NOT NULL</td>
<td> COMMENT 'same as the id column on the observation table',</td>
<td> COMMENT 'Unique Id of the observation',</td>
<td>  id bigint NOT NULL COMMENT 'same as the id column on the observation table',</td>
<td>  id bigint NOT NULL COMMENT 'Unique Id of the observation',</td>
</tr>
</tr>
<tr>
<tr>
<td>value_id</td>
<td>result_concept_id</td>
<td>int</td>
<td>int</td>
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> COMMENT 'IM reference (i.e. minor, significant)',</td>
<td> COMMENT 'Reference to the clinical coding of the result',</td>
<td>  value_id int  NULL COMMENT 'IM reference (i.e. minor, significant)',</td>
<td>  result_concept_id int  NULL COMMENT 'Reference to the clinical coding of the result',</td>
</tr>
</tr>
<tr>
<tr>
<td>property_id</td>
<td>age_at_event</td>
<td>int</td>
<td>decimal(5,2)</td>
<td>NOT NULL</td>
<td>DEFAULT NULL</td>
<td> COMMENT 'IM reference (i.e. significance)',</td>
<td> COMMENT 'The age of the patient at the time of the observation',</td>
<td>  property_id int NOT NULL COMMENT 'IM reference (i.e. significance)',</td>
<td>  age_at_event decimal(5,2)  NULL COMMENT 'The age of the patient at the time of the observation',</td>
</tr>
</tr>
</tbody>
</table>
<h2><span class="mw-headline" id="Sortable_tables">Organization</span></h2>
<table class="sortable" border="1" style="border-collapse:collapse">
<tr>
<th scope="col" width="10%">Column Name</th>
<th scope="col" width="10%">Type</th>
<th scope="col" width="10%">Constraint</th>
<th scope="col" width="10%">Comment</th>
<th scope="col" width="10%">Sql</th>
</tr>
<tbody>
<tr>
<tr>
<td>type_code</td>
<td>episodicity_concept_id</td>
<td>varchar(50)</td>
<td>int</td>
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> COMMENT 'The type of organisation',</td>
<td> COMMENT 'Reference to the episodicity of the problem eg First, review, flare',</td>
<td>  type_code varchar(50) NULL COMMENT 'The type of organisation',</td>
<td>  episodicity_concept_id int NULL COMMENT 'Reference to the episodicity of the problem eg First, review, flare',</td>
</tr>
</tr>
<tr>
<tr>
<td>parent_organization_id</td>
<td>result_value_units</td>
<td>bigint</td>
<td>varchar(50)</td>
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> COMMENT 'The id of the parent organisation',</td>
<td> COMMENT 'The units of the result of the observation',</td>
<td>  parent_organization_id bigint NULL COMMENT 'The id of the parent organisation',</td>
<td>  result_value_units varchar(50) NULL COMMENT 'The units of the result of the observation',</td>
</tr>
</tr>
<tr>
<tr>
<td>Postcode</td>
<td>core_concept_id</td>
<td>varchar(10)</td>
<td>int</td>
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> COMMENT 'The postcode of the organisation',</td>
<td> COMMENT 'Reference to the clinical coding of the observation',</td>
<td>  Postcode varchar(10) NULL COMMENT 'The postcode of the organisation',</td>
<td>  core_concept_id int NULL COMMENT 'Reference to the clinical coding of the observation',</td>
</tr>
</tr>
<tr>
<tr>
<td>ods_code</td>
<td>date_precision_concept_id</td>
<td>varchar(50)</td>
<td>int</td>
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> COMMENT 'ODS Code of the organisation',</td>
<td> COMMENT 'Identifies the precision of the clinical effectiveness date to either year (1) month (2) day (5) minute (12) second (13) millisecond (14)',</td>
<td>  ods_code varchar(50) NULL COMMENT 'ODS Code of the organisation',</td>
<td>  date_precision_concept_id int NULL COMMENT 'Identifies the precision of the clinical effectiveness date to either year (1) month (2) day (5) minute (12) second (13) millisecond (14)',</td>
</tr>
</tr>
<tr>
<tr>
<td>id</td>
<td>patient_id</td>
<td>bigint</td>
<td>bigint</td>
<td>NOT NULL</td>
<td>NOT NULL</td>
<td> COMMENT 'Unique Id of the organisation',</td>
<td> COMMENT 'The organisations record for this person’s registration. Patients may have multiple records across clinical systems and may have registered at an organisation multiple times',</td>
<td>  id bigint NOT NULL COMMENT 'Unique Id of the organisation',</td>
<td>  patient_id bigint NOT NULL COMMENT 'The organisations record for this person’s registration. Patients may have multiple records across clinical systems and may have registered at an organisation multiple times',</td>
</tr>
</tr>
<tr>
<tr>
<td>Name</td>
<td>organization_id</td>
<td>varchar(255)</td>
<td>bigint</td>
<td>DEFAULT NULL</td>
<td>NOT NULL</td>
<td> COMMENT 'Name of the organisation',</td>
<td> COMMENT 'Owning organisation (i.e. publisher)',</td>
<td>  Name varchar(255)  NULL COMMENT 'Name of the organisation',</td>
<td>  organization_id bigint NOT NULL COMMENT 'Owning organisation (i.e. publisher)',</td>
</tr>
</tr>
<tr>
<tr>
<td>type_desc</td>
<td>is_problem</td>
<td>varchar(255)</td>
<td>tinyint(1)</td>
<td>DEFAULT NULL</td>
<td>NOT NULL</td>
<td> COMMENT 'Textual description of the type of organisation eg GP Practice',</td>
<td> COMMENT 'Whether the observation is marked as a problem',</td>
<td>  type_desc varchar(255) NULL COMMENT 'Textual description of the type of organisation eg GP Practice',</td>
<td>  is_problem tinyint(1) NOT NULL COMMENT 'Whether the observation is marked as a problem',</td>
</tr>
</tr>
</tbody>
</table>
<h2><span class="mw-headline" id="Sortable_tables">Organization_metadata</span></h2>
<table class="sortable" border="1" style="border-collapse:collapse">
<tr>
<th scope="col" width="10%">Column Name</th>
<th scope="col" width="10%">Type</th>
<th scope="col" width="10%">Constraint</th>
<th scope="col" width="10%">Comment</th>
<th scope="col" width="10%">Sql</th>
</tr>
<tbody>
<tr>
<tr>
<td>id</td>
<td>parent_observation_id</td>
<td>bigint</td>
<td>bigint</td>
<td>NOT NULL</td>
<td>DEFAULT NULL</td>
<td> COMMENT 'organisation ID, corresponds to same ID in the organizaton table',</td>
<td> COMMENT 'Reference to the parent observation in a complex observation eg systolic and diastolic blood pressures will have a parent observation of Blood pressure',</td>
<td>  id bigint NOT NULL COMMENT 'organisation ID, corresponds to same ID in the organizaton table',</td>
<td>  parent_observation_id bigint NULL COMMENT 'Reference to the parent observation in a complex observation eg systolic and diastolic blood pressures will have a parent observation of Blood pressure',</td>
</tr>
<tr>
<td>result_text</td>
<td>text</td>
<td>COMMENT 'Any</td>
<td> text associated with the result',</td>
<td>  result_text text COMMENT 'Any text associated with the result',</td>
</tr>
</tr>
<tr>
<tr>
<td>last_data_to_dds</td>
<td>is_primary</td>
<td>datetime</td>
<td>tinyint(1)</td>
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> COMMENT 'date time data was last sent to DDS',</td>
<td> COMMENT 'Whether the observation is a primary observation',</td>
<td>  last_data_to_dds datetime NULL COMMENT 'date time data was last sent to DDS',</td>
<td>  is_primary tinyint(1) NULL COMMENT 'Whether the observation is a primary observation',</td>
</tr>
</tr>
<tr>
<tr>
<td>last_data_cutoff</td>
<td>clinical_effective_date</td>
<td>datetime</td>
<td>date</td>
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> COMMENT 'cutoff date time of the last extract from the publishing system',</td>
<td> COMMENT 'The date the observation was identified by a clinician',</td>
<td>  last_data_cutoff datetime NULL COMMENT 'cutoff date time of the last extract from the publishing system',</td>
<td>  clinical_effective_date date NULL COMMENT 'The date the observation was identified by a clinician',</td>
</tr>
</tr>
<tr>
<tr>
<td>publishing_software</td>
<td>problem_end_date</td>
<td>varchar(50)</td>
<td>date</td>
<td>NOT NULL</td>
<td>DEFAULT NULL</td>
<td> COMMENT 'software name of publishing system, i.e. SystmOne',</td>
<td> COMMENT 'The end date of the problem',</td>
<td>  publishing_software varchar(50) NOT NULL COMMENT 'software name of publishing system, i.e. SystmOne',</td>
<td>  problem_end_date date  NULL COMMENT 'The end date of the problem',</td>
</tr>
</tr>
</tbody>
</table>
<h2><span class="mw-headline" id="Sortable_tables">Patient</span></h2>
<table class="sortable" border="1" style="border-collapse:collapse">
<tr>
<th scope="col" width="10%">Column Name</th>
<th scope="col" width="10%">Type</th>
<th scope="col" width="10%">Constraint</th>
<th scope="col" width="10%">Comment</th>
<th scope="col" width="10%">Sql</th>
</tr>
<tbody>
<tr>
<tr>
<td>organization_id</td>
<td>is_review</td>
<td>bigint</td>
<td>tinyint(1)</td>
<td>NOT NULL</td>
<td>NOT NULL</td>
<td> COMMENT 'Owning organisation (i.e. publisher)',</td>
<td> COMMENT 'Whether the observation is a review of an existing problem',</td>
<td>  organization_id bigint NOT NULL COMMENT 'Owning organisation (i.e. publisher)',</td>
<td>  is_review tinyint(1) NOT NULL COMMENT 'Whether the observation is a review of an existing problem',</td>
</tr>
</tr>
<tr>
<tr>
<td>id</td>
<td>result_value</td>
<td>bigint</td>
<td>double</td>
<td>NOT NULL</td>
<td>DEFAULT NULL</td>
<td> COMMENT 'Unique Id of the patient',</td>
<td> COMMENT 'The value of the result of the observation',</td>
<td>  id bigint NOT NULL COMMENT 'Unique Id of the patient',</td>
<td>  result_value double  NULL COMMENT 'The value of the result of the observation',</td>
</tr>
</tr>
<tr>
<tr>
<td>first_names</td>
<td>person_id</td>
<td>varchar(255)</td>
<td>DEFAULT NULL</td>
<td> COMMENT 'The first names of the patient',</td>
<td>  first_names varchar(255)  NULL COMMENT 'The first names of the patient',</td>
</tr>
<tr>
<td>current_address_id</td>
<td>bigint</td>
<td>bigint</td>
<td>DEFAULT NULL</td>
<td>NOT NULL</td>
<td> COMMENT 'Reference to the current address of the patient',</td>
<td> COMMENT 'Unique individual across all organisations',</td>
<td>  current_address_id bigint NULL COMMENT 'Reference to the current address of the patient',</td>
<td>  person_id bigint NOT NULL COMMENT 'Unique individual across all organisations',</td>
</tr>
</tr>
<tr>
<tr>
<td>last_name</td>
<td>non_core_concept_id</td>
<td>varchar(255)</td>
<td>int</td>
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> COMMENT 'The last name of the patient',</td>
<td> COMMENT 'Reference to the clinical coding of the observation',</td>
<td>  last_name varchar(255) NULL COMMENT 'The last name of the patient',</td>
<td>  non_core_concept_id int NULL COMMENT 'Reference to the clinical coding of the observation',</td>
</tr>
<tr>
<td>date_of_birth</td>
<td>date</td>
<td>DEFAULT NULL</td>
<td> COMMENT 'The date of birth of the patient',</td>
<td>  date_of_birth date  NULL COMMENT 'The date of birth of the patient',</td>
</tr>
</tr>
</tbody>
</table>
<h2><span class="mw-headline" id="Sortable_tables">Observation_additional</span></h2>
<table class="sortable" border="1" style="border-collapse:collapse">
<tr>
<th scope="col" width="10%">Column Name</th>
<th scope="col" width="10%">Type</th>
<th scope="col" width="10%">Constraint</th>
<th scope="col" width="10%">Comment</th>
<th scope="col" width="10%">Sql</th>
</tr>
<tbody>
<tr>
<tr>
<td>date_of_death</td>
<td>json_value</td>
<td>date</td>
<td>json</td>
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> COMMENT 'The date of death of the patient',</td>
<td> COMMENT 'the JSON data itself ',</td>
<td>  date_of_death date NULL COMMENT 'The date of death of the patient',</td>
<td>  json_value json NULL COMMENT 'the JSON data itself ',</td>
</tr>
</tr>
<tr>
<tr>
<td>title</td>
<td>text_value</td>
<td>varchar(255)</td>
<td>varchar(255)</td>
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> COMMENT 'The title of the patient',</td>
<td> COMMENT 'where there is no mapped value_id or raw JSON, just a basic text value',</td>
<td>  title varchar(255)  NULL COMMENT 'The title of the patient',</td>
<td>  text_value varchar(255)  NULL COMMENT 'where there is no mapped value_id or raw JSON, just a basic text value',</td>
</tr>
</tr>
<tr>
<tr>
<td>nhs_number</td>
<td>id</td>
<td>varchar(255)</td>
<td>bigint</td>
<td>DEFAULT NULL</td>
<td>NOT NULL</td>
<td> COMMENT 'The NHS number of the patient',</td>
<td> COMMENT 'same as the id column on the observation table',</td>
<td>  nhs_number varchar(255)  NULL COMMENT 'The NHS number of the patient',</td>
<td>  id bigint NOT NULL COMMENT 'same as the id column on the observation table',</td>
</tr>
</tr>
<tr>
<tr>
<td>ethnic_code_concept_id</td>
<td>value_id</td>
<td>int</td>
<td>int</td>
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> COMMENT 'Reference to the ethnicity of the patient',</td>
<td> COMMENT 'IM reference (i.e. minor, significant)',</td>
<td>  ethnic_code_concept_id int  NULL COMMENT 'Reference to the ethnicity of the patient',</td>
<td>  value_id int  NULL COMMENT 'IM reference (i.e. minor, significant)',</td>
</tr>
</tr>
<tr>
<tr>
<td>person_id</td>
<td>property_id</td>
<td>bigint</td>
<td>int</td>
<td>NOT NULL</td>
<td>NOT NULL</td>
<td> COMMENT 'Unique individual across all organisations',</td>
<td> COMMENT 'IM reference (i.e. significance)',</td>
<td>  person_id bigint NOT NULL COMMENT 'Unique individual across all organisations',</td>
<td>  property_id int NOT NULL COMMENT 'IM reference (i.e. significance)',</td>
</tr>
</tr>
<tr>
</tbody>
<td>gender_concept_id</td>
<td>int</td>
<td>DEFAULT NULL</td>
<td> COMMENT 'Reference to the gender of the patient',</td>
<td>  gender_concept_id int  NULL COMMENT 'Reference to the gender of the patient',</td>
</tr>
<tr>
<td>registered_practice_organization_id</td>
<td>bigint</td>
<td>DEFAULT NULL</td>
<td> COMMENT 'Reference to the organisation the patient is registered at',</td>
<td>  registered_practice_organization_id bigint  NULL COMMENT 'Reference to the organisation the patient is registered at',</td>
</tr>
</tbody>
</table>
</table>
<h2><span class="mw-headline" id="Sortable_tables">Patient_additional</span></h2>
<h2><span class="mw-headline" id="Sortable_tables">Organization</span></h2>
<table class="sortable" border="1" style="border-collapse:collapse">
<table class="sortable" border="1" style="border-collapse:collapse">
<tr>
<tr>
Line 1,795: Line 1,696:
<tbody>
<tbody>
<tr>
<tr>
<td>text_value</td>
<td>type_code</td>
<td>varchar(255)</td>
<td>varchar(50)</td>
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> COMMENT 'where there is no mapped value_id or raw JSON, just a basic text value (i.e. GP Practitioner number)',</td>
<td> COMMENT 'The type of organisation',</td>
<td>  text_value varchar(255)  NULL COMMENT 'where there is no mapped value_id or raw JSON, just a basic text value (i.e. GP Practitioner number)',</td>
<td>  type_code varchar(50)  NULL COMMENT 'The type of organisation',</td>
</tr>
</tr>
<tr>
<tr>
<td>value_id</td>
<td>parent_organization_id</td>
<td>int</td>
<td>bigint</td>
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> COMMENT 'IM reference (e.g. COVID)',</td>
<td> COMMENT 'The id of the parent organisation',</td>
<td>  value_id int NULL COMMENT 'IM reference (e.g. COVID)',</td>
<td>  parent_organization_id bigint NULL COMMENT 'The id of the parent organisation',</td>
</tr>
</tr>
<tr>
<tr>
<td>id</td>
<td>Postcode</td>
<td>bigint</td>
<td>varchar(10)</td>
<td>NOT NULL</td>
<td>DEFAULT NULL</td>
<td> COMMENT 'same as the id column on the patient table ',</td>
<td> COMMENT 'The postcode of the organisation',</td>
<td>  id bigint NOT NULL COMMENT 'same as the id column on the patient table ',</td>
<td>  Postcode varchar(10)  NULL COMMENT 'The postcode of the organisation',</td>
</tr>
<tr>
<td>ods_code</td>
<td>varchar(50)</td>
<td>DEFAULT NULL</td>
<td> COMMENT 'ODS Code of the organisation',</td>
<td>  ods_code varchar(50) NULL COMMENT 'ODS Code of the organisation',</td>
</tr>
</tr>
<tr>
<tr>
<td>property_id</td>
<td>id</td>
<td>int</td>
<td>bigint</td>
<td>NOT NULL</td>
<td>NOT NULL</td>
<td> COMMENT 'IM reference (e.g. Cause of death)',</td>
<td> COMMENT 'Unique Id of the organisation',</td>
<td>  property_id int NOT NULL COMMENT 'IM reference (e.g. Cause of death)',</td>
<td>  id bigint NOT NULL COMMENT 'Unique Id of the organisation',</td>
</tr>
</tr>
<tr>
<tr>
<td>json_value</td>
<td>Name</td>
<td>json</td>
<td>varchar(255)</td>
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> COMMENT 'where there is no mapped value_id, just raw JSON',</td>
<td> COMMENT 'Name of the organisation',</td>
<td>  json_value json NULL COMMENT 'where there is no mapped value_id, just raw JSON',</td>
<td>  Name varchar(255)  NULL COMMENT 'Name of the organisation',</td>
</tr>
<tr>
<td>type_desc</td>
<td>varchar(255)</td>
<td>DEFAULT NULL</td>
<td> COMMENT 'Textual description of the type of organisation eg GP Practice',</td>
<td>  type_desc varchar(255) NULL COMMENT 'Textual description of the type of organisation eg GP Practice',</td>
</tr>
</tr>
</tbody>
</tbody>
</table>
</table>
<h2><span class="mw-headline" id="Sortable_tables">Patient_address</span></h2>
<h2><span class="mw-headline" id="Sortable_tables">Organization_metadata</span></h2>
<table class="sortable" border="1" style="border-collapse:collapse">
<table class="sortable" border="1" style="border-collapse:collapse">
<tr>
<tr>
Line 1,842: Line 1,757:
<tbody>
<tbody>
<tr>
<tr>
<td>start_date</td>
<td>id</td>
<td>date</td>
<td>NOT NULL</td>
<td> COMMENT 'The start date of this address being relevant',</td>
<td>  start_date date NOT NULL COMMENT 'The start date of this address being relevant',</td>
</tr>
<tr>
<td>patient_id</td>
<td>bigint</td>
<td>bigint</td>
<td>NOT NULL</td>
<td>NOT NULL</td>
<td> COMMENT 'The organisations record for this person’s registration. Patients may have multiple records across clinical systems and may have registered at an organisation multiple times',</td>
<td> COMMENT 'organisation ID, corresponds to same ID in the organizaton table',</td>
<td>  patient_id bigint NOT NULL COMMENT 'The organisations record for this person’s registration. Patients may have multiple records across clinical systems and may have registered at an organisation multiple times',</td>
<td>  id bigint NOT NULL COMMENT 'organisation ID, corresponds to same ID in the organizaton table',</td>
</tr>
</tr>
<tr>
<tr>
<td>msoa_2011_code</td>
<td>last_data_to_dds</td>
<td>varchar(9)</td>
<td>datetime</td>
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> COMMENT 'A reference to the MSOA_2011 code',</td>
<td> COMMENT 'date time data was last sent to DDS',</td>
<td>  msoa_2011_code varchar(9) NULL COMMENT 'A reference to the MSOA_2011 code',</td>
<td>  last_data_to_dds datetime NULL COMMENT 'date time data was last sent to DDS',</td>
</tr>
</tr>
<tr>
<tr>
<td>address_line_4</td>
<td>last_data_cutoff</td>
<td>varchar(255)</td>
<td>datetime</td>
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> COMMENT 'The fourth line of the address',</td>
<td> COMMENT 'cutoff date time of the last extract from the publishing system',</td>
<td>  address_line_4 varchar(255) NULL COMMENT 'The fourth line of the address',</td>
<td>  last_data_cutoff datetime NULL COMMENT 'cutoff date time of the last extract from the publishing system',</td>
</tr>
</tr>
<tr>
<tr>
<td>lsoa_2011_code</td>
<td>publishing_software</td>
<td>varchar(9)</td>
<td>varchar(50)</td>
<td>DEFAULT NULL</td>
<td> COMMENT 'A reference to the LSOA_2011 code',</td>
<td>  lsoa_2011_code varchar(9)  NULL COMMENT 'A reference to the LSOA_2011 code',</td>
</tr>
<tr>
<td>organization_id</td>
<td>bigint</td>
<td>NOT NULL</td>
<td>NOT NULL</td>
<td> COMMENT 'Owning organisation (i.e. publisher)',</td>
<td> COMMENT 'software name of publishing system, i.e. SystmOne',</td>
<td>  organization_id bigint NOT NULL COMMENT 'Owning organisation (i.e. publisher)',</td>
<td>  publishing_software varchar(50) NOT NULL COMMENT 'software name of publishing system, i.e. SystmOne',</td>
</tr>
</tr>
<tr>
</tbody>
<td>city</td>
</table>
<td>varchar(255)</td>
<h2><span class="mw-headline" id="Sortable_tables">Patient</span></h2>
<td>DEFAULT NULL</td>
<table class="sortable" border="1" style="border-collapse:collapse">
<td> COMMENT 'The city',</td>
<tr>
<td>  city varchar(255) NULL COMMENT 'The city',</td>
<th scope="col" width="10%">Column Name</th>
<th scope="col" width="10%">Type</th>
<th scope="col" width="10%">Constraint</th>
<th scope="col" width="10%">Comment</th>
<th scope="col" width="10%">Sql</th>
</tr>
<tbody>
<tr>
<td>birth_month</td>
<td>tinyint</td>
<td>DEFAULT NULL,</td>
<td></td>
<td>  birth_month tinyint NULL,</td>
</tr>
</tr>
<tr>
<tr>
<td>lsoa_2001_code</td>
<td>birth_week</td>
<td>varchar(9)</td>
<td>tinyint</td>
<td>DEFAULT NULL</td>
<td>DEFAULT NULL,</td>
<td> COMMENT 'A reference to the LSOA_2001 code',</td>
<td></td>
<td>  lsoa_2001_code varchar(9) NULL COMMENT 'A reference to the LSOA_2001 code',</td>
<td>  birth_week tinyint NULL,</td>
</tr>
</tr>
<tr>
<tr>
<td>local_authority_code</td>
<td>organization_id</td>
<td>varchar(9)</td>
<td>bigint</td>
<td>DEFAULT NULL</td>
<td>NOT NULL</td>
<td> COMMENT 'The local authority the address belongs to',</td>
<td> COMMENT 'Owning organisation (i.e. publisher)',</td>
<td>  local_authority_code varchar(9)  NULL COMMENT 'The local authority the address belongs to',</td>
<td>  organization_id bigint NOT NULL COMMENT 'Owning organisation (i.e. publisher)',</td>
</tr>
</tr>
<tr>
<tr>
<td>address_line_2</td>
<td>id</td>
<td>bigint</td>
<td>NOT NULL</td>
<td> COMMENT 'Unique Id of the patient',</td>
<td>  id bigint NOT NULL COMMENT 'Unique Id of the patient',</td>
</tr>
<tr>
<td>first_names</td>
<td>varchar(255)</td>
<td>varchar(255)</td>
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> COMMENT 'The second line of the address',</td>
<td> COMMENT 'The first names of the patient',</td>
<td>  address_line_2 varchar(255)  NULL COMMENT 'The second line of the address',</td>
<td>  first_names varchar(255)  NULL COMMENT 'The first names of the patient',</td>
</tr>
</tr>
<tr>
<tr>
<td>end_date</td>
<td>current_address_id</td>
<td>date</td>
<td>bigint</td>
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> COMMENT 'The end date of this address being relevant',</td>
<td> COMMENT 'Reference to the current address of the patient',</td>
<td>  end_date date NULL COMMENT 'The end date of this address being relevant',</td>
<td>  current_address_id bigint NULL COMMENT 'Reference to the current address of the patient',</td>
</tr>
</tr>
<tr>
<tr>
<td>msoa_2001_code</td>
<td>last_name</td>
<td>varchar(9)</td>
<td>varchar(255)</td>
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> COMMENT 'A reference to the MSOA_2001 code',</td>
<td> COMMENT 'The last name of the patient',</td>
<td>  msoa_2001_code varchar(9)  NULL COMMENT 'A reference to the MSOA_2001 code',</td>
<td>  last_name varchar(255)  NULL COMMENT 'The last name of the patient',</td>
</tr>
</tr>
<tr>
<tr>
<td>Id</td>
<td>date_of_birth</td>
<td>bigint</td>
<td>date</td>
<td>NOT NULL</td>
<td>DEFAULT NULL</td>
<td> COMMENT 'Unique Id of the address',</td>
<td> COMMENT 'The date of birth of the patient',</td>
<td>  Id bigint NOT NULL COMMENT 'Unique Id of the address',</td>
<td>  date_of_birth date  NULL COMMENT 'The date of birth of the patient',</td>
</tr>
</tr>
<tr>
<tr>
<td>address_line_3</td>
<td>date_of_death</td>
<td>varchar(255)</td>
<td>date</td>
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> COMMENT 'The third line of the address',</td>
<td> COMMENT 'The date of death of the patient',</td>
<td>  address_line_3 varchar(255) NULL COMMENT 'The third line of the address',</td>
<td>  date_of_death date NULL COMMENT 'The date of death of the patient',</td>
</tr>
</tr>
<tr>
<tr>
<td>use_concept_id</td>
<td>title</td>
<td>int</td>
<td>varchar(255)</td>
<td>NOT NULL</td>
<td>DEFAULT NULL</td>
<td> COMMENT 'use of address (e.g. home, temporary)',</td>
<td> COMMENT 'The title of the patient',</td>
<td>  use_concept_id int NOT NULL COMMENT 'use of address (e.g. home, temporary)',</td>
<td>  title varchar(255)  NULL COMMENT 'The title of the patient',</td>
</tr>
</tr>
<tr>
<tr>
<td>postcode</td>
<td>nhs_number</td>
<td>varchar(255)</td>
<td>varchar(255)</td>
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> COMMENT 'The postcode',</td>
<td> COMMENT 'The NHS number of the patient',</td>
<td>  postcode varchar(255)  NULL COMMENT 'The postcode',</td>
<td>  nhs_number varchar(255)  NULL COMMENT 'The NHS number of the patient',</td>
</tr>
</tr>
<tr>
<tr>
<td>ward_code</td>
<td>ethnic_code_concept_id</td>
<td>varchar(9)</td>
<td>int</td>
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> COMMENT 'The ward the address belongs to',</td>
<td> COMMENT 'Reference to the ethnicity of the patient',</td>
<td>  ward_code varchar(9) NULL COMMENT 'The ward the address belongs to',</td>
<td>  ethnic_code_concept_id int NULL COMMENT 'Reference to the ethnicity of the patient',</td>
</tr>
</tr>
<tr>
<tr>
<td>address_line_1</td>
<td>birth_year</td>
<td>varchar(255)</td>
<td>smallint</td>
<td>DEFAULT NULL</td>
<td>DEFAULT NULL,</td>
<td> COMMENT 'The first line of the address',</td>
<td></td>
<td>  address_line_1 varchar(255) NULL COMMENT 'The first line of the address',</td>
<td>  birth_year smallint NULL,</td>
</tr>
</tr>
<tr>
<tr>
Line 1,973: Line 1,893:
<td> COMMENT 'Unique individual across all organisations',</td>
<td> COMMENT 'Unique individual across all organisations',</td>
<td>  person_id bigint NOT NULL COMMENT 'Unique individual across all organisations',</td>
<td>  person_id bigint NOT NULL COMMENT 'Unique individual across all organisations',</td>
</tr>
<tr>
<td>gender_concept_id</td>
<td>int</td>
<td>DEFAULT NULL</td>
<td> COMMENT 'Reference to the gender of the patient',</td>
<td>  gender_concept_id int  NULL COMMENT 'Reference to the gender of the patient',</td>
</tr>
<tr>
<td>registered_practice_organization_id</td>
<td>bigint</td>
<td>DEFAULT NULL</td>
<td> COMMENT 'Reference to the organisation the patient is registered at',</td>
<td>  registered_practice_organization_id bigint  NULL COMMENT 'Reference to the organisation the patient is registered at',</td>
</tr>
</tr>
</tbody>
</tbody>
</table>
</table>
<h2><span class="mw-headline" id="Sortable_tables">Patient_address_match</span></h2>
<h2><span class="mw-headline" id="Sortable_tables">Patient_additional</span></h2>
<table class="sortable" border="1" style="border-collapse:collapse">
<tr>
<th scope="col" width="10%">Column Name</th>
<th scope="col" width="10%">Type</th>
<th scope="col" width="10%">Constraint</th>
<th scope="col" width="10%">Comment</th>
<th scope="col" width="10%">Sql</th>
</tr>
<tbody>
</tbody>
</table>
<h2><span class="mw-headline" id="Sortable_tables">Patient_address_ralf</span></h2>
<table class="sortable" border="1" style="border-collapse:collapse">
<tr>
<th scope="col" width="10%">Column Name</th>
<th scope="col" width="10%">Type</th>
<th scope="col" width="10%">Constraint</th>
<th scope="col" width="10%">Comment</th>
<th scope="col" width="10%">Sql</th>
</tr>
<tbody>
</tbody>
</table>
<h2><span class="mw-headline" id="Sortable_tables">Patient_contact</span></h2>
<table class="sortable" border="1" style="border-collapse:collapse">
<table class="sortable" border="1" style="border-collapse:collapse">
<tr>
<tr>
Line 2,011: Line 1,921:
<tbody>
<tbody>
<tr>
<tr>
<td>patient_id</td>
<td>text_value</td>
<td>bigint</td>
<td>varchar(255)</td>
<td>NOT NULL</td>
<td>DEFAULT NULL</td>
<td> COMMENT 'The organisations record for this person’s registration. Patients may have multiple records across clinical systems and may have registered at an organisation multiple times',</td>
<td> COMMENT 'where there is no mapped value_id or raw JSON, just a basic text value (i.e. GP Practitioner number)',</td>
<td>  patient_id bigint NOT NULL COMMENT 'The organisations record for this person’s registration. Patients may have multiple records across clinical systems and may have registered at an organisation multiple times',</td>
<td>  text_value varchar(255)  NULL COMMENT 'where there is no mapped value_id or raw JSON, just a basic text value (i.e. GP Practitioner number)',</td>
</tr>
</tr>
<tr>
<tr>
<td>start_date</td>
<td>value_id</td>
<td>date</td>
<td>int</td>
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> COMMENT 'The start date of the contact being valid',</td>
<td> COMMENT 'IM reference (e.g. COVID)',</td>
<td>  start_date date NULL COMMENT 'The start date of the contact being valid',</td>
<td>  value_id int NULL COMMENT 'IM reference (e.g. COVID)',</td>
</tr>
</tr>
<tr>
<tr>
<td>value</td>
<td>id</td>
<td>varchar(255)</td>
<td>bigint</td>
<td>DEFAULT NULL</td>
<td>NOT NULL</td>
<td> COMMENT 'The value of the contact information eg phone number, email address',</td>
<td> COMMENT 'same as the id column on the patient table ',</td>
<td>  value varchar(255)  NULL COMMENT 'The value of the contact information eg phone number, email address',</td>
<td>  id bigint NOT NULL COMMENT 'same as the id column on the patient table ',</td>
</tr>
</tr>
<tr>
<tr>
<td>use_concept_id</td>
<td>property_id</td>
<td>int</td>
<td>int</td>
<td>DEFAULT NULL</td>
<td>NOT NULL</td>
<td> COMMENT 'use of contact (e.g. mobile, home,work',</td>
<td> COMMENT 'IM reference (e.g. Cause of death)',</td>
<td>  use_concept_id int NULL COMMENT 'use of contact (e.g. mobile, home,work',</td>
<td>  property_id int NOT NULL COMMENT 'IM reference (e.g. Cause of death)',</td>
</tr>
</tr>
<tr>
<tr>
<td>type_concept_id</td>
<td>json_value</td>
<td>int</td>
<td>json</td>
<td>DEFAULT NULL</td>
<td>DEFAULT NULL</td>
<td> COMMENT 'type of contact (e.g. phone, email)',</td>
<td> COMMENT 'where there is no mapped value_id, just raw JSON',</td>
<td>  type_concept_id int NULL COMMENT 'type of contact (e.g. phone, email)',</td>
<td>  json_value json NULL COMMENT 'where there is no mapped value_id, just raw JSON',</td>
</tr>
</tr>
</tbody>
</table>
<h2><span class="mw-headline" id="Sortable_tables">Patient_address</span></h2>
<table class="sortable" border="1" style="border-collapse:collapse">
<tr>
<th scope="col" width="10%">Column Name</th>
<th scope="col" width="10%">Type</th>
<th scope="col" width="10%">Constraint</th>
<th scope="col" width="10%">Comment</th>
<th scope="col" width="10%">Sql</th>
</tr>
<tbody>
<tr>
<tr>
<td>organization_id</td>
<td>start_date</td>
<td>bigint</td>
<td>date</td>
<td>NOT NULL</td>
<td>NOT NULL</td>
<td> COMMENT 'Owning organisation (i.e. publisher)',</td>
<td> COMMENT 'The start date of this address being relevant',</td>
<td>  organization_id bigint NOT NULL COMMENT 'Owning organisation (i.e. publisher)',</td>
<td>  start_date date NOT NULL COMMENT 'The start date of this address being relevant',</td>
</tr>
</tr>
<tr>
<tr>
<td>end_date</td>
<td>patient_id</td>
<td>date</td>
<td>bigint</td>
<td>DEFAULT NULL</td>
<td>NOT NULL</td>
<td> COMMENT 'The end date of the contact being valid',</td>
<td> COMMENT 'The organisations record for this person’s registration. Patients may have multiple records across clinical systems and may have registered at an organisation multiple times',</td>
<td>  end_date date  NULL COMMENT 'The end date of the contact being valid',</td>
<td>  patient_id bigint NOT NULL COMMENT 'The organisations record for this person’s registration. Patients may have multiple records across clinical systems and may have registered at an organisation multiple times',</td>
</tr>
</tr>
<tr>
<tr>
<td>id</td>
<td>msoa_2011_code</td>
<td>bigint</td>
<td>varchar(9)</td>
<td>NOT NULL</td>
<td>DEFAULT NULL</td>
<td> COMMENT 'Unique Id of the patient contact',</td>
<td> COMMENT 'A reference to the MSOA_2011 code',</td>
<td>  id bigint NOT NULL COMMENT 'Unique Id of the patient contact',</td>
<td>  msoa_2011_code varchar(9)  NULL COMMENT 'A reference to the MSOA_2011 code',</td>
</tr>
</tr>
<tr>
<tr>
<td>person_id</td>
<td>address_line_4</td>
<td>bigint</td>
<td>varchar(255)</td>
<td>NOT NULL</td>
<td>DEFAULT NULL</td>
<td> COMMENT 'Unique individual across all organisations',</td>
<td> COMMENT 'The fourth line of the address',</td>
<td>  person_id bigint NOT NULL COMMENT 'Unique individual across all organisations',</td>
<td>  address_line_4 varchar(255)  NULL COMMENT 'The fourth line of the address',</td>
</tr>
<tr>
<td>lsoa_2011_code</td>
<td>varchar(9)</td>
<td>DEFAULT NULL</td>
<td> COMMENT 'A reference to the LSOA_2011 code',</td>
<td>  lsoa_2011_code varchar(9)  NULL COMMENT 'A reference to the LSOA_2011 code',</td>
</tr>
</tr>
</tbody>
</table>
<h2><span class="mw-headline" id="Sortable_tables">Patient_pseudo_id</span></h2>
<table class="sortable" border="1" style="border-collapse:collapse">
<tr>
<th scope="col" width="10%">Column Name</th>
<th scope="col" width="10%">Type</th>
<th scope="col" width="10%">Constraint</th>
<th scope="col" width="10%">Comment</th>
<th scope="col" width="10%">Sql</th>
</tr>
<tbody>
<tr>
<tr>
<td>id</td>
<td>organization_id</td>
<td>bigint</td>
<td>bigint</td>
<td>NOT NULL</td>
<td>NOT NULL</td>
<td> COMMENT 'Unique Id of the patient pseudo id',</td>
<td> COMMENT 'Owning organisation (i.e. publisher)',</td>
<td>  id bigint NOT NULL COMMENT 'Unique Id of the patient pseudo id',</td>
<td>  organization_id bigint NOT NULL COMMENT 'Owning organisation (i.e. publisher)',</td>
</tr>
</tr>
<tr>
<tr>
<td>Skid</td>
<td>city</td>
<td>varchar(255)</td>
<td>varchar(255)</td>
<td>NOT NULL</td>
<td>DEFAULT NULL</td>
<td> COMMENT '"Secure Key IDentifier" - the pseudonymised ID generated for this patient using the salt specified in the salt_name column. Typically generated from patient NHS number, but is configurable on a case by case basis (e.g. may include date of birth)',</td>
<td> COMMENT 'The city',</td>
<td>  Skid varchar(255) NOT NULL COMMENT '"Secure Key IDentifier" - the pseudonymised ID generated for this patient using the salt specified in the salt_name column. Typically generated from patient NHS number, but is configurable on a case by case basis (e.g. may include date of birth)',</td>
<td>  city varchar(255) NULL COMMENT 'The city',</td>
</tr>
</tr>
<tr>
<tr>
<td>salt_name</td>
<td>lsoa_2001_code</td>
<td>varchar(50)</td>
<td>varchar(9)</td>
<td>NOT NULL</td>
<td>DEFAULT NULL</td>
<td> COMMENT 'The name of the salt used to create the pseudo id',</td>
<td> COMMENT 'A reference to the LSOA_2001 code',</td>
<td>  salt_name varchar(50) NOT NULL COMMENT 'The name of the salt used to create the pseudo id',</td>
<td>  lsoa_2001_code varchar(9) NULL COMMENT 'A reference to the LSOA_2001 code',</td>
</tr>
</tr>
<tr>
<tr>
<td>organization_id</td>
<td>local_authority_code</td>
<td>bigint</td>
<td>varchar(9)</td>
<td>NOT NULL</td>
<td>DEFAULT NULL</td>
<td> COMMENT 'Owning organisation (i.e. publisher)',</td>
<td> COMMENT 'The local authority the address belongs to',</td>
<td>  organization_id bigint NOT NULL COMMENT 'Owning organisation (i.e. publisher)',</td>
<td>  local_authority_code varchar(9)  NULL COMMENT 'The local authority the address belongs to',</td>
</tr>
</tr>
<tr>
<tr>
<td>person_id</td>
<td>address_line_2</td>
<td>bigint</td>
<td>varchar(255)</td>
<td>NOT NULL</td>
<td>DEFAULT NULL</td>
<td> COMMENT 'Reference to the person this registration status history belongs to',</td>
<td> COMMENT 'The second line of the address',</td>
<td>  person_id bigint NOT NULL COMMENT 'Reference to the person this registration status history belongs to',</td>
<td>  address_line_2 varchar(255)  NULL COMMENT 'The second line of the address',</td>
</tr>
<tr>
<td>end_date</td>
<td>date</td>
<td>DEFAULT NULL</td>
<td> COMMENT 'The end date of this address being relevant',</td>
<td>  end_date date  NULL COMMENT 'The end date of this address being relevant',</td>
</tr>
</tr>
<tr>
<tr>
<td>is_nhs_number_valid</td>
<td>msoa_2001_code</td>
<td>tinyint(1)</td>
<td>varchar(9)</td>
<td>NOT NULL</td>
<td>DEFAULT NULL</td>
<td> COMMENT 'Whether the nhs number is valid',</td>
<td> COMMENT 'A reference to the MSOA_2001 code',</td>
<td>  is_nhs_number_valid tinyint(1) NOT NULL COMMENT 'Whether the nhs number is valid',</td>
<td>  msoa_2001_code varchar(9) NULL COMMENT 'A reference to the MSOA_2001 code',</td>
</tr>
</tr>
<tr>
<tr>
<td>patient_id</td>
<td>Id</td>
<td>bigint</td>
<td>bigint</td>
<td>NOT NULL</td>
<td>NOT NULL</td>
<td> COMMENT 'Reference to the patient this registration status history belongs to',</td>
<td> COMMENT 'Unique Id of the address',</td>
<td>  patient_id bigint NOT NULL COMMENT 'Reference to the patient this registration status history belongs to',</td>
<td>  Id bigint NOT NULL COMMENT 'Unique Id of the address',</td>
</tr>
</tr>
<tr>
<tr>
<td>is_nhs_number_verified_by_publisher</td>
<td>address_line_3</td>
<td>tinyint(1)</td>
<td>varchar(255)</td>
<td>NOT NULL</td>
<td>DEFAULT NULL</td>
<td> COMMENT 'Whether the nhs number has been verified by the publisher',</td>
<td> COMMENT 'The third line of the address',</td>
<td>  is_nhs_number_verified_by_publisher tinyint(1) NOT NULL COMMENT 'Whether the nhs number has been verified by the publisher',</td>
<td>  address_line_3 varchar(255) NULL COMMENT 'The third line of the address',</td>
</tr>
</tr>
</tbody>
</table>
<h2><span class="mw-headline" id="Sortable_tables">Patient_uprn</span></h2>
<table class="sortable" border="1" style="border-collapse:collapse">
<tr>
<th scope="col" width="10%">Column Name</th>
<th scope="col" width="10%">Type</th>
<th scope="col" width="10%">Constraint</th>
<th scope="col" width="10%">Comment</th>
<th scope="col" width="10%">Sql</th>
</tr>
<tbody>
<tr>
<tr>
<td>patient_id</td>
<td>use_concept_id</td>
<td>bigint</td>
<td>int</td>
<td>NOT NULL</td>
<td>NOT NULL</td>
<td> COMMENT 'The organisations record for this person’s registration. Patients may have multiple records across clinical systems and may have registered at an organisation multiple times',</td>
<td> COMMENT 'use of address (e.g. home, temporary)',</td>
<td>  patient_id bigint NOT NULL COMMENT 'The organisations record for this person’s registration. Patients may have multiple records across clinical systems and may have registered at an organisation multiple times',</td>
<td>  use_concept_id int NOT NULL COMMENT 'use of address (e.g. home, temporary)',</td>
</tr>
</tr>
<tr>
<tr>
<td>organization_id</td>
<td>postcode</td>
<td>bigint</td>
<td>varchar(255)</td>
<td>NOT NULL</td>
<td>DEFAULT NULL</td>
<td> COMMENT 'Owning organisation (i.e. publisher)',</td>
<td> COMMENT 'The postcode',</td>
<td>  organization_id bigint NOT NULL COMMENT 'Owning organisation (i.e. publisher)',</td>
<td>  postcode varchar(255)  NULL COMMENT 'The postcode',</td>
</tr>
</tr>
<tr>
<tr>
<td>person_id</td>
<td>ward_code</td>
<td>bigint</td>
<td>varchar(9)</td>
<td>NOT NULL</td>
<td>DEFAULT NULL</td>
<td> COMMENT 'Unique individual across all organisations',</td>
<td> COMMENT 'The ward the address belongs to',</td>
<td>  person_id bigint NOT NULL COMMENT 'Unique individual across all organisations',</td>
<td>  ward_code varchar(9)  NULL COMMENT 'The ward the address belongs to',</td>
</tr>
</tr>
</tbody>
<tr>
</table>
<td>address_line_1</td>
<h2><span class="mw-headline" id="Sortable_tables">Person</span></h2>
<td>varchar(255)</td>
<table class="sortable" border="1" style="border-collapse:collapse">
<td>DEFAULT NULL</td>
<tr>
<td> COMMENT 'The first line of the address',</td>
<th scope="col" width="10%">Column Name</th>
<td> address_line_1 varchar(255)  NULL COMMENT 'The first line of the address',</td>
<th scope="col" width="10%">Type</th>
</tr>
<th scope="col" width="10%">Constraint</th>
<tr>
<th scope="col" width="10%">Comment</th>
<td>person_id</td>
<th scope="col" width="10%">Sql</th>
<td>bigint</td>
</tr>
<td>NOT NULL</td>
<tbody>
<td> COMMENT 'Unique individual across all organisations',</td>
<tr>
<td>  person_id bigint NOT NULL COMMENT 'Unique individual across all organisations',</td>
<td>title</td>
</tr>
<td>varchar(255)</td>
<tr>
<td>DEFAULT NULL</td>
<td>townsend_deprivation_index</td>
<td> COMMENT 'The title of the person',</td>
<td>double</td>
<td>  title varchar(255) NULL COMMENT 'The title of the person',</td>
<td>DEFAULT NULL,</td>
</tr>
<td></td>
<tr>
<td>  townsend_deprivation_index double  NULL,</td>
<td>organization_id</td>
</tr>
</tbody>
</table>
<h2><span class="mw-headline" id="Sortable_tables">Patient_address_match</span></h2>
<table class="sortable" border="1" style="border-collapse:collapse">
<tr>
<th scope="col" width="10%">Column Name</th>
<th scope="col" width="10%">Type</th>
<th scope="col" width="10%">Constraint</th>
<th scope="col" width="10%">Comment</th>
<th scope="col" width="10%">Sql</th>
</tr>
<tbody>
<tr>
<td>patient_address_id</td>
<td>bigint</td>
<td>NOT NULL,</td>
<td></td>
<td>  patient_address_id bigint NOT NULL,</td>
</tr>
<tr>
<td>match_date</td>
<td>datetime</td>
<td>DEFAULT NULL,</td>
<td></td>
<td>  match_date datetime  NULL,</td>
</tr>
<tr>
<td>abp_address_locality</td>
<td>varchar(255)</td>
<td>CHARACTER SET</td>
<td> utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL,</td>
<td>  abp_address_locality varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci  NULL,</td>
</tr>
<tr>
<td>status</td>
<td>tinyint(1)</td>
<td>DEFAULT NULL,</td>
<td></td>
<td>  status tinyint(1)  NULL,</td>
</tr>
<tr>
<td>match_pattern_street</td>
<td>varchar(255)</td>
<td>CHARACTER SET</td>
<td> utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL,</td>
<td>  match_pattern_street varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci  NULL,</td>
</tr>
<tr>
<td>id</td>
<td>bigint</td>
<td>NOT NULL</td>
<td> AUTO_INCREMENT,</td>
<td>  id bigint NOT NULL AUTO_INCREMENT,</td>
</tr>
<tr>
<td>match_pattern_postcode</td>
<td>varchar(255)</td>
<td>CHARACTER SET</td>
<td> utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL,</td>
<td>  match_pattern_postcode varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci  NULL,</td>
</tr>
<tr>
<td>uprn_property_classification</td>
<td>varchar(45)</td>
<td>CHARACTER SET</td>
<td> utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL,</td>
<td>  uprn_property_classification varchar(45) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci  NULL,</td>
</tr>
<tr>
<td>abp_address_town</td>
<td>varchar(255)</td>
<td>CHARACTER SET</td>
<td> utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL,</td>
<td>  abp_address_town varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci  NULL,</td>
</tr>
<tr>
<td>algorithm_version</td>
<td>varchar(255)</td>
<td>CHARACTER SET</td>
<td> utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL,</td>
<td>  algorithm_version varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci  NULL,</td>
</tr>
<tr>
<td>qualifier</td>
<td>varchar(50)</td>
<td>CHARACTER SET</td>
<td> utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL,</td>
<td>  qualifier varchar(50) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci  NULL,</td>
</tr>
<tr>
<td>uprn_ycoordinate</td>
<td>double</td>
<td>DEFAULT NULL,</td>
<td></td>
<td>  uprn_ycoordinate double  NULL,</td>
</tr>
<tr>
<td>uprn_ralf00</td>
<td>varchar(255)</td>
<td>DEFAULT NULL,</td>
<td></td>
<td>  uprn_ralf00 varchar(255)  NULL,</td>
</tr>
<tr>
<td>abp_address_street</td>
<td>varchar(255)</td>
<td>CHARACTER SET</td>
<td> utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL,</td>
<td>  abp_address_street varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci  NULL,</td>
</tr>
<tr>
<td>uprn_xcoordinate</td>
<td>double</td>
<td>DEFAULT NULL,</td>
<td></td>
<td>  uprn_xcoordinate double  NULL,</td>
</tr>
<tr>
<td>abp_address_postcode</td>
<td>varchar(10)</td>
<td>CHARACTER SET</td>
<td> utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL,</td>
<td>  abp_address_postcode varchar(10) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci  NULL,</td>
</tr>
<tr>
<td>epoch</td>
<td>varchar(255)</td>
<td>CHARACTER SET</td>
<td> utf8mb3 COLLATE utf8mb3_bin DEFAULT NULL,</td>
<td>  epoch varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_bin  NULL,</td>
</tr>
<tr>
<td>latitude</td>
<td>double</td>
<td>DEFAULT NULL,</td>
<td></td>
<td>  latitude double  NULL,</td>
</tr>
<tr>
<td>match_pattern_number</td>
<td>varchar(255)</td>
<td>CHARACTER SET</td>
<td> utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL,</td>
<td>  match_pattern_number varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci  NULL,</td>
</tr>
<tr>
<td>match_rule</td>
<td>varchar(4096)</td>
<td>CHARACTER SET</td>
<td> utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL,</td>
<td>  match_rule varchar(4096) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci  NULL,</td>
</tr>
<tr>
<td>match_pattern_flat</td>
<td>varchar(255)</td>
<td>CHARACTER SET</td>
<td> utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL,</td>
<td>  match_pattern_flat varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci  NULL,</td>
</tr>
<tr>
<td>abp_address_number</td>
<td>varchar(255)</td>
<td>CHARACTER SET</td>
<td> utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL,</td>
<td>  abp_address_number varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci  NULL,</td>
</tr>
<tr>
<td>abp_address_organization</td>
<td>varchar(255)</td>
<td>CHARACTER SET</td>
<td> utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL,</td>
<td>  abp_address_organization varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci  NULL,</td>
</tr>
<tr>
<td>longitude</td>
<td>double</td>
<td>DEFAULT NULL,</td>
<td></td>
<td>  longitude double  NULL,</td>
</tr>
<tr>
<td>match_pattern_building</td>
<td>varchar(255)</td>
<td>CHARACTER SET</td>
<td> utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL,</td>
<td>  match_pattern_building varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci  NULL,</td>
</tr>
<tr>
<td>uprn</td>
<td>varchar(255)</td>
<td>CHARACTER SET</td>
<td> utf8mb3 COLLATE utf8mb3_bin DEFAULT NULL,</td>
<td>  uprn varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_bin  NULL,</td>
</tr>
</tbody>
</table>
<h2><span class="mw-headline" id="Sortable_tables">Patient_address_ralf</span></h2>
<table class="sortable" border="1" style="border-collapse:collapse">
<tr>
<th scope="col" width="10%">Column Name</th>
<th scope="col" width="10%">Type</th>
<th scope="col" width="10%">Constraint</th>
<th scope="col" width="10%">Comment</th>
<th scope="col" width="10%">Sql</th>
</tr>
<tbody>
<tr>
<td>patient_address_id</td>
<td>bigint</td>
<td>NOT NULL,</td>
<td></td>
<td>  patient_address_id bigint NOT NULL,</td>
</tr>
<tr>
<td>salt_name</td>
<td>varchar(50)</td>
<td>NOT NULL,</td>
<td></td>
<td>  salt_name varchar(50) NOT NULL,</td>
</tr>
<tr>
<td>organization_id</td>
<td>bigint</td>
<td>NOT NULL,</td>
<td></td>
<td>  organization_id bigint NOT NULL,</td>
</tr>
<tr>
<td>id</td>
<td>bigint</td>
<td>NOT NULL,</td>
<td></td>
<td>  id bigint NOT NULL,</td>
</tr>
<tr>
<td>person_id</td>
<td>bigint</td>
<td>NOT NULL,</td>
<td></td>
<td>  person_id bigint NOT NULL,</td>
</tr>
<tr>
<td>patient_address_match_uprn_ralf00</td>
<td>varchar(255)</td>
<td>NOT NULL,</td>
<td></td>
<td>  patient_address_match_uprn_ralf00 varchar(255) NOT NULL,</td>
</tr>
<tr>
<td>patient_id</td>
<td>bigint</td>
<td>NOT NULL,</td>
<td></td>
<td>  patient_id bigint NOT NULL,</td>
</tr>
<tr>
<td>ralf</td>
<td>varchar(255)</td>
<td>NOT NULL,</td>
<td></td>
<td>  ralf varchar(255) NOT NULL,</td>
</tr>
</tbody>
</table>
<h2><span class="mw-headline" id="Sortable_tables">Patient_contact</span></h2>
<table class="sortable" border="1" style="border-collapse:collapse">
<tr>
<th scope="col" width="10%">Column Name</th>
<th scope="col" width="10%">Type</th>
<th scope="col" width="10%">Constraint</th>
<th scope="col" width="10%">Comment</th>
<th scope="col" width="10%">Sql</th>
</tr>
<tbody>
<tr>
<td>patient_id</td>
<td>bigint</td>
<td>NOT NULL</td>
<td> COMMENT 'The organisations record for this person’s registration. Patients may have multiple records across clinical systems and may have registered at an organisation multiple times',</td>
<td>  patient_id bigint NOT NULL COMMENT 'The organisations record for this person’s registration. Patients may have multiple records across clinical systems and may have registered at an organisation multiple times',</td>
</tr>
<tr>
<td>start_date</td>
<td>date</td>
<td>DEFAULT NULL</td>
<td> COMMENT 'The start date of the contact being valid',</td>
<td>  start_date date  NULL COMMENT 'The start date of the contact being valid',</td>
</tr>
<tr>
<td>value</td>
<td>varchar(255)</td>
<td>DEFAULT NULL</td>
<td> COMMENT 'The value of the contact information eg phone number, email address',</td>
<td>  value varchar(255)  NULL COMMENT 'The value of the contact information eg phone number, email address',</td>
</tr>
<tr>
<td>use_concept_id</td>
<td>int</td>
<td>DEFAULT NULL</td>
<td> COMMENT 'use of contact (e.g. mobile, home,work',</td>
<td>  use_concept_id int  NULL COMMENT 'use of contact (e.g. mobile, home,work',</td>
</tr>
<tr>
<td>type_concept_id</td>
<td>int</td>
<td>DEFAULT NULL</td>
<td> COMMENT 'type of contact (e.g. phone, email)',</td>
<td>  type_concept_id int  NULL COMMENT 'type of contact (e.g. phone, email)',</td>
</tr>
<tr>
<td>organization_id</td>
<td>bigint</td>
<td>NOT NULL</td>
<td> COMMENT 'Owning organisation (i.e. publisher)',</td>
<td>  organization_id bigint NOT NULL COMMENT 'Owning organisation (i.e. publisher)',</td>
</tr>
<tr>
<td>end_date</td>
<td>date</td>
<td>DEFAULT NULL</td>
<td> COMMENT 'The end date of the contact being valid',</td>
<td>  end_date date  NULL COMMENT 'The end date of the contact being valid',</td>
</tr>
<tr>
<td>id</td>
<td>bigint</td>
<td>NOT NULL</td>
<td> COMMENT 'Unique Id of the patient contact',</td>
<td>  id bigint NOT NULL COMMENT 'Unique Id of the patient contact',</td>
</tr>
<tr>
<td>person_id</td>
<td>bigint</td>
<td>NOT NULL</td>
<td> COMMENT 'Unique individual across all organisations',</td>
<td>  person_id bigint NOT NULL COMMENT 'Unique individual across all organisations',</td>
</tr>
</tbody>
</table>
<h2><span class="mw-headline" id="Sortable_tables">Patient_pseudo_id</span></h2>
<table class="sortable" border="1" style="border-collapse:collapse">
<tr>
<th scope="col" width="10%">Column Name</th>
<th scope="col" width="10%">Type</th>
<th scope="col" width="10%">Constraint</th>
<th scope="col" width="10%">Comment</th>
<th scope="col" width="10%">Sql</th>
</tr>
<tbody>
<tr>
<td>id</td>
<td>bigint</td>
<td>NOT NULL</td>
<td> COMMENT 'Unique Id of the patient pseudo id',</td>
<td>  id bigint NOT NULL COMMENT 'Unique Id of the patient pseudo id',</td>
</tr>
<tr>
<td>Skid</td>
<td>varchar(255)</td>
<td>NOT NULL</td>
<td> COMMENT '"Secure Key IDentifier" - the pseudonymised ID generated for this patient using the salt specified in the salt_name column. Typically generated from patient NHS number, but is configurable on a case by case basis (e.g. may include date of birth)',</td>
<td>  Skid varchar(255) NOT NULL COMMENT '"Secure Key IDentifier" - the pseudonymised ID generated for this patient using the salt specified in the salt_name column. Typically generated from patient NHS number, but is configurable on a case by case basis (e.g. may include date of birth)',</td>
</tr>
<tr>
<td>salt_name</td>
<td>varchar(50)</td>
<td>NOT NULL</td>
<td> COMMENT 'The name of the salt used to create the pseudo id',</td>
<td>  salt_name varchar(50) NOT NULL COMMENT 'The name of the salt used to create the pseudo id',</td>
</tr>
<tr>
<td>organization_id</td>
<td>bigint</td>
<td>NOT NULL</td>
<td> COMMENT 'Owning organisation (i.e. publisher)',</td>
<td>  organization_id bigint NOT NULL COMMENT 'Owning organisation (i.e. publisher)',</td>
</tr>
<tr>
<td>person_id</td>
<td>bigint</td>
<td>NOT NULL</td>
<td> COMMENT 'Reference to the person this registration status history belongs to',</td>
<td>  person_id bigint NOT NULL COMMENT 'Reference to the person this registration status history belongs to',</td>
</tr>
<tr>
<td>is_nhs_number_valid</td>
<td>tinyint(1)</td>
<td>NOT NULL</td>
<td> COMMENT 'Whether the nhs number is valid',</td>
<td>  is_nhs_number_valid tinyint(1) NOT NULL COMMENT 'Whether the nhs number is valid',</td>
</tr>
<tr>
<td>patient_id</td>
<td>bigint</td>
<td>NOT NULL</td>
<td> COMMENT 'Reference to the patient this registration status history belongs to',</td>
<td>  patient_id bigint NOT NULL COMMENT 'Reference to the patient this registration status history belongs to',</td>
</tr>
<tr>
<td>is_nhs_number_verified_by_publisher</td>
<td>tinyint(1)</td>
<td>NOT NULL</td>
<td> COMMENT 'Whether the nhs number has been verified by the publisher',</td>
<td>  is_nhs_number_verified_by_publisher tinyint(1) NOT NULL COMMENT 'Whether the nhs number has been verified by the publisher',</td>
</tr>
</tbody>
</table>
<h2><span class="mw-headline" id="Sortable_tables">Patient_uprn</span></h2>
<table class="sortable" border="1" style="border-collapse:collapse">
<tr>
<th scope="col" width="10%">Column Name</th>
<th scope="col" width="10%">Type</th>
<th scope="col" width="10%">Constraint</th>
<th scope="col" width="10%">Comment</th>
<th scope="col" width="10%">Sql</th>
</tr>
<tbody>
<tr>
<td>patient_id</td>
<td>bigint</td>
<td>NOT NULL</td>
<td> COMMENT 'The organisations record for this person’s registration. Patients may have multiple records across clinical systems and may have registered at an organisation multiple times',</td>
<td>  patient_id bigint NOT NULL COMMENT 'The organisations record for this person’s registration. Patients may have multiple records across clinical systems and may have registered at an organisation multiple times',</td>
</tr>
<tr>
<td>uprn</td>
<td>bigint</td>
<td>DEFAULT NULL,</td>
<td></td>
<td>  uprn bigint  NULL,</td>
</tr>
<tr>
<td>algorithm</td>
<td>varchar(255)</td>
<td>DEFAULT NULL,</td>
<td></td>
<td>  algorithm varchar(255)  NULL,</td>
</tr>
<tr>
<td>organization_id</td>
<td>bigint</td>
<td>NOT NULL</td>
<td> COMMENT 'Owning organisation (i.e. publisher)',</td>
<td>  organization_id bigint NOT NULL COMMENT 'Owning organisation (i.e. publisher)',</td>
</tr>
<tr>
<td>match</td>
<td>varchar(255)</td>
<td>DEFAULT NULL,</td>
<td></td>
<td>  match varchar(255)  NULL,</td>
</tr>
<tr>
<td>no_address</td>
<td>tinyint(1)</td>
<td>DEFAULT NULL,</td>
<td></td>
<td>  no_address tinyint(1)  NULL,</td>
</tr>
<tr>
<td>invalid_postcode</td>
<td>tinyint(1)</td>
<td>DEFAULT NULL,</td>
<td></td>
<td>  invalid_postcode tinyint(1)  NULL,</td>
</tr>
<tr>
<td>missing_postcode</td>
<td>tinyint(1)</td>
<td>DEFAULT NULL,</td>
<td></td>
<td>  missing_postcode tinyint(1)  NULL,</td>
</tr>
<tr>
<td>invalid_address</td>
<td>tinyint(1)</td>
<td>DEFAULT NULL,</td>
<td></td>
<td>  invalid_address tinyint(1)  NULL,</td>
</tr>
<tr>
<td>person_id</td>
<td>bigint</td>
<td>NOT NULL</td>
<td> COMMENT 'Unique individual across all organisations',</td>
<td>  person_id bigint NOT NULL COMMENT 'Unique individual across all organisations',</td>
</tr>
<tr>
<td>qualifier</td>
<td>varchar(50)</td>
<td>DEFAULT NULL,</td>
<td></td>
<td>  qualifier varchar(50)  NULL,</td>
</tr>
</tbody>
</table>
<h2><span class="mw-headline" id="Sortable_tables">Person</span></h2>
<table class="sortable" border="1" style="border-collapse:collapse">
<tr>
<th scope="col" width="10%">Column Name</th>
<th scope="col" width="10%">Type</th>
<th scope="col" width="10%">Constraint</th>
<th scope="col" width="10%">Comment</th>
<th scope="col" width="10%">Sql</th>
</tr>
<tbody>
<tr>
<td>title</td>
<td>varchar(255)</td>
<td>DEFAULT NULL</td>
<td> COMMENT 'The title of the person',</td>
<td>  title varchar(255)  NULL COMMENT 'The title of the person',</td>
</tr>
<tr>
<td>birth_month</td>
<td>tinyint</td>
<td>DEFAULT NULL,</td>
<td></td>
<td>  birth_month tinyint  NULL,</td>
</tr>
<tr>
<td>birth_week</td>
<td>tinyint</td>
<td>DEFAULT NULL,</td>
<td></td>
<td>  birth_week tinyint NULL,</td>
</tr>
<tr>
<td>organization_id</td>
<td>bigint</td>
<td>bigint</td>
<td>NOT NULL</td>
<td>NOT NULL</td>
Line 2,241: Line 2,682:
<td> COMMENT 'The last name of the person',</td>
<td> COMMENT 'The last name of the person',</td>
<td>  last_name varchar(255)  NULL COMMENT 'The last name of the person',</td>
<td>  last_name varchar(255)  NULL COMMENT 'The last name of the person',</td>
</tr>
<tr>
<td>birth_year</td>
<td>smallint</td>
<td>DEFAULT NULL,</td>
<td></td>
<td>  birth_year smallint  NULL,</td>
</tr>
</tr>
<tr>
<tr>

Revision as of 15:47, 22 November 2022

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

From Discovery Data Service

Allergy_intolerance

<tbody> </tbody>
Column Name Type Constraint Comment Sql
is_review tinyint(1) NOT NULL COMMENT 'Is this instance of the code a review of a previous encounter', is_review tinyint(1) NOT NULL COMMENT 'Is this instance of the code a review of a previous encounter',
patient_id bigint NOT NULL COMMENT 'The organisations record for this person’s registration. Patients may have multiple records across clinical systems and may have registered at an organisation multiple times', patient_id bigint NOT NULL COMMENT 'The organisations record for this person’s registration. Patients may have multiple records across clinical systems and may have registered at an organisation multiple times',
practitioner_id bigint DEFAULT NULL COMMENT 'The clinician the activity is recorded against', practitioner_id bigint NULL COMMENT 'The clinician the activity is recorded against',
core_concept_id int DEFAULT NULL COMMENT 'Reference to the clinical coding of the allergy', core_concept_id int NULL COMMENT 'Reference to the clinical coding of the allergy',
clinical_effective_date date DEFAULT NULL COMMENT 'The date the clinical code is recorded for', clinical_effective_date date NULL COMMENT 'The date the clinical code is recorded for',
organization_id bigint NOT NULL COMMENT 'Owning organisation (i.e. publisher)', organization_id bigint NOT NULL COMMENT 'Owning organisation (i.e. publisher)',
age_at_event decimal(5,2) DEFAULT NULL COMMENT 'The age the patient was at the time of this event', age_at_event decimal(5,2) NULL COMMENT 'The age the patient was at the time of this event',
non_core_concept_id int DEFAULT NULL COMMENT 'Reference to the clinical coding of the allergy', non_core_concept_id int NULL COMMENT 'Reference to the clinical coding of the allergy',
id bigint NOT NULL COMMENT 'Unique Id of the allergy', id bigint NOT NULL COMMENT 'Unique Id of the allergy',
date_recorded datetime NOT NULL COMMENT 'The date the allergy was recorded', date_recorded datetime NOT NULL COMMENT 'The date the allergy was recorded',
person_id bigint NOT NULL COMMENT 'Unique individual across all organisations', person_id bigint NOT NULL COMMENT 'Unique individual across all organisations',
date_precision_concept_id int DEFAULT NULL COMMENT 'Identifies the precision of the clinical effectiveness date to either year (1) month (2) day (5) minute (12) second (13) millisecond (14)', date_precision_concept_id int NULL COMMENT 'Identifies the precision of the clinical effectiveness date to either year (1) month (2) day (5) minute (12) second (13) millisecond (14)',
encounter_id bigint DEFAULT NULL COMMENT 'Reference to the encounter this allergy was record in', encounter_id bigint NULL COMMENT 'Reference to the encounter this allergy was record in',

Appointment

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

Appointment_additional

<tbody> </tbody>
Column Name Type Constraint Comment Sql
text_value varchar(255) DEFAULT NULL COMMENT 'where there is no mapped value_id or raw JSON, just a basic text value (i.e. GP Practitioner number)', text_value varchar(255) NULL COMMENT 'where there is no mapped value_id or raw JSON, just a basic text value (i.e. GP Practitioner number)',
property_id int NOT NULL COMMENT 'IM reference (e.g. appointment type)', property_id int NOT NULL COMMENT 'IM reference (e.g. appointment type)',
value_id int DEFAULT NULL COMMENT 'IM reference (e.g. Appointment Type)', value_id int NULL COMMENT 'IM reference (e.g. Appointment Type)',
id bigint NOT NULL COMMENT 'same as the id column on the patient table ', id bigint NOT NULL COMMENT 'same as the id column on the patient table ',
json_value json DEFAULT NULL COMMENT 'where there is no mapped value_id, just raw JSON', json_value json NULL COMMENT 'where there is no mapped value_id, just raw JSON',

Concept

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

Concept_map

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

Diagnostic_order

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

Encounter

<tbody> </tbody>
Column Name Type Constraint Comment Sql
id bigint NOT NULL COMMENT 'Unique Id of the encounter', id bigint NOT NULL COMMENT 'Unique Id of the encounter',
patient_id bigint NOT NULL COMMENT 'The organisations record for this person’s registration. Patients may have multiple records across clinical systems and may have registered at an organisation multiple times', patient_id bigint NOT NULL COMMENT 'The organisations record for this person’s registration. Patients may have multiple records across clinical systems and may have registered at an organisation multiple times',
date_precision_concept_id int DEFAULT NULL COMMENT 'Reference to the precision of the date of the encounter', date_precision_concept_id int NULL COMMENT 'Reference to the precision of the date of the encounter',
date_recorded datetime DEFAULT NULL COMMENT 'The date the encounter was recorded', date_recorded datetime NULL COMMENT 'The date the encounter was recorded',
appointment_id bigint DEFAULT NULL COMMENT 'Reference to the appointment this encounter took part on', appointment_id bigint NULL COMMENT 'Reference to the appointment this encounter took part on',
non_core_concept_id int DEFAULT NULL COMMENT 'Reference to the type of encounter', non_core_concept_id int NULL COMMENT 'Reference to the type of encounter',
practitioner_id bigint DEFAULT NULL COMMENT 'The clinician the activity is recorded against', practitioner_id bigint NULL COMMENT 'The clinician the activity is recorded against',
service_provider_organization_id bigint DEFAULT NULL COMMENT 'Reference to the service provider organisation', service_provider_organization_id bigint NULL COMMENT 'Reference to the service provider organisation',
clinical_effective_date date DEFAULT NULL COMMENT 'The date the clinical code is recorded for', clinical_effective_date date NULL COMMENT 'The date the clinical code is recorded for',
organization_id bigint NOT NULL COMMENT 'Owning organisation (i.e. publisher)', organization_id bigint NOT NULL COMMENT 'Owning organisation (i.e. publisher)',
core_concept_id int DEFAULT NULL COMMENT 'Reference to the type of encounter', core_concept_id int NULL COMMENT 'Reference to the type of encounter',
admission_method varchar(40) DEFAULT NULL COMMENT 'The admission method of the encounter', admission_method varchar(40) NULL COMMENT 'The admission method of the encounter',
age_at_event decimal(5,2) DEFAULT NULL COMMENT 'The age the patient was when this encounter took place', age_at_event decimal(5,2) NULL COMMENT 'The age the patient was when this encounter took place',
institution_location_id text COMMENT 'Reference to the institution the encounter took place at', institution_location_id text COMMENT 'Reference to the institution the encounter took place at',
sub_type text COMMENT 'Unused', sub_type text COMMENT 'Unused',
person_id bigint NOT NULL COMMENT 'Unique individual across all organisations', person_id bigint NOT NULL COMMENT 'Unique individual across all organisations',
Type text COMMENT 'Unused', Type text COMMENT 'Unused',
episode_of_care_id bigint DEFAULT NULL COMMENT 'Is this instance of the code a review of a previous encounter', episode_of_care_id bigint NULL COMMENT 'Is this instance of the code a review of a previous encounter',
end_date date DEFAULT NULL COMMENT 'The end date of the encounter', end_date date NULL COMMENT 'The end date of the encounter',

Encounter_additional

<tbody> </tbody>
Column Name Type Constraint Comment Sql
id bigint NOT NULL COMMENT 'same as the id column on the encounter table', id bigint NOT NULL COMMENT 'same as the id column on the encounter table',
property_id int NOT NULL COMMENT 'IM concept id reference (i.e. Admission method)', property_id int NOT NULL COMMENT 'IM concept id reference (i.e. Admission method)',
value_id int DEFAULT NULL COMMENT 'IM concept id reference (i.e. Emergency admission)', value_id int NULL COMMENT 'IM concept id reference (i.e. Emergency admission)',
text_value varchar(255) DEFAULT NULL COMMENT 'where there is no mapped value_id, or raw JSON, just a basic text value (i.e. FIN number)', text_value varchar(255) NULL COMMENT 'where there is no mapped value_id, or raw JSON, just a basic text value (i.e. FIN number)',
json_value json DEFAULT NULL COMMENT 'where there is no mapped value_id, just raw JSON (i.e. birth delivery details)', json_value json NULL COMMENT 'where there is no mapped value_id, just raw JSON (i.e. birth delivery details)',

Encounter_event

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

Episode_of_care

<tbody> </tbody>
Column Name Type Constraint Comment Sql
patient_id bigint NOT NULL COMMENT 'The organisations record for this person’s registration. Patients may have multiple records across clinical systems and may have registered at an organisation multiple times', patient_id bigint NOT NULL COMMENT 'The organisations record for this person’s registration. Patients may have multiple records across clinical systems and may have registered at an organisation multiple times',
id bigint NOT NULL COMMENT 'Unique Id of the episode of care', id bigint NOT NULL COMMENT 'Unique Id of the episode of care',
date_registered date DEFAULT NULL COMMENT 'The date the registration was started  for this episode of care', date_registered date NULL COMMENT 'The date the registration was started  for this episode of care',
registration_status_concept_id int DEFAULT NULL COMMENT 'Reference to the registration status of the patient', registration_status_concept_id int NULL COMMENT 'Reference to the registration status of the patient',
date_registered_end date DEFAULT NULL COMMENT 'The date the registration was ended  for this episode of care', date_registered_end date NULL COMMENT 'The date the registration was ended  for this episode of care',
organization_id bigint NOT NULL COMMENT 'Owning organisation (i.e. publisher)', organization_id bigint NOT NULL COMMENT 'Owning organisation (i.e. publisher)',
usual_gp_practitioner_id bigint DEFAULT NULL COMMENT 'Reference to the usual GP for this episode of care', usual_gp_practitioner_id bigint NULL COMMENT 'Reference to the usual GP for this episode of care',
person_id bigint NOT NULL COMMENT 'Unique individual across all organisations', person_id bigint NOT NULL COMMENT 'Unique individual across all organisations',
registration_type_concept_id int DEFAULT NULL COMMENT 'Reference to the registration type of the patient', registration_type_concept_id int NULL COMMENT 'Reference to the registration type of the patient',

Event_log

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

Flag

<tbody> </tbody>
Column Name Type Constraint Comment Sql
patient_id bigint NOT NULL COMMENT 'The organisations record for this person’s registration. Patients may have multiple records across clinical systems and may have registered at an organisation multiple times', patient_id bigint NOT NULL COMMENT 'The organisations record for this person’s registration. Patients may have multiple records across clinical systems and may have registered at an organisation multiple times',
is_active tinyint(1) NOT NULL COMMENT 'Whether the flag is active or not', is_active tinyint(1) NOT NULL COMMENT 'Whether the flag is active or not',
effective_date date DEFAULT NULL COMMENT 'The date the flag was entered onto the patients record', effective_date date NULL COMMENT 'The date the flag was entered onto the patients record',
organization_id bigint NOT NULL COMMENT 'Owning organisation (i.e. publisher)', organization_id bigint NOT NULL COMMENT 'Owning organisation (i.e. publisher)',
person_id bigint NOT NULL COMMENT 'Unique individual across all organisations', person_id bigint NOT NULL COMMENT 'Unique individual across all organisations',
flag_text text COMMENT 'This is a warning set by the publisher regarding he patient', flag_text text COMMENT 'This is a warning set by the publisher regarding he patient',
date_precision_concept_id int DEFAULT NULL COMMENT 'Identifies the precision of the clinical effectiveness date to either year (1) month (2) day (5) minute (12) second (13) millisecond (14)', date_precision_concept_id int NULL COMMENT 'Identifies the precision of the clinical effectiveness date to either year (1) month (2) day (5) minute (12) second (13) millisecond (14)',
id bigint NOT NULL COMMENT 'Unique Id of the flag', id bigint NOT NULL COMMENT 'Unique Id of the flag',

Location

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

Medication_order

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

Medication_statement

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

Observation

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

Observation_additional

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

Organization

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

Organization_metadata

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

Patient

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

Patient_additional

<tbody> </tbody>
Column Name Type Constraint Comment Sql
text_value varchar(255) DEFAULT NULL COMMENT 'where there is no mapped value_id or raw JSON, just a basic text value (i.e. GP Practitioner number)', text_value varchar(255) NULL COMMENT 'where there is no mapped value_id or raw JSON, just a basic text value (i.e. GP Practitioner number)',
value_id int DEFAULT NULL COMMENT 'IM reference (e.g. COVID)', value_id int NULL COMMENT 'IM reference (e.g. COVID)',
id bigint NOT NULL COMMENT 'same as the id column on the patient table ', id bigint NOT NULL COMMENT 'same as the id column on the patient table ',
property_id int NOT NULL COMMENT 'IM reference (e.g. Cause of death)', property_id int NOT NULL COMMENT 'IM reference (e.g. Cause of death)',
json_value json DEFAULT NULL COMMENT 'where there is no mapped value_id, just raw JSON', json_value json NULL COMMENT 'where there is no mapped value_id, just raw JSON',

Patient_address

<tbody> </tbody>
Column Name Type Constraint Comment Sql
start_date date NOT NULL COMMENT 'The start date of this address being relevant', start_date date NOT NULL COMMENT 'The start date of this address being relevant',
patient_id bigint NOT NULL COMMENT 'The organisations record for this person’s registration. Patients may have multiple records across clinical systems and may have registered at an organisation multiple times', patient_id bigint NOT NULL COMMENT 'The organisations record for this person’s registration. Patients may have multiple records across clinical systems and may have registered at an organisation multiple times',
msoa_2011_code varchar(9) DEFAULT NULL COMMENT 'A reference to the MSOA_2011 code', msoa_2011_code varchar(9) NULL COMMENT 'A reference to the MSOA_2011 code',
address_line_4 varchar(255) DEFAULT NULL COMMENT 'The fourth line of the address', address_line_4 varchar(255) NULL COMMENT 'The fourth line of the address',
lsoa_2011_code varchar(9) DEFAULT NULL COMMENT 'A reference to the LSOA_2011 code', lsoa_2011_code varchar(9) NULL COMMENT 'A reference to the LSOA_2011 code',
organization_id bigint NOT NULL COMMENT 'Owning organisation (i.e. publisher)', organization_id bigint NOT NULL COMMENT 'Owning organisation (i.e. publisher)',
city varchar(255) DEFAULT NULL COMMENT 'The city', city varchar(255) NULL COMMENT 'The city',
lsoa_2001_code varchar(9) DEFAULT NULL COMMENT 'A reference to the LSOA_2001 code', lsoa_2001_code varchar(9) NULL COMMENT 'A reference to the LSOA_2001 code',
local_authority_code varchar(9) DEFAULT NULL COMMENT 'The local authority the address belongs to', local_authority_code varchar(9) NULL COMMENT 'The local authority the address belongs to',
address_line_2 varchar(255) DEFAULT NULL COMMENT 'The second line of the address', address_line_2 varchar(255) NULL COMMENT 'The second line of the address',
end_date date DEFAULT NULL COMMENT 'The end date of this address being relevant', end_date date NULL COMMENT 'The end date of this address being relevant',
msoa_2001_code varchar(9) DEFAULT NULL COMMENT 'A reference to the MSOA_2001 code', msoa_2001_code varchar(9) NULL COMMENT 'A reference to the MSOA_2001 code',
Id bigint NOT NULL COMMENT 'Unique Id of the address', Id bigint NOT NULL COMMENT 'Unique Id of the address',
address_line_3 varchar(255) DEFAULT NULL COMMENT 'The third line of the address', address_line_3 varchar(255) NULL COMMENT 'The third line of the address',
use_concept_id int NOT NULL COMMENT 'use of address (e.g. home, temporary)', use_concept_id int NOT NULL COMMENT 'use of address (e.g. home, temporary)',
postcode varchar(255) DEFAULT NULL COMMENT 'The postcode', postcode varchar(255) NULL COMMENT 'The postcode',
ward_code varchar(9) DEFAULT NULL COMMENT 'The ward the address belongs to', ward_code varchar(9) NULL COMMENT 'The ward the address belongs to',
address_line_1 varchar(255) DEFAULT NULL COMMENT 'The first line of the address', address_line_1 varchar(255) NULL COMMENT 'The first line of the address',
person_id bigint NOT NULL COMMENT 'Unique individual across all organisations', person_id bigint NOT NULL COMMENT 'Unique individual across all organisations',
townsend_deprivation_index double DEFAULT NULL, townsend_deprivation_index double NULL,

Patient_address_match

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

Patient_address_ralf

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

Patient_contact

<tbody> </tbody>
Column Name Type Constraint Comment Sql
patient_id bigint NOT NULL COMMENT 'The organisations record for this person’s registration. Patients may have multiple records across clinical systems and may have registered at an organisation multiple times', patient_id bigint NOT NULL COMMENT 'The organisations record for this person’s registration. Patients may have multiple records across clinical systems and may have registered at an organisation multiple times',
start_date date DEFAULT NULL COMMENT 'The start date of the contact being valid', start_date date NULL COMMENT 'The start date of the contact being valid',
value varchar(255) DEFAULT NULL COMMENT 'The value of the contact information eg phone number, email address', value varchar(255) NULL COMMENT 'The value of the contact information eg phone number, email address',
use_concept_id int DEFAULT NULL COMMENT 'use of contact (e.g. mobile, home,work', use_concept_id int NULL COMMENT 'use of contact (e.g. mobile, home,work',
type_concept_id int DEFAULT NULL COMMENT 'type of contact (e.g. phone, email)', type_concept_id int NULL COMMENT 'type of contact (e.g. phone, email)',
organization_id bigint NOT NULL COMMENT 'Owning organisation (i.e. publisher)', organization_id bigint NOT NULL COMMENT 'Owning organisation (i.e. publisher)',
end_date date DEFAULT NULL COMMENT 'The end date of the contact being valid', end_date date NULL COMMENT 'The end date of the contact being valid',
id bigint NOT NULL COMMENT 'Unique Id of the patient contact', id bigint NOT NULL COMMENT 'Unique Id of the patient contact',
person_id bigint NOT NULL COMMENT 'Unique individual across all organisations', person_id bigint NOT NULL COMMENT 'Unique individual across all organisations',

Patient_pseudo_id

<tbody> </tbody>
Column Name Type Constraint Comment Sql
id bigint NOT NULL COMMENT 'Unique Id of the patient pseudo id', id bigint NOT NULL COMMENT 'Unique Id of the patient pseudo id',
Skid varchar(255) NOT NULL COMMENT '"Secure Key IDentifier" - the pseudonymised ID generated for this patient using the salt specified in the salt_name column. Typically generated from patient NHS number, but is configurable on a case by case basis (e.g. may include date of birth)', Skid varchar(255) NOT NULL COMMENT '"Secure Key IDentifier" - the pseudonymised ID generated for this patient using the salt specified in the salt_name column. Typically generated from patient NHS number, but is configurable on a case by case basis (e.g. may include date of birth)',
salt_name varchar(50) NOT NULL COMMENT 'The name of the salt used to create the pseudo id', salt_name varchar(50) NOT NULL COMMENT 'The name of the salt used to create the pseudo id',
organization_id bigint NOT NULL COMMENT 'Owning organisation (i.e. publisher)', organization_id bigint NOT NULL COMMENT 'Owning organisation (i.e. publisher)',
person_id bigint NOT NULL COMMENT 'Reference to the person this registration status history belongs to', person_id bigint NOT NULL COMMENT 'Reference to the person this registration status history belongs to',
is_nhs_number_valid tinyint(1) NOT NULL COMMENT 'Whether the nhs number is valid', is_nhs_number_valid tinyint(1) NOT NULL COMMENT 'Whether the nhs number is valid',
patient_id bigint NOT NULL COMMENT 'Reference to the patient this registration status history belongs to', patient_id bigint NOT NULL COMMENT 'Reference to the patient this registration status history belongs to',
is_nhs_number_verified_by_publisher tinyint(1) NOT NULL COMMENT 'Whether the nhs number has been verified by the publisher', is_nhs_number_verified_by_publisher tinyint(1) NOT NULL COMMENT 'Whether the nhs number has been verified by the publisher',

Patient_uprn

<tbody> </tbody>
Column Name Type Constraint Comment Sql
patient_id bigint NOT NULL COMMENT 'The organisations record for this person’s registration. Patients may have multiple records across clinical systems and may have registered at an organisation multiple times', patient_id bigint NOT NULL COMMENT 'The organisations record for this person’s registration. Patients may have multiple records across clinical systems and may have registered at an organisation multiple times',
uprn bigint DEFAULT NULL, uprn bigint NULL,
algorithm varchar(255) DEFAULT NULL, algorithm varchar(255) NULL,
organization_id bigint NOT NULL COMMENT 'Owning organisation (i.e. publisher)', organization_id bigint NOT NULL COMMENT 'Owning organisation (i.e. publisher)',
match varchar(255) DEFAULT NULL, match varchar(255) NULL,
no_address tinyint(1) DEFAULT NULL, no_address tinyint(1) NULL,
invalid_postcode tinyint(1) DEFAULT NULL, invalid_postcode tinyint(1) NULL,
missing_postcode tinyint(1) DEFAULT NULL, missing_postcode tinyint(1) NULL,
invalid_address tinyint(1) DEFAULT NULL, invalid_address tinyint(1) NULL,
person_id bigint NOT NULL COMMENT 'Unique individual across all organisations', person_id bigint NOT NULL COMMENT 'Unique individual across all organisations',
qualifier varchar(50) DEFAULT NULL, qualifier varchar(50) NULL,

Person

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

Practitioner

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

Procedure_request

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

Referral_request

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

Registration_status_history

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

Schedule

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