Medication Safety and Interaction Assistant is an AI-enabled, explainable FHIR application built on InterSystems IRIS AI Hub.
It analyzes patient context from standard FHIR resources (including MedicationRequest, MedicationStatement, AllergyIntolerance, Condition, and Observation) and produces clinically useful safety guidance in two tiers: strict warnings first, then conservative warnings with additional context.
Key capabilities include:
Drug interaction and duplicate therapy detection
Allergy and contraindication checks
Risk-category findings (including black-box and population-relevant risks)
Lab-threshold safety checks
QT-risk analysis, including amplification when potassium is low
Anticholinergic burden scoring
Explainable reasoning for every finding (clear “why this was flagged”)
Structured recommended actions with urgency metadata (actionType, priority, slaHours, sourceRisk)
The project includes reproducible synthetic test profiles and consolidated per-patient case artifacts demonstrating input resources and assistant output, enabling transparent validation and easy review for contest judging.
An AI agent built on InterSystems IRIS AI Hub that analyses a patient’s FHIR medication record for safety signals. Given a patient ID, it queries a FHIR R4 server and runs deterministic checks across 14 safety categories, producing structured findings and recommended clinician actions.
Safety categories checked:
Black box warnings · Drug-drug interactions · Drug-food cautions · Population contraindications (age, pregnancy/lactation) · Activity cautions (driving, machinery) · Drug-condition warnings · Lab threshold warnings · QT/arrhythmia risk · Anticholinergic burden · Mental health warnings · Family history risks · Duplicate therapy · Allergy cross-check · Adherence signals
Submission mode: solo project.
One container runs the safety engine and connects to your FHIR server:
| Container | Image | Purpose |
|---|---|---|
iris |
irishealth-community:2026.2.0AI.162.0 (AI Hub EAP) |
Runs the ObjectScript safety engine |
The container connects to a FHIR R4 server running on your host machine (or any reachable URL configured in .env).
irishealth-community-2026.2.0AI.162.0-docker.tar.gz (x64) — or the arm64 variant for Mac M-seriesiris-container-x64.key (or iris-container-arm64.key for ARM64)docker image load -i irishealth-community-2026.2.0AI.162.0-docker.tar.gz
docker tag docker.iscinternal.com/docker-intersystems/intersystems/irishealth-community:2026.2.0AI.162.0 irishealth-community:2026.2.0AI.162.0
iris-container-x64.key into the keys/ folder at the repo root..env and set FHIR_BASE_URL to your FHIR server’s address. The default (http://host.docker.internal:52773/fhir/r4) points to the standard IRIS web port on your host machine — no change needed if that is where your server runs.docker compose build
docker compose up -d
The safety engine requires at least one patient in your FHIR R4 server.
Option A — Load from the included test cases
Each file in med_safety_io/ contains a ready-made FHIR patient bundle under inputResources. Use the included helper script to post all test profiles at once:
python scripts/create_medication_safety_profiles.py
By default the script posts to http://localhost:52773/fhir/r4 (your host FHIR server). Set FHIR_BASE_URL in the environment to override:
FHIR_BASE_URL=http://localhost:52773/fhir/r4 python scripts/create_medication_safety_profiles.py
This creates patients covering the main safety scenarios: duplicate therapy, drug-drug interaction, allergy conflict, QT risk, anticholinergic burden, and more.
Option B — Load your own FHIR R4 patient
Use any FHIR R4 client (Postman, HAPI FHIR CLI, curl) to POST patient data to your FHIR server.
Note the patient ID — you’ll use it in the run command below.
Replace <patientId> with your patient’s FHIR ID:
docker exec medication-safety-and-interaction-assistant-iris-1 bash -c \
"printf 'Do ##class(Sample.AI.Examples.MedicationSafetyAssistant).Demo(\"\",\"detailed\")\nHalt\n' \
| iris session IRIS -U USER 2>&1 | grep -Ev '^(USER>|Node:)'"
Test case patient IDs (after running create_medication_safety_profiles.py):
| Patient ID | Scenario |
|---|---|
med-safe-dup-001 |
Duplicate therapy (two Metformin strengths) |
med-safe-interaction-001 |
Drug-drug interaction (Warfarin + Aspirin) |
med-safe-allergy-001 |
Allergy conflict (Penicillin allergy + Amoxicillin Rx) |
med-safe-qt-001 |
QT prolongation risk |
med-safe-anticholinergic-001 |
Anticholinergic burden |
med-safe-blackbox-001 |
Black box warning |
med-safe-condition-001 |
Drug-condition warning |
med-safe-lab-001 |
Medication + lab threshold warning |
med-safe-mental-001 |
Mental health medication warning |
med-safe-family-001 |
Family history risk |
med-safe-population-age-001 |
Age-related contraindication |
med-safe-population-preg-001 |
Pregnancy contraindication |
Set in .env (loaded automatically by Docker Compose):
| Variable | Default | Purpose |
|---|---|---|
FHIR_BASE_URL |
http://host.docker.internal:52773/fhir/r4 |
FHIR R4 endpoint |
FHIR_BASIC_USER |
_SYSTEM |
Basic auth username |
FHIR_BASIC_PASS |
SYS |
Basic auth password |
FHIR_BEARER_TOKEN |
(none) | Bearer token (alternative to basic auth) |
Patient · MedicationRequest · MedicationStatement · AllergyIntolerance · Condition · Observation · FamilyMemberHistory
Each analysis produces:
actionType, priority, slaHours, sourceRiskPre-generated outputs are in med_safety_io/ — each *-case.json file contains the input FHIR resources and the assistant’s full output for that safety scenario.