Optum / CyFHIR

A Neo4j Plugin for Handling HL7 FHIR Data
GNU General Public License v3.0
53 stars 13 forks source link
fhir graph-database healthcare hl7 maven neo4j

CyFHIR

Operationalizing Neo4j for use within Healthcare by leveraging HL7 FHIR Standards

Table of Contents

  1. Introduction
  2. Using CyFHIR
  3. Using This Codebase
  4. Performance Metrics

1. Introduction

Background

Before explaining CyFHIR, you should first understand what Neo4j and FHIR are, as this project is directly built off of them. To summarize, Neo4j is an 'open-source, NoSQL, native graph database', and FHIR is an open standard in healthcare maintained by HL7 who publishes interoperable methods of data transfer, storage, classification, and more. We highly recommend at least reading through HL7's FHIR documentation before continuing to work with CyFHIR.

What is CyFHIR?

CyFHIR is a native Neo4j plugin that acts as the bridge between FHIR and Neo4j. With CyFHIR, users can: directly load FHIR Resources into their Neo4j database, execute Neo4j queries (using Neo4j's query language, Cypher) on those FHIR Resources, and return query responses as FHIR Resources that meet HL7's standards.

2. Using CyFHIR

Usage Prerequisites

How to use CyFHIR

We recommend the use of Docker for running Neo4j version 4.2.x locally to maintain static development environments that can be easily cleaned/removed. But if you wish to use Neo4j Desktop, that should work as well. Whichever development you choose, adding CyFHIR to Neo4j should be the same process:

  1. Download the latest release from https://github.com/Optum/CyFHIR/releases
  2. Add CyFHIR to your $NEO4J_HOME/plugins folder
  3. Download the latest APOC Package from https://github.com/neo4j-contrib/neo4j-apoc-procedures/releases (APOC is a Neo4j community package with tons of useful procedures and functions and we use it in tandem with CyFHIR)
  4. Add APOC to your $NEO4J_HOME/plugins folder
  5. In $NEO4J_HOME/conf/neo4j.conf add apoc and cyfhir as unrestricted plugins NEO4J_dbms_security_procedu res_unrestricted: apoc.*,cyfhir.*
  6. Run Neo4j

CyFHIR Commands

Currently CyFHIR has 3 procedures and 2 aggregating functions:

Procedures:
Functions

3. Using this Codebase

Understanding the Cypher and code behind this solution is not trivial, so we recommend using this repo to get a better understanding of how this all works.

In this repo we have:

Just be sure to git clone this repo and cd CyFHIR into the project

Starting Neo4j with CyFHIR in Docker and local Express.js server

  1. In one terminal window run command make neo4j
  2. In a different terminal window run command cd express && npm ci
  3. Then run npm run serve to start the Express.js server
  4. Open browser to http://localhost:7474 and http://localhost:3000/docs
  5. Use Swagger Docs to Load Test Bundle or run bash bin/seed.sh from root of project to seed Neo4j with 6, large Synthea Bundles

Starting Neo4j with CyFHIR and Express.js server in Docker

  1. In terminal run command make backend
  2. Open browser to http://localhost:7474 and http://localhost:3000/docs
  3. Use Swagger Docs to Load Test Bundle or run bash bin/seed.sh from root of project to seed Neo4j with 6, large Synthea Bundles

Visual Graph of Patient and Conditions