Skip to content
Partner Developer Portal

Schema

The core schema represents the Diary schema derived from EMIS source system.

Column NameData TypeDescriptionExample
is_deletedbooleanIndicates if this record should be considered soft deletedfalse
load_datetimetimestamp(6) with time zoneThe datetime that the record was last upserted into the EXA data lake from EMIS source system with a relevant change from source system.‘2023-05-12 14:30:15.000000 UTC’
_ingest_timevarcharThe load_datetime formatted as yyyyMMddHHmmss. This column is provided only for backward compatibility.‘20230512143015’
diary_idbigintThe unique internal identifier for the diary record within an organisation.345678
diary_guidvarcharThe GUID for the diary record within an organisation‘b1c2d3e4-f5a6-4b5c-8d9e-0f1a2b3c4d5e’
diary_uuidvarcharThe UUID derived from diary_id and organisation, providing a stable unique identifier.‘d4e5f6a7-b8c9-7d0e-2f3a-4b5c6d7e8f9a’
patient_idbigintThe unique internal identifier for the patient record within the organisation for whom the diary entry was recorded.123456
patient_guidvarcharThe GUID for the patient record within an organisation‘e5f6a7b8-c9d0-8e1f-3a4b-5c6d7e8f9a0b’
patient_uuidvarcharThe UUID derived from patient_id and organisation, providing a stable unique identifier.‘a7b8c9d0-e1f2-0a3b-5c6d-7e8f9a0b1c2d’
patient_organisation_idbigintThe unique internal identifier for the organisation where the patient is registered98765
patient_organisation_guidvarcharThe GUID of the organisation where the patient is registered‘c2d3e4f5-a6b7-5c6d-9e0f-1a2b3c4d5e6f’
patient_organisation_uuidvarcharThe UUID derived from patient_organisation_id and organisation, providing a stable unique identifier.‘e44c…f2’
diary_organisation_idbigintThe unique internal identifier of the organisation where the diary event was recorded98765
diary_organisation_guidvarcharThe GUID of the organisation where the diary event was recorded‘f47ac10b-58cc-4372-a567-0e02b2c3d479’
diary_organisation_uuidvarcharThe UUID derived from diary_organisation_id and organisation, providing a stable unique identifier.‘a1b2c3d4-e5f6-7890-abcd-ef1234567890’
consultation_idbigintThe unique internal identifier for the consultation record within an organisation in which the diary entry was recorded.456789
consultation_guidvarcharThe GUID for the consultation record within an organisation‘a1b2c3d4-e5f6-4a5b-9c8d-0e1f2a3b4c5d’
consultation_uuidvarcharThe UUID derived from consultation_id and organisation, providing a stable unique identifier.‘e5f6a7b8-c9d0-8e1f-3a4b-5c6d7e8f9a0b’
consultation_section_idbigintThe unique internal identifier for the consultation section within an organisation.12345
consultation_section_uuidvarcharThe UUID derived from consultation_section_id and organisation, providing a stable unique identifier.‘c9d0e1f2-a3b4-2c5d-7e8f-9a0b1c2d3e4f’
consultation_source_code_idbigintThe identifier of the code describing the consultation source (e.g. GP Surgery, Telephone)1672851000006116
authorising_user_in_role_idbigintThe unique identifier of the clinician who authorised or authored the diary record111
authorising_user_in_role_uuidvarcharThe UUID derived from authorising_user_in_role_id and organisation, providing a stable unique identifier.‘c9d0e1f2-a3b4-2c5d-7e8f-9a0b1c2d3e4f’
entered_by_user_in_role_idbigintThe unique identifier of the user who entered the diary record222
entered_by_user_in_role_uuidvarcharThe UUID derived from entered_by_user_in_role_id and organisation, providing a stable unique identifier.‘f6a7b8c9-d0e1-9f2a-4b5c-6d7e8f9a0b1c’
code_idbigintThe unique EMIS code identifier for the clinical code associated with the diary entry1776891000006116
location_type_idbigintInternal identifier for the location type27
location_type_descriptionvarcharLocation type description‘Surgery’
is_activebooleanIndicates whether the diary record is currently active or no longer activetrue
is_completebooleanIndicates whether the diary event has been completed or is still outstandingfalse
original_termvarcharThe EMISl term used to record the diary entry‘Medication review’
associated_textvarcharFree text associated with the diary entry‘Recall in 3 months’
duration_termvarcharDuration attached to the diary entry, for example how long until an action is due or planned‘3 months’
effective_datetimetimestamp(6) with time zoneThe date and time when the diary entry came into effect‘2025-01-05 09:00:00+00’
effective_datetime_precisionvarcharPrecision of the effective datetime; set to ‘YMDT’.‘YMDT’
availability_datetimetimestamp(6) with time zoneThe date and time the diary entry was recorded in the source system‘2025-01-01 09:00:00+00’
is_sensitivebooleanIndicates whether the diary record is flagged as sensitive. The sensitive reference set codes are 999004351000000109( gender related issues), 999004371000000100(assisted fertilisation), 999004361000000107(termination of pregnancy) and 999004381000000103 (sexually transmitted disease)false
confidentiality_policy_idbigintConfidentiality policy id4
is_confidentialbooleanIndicates whether the diary record is confidential. This is based on confidentiality set against the patient, consultation section or diary record.false
organisationvarcharAn identifier for the source of data (an organisation) relating to a given GP practice‘A12345’
transform_datetimetimestamp(6) with time zoneThe timestamp indicating when the record was last processed and updated in the data model.‘2025-01-01 12:40:00+00’
_execution_datevarcharThe transform_datetime formatted as yyyyMMddHHmmss. This column is provided only for backward compatibility.‘20250101124000’

