Assume that you have been hired to write a java application for SQU students’ clinic to help receptionist to manage the clinic appointments. There are two type of appointments: emergency appointment and routine appointment. Each appointment has the following information: patient ID, patient name, appointment date and time, and doctor name. Emergency appointment can be scheduled on the same date and the patient symptoms (e.g. cough, fever, cold, diarrhea, injury, ...) should be recorded. While for a routine appointment the patient can decide when he/she would like to have the appointment and the required tests (e.g., blood, x-ray, urine, ...) should also be recorded. Your application should read the initial appointments records from a file called “Clinic Appointments.txt" (check Figure 1 for a sample input file). Your program should then display a menu for the receptionist (shown in the sample runs) then he/she can choose the service. For scheduling an appointment, they can choose whether it is an emergency appointment or routine appointment. Then they will be asked to enter the required information as shown in the sample run. The clinic has four doctors (Dr. Ahmed Al Abri, Dr. Muna Mousa, Dr. Hisham Nazim, and Dr. Ismail Mahmood) and patients are assigned to one of these doctors automatically by the system. The receptionist can also check the appointments for a specific patient ID. The system will display the checked appointments sorted by appointment date (Hint: use the Comparable interface). The receptionist can also cancel the next coming (future) appointments or reschedule a coming appointment by changing the date and time. Once receptionist choose to exit the application the system should give them the option to either save the records by updating the initial file or exit without saving. Emergency |32456 |Mohammed Al Azri|12-11-2021 09: 30 |Dr. Muna Mousa|fever, cough Routine |12345 |Aii Al Abri|22-11-2021 10:30|Dr. Ahmed Al Abrilblood, x-ray Emergency |12345 |Ali AI Abri|12-11-2021 08:15|Dr. Ahmed Al Abrilfever, cold, cough Routine |43234 |Mariam Ali|24-11-2021 09:15 |Dr. Muna Mousa|blood, urine Emergency 144342 |Issa Ismail|13-11-2021 13:15|Dr. Muna Mousa |fever Figure 1: Sample Input file "Clinic Appointments.xt" **** Welcome to SQU Students CliniC **** which service do you want? Press "1" to schedule an appointment Press "2" to check appointnents Press "3" to cancel an appointnent Press "4" to reschedule an appointment Press "" to exit Enter the type of the appointment (R)outine or (E)megency:> e Enter Patient ID: 66563 Enter Patient Name: Ali Mousa Enter the patient's current symptons separated by connas(,): injury run: **** Welcome to SQu Students Clinic **** Which service do you want? Press "1" to schedule an appointment Press "2" to check appointments Press "3" to cancel an appointment Press "4" to reschedule an appointment Press "#" to exit Which service do you want? Press "1" to schedule an appointment Press "2" to check appointments Press "3" to cancel an appointnent Press "4" to reschedule an appointment Press "" to exit :> Figure 2: Application menu Figure 3: Schedule Emergency Appointment Which service do you want? Press "1" to schedule an appointment Press "2" to check appointments Press "3" to cancel an appointment Press "4" to reschedule an appointment Press ""#" to exit :> 1 Enter the type of the appointment (R)outine or (E)megency:> r Enter Patient ID: 84326 Enter Patient Name: Nuha Amur Enter the required tests separated by commas(,) : blood Enter Appointment Date and Time as dd-mm-yyyy hh: mm: 2-12-2021 9:45 Which service do you want? Press "1" to schedule an appointment Press "2" to check appointments Press "3" to cancel an appointment Press "4" to reschedule an appointment Press "#" to exit
OOPs
In today's technology-driven world, computer programming skills are in high demand. The object-oriented programming (OOP) approach is very much useful while designing and maintaining software programs. Object-oriented programming (OOP) is a basic programming paradigm that almost every developer has used at some stage in their career.
Constructor
The easiest way to think of a constructor in object-oriented programming (OOP) languages is:
input file sample :
Emergency|32456|Mohammed Al Azri|12-11-2021 09:30|Dr. Muna Mousa|fever, cough Routine|12345|Ali Al Abri|22-11-2021 10:30|Dr. Ahmed Al Abri|blood, x-ray Routine|32456|Mohammed Al Azri|02-12-2021 08:45|Dr. Hisham Nazim|x-ray Emergency|12345|Ali Al Abri|12-11-2021 08:15|Dr. Ahmed Al Abri|fever, cold, cough Routine|43234|Mariam Ali|24-11-2021 09:15|Dr. Muna Mousa|blood, urine Emergency|44342|Issa Ismail|13-11-2021 13:15|Dr. Muna Mousa|fever
Trending now
This is a popular solution!
Step by step
Solved in 3 steps with 1 images