Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SMART Meds Contraindication Checker — Training Exercise

A SMART-on-FHIR training app that detects medication contraindications by combining FHIR queries with SNOMED CT ECL queries against a terminology server. You complete five TODO sections to make it work end-to-end.

Run on StackBlitz (recommended)

Open in StackBlitz

  1. Click the badge above (or open https://stackblitz.com/github/aehrc/smart-meds-training). StackBlitz installs dependencies and starts the server automatically — watch the terminal for the [test-data] messages seeding the training patient.
  2. Open the preview in a new tab using the "Open in New Tab" button in the preview pane. ⚠️ This step is required — the SMART OAuth flow uses session cookies that do not survive inside the embedded preview iframe.
  3. Follow the launch instructions shown on the landing page:
    • Go to launch.smarthealthit.org
    • Paste your app's launch URL (shown on the landing page) as the App Launch URL
    • Select the patient Li Wang
    • Click Launch
    • If asked to select an encounter, click Launch Without Encounter (the training patient has no encounters)

The server auto-restarts whenever you save a file, so you can iterate on the TODOs without touching the terminal.

The launch will not complete until you have configured the SMART scopes in TODO 1 — that's the exercise!

The exercise

Work through the numbered TODOs:

TODO File Task
1 routes/launch.js Configure the SMART scopes
2 routes/dashboard.js FHIR search for MedicationRequests
3 routes/dashboard.js FHIR search for AllergyIntolerances
4 routes/dashboard.js ECL expression for active ingredients
5 routes/dashboard.js ECL for the $validate-code subsumption check

When all five are complete, the dashboard shows Li Wang's medications, allergies, and a contraindication alert (amoxicillin vs penicillin allergy).

Run locally

npm install
npm start          # or: npm run dev (auto-restarts on save)

Then open http://localhost:3000 and follow the same launch instructions, using http://localhost:3000/launch as the App Launch URL.

How it works

  1. Launch from an EHR (or the SMART Launcher sandbox)
  2. Retrieve the patient's medications and allergies via FHIR
  3. Extract active ingredients using SNOMED CT ECL on a terminology server (https://tx.training.hl7.org.au/fhir)
  4. Check each ingredient against each allergy using $validate-code
  5. Display any detected contraindications

About

SMART-on-FHIR Medication Contraindication Checker - Developer Training Exercise

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages