Generates synthetic FHIR resources.
Project description
:fire: FHIR Kindling
CRUD library for fhir servers, with resource validation and parsing powered by the pydantic models created by fhir.resources. More details in the Documentation.
Features
- Create, Read, Update, Delete using a server's REST API
- Bundle creation, validation and data management on a FHIR server via the REST API
- Supports Hapi, Blaze and IBM FHIR servers
Installation
Install the package using pip:
pip install fhir-kindling --user
Usage
Connecting to a FHIR server
from fhir_kindling import FhirServer
# Connect with basic auth
basic_auth_server = FhirServer("https://fhir.server/fhir", username="admin", password="admin")
# Connect with static token
token_server = FhirServer("https://fhir.server/fhir", token="your_token")
# Connect using oauth2/oidc
oidc_server = FhirServer("https://fhir.server/fhir", client_id="client_id", client_secret="secret",
oidc_provider_url="url")
# Print the server's capability statement
print(basic_auth_server.capabilities)
Query resources from the server
from fhir_kindling import FhirServer
from fhir.resources.patient import Patient
# Connect using oauth2/oidc
oidc_server = FhirServer("https://fhir.server/fhir", client_id="client_id", client_secret="secret",
oidc_provider_url="url")
# query all patients on the server
query = oidc_server.query(Patient, output_format="json").all()
print(query.response)
# Query resources based on name of resource
query = oidc_server.query("Patient", output_format="json").all()
print(query.response)
Credits
This package was created with Cookiecutter and the audreyr/cookiecutter-pypackage project template.
Change Log
All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog and this project adheres to Semantic Versioning.
[0.6.0] - 2022-01-19
Query Response with included resources. Reworked Generators
Added
- Query response now stores and parses included resources
- Generator parameters for Resources and Fields
- Field generators for generating resource fields based on probabilistic choices or a generator function
- Resource generator field values based on static value or list
- Patient based data set generator
Changed
- Query interface
where, include, has
now can add query parameters based on method arguments or parameter objects.
[0.5.0] - 2021-11-12
Query Parameters, include/revinclude, reverse chaining.
Added
- Query Parameters classes, for regular queries, including resources and reverse chaining
- Support for
_include
and_revinclude
viaquery.include()
- Reverse chaining support via
query.has()
- Parsing parameters from given URL/ coverting parameters to query url
Changed
- Query interface
where, include, has
now can add query parameters based on method arguments or parameter objects.
[0.4.0] - 2021-11-12
Server summary, deleting resources, removed initial CLI.
Added
- Getting a list of all resources on the server based on capabilities
- Plots for server and resource summary
-
server.delete()
method to delete resources based on ids
[0.3.0] - 2021-10-30
Response classes, reference parsing and basic xml support
Added
XML output format and resolving xml pagination. Response objects containig resources and references
Changed
Outsourced resolving of response pagination into response classes
Fixed
[0.2.0] - 2021-09-18
FHIR server and query API
Added
Classes for fhir servers and queries. Oauth2/OIDC support.
Changed
Moved location of cli
Fixed
[0.1.0] - 2021-08-24
Initial cli
Added
Changed
Fixed
Hashing order guarantees the right index of the query.json file in the hash
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
Built Distribution
File details
Details for the file fhir_kindling-0.7.0.tar.gz
.
File metadata
- Download URL: fhir_kindling-0.7.0.tar.gz
- Upload date:
- Size: 39.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.7.1 importlib_metadata/4.10.1 pkginfo/1.8.2 requests/2.27.1 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.10
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | d7990d00ccd9f59f4ee22ffb61a765697266d7c6980f83287edd2fdfd360e6cb |
|
MD5 | 5e1cafd6f385229ee826b2d3e8c7f83e |
|
BLAKE2b-256 | a7b030efdc7337d3883766110845ad8a5046ff7f9783416316c05c192770bd5f |
File details
Details for the file fhir_kindling-0.7.0-py2.py3-none-any.whl
.
File metadata
- Download URL: fhir_kindling-0.7.0-py2.py3-none-any.whl
- Upload date:
- Size: 30.6 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.7.1 importlib_metadata/4.10.1 pkginfo/1.8.2 requests/2.27.1 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.10
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | e9fa1ae6dcff2f9fa2cb9b94dd0b3dea8b50d0ec48e8f6c2e0ee2c5fa33a5a79 |
|
MD5 | a2fd967b00e7ca0c63ae482756378528 |
|
BLAKE2b-256 | afc717eb617edabf8ad39bbca6de83ea86c3349fc9d9e56d445e631e262dc5b0 |