Get Your Clinical Decision Support in an EHR in 10 mins
Looking to get your great calculator, insight, or decision support to appear in an EHR? Looking to know when a certain medication is ordered, or when a chart is opened in an EHR? Well then, CDS Hooks might be what you are looking for.
CDS hooks take EHR events (like when a provider opens a chart/views a patient, when an order is selected or signed, when a visit starts or ends, ...) and notify arbitrary web services that anyone can create. These services can give "card" data back to the EHR to display to the provider.
Think of the following:
- You create a cost estimator card for when a provider selects an MRI order.
- You create a service that suggest a different medication for a doctor when they are about to prescribe something.
- You create a service that makes CME appear inside the EHR when a patient has certain characteristics.
- ....
To get you started, we are going to build #3, because, well, it is super interesting.
It's called "CME-ster" and it makes the following card surface in an EHR when a provider opens a chart and the patient has a history of dementia.
The link is to the awesome Curbsider's podcast which internal medicine doctors/hospitalist love
Two get CDS Hooks to work you need two things:
- Somewhere you serve your code for "CME-ster"
- an EHR to show these cards in
Server Part
For the server part, I like repl.it, and I have some code there you can sign up for a free account and fork it at
https://replit.com/@patientDev/cdshooks#index.js
Once you fork it click "Run"
You will notice you magically have your own url serving code at the upper right
In fact if you hit the button with the box and an arrow coming out of it, you will see your code being served
Simulate an Electronic Health Record
To simulate an EHR, go to the CDS Hooks Sandbox at
Click on the gear in the upper right
Click Add CDS Service
Enter your repl url with /cds-services added to the end like this:
Magically you will see this card appear in the "EHR"
Try changing the code (like the image or the "details" of the json for the card). Hit Stop on your repl, then run, then reload the CDS Hooks Sandbox.
Check out more FHIR tutorials at www.patient.dev