Narrative in
Clinical notes arrive as free text, with the abbreviations and variation found in real care.
FHIR at Will is the bridge.
An open-source, AI-powered interoperability layer that turns your Unstructured narrative clinical data into FHIR R4 resources—while your infrastructure evolves.
FHIR at Will implements an 8-layer validation cascade so you can trust what you interoperate.
› Verification-first by design
› AI-powered. Deterministic by design.
FHIR at Will uses an LLM where clinical language is ambiguous: extracting grounded facts from unstructured narrative. From there, explicit schemas, profiles, terminology rules, and validation logic control the result.
Clinical notes arrive as free text, with the abbreviations and variation found in real care.
The LLM identifies clinical facts and ties them back to the source narrative.
Typed mappings turn extracted facts into predictable FHIR R4 resources and Bundles.
The same facts, configuration, and rules produce the same validation outcome every time.
› Research
The method asks a model only for the judgment that code cannot make: which facts a narrative states and which facts describe the same real-world thing. Once that compact entity stream exists, deterministic code owns validation, FHIR datatypes, references, identifiers, required defaults, provenance, and reporting.
[ the organizing question ]
Does this step have more than one defensible answer given its input?
Language interpretation and grouping may have more than one defensible answer, so the model handles them. Datatype selection, entry ordering, identifier minting, reference wiring, and policy-defined defaults do not, so ordinary code handles them.
(resourceType, instance, keyword, value)
01 / Input
Typed narratives enter directly. Dictated audio first passes through a separate speech-to-text call using a caller-supplied key. Its hash-pinned instruction is deliberately narrow: transcribe only—no translation, summarization, speaker labeling, clinical interpretation, or silent repair.
Negation words and quantities must be preserved exactly. Unclear audio is marked unintelligible rather than completed by guesswork, and the transcript is returned with the Bundle so a reviewer can inspect what the downstream stages actually saw.
02 / Extraction
One constrained JSON-mode call emits a flat list. Every entity has exactly four non-empty strings; the model never emits a FHIR object.
The catalog closes the output space and is versioned with the prompt. FHIR datatypes
are intentionally absent from the prompt: the model supplies source meaning, while
typed FHIR models resolve representation later. The explicit instance
field makes the model’s highest-risk decision—grouping—visible and reviewable instead
of hiding it in array order.
[ reviewed rule pack ]
Rules may name only elements the assembler can build, and they may never ask the model to invent a value.
Keep a stated age as an Age Observation; do not calculate a plausible date of birth.
Represent compound readings as distinct measurements instead of forcing two numbers into one Quantity.
Resolve an offset only against a date stated in the narrative and only to supported precision.
Do not turn a negation or a relative’s history into an active diagnosis for the patient.
Separate the medication identity from dose, route, frequency, and timing so each lands in its proper element.
Give each measurement, condition, encounter, and medication its own explicit grouping key.
03 / Gate
Entity validation is deterministic and all-or-nothing. Each record must contain only the four declared fields; every value must be a non-empty string; resource and element names must belong to the catalog; the instance must match its bounded slug pattern; and the complete stream must remain under the configured ceiling.
One malformed entity rejects the stream. Silently retaining the rest would create an apparently complete Bundle from a partial account of the narrative.
04 / Assembly
Bucket records by resource type and instance; each group becomes one entry.
Apply a reviewed resource rank so model output order cannot control Bundle order.
Use UUIDv5 over a fixed namespace, conversion seed, type, and instance.
Read datatype and cardinality from typed FHIR R4 models, not from model output or a handwritten guess.
Place values only when their declared datatype accepts them; otherwise drop and report.
Create a reference only when its target type has exactly one unambiguous instance.
Point required subject fields at the sole Patient; leave ambiguity unresolved.
Fill only required 1..1 elements with a defensible policy constant; optional fields stay absent.
Mark every entry as AI-derived and identify entries containing policy-inferred defaults.
Coded concepts receive text or display only. Quantities may carry a stated unit, but no terminology system or code is asserted without a separate deterministic terminology check.
[ explainability ]
Report notes contain only an entry index, resource type, element, action, and reason. They never contain the clinical value or model-authored instance slug, making the report safe to aggregate without treating the Bundle itself as loggable.
[ why this improves on older generation patterns ]
The model interprets language and grouping; it does not invent resource structure, datatypes, references, identifiers, or codes.
A value that does not fit is reported instead of silently reshaped into something plausible.
FHIR’s typed models—not prompt memory—determine representation and cardinality.
Grounded, structurally wired, and policy-inferred content remain distinguishable downstream.
Versioned prompts, rule packs, catalogs, typed models, and deterministic assembly make a verdict explainable.
The remaining model judgment is explicit in the entity stream rather than distributed across an opaque generated Bundle.
[ privacy & boundaries ]
[ developers welcome ]
Help shape practical, trustworthy healthcare interoperability. Contribute code, improve the docs, report issues, or bring a new idea.
[ one project · four services ]
Launch the API, private HL7 validator, PostgreSQL, and Redis together. Generated secrets and database bootstrap are configured for you.