Need help to design ER diagram

database-designdatabase-diagrams

I need to design an ER diagram for a centralized healthcare management system for my college mini-project.

Firstly, I came up with the following ER diagram.

ER-diagram-1

While designing the tables in the database, I found the patient table to be redundant as every person is a patient in our case so, I came up with the following ER-diagram.

ER-diagram-2

Now, I am confused about which ER diagram shall I use for the project.
Can you please me with the ER diagram? Thanks in advance.

Best Answer

I would take the approach for diagram 1. When approaching people in a database, the patients are essentially objects. They don't log in, they only have data. A doctor (or any employee) would be able to log in as users, so would have fields in their table like a login_id, password, and such. A point of confusion may come up when you have a doctor that is also a patient, but then they would have an employee_id\user_id AND a separate patient_id.

As a side note, I would move the connection for medications to be attached to the treatment actions. That would associate a drug with a prescription event, which would be connected to a patient and doctor. Drug prescriptions are events in and of themselves, not necessarily a long-term association to just a patient.