Package Singletons
Class AppointmentManager
java.lang.Object
Singletons.AppointmentManager
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
acceptAppointment
(Appointment appointment, String doctorId) Accept an appointment request Sets the status of the appointment to ACCEPTED and assigns the doctor to the appointmentvoid
add
(Appointment appointment) Add an appointment to the list of appointmentsboolean
addPrescription
(Prescription prescription) Add a new prescriptionvoid
declineAppointment
(Appointment appointment) boolean
editPrescription
(Prescription prescription) Edit an existing prescriptionGet a list of all outcomes of completed appointmentsGet a list of appointments for a given doctorgetAppointmentsByDoctorId
(String doctorId) getAppointmentsByDoctorId
(String id, Appointment.Status status) Get a list of appointments for a given doctorgetAppointmentsByPatientId
(String patientId) Get a list of appointments for a given patientGet a list of appointments with a given statusGet a list of appointments with a given filter Other filter methods use this as a basestatic AppointmentManager
getScheduleOfDoctor
(Staff doctor) Gets the schedule of a doctorGet a list of TimeSlotWithDoctor objects for a given date
Each entry in the list contains a TimeSlot object and a list of doctors available at that timeboolean
isDoctorAvailable
(String doctorId, LocalDate date, LocalTime time) Check if a doctor is available at a given date and time
Will check based on the doctor's schedule and appointments accepted by the doctorvoid
recordAppointmentOutcome
(String doctorId, Appointment appointment, AppointmentOutcomeRecord outcome, Prescription prescription) record the outcome of an appointmentvoid
remove
(Appointment appointment) Remove an appointment from the list of appointmentsvoid
setAppointments
(List<Appointment> appointments) Set the list of appointments Only meant for loading data from filevoid
setDoctorScheduleMap
(Map<String, Schedule> doctorScheduleMap) Set the map of doctor schedules Only meant for loading data from filevoid
setSchedule
(String doctorId, Schedule schedule)
-
Constructor Details
-
AppointmentManager
public AppointmentManager()
-
-
Method Details
-
getInstance
-
getDoctorScheduleMap
-
setSchedule
-
getAppointmentsWithFilter
Get a list of appointments with a given filter Other filter methods use this as a base- Parameters:
filter
- to apply to the list of appointments- Returns:
- a list of appointments that match the filter
-
getAppointmentsByPatientId
Get a list of appointments for a given patient- Parameters:
patientId
- the id of the patient- Returns:
- a list of appointments for the patient
-
getAppointmentsByDoctorId
-
getAppointmentsByStatus
Get a list of appointments with a given status- Parameters:
status
- the status of the appointments to get- Returns:
- a list of appointments with the given status
-
getAppointmentsByDoctorId
Get a list of appointments for a given doctor- Parameters:
id
- the id of the doctorstatus
- the status of the appointments to get- Returns:
- a list of appointments for the doctor with the given status
-
getAppointments
Get a list of appointments for a given doctor- Returns:
- a list of appointments for the doctor
-
add
Add an appointment to the list of appointments- Parameters:
appointment
- the appointment to add
-
remove
Remove an appointment from the list of appointments- Parameters:
appointment
- the appointment to remove
-
getScheduleOfDoctor
-
getTimeslotWithDoctorList
Get a list of TimeSlotWithDoctor objects for a given date
Each entry in the list contains a TimeSlot object and a list of doctors available at that time- Parameters:
date
- the date to get the list for- Returns:
- a list of TimeSlotWithDoctor objects
-
isDoctorAvailable
Check if a doctor is available at a given date and time
Will check based on the doctor's schedule and appointments accepted by the doctor- Parameters:
doctorId
- the id of the doctordate
- the date to checktime
- the time to check- Returns:
- true if the doctor is available, false otherwise
-
acceptAppointment
Accept an appointment request Sets the status of the appointment to ACCEPTED and assigns the doctor to the appointment- Parameters:
appointment
- the appointment to acceptdoctorId
- the id of the doctor accepting the appointment
-
declineAppointment
-
recordAppointmentOutcome
public void recordAppointmentOutcome(String doctorId, Appointment appointment, AppointmentOutcomeRecord outcome, Prescription prescription) record the outcome of an appointment- Parameters:
doctorId
- the id of the doctor recording the outcomeappointment
- the appointment to record the outcome foroutcome
- the outcome of the appointment
-
getAllOutcomes
Get a list of all outcomes of completed appointments- Returns:
- a list of all outcomes of completed appointments
-
getPrescriptionById
-
getPrescriptions
-
editPrescription
Edit an existing prescription- Parameters:
prescription
- the prescription to edit- Returns:
- true if the prescription was edited, false if the prescription does not exist
-
addPrescription
Add a new prescription- Parameters:
prescription
- the prescription to add- Returns:
- true if the prescription was added, false if the prescription already exists
-
setAppointments
Set the list of appointments Only meant for loading data from file- Parameters:
appointments
- the list of appointments to set
-
setDoctorScheduleMap
-