Please help me! Im creating a database to store data about patients in an A&E Department. However, Im unsure how to relate the tables.
Table structure:
PATIENTS (PatientID(PK),Forename, surname, gender, DOB, Address, History, illness, priority)
A&E (ID(PK), PatientID(FK), address, city, postcode, telenumber)
NURSE (NurseID(PK), forename, surname)
CONDITION (ID(PK), PatientID(FK) symptoms, diagnosis, treatment)
Basically the relationships between these are:
PATIENT attends A&E
PATIENT seen_by NURSE
NURSE assesses CONDITION of PATIENT
Here are the relations that need to be added:
- Time should be linked to both Patients and Nurse
- Priority should link to both Patients and Nurse
- Doctors should be linked to time and priority (doctors will make a decision based on waiting time and priority of patient). There is no direct link between doctor and patients.
This is imperitive that I get these relations correct so any help would be greatly appreciated. Thankyou.
Your question is not at all clear to me. For instance you talk about patients and nurses being linked to "Priority" and doctors being linked to "Time" and "Priority" - and you write as if these are other tables - but you don't describe them.
Below is how I would solve your problem, based on the foggy understanding I have of your problem.
I don't know what A&E means. I'm assuming it's a clinic, hospital or other facility.
Obviously your "state" could be different. Here in the United States our states all have a unique 2-character code.
You didn't describe what you need to know about doctors so I'm assuming it's the same as what you need to know about nurses.
Things like: influenza, bronchitis, sinus infection, etc.
I put the patient history into it's own table so we can associate multiple illnesses with each patient as well as a date for when the patient had each illness.
Again, your "states" may have a different size id or name.
Things like: dizziness, fatigue, sinus congestion, shortness of breath, etc.
This table holds information about every time a patient visits an A&E. Any record that doesn't have an end_time would represent a patient who is currently at an A&E waiting to be seen by a doctor/nurse. You can determine how long a patient has been waiting by comparing the current time to the beg_time. And of course priority would be entered/updated by the admitting clerk, nurse, doctor, etc.
Multiple doctors might see a patient...
And multiple nurses might see a patient...
A patient usually has multiple symptoms when they come in for a visit...