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 {
        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"
Foreign KeyReferencesDescription
consultation_source_code_idclinical_code.code_id, codeable_concept.code_idEMIS code representing the consultation purpose
location_code_idclinical_code.code_id, codeable_concept.code_idEMIS code representing the consultation location type
patient_idpatient.patient_idLinks the consultation to a patient record
slot_idappointment_slot.slot_idLinks the consultation to an appointment slot (optional)