ErxTaskRepository
public protocol ErxTaskRepository
Interface for the app to the ErxTask data layer sourcery: StreamWrapped, SkipCurrent
-
Loads the ErxTask by its id and accessCode from a remote (server).
Declaration
Swift
func loadRemote(by id: ErxTask.ID, accessCode: String?) -> AnyPublisher<ErxTask?, ErxRepositoryError>Parameters
idthe ErxTask ID
accessCodewhen nil only load from local store(s)
Return Value
Publisher for the load request
-
Loads the
ErxTaskby its id and accessCode from diskDeclaration
Swift
func loadLocal(by id: ErxTask.ID, accessCode: String?) -> AnyPublisher<ErxTask?, ErxRepositoryError>Parameters
idthe
ErxTaskIDaccessCodewhen nil only look for the
idReturn Value
Publisher for the load request
-
Load all local tasks (from disk)
Declaration
Swift
func loadLocalAll() -> AnyPublisher<[ErxTask], ErxRepositoryError>Return Value
Publisher for the load request
-
Load all ErxTasks (from remote)
Declaration
Swift
func loadRemoteAll(for locale: String?) -> AnyPublisher<[ErxTask], ErxRepositoryError>Return Value
Publisher for the load request
-
Saves an array of
ErxTasksDeclaration
Swift
func save(erxTasks: [ErxTask]) -> AnyPublisher<Bool, ErxRepositoryError>Parameters
erxTasksthe
ErxTasks to be savedReturn Value
Publisher for the load request
-
Delete an array of
ErxTasksDeclaration
Swift
func delete(erxTasks: [ErxTask]) -> AnyPublisher<Bool, ErxRepositoryError>Parameters
erxTasksthe
ErxTasks to be deletedReturn Value
Publisher for the load request
-
Set a redeem request of an
ErxTaskin the selected pharmacy Note: The response does not verify that the pharmacy has accepted the orderDeclaration
Swift
func redeem(order: ErxTaskOrder) -> AnyPublisher<ErxTaskOrder, ErxRepositoryError>Parameters
orderOrder that contains informations about the task, redeem option and the pharmacy where the task should be redeemed
Return Value
The
ErxTaskOrderthat has been redeemed -
Load All communications of the given profile
Declaration
Swift
func loadLocalCommunications( for profile: ErxTask.Communication.Profile ) -> AnyPublisher<[ErxTask.Communication], ErxRepositoryError>Parameters
profileFilters for the passed profile type
Return Value
Array of all unread loaded
ErxTaskCommunicationsorted by timestamp -
Save communications
isReadproperty to local data store.Declaration
Swift
func saveLocal(communications: [ErxTask.Communication]) -> AnyPublisher<Bool, ErxRepositoryError>Parameters
communicationscommunications where the
isReadstate should be changed. -
Updates
DiGaInfoproperty to local data store.Declaration
Swift
func updateLocal(diGaInfo: DiGaInfo) -> AnyPublisher<Bool, ErxRepositoryError>Parameters
diGaInfonew
DiGaInfothat should be updated. -
Returns a count for all unread communications for the given profile
Declaration
Swift
func countAllUnreadCommunicationsAndChargeItems( for fhirProfile: ErxTask.Communication.Profile ) -> AnyPublisher<Int, ErxRepositoryError>Parameters
profileprofile for which you want to have the count
-
Load all AuditEvent’s from a remote (server)
Declaration
Swift
func loadRemoteLatestAuditEvents(for locale: String?) -> AnyPublisher<PagedContent<[ErxAuditEvent]>, ErxRepositoryError>Return Value
AnyPublisher that emits true if loading and sing the audit events was successful. Raises a
DefaultErxTaskRepository.Errorif not -
Load one page of audit events from a remote (server) from an url previously provided by the server
Declaration
Swift
func loadRemoteAuditEventsPage(from url: URL, locale: String?) -> AnyPublisher<PagedContent<[ErxAuditEvent]>, ErxRepositoryError>Parameters
urldestination of the request
localeLocation type of the language in which the result should be returned
-
Load all ErxChargeItem’s from a remote (server).
Declaration
Swift
func loadRemoteChargeItems() -> AnyPublisher<[ErxSparseChargeItem], ErxRepositoryError>Return Value
AnyPublisher that emits an array of all
ErxChargeItemss orDefaultErxTaskRepository.Error -
Loads All consents of a given profile Uses the request headers ACCESS_TOKEN with the containing insurance id
Declaration
Swift
func fetchConsents() -> AnyPublisher<[ErxConsent], ErxRepositoryError>Return Value
Array of all loaded
ErxConsent -
Loads the
ErxChargeItemby its id from diskDeclaration
Swift
func loadLocal(by id: ErxSparseChargeItem.ID) -> AnyPublisher<ErxSparseChargeItem?, ErxRepositoryError>Parameters
idthe
ErxChargeItemIDReturn Value
Publisher for the load request
-
Load all local charge items (from disk)
Declaration
Swift
func loadLocalAll() -> AnyPublisher<[ErxSparseChargeItem], ErxRepositoryError>Return Value
Publisher for the load request
-
Saves an array of
ErxChargeItemsDeclaration
Swift
func save(chargeItems: [ErxSparseChargeItem]) -> AnyPublisher<Bool, ErxRepositoryError>Parameters
chargeItemsthe
ErxChargeItems to be savedReturn Value
Publisher for the load request
-
Delete an array of
ErxChargeItems from a remote (server) and local (disk)Declaration
Swift
func delete(chargeItems: [ErxChargeItem]) -> AnyPublisher<Bool, ErxRepositoryError>Parameters
chargeItemsthe
ErxChargeItems to be deletedReturn Value
Publisher for the load request
-
Delete an array of
ErxChargeItems from local (disk)Declaration
Swift
func deleteLocal(chargeItems: [ErxChargeItem]) -> AnyPublisher<Bool, ErxRepositoryError>Parameters
chargeItemsthe
ErxChargeItems to be deletedReturn Value
Publisher for the load request
-
Send a grant consent request of an
ErxConsentDeclaration
Swift
func grantConsent(_ consent: ErxConsent) -> AnyPublisher<ErxConsent?, ErxRepositoryError>Parameters
consentConsent that contains information about the type of consent and insurance id which the consent will be granted for
Return Value
The
ErxConsentthat was granted -
Delete an consent of
ErxConsentto revoke itDeclaration
Swift
func revokeConsent(_ category: ErxConsent.Category) -> AnyPublisher<Bool, ErxRepositoryError>Parameters
categorythe
ErxConsent.Categoryof the consent to be revokedReturn Value
Publisher for the load request
View on GitHub
ErxTaskRepository Protocol Reference