| | 8 | |
| | 9 | === Entities |
| | 10 | |
| | 11 | 1. **Doctor_Level** – entity that stores doctor levels |
| | 12 | - level_id (PK, bigint) |
| | 13 | - level (text) |
| | 14 | |
| | 15 | 2. **Doctor_Specialization** – entity that stores doctor specializations |
| | 16 | - specialization_id (PK, bigint) |
| | 17 | - specialization_name (text) |
| | 18 | |
| | 19 | 3. **Departments** – entity that stores hospital departments |
| | 20 | - department_id (PK, bigint) |
| | 21 | - department_name (text) |
| | 22 | |
| | 23 | 4. **Doctors** – entity that stores doctors |
| | 24 | - doctor_id (PK, bigint) |
| | 25 | - first_name (text) |
| | 26 | - last_name (text) |
| | 27 | - email_address (text) |
| | 28 | - level_id (FK, bigint) |
| | 29 | - specialization_id (FK, bigint) |
| | 30 | - department_id (FK, bigint) |
| | 31 | |
| | 32 | 5. **Admin** – entity that stores administrator data |
| | 33 | - admin_id (PK, bigint) |
| | 34 | |
| | 35 | 6. **Lab_Technician** – entity that stores lab technician data |
| | 36 | - technician_id (PK, bigint) |
| | 37 | |
| | 38 | 7. **Patients** – entity that stores patients |
| | 39 | - patient_id (PK, bigint) |
| | 40 | - first_name (text) |
| | 41 | - last_name (text) |
| | 42 | - email_address (text) |
| | 43 | - date_of_birth (date) |
| | 44 | - blood_type (text) |
| | 45 | - gender (text) |
| | 46 | - phone_number (text) |
| | 47 | - EMBG (text) |
| | 48 | |
| | 49 | 8. **Allergies** – entity that stores allergies |
| | 50 | - allergy_id (PK, bigint) |
| | 51 | - name (text) |
| | 52 | - allergy_severity (text) |
| | 53 | |
| | 54 | 9. **Symptoms** – entity that stores symptoms |
| | 55 | - symptom_id (PK, bigint) |
| | 56 | - name (text) |
| | 57 | - description (text) |
| | 58 | |
| | 59 | 10. **Appointments** – entity that stores appointments |
| | 60 | - appointment_id (PK, bigint) |
| | 61 | - appointment_date (date) |
| | 62 | - appointment_time (time) |
| | 63 | - status (text) |
| | 64 | - patient_id (FK, bigint) |
| | 65 | - doctor_id (FK, bigint) |
| | 66 | |
| | 67 | 11. **Diagnosis** – entity that stores diagnoses |
| | 68 | - diagnosis_id (PK, bigint) |
| | 69 | - name (text) |
| | 70 | - description (text) |
| | 71 | - patient_id (FK, bigint) |
| | 72 | - doctor_id (FK, bigint) |
| | 73 | |
| | 74 | 12. **Diagnosis_Results** – entity that stores diagnosis results |
| | 75 | - result_id (PK, bigint) |
| | 76 | - result_description (text) |
| | 77 | - diagnosis_id (FK, bigint) |
| | 78 | |
| | 79 | 13. **Procedures** – entity that stores medical procedures |
| | 80 | - procedure_id (PK, bigint) |
| | 81 | - procedure_type (text) |
| | 82 | - procedure_date (date) |
| | 83 | - description (text) |
| | 84 | - cost (decimal) |
| | 85 | - doctor_id (FK, bigint) |
| | 86 | - diagnosis_id (FK, bigint) |
| | 87 | |
| | 88 | 14. **Procedure_Results** – entity that stores procedure results |
| | 89 | - result_id (PK, bigint) |
| | 90 | - result_description (text) |
| | 91 | - result_date (date) |
| | 92 | - procedure_id (FK, bigint) |
| | 93 | |
| | 94 | 15. **Prescriptions** – entity that stores prescriptions |
| | 95 | - prescription_id (PK, bigint) |
| | 96 | - medication_name (text) |
| | 97 | - dosage (text) |
| | 98 | - instructions (text) |
| | 99 | - duration (text) |
| | 100 | - price (decimal) |
| | 101 | - doctor_id (FK, bigint) |
| | 102 | - patient_id (FK, bigint) |
| | 103 | |
| | 104 | 16. **Prescription_Restriction** – entity that stores prescription restrictions |
| | 105 | - restriction_id (PK, bigint) |
| | 106 | - allowed (boolean) |
| | 107 | - prescription_id (FK, bigint) |
| | 108 | |
| | 109 | 17. **Lab_Tests** – entity that stores lab tests |
| | 110 | - test_id (PK, bigint) |
| | 111 | - test_name (text) |
| | 112 | - description (text) |
| | 113 | - cost (decimal) |
| | 114 | - patient_id (FK, bigint) |
| | 115 | - technician_id (FK, bigint) |
| | 116 | |
| | 117 | 18. **Lab_Results** – entity that stores lab results |
| | 118 | - result_id (PK, bigint) |
| | 119 | - results (text) |
| | 120 | - result_date (date) |
| | 121 | - test_id (FK, bigint) |
| | 122 | |
| | 123 | 19. **Medical_Records** – entity that stores medical records |
| | 124 | - record_id (PK, bigint) |
| | 125 | - doctor_notes (text) |
| | 126 | - patient_id (FK, bigint) |
| | 127 | - doctor_id (FK, bigint) |
| | 128 | |
| | 129 | 20. **Referrals** – entity that stores referrals |
| | 130 | - referral_id (PK, bigint) |
| | 131 | - reason (text) |
| | 132 | - date (date) |
| | 133 | - doctor_id (FK, bigint) |
| | 134 | - patient_id (FK, bigint) |
| | 135 | |
| | 136 | 21. **Medical_Report** – entity that stores medical reports |
| | 137 | - report_id (PK, bigint) |
| | 138 | - description (text) |
| | 139 | - date (date) |
| | 140 | - patient_id (FK, bigint) |
| | 141 | - doctor_id (FK, bigint) |
| | 142 | |
| | 143 | 22. **Billing** – entity that stores billing information |
| | 144 | - bill_id (PK, bigint) |
| | 145 | - payment_status (text) |
| | 146 | - payment_date (date) |
| | 147 | - patient_id (FK, bigint) |