MedicationScheduleStore

public protocol MedicationScheduleStore

Protocol for storing MedicationSchedules.

  • Fetch any MedicationSchedule by provided TaskId

    Declaration

    Swift

    func fetch(by taskID: ErxTask.ID) throws -> MedicationSchedule?

    Parameters

    taskID

    TaskID the medication Schedule is for

    Return Value

    The according MedicationSchedule if there is any for the given TaskID.

  • Fetch MedicationSchedule and ErxTask by provided MedicationSchedule.Entry.id

    Declaration

    Swift

    func fetch(byEntryId entryId: UUID, dateProvider: @escaping () -> Date) throws
        -> MedicationScheduleFetchByEntryIdResponse
  • Fetches and returns all available Medication Schedules.

    Declaration

    Swift

    func fetchAll() throws -> [MedicationSchedule]

    Return Value

    A list of all available Medication Schedules.

  • Save the given MedicationSchedules. Overwrites any existing MedicationSchedule.

    Declaration

    Swift

    func save(medicationSchedules: [MedicationSchedule]) throws -> [MedicationSchedule]

    Parameters

    medicationSchedules

    List of MedicationSchedules to save.

    Return Value

    The saved list of MedicationSchedules.

  • Delete the given MedicationSchedules.

    Declaration

    Swift

    func delete(medicationSchedules: [MedicationSchedule]) throws

    Parameters

    medicationSchedules

    The list of MedicationSchedules do delete.