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