🚨 Shai-Hulud Strikes Again:834 Packages Compromised.Technical Analysis →
Socket
Book a DemoInstallSign in
Socket

@asymmetrik/node-cds-hooks

Package Overview
Dependencies
Maintainers
8
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@asymmetrik/node-cds-hooks

A framework for creating NodeJS CDS Hooks applications

latest
Source
npmnpm
Version
1.1.1
Version published
Maintainers
8
Created
Source

Node CDS Hooks

Build Status

A framework for making CDS Hooks applications -- APIs that serve Cards to providers within EHRs.

Getting started

Install node-cds-hooks as an npm module and save it to your package.json as a dependency

npm i s @asymmetrik/node-cds-hooks

Example Usage

const { CDSServer, Service } = require('@asymmetrik/node-cds-hooks');

const definition = {
  hook: 'patient-view',
  name: 'CDS Service Starter Patient View',
  description: 'An example of a CDS Service that displays "Hello World!"',
  id: 'cds-service-starter-patient-view',
  prefetch: {
    patient: 'Patient/{{context.patientId}}',
  }
}

const handler = (req) => {
    return {
      cards: [
        {
          summary: 'My summary',
          detail: 'My details',
          source: {
            label: 'Node CDS Hooks',
            url: 'https://example.com',
          },
          indicator: 'info',
        }
      ]
    }
  }

};

// Create the server
const app = new CDSServer();

// Create the service
const service = new Service(definition,  handler);

// Register the service
app.registerService(service);

// Start the application
const port = 9000
app.listen({ port }, () => {
  logger.info('Application listening on port: ' + port);
}

After your app is running, query your discovery endpoint.

curl http://localhost:9000/cds-services
{"services":[{"hook":"patient-view","name":"CDS Service Starter Patient View","description":"An example of a CDS Service that displays \"Hello World!\"","id":"cds-service-starter-patient-view","prefetch":{"patient":"Patient/{{context.patientId}}"}}]}

You're up and running!

Keywords

CDS Hooks

FAQs

Package last updated on 15 Jul 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts