| 16 | | 1. users(user_id [PK], username [UQ], password, role, first_name, last_name, is_active, patient_id*(PATIENTS), doctor_id*(DOCTORS), admin_id*(ADMIN), lab_technician_id*(LAB_TECHNICIAN)) |
| | 16 | 1. users(user_id [PK], username [UQ], password, role, first_name, last_name, is_active) |
| 24 | | 5. doctors(doctor_id [PK], first_name, last_name, email_address [UQ], level_id*(DOCTOR_LEVEL), specialization_id*(DOCTOR_SPECIALIZATION), department_id*(DEPARTMENTS)) |
| 25 | | 6. admin(admin_id [PK], username [UQ], name, lastname, email [UQ]) |
| 26 | | 7. lab_technician(technician_id [PK], username [UQ], name, lastname, email [UQ]) |
| | 24 | 5. doctors(doctor_id [PK], first_name, last_name, email_address [UQ], level_id*(DOCTOR_LEVEL), specialization_id*(DOCTOR_SPECIALIZATION), department_id*(DEPARTMENTS), user_id [UQ]*(USERS)) |
| | 25 | 6. admin(admin_id [PK], username [UQ], name, lastname, email [UQ], user_id [UQ]*(USERS)) |
| | 26 | 7. lab_technician(technician_id [PK], username [UQ], name, lastname, email [UQ], user_id [UQ]*(USERS)) |
| 31 | | 8. patients(patient_id [PK], first_name, last_name, email_address [UQ], date_of_birth, blood_type, gender, phone_number, embg [UQ]) |
| | 31 | 8. patients(patient_id [PK], first_name, last_name, email_address [UQ], date_of_birth, blood_type, gender, phone_number, embg [UQ], user_id [UQ]*(USERS)) |
| 61 | | 22. lab_tests(test_id [PK], test_name, description, cost) |
| 62 | | 23. lab_results(result_id [PK], results, result_date, test_id*(LAB_TESTS)) |
| 63 | | 24. performed_lab_tests(performed_test_id [PK], test_date, notes, created_at, test_id*(LAB_TESTS), patient_id*(PATIENTS), doctor_id*(DOCTORS), technician_id*(LAB_TECHNICIAN)) |
| | 60 | 21. lab_tests(test_id [PK], test_name, description, cost) |
| | 61 | 22. lab_results(result_id [PK], results, result_date, test_id*(LAB_TESTS)) |
| | 62 | 23. performed_lab_tests(performed_test_id [PK], test_date, notes, created_at, test_id*(LAB_TESTS), patient_id*(PATIENTS), doctor_id*(DOCTORS), technician_id*(LAB_TECHNICIAN)) |
| 68 | | 25. prescriptions(prescription_id [PK], medication_name) |
| 69 | | 26. prescription_restriction(restriction_id [PK], description, prescription_id*(PRESCRIPTIONS)) |
| 70 | | 27. allergy_prescription_restrictions(allergy_id*(ALLERGIES), restriction_id*(PRESCRIPTION_RESTRICTION)) |
| | 67 | 24. prescriptions(prescription_id [PK], medication_name) |
| | 68 | 25. prescription_restriction(restriction_id [PK], description, prescription_id*(PRESCRIPTIONS)) |
| | 69 | 26. allergy_prescription_restrictions(allergy_id*(ALLERGIES), restriction_id*(PRESCRIPTION_RESTRICTION)) |
| 75 | | 28. medical_records(record_id [PK], patient_id*(PATIENTS)) |
| 76 | | 29. doctor_medical_records(doctor_id*(DOCTORS), record_id*(MEDICAL_RECORDS)) |
| 77 | | 30. diagnosis_medical_records(diagnosis_id*(DIAGNOSIS), record_id*(MEDICAL_RECORDS)) |
| 78 | | 31. prescription_medical_records(prescription_id*(PRESCRIPTIONS), record_id*(MEDICAL_RECORDS), dosage, frequency, duration, notes) |
| 79 | | 32. medical_record_lab_results(record_id*(MEDICAL_RECORDS), result_id*(LAB_RESULTS)) |
| 80 | | 33. medical_record_procedures(record_id*(MEDICAL_RECORDS), procedure_id*(PROCEDURES)) |
| 81 | | 34. medical_record_symptoms(record_id*(MEDICAL_RECORDS), symptom_id*(SYMPTOMS), severity) |
| 82 | | 35. medical_record_allergies(record_id*(MEDICAL_RECORDS), allergy_id*(ALLERGIES), reaction, severity) |
| | 74 | 27. medical_records(record_id [PK], patient_id*(PATIENTS)) |
| | 75 | 28. diagnosis_medical_records(diagnosis_id*(DIAGNOSIS), record_id*(MEDICAL_RECORDS)) |
| | 76 | 29. prescription_medical_records(prescription_id*(PRESCRIPTIONS), record_id*(MEDICAL_RECORDS), dosage, frequency, duration, notes) |
| | 77 | 30. medical_record_lab_results(record_id*(MEDICAL_RECORDS), result_id*(LAB_RESULTS)) |
| | 78 | 31. medical_record_procedures(record_id*(MEDICAL_RECORDS), procedure_id*(PROCEDURES)) |
| | 79 | 32. medical_record_symptoms(record_id*(MEDICAL_RECORDS), symptom_id*(SYMPTOMS), severity) |
| | 80 | 33. medical_record_allergies(record_id*(MEDICAL_RECORDS), allergy_id*(ALLERGIES), reaction, severity) |
| 87 | | 36. medical_report(report_id [PK], description, report_date, record_id*(MEDICAL_RECORDS), doctor_id*(DOCTORS)) |
| 88 | | 37. medical_report_lab_results(report_id*(MEDICAL_REPORT), result_id*(LAB_RESULTS)) |
| 89 | | 38. referrals(referral_id [PK], reason, referral_date, record_id*(MEDICAL_RECORDS), from_doctor_id*(DOCTORS), to_doctor_id*(DOCTORS)) |
| | 85 | 34. medical_report(report_id [PK], description, report_date, record_id*(MEDICAL_RECORDS), doctor_id*(DOCTORS)) |
| | 86 | 35. medical_report_lab_results(report_id*(MEDICAL_REPORT), result_id*(LAB_RESULTS)) |
| | 87 | 36. referrals(referral_id [PK], reason, referral_date, record_id*(MEDICAL_RECORDS), from_doctor_id*(DOCTORS), to_doctor_id*(DOCTORS)) |
| 94 | | 39. billing(bill_id [PK], total_cost, payment_status, payment_date, created_at, record_id*(MEDICAL_RECORDS), admin_id*(ADMIN)) |
| 95 | | 40. billing_procedures(bill_id*(BILLING), procedure_id*(PROCEDURES)) |
| 96 | | 41. billing_lab_tests(bill_id*(BILLING), test_id*(LAB_TESTS)) |
| | 92 | 37. billing(bill_id [PK], total_cost, payment_status, payment_date, created_at, record_id*(MEDICAL_RECORDS), admin_id*(ADMIN)) |
| | 93 | 38. billing_procedures(bill_id*(BILLING), procedure_id*(PROCEDURES)) |
| | 94 | 39. billing_lab_tests(bill_id*(BILLING), test_id*(LAB_TESTS)) |