diary_id | bigint | Composite primary key when combined with organisation. Not unique across organisations. |
organisation | varchar | Organisation identifier required for Ranger to apply DSA. |
is_deleted | boolean | Soft-delete flag; include in queries to exclude deleted records. |
transform_datetime | timestamp(6) with time zone | Datetime when the data was made available in the model due to an entry or relevant change. |
model_updated_datetime | timestamp(6) with time zone | Timestamp indicating when the model last updated this record. |
patient_id | bigint | Patient identifier; only patients meeting the inclusion criteria (valid NHS number, regular patients at England GP practices) are included. |
consultation_id | bigint | Foreign key referencing the consultation model; links the diary entry back to the parent consultation. |
consultation_section_id | bigint | Foreign key referencing the consultation section model; links the diary entry to a specific section within the consultation. |
code_id | bigint | Code identifier used to look up the clinical code in the codeable concept dimension. |
snomed_concept_id | bigint | SNOMED CT concept ID resolved from code_id via the dim_codeable_concept_v1 dimension; may be NULL if no matching concept exists. |
consultation_source_code_id | bigint | Code representing the source or purpose of the consultation associated with this diary entry. |
availability_datetime | timestamp(6) with time zone | Date and time when the diary entry becomes available or is scheduled for. |
effective_datetime | timestamp(6) with time zone | Date and time when the diary entry came into effect. |
duration_term | varchar | Human-readable term describing the duration of the diary entry. |
is_active | boolean | Indicates whether the diary entry is currently active. |
is_complete | boolean | Indicates whether the diary entry is complete. |