DefaultErxTaskRepository
public class DefaultErxTaskRepository : ErxTaskRepository
Repository for the app to the ErxTask data layer handling the syncing between its data stores.
-
ErxTaskRepository ErrorType
Declaration
Swift
public typealias ErrorType = ErxRepositoryError
-
Initialize a new ErxTaskRepository as the gateway between Presentation layer and underlying data layer(s)
Declaration
Swift
public required init( disk: ErxLocalDataStore, cloud: ErxRemoteDataStore, medicationScheduleRepository: MedicationScheduleRepository, profile: AnyPublisher<Profile, LocalStoreError> )
Parameters
disk
The data source that represents the disk/local storage
cloud
The data source that represents the cloud/remote storage
-
Declaration
Swift
public func loadRemoteLatestTasks() -> AnyPublisher<Bool, ErrorType>
-
Declaration
Swift
public func loadRemoteLatestAuditEvents(for locale: String?) -> AnyPublisher<PagedContent<[ErxAuditEvent]>, ErrorType>
-
Declaration
Swift
public func loadRemoteAuditEventsPage(from url: URL, locale: String?) -> AnyPublisher<PagedContent<[ErxAuditEvent]>, ErrorType>
-
Sends a redeem request of an
ErxTask
for the selected pharmacy Note: The response does not verify that the pharmacy has accepted the orderDeclaration
Swift
public func redeem(order: ErxTaskOrder) -> AnyPublisher<ErxTaskOrder, ErrorType>
Parameters
order
Order that contains informations about the task, redeem option and the pharmacy where the task should be redeemed
Return Value
ErxTaskOrder
if the server has received the order -
Returns a count for all unread communications for the given communication profile and for all unread ChargeItems
Declaration
Parameters
profile
Communication profile for which you want to have the count
-
Load all ErxChargeItem’s from a remote (server).
Declaration
Swift
public func loadRemoteChargeItems() -> AnyPublisher<[ErxSparseChargeItem], ErrorType>
Return Value
AnyPublisher that emits an array of all
ErxSparseChargeItem
s orDefaultErxTaskRepository.Error
-
Declaration
Swift
public func loadLocal(by id: ErxSparseChargeItem.ID) -> AnyPublisher<ErxSparseChargeItem?, ErxRepositoryError>
-
Declaration
Swift
public func loadLocalAll() -> AnyPublisher<[ErxSparseChargeItem], ErxRepositoryError>
-
Declaration
Swift
public func save(chargeItems: [ErxSparseChargeItem]) -> AnyPublisher<Bool, ErxRepositoryError>
-
Declaration
Swift
public func delete(chargeItems: [ErxChargeItem]) -> AnyPublisher<Bool, ErxRepositoryError>
-
Declaration
Swift
public func fetchConsents() -> AnyPublisher<[ErxConsent], ErrorType>
-
Declaration
Swift
public func grantConsent(_ consent: ErxConsent) -> AnyPublisher<ErxConsent?, ErrorType>
-
Declaration
Swift
public func revokeConsent(_ category: ErxConsent.Category) -> AnyPublisher<Bool, ErrorType>