https://github.com/trostalski/fhan
A simple client to query FHIR servers
https://github.com/trostalski/fhan
data fhir fhir-client healthcare interoperability
Last synced: 5 months ago
JSON representation
A simple client to query FHIR servers
- Host: GitHub
- URL: https://github.com/trostalski/fhan
- Owner: trostalski
- License: mit
- Created: 2023-09-19T19:05:59.000Z (almost 3 years ago)
- Default Branch: main
- Last Pushed: 2024-10-17T13:55:26.000Z (over 1 year ago)
- Last Synced: 2024-10-20T14:59:21.795Z (over 1 year ago)
- Topics: data, fhir, fhir-client, healthcare, interoperability
- Language: Python
- Homepage:
- Size: 2.66 MB
- Stars: 5
- Watchers: 1
- Forks: 2
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Fhan
**At least Python 3.10 is required**
Fhan is a small [FHIR](https://www.hl7.org/fhir/overview.html) query client with a focus on performance and usability.
```python
from fhan.client import Client
client = Client(base_url="https://demo.kodjin.com/fhir", authenticate=False)
patients = client.get("Patient", count=1)
print(patients)
```
## Installation
To get started with Fhan, install it using pip:
```shell
pip install fhan
```
## Basic Usage
**Check out the [example notebooks](./examples).**
After installation, you can begin using Fhan to query FHIR resources:
```python
from fhan.client import Client
# The server is public and does not require authentication
client = Client("https://demo.kodjin.com/fhir/Condition", authenticate=False)
```
Get a Resource by id:
```python
client.get("Condition", "13b810dc-58d5-42e3-b34f-5e2454401561")
```
Search for resources:
```python
client.get("Observation", search_params={"code":"249227004"}, count=20)
```
## 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!
## Tools
- [fhirmodels](https://github.com/trostalski/fhirmodels/tree/main) for python fhir objects.
- [Fhir-Views](https://fhir-views.vercel.app/) to inspect FHIR Bundles.