This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes OO, Patterns, UML and Refactoring and the fly likes class diagram clarification for hospital management Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Engineering » OO, Patterns, UML and Refactoring
Bookmark "class diagram clarification for hospital management" Watch "class diagram clarification for hospital management" New topic
Author

class diagram clarification for hospital management

Harshana Dias
Ranch Hand

Joined: Jun 11, 2007
Posts: 327
I have need to verify whether I have correctly identify the relationship among those classes. For example Suppose I have below entities,

Doctor 1---------m Diagnosis m----------m Prescriptions m ----------1 Patience
1 ------------------------------------------------------------------------- m


So its basically diagnonsis is a refernece table where a admin doctor entered all the dignosis details. For example,

Diag_ID, Category, Name, Desc
1 Skin Red Skin Red spots in skin


So my business flow is Doctor going to create a prescription for a patient. So he will be giving a patient id (patient registration also happen but i didn't display those entity). Then from Doctor.createPrescription(patientId) he will refer to the Diagnosis table and create prescription with relevant details. Suppose the prescription class constructor takes new Prescription(diagnonsisId,doctorId,patientID).

Is it a correct way to identify the relationship among them. Is it correct to link doctor and diagnosis class when creating the prescription. Doctor can also create a new diagnosis type if its not exsits.

So one doctor can diagnose a patient with more than one symptoms. For example one with skin and another one with Chest. so in that case 1 doctor can have many diagnosis. But all those should be done by one doctor. So for each diagnonsis doctor can issue seperate prescriptions or a one prescription can issue for all diagnoses. So its a many to many relationship. Finally those prescriptions should be belong to a one patient. Can not share between patients. I guess my model is right know?

What if multiple doctors can diagnose a patient. How to extend this to support that requirement?

Any suggestions and if this model wrong from start. please suggest a new model
Ryan McGuire
Ranch Hand

Joined: Feb 18, 2005
Posts: 1006
    
    3
If I understand the question correctly...

I would think the diagram would have Diagnosis at the center and the other three classes related to it, but not directly to each other.



It's true that a single Doctor is related to any given prescription, so it would seem that those two classes should be directly related. However, the Prescription exists only because the Doctor made a Diagnosis. Also, one Diagnosis might require multiple Prescriptions, however any one Prescription is for exactly Diagnosis.

There may be a relationship between Patient and Doctor (e.g. Patient goes-to Doctor maybe). However as far as the business of making a Diagnosis and writing a Prescription goes, that relation can be momentarily ignored.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: class diagram clarification for hospital management
 
Similar Threads
detached entity passed to persist
Compound key
access records from 2 table using CMB
A Riddle... Can someone answer?
Weblogic EJB Deployment Descriptor Help Needed