I have school project where me and my team have to build a health care system. It consists of different modules including :
A module for doctors : It allows a doctor to access the medical records of his patients, send indications to them, consult his agenda...
A module for patients : A patient can take an appointment with his doctor, signal an emergency or send indicators (glycaemia level, weight, blood pressure). There are three types of patients that must be taken care of by the system : Women with a risky pregnancy, Diabetics and people suffering from Alzheimer. The latter are assisted by people from their family or medical staff.
A module for transportation : To affect and dispatch an ambulance at the location where a patient signaled an emergency.
Upon trying to model the solution through an UML class diagram (which is actually a due document for the project), we came across three problems/dilemmas :
- How to model a patient ?
Our first thought was to create a User class from which inherit the other classes like this :
But then this wouldn't allow a patient to be pregnant and diabetic for example. Which is bothersome.
After searching on the internet, we found out about role-based access control, we didn't delve into it because we thought it was intended for account management and permissions, not business related stuff like a patient having different roles (diabetic and pregnant for example).
We finally agreed on creating a Pathology class and adding a list of pathologies for each patient. Does this violate any good design principle ? Is there a standard or better way to do this ?
Another similar problem appears with the assistant. Since he can be a member of the patient's family or the medical staff, we would have an him either falling in the Assistant class under User or in the MedicalAssistant class under MedicalStaff. But I think this is the same problem as for the patient's pathologies.
- How to model an assistant ?
Again with the assistant, he is here to assist a patient suffering from Alzheimer : he makes doctor appointments for him and is notified if he wanders off too far (we've included a wearable bracelet equipped with a GPS in the solution). This raised up the issue of redundancy since we have classes Assistant and Patient which implement the method MakeAppointment(Doctor, Date). This raised two possibilities :
-Should this method be in the Doctor class instead ?
-Should we have an IAppointement interface containing the method ?
I personally think the method should be moved to the Doctor class (maybe this is even a basic OOP thing).
- How to represent MVC ?
We're going to make a website and a mobile app supporting the system. We've thought about using ASP.NET to get a hand on it and get to know about the MVC design pattern. After a little bit of documentation (mainly from the "MVC In PHP series" from Tom Butler and "GUI Architectures from Martin Fowler (both on their websites), We've come to ask ourselves if the Controller and View layers should be represented in a class diagram like this :
We've found this post on stackoverflow that asks a similar question :
How to create UML class diagrams for MVC
It says that only the model (business related classes) should be represented. But is that a general rule ? Should the Controller and View classes be represented ? How would that translate into a sequence diagram ?
I'm sorry for the post being so long and the questions quite heterogeneous. Thanks in advance for any help, advice or remarks you might give us.
Interfaces(pure virtual abstract) instead of inheritance.