Skip to content
Partner Developer Portal

Entity Relationship Diagram

The diagram below shows the consultation model and its relationships to related models via foreign keys.

erDiagram
    consultation {
        boolean   is_deleted
        varbinary   consultation_id              PK
        bigint      consultation_source_code_id  FK
        timestamp   effective_datetime
        boolean     has_consultation_sections
        boolean     is_complete
        bigint      location_code_id             FK
        timestamp   model_updated_datetime
        varbinary   patient_id                   FK
        varbinary   appointment_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 appointment_slot_id PK
    }

    consultation }o--|| patient : "patient_id"
    consultation }o--o| appointment_slot : "appointment_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"
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
appointment_slot_id appointment_slot.appointment_slot_id Links the consultation to an appointment slot (optional)