A simple Hospital Management System in java
-
patientList
is the list of the Patients attended by the Doctor. -
addPatient(Patient p)
method receives one Patient object as argument and adds it to the list and returns the current size of the list. -
releasePatient(Patient p)
method receives int patientId as argument and releases (remove) the patient from the system (list) and returns the current size of the list.
patientId
should be generated using IDGenerator
class outline as given below. Id value should start with 1.
Patient
class outline is given below.
Property and Method description of the above class is given below
-
doctorList is the list of Doctor present for the Hospital Network (ArrayList)
-
registerDoctor(Doctor d) method registers (add) one doctor into system. Returns size of the list on success. -1 in failed scenario. Doctor regNo should be unique unless it should throw DuplicateDoctorException. Exception class outline is given at the end.
-
hospitalizePatient(String regNo, Patient p) method add a patient in the treating Doctor’s List identified by the regNo. Returns size of the patientList on success. -1 in failed scenario. uId is the unique identifier for a Patient (like PAN001). If Patient with same uId is already treated by a Doctor, method will throw PatientExistException. Exception class outline is given at the end.
-
releasePatient(int patientId) method removes one patient based on patientId from system. Returns size of the list after removal if operation is successful. -1 in failed scenario.
-
retrieveDoctorInfo(int patientId) method returns treating Doctor based on patientId from system. Returns Doctor object from List on success. Blank Doctor object in failed scenario.
-
patientCountPerCity(String city) method returns count of patients, who are from the specific city given as argument.
Exception Class Outline is given below
Message: Doctor with same Reg No Exist in System
Message: Patient with given PAN already hospitalized