The table below presents the flavour specific schema and maps columns between core, V1, and V2. Refer to Changes in iPCV V2 for more information.

Column NameData TypeData in V1Data in V2Core MappingComments
_ingest_timevarchar✓✓
is_deletedboolean✗✓
diary_idbigint✗✓
emis_diary_guidvarchar✓✓diary_guid
exa_diary_guidvarchar✓✓diary_uuid
consultation_idbigint✗✓
emis_encounter_guidvarchar✓✓consultation_guid
exa_encounter_guidvarchar✓✓consultation_uuid
consultation_section_idbigint✗✓
consultation_section_uuidvarchar✗✓
emis_patient_idbigint✓✓patient_id
registration_guidvarchar✓✓patient_guid
patient_uuidvarchar✗✓
diary_organisation_idbigint✗✓
diary_organisation_guidvarchar✗✓
diary_organisation_uuidvarchar✗✓
patient_organisation_idbigint✗✓
emis_registration_organisation_guidvarchar✓✓patient_organisation_guid
patient_organisation_uuidvarchar✗✓
emis_code_idbigint✓✓code_id
emis_original_termvarchar✓✓original_term
is_active_flagboolean✓✓is_active
is_complete_flagboolean✓✓is_complete
consultation_source_emis_code_idbigint✓✓consultation_source_code_id
location_type_idbigint✗✓
location_type_descriptionvarchar✓✓
associated_textvarchar✓✓
entered_by_user_in_role_guidvarchar✓✓Always NULL as it is deprecated in v2. Refer changes in v2 for more details.
entered_by_user_in_role_idbigint✗✓
entered_by_user_in_role_uuidvarchar✗✓
authorising_user_in_role_guidvarchar✓✓Always NULL as it is deprecated in v2. Refer changes in v2 for more details.
authorising_user_in_role_idbigint✗✓
authorising_user_in_role_uuidvarchar✗✓
effective_datetimestamp(6) with time zone✓✓effective_datetime
effective_date_precisionvarchar✓✓effective_datetime_precision
confidential_flagboolean✓✓is_confidential
sensitive_flagboolean✓✓is_sensitive
confidential_patient_flagboolean✓✗
sensitive_patient_flagboolean✓✗
dummy_patient_flagboolean✓✗
regular_patient_flagboolean✓✗
regular_and_current_active_flagboolean✓✗
regular_current_active_and_inactive_flagboolean✓✗
non_regular_and_current_active_flagboolean✓✗
opt_out_93c1_flagboolean✓✗
opt_out_9nd19nu09nu4_flagboolean✓✗
opt_out_9nd19nu0_flagboolean✓✗
opt_out_9nu0_flagboolean✓✗
organisationvarchar✓✓
transform_datetimetimestamp(6) with time zone✗✓
_execution_datevarchar✓✓
_record_versionvarchar✓✗
_update_datevarchar✓✗
_update_hourvarchar✓✗

