Changes between Initial Version and Version 1 of LogicalAndPhysicalDesign


Ignore:
Timestamp:
05/30/26 10:55:20 (2 weeks ago)
Author:
236021
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • LogicalAndPhysicalDesign

    v1 v1  
     1= Logical and Physical Design, DB Creation (DDL) =
     2
     3
     4== Notation ==
     5 * PK marked with [PK]
     6 * FK marked with *(TABLE)
     7 * UQ = unique constraint
     8
     9
     10== Relation schema ==
     11----
     12
     13{{{
     14USERS & ROLES
     15}}}
     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), technician_id*(LAB_TECHNICIAN))
     17
     18{{{
     19STAFF
     20}}}
     21 2. doctor_level(level_id [PK], level [UQ])
     22 3. doctor_specialization(specialization_id [PK], specialization_name [UQ])
     23 4. departments(department_id [PK], department_name [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))
     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])
     27
     28{{{
     29PATIENTS
     30}}}
     31 8. patients(patient_id [PK], first_name, last_name, email_address [UQ], date_of_birth, blood_type, gender, phone_number, embg [UQ])
     32 9. patient_allergies(patient_id*(PATIENTS), allergy_id*(ALLERGIES))
     33 10. patient_symptoms(patient_id*(PATIENTS), symptom_id*(SYMPTOMS))
     34
     35{{{
     36APPOINTMENTS
     37}}}
     38 11. appointments(appointment_id [PK], appointment_date, appointment_time, status, patient_id*(PATIENTS), doctor_id*(DOCTORS))
     39
     40{{{
     41CLINICAL ENTITIES
     42}}}
     43 12. allergies(allergy_id [PK], name [UQ], allergy_severity)
     44 13. symptoms(symptom_id [PK], name [UQ], description)
     45 14. diagnosis(diagnosis_id [PK], name, description, patient_id*(PATIENTS), doctor_id*(DOCTORS))
     46 15. diagnosis_symptoms(diagnosis_id*(DIAGNOSIS), symptom_id*(SYMPTOMS))
     47
     48{{{
     49PROCEDURES
     50}}}
     51 16. procedures(procedure_id [PK], procedure_type, procedure_date, description, cost, doctor_id*(DOCTORS), diagnosis_id*(DIAGNOSIS))
     52 17. procedure_results(result_id [PK], result_description, result_date, procedure_id*(PROCEDURES))
     53 18. performed_procedures(performed_id [PK], procedure_date, notes, procedure_id*(PROCEDURES), doctor_id*(DOCTORS), patient_id*(PATIENTS), diagnosis_id*(DIAGNOSIS))
     54 19. specialization_procedures(specialization_id*(DOCTOR_SPECIALIZATION), procedure_id*(PROCEDURES))
     55 20. diagnosis_procedures(diagnosis_id*(DIAGNOSIS), procedure_id*(PROCEDURES))
     56 21. department_procedures(department_id*(DEPARTMENTS), procedure_id*(PROCEDURES))
     57
     58{{{
     59LAB TESTS
     60}}}
     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, test_id*(LAB_TESTS), patient_id*(PATIENTS), doctor_id*(DOCTORS), technician_id*(LAB_TECHNICIAN))
     64
     65{{{
     66PRESCRIPTIONS
     67}}}
     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))
     71
     72{{{
     73MEDICAL RECORDS
     74}}}
     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_procedure_results(record_id*(MEDICAL_RECORDS), result_id*(PROCEDURE_RESULTS))
     81 34. medical_record_procedures(record_id*(MEDICAL_RECORDS), procedure_id*(PROCEDURES))
     82 35. medical_record_symptoms(record_id*(MEDICAL_RECORDS), symptom_id*(SYMPTOMS), severity)
     83 36. medical_record_allergies(record_id*(MEDICAL_RECORDS), allergy_id*(ALLERGIES), reaction, severity)
     84
     85{{{
     86REPORTS & REFERRALS
     87}}}
     88 37. medical_report(report_id [PK], description, report_date, record_id*(MEDICAL_RECORDS), doctor_id*(DOCTORS))
     89 38. medical_report_lab_results(report_id*(MEDICAL_REPORT), result_id*(LAB_RESULTS))
     90 39. referrals(referral_id [PK], reason, referral_date, record_id*(MEDICAL_RECORDS), from_doctor_id*(DOCTORS), to_doctor_id*(DOCTORS))
     91
     92{{{
     93BILLING
     94}}}
     95 40. billing(bill_id [PK], total_cost, payment_status, payment_date, record_id*(MEDICAL_RECORDS), admin_id*(ADMIN))
     96 41. billing_procedures(bill_id*(BILLING), procedure_id*(PROCEDURES))
     97 42. billing_lab_tests(bill_id*(BILLING), test_id*(LAB_TESTS))
     98
     99== DDL ==
     100
     101== DML ==
     102
     103== Relational Diagram ==