Hospital
Implement a system to manage patients of an hospital
(using Exceptions and
Collections).
The system must meet the following requirements.
R1: Patients
The main class of the program is class Hospital.
Patients are characterized by the first name, the last name, and the
unique social security number (characters string).
New patients can be added
to the system by means of method addPatient().
The information about a patient can be retrieved by means of method
getPatient() that given an SSN returns an object of class Person.
Such class provides the getter methods for first and last names.
If the patient does not exist,
exception NoSuchPatient is
thrown.
R2: Doctors
Doctors are characterized by the first name, the last name, and the unique badge ID
(integer number).
New doctors can be added to the system by means of method addDoctor().
Method getDoctor(), given a badge ID, returns an object of class Doctor.
Such class that extends class Person.
If the doctor does not exist, exception NoSuchDoctor is thrown.
Suppose that doctors are never patients of the same hospital they work in.
R3: Patient registration
When accepted, a patient is assigned to one of the hospital doctors. To
this aim, method assignPatientToDoctor()
is provided. Patient is identified by means of her SSN, and doctor is
identified by means of her badge ID. If the doctor does not exist,
exception NoSuchDoctor is
thrown. Further, if the patient does not exist, exception NoSuchPatient is thrown.
R3: Doctor and patients
By means of method getDoctor() of class Person,
it is possible to obtain the Doctor of that person.
By means of method getPatients() of class Doctor
returns the list of all patients of that doctor.