Giter Club home page Giter Club logo

pht_on_fhir_demo's Introduction

Personal Health Train on FHIR demo

Welcome to the Personal Health Train on FHIR demo. In this demo, we want to show how the Personal Health Train and FHIR can work together.

tl/dr: see control/pht_execution_notebook.ipynb to run the PHT cohort counter.

The basic technical essence of the Personal Health Train is to use computational resources at the data source. This means:

  • we can calculate information at the source
  • we don't have to transfer data for calculation purposes, hence preserving patients' privacy
  • we are able to support different data representation and query standards, as applications/calculations at the source can perform the conversion/transformation.

This repository is structured into two different folders:

  • the application (in the train folder)
  • the control post for trains (in the control folder)

Train specifications

The train (application) is described in the train folder. The main script in here is run.py, which reads environment variables indicating the endpoint type, URL and optional token. Based on the endpoint type, it selects the FHIR or SPARQL script and included query protocol. Finally, it will report the results in a text file (output.txt).

FHIR query file

The FHIR endpoint is queried for all patients having Diabetes (all types), this code is available in fhir.py. Based on the FHIR endpoint result, the number of patients are counted, and the mean age in this cohort calculated.

SPARQL query file

The sparql query file (sparql.py) contains a sparql query, which is being executed on the given endpoint URL. This query identifies patients with rectal cancer (ICD code C20) and requests the age at diagnosis. Afterwards, the number of patients (rows) are counted, and the mean age in this cohort calculated.

Make a train using docker

The script to convert these analysis scripts into a docker container is available in Dockerfile. This creation can be executed by running build.bat, which builds an image based on the description in Dockerfile and sends this image to a central Docker repository. Afterwards, the data stations will pull the image from this repository, and execute the image (containing the analysis scripts and dependencies).

Control post

The control post is defined in a Jupyter Notebook. This notebook can be executed by downloading the repository, navigating to the control folder, and running the Jupyter Notebook command (jupyter notebook).

When opening the notebook, the control station first identifies the data stations available. Second it will send the train towards a specific FHIR endpoint (listed in the available data stations), and retrieve the results after the application (train) has been executed. Third, the control post will send the same train towards a specific RDF (SPARQL) endpoint (listed in the available data stations), and retrieve the results of the application after execution.

Conclusion

This codebase shows that the PHT can be agnostic to the underlying data used. However, as developers of applications/scripts/trains cannot see the actual data, we have to rely on FAIR data descriptions. If FAIR data descriptions are available, applications/trains should be able to interpret these descriptions, and request the data accordingly.

pht_on_fhir_demo's People

Contributors

jvsoest avatar ahamturiyam avatar ananyacn avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.