ErxRemoteDataStore
public protocol ErxRemoteDataStore
Interface for the remote 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?, RemoteStoreError>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(after referenceDate: String?) -> AnyPublisher<PagedContent<[ErxTask]>, RemoteStoreError>Parameters
referenceDateTasks with modification date greater or equal
referenceDatewill be listed. Passnilfor listing all -
List the next page of a previous received PagedContent.
Declaration
Swift
func listTasksNextPage(of previousPage: PagedContent<[ErxTask]>) -> AnyPublisher<PagedContent<[ErxTask]>, RemoteStoreError>Parameters
previousPageThe previous page of the content to retrieve
-
List detailed tasks with all available information in the store
Declaration
Swift
func listDetailedTasks(for tasks: PagedContent<[ErxTask]>) -> AnyPublisher<PagedContent<[ErxTask]>, RemoteStoreError>Parameters
tasksThe low detail tasks
-
Deletes a sequence of tasks from the store
Declaration
Swift
func delete(tasks: [ErxTask]) -> AnyPublisher<Bool, RemoteStoreError> -
Sends a redeem request of an
ErxTaskfor the selected pharmacy Note: The response does not verify that the pharmacy has accepted the orderDeclaration
Swift
func redeem(order: ErxTaskOrder) -> AnyPublisher<ErxTaskOrder, RemoteStoreError>Parameters
orderOrder that contains informations about the task, redeem option and the pharmacy where the task should be redeemed
Return Value
The order that has been redeemed
-
Load All communications of the given profile
Declaration
Swift
func listAllCommunications( after referenceDate: String?, for profile: ErxTask.Communication.Profile ) -> AnyPublisher<[ErxTask.Communication], RemoteStoreError>Parameters
referenceDateCommunications with modification date great or equalreferenceDatewill be listed. Passnilfor listing allprofileFilters for the passed Profile type
-
Fetch the ErxAuditEvent by its id when required by
SelfDeclaration
Swift
func fetchAuditEvent(by id: ErxAuditEvent.ID) -> AnyPublisher<ErxAuditEvent?, RemoteStoreError>Parameters
idthe ErxAuditEvent ID
Return Value
Publisher for the fetch request
-
List all audit events contained in the store
Declaration
Swift
func listAllAuditEvents(after referenceDate: String?, for locale: String?) -> AnyPublisher<PagedContent<[ErxAuditEvent]>, RemoteStoreError>Parameters
referenceDateAuditEvents with modification date great or equalreferenceDatewill be listed. Passnilfor listing alllocaleLocation type of the language in which the result should be returned
-
List all audit events contained in the store
Declaration
Swift
func listAuditEventsNextPage(from url: URL, locale: String?) -> AnyPublisher<PagedContent<[ErxAuditEvent]>, RemoteStoreError>Parameters
urldestination of the request
localeLocation type of the language in which the result should be returned
-
List all medication dispenses for a specific
Prescription/ErxTaskDeclaration
Swift
func listMedicationDispenses( for id: ErxTask.ID ) -> AnyPublisher<[ErxMedicationDispense], RemoteStoreError>Parameters
idMedicationDispense for the corresponding
ErxTask.IDwill be fetched.Return Value
MedicationDispenses -
Fetch the ErxChargeItem by its id when required by
SelfDeclaration
Swift
func fetchChargeItem(by id: ErxChargeItem.ID) -> AnyPublisher<ErxChargeItem?, RemoteStoreError>Parameters
idthe ErxChargeIem ID
Return Value
Publisher for the fetch request
-
List all charge items contained in the store
Declaration
Swift
func listAllChargeItems(after referenceDate: String?) -> AnyPublisher<[ErxChargeItem], RemoteStoreError>Parameters
referenceDateChargeItems with entered date great or equalreferenceDatewill be listed. Passnilfor listing allReturn Value
Publisher for the fetch request
-
Deletes a sequence of charge items from the store
Declaration
Swift
func delete(chargeItems: [ErxChargeItem]) -> AnyPublisher<Bool, RemoteStoreError> -
Loads All consents of a given profile Uses the request headers ACCESS_TOKEN with the containing insurance id
Declaration
Swift
func fetchConsents() -> AnyPublisher<[ErxConsent], RemoteStoreError>Return Value
Array of all loaded
ErxConsent -
Send a grant consent request of an
ErxConsentDeclaration
Swift
func grantConsent(_ consent: ErxConsent) -> AnyPublisher<ErxConsent?, RemoteStoreError>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, RemoteStoreError>Parameters
categorythe
ErxConsent.Categoryof the consent to be revokedReturn Value
Publisher for the load request
View on GitHub
ErxRemoteDataStore Protocol Reference