Skip to main content

Transform FHIR to Dataset

Project description

FHIR2Dataset

Transform FHIR to dataset for ML applications

FHIR2Dataset in Detail

This project is still under development.

This repo is a POC allowing to make a query (close to SQL format) on a FHIR API and to retrieve tabular data.

The request that FHIR2Dataset performs on a FHIR API is specified in a configuration file of this form. The purpose of this file is to perform a query whose result will be identical to the next SQL query:

SELECT (alias n°1).a, (alias n°1).b, (alias n°1).c, (alias n°2).a FROM (Resource type 1) as (alias n°1)
INNER JOIN (Resource type 2) as (alias n°2)
ON (alias n°1).d = (alias n°2)
INNER JOIN (Resource type 3) as (alias n°3)
ON (alias n°2).b = (alias n°3) WHERE (alias n°2).c = "value 1"
AND (alias n°2).d = "value 2"
AND (alias n°3).a = "value 3"
AND (alias n°3).b = "value 4"

Installation

After cloning this repository, you can install the required dependencies

pip install -r requirements.txt
npm install --prefix ./fhir2dataset/metadata

For usage, refer to this turorial and then this Jupyer Notebook

Examples

Check out examples of queries and how they are transformed in call to the FHIR api!

Contributing

The following commands on a terminal and in your virtual environment allow you to do some minimal local testing before each commit:

pip install -r requirements-dev.txt
pre-commit install

If you ever want to delete them you just have to do:

pre-commit clean

Publish

First, you need to have twine installedd

pip install --user --upgrade twine

Make sure you have bumped the version number in setup.py, then run the following:

python setup.py sdist bdist_wheel
python -m twine upload dist/*

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

fhir2dataset-0.0.9.tar.gz (1.4 MB view hashes)

Uploaded Source

Built Distribution

fhir2dataset-0.0.9-py3-none-any.whl (1.9 MB view hashes)

Uploaded Python 3

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