项目作者: kgrid-lab

项目描述 :
Experimental implementation of the KGrid CDS Service Provider
高级语言: JavaScript
项目地址: git://github.com/kgrid-lab/kgrid-cds-service-provider.git
创建时间: 2019-08-02T14:53:42Z
项目社区:https://github.com/kgrid-lab/kgrid-cds-service-provider

开源协议:

下载


Implementing A CDS-Hooks Translation Layer for the Knowledge Grid

This is generally derived from the cds hooks node implementation demo
and edits it to transform requests for cds service calls into k-grid service calls
and responses from the k-grid into cds-hooks cards.

This project can easily be adapted to serve as a translation layer for any number of knowledge objects.

CDS Hooks Overview

CDS Hooks is a technology from SMART on FHIR that allows third-party CDS systems to register with an
EHR using a “hook” pattern. The third-party CDS system is able to provide
the EHR with information in the form of “cards” that the EHR may use to
show the end-user or otherwise interweave into the workflow

Hello World Example CDS Service

Using the Hello World example knowledge object from the example collection
example collection. The CDS services access
the KO Services at https://kgrid-activator.herokuapp.com/.

We have also created CDS hook integrations for the score calc example,
the opioid finder and the
IPP 10 year stroke risk calculator. These
can all be found in the /service directory.

Service Definition

Developers of CDS Services SHALL provide a stable endpoint for allowing
CDS Clients to discover available CDS Services, including information
such as a description of the CDS Service, when it should be invoked, and any data that is requested to be prefetched.

The http://localhost:3000/cds-services service returns the services defined in
the service-definitions.json file at the root of the project

Service Function

The kgrid-cds-service-provider/service/cds-services.js defines the expressjs
routing for the cds services.

Running the server

To run the server, run:

  1. npm start

You can also run in a dev mode using nodemon

nodemon is a tool that helps develop node.js based applications by
automatically restarting the node application when file changes in the
directory are detected.

  1. npm run dev

Running Integration tests

Our inteegration tests run the hello world and score calc CDS services using Postman and
Newman.

  1. npm test

Heroku

The kgrid-cdes app is running on Heroku. Crowdsort Heroku. The app consists of static content and api backend the communicates with MongoDB. MongoDB is also hosted on the heroku instance.

The instance own by the heroku kgrid team. Create a Heroku login or you can use an existing login. Have a kgrid team memeber add you to the team.

Once a member you should be able to navigate to the Heroku Dashboard

Getting Started

Deploying

  • kgrid-cds root directory
  • herkou login heroku login
  • add heroku as a remote repo heroku git:remote -a kgrid-cds
  • git remote -v verifies that you not have to remotes github and git heroku
  • Push to heroku repo git push heroku master or if deploying from a branch besides mastergit push heroku heroku:master
  • Push custom branch to Heroku
    1. git push <branch name> heroku:master

Useful

Creating your own CDS hooks integrations

You can fork this project to create your own CDS hooks that connect to knowledge
object services. As the examples show all you just need two simple data transforms:
One to transform the data provided by the EHR into the knowledge grid inputs and one to convert the
knowledge grid results into a CDS hook card.

From the hello world example:

This section takes data sent from the EHR and passes it to the knowledge object.

  1. const axiosConfig = {
  2. headers: { Accept: 'application/json' }
  3. };
  4. const url = 'http://kgrid-activator.herokuapp.com/hello/world/v0.2.0/welcome';
  5. const data = {"name": req.body.prefetch.patient.name[0].given[0] };

Then this section takes the response from the knowledge object and inserts it into some CDS cards which
can be read by the EHR.

  1. axios.post(url, data , axiosConfig ).
  2. then((response) => {
  3. console.log('response' + response.data.result)
  4. links = [ { label: "google", url: "https://www.google.com", type: "absolute"},
  5. { label: "github", url: "https://www.github.com", type: "absolute"}];
  6. let aCard = new Card( "Hello World", response.data.result , "label", "url", "info", JSON.parse(JSON.stringify(links)));
  7. links.push({label: "yahoo", url: "http://yahoo.com", type: "absolute"});
  8. let card2 = new Card("Hello links", response.data.result, "label", "http://umich.edu", "warning", links);
  9. let responseObject = { cards: [ aCard, card2 ]};
  10. res.send( responseObject );
  11. });

The other objects all behave similarly.

Resources