Not used in this schema

The table below presents the flavour specific schema and maps columns between core, V1, and V2. Refer to Changes in iPCV V2 for more information.

Column NameData TypeData in V1Data in V2Core MappingComments
_ingest_timevarchar✓✓
is_deletedboolean✗✓
diary_idbigint✗✓
emis_diary_guidvarchar✓✓diary_guid
exa_diary_guidvarchar✓✓diary_uuid
consultation_idbigint✗✓
emis_encounter_guidvarchar✓✓consultation_guid
exa_encounter_guidvarchar✓✓consultation_uuid
consultation_section_idbigint✗✓
consultation_section_uuidvarchar✗✓
emis_patient_idbigint✓✓patient_id
registration_guidvarchar✓✓patient_guid
patient_uuidvarchar✗✓
diary_organisation_idbigint✗✓
diary_organisation_guidvarchar✗✓
diary_organisation_uuidvarchar✗✓
patient_organisation_idbigint✗✓
emis_registration_organisation_guidvarchar✓✓patient_organisation_guid
patient_organisation_uuidvarchar✗✓
emis_code_idbigint✓✓code_id
emis_original_termvarchar✓✓original_term
is_active_flagboolean✓✓is_active
is_complete_flagboolean✓✓is_complete
consultation_source_emis_code_idbigint✓✓consultation_source_code_id
location_type_idbigint✗✓
location_type_descriptionvarchar✓✓
entered_by_user_in_role_guidvarchar✓✓Always NULL as it is deprecated in v2. Refer changes in v2 for more details.
entered_by_user_in_role_idbigint✗✓
entered_by_user_in_role_uuidvarchar✗✓
authorising_user_in_role_guidvarchar✓✓Always NULL as it is deprecated in v2. Refer changes in v2 for more details.
authorising_user_in_role_idbigint✗✓
authorising_user_in_role_uuidvarchar✗✓
effective_datetimestamp(6) with time zone✓✓effective_datetime
effective_date_precisionvarchar✓✓effective_datetime_precision
recorded_datetimestamp(6) with time zone✓✓availability_datetime
duration_termvarchar✓✓
confidential_flagboolean✓✓is_confidential
sensitive_flagboolean✓✓is_sensitive
confidential_patient_flagboolean✓✗
sensitive_patient_flagboolean✓✗
dummy_patient_flagboolean✓✗
regular_patient_flagboolean✓✗
regular_and_current_active_flagboolean✓✗
regular_current_active_and_inactive_flagboolean✓✗
non_regular_and_current_active_flagboolean✓✗
opt_out_9nd19nu09nu4_flagboolean✓✗
opt_out_9nd19nu0_flagboolean✓✗
snomed_concept_idbigint✓✗
snomed_description_idbigint✓✗
readv2_codevarchar✓✗
other_codevarchar✓✗
other_code_systemvarchar✓✗
other_displayvarchar✓✗
organisationvarchar✓✓
transform_datetimetimestamp(6) with time zone✗✓
_execution_datevarchar✓✓
_record_versionvarchar✓✗
_update_datevarchar✓✗
_update_hourvarchar✓✗

The table below presents the flavour specific schema.

Column NameData TypeCore Mapping
is_deletedboolean
pseudo_diary_uuidvarchardiary_uuid
pseudo_patient_uuidvarcharpatient_uuid
pseudo_patient_organisation_uuidvarcharpatient_organisation_uuid
pseudo_diary_organisation_uuidvarchardiary_organisation_uuid
pseudo_consultation_uuidvarcharconsultation_uuid
availability_datetimetimestamp(6) with time zone
effective_datetimetimestamp(6) with time zone
effective_datetime_precisionvarchar
duration_termvarchar
original_termvarchar
consultation_source_code_idbigint
code_idbigint
location_type_idbigint
location_type_descriptionvarchar
confidentiality_policy_idbigint
is_activeboolean
is_completeboolean
is_sensitiveboolean
is_confidentialboolean
organisationvarchar
transform_datetimetimestamp(6) with time zone

Not used in this schema

