AppointmentService

public interface AppointmentService

AppointmentService interface to add/remove/update/find appointments

Methods

addAppointment

Appointment addAppointment(Appointment appointment)

Adds one instance of an appointment

Parameters:
  • appointment – Appointment object to add
Returns:

appointment object that is returned from the data store

addAppointments

List<Appointment> addAppointments(List<Appointment> appointments)

Add appointments for users with external id set in the appointment objects

Parameters:
  • appointments – list of appointment objects to add
Returns:

the newly added appointments

findAppointmentsByExternalId

List<Appointment> findAppointmentsByExternalId(String externalId)

Find the list of appointments for a given external id (overloaded)

Parameters:
  • externalId – external id related to the implementation
Returns:

List of appointments that belong to the external id

findAppointmentsByExternalId

List<Appointment> findAppointmentsByExternalId(String externalId, AppointmentStatus status)

Find visit for given user identifier (external id) and appointment status (overloaded)

Parameters:
  • externalId – external id related to the implementation
  • status – status of the appointment to filter on
Returns:

List of appointments that belong to the external id, filtered by status

getAppointment

Appointment getAppointment(String appointmentId)

Get the appointment for the Appointment Id

Parameters:
  • appointmentId – Appointment to search for
Returns:

Appointment object for id

removeAppointment

void removeAppointment(String appointmentId)

Remove a given appointment from the store

Parameters:
  • appointmentId – Appointment to remove
Throws:

removeAppointments

void removeAppointments(List<String> appointmentId)

Removes all appointments and reminders for given user (identified by externalId)

Parameters:
  • appointmentId – list of appointments to remove
Throws:

toggleReminders

void toggleReminders(String externalId, boolean sendReminders)

Toggle the reminders for a user with external id. True == send reminders for patient (externalId), false == stop reminders for patient

Parameters:
  • externalId – External id of the user
  • sendReminders – boolean flag to start or stop reminders based on the appointment interval field
Throws:

updateAppointment

Appointment updateAppointment(Appointment appointment)

Update the appointment object in the store

Parameters:
  • appointment – Appointment object to update
Throws:
Returns:

updated Appointment object to return

updateAppointments

List<Appointment> updateAppointments(List<Appointment> appointments)

Updates the list of appointments

Parameters:
  • appointments – List of appointment objects
Throws:
Returns:

Updated list of appointments