Home Applications smart-patient-summary-generator

smart-patient-summary-generator Works

InterSystems does not provide technical support for this project. Please contact its developer for the technical assistance.
0
0 reviews
0
Awards
72
Views
0
IPM installs
0
0
Details
Releases (1)
Reviews
Issues
Smart Patient Summary Generator for the Contest

What's new in this version

Initial ReleaseSmart Patient Summary Generator is a clinician-focused application that converts fragmented FHIR R4 patient data into clear, role-aware narrative summaries for rapid clinical decision support.

It ingests key clinical resources (Patient, Observation, Condition, MedicationRequest, AllergyIntolerance, Encounter, and CarePlan) and produces concise summaries tailored to different audiences such as ED physicians, care managers, patients, and caregivers. The output emphasizes actionable clinical content rather than technical metadata, helping users quickly identify what matters now.

Core capabilities include:

Role-based narrative generation (ED, care manager, patient, caregiver views).
Deterministic extraction of current issues from structured data.
Detection and highlighting of unusual/abnormal observations (for example low oxygen saturation) using interpretation flags, reference ranges, and rule-based thresholds.
Safety-aware context such as allergy constraints and recent acute utilization.
Clean, shareable narrative output written directly to file (without terminal/session noise).
The project is designed for explainable, practical use in healthcare workflows, where clarity, traceability to FHIR evidence, and immediate clinical relevance are essential.

Smart Patient Summary Agent for FHIR

An AI agent built on InterSystems IRIS AI Hub that generates role-specific clinical summaries from FHIR patient data. Given a patient ID, it queries a FHIR R4 server, extracts structured clinical signals, and produces four distinct narrative summaries tailored to:

  • ED Doctor — safety-first, immediate action priorities, disposition context
  • Care Manager — continuity gaps, transitions, care coordination tasks
  • Patient — plain language, self-care guidance, warning signs
  • Family Caregiver — monitoring checkpoints, medication safety, escalation triggers

Output is deterministic and evidence-based — same FHIR data, four different narrative framings.

Team

Submission mode: solo project.

Architecture

One container runs the summary engine and connects to your FHIR server:

Container Image Purpose
iris irishealth-community:2026.2.0AI.162.0 (AI Hub EAP) Runs the ObjectScript summary engine

The container connects to a FHIR R4 server running on your host machine (or any reachable URL configured in .env).

Prerequisites

  • Docker Desktop (Windows / Mac) or Docker Engine (Linux)
  • InterSystems IRIS AI Hub EAP image — the AI Hub is baked into this image.
    1. Register / log in at https://evaluation.intersystems.com/Eval/early-access/AIHub and select the AI Hub program.
    2. Download two files:
      • irishealth-community-2026.2.0AI.162.0-docker.tar.gz (x64) — or the arm64 variant for Mac M-series
      • iris-container-x64.key (or iris-container-arm64.key for ARM64)
    3. Load and tag the image (one-time step per machine):
      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
      

Quick start

  1. Clone this repository.
  2. Copy your iris-container-x64.key into the keys/ folder at the repo root.
  3. Open .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.
  4. Build and start:
    docker compose build
    docker compose up -d
    
  5. Wait ~60 seconds for the container to become healthy.
  6. Load patient data into your FHIR server (see Patient data below).
  7. Run a summary.

Patient data

The summary engine requires at least one patient in your FHIR R4 server.

Load with any FHIR R4 client (Postman, HAPI FHIR CLI, curl) or generate realistic synthetic profiles with Synthea.

Note the patient ID returned when you POST the Patient resource — you’ll use it in the demo commands below.

Running a summary

Replace <patientId> with your patient’s FHIR ID:

# All four roles, detailed mode
docker exec smart-patient-summary-generator-iris-1 bash -c \
  "printf 'Do ##class(Sample.AI.Examples.FHIRSummary).DemoNarrativeAllRoles(\"\",\"detailed\")\nHalt\n' \
  | iris session IRIS -U USER 2>&1 | grep -Ev '^(USER>|Node:)'"

Single role (ed, care_manager, patient, or caregiver)

docker exec smart-patient-summary-generator-iris-1 bash -c
"printf 'Do ##class(Sample.AI.Examples.FHIRSummary).DemoNarrative("","ed","detailed")\nHalt\n'
| iris session IRIS -U USER 2>&1 | grep -Ev '^(USER>|Node:)'"

Brief mode (2 items per section)

docker exec smart-patient-summary-generator-iris-1 bash -c
"printf 'Do ##class(Sample.AI.Examples.FHIRSummary).DemoNarrativeAllRoles("","brief")\nHalt\n'
| iris session IRIS -U USER 2>&1 | grep -Ev '^(USER>|Node:)'"

All entry points

Method Description
FHIRSummary.DemoNarrativeAllRoles(patientId, detailMode) Four-role narrative — recommended starting point
FHIRSummary.DemoNarrative(patientId, role, detailMode) Single role narrative (ed, care_manager, patient, caregiver)
FHIRSummary.DemoDeterministic(patientId, role, detailMode) Single role as JSON
FHIRSummary.DemoRoleComparison(patientId, detailMode) All roles as JSON
FHIRSummary.DemoNarrativeToFile(patientId, role, detailMode, path) Write narrative to file

detailMode: "brief" (2 items/section) or "detailed" (full evidence).

Environment variables

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)

FHIR resources used

The engine queries: Patient, Observation, AllergyIntolerance, Condition, MedicationRequest, Encounter, CarePlan.

Output structure

Each role summary contains:

  • Patient Overview — demographics and evidence inventory
  • Clinical Details — conditions, medications, allergies, encounters, observations, care plans
  • Current Issues — deterministic extraction of active problems, abnormal findings, alerts
  • Recent Changes — trend signals and data freshness
  • Risks / Follow-up — evidence-based escalation triggers
  • Role-Specific Action Plan — immediate priorities, weekly actions, escalation criteria

What is the AI Hub?

InterSystems AI Hub is the AI SDK for IRIS — it provides ObjectScript, Python, and Java APIs for building agents, tool-based pipelines, and RAG applications that run natively on IRIS.

Made with
Version
1.0.026 May, 2026
Ideas portal
Category
Solutions
Works with
InterSystems IRISInterSystems IRIS for HealthInterSystems FHIR
First published
26 May, 2026
Last edited
26 May, 2026
Last checked by moderator
07 Jun, 2026Works