MedicationScheduleStore
public protocol MedicationScheduleStore
Protocol for storing MedicationSchedule
s.
-
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
andErxTask
by providedMedicationSchedule.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
MedicationSchedule
s. Overwrites any existingMedicationSchedule
.Declaration
Swift
func save(medicationSchedules: [MedicationSchedule]) throws -> [MedicationSchedule]
Parameters
medicationSchedules
List of
MedicationSchedule
s to save.Return Value
The saved list of
MedicationSchedule
s. -
Delete the given
MedicationSchedule
s.Declaration
Swift
func delete(medicationSchedules: [MedicationSchedule]) throws
Parameters
medicationSchedules
The list of
MedicationSchedule
s do delete.