CDS Hooks Integration

We are exited to announce the CDS Hooks sandbox (http://sandbox.cds-hooks.org) is integrated with all Logica Sandbox instances! This means you can launch the CDS Hooks sandbox using the SMART on FHIR launch flow passing the CDS Hooks Sandbox:

  • The address of your FHIR server
  • The patient id within your sandbox
  • Custom parameters

You can launch the CDS Hooks sandbox directly from the Apps page, or you can create launch scenarios for the CDS Hooks sandbox.

Step 0 - Create or select your Logica Sandbox instance

As a precondition, create or select your Logica Sandbox instance.  The CDS Hooks sandbox currently supports DSTU2.  If you launch with an STU3 sandbox, you will likely see Javascript errors due to object parsing of STU3 objects with DSTU2 libraries.

Step 1 - Select the CDS Hooks app from the Apps page

The CDS Hooks Sandbox is available to all Logica Sandbox instances by default in the Apps page.

Step 2 - Launch the CDS Hooks App

Begin the SMART on FHIR launch flow by pressing the Launch button.  This will send a request to the CDS Hooks Sandbox that contains an issuer value of your Logica Sandbox Instance's FHIR Server.

Step 3 - Select a patient from your sandbox

As part of the SMART on FHIR launch flow, the Logica Sandbox can simulate a patient in context.  The launch request to the CDS Hooks Sandbox will contain the ID of the patient you select here.

Step 4 - Authorize the CDS Hooks Sandbox to query data in your Logica Sandbox instance

The CDS Hooks Sandbox will recieve the SMART on FHIR launch request from the Logica Sandbox.  The CDS Hooks Sandbox will then proceed to request authorization to your Logica Sandbox Instance FHIR Server.  Notice the address, scopes, and "remember" options.  Select "Authorize" to grant this request to the CDS Hooks Sandbox.

Step 5 - The CDS Hooks Sandbox gains an access token to your Logica Sandbox instance

Having recieved authorization from your Logica Sandbox Instance, the CDS Hooks sandbox will then gain an access token.  You can see the access token granted from the Logica Sandbox to the CDS Hooks Sandbox in the browser development tools.  Notice the patient is included in the token response as per the SMART on FHIR flow.

Step 6 - The CDS Hooks Sandbox queries your Logica Sandbox instance

Having gained an access token, the CDS Hooks Sandbox queries your Logica Sandbox Instance for the patient and patient demographics information.  The patient is displayed in the CDS Hooks Sandbox.  Note, the CDS Hooks Sandbox has a default database and can be used directly (from http://sandbox.cds-hooks.org).  The default database is also an Logica Sandbox Instance that contains the starter dataset.  Many of the patients (ex: Daniel X. Adams) exist in both the CDS Hooks' Logica Sandbox Instance and your personal Logica Sandbox Instance.  

Note: The CDS Hooks Sandbox has a default database and can be used directly (from http://sandbox.cds-hooks.org).  The default database is also an Logica Sandbox Instance that contains the starter dataset.  Many of the patients (ex: Daniel X. Adams) exist in both the CDS Hooks' Logica Sandbox Instance and your personal Logica Sandbox Instance.  You can see that the CDS Hooks Sandbox is using your FHIR server by selecting the Choose a Patient button.  Here it shows that the CDS Hooks Sandbox is using my personal Logica Sandbox Instance, "travisdstu2".

Step 7 - See your CDS cards

Your CDS Hooks service is invoked and your cards are displayed in the CDS Hooks sandbox.  If your card returns an app link, it will be displayed as a clickable link.

Step 8 - Launch your app using your Logica Sandbox as the issuer (FHIR server)

If your SMART app is registered in your Logica sandbox, the CDS Hooks sandbox will launch your app using your Logica Sandbox instance as the issuer!