Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Class for java. Named appointment. You are required to write a class named Appointment to model the details of a appointment made to see a

Class for java. Named appointment.

You are required to write a class named Appointment to model the details of a appointment made to see a specialist at the Child Health Clinic.

The design and functionality for this Appointment class will be discussed below and you must adhere to this class design / functional specification - no changes to this design are permitted unless a specific clarification or correction is made by the instructor, as part of this task is being able to understand and follow a design specification that you have been given.

A) Declare private instance variables to store the details required for a single Appointment in the system: appointment ID, clinic name, appointment time, appointment status, room number, patient name, consultation notes, bulk billin (boolean), and consultation fee (int). Note: The type for each instance variable listed above is String, unless otherwise stated

B) Provide a constructor for the class that accepts the information shown below as parameters for the Appointment to be created: public Appointment(String appointmentID, String appointmentTime, String patientName, boolean bulkBilling) This constructor should begin by initialising the corresponding instance variables to the values passed in via in the supplied parameters. The appointment status should be initialised to 'scheduled' (ie. "SCH"), after which the clinic name should be recorded by invoking the getClinicName() method of the ClinicDetails class in an appropriate manner, passing the appointment ID as a parameter, and storing the result in the clinic name instance variable.

C) Implement accessors for the appointment ID, clinic name, appointment time, appointment status and patient name instance variables.

D) Implement a method public boolean checkIn (), which handles the checking in of a patient for their clinic Appointment. If the appointment status for the current Appointment is not currently 'scheduled' (ie. "SCH") then the method should immediately return the value false, otherwise it should proceed to update the appointment status to 'checked in' (ie. "CHK") and return the value true.

E) Implement a method public boolean callPatient (String roomNumber), which handles the calling of a patient to the assigned consultation room for their clinic Appointment. If the appointment status for the current Appointment is not currently 'checked in' (ie. "CHK") then the method should immediately return the value false, otherwise it should proceed to store the room number that was passed in as a parameter in the corresponding room number instance variable, update the appointment status to 'called' (ie. "CLD") and return the value true.

F) Implement a method public int recordConsultation (String notes), which records details of a consultation that has been delivered to a patient at the clinic. If the appointment status for the current Appointment is not currently 'called' (ie. "CLD") then the method should immediately return the value -1. Otherwise the method should proceed to store the notes that were passed in as a parameter to the corresponding consultation notes instance, after which it should proceed to update the appointment status and determine the applicable consultation fee, based on the bulk billing status as follows: If the appointment is being bulk billed (ie. bulk billing is set to true) then the appointment status should be set to "bulk billed" (ie. "BBL") and the method should return the value zero (0). Otherwise the method should proceed to determine the applicable consultation fee, by invoking the getClinicFee() method from the ClinicDetails class in an appropriate manner (passing in the appointment ID as a parameter), and store the result that is returned in the consultation fee instance variable, after which it should update the appointment status to "payment pending" (ie. "PPE") and return the consultation fee that was stored earlier.

G) Implement a method public void printDetails() , which displays all of the details of an appointment to the screen in a neat, formatted manner - this summary should include the following details: the appointment ID and clinic name the appointment time and appointment status the room number, patient name and their bulk billing status the consultation notes and consultation fee Sample output demonstrating the structure and content required in the record for an appointment is shown below.

Appointment immediately after creation:

Appointment ID: AUD001, Clinic: AUDITORY Appointment Time: 05/04/2018 14:00, Status: SCH Room: null, Patient: Jill Smith, Bulk Billing: false Consultation Notes: null Consultation fee: $0 Same appointment after recording of consultation: Appointment ID: AUD005, Clinic: AUDITORY Appointment Time: 05/04/2018 14:00, Status: PPE Room: B-212, Patient: Jill Smith, Bulk Billing: false Consultation Notes: LHS Test 95% complete - response at all levels RHS 100% complete - response at all levels Assessment - hearing within normal ranges (both sides) Consultation fee: $120

Note that you do not need to match this formatting exactly, but it is expected that the details your printDetails() method displays to the screen will be neat and easy to read and all details for the Appointment should be labeled appropriately, so that the user can work out what they represent.

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

Intelligent Information And Database Systems Asian Conference Aciids 2012 Kaohsiung Taiwan March 2012 Proceedings Part 2 Lnai 7197

Authors: Jeng-Shyang Pan ,Shyi-Ming Chen ,Ngoc-Thanh Nguyen

2012th Edition

3642284892, 978-3642284892

More Books

Students also viewed these Databases questions

Question

Are the rules readily available?

Answered: 1 week ago

Question

Have ground rules been established for the team?

Answered: 1 week ago

Question

Is how things are said consistent with what is said?

Answered: 1 week ago