sample input file : 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

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question

sample input file :

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 

Press "1" te schedule an appointment
Press "2" to check appointments
Press "3" to cancel an appointnent
Press "4" to reschedule an appointment
Press "" to exit
1> 2
Enter Patient ID: 12345
Appointment
Туре
Patient
Patient
Doctor
Appointnent
ID
Nane
Name
Date
Energency
Routine
12345
12345
Ali AL Abri
Dr. Ahmed Al Abri
Ali Al Abri
12-11-2021 08:15
22-11-2021 10:30
Symptoms: fever, cold, cough
Tests: blood, x-ray
Dr. Ahmed Al Abri
Which service do you want?
Press "1" to schedule an appointnent
Press "2" te check appointments
Press "3" to cancel an appointnent
Press "4" to reschedule an appointnent
Press "e" to exit
Figure 5: Check an Appointment by Patient ID (results are sorted by appointment date)
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
:> 3
Enter Patient ID: 43234
The sheduled appointment for Mariam Ali(ID#: 43234) on 24-11-2021 09:15 is cancelled.
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
:>
Figure 6: Cancel an appointment
Which service do you want?
Press "1" to schedule an appointnent
Press "2" to check appointments
Press "3" to cancel an appointment
Press "4" to reschedule an appointnent
Which service do you want?
Press "1" to schedule an appointment
Press "2" to check appointnents
Press "3" to cancel an appointment
Press "4" to reschedule an appointment
Press "*" to exit
Press "" to exit
Enter Patient ID: 44342
No coming appointment found for 44342.
You might need to schedule a new appointment.
4
Enter Patient ID: 12345
The coming sheduled appointment for Ali Al Abri(ID#: 12345) is on 22-11-2021 10:30
Enter the Appointment New Date and Time as dd-an-yyyy hh:m: 4-1-2021 12:08
The new date and time should be after the current System time. Try again.
Which service do you want?
Press "1" to schedule an appointnent
Press "2" to check appointnents
Press "3" to cancel an appointment
Press "4" to reschedule an appointnent
Press "" to exit
Enter the Appointment New Date and Tine as dd-an-yyyy hh:m: 4-1-2022 12:00
Appointnent has been updated.
Which service do you want?
Press "1" to schedule an appointment
Press "2" to check appointnents
Press "4" to reschedule an appointment
Press "" to exit
Figure 7: Reschedule an appointment (Left no future appointment found, Right update a future appointment to a future time)
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 appointnent
Press "" to exit
:> 5
which service do you want?
Press "1" to schedule an appointnent
Press "2" to check appointnents
Press "3" to cancel an appointment
Press "4" to reschedule an appointment
Invalid choice.
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 appointnent
Press "#" to exit
Would you like to save (Y/N]? Y
Good Bye. Have a nice day.
BUILD SUCCESSFUL (total tine: 6 ninutes e seconds)
Press "" to exit
Figure 8: Invalid option
Figure 9: Exit the application with saving option
Emergency |32456 |Mohammed Al Azri|12-11-2021 09:30|Dr. Muna Mousa |fever, cough
Routine|12345|Aii Al Abrij04-01-2022 12:00|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
Emergency 44342|Issa Ismailj13-11-2021 13:15 Dr. Muna Mousa|fever
Emergency |66563 |Ali Mousa|14-11-2021 22:45|Dr. Hisham Nazim|injury
Routine|84326 |Nuha Amur|02-12-2021 09:45|Dr. Ismail Mahmood|blood
Figure 10: "Clinice Appointments.txt" after the operations applied in Figures 3 -9.
Transcribed Image Text:Press "1" te schedule an appointment Press "2" to check appointments Press "3" to cancel an appointnent Press "4" to reschedule an appointment Press "" to exit 1> 2 Enter Patient ID: 12345 Appointment Туре Patient Patient Doctor Appointnent ID Nane Name Date Energency Routine 12345 12345 Ali AL Abri Dr. Ahmed Al Abri Ali Al Abri 12-11-2021 08:15 22-11-2021 10:30 Symptoms: fever, cold, cough Tests: blood, x-ray Dr. Ahmed Al Abri Which service do you want? Press "1" to schedule an appointnent Press "2" te check appointments Press "3" to cancel an appointnent Press "4" to reschedule an appointnent Press "e" to exit Figure 5: Check an Appointment by Patient ID (results are sorted by appointment date) 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 :> 3 Enter Patient ID: 43234 The sheduled appointment for Mariam Ali(ID#: 43234) on 24-11-2021 09:15 is cancelled. 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 :> Figure 6: Cancel an appointment Which service do you want? Press "1" to schedule an appointnent Press "2" to check appointments Press "3" to cancel an appointment Press "4" to reschedule an appointnent Which service do you want? Press "1" to schedule an appointment Press "2" to check appointnents Press "3" to cancel an appointment Press "4" to reschedule an appointment Press "*" to exit Press "" to exit Enter Patient ID: 44342 No coming appointment found for 44342. You might need to schedule a new appointment. 4 Enter Patient ID: 12345 The coming sheduled appointment for Ali Al Abri(ID#: 12345) is on 22-11-2021 10:30 Enter the Appointment New Date and Time as dd-an-yyyy hh:m: 4-1-2021 12:08 The new date and time should be after the current System time. Try again. Which service do you want? Press "1" to schedule an appointnent Press "2" to check appointnents Press "3" to cancel an appointment Press "4" to reschedule an appointnent Press "" to exit Enter the Appointment New Date and Tine as dd-an-yyyy hh:m: 4-1-2022 12:00 Appointnent has been updated. Which service do you want? Press "1" to schedule an appointment Press "2" to check appointnents Press "4" to reschedule an appointment Press "" to exit Figure 7: Reschedule an appointment (Left no future appointment found, Right update a future appointment to a future time) 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 appointnent Press "" to exit :> 5 which service do you want? Press "1" to schedule an appointnent Press "2" to check appointnents Press "3" to cancel an appointment Press "4" to reschedule an appointment Invalid choice. 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 appointnent Press "#" to exit Would you like to save (Y/N]? Y Good Bye. Have a nice day. BUILD SUCCESSFUL (total tine: 6 ninutes e seconds) Press "" to exit Figure 8: Invalid option Figure 9: Exit the application with saving option Emergency |32456 |Mohammed Al Azri|12-11-2021 09:30|Dr. Muna Mousa |fever, cough Routine|12345|Aii Al Abrij04-01-2022 12:00|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 Emergency 44342|Issa Ismailj13-11-2021 13:15 Dr. Muna Mousa|fever Emergency |66563 |Ali Mousa|14-11-2021 22:45|Dr. Hisham Nazim|injury Routine|84326 |Nuha Amur|02-12-2021 09:45|Dr. Ismail Mahmood|blood Figure 10: "Clinice Appointments.txt" after the operations applied in Figures 3 -9.
Problem:
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 |Ali Al Abri|22-11-2021 10:30|Dr. Ahmed Al Abri| blood, x-ray
Routine|32456 |Mohammed Al Azril02-12-2021 08:45 |Dr. His ham 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
Figure 1: Sample Input file "Clinic Appointments.txt"
**** 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 appointnent
Press "4" to reschedule an appointnent
Press "" to exit
Enter the type of the appointment (R)outine or (E)megency:> e
Enter Patient ID: 66563
Enter Patient Nane: 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 appointnents
Press "3" to cancel an appointment
Press "4" to reschedule an appointment
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
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
:>
Figure 4: schedule routine Appointment
Transcribed Image Text:Problem: 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 |Ali Al Abri|22-11-2021 10:30|Dr. Ahmed Al Abri| blood, x-ray Routine|32456 |Mohammed Al Azril02-12-2021 08:45 |Dr. His ham 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 Figure 1: Sample Input file "Clinic Appointments.txt" **** 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 appointnent Press "4" to reschedule an appointnent Press "" to exit Enter the type of the appointment (R)outine or (E)megency:> e Enter Patient ID: 66563 Enter Patient Nane: 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 appointnents Press "3" to cancel an appointment Press "4" to reschedule an appointment 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 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 :> Figure 4: schedule routine Appointment
Expert Solution
steps

Step by step

Solved in 2 steps with 1 images

Blurred answer
Knowledge Booster
Encryption and decryption
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education