Inspiration

What it does

How we built it

Challenges we ran into

Accomplishments that we're proud of

What we learned

What's next for Polyglot Health Intake

Inspiration

About 25 million U.S. residents have limited English proficiency. Their narratives at safety-net clinics, urgent care, and ED triage usually end up as free text — and the clinical structure (red flags, dose, family history of premature CAD) gets lost in translation. Phone interpreters cost time the front desk doesn't have. Google-Translate-grade chart notes don't make it back into the EHR as structured data.

We built Polyglot Health Intake to close that gap with two convictions: the patient should write in their own language, and the clinician should get back a structured FHIR record that actually maps 胸口闷 to chest tightness rather than chest stuffy.

What it does

Polyglot Health Intake registers four MCP tools on the Prompt Opinion platform:

  1. MultilingualIntake — A Prefab UI card that drops into the patient's conversation. The patient writes their narrative in any language (Mandarin, Spanish, Japanese, Vietnamese, Arabic, Korean, English, or auto-detect).
  2. polyglot_process_intake — Translates the narrative to clinical English and extracts structured data: chief complaint, symptoms with onset and severity, conditions, current medications with dose, allergies with reaction, past medical history, family history, and red flags. Each entity is written to the platform's FHIR sandbox as a real R4 Observation, Condition, or AllergyIntolerance resource.
  3. ClinicianSummary — Reads every FHIR resource on the current patient and synthesises a SOAP-style brief (Subjective / Objective / Assessment / Plan + safety flags) the clinician can read in 30 seconds.
  4. ReplyToPatient — Translates the clinician's reply back into the patient's language at a 6th-grade reading level, preserving every dose and red-flag instruction (e.g. "call 911") verbatim.

In our demo, a 32-year-old patient Mei Lin presents in Mandarin with three days of chest tightness. The pipeline produces six FHIR resources, flags possible acute coronary syndrome and premature CAD family history, generates a SOAP brief with full differential (ACS, PE, myocarditis, infectious etiology, anxiety), and translates the clinician's EKG/troponin orders back into Mandarin while preserving the "call 911" instruction.

How we built it

  • FastMCP / POFastMCP for the server, vendored from the upstream Prompt Opinion sample so the FHIR-context capability extension is declared correctly.
  • Prefab UI for the in-chat patient narrative card.
  • fhir.resources Pydantic models on the read path; raw R4 JSON on the write path so we can assign client-generated UUIDs.
  • claude -p subprocess for every clinical inference — we shell out to the operator's local Claude CLI with --disallowedTools set to forbid every non-LLM tool, so each call is a pure text completion against the operator's own Claude Max subscription. Zero API token cost.
  • Tailscale Funnel to expose the local FastMCP server to Prompt Opinion's marketplace at https://node.tail896d9b.ts.net/poly.

Challenges we ran into

  • Windows .cmd shims do not resolve PATHEXT for asyncio.create_subprocess_exec and silently truncate UTF-8 multibyte argv when the prompt contains Chinese characters. Fix: pipe the full prompt over stdin instead of as a positional argument.
  • The default Tailscale Funnel --set-path=/mcp strips its prefix before forwarding, so the FastMCP server has to bind on path="/" for the public /mcp URL to resolve at the root of the upstream port.
  • The agent and platform cache their MCP tool list; tool-name changes during development required Reconnect / agent re-attach to refresh the list.

Accomplishments

  • Real FHIR R4 round trip: patient narrative in Mandarin → six FHIR resources persisted, with proper category / clinicalStatus / verificationStatus codings — not "almost FHIR" JSON.
  • Conservative extraction: the model is instructed not to invent data, leave severity as unknown rather than guess, and emit empty arrays instead of fabricated entries. Demoed end-to-end on a Mandarin ACS-presentation narrative.
  • Zero LLM token cost. Every inference goes through the operator's Claude Max subscription via claude -p.
  • Bilingual demo with English subtitles so reviewers without Mandarin can verify translation quality.

What we learned

  • Patient narratives compress beautifully into LOINC display-level codes if you give the model a strict JSON contract. ICD-10 mapping works for the common-vocabulary conditions.
  • Cultural softening matters more on the reply path than on the intake path — clinicians write tersely, and the patient-facing translation has to add emotional valence without losing dose accuracy.

What's next

  • Add a Procedure writer for prior surgical history (currently only written into PMH free text).
  • Detect dialect/script automatically (Simplified vs. Traditional Chinese, Cantonese vs. Mandarin) and adjust both extraction and reply tone.
  • A Spanish-only variant pinned to the Project ECHO vocabulary for rural-Mexico migrant care.

Try it

Eligibility / Compliance

All sample data is synthetic. No real PHI is used or required to run the demo. Patient narratives stored only in the platform's FHIR sandbox; nothing persisted server-side. Disallowed tools enforced on every claude -p invocation so each LLM call is a pure text completion.

Built With

  • claude
  • fastmcp
  • fhir
  • fhir-r4
  • healthcare
  • httpx
  • mcp
  • multilingual
  • po-fastmcp
  • prefab-ui
  • python
  • tailscale
Share this project:

Updates