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
id
the ErxTask ID
accessCode
when nil only load from local store(s)
Return Value
Publisher for the load request
-
Loads the
ErxTask
by its id and accessCode from diskDeclaration
Swift
func loadLocal(by id: ErxTask.ID, accessCode: String?) -> AnyPublisher<ErxTask?, ErxRepositoryError>
Parameters
id
the
ErxTask
IDaccessCode
when nil only look for the
id
Return 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
ErxTask
sDeclaration
Swift
func save(erxTasks: [ErxTask]) -> AnyPublisher<Bool, ErxRepositoryError>
Parameters
erxTasks
the
ErxTask
s to be savedReturn Value
Publisher for the load request
-
Delete an array of
ErxTask
sDeclaration
Swift
func delete(erxTasks: [ErxTask]) -> AnyPublisher<Bool, ErxRepositoryError>
Parameters
erxTasks
the
ErxTask
s to be deletedReturn Value
Publisher for the load request
-
Set a redeem request of an
ErxTask
in 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
order
Order that contains informations about the task, redeem option and the pharmacy where the task should be redeemed
Return Value
The
ErxTaskOrder
that has been redeemed -
Load All communications of the given profile
Declaration
Swift
func loadLocalCommunications( for profile: ErxTask.Communication.Profile ) -> AnyPublisher<[ErxTask.Communication], ErxRepositoryError>
Parameters
profile
Filters for the passed profile type
Return Value
Array of all unread loaded
ErxTaskCommunication
sorted by timestamp -
Save communications
isRead
property to local data store.Declaration
Swift
func saveLocal(communications: [ErxTask.Communication]) -> AnyPublisher<Bool, ErxRepositoryError>
Parameters
communications
communications where the
isRead
state should be changed. -
Returns a count for all unread communications for the given profile
Declaration
Swift
func countAllUnreadCommunicationsAndChargeItems( for fhirProfile: ErxTask.Communication.Profile ) -> AnyPublisher<Int, ErxRepositoryError>
Parameters
profile
profile 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.Error
if 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
url
destination of the request
locale
Location 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
ErxChargeItems
s 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
ErxChargeItem
by its id from diskDeclaration
Swift
func loadLocal(by id: ErxSparseChargeItem.ID) -> AnyPublisher<ErxSparseChargeItem?, ErxRepositoryError>
Parameters
id
the
ErxChargeItem
IDReturn 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
ErxChargeItem
sDeclaration
Swift
func save(chargeItems: [ErxSparseChargeItem]) -> AnyPublisher<Bool, ErxRepositoryError>
Parameters
chargeItems
the
ErxChargeItem
s to be savedReturn Value
Publisher for the load request
-
Delete an array of
ErxChargeItem
sDeclaration
Swift
func delete(chargeItems: [ErxChargeItem]) -> AnyPublisher<Bool, ErxRepositoryError>
Parameters
chargeItems
the
ErxChargeItem
s to be deletedReturn Value
Publisher for the load request
-
Send a grant consent request of an
ErxConsent
Declaration
Swift
func grantConsent(_ consent: ErxConsent) -> AnyPublisher<ErxConsent?, ErxRepositoryError>
Parameters
consent
Consent that contains information about the type of consent and insurance id which the consent will be granted for
Return Value
The
ErxConsent
that was granted -
Delete an consent of
ErxConsent
to revoke itDeclaration
Swift
func revokeConsent(_ category: ErxConsent.Category) -> AnyPublisher<Bool, ErxRepositoryError>
Parameters
category
the
ErxConsent.Category
of the consent to be revokedReturn Value
Publisher for the load request