Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Medical Administration System Phase 1 This program represents a simple medical administration system, which could hypothetically be used by a medical center to maintain information

Medical Administration System Phase 1

This program represents a simple medical administration system, which could hypothetically be used by a medical center to maintain information on their patients, doctors, patient visits, medical procedures performed, etc.

The system will be developed in several phases. This document describes the functionality to be implemented for phase 1.

For phase 1, we are just going to implement several classes, but we are not going to implement a user interface. I am providing you with code for the MedAdministration_Phase1 class, which is the class that has the main method.

Important: All the classes that you implement are to provide a constructor with enough parameters to initialize all instance variables and, unless specified, all classes also have to provide a copy constructor. Additionally, all classes need to provide a getter and a setter method for every instance variable, as well as the toString, equals, and hashCode methods.

The toString method in each class returns a String with the value of all the instance variables including labels.

The equals method compares two objects of the same type: the calling object and the one passed as an argument. It has one parameter whose data type is Object and it returns true if the argument is an object of the same type and has the same value for all fields as the calling object. Otherwise, it returns false.

The hashCode method returns a hashcode for the calling object based on its field values. You may let your IDE generate this method, but make sure that the fields used in the hash code calculation are the same fields used in the comparison of the equals method.

Include javadoc comments for all the classes, constructors and methods in the project.

When getting or setting an instance variable that is a reference type, other than String, make sure to make a copy of the object.

Add the MedAdministration_Phase1 class to your project.

Person This is an abstract class; it represents a person in the system.

Private Instance Variables:

firstName of type String

lastName of type String

Patient This class extends the Person class. It represents a patient in the system.

Private Instance Variables:

patientID of type int

dateOfBirth of type String

Notes:

  • Exclude the patientID field from the comparison in the equals method. In other words, two Patient objects are considered equal if they have the same value for the firstName, lastName, and dateOfBirth fields.

UnderagePatient This class extends the Patient class. It represents a patient under the age of 18.

Private Instance Variables:

legalGuardian of type String

Doctor This class extends the Person class. It represents a doctor in the system.

Private Instance Variables:

doctorID of type int

medSchool of type String

yearsOfExperience of type int

Notes:

  • Exclude the doctorID field from the comparison in the equals method. In other words, two Doctor objects are considered equal if they have the same value for the firstName, lastName, medSchool, and yearsOfExperience fields.

Specialist This class extends the Doctor class. It represents a doctor that is a specialist.

Private Instance Variables:

specialty of type String

trainingPrograms of type ArrayList of String

Notes:

  • Exclude the doctorID and trainingPrograms fields from the comparison in the equals method. In other words, two Specialist objects are considered equal if they have the same value for the firstName, lastName, medSchool, yearsOfExperience, and specialty fields.

Diagnosis This class represents a diagnosis made during a patients visit.

Private Instance Variables:

code of type String

description of type String

Procedure - This class represents a procedure performed during a patients visit.

Private Instance Variables:

code of type String

description of type String

charge of type double

inPatient of type boolean

Notes:

  • Exclude the charge and inPatient fields from the comparison in the equals method. In other words, two Procedure objects are considered equal if they have the same value for the code, and description fields.

Visit This class represents a patients visit to the medical center.

Private Instance Variables:

attendingPhysician of type Doctor

patient of type Patient

listOfDiagnoses of type ArrayList

listOfProcedures of type ArrayList

visitDate of type String

Public Instance Methods:

addDiagnosis This method doesnt return a value and it has 1 parameter of type Diagnosis. It adds a copy of the parameter to the listOfDiagnoses instance variable.

addVisit This method doesnt return a value and it has 1 parameter of type Visit. It adds a copy of the parameter to the listOfVisits instance variable.

Notes:

  • Exclude the listOfDiagnoses and listOfProcedures fields from the comparison in the equals method.

Clinic This class represents the medical office or clinic thats using this system to manage their data.

Private Instance Variables:

name of type String

listOfDoctors of type ArrayList

listOfPatients of type ArrayList

listOfVisits of type ArrayList

Public Instance Methods:

addDoctor This method doesnt return a value and it has 1 parameter of type Doctor. It adds a copy of the parameter to the listOfDoctors instance variable.

addPatient This method doesnt return a value and it has 1 parameter of type Patient. It adds a copy of the parameter to the listOfPatients instance variable.

addVisit This method doesnt return a value and it has 1 parameter of type Visit. It adds a copy of the parameter to the listOfVisits instance variable.

Notes:

  • This class does not have a copy constructor, an equals, or hashCode methods.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Oracle 10g Database Administrator Implementation And Administration

Authors: Gavin Powell, Carol McCullough Dieter

2nd Edition

1418836656, 9781418836658

More Books

Students also viewed these Databases questions

Question

14.4 Analyze in detail three basic causes of accidents.

Answered: 1 week ago