'Patients part in a Hospital Management System
I'm still new to coding and I'm asked to create a Patients part in a hospital management system
It should include: 1- Add Patients Records (Name Age, Gender, ID, Insurance, Phone Number) (write it in file) 2- Add Health Condition (write it in file) 3- Add Appointments (write it in file) 4- Cancel Appointments (clear or remove whatever in file) 5- Get Appointments (read it from file) 6- Get Patients Records (read it from file)
I wanna make sure to use proper classes, methods, inheritance, overriding, polymorphism, reading and writing from files, and exception handling
The thing is I don't know how to start this and since this is a hospital management system, there will be a class named hospital and under it will be staff, patients, pharmacy, and etc patients are considered what? should they be an individual class? and how can I fill all the requirements? So how this code should look like?
Solution 1:[1]
This question is too broad to be answered, but I will try to provide you with answers to your questions.
Will there be a class named hospital and under it will be staff,...
hospital would not have to be an object unless your system encompasses multiple hospitals (and each of them specialises in an area, etc...). By what I understand you don't need something like that, so you can ignore it.
staff, patients, pharmacy, and etc patients are considered what?
They would be each considered an object.
should they be an individual class?
Yes.
An example of where you can use polymorphism and inheritance would be between staff and patients. They are both people with common attributes such as name, gender, etc... So you could, create a superclass called person and have both staff and patient inherit it. Then create member variables and methods that are common to all people in the person class, while things such as health condition which are specific to patients can be kept in the patient class.
That was just an example. If you were to get a thorough understanding of the OOP concepts you mentioned yourself, everything would start to fit into place. It is also best if you created a class diagram, or some sort of overview diagram and look through the architecture of your system before you start implementing it.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | M B |
