Inspiration / Problem

A patient leaves the clinic with a positive FIT test. The clinician documents: "needs colonoscopy." Weeks become months. The referral was never scheduled. The patient was never called. The finding sits buried across notes, orders, tasks, and follow-up plans. Nobody sees the full picture until the delay has already become a missed cancer.

This is not rare. 12 million US adults experience outpatient diagnostic errors annually — 1 in 20 (Singh et al., BMJ Quality & Safety, 2014). Missed follow-up rates reach 62% for abnormal labs and 35.7% for radiology (Callen et al., JGIM, 2012). Even in electronic workflows with active alerts, 7.7% of critical imaging alerts still lacked timely follow-up (Singh et al., Arch Intern Med, 2009). Colonoscopy delayed more than 12 months after a positive FIT doubles colorectal cancer risk and triples advanced-stage disease risk (Corley et al., JAMA, 2017). Care fragmentation alone is associated with 61% higher adjusted odds of preventable adverse events (Kern et al., BMC Health Services Research, 2024).

In a 2024 multi-site lung cancer cohort, every 10 percentage-point increase in missed oncology follow-up was associated with a 44% higher hazard of death (HR 1.44, 95% CI 1.05-1.97, Steele et al., Scientific Reports, 2024).

LoopGuard Passport is designed to help prevent this. Not by adding another alert. By finding the open loops that already fell silent, ranking the dangerous ones by guideline-grounded urgency, suppressing completed work so clinicians are not distracted, and saving a governed review-required Passport back into the patient FHIR record so the next clinician sees exactly what needs attention — and can close the loop.

This is not a model benchmark problem. It is a healthcare workflow problem: the referral not made, the follow-up forgotten, the imaging finding never tracked. LoopGuard Passport is a specialized MCP server designed to be assembled into clinical workflows as the diagnostic harm prevention layer.

What It Does

LoopGuard Passport finds dangerous clinical follow-up loops that silently fell through the cracks — like a positive FIT test with no colonoscopy — ranks them by guideline-grounded urgency, suppresses already-completed work, and saves a review-required FHIR Passport back into the patient record.

It is a specialized MCP server and Prompt Opinion MCP App for care-continuity risk.

It runs a full loop-closure pipeline:

  1. Reads patient-scoped FHIR R4 context from Prompt Opinion or synthetic demo data.
  2. Extracts implicit care commitments from clinical note narratives.
  3. Detects structured loops from FHIR resources.
  4. Suppresses completed loops so closed work is not re-alerted.
  5. Enriches loops with HPO phenotype flags.
  6. Classifies urgency using guideline-grounded temporal zones.
  7. Ranks the open-loop board.
  8. Synthesizes compound risk across all open loops simultaneously.
  9. Detects notification, ownership, and timeframe gaps from narrative text.
  10. Renders a visual Passport dashboard inside Prompt Opinion.
  11. Saves draft clinician-review edits back to the patient record as FHIR Task and DocumentReference resources.

Demo Patient: Maria Lopez

The submitted demo uses Maria Lopez, a fully synthetic patient. No real PHI is required for judging.

Maria has diabetes, iron-deficiency anemia, positive FIT, pulmonary nodule follow-up, weight loss context, and a completed potassium follow-up that should not be re-flagged.

Loop Urgency Temporal status
Positive FIT → colonoscopy HIGH RED — 200 days open, 180-day benchmark, 20 days over
Pulmonary nodule → follow-up CT MEDIUM YELLOW — 240 days open, Fleischner Society 2017
Abnormal potassium SUPPRESSED Completed Task — not re-flagged

HPO phenotype flags on the top loop: HP:0001903 Anemia, HP:0003281 Iron-deficiency anemia, HP:0001824 Weight loss, HP:0034307 Positive fecal immunochemical test, HP:0033660 Pulmonary nodule, HP:0000819 Diabetes mellitus. Compound phenotype risk: ELEVATED. Compound risk: ESCALATE_TODAY.

Live FHIR Validation

