Entity Relationship Diagram
The diagram below shows the consultation model and its relationships to
related models via foreign keys.
erDiagram
consultation {
varbinary consultation_id PK
bigint consultation_source_code_id FK
timestamp effective_datetime
boolean has_consultation_sections
boolean is_complete
boolean is_deleted
bigint location_code_id FK
timestamp model_updated_datetime
varchar organisation
varbinary patient_id FK
varbinary slot_id FK
timestamp transform_datetime
}
clinical_code {
bigint code_id PK
}
codeable_concept {
bigint code_id PK
}
patient {
varbinary patient_id PK
}
appointment_slot {
varbinary slot_id PK
}
consultation }o--|| patient : "patient_id"
consultation }o--o| appointment_slot : "slot_id"
consultation }o--|| clinical_code : "consultation_source_code_id"
consultation }o--|| codeable_concept : "consultation_source_code_id"
consultation }o--|| clinical_code : "location_code_id"
consultation }o--|| codeable_concept : "location_code_id"
Relationship Notes
Section titled “Relationship Notes”| Foreign Key | References | Description |
|---|---|---|
consultation_source_code_id | clinical_code.code_id, codeable_concept.code_id | EMIS code representing the consultation purpose |
location_code_id | clinical_code.code_id, codeable_concept.code_id | EMIS code representing the consultation location type |
patient_id | patient.patient_id | Links the consultation to a patient record |
slot_id | appointment_slot.slot_id | Links the consultation to an appointment slot (optional) |