ErxLocalDataStore
public protocol ErxLocalDataStore
Interface for the local data store
-
Fetch the ErxTask by its id and accessCode when required by
SelfDeclaration
Swift
func fetchTask(by id: ErxTask.ID, accessCode: String?) -> AnyPublisher<ErxTask?, LocalStoreError>Parameters
idthe ErxTask ID
accessCodeAccessCode, optional as required by implementing DataStore
Return Value
Publisher for the fetch request
-
List all tasks contained in the store
Declaration
Swift
func listAllTasks() -> AnyPublisher<[ErxTask], LocalStoreError> -
Fetch the most recent
lastModifiedof allErxTasksDeclaration
Swift
func fetchLatestLastModifiedForErxTasks() -> AnyPublisher<String?, LocalStoreError> -
Creates or updates a sequence of tasks into the store
Declaration
Swift
func save(tasks: [ErxTask], updateProfileLastAuthenticated: Bool) -> AnyPublisher<Bool, LocalStoreError>Parameters
tasksArray of
ErxTaskss that should be savedupdateProfileLastAuthenticatedtrueif the profile last authenticated should be updated,falseotherwise.Return Value
A publisher that finishes with
trueon completion or fails with an error. -
Deletes a sequence of tasks from the store
Declaration
Swift
func delete(tasks: [ErxTask]) -> AnyPublisher<Bool, LocalStoreError> -
List all tasks without relationship to a
ProfileDeclaration
Swift
func listAllTasksWithoutProfile() -> AnyPublisher<[ErxTask], LocalStoreError>
-
List all communications for the given profile contained in the store
Declaration
Swift
func listAllCommunications( for profile: ErxTask.Communication.Profile ) -> AnyPublisher<[ErxTask.Communication], LocalStoreError>Parameters
profileFilters for the passed Profile type
Return Value
array of the fetched communications or error
-
Fetch the most recent
timestampof allCommunicationsDeclaration
Swift
func fetchLatestTimestampForCommunications() -> AnyPublisher<String?, LocalStoreError> -
Creates or updates the passes sequence of
ErxTaskCommunicationsDeclaration
Swift
func save(communications: [ErxTask.Communication]) -> AnyPublisher<Bool, LocalStoreError>Parameters
communicationsArray of communications that should be stored
Return Value
trueif save operation was successful -
Returns all unread communications for the given profile
Declaration
Swift
func allUnreadCommunications( for profile: ErxTask.Communication.Profile ) -> AnyPublisher<[ErxTask.Communication], LocalStoreError>Parameters
profileprofile for which you want to have the count
-
List all medication dispenses contained in the store
Declaration
Swift
func listAllMedicationDispenses() -> AnyPublisher<[ErxMedicationDispense], LocalStoreError> -
Creates or updates the passed sequence of
ErxTask.MedicationDispensesDeclaration
Swift
func save(medicationDispenses: [ErxMedicationDispense]) -> AnyPublisher<Bool, LocalStoreError>Parameters
medicationDispensesArray of medication dispenses that should be stored
Return Value
trueif save operation was successful
-
Fetch the ErxChargeItem by its id when required by
SelfDeclaration
Swift
func fetchChargeItem( by chargeItemID: ErxSparseChargeItem.ID ) -> AnyPublisher<ErxSparseChargeItem?, LocalStoreError>Parameters
idthe ErxChargeItem ID
Return Value
Publisher for the fetch request
-
Fetch the most recent
enteredDateof allChargeItemsDeclaration
Swift
func fetchLatestTimestampForChargeItems() -> AnyPublisher<String?, LocalStoreError> -
List all charge items with the given local contained in the store
Declaration
Swift
func listAllChargeItems() -> AnyPublisher<[ErxSparseChargeItem], LocalStoreError>Return Value
Array of the fetched charge items or error
-
Creates or updates the passed sequence of
ErxSparseChargeItemsDeclaration
Swift
func save(chargeItems: [ErxSparseChargeItem]) -> AnyPublisher<Bool, LocalStoreError>Parameters
chargeItemsArray of charge items that should be stored
Return Value
trueif save operation was successful -
Deletes a sequence of charge items from the store
Declaration
Swift
func delete(chargeItems: [ErxSparseChargeItem]) -> AnyPublisher<Bool, LocalStoreError>Parameters
chargeItemsArray of charge items that should be deleted
Return Value
trueif delete operation was successful -
Creates or updates the passed sequence of
DiGaInfoDeclaration
Swift
func update(diGaInfo: DiGaInfo) -> AnyPublisher<Bool, LocalStoreError>Parameters
diGaInfodiGaInfo that should be saved
Return Value
trueif save operation was successful
View on GitHub
ErxLocalDataStore Protocol Reference