Package Common
Class AppointmentOutcomeManager
java.lang.Object
Common.AppointmentOutcomeManager
- Direct Known Subclasses:
AdminAOM
,DoctorAOM
,PatientAOM
,PharmaAOM
The
AppointmentOutcomeManager
class provides functionalities for managing
appointment outcomes. It allows adding, removing, and retrieving appointment outcomes
from the associated AppointmentOutcomeDatabase
.-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionConstructs anAppointmentOutcomeManager
with the specified database. -
Method Summary
Modifier and TypeMethodDescriptionboolean
addOutcome
(AppointmentOutcome outcome, DoctorSchedule schedule) Adds a new appointment outcome to the database if it does not already exist.Retrieves all appointment outcomes from the database.getOutcome
(String appointmentID) Retrieves an appointment outcome by its unique identifier.boolean
removeOutcome
(String appointmentID) Removes an appointment outcome from the database by its unique identifier.
-
Field Details
-
database
-
-
Constructor Details
-
AppointmentOutcomeManager
Constructs anAppointmentOutcomeManager
with the specified database.- Parameters:
database
- theAppointmentOutcomeDatabase
used to manage appointment outcomes
-
-
Method Details
-
addOutcome
Adds a new appointment outcome to the database if it does not already exist.- Parameters:
outcome
- theAppointmentOutcome
to be addedschedule
- theDoctorSchedule
associated with the appointment- Returns:
- true if the outcome was added successfully; false if it already exists or the schedule is invalid
-
removeOutcome
Removes an appointment outcome from the database by its unique identifier.- Parameters:
appointmentID
- the unique identifier of the appointment outcome to be removed- Returns:
- true if the outcome was successfully removed; false otherwise
-
getOutcome
Retrieves an appointment outcome by its unique identifier.- Parameters:
appointmentID
- the unique identifier of the appointment outcome to retrieve- Returns:
- the
AppointmentOutcome
object if found; otherwise, returns null
-
getAllOutcomes
Retrieves all appointment outcomes from the database.- Returns:
- a list of all
AppointmentOutcome
objects in the database
-