Question: It is required to develop an application in Java called Hospital Management System focusing on managing patient information and hospital services. The application will maintain
It is required to develop an application in Java called Hospital Management System focusing on managing patient information and hospital services. The application will maintain information about patients registered in a hospital, their medical records, and the services provided. Write the following classes: A Class: Service This class will represent medical services offered by the hospital. Private Data Members: serviceId String egS serviceName String eg "General Checkup" cost double duration int duration in minutes Public Methods: Default constructor Constructor with parameters Set and get methods for all attributes equals method to compare two services toString method for displaying service details B Class: Patient This class will represent patients in the hospital. Private Data Members: patientId long firstName String lastName String gender char email String medicalHistory ArrayList of type String, where each entry is a medical record servicesReceived ArrayList of type Service Public Methods: Default constructor Constructor with parameters excluding medicalHistory and servicesReceived Done by: Mrs Fatema Alshaikh Set and get methods for all attributes equals method to compare patients by patientId printMedicalHistory method to display medical records printServicesReceived method to display services received toString method for displaying patient details. C Class: Hospital This class will manage the list of patients and services. Private Data Members: patientsList LinkedList of type Patient servicesList LinkedList of type Service size int actual number of patients Public Methods: Constructor without parameters, initializes patientsList and servicesList as empty lists and size to addPatient: Adds a new Patient object to the patientsList. Returns true if added, false if patient already exists. deletePatient: Deletes a Patient by patientId. Returns true if deleted, false if not found. searchPatient: Searches for a Patient by patientId. Returns the index if found, or if not. isEmpty: Returns true if patientsList is empty, otherwise false. listSize: Returns the size of the patientsList. getPatient: Returns the Patient object at the specified index. addService: Accepts a Service object and adds it to servicesList. getService: Returns a Service object based on its ID printPatientDetails: Prints details of a Patient including their medical history and services received. printPatientList: Print all patients in the patientsList. printServiceList: Print all services in the servicesList. D Class: HospitalManagement This class will contain the main method to test functionalities. Main Method: Display a menudriven interface using a loop and switch statement to interact with the user. Options include addingremoving patients, viewing patient details, searching for specific patient, adding medical services,and adding service to patient etc. NOTE: For linked list use Javas builtin LinkedList class. Write detailed comments for each class and method.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
