FHIRClient
extension FHIRClient
-
Convenience function for requesting a certain task by ID
Declaration
Swift
public func fetchTask(by id: ErxTask.ID, accessCode: String?) -> AnyPublisher<ErxTask?, FHIRClient.Error>Parameters
idThe ID of the task to be requested
accessCodecode to access the given
idor nil when not required due to (previous|other) authorizationReturn Value
AnyPublisherthat emits the task or nil when not found -
Convenience function for requesting all tasks
Note
the simplifier (and the gematik specification) documentation is not clear as how to handle multiple tasks in one bundle/requests
Declaration
Swift
public func fetchAllTasks(after referenceDate: String?) -> AnyPublisher<PagedContent<[ErxTask]>, FHIRClient.Error>Parameters
referenceDateTasks with modification date greater or equal
referenceDatewill be fetchedReturn Value
AnyPublisherthat emits all sparse tasks -
Convenience function for requesting all tasks of a next page from a previous page.
Declaration
Swift
public func fetchTasksNextPage(for url: URL?) -> AnyPublisher<PagedContent<[ErxTask]>, FHIRClient.Error>Parameters
previousPageThe previous page retrieved from the service
-
Convenience function for deleting a task
Declaration
Swift
public func deleteTask(by id: ErxTask.ID, accessCode: String?) -> AnyPublisher<Bool, FHIRClient.Error>Parameters
idThe ID of the task to be requested
accessCodecode to access the given
idor nil when not required due to (previous|other) authorizationReturn Value
AnyPublisherthat emits the task or nil when not found -
Convenience function for requesting a certain audit event by ID
Declaration
Swift
public func fetchAuditEvent(by id: ErxAuditEvent.ID) -> AnyPublisher<ErxAuditEvent?, FHIRClient.Error>Parameters
idThe ID of the audit event to be requested
accessCodecode to access the given
idor nil when not required due to (previous|other) authorizationReturn Value
AnyPublisherthat emits the audit event or nil when not found -
Convenience function for requesting audit events
Declaration
Swift
public func fetchAllAuditEvents( after referenceDate: String? = nil, for locale: String? = nil ) -> AnyPublisher<PagedContent<[ErxAuditEvent]>, FHIRClient.Error>Parameters
referenceDateAudit-Events with date greater or equal
referenceDatewill be fetched. Passnilfor fetching all audit eventslocaleLocale key for which language the audit events will be fetched. Nil if all languages should be fetched
Return Value
AnyPublisherthat emits the audit events -
Convenience function for requesting audit events
Declaration
Swift
public func fetchAuditEventsNextPage(from url: URL, locale: String?) -> AnyPublisher<PagedContent<[ErxAuditEvent]>, FHIRClient.Error>Parameters
urlLink to load next page
localeLocation type of the language in which the result should be returned
Return Value
AnyPublisherthat emits the audit events -
Convenience function for redeeming an
ErxTaskin a pharmacyDeclaration
Swift
public func redeem(order: ErxTaskOrder) -> AnyPublisher<ErxTaskOrder, FHIRClient.Error>Parameters
orderThe information relevant for placing the order
Return Value
trueif the server responds without error and parsing has been successful, otherwise error -
Requests all communication Resources for the logged in user
[REQ:gemSpec_eRp_FdV:A_19984] validate pharmacy data format conforming to FHIR
Declaration
Swift
public func communicationResources( after referenceDate: String? ) -> AnyPublisher<[ErxTask.Communication], FHIRClient.Error>Parameters
referenceDateCommunications with
timestampgreater or equalreferenceDatewill be fetchedReturn Value
Array of all loaded communication resources
-
Requests medication dispenses for a specific
PrescriptionDeclaration
Swift
public func fetchMedicationDispenses( for id: ErxTask.ID ) -> AnyPublisher<[ErxMedicationDispense], FHIRClient.Error>Parameters
idMedicationDispense for the corresponding
ErxTask.IDwill be fetched.Return Value
AnyPublisherthat emitsMedicationDispenses -
Convenience function for requesting a certain charge item by ID
Declaration
Swift
public func fetchChargeItem(by id: ErxChargeItem.ID) -> AnyPublisher<ErxChargeItem?, FHIRClient.Error>Parameters
idThe ID of the charge item to be requested
Return Value
AnyPublisherthat emits the charge item or nil when not found -
Convenience function for requesting all charge item ids
Declaration
Swift
public func fetchAllChargeItemIDs(after referenceDate: String?) -> AnyPublisher<[String], FHIRClient.Error>Parameters
referenceDateCharge items with entered date greater or equal
referenceDatewill be fetchedReturn Value
AnyPublisherthat emits the ids for the found charge items -
Convenience function for deleting a charge item
Declaration
Swift
public func deleteChargeItem( by id: ErxChargeItem.ID, accessCode: String? ) -> AnyPublisher<Bool, FHIRClient.Error>Parameters
idThe ID of the charge item to be deleted
accessCodecode to access the given
idor nil when not required due to (previous/other) authorisationReturn Value
AnyPublisherthat emits true if the item was deleted -
Loads All consents of a given profile Uses the request headers ACCESS_TOKEN with the containing insurance id
Declaration
Swift
public func fetchConsents() -> AnyPublisher<[ErxConsent], FHIRClient.Error>Return Value
Array of all loaded
ErxConsent -
Send a grant consent request of an
ErxConsentDeclaration
Swift
public func grantConsent(_ consent: ErxConsent) -> AnyPublisher<ErxConsent?, FHIRClient.Error>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 or nil when not found -
Delete an consent of
ErxConsentto revoke itDeclaration
Swift
public func revokeConsent(_ category: ErxConsent.Category) -> AnyPublisher<Bool, FHIRClient.Error>Parameters
categorythe
ErxConsent.Categoryof the consent to be revokedReturn Value
Publisher for the load request
View on GitHub
FHIRClient Extension Reference