This repository hosts the default CDS Services configured for the CDS Hooks Sandbox tool. These services are spun up by a Node.js application hosted on Google App Engine.
Once you clone the repository down to your machine, run the following command to install all necessary dependencies for the project.
npm install
Once the dependencies are installed locally, you can run the server on localhost.
npm run dev
You can test out this app from http://localhost:3000
. Try hitting the discovery endpoint at http://localhost:3000/cds-services
.
The JavaScript linter configured for this project is ESlint, which uses the Airbnb JavaScript style guide to correct and standardize JavaScript code.
To lint:
npm run lint
This project contains unit tests using the Jest library. Discovery and CDS Service endpoints are tested by each route and expected behavior.
To test:
npm run test
The following services are configured for this application:
patient-greeting
: A CDS Service configured for the patient-view
hook. The service prefetches the Patient resource of the patient in context of the EHR and returns a proper greeting that displays what patient is being seen by the current provider.
cms-price-check
: A CDS Service configured for the order-select
hook. The service reads the context of a medication being authored and determines if a cheaper prescription alternative may be available to switch to based on historical pharmacy dispensing data. Prices will be displayed for chosen medication.
To add another default service for the CDS Hooks Sandbox:
- Add the service definition to the
/discovery/service-definitions.json
file (metadata for the services found at the discovery endpoint) - Create the service endpoint route in a new file under the
/services
directory - Add the route to the
cds-services.js
file inside thediscovery
directory that points to the new service endpoint - Add a test file to test the service endpoint route under the
/tests
directory
Copyright 2017 Cerner Innovation, Inc
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.