The final Prompt Opinion live FHIR demo used an uploaded synthetic LoopGuard patient with demo_mode=false.

Verified live output:

  • data_mode: prompt_opinion_fhir_context
  • open_loop_count: 2
  • suppressed_loop_count: 1
  • compound_risk_level: ESCALATE_TODAY
  • top loop zone: RED
  • notification_gaps.gap_count: 0
  • review_required: true

For a patient with no detected open loops, LoopGuard returned ROUTINE rather than escalating. The system is calibrated, not alarmist.

The AI Factor

The architecture is intentional: LoopGuard is the clinical evidence engine. The Prompt Opinion agent is the generative reasoning layer. Together they do what neither can do alone.

A rule engine cannot reason over unstructured clinical language. A general LLM cannot reliably ground clinical urgency in verified guidelines, suppress completed loops, or write auditable FHIR artifacts. LoopGuard solves this by separating the two concerns: deterministic code handles what must be exact and auditable; generative AI handles what requires reasoning over messy, heterogeneous, multi-source clinical context.

Three things traditional software cannot replicate:

1. Implicit Loop Detection Extracts care commitments from unstructured clinical note narratives — phrases like "will refer to GI if hemoglobin stays low" that were never formalized as structured FHIR orders. Rules match structured fields. They cannot read intent from narrative text. Language reasoning can. No lookup table produces: "this note commitment implies an unfulfilled referral obligation that has no corresponding ServiceRequest in FHIR."

2. HPO Phenotype Enrichment with Compound Reasoning Maps FHIR Observations to Human Phenotype Ontology codes and reasons about whether concurrent phenotypes combine into elevated risk. For Maria: HP:0001903 Anemia + HP:0001824 Weight loss + HP:0034307 Positive FIT = ELEVATED compound phenotype risk. Rules can flag one abnormal result. They cannot reason about what the combination implies for urgency across multiple open loops.

3. Cross-Loop Compound Synthesis Reads across all open loops simultaneously and reasons about whether the combination creates urgency greater than any single loop alone. No rule engine produces:

"Positive FIT loop is RED at 200 days against the CMS/AGA eCQM benchmark, concurrent with iron-deficiency anemia, weight loss, active diabetes-care work, and a second open imaging loop — warrants same-day responsible clinician review."

The generative layer — by design, not by accident LoopGuard returns structured, evidence-bound JSON: temporal zones, HPO codes, guideline sources, days-open values, missing information, suppressed loops. The Prompt Opinion agent then performs the generative step: it reads the raw evidence fields and generates its own 2-3 sentence compound-risk synthesis — without copying the deterministic rationale, without inventing facts outside the evidence, and without claiming actions that require clinician approval.

This is not a limitation of LoopGuard. It is the correct architecture for healthcare AI: deterministic code keeps results safe, bounded, and auditable; generative AI drafts the synthesis that helps a clinician understand why multiple open loops should be reviewed together — now, not later. The clinician decides.

Exact-phrase searches across EuropePMC, arXiv, GitHub, and open-source repositories did not reveal a directly comparable open-source implementation combining cross-loop urgency synthesis, completed-loop suppression, HPO enrichment, and governed FHIR write-back.

Governed FHIR Write-Back

LoopGuard supports optional editable Passport drafts in the MCP App. The clinician can edit safe coordination-only fields: draft next action, owner, due date, review status, clinician note, escalation status.

LoopGuard never exposes diagnosis, medication, procedure order, prescription, or patient-message fields for editing.

When the user clicks Save Draft, LoopGuard persists the edit to live Prompt Opinion FHIR as:

  • Task: draft coordination work item
  • DocumentReference: visible Passport draft snapshot

Verified live persistence:

  • Task count increased after saves.
  • DocumentReference count increased after saves.
  • Patient Details showed readable LoopGuard Passport Draft Snapshot documents under the same patient.

Optional Synthetic Cohort Demo

