erDiagram
problem_drug_record {
bigint problem_observation_id PK
bigint drug_record_id PK
varchar organisation PK
bigint patient_id FK
bigint patient_organisation_id FK
}
problem_issue_record {
bigint problem_observation_id PK
bigint issue_record_id PK
varchar organisation PK
bigint patient_id FK
bigint patient_organisation_id FK
}
problem {
bigint problem_observation_id PK
varchar organisation PK
}
drug_record {
bigint drug_record_id PK
varchar organisation PK
}
issue_record {
bigint issue_record_id PK
varchar organisation PK
}
patient {
bigint patient_id PK
varchar organisation PK
}
problem_drug_record }o--|| problem : "problem_observation_id"
problem_drug_record }o--|| drug_record : "drug_record_id"
problem_drug_record }o--|| patient : "belongs to"
problem_issue_record }o--|| problem : "problem_observation_id"
problem_issue_record }o--|| issue_record : "issue_record_id"
problem_issue_record }o--|| patient : "belongs to"