COP3804 Spring, 2014 Assignment #1 Technical Details – Medical Administration System – Phase I The program consists of a number of classes, which you need to implement, and an interface, which is provided. You may find their description below: Clinic – This class represents the medical office or clinic that’s using this program to manage their data. Private instance variables: name of type String listOfDoctors of type ArrayList of Doctor listOfPatients of type ArrayList of Patient Private class variables: nextAvailablePatientID of type int and initialized to 1 nextAvailableDoctorID of type int and initialized to 1 Public class constant: BASE_VISIT_FEE of type double and initialized to 100 Constructors: Only 1 constructor that takes a String parameter used to initialize the name instance variable. The ArrayList instance variables are initialized to empty array lists. Public Instance Methods: getName – returns the name instance variable getDoctors – returns the listOfDoctors instance variable getPatients – returns the listOfPatients instance variable setName – takes a String parameter to set the name instance variable addDoctor – takes a Doctor parameter that gets added to the listOfDoctors instance variable addPatient – takes a Patient parameter that gets added to the listOfPatients instance variable toString – this method returns a String. This is the text that gets displayed when the user selects option 3 (the list of patients and doctors in the specific format shown in the Requirements Document). Public Class Methods: getNextPatientID() – increments the nextAvailablePatientID class variable and returns the new value. getNextDoctorID() - increments the nextAvailableDoctorID class variable and returns the new value. Person – This class represents a person in the system. Private instance variables: firstName of type String lastName of type String Constructors: Only 1 constructor that takes two String parameters used to initialize the firstName and lastName instance variables. Both first and last name are converted to proper case. Public Instance Methods: getFirstName – returns the firstName instance variable getLastName – returns the lastName instance variable setFirstName – takes a String parameter to set the firstName instance variable (converted to proper case) setLastName – takes a String parameter to set the lastName instance variable (converted to proper case) toProperCase – takes a String parameter, which gets converted to proper case and returned toString – This method returns a String including the first name and last name in the following format: Patient – This is a subclass of Person and represents a patient in the system. Private instance variables: patientID of type int dateOfBirth of type String Constructors: Only 1 constructor that takes 4 parameters: the first 2 parameters are passed to the superclass’ constructor, and the other 2 are used to initialize the patientID and dateOfBirth instance variables. The dateOfBirth instance variable is only set if the date parameter has a valid value. Public Instance Methods: getPatientID – returns the patientID instance variable getDateOfBirth – returns the dateOfBirth instance variable setDateOfBirth - takes a String parameter to set the dateOfBirth instance variable if the value is valid isValidDate – Checks if the parameter passed has a valid date format. Code provided below getCurrentYear – Returns an int value which is the current year. Code provided below toString – This method returns a String including the first name, last name, patient ID, and date of birth in the following format: public static boolean isValidDate(String date) { return date != null && date.matches("[\\d]{2}/[\\d]{2}/[\\d]{4}"); } public static int getCurrentYear() { Calendar now = Calendar.getInstance(); // This gets the current date and time. return now.get(Calendar.YEAR); } UnderagePatient – This is a subclass of Patient and represents a patient under the age of 18. Private instance variables: legalGuardian of type String Constructors: Only 1 constructor that takes 5 parameters: the first 4 parameters are passed to the superclass’ constructor, and the other one is used to initialize the legalGuardian instance variable. Public Instance Methods: getLegalGuardian - returns the legalGuardian instance variable setLegalGuardian - takes a String parameter to set the legalGuardian instance toString – This method returns a String including the first name, last name, patient ID, date of birth, and legal guardian in the following format: Doctor – This is a subclass of Person and represents a doctor in the system. It implements the CanBill interface. Private instance variables: doctorID of type int medSchool of type String Constructors: Only 1 constructor that takes 4 parameters: the first 2 parameters are passed to the superclass’ constructor, and the other two are used to initialize the doctorID and medSchool instance variables. Public Instance Methods: getDoctorID - returns the doctorID instance variable getMedSchool - returns the medSchool instance variable setMedSchool - takes a String parameter to set the medSchool instance variable getBillAmount - returns a double value which is the clinic’s base visit fee (Clinic.BASE_VISIT_FEE). toString – This method returns a String including the first name, last name, doctor ID, and school attended in the following format: Specialist – This is a subclass of Doctor and represents a doctor that is a specialist. It implements the CanBill interface. Private instance variables: specialty of type String trainingPrograms of type ArrayList of String Constructors: Only 1 constructor that takes 6 parameters: the first 4 parameters are passed to the superclass’ constructor, and the other two are used to initialize the specialty and trainingPrograms instance variables. If the specialty argument is null, set the specialty instance variable to “” (empty string). Public Instance Methods: getSpecialty - returns the specialty instance variable getTrainingPrograms - returns the trainingPrograms instance variable setSpecialty - takes a String parameter to set the specialty instance variable. If the specialty argument is null, set the specialty instance variable to “” (empty string). setTrainingPrograms – takes a parameter of type ArrayList of String that is used to set the trainingPrograms instance variable getBillAmount – returns a double value which is the clinic’s base visit fee (Clinic.BASE_VISIT_FEE) plus 25 for each training in the trainingPrograms instance variable. toString - This method returns a String including the first name, last name, doctor ID, school attended, specialty, and list of training programs in the following format: note: If the trainingPrograms instance variable is empty, display “None provided” next to “Specialty Training Programs”. MedAdministration – This is the class that has the main method and all the user interfaces. The CanBill interface is implemented by the Doctor and Specialist classes. Its implementation is below (you’ll need to change the package name): package medadminsystem; public interface CanBill { double getBillAmount(); } Note: I’ll be adding more information on the MedAdminitration class.