FHIRClient

extension FHIRClient
  • Convenience function for searching for pharmacies

    [REQ:gemSpec_eRp_FdV:A_19984] validate pharmacy data format conforming to FHIR

    Declaration

    Swift

    public func searchPharmacies(
        by searchTerm: String,
        position: Position?,
        filter: [String: String],
        accessToken: String? = nil
    ) -> AnyPublisher<[PharmacyLocation], FHIRClient.Error>

    Parameters

    searchTerm

    String that send to the server for filtering the pharmacies response

    position

    Position (latitude and longitude) of pharmacy

    filter

    further filter parameters for pharmacies

    accessToken

    access token to interact with the service

    Return Value

    AnyPublisher that emits all PharmacyLocations for the given searchTerm

  • Convenience function for requesting a certain pharmacy by ID

    Declaration

    Swift

    public func fetchPharmacy(
        by telematikId: String,
        accessToken: String? = nil
    ) -> AnyPublisher<PharmacyLocation?, Error>

    Parameters

    telematikId

    The Telematik-ID of the pharmacy to be requested

    accessToken

    access token to interact with the service

    Return Value

    AnyPublisher that emits the PharmacyLocation or nil when not found

  • Convenience function for requesting the certificates of a pharmacy

    Declaration

    Swift

    public func loadAvsCertificates(for locationId: String) -> AnyPublisher<[X509], Error>

    Parameters

    locationId

    The id of the pharmacy to be requested

    Return Value

    AnyPublisher that emits an array of X509 certificates