Skip to main content

helix.fhir.client.sdk

Project description

from typing_extensions import Optionalfrom helix_fhir_client_sdk.responses.fhir_get_response import FhirGetResponsefrom build.lib.helix_fhir_client_sdk.responses.fhir_get_response import FhirGetResponsefrom helix_fhir_client_sdk.responses.fhir_get_response import FhirGetResponse

helix.fhir.client.sdk

Continuous Integration Latest Release GitHub license

Fluent API to call the FHIR server that handles:

  1. Authentication to FHIR server
  2. Renewing access token when they expire
  3. Retry when there are transient errors
  4. Un-bundling the resources received from FHIR server
  5. Paging
  6. Streaming
  7. Logging
  8. Simulating a $graph call when the server does not support it

Usage

pip install helix.fhir.client.sdk

Documentation

https://icanbwell.github.io/helix.fhir.client.sdk/

Test Project using this

https://github.com/icanbwell/fhir-server-performance

Python Version Support

  • 1.x supports python 3.7+
  • 2.x supports python 3.10+
  • 3.x supports python 3.12+

Asynchronous Support

When communicating with FHIR servers, a lot of time is spent waiting for the server to respond. This is a good use case for using asynchronous programming. This SDK supports asynchronous programming using the async and await keywords.

The return types are Python AsyncGenerators. Python makes it very easy to work with AsyncGenerators.

For example, if the SDK provides a function like this:

async def get_resources(self) -> AsyncGenerator[FhirGetResponse, None]:
    ...

You can iterate over the results as they become available:

response: Optional[FhirGetResponse]
async for response in client.get_resources():
    print(response.resource)

Or you can get a list of responses (which will return AFTER all the responses are received:

responses: List[FhirGetResponse] = [response async for response in client.get_resources()]

Or you can aggregate the responses into one response (which will return AFTER all the responses are received:

response: Optional[FhirGetResponse] = await FhirGetResponse.from_async_generator(client.get_resources())

Data Streaming

For FHIR servers that support data streaming (e.g., b.well FHIR server), you can just set the use_data_streaming parameter to stream the data as it i received. The data will be streamed in AsyncGenerators as described above.

Project details


Release history Release notifications | RSS feed

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

helix_fhir_client_sdk-3.0.16.tar.gz (95.8 kB view details)

Uploaded Source

Built Distribution

helix.fhir.client.sdk-3.0.16-py3-none-any.whl (180.2 kB view details)

Uploaded Python 3

File details

Details for the file helix_fhir_client_sdk-3.0.16.tar.gz.

File metadata

File hashes

Hashes for helix_fhir_client_sdk-3.0.16.tar.gz
Algorithm Hash digest
SHA256 ee8d782e631c2c35a8d5826c2a95c998906c0b02df7300a4454a92f478169afe
MD5 313e45980da7d4ca4c2d8e21f8c4a792
BLAKE2b-256 2bdeac5d39b6093b75e43750cc62aa78563f270f7ba86b98e70b1a36a2bfe5b8

See more details on using hashes here.

Provenance

File details

Details for the file helix.fhir.client.sdk-3.0.16-py3-none-any.whl.

File metadata

File hashes

Hashes for helix.fhir.client.sdk-3.0.16-py3-none-any.whl
Algorithm Hash digest
SHA256 8d359bec1b63c71eebfbf0344dadeb70a2dcd55a082777852d159c828d812652
MD5 3c0e7185068c3ca43c70b73cac99bdb8
BLAKE2b-256 f1784ec4c54935a4e6948a3f8a958eb94b3e1c9006f01f6fe1268b22cad1282c

See more details on using hashes here.

Provenance

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page