ErxRemoteDataStore

public protocol ErxRemoteDataStore

Interface for the remote data store

  • Fetch the ErxTask by its id and accessCode when required by Self

    Declaration

    Swift

    func fetchTask(by id: ErxTask.ID, accessCode: String?)
        -> AnyPublisher<ErxTask?, RemoteStoreError>

    Parameters

    id

    the ErxTask ID

    accessCode

    AccessCode, 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

    referenceDate

    Tasks with modification date greater or equal referenceDate will be listed. Pass nil for listing all

  • List the next page of a previous received PagedContent.

    Declaration

    Swift

    func listTasksNextPage(of previousPage: PagedContent<[ErxTask]>)
        -> AnyPublisher<PagedContent<[ErxTask]>, RemoteStoreError>

    Parameters

    previousPage

    The previous page of the content to retrieve

  • Deletes a sequence of tasks from the store

    Declaration

    Swift

    func delete(tasks: [ErxTask]) -> AnyPublisher<Bool, RemoteStoreError>
  • Sends a redeem request of an ErxTask for the selected pharmacy Note: The response does not verify that the pharmacy has accepted the order

    Declaration

    Swift

    func redeem(order: ErxTaskOrder) -> AnyPublisher<ErxTaskOrder, RemoteStoreError>

    Parameters

    order

    Order 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

    referenceDate

    Communications with modification date great or equal referenceDate will be listed. Pass nil for listing all

    profile

    Filters for the passed Profile type

  • Fetch the ErxAuditEvent by its id when required by Self

    Declaration

    Swift

    func fetchAuditEvent(by id: ErxAuditEvent.ID)
        -> AnyPublisher<ErxAuditEvent?, RemoteStoreError>

    Parameters

    id

    the 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

    referenceDate

    AuditEvents with modification date great or equal referenceDate will be listed. Pass nil for listing all

    locale

    Location 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

    url

    destination of the request

    locale

    Location type of the language in which the result should be returned

  • List all medication dispenses for a specific Prescription / ErxTask

    Declaration

    Swift

    func listMedicationDispenses(
        for id: ErxTask.ID
    ) -> AnyPublisher<[ErxMedicationDispense], RemoteStoreError>

    Parameters

    id

    MedicationDispense for the corresponding ErxTask.ID will be fetched.

    Return Value

    MedicationDispenses

  • Fetch the ErxChargeItem by its id when required by Self

    Declaration

    Swift

    func fetchChargeItem(by id: ErxChargeItem.ID)
        -> AnyPublisher<ErxChargeItem?, RemoteStoreError>

    Parameters

    id

    the 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

    referenceDate

    ChargeItems with entered date great or equal referenceDate will be listed. Pass nil for listing all

    Return 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 ErxConsent

    Declaration

    Swift

    func grantConsent(_ consent: ErxConsent) -> AnyPublisher<ErxConsent?, RemoteStoreError>

    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 it

    Declaration

    Swift

    func revokeConsent(_ category: ErxConsent.Category) -> AnyPublisher<Bool, RemoteStoreError>

    Parameters

    category

    the ErxConsent.Categoryof the consent to be revoked

    Return Value

    Publisher for the load request