Skip to main content

JamGuard

v1.0 · Spring Boot · Commercial · Port 8094

JamGuard is the cross-branch clinical safety engine. It fires before every MedicationRequest write and on a scheduled hourly scan. Its power in a hospital chain context is that it sees the complete medication history — not just what was prescribed at the current branch.

Rules

MAJOR DDI blocks the write

A MAJOR drug-drug interaction prevents the MedicationRequest from being written to HAPI FHIR. The prescriber must acknowledge the alert and explicitly override before the prescription is accepted. MODERATE interactions create a warning card but do not block.

DRUG_DRUG_INTERACTION

On every MedicationRequest write, JamGuard:

  1. Fetches all active MedicationRequests for Patient/GOLDEN-{id} from HAPI FHIR (across all branches)
  2. Extracts RxNorm CUIs for the new drug and all active drugs
  3. Queries the NLM RxNorm Interaction API:
GET https://rxnav.nlm.nih.gov/REST/interaction/list?rxcuis=855288+1191
  1. MAJOR interactions → block write + alert prescriber
    MODERATE interactions → warning card, write proceeds
    MINOR interactions → logged only

DRUG_ALLERGY

Checks new MedicationRequest against all AllergyIntolerance resources for the golden patient ID. Cross-branch allergies are visible because they are all stored in HAPI under the same golden patient ID.

MISSED_FOLLOWUP

Hourly scheduled scan. Finds Observations where:

  • OBX-8 = H (high) or L (low) — critical value flag
  • Observation is older than window-hours (default: 72)
  • No follow-up Encounter exists for this patient in this window

Fires an alert to the ordering clinician and branch admin.

POLYPHARMACY

Flags patients where:

  • Active MedicationRequest count > 10 (configurable)
  • Patient age > 65 (configurable)

DUPLICATE_PRESCRIPTION

Checks whether a new MedicationRequest is in the same ATC drug class as a medication already active from another branch within 30 days (configurable).

Configuration

JamGuard application.yaml
jamguard:
ddi:
enabled: true
block-on-major: true
warn-on-moderate: true
allergy:
enabled: true
missed-followup:
enabled: true
window-hours: 72
scan-cron: "0 0 * * * *" # every hour
polypharmacy:
enabled: true
threshold-count: 10
min-age: 65
duplicate-rx:
enabled: true
window-days: 30