0

First I'll explain the statement of diagram and after that I will explain my problem and I'll attach my actual diagram.

I should make an ER diagram about the following statement:

Perform the design and implementation of a database to store information about patients admitted to a hospital, patients can be adults or children. In the case of children we save information from who their parents who in turn can also be patient. In this hospital, patients arriving at the emergency department of the hospital are examined by a doctor and, depending on their health status, are entered in the corresponding plant (traumatology, intensive care...) under the supervision of a nurse. Each patient receives a treatment that must be stored

Well, I design the following diagram; but my main problem is how to make the relation between fathers that can be patients. I decided put all fathers as patients and don't represent adults as entity, I have considered them implicit into patient's entity. But I'm not very sure about the validity of my solution.

My Diagram

I'd be grateful if someone can help me with my doubt.

reaanb
  • 9,806
  • 2
  • 23
  • 37
justme
  • 33
  • 1
  • 1
  • 9

1 Answers1

0

How about subtyping patient from person and then creating a relationship from patients who are children to their parent persons? In this way, not every person need to be a patient but parents can be patients too. The relationship between parent and child indicates the role of each so there's no need to specifically subtype patients into parents or children.

Patient-parent relationship

Note also that your Doctors can currently only examine one patient.

reaanb
  • 9,806
  • 2
  • 23
  • 37
  • Yes, you are right about my "examined by" relation, it should be n to 1; thanks for tell me it. And about your solution, I don't understand it really... Do you mean that I should add a relation between fathers and patients? Or do you mean that I should delete my kids entity? My sentence doesn't specify it and I suppose that it will be enough if I store just one parent – justme Jun 08 '16 at 13:17
  • I don't know if you are suggesting me the following: http://imgur.com/C2q3Put But with that relation I'm considering that all parents are patients but the sentence says that a parent can be a parent, maybe he isn't a parent... I don't know if it correct – justme Jun 08 '16 at 15:07
  • Sorry, "padre" means "father" I wrote it into my language by mistake – justme Jun 08 '16 at 15:07
  • You're right, I missed that parents didn't need to be patients. I adjusted my answer accordingly. – reaanb Jun 08 '16 at 17:34
  • Thanks sir, I think that your solution is great! – justme Jun 08 '16 at 21:37