Provides a FHIR-based data source for use w/ CQL
Last updated 5 months ago by cmoesel .
Apache-2.0 · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install cql-exec-fhir 
SYNC missed versions from official npm registry.

CQL Execution FHIR Data Source

This project establishes a FHIR-based data source module for use with the CQL Execution Engine. Currently, FHIR 1.0.2 (DSTU2), FHIR 3.0.0 (STU3), and FHIR 4.0.0 (R4) are supported.

Setting Up the Environment

To use this project, you should perform the following steps:

  1. Install Node.js
  2. Install Yarn
  3. Execute the following from this project's root directory: yarn

Using the FHIR Patient Data Source

The FHIR Data Source expects each patient to be represented as a single FHIR Bundle containing all of the patient's relevant data. The FHIR Data Source does not query FHIR servers, but rather, expects the Bundles to be passed to it.

The following is a simple example of how it would be used to execute over two patients:

const cqlfhir = require('cql-exec-fhir');

// Code setting up the CQL library, executor, etc, and getting the patient data as a bundle
// ...

const patientSource = cqlfhir.PatientSource.FHIRv102(); // or .FHIRv300() or .FHIRv400()
patientSource.loadBundles([patient01, patient02]);
const results = executor.exec(patientSource);

Using the FHIRWrapper

If you are passing in individual FHIR resources to the execution engine as parameters, you can use FHIRWrapper to convert the raw json FHIR resources into FHIRObjects that work with the execution engine.


const cqlfhir = require('cql-exec-fhir');
const fhirWrapper = cqlfhir.FHIRWrapper.FHIRv102(); // or .FHIRv300() or .FHIRv400()

const conditionRawResource = { "resourceType": "Condition", "id": "f201", "clinicalStatus": "active", ... }
const conditionFhirObject = fhirWrapper.wrap(conditionResource)
// Now conditionFhirObject can be passed into the cql execution engine

Linting the Code

To encourage quality and consistency within the code base, all code should pass eslint without any warnings. Many text editors can be configured to automatically flag eslint violations. We also provide an npm script for running eslint on the project. To run eslint, execute the following command:

$ yarn lint

Current Tags

  • 1.3.1                                ...           latest (5 months ago)

7 Versions

  • 1.3.1                                ...           5 months ago
  • 1.3.0                                ...           a year ago
  • 1.2.0                                ...           a year ago
  • 1.1.1                                ...           a year ago
  • 1.1.0                                ...           2 years ago
  • 1.0.1                                ...           2 years ago
  • 1.0.0                                ...           2 years ago
Maintainers (1)
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 0
Dependencies (1)
Dev Dependencies (6)
Dependents (2)

Copyright 2014 - 2017 © taobao.org |