trostalski / fhan

A simple client to query FHIR servers

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Fhan

Fhan is a small FHIR query client with a focus on performance and usability

from fhan.client import Client

client = Client(base_url="http://hapi.fhir.org/baseR4/", authenticate=False)
patients = client.get("Patient", count=1)
print(patients)

Installation

To get started with Fhan, install it using pip:

pip install fhan

Basic Usage

Check out the example notebooks.

After installation, you can begin using Fhan to query FHIR resources:

from fhan.client import Client

# The server is public and does not require authentication
client = Client("https://hapi.fhir.org/baseR4/", authenticate=False)

Get a Resource by id:

client.get("Condition", "39238")

Search for resources:

client.get("Observation", search_params={"code":"8310-5"}, count=20)

Features

  • Intelligent Autocomplete
  • Integrated Metadata and Package Context Management
  • SearchBuilder for Incremental Search Query Construction
  • Seamless Authentication
  • Efficient Caching Mechanism
  • Object-Oriented FHIR Resources
  • FHIR Views Integration (link)
  • ViewBuilder for Robust View Construction

Authentication

For servers that require authentication:

Copy .env.example to .env. Fill in your authentication details in the .env file. Currently, Fhan supports a limited set of authentication methods. Contributions to expand authentication support are welcome!

Other Tools

  • Fhan is using rye for managing packages.
  • Use Fhir-Views to inspect FHIR Bundles.

About

A simple client to query FHIR servers

License:MIT License


Languages

Language:Python 99.7%Language:Jinja 0.3%Language:Shell 0.0%