Package Controllers.AMManagers
Class PatientAM
java.lang.Object
Controllers.AMManagers.PatientAM
The
PatientAM
class manages appointment-related functionalities for patients.
It provides methods to retrieve doctor information, check appointment availability,
and manage appointment slots.-
Constructor Summary
ConstructorsConstructorDescriptionPatientAM
(String id, AccountDatabase accountDatabase) Constructs aPatientAM
with the specified patient ID and account database. -
Method Summary
Modifier and TypeMethodDescriptionboolean
cancelSlot
(String appointmentId) Cancels an appointment slot by its ID.boolean
checkDoctor
(String id) Checks if a doctor exists in the database by their ID.boolean
checkSlotAvailable
(String appointmentId) Checks whether a specific appointment slot is available.boolean
checkSlotCancellable
(String appointmentId) Checks whether a specific appointment slot can be canceled by this patient.Retrieves all appointments associated with this patient across all doctors.Retrieves available appointment slots for a specific doctor by their ID.Returns the list of doctors available to the patient.Retrieves the schedule for a specific doctor by their ID.Retrieves all appointment slots for a specific doctor by their ID.boolean
requestSlot
(String appointmentId) Requests an appointment slot by its ID.
-
Constructor Details
-
PatientAM
Constructs aPatientAM
with the specified patient ID and account database.- Parameters:
id
- the unique identifier of the patientaccountDatabase
- theAccountDatabase
used to manage accounts
-
-
Method Details
-
getDocList
Returns the list of doctors available to the patient.- Returns:
- a list of
Account
objects representing doctors
-
checkDoctor
Checks if a doctor exists in the database by their ID.- Parameters:
id
- the unique identifier of the doctor- Returns:
- true if the doctor exists; false otherwise
-
getDoctorSchedule
Retrieves the schedule for a specific doctor by their ID.- Parameters:
id
- the unique identifier of the doctor- Returns:
- a
DoctorSchedule
object if found; null otherwise
-
getAvailableSlots
Retrieves available appointment slots for a specific doctor by their ID.- Parameters:
id
- the unique identifier of the doctor- Returns:
- a list of available
AppointmentSlot
objects; null if no schedule found
-
getSlots
Retrieves all appointment slots for a specific doctor by their ID.- Parameters:
id
- the unique identifier of the doctor- Returns:
- a list of all
AppointmentSlot
objects; null if no schedule found
-
cancelSlot
Cancels an appointment slot by its ID.- Parameters:
appointmentId
- the unique identifier of the appointment to cancel- Returns:
- true if the slot was successfully canceled; false otherwise
-
requestSlot
Requests an appointment slot by its ID.- Parameters:
appointmentId
- the unique identifier of the appointment to request- Returns:
- true if the slot was successfully requested; false otherwise
-
getAppointments
Retrieves all appointments associated with this patient across all doctors.- Returns:
- a list of
AppointmentSlot
objects representing this patient's appointments
-
checkSlotAvailable
Checks whether a specific appointment slot is available.- Parameters:
appointmentId
- the unique identifier of the appointment to check availability for- Returns:
- true if the slot is available; false otherwise
-
checkSlotCancellable
Checks whether a specific appointment slot can be canceled by this patient.- Parameters:
appointmentId
- the unique identifier of the appointment to check cancelability for- Returns:
- true if the slot can be canceled; false otherwise
-