Skip to main content

Toolkit to handle FHIR Resources in a more efficient, pythonic way.

Project description

# FHIRkit

[![PyPI version](https://badge.fury.io/py/FHIRkit.svg)](https://badge.fury.io/py/FHIRkit)

Handle FHIR resources in a more efficient, and pythonic way

## Why FHIRKit

FHIRKit is a wrapper around [Pydantic](https://github.com/samuelcolvin/pydantic) that will help you parse FHIR JSON data. It comes with some utility functions to display resources 👀 and validate codes in those resources ✅.

After implementing calls to terminology servers over and over again 😥, we realized that Python developpers and data scientists want code like this:

`python target_code = SCTCoding(code="298364001") vs = target_code.descendants() # create a valueset by retrieving all descendants of a SNOMED-CT code obs = Observation.parse_file("my_observation.json") assert obs.code in vs, f"Observation has an invalid code={obs.code}, please provide a {target_code}" # # AssertionError # Observation has an invalid code="55406008 | Hyperalgesia |", please provide a "298364001 | Finding of head region |" `

Calls to terminology servers are handled for you and boilerplate code is reduced to simple Python operations 🎉.

The goals of this package in a nutshell:

  • Parse FHIR/JSON(https://build.fhir.org/json.html) resources using predefined Pydantic models. These models automatically handle all inconveniences like [choice data types](https://www.hl7.org/fhir/formats.html#choice)s and datetime parsing for you.

  • Perform validations and lookups for code, coding, CodeableConcept elements and expand ValueSets resources in a _pythonic_ way.

  • Make FHIR Resources and FHIR Elements readable when printing them in the command-line or displaying them in a Jupyter Notebook. FHIRkit has some handy defaults for __str__ `, `__repr__ and __repr_html__ that take care of your development and debug experience. No huge nested dicts in your terminal or notebook.

  • Turn a bunch of FHIR resources with the same type in a [FHIR DataFrame](https://github.com/Tiro-health/fhir-dataframes) _(still under development)_

Project details


Download files

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

Source Distribution

FHIRkit-0.1.2.tar.gz (594.8 kB view details)

Uploaded Source

File details

Details for the file FHIRkit-0.1.2.tar.gz.

File metadata

  • Download URL: FHIRkit-0.1.2.tar.gz
  • Upload date:
  • Size: 594.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.16

File hashes

Hashes for FHIRkit-0.1.2.tar.gz
Algorithm Hash digest
SHA256 0de38fd86d30cc8d538806a6ccffcc846e34e246b8434ac96a66b7e25d92c342
MD5 4cfdc1bf57d3179af322f7cf66d3919b
BLAKE2b-256 266f29d09257ffedc6b14ba5d94d8673b665dc48e851b89a14afd7a6af3e22d0

See more details on using hashes here.

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