LoopGuard includes loopguard.cohort_scan when enabled with LOOPGUARD_ENABLE_COHORT_TOOL=true. It scans bundled synthetic patients, ranks the panel by urgency and HPO phenotype risk, and returns a review-required escalation queue.

How It Differs

Other entries address adjacent problems: unfulfilled note commitments, source-span provenance, HEDIS care gaps, medication or appointment gaps, rare disease navigation, and antibiotic stewardship.

LoopGuard's lane is different: it prevents silent diagnostic harm after the clinical decision — the referral not scheduled, the follow-up forgotten, the imaging finding never tracked.

LoopGuard's differentiator is the combination of:

  • Implicit loop detection from unstructured notes
  • Structured FHIR loop detection
  • Completed-loop suppression
  • HPO phenotype enrichment
  • Guideline-grounded temporal urgency
  • Cross-loop compound synthesis
  • Governed FHIR write-back (Task + Provenance + DocumentReference)
  • Visual Passport dashboard with editable draft fields
  • Strict human-in-the-loop safety model

I did not find a directly comparable open-source implementation combining cross-loop urgency synthesis, completed-loop suppression, HPO enrichment, and governed FHIR write-back.

Why the EHR and single-disease tools cannot close this gap

Even in a large integrated health system, 58% of patients with incident abnormal eGFR results lacked timely follow-up despite electronic workflows (Danforth et al., Am J Kidney Dis, 2019). Prior alert-based solutions improve acknowledgment speed but not adherence: one pathology closed-loop alert system improved median acknowledgment from 6 to 2 days, yet overall policy adherence fell from 91.6% to 86.4% (O'Connor et al., Appl Clin Inform, 2018).

Complex patients are at measurably higher risk. Multimorbidity was independently associated with diagnostic errors (aOR 1.83, Aoki et al., BMJ Open, 2020). Patients without multimorbidity were less than half as likely to experience misdiagnosis (OR 0.42, Dong et al., Orphanet J Rare Dis, 2020). Single-disease tracking tools cannot see compound risk. LoopGuard is built for exactly this gap.

Potential Impact

Hypothesis: If unresolved loops are surfaced, ranked by guideline-grounded urgency, and saved as review-required FHIR artifacts, care teams can spend less time reconstructing chart history and more time closing the right loop first.

Potential benefits:

  • Reduce missed follow-up risk after abnormal results
  • Reduce clinician time spent hunting across notes, orders, referrals, and imaging reports
  • Reduce alert fatigue by suppressing completed loops
  • Improve handoff quality through FHIR Task and DocumentReference artifacts
  • Preserve safety by keeping every output draft-only and review-required

The harm is real, measurable, and preventable

Missed follow-up directly shortens lives: every 10 percentage- point increase in missed oncology follow-up appointments was associated with a 44% higher hazard of death (HR 1.44, 95% CI 1.05-1.97, Steele et al., Scientific Reports, 2024).

The economic downside is measurable before litigation reaches court: first-year charges for metastatic colorectal cancer are approximately $359,000 versus $184,406 for non-metastatic disease — an incremental difference of $174,594 per patient that begins the moment follow-up fails (Nguyen et al., Cancer Res Commun, 2025). When delayed diagnosis reaches litigation, exposure averages $2.84M per case (Fritz et al., Head Neck, 2023).

Even in 2024, loop closure is not improving: only 44.4% of patients in usual care completed colonoscopy within 6 months of a positive FIT (Reuland et al., JAMA Netw Open, 2024). In academic primary care, only 52.9% of diagnostic tests and referrals were completed within the designated time window (Amat et al., Jt Comm J Qual Patient Saf, 2024).

Feasibility

LoopGuard is designed for a real healthcare architecture:

  • MCP for tool invocation inside Prompt Opinion
  • FHIR R4 for patient context and saved artifacts
  • Patient-scoped reads and writes
  • Token redaction throughout
  • Synthetic test patient upload for reproducible live FHIR testing
  • Review-required in every output
  • No autonomous diagnosis, prescribing, ordering, scheduling, or patient contact

The save model is practical: Patient/{id}

  • Task: draft coordination work item
  • DocumentReference: readable Passport draft snapshot
  • Provenance: attempted when supported; audit context embedded in the document when not

LoopGuard does not replace the EHR or clinician. It creates reviewable draft coordination artifacts in the same patient context.

Safety

LoopGuard is draft-only clinical decision support.

It does not diagnose, prescribe, place orders, schedule procedures, or contact patients autonomously. All outputs require responsible clinician review. The demo uses synthetic patient data only — no real PHI is required for judging. Access tokens are never printed in outputs.

Editable Passport fields are restricted to safe coordination- only content. Diagnosis fields, medication fields, procedure orders, and patient-facing messages are never exposed.

Judge Reproduction

The demo video should show: analyze Maria, open the Passport dashboard, save a draft edit, and confirm Task/DocumentReference in Patient Details.

First-pass (no credentials required): Call loopguard.analyze_patient_loops with demo_mode=true. Returns the ranked loop board, HPO phenotype flags, compound risk synthesis, safety disclaimer, and draft FHIR governance artifacts. No PHI. Deterministic. Under 60 seconds.

Full workflow:

  1. loopguard.analyze_patient_loops with demo_mode=false—Maria's loops, HPO flags, compound risk, FHIR artifacts.
  2. loopguard.open_passport_app with demo_mode=false—visual Passport dashboard.
  3. Edit a safe draft field and save — confirm Task count increments in Prompt Opinion Patient Details.
  4. Optional: LOOPGUARD_ENABLE_COHORT_TOOL=true then loopguard.cohort_scan with demo_mode=true — synthetic panel triage across 3 patients.

Live FHIR optional path: Select the uploaded synthetic LoopGuard patient in Prompt Opinion, then call loopguard.analyze_patient_loops with demo_mode=false. Returns data_mode: prompt_opinion_fhir_context.

Links

References

  1. Singh et al., BMJ Quality & Safety, 2014 — pubmed.ncbi.nlm.nih.gov/24742777/
  2. Callen et al., JGIM, 2012 — pubmed.ncbi.nlm.nih.gov/22183961/
  3. Singh et al., Arch Intern Med, 2009 — pubmed.ncbi.nlm.nih.gov/19786677/
  4. Corley et al., JAMA, 2017 — pubmed.ncbi.nlm.nih.gov/28444278/
  5. Kern et al., BMC Health Services Research, 2024 — pubmed.ncbi.nlm.nih.gov/39256705/
  6. Steele et al., Scientific Reports, 2024 — pubmed.ncbi.nlm.nih.gov/39085317/
  7. Nguyen et al., Cancer Res Commun, 2025 — pubmed.ncbi.nlm.nih.gov/41003659/
  8. Fritz et al., Head Neck, 2023 — pubmed.ncbi.nlm.nih.gov/37144329/
  9. Danforth et al., Am J Kidney Dis, 2019 — pubmed.ncbi.nlm.nih.gov/31324445/
  10. O'Connor et al., Appl Clin Inform, 2018 — pubmed.ncbi.nlm.nih.gov/29874687/
  11. Aoki et al., BMJ Open, 2020 — pubmed.ncbi.nlm.nih.gov/32819954/
  12. Dong et al., Orphanet J Rare Dis, 2020 — pubmed.ncbi.nlm.nih.gov/33115515/
  13. Amat et al., Jt Comm J Qual Patient Saf, 2024 — pubmed.ncbi.nlm.nih.gov/37996308/
  14. Reuland et al., JAMA Netw Open, 2024 — pubmed.ncbi.nlm.nih.gov/39585696/

LoopGuard does not find problems. It prevents the moment a missed cancer begins — the silent follow-up that nobody tracked.

Built With

  • fastmcp
  • fastmcp-apps-/-prefab-ui
  • fhir-r4
  • mcp-streamable-http
  • prompt-opinion
  • python
  • render
Share this project:

Updates