The table below presents the flavour specific schema and maps columns between core, V1, and V2. Refer to Changes in iPCV V2 for more information.

Column NameData TypeData in V1Data in V2Core MappingComments
_ingest_timevarchar✓✓
emis_diary_guidvarchar✓✓diary_guid
exa_diary_guidvarchar✓✓diary_uuid
diary_idbigint✗✓
is_deletedboolean✓✓Renamed from deletedin V1
consultation_section_idbigint✗✓
consultation_section_uuidvarchar✗✓
consultation_idbigint✗✓
emis_consultation_guidvarchar✓✓consultation_guid
consultation_uuidvarchar✓✓
emis_code_idbigint✓✓code_id
emis_original_termvarchar✓✓original_term
location_type_idbigint✗✓
location_type_descriptionvarchar✓✓
pseudo_registration_guidvarchar✓✓patient_guid
pseudo_patient_uuidvarchar✗✓patient_uuid
patient_organisation_idbigint✗✓
emis_registration_organisation_guidvarchar✓✓patient_organisation_guid
patient_organisation_uuidvarchar✗✓
emis_authorising_userinrole_guidvarchar✓✓Always NULL as it is deprecated in v2. Refer changes in v2 for more details.
emis_enteredby_userinrole_guidvarchar✓✓Always NULL as it is deprecated in v2. Refer changes in v2 for more details.
entered_by_user_in_role_idbigint✗✓
entered_by_user_in_role_uuidvarchar✗✓
authorising_user_in_role_idbigint✗✓
authorising_user_in_role_uuidvarchar✗✓
effective_datedate✓✓effective_datetime
effective_date_precisionvarchar✓✓effective_datetime_precision
entered_datedate✓✓availability_datetime
entered_timevarchar✓✓availability_datetime
confidential_flagboolean✓✓is_confidential
is_active_flagboolean✓✓is_active
is_complete_flagboolean✓✓is_complete
processing_idbigint✓✓Always NULL as it is deprecated in v2. Refer changes in v2 for more details.
organisationvarchar✓✓
transform_datetimetimestamp(6) with time zone✗✓
_execution_datevarchar✓✓

The table below presents the flavour specific schema and maps columns between core, V1, and V2. Refer to Changes in iPCV V2 for more information.

Column NameData TypeData in V1Data in V2Core MappingComments
_ingest_timevarchar✓✓
emis_diary_guidvarchar✓✓diary_guid
exa_diary_guidvarchar✓✓diary_uuid
diary_idbigint✗✓
is_deletedboolean✓✓Renamed from deletedin V1
consultation_section_idbigint✗✓
consultation_section_uuidvarchar✗✓
consultation_idbigint✗✓
emis_consultation_guidvarchar✓✓consultation_guid
consultation_uuidvarchar✓✓
emis_code_idbigint✓✓code_id
emis_original_termvarchar✓✓original_term
location_type_idbigint✗✓
location_type_descriptionvarchar✓✓
pseudo_registration_guidvarchar✓✓patient_guid
pseudo_patient_uuidvarchar✗✓patient_uuid
patient_organisation_idbigint✗✓
emis_registration_organisation_guidvarchar✓✓patient_organisation_guid
patient_organisation_uuidvarchar✗✓
emis_authorising_userinrole_guidvarchar✓✓Always NULL as it is deprecated in v2. Refer changes in v2 for more details.
emis_enteredby_userinrole_guidvarchar✓✓Always NULL as it is deprecated in v2. Refer changes in v2 for more details.
entered_by_user_in_role_idbigint✗✓
entered_by_user_in_role_uuidvarchar✗✓
authorising_user_in_role_idbigint✗✓
authorising_user_in_role_uuidvarchar✗✓
effective_datedate✓✓effective_datetime
effective_date_precisionvarchar✓✓effective_datetime_precision
entered_datedate✓✓availability_datetime
entered_timevarchar✓✓availability_datetime
confidential_flagboolean✓✓is_confidential
is_active_flagboolean✓✓is_active
is_complete_flagboolean✓✓is_complete
processing_idbigint✓✓Always NULL as it is deprecated in v2. Refer changes in v2 for more details.
organisationvarchar✓✓
transform_datetimetimestamp(6) with time zone✗✓
_execution_datevarchar✓✓Renamed from execution_datein V1

