| | 151 | |
| | 152 | === Relations |
| | 153 | |
| | 154 | 1. **is** (Doctor_Levels ↔ Doctors, 1:N) |
| | 155 | Each doctor is assigned one level, while a level can belong to many doctors. |
| | 156 | |
| | 157 | 2. **has_specialization** (Doctors ↔ Doctor_Specialization, 1:N) |
| | 158 | Each doctor has one specialization, while a specialization can apply to many doctors. |
| | 159 | |
| | 160 | 3. **works_in** (Departments ↔ Doctors, 1:N) |
| | 161 | Each doctor works in one department, while a department employs many doctors. |
| | 162 | |
| | 163 | 4. **has_allergies** (Patients ↔ Allergies, M:N) |
| | 164 | Patients can have multiple allergies, and the same allergy can affect many patients. |
| | 165 | |
| | 166 | 5. **contains_allergies** (Allergies ↔ Medical_Record, M:N) |
| | 167 | A medical record can contain multiple allergies, while the same allergy can appear in multiple medical records. |
| | 168 | |
| | 169 | 6. **affects_prescription** (Allergy ↔ Prescription_Restriction, M:N) |
| | 170 | An allergy can be associated with multiple prescription restrictions, while the same restriction can apply to multiple allergies. |
| | 171 | |
| | 172 | 7. **has_symptoms** (Patients ↔ Symptoms, M:N) |
| | 173 | Patients can report multiple symptoms, and each symptom can be reported by many patients. |
| | 174 | |
| | 175 | 8. **indicates** (Symptoms ↔ Diagnosis, M:N) |
| | 176 | A diagnosis can be associated with multiple symptoms, while the same symptom can appear in multiple diagnoses. |
| | 177 | |
| | 178 | 9. **contains_symptoms** (Medical_Record ↔ Symptoms, 1:N) |
| | 179 | Each medical record can contain multiple symptoms, while each symptom entry belongs to one medical record. |
| | 180 | |
| | 181 | 10. **books** (Patients ↔ Appointments, 1:N) |
| | 182 | A patient can book multiple appointments, while each appointment belongs to one patient. |
| | 183 | |
| | 184 | 11. **attends** (Doctors ↔ Appointments, 1:N) |
| | 185 | A doctor can attend multiple appointments, while each appointment is handled by one doctor. |
| | 186 | |
| | 187 | 12. **updates** (Appointment ↔ Medical_Record, 1:N) |
| | 188 | An appointment can generate multiple updates in the medical record, while each update is associated with one appointment. |
| | 189 | |
| | 190 | 13. **diagnoses** (Doctors ↔ Diagnosis, 1:N) |
| | 191 | A doctor can make multiple diagnoses, while each diagnosis is made by one doctor. |
| | 192 | |
| | 193 | 14. **performs_allowed** (Doctor_Specialization ↔ Procedure, M:N) |
| | 194 | A doctor specialization can be associated with multiple procedures it allows, while the same procedure can be associated with multiple doctor specializations. |
| | 195 | |
| | 196 | 15. **requires** (Diagnosis ↔ Procedure, M:N) |
| | 197 | A diagnosis can require multiple procedures, while the same procedure can be required by multiple diagnoses. |
| | 198 | |
| | 199 | 16. **produces** (Procedure ↔ Procedure_Result, 1:N) |
| | 200 | A procedure can produce multiple results, while each result belongs to one procedure. |
| | 201 | |
| | 202 | 17. **performs** (Department ↔ Procedure, M:N) |
| | 203 | A department can perform multiple procedures, while the same procedure can be performed in multiple departments. |
| | 204 | |
| | 205 | 18. **billed_for** (Procedure ↔ Billing, M:N) |
| | 206 | A billing record can include multiple procedures, while the same procedure can appear in multiple billing records. |
| | 207 | |
| | 208 | 19. **prescribes** (Doctors ↔ Prescriptions, 1:N) |
| | 209 | A doctor can write multiple prescriptions, while each prescription is written by one doctor. |
| | 210 | |
| | 211 | 20. **restricts** (Prescriptions ↔ Prescription_Restriction, 1:N) |
| | 212 | A prescription can have multiple restrictions, while each restriction belongs to one prescription. |
| | 213 | |
| | 214 | 21. **does_test** (Patients ↔ Lab_Tests, 1:N) |
| | 215 | A patient can take multiple lab tests, while each test belongs to one patient. |
| | 216 | |
| | 217 | 22. **orders_test** (Doctors ↔ Lab_Tests, 1:N) |
| | 218 | A doctor can order multiple lab tests, while each lab test is ordered by one doctor. |
| | 219 | |
| | 220 | 23. **conducts** (Lab_Technician ↔ Lab_Tests, 1:N) |
| | 221 | A lab technician can conduct multiple tests, while each test is conducted by one technician. |
| | 222 | |
| | 223 | 24. **produces_test** (Lab_Tests ↔ Lab_Results, 1:N) |
| | 224 | A lab test can produce multiple results, while each result belongs to one test. |
| | 225 | |
| | 226 | 25. **billed_for_test** (LabTest ↔ Billing, M:N) |
| | 227 | A billing record can include multiple lab tests, while the same lab test can appear in multiple billing records. |
| | 228 | |
| | 229 | 26. **has** (Patient ↔ Medical_Record, 1:1) |
| | 230 | Each patient has one medical record, and each medical record belongs to one patient. |
| | 231 | |
| | 232 | 27. **updates** (Doctors ↔ Medical_Record, M:N) |
| | 233 | Doctors can update multiple medical records, and records can be updated by multiple doctors. |
| | 234 | |
| | 235 | 28. **issues** (Doctors ↔ Referral, 1:N) |
| | 236 | A doctor can issue multiple referrals, while each referral is issued by one doctor. |
| | 237 | |
| | 238 | 29. **creates** (Doctors ↔ Medical_Report, 1:N) |
| | 239 | A doctor can create multiple medical reports, while each report is created by one doctor. |
| | 240 | |
| | 241 | 30. **has** (Patient ↔ Medical_Report, 1:N) |
| | 242 | A patient can have multiple medical reports, while each report belongs to one patient. |
| | 243 | |
| | 244 | 31. **updates** (Medical_Record ↔ Medical_Report, 1:N) |
| | 245 | A medical record can generate multiple reports, while each report is based on one record. |
| | 246 | |
| | 247 | 32. **isn’t_allowed** (Medical_Record ↔ Prescription_Restriction, 1:M) |
| | 248 | Each medical record can contain multiple prescription restrictions, while each restriction belongs to one medical record. |
| | 249 | |
| | 250 | 33. **processes** (Admin ↔ Billing, 1:N) |
| | 251 | An admin can process multiple billing records, while each bill is processed by one admin. |
| | 252 | |
| | 253 | 34. **relates_to** (Diagnosis ↔ Medical_Record, M:N) |
| | 254 | Diagnoses can relate to multiple medical records, and records can include multiple diagnoses. |
| | 255 | |
| | 256 | 35. **linked_to** (Prescription ↔ Medical_Record, M:N) |
| | 257 | Prescriptions can be linked to multiple medical records, and records can include multiple prescriptions. |
| | 258 | |
| | 259 | 36. **includes_prescription** (Medical_Report ↔ Prescription, M:N) |
| | 260 | Medical reports can include multiple prescriptions, and prescriptions can appear in multiple reports. |
| | 261 | |
| | 262 | 37. **includes_lab_results** (Medical_Report ↔ Lab_Results, M:N) |
| | 263 | Medical reports can include multiple lab results, and results can appear in multiple reports. |
| | 264 | |
| | 265 | 38. **based_on** (Referral ↔ Appointment, 1:N) |
| | 266 | A referral can serve as the basis for multiple appointments, while each appointment is associated with one referral. |
| | 267 | |
| | 268 | 39. **re_visits** (Appointment ↔ Appointment, 1:N) |
| | 269 | An appointment can result in multiple follow-up appointments, while each follow-up appointment is associated with one previous appointment. |
| | 270 | |
| | 271 | 40. **documents** (Medical_Report ↔ Billing, 1:N) |
| | 272 | A medical report can generate multiple billing records, while each billing record is associated with one medical report. |