Metadata-Version: 2.1
Name: fhan
Version: 0.1.10
Summary: Add your description here
Author-email: Till Rostalski <tillrostalski@gmail.com>
License-File: LICENSE
Requires-Python: >=3.8
Requires-Dist: cachetools>=5.3.1
Requires-Dist: click>=8.1.7
Requires-Dist: dacite>=1.8.1
Requires-Dist: fhirpathpy>=0.2.2
Requires-Dist: flake8>=5.0.4
Requires-Dist: jinja2>=3.1.2
Requires-Dist: pandas>=2.0.3
Requires-Dist: python-dotenv>=1.0.0
Requires-Dist: requests>=2.31.0
Requires-Dist: stringcase>=1.2.0
Description-Content-Type: text/markdown

# Fhan

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="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:

```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://hapi.fhir.org/baseR4/", authenticate=False)
```

Get a Resource by id:

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

Search for resources:

```python
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](https://build.fhir.org/ig/FHIR/sql-on-fhir-v2/))
- `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](https://github.com/mitsuhiko/rye) for managing packages.
- Use [Fhir-Views](https://fhir-views.vercel.app/) to inspect FHIR Bundles.