The table below presents the flavour specific schema and maps columns between core, V1, and V2. Refer to Changes in iPCV V2 for more information.

Column NameData TypeData in V1Data in V2Core MappingComments
_ingest_timevarchar✓✓
is_deletedboolean✓✓Renamed from deletedin V1
diary_idbigint✗✓
diary_guidvarchar✓✓
id_type5varchar✓✓diary_uuid
consultation_section_idbigint✗✓
consultation_section_uuidvarchar✗✓
consultation_idbigint✗✓
consultation_guidvarchar✓✓
consultation_uuidvarchar✗✓
patient_idbigint✗✓
patient_guidvarchar✓✓
patient_uuidvarchar✗✓
patient_organisation_idbigint✗✓
patient_organisation_guidvarchar✗✓
patient_organisation_uuidvarchar✗✓
diary_organisation_idbigint✗✓
diary_organisation_guidvarchar✗✓
diary_organisation_uuidvarchar✗✓
organisation_guidvarchar✓✗
code_idbigint✓✓
original_termvarchar✓✓
location_type_idbigint✗✓
location_type_descriptionvarchar✓✓
clinician_user_in_role_guidvarchar✓✓Always NULL as it is deprecated in v2. Refer changes in v2 for more details.
entered_by_userinrole_guidvarchar✓✓Always NULL as it is deprecated in v2. Refer changes in v2 for more details.
entered_by_user_in_role_idbigint✗✓
entered_by_user_in_role_uuidvarchar✗✓
authorising_user_in_role_idbigint✗✓
authorising_user_in_role_uuidvarchar✗✓
effective_datedate✓✓effective_datetime
effective_date_precisionvarchar✓✓effective_datetime_precision
entered_datedate✓✓availability_datetime
entered_timevarchar✓✓availability_datetime
is_confidentialboolean✓✓
is_activeboolean✓✓
is_completeboolean✓✓
processing_idbigint✓✓Always NULL as it is deprecated in v2. Refer changes in v2 for more details.
organisationvarchar✓✓
transform_datetimetimestamp(6) with time zone✗✓
_execution_datevarchar✓✓Renamed from execution_date in V1

The table below presents the flavour specific schema and maps columns between core, V1, and V2. Refer to Changes in iPCV V2 for more information.

Column NameData TypeData in V1Data in V2Core MappingComments
_ingest_timevarchar✓✓
is_deletedboolean✗✓
diary_idbigint✗✓
emis_diary_guidvarchar✓✓diary_guid
exa_diary_guidvarchar✓✓diary_uuid
consultation_idbigint✗✓
emis_encounter_guidvarchar✓✓consultation_guid
exa_encounter_guidvarchar✓✓consultation_uuid
consultation_section_idbigint✗✓
consultation_section_uuidvarchar✗✓
emis_patient_idbigint✓✓patient_id
registration_guidvarchar✓✓patient_guid
patient_uuidvarchar✗✓
diary_organisation_idbigint✗✓
diary_organisation_guidvarchar✗✓
diary_organisation_uuidvarchar✗✓
patient_organisation_idbigint✗✓
emis_registration_organisation_guidvarchar✓✓patient_organisation_guid
patient_organisation_uuidvarchar✗✓
emis_code_idbigint✓✓code_id
emis_original_termvarchar✓✓original_term
location_type_idbigint✗✓
location_type_descriptionvarchar✓✓
is_active_flagboolean✓✓is_active
is_complete_flagboolean✓✓is_complete
consultation_source_emis_code_idbigint✓✓consultation_source_code_id
associated_textvarchar✓✓
entered_by_user_in_role_guidvarchar✓✓Always NULL as it is deprecated in v2. Refer changes in v2 for more details.
entered_by_user_in_role_idbigint✗✓
entered_by_user_in_role_uuidvarchar✗✓
authorising_user_in_role_guidvarchar✓✓Always NULL as it is deprecated in v2. Refer changes in v2 for more details.
authorising_user_in_role_idbigint✗✓
authorising_user_in_role_uuidvarchar✗✓
effective_datetimestamp(6) with time zone✓✓effective_datetime
effective_date_precisionvarchar✓✓effective_datetime_precision
recorded_datetimestamp(6) with time zone✓✓availability_datetime
duration_termvarchar✓✓
confidential_flagboolean✓✓is_confidential
sensitive_flagboolean✓✓is_sensitive
confidential_patient_flagboolean✓✗
sensitive_patient_flagboolean✓✗
dummy_patient_flagboolean✓✗
regular_patient_flagboolean✓✗
regular_and_current_active_flagboolean✓✗
regular_current_active_and_inactive_flagboolean✓✗
non_regular_and_current_active_flagboolean✓✗
opt_out_93c1_flagboolean✓✗
opt_out_9nd19nu09nu4_flagboolean✓✗
opt_out_9nd19nu0_flagboolean✓✗
opt_out_9nu0_flagboolean✓✗
snomed_concept_idbigint✓✗
snomed_description_idbigint✓✗
readv2_codevarchar✓✗
other_codevarchar✓✗
other_code_systemvarchar✓✗
other_displayvarchar✓✗
organisationvarchar✓✓
transform_datetimetimestamp(6) with time zone✗✓
_execution_datevarchar✓✓
_record_versionvarchar✓✗
_update_datevarchar✓✗
_update_hourvarchar✓✗

