erDiagram
consultation ||--o{ consultation_section : "contains"
patient ||--o{ consultation_section : "belongs_to"
organisation ||--o{ consultation_section : "hosts"
location ||--o{ consultation_section : "occurs_at"
appointment_slot ||--o{ consultation_section : "scheduled_in"
consultation_section ||--o{ observation : "event_id
references
observation_id"
consultation_section ||--o{ diary : "event_id
references
diary_id"
consultation_section ||--o{ issue_record : "event_id
references
issue_record_id"
consultation_section ||--o{ test_request : "event_id
references
test_request_id"
consultation_section ||--o{ report : "event_id
references
report_id"
consultation_section ||--o{ care_plan_detail : "event_id
references
care_plan_detail_id"
consultation {
bigint consultation_id PK
varchar organisation PK
bigint patient_id FK
}
consultation_section {
bigint consultation_section_id PK
varchar organisation PK
bigint consultation_id FK
bigint event_id FK
bigint patient_id FK
bigint patient_organisation_id FK
bigint consultation_organisation_id FK
bigint entered_by_user_in_role_id FK
bigint authorising_user_in_role_id FK
bigint location_id FK
bigint appointment_slot_id FK
bigint consultation_source_code_id FK
}
patient {
bigint patient_id PK
varchar organisation PK
}
organisation {
varchar organisation PK
varchar organisation_guid
bigint emis_organisation_id
varchar organisation_type_description
}
location {
bigint location_id PK
varchar organisation PK
bigint location_code_id
varchar location_type_description
}
appointment_slot {
bigint appointment_slot_id PK
varchar organisation PK
}
observation {
bigint observation_id PK
varchar organisation PK
bigint consultation_section_id FK
}
diary {
bigint diary_id PK
varchar organisation PK
bigint consultation_section_id FK
}
issue_record {
bigint issue_record_id PK
varchar organisation PK
bigint consultation_section_id FK
}
test_request {
bigint test_request_id PK
varchar organisation PK
bigint consultation_section_id FK
}
report {
bigint report_id PK
varchar organisation PK
bigint consultation_section_id FK
}
care_plan_detail {
bigint care_plan_detail_id PK
varchar organisation PK
bigint consultation_section_id FK
}