Skip to content
This repository has been archived by the owner on Feb 26, 2024. It is now read-only.

Frequently Asked Questions

Dennis Patterson edited this page Jun 1, 2019 · 9 revisions

Q: I already have Node.js on my machine, but I have an earlier version. How do I update this?

There's a few different options for this, but the easiest way is to go to the Node.js downloads page and use the Installers (.msi for Windows or .pkg for Macintosh). Click on the icon that best matches your machine, and the installer will update and replace your old versions of Node and npm. You can verify the version by typing node -v in your command prompt/terminal.

Q: I downloaded Node on my machine, but cannot run the npm install command inside my project directory

You may need to restart your computer to allow the PATH variable change to take effect. Once you restart, open your command prompt or terminal and type the command node -v and the output should display the version of Node.js you have installed on your machine, indicating you can now run commands with the node or npm keyword.

Q: Why are we using Node.js to create CDS Services? Do all services have to be written in JavaScript?

No, you may write CDS Services in whatever language you want. We use Node.js because it is one of the more simpler ways to set up a service that can handle HTTP requests. Additionally, there are minimal dependencies needed to get this application up and running.

Q: We test services against patient-view and the order-select hook. Are there any other hooks available?

Certainly! You can see the current list of common use case hooks in the spec here. Additionally, anyone can define a new hook to address other use cases. You can add your hook on the proposed hooks page of the CDS Hooks docs wiki. Unfortunately, the CDS Hooks Sandbox only supports testing against the patient-view and order-select hooks. This may change in the future.

Q: If there is a bad request (i.e invalid JSON body), how do I handle this on the services side?

The easiest thing you can do on your end is simply send back an HTTP status code indicating the type of error you see on the CDS Services end. For example, if the POST body of an incoming request has invalid JSON syntax, you can send back a 400 status code for a bad request.

Q: Can I create my own copy of this tutorial project?

Absolutely! Go to the project repository for this tutorial walk-through, and in the upper right corner, click the button that says "Fork". This will make a copy of the entire repository as your own project on your Github account.