The table below presents the flavour specific schema and maps columns between core, V1, and V2. Refer to Changes in iPCV V2 for more information.

Column NameData TypeData in V1Data in V2Core MappingComments
_ingest_timevarchar✓✓
is_deletedboolean✗✓
diary_idbigint✗✓
emis_diary_guidvarchar✓✓diary_guid
exa_diary_guidvarchar✓✓diary_uuid
consultation_section_idbigint✗✓
consultation_section_uuidvarchar✗✓
consultation_idbigint✗✓
emis_encounter_guidvarchar✓✓consultation_guid
exa_encounter_guidvarchar✓✓consultation_uuid
emis_patient_idbigint✓✗patient_id
pseudo_patient_uuidvarchar✗✓patient_uuid
pseudo_registration_guid_oureavarchar✓✓patient_guid
patient_organisation_idbigint✗✓
emis_registration_organisation_guidvarchar✓✓patient_organisation_guid
patient_organisation_uuidvarchar✗✓
emis_code_idbigint✓✓code_id
emis_original_termvarchar✓✓original_term
consultation_source_emis_code_idbigint✓✓consultation_source_code_id
duration_termvarchar✓✓
is_active_flagboolean✓✓is_active
is_complete_flagboolean✓✓is_complete
entered_by_user_in_role_guidvarchar✓✓Always NULL as it is deprecated in v2. Refer changes in v2 for more details.
entered_by_user_in_role_idbigint✗✓
entered_by_user_in_role_uuidvarchar✗✓
authorising_user_in_role_guidvarchar✓✓Always NULL as it is deprecated in v2. Refer changes in v2 for more details.
authorising_user_in_role_idbigint✗✓
authorising_user_in_role_uuidvarchar✗✓
effective_datedate✓✓effective_datetime
effective_date_precisionvarchar✓✓effective_datetime_precision
recorded_datetimestamp(6) with time zone✓✓availability_datetime
sensitive_flagboolean✓✓is_sensitive
location_type_idbigint✗✓
location_type_descriptionvarchar✓✓
confidential_flagboolean✓✓is_confidential
data_filterinteger✓✗
confidential_patient_flagboolean✓✗
sensitive_patient_flagboolean✓✗
dummy_patient_flagboolean✓✗
regular_patient_flagboolean✓✗
regular_and_current_active_flagboolean✓✗
regular_current_active_and_inactive_flagboolean✓✗
non_regular_and_current_active_flagboolean✓✗
opt_out_93c1_flagboolean✓✗
opt_out_9nd19nu09nu4_flagboolean✓✗
opt_out_9nd19nu0_flagboolean✓✗
opt_out_9nu0_flagboolean✓✗
snomed_concept_idbigint✓✗
snomed_description_idbigint✓✗
readv2_codevarchar✓✗
other_codevarchar✓✗
other_code_systemvarchar✓✗
other_displayvarchar✓✗
organisationvarchar✓✓
transform_datetimetimestamp(6) with time zone✗✓
_execution_datevarchar✓✓