The Context Engine Studio is now open source.  View on GitHub →
Clinia
Concepts

Narratives

How the Clinia Context Engine draws an account out of the prose in an ingested document, groups what speaks to the same thing, and relates it to facts without changing them.

Narratives

A narrative is a piece of information documented about the patient in unstructured text: the assessment, the plan, the paragraph explaining why a medication was stopped. It is not a copy of that text but a single titled account of what one or more passages say, assembled so it can be set against the structured clinical record and related to the facts it concerns. The text it was drawn from is kept underneath, and everything in the narrative is derived from it.

Today, narratives do not produce facts

A narrative relates to facts rather than producing them. The facts it is checked against are the ones the document's coded content already yielded, and prose is not promoted into a fact of its own. Deriving facts from the prose directly is a direction the engine is expected to take, and not something it does now.

How prose becomes a narrative

Fact extraction reads a document's coded content and leaves the prose behind. Narratives pick it up in three steps:

  1. The text is stored exactly as it arrived. This copy is never modified, and everything below is derived from it.
  2. It is rendered to plain text as a passage, the unit that gets compared.
  3. Passages are clustered by meaning, and each cluster becomes one narrative with a title and a short summary of what it says.

Clustering is semantic rather than textual, so a finding restated across a year of notes becomes one narrative instead of twelve, and a passage resembling nothing else becomes a narrative on its own. Where two passages are neither clearly the same nor clearly different they are left unmerged, the same threshold behaviour as entity resolution.

Enriching the record without changing it

Each narrative is checked against the facts it speaks to. Where that check produces a judgement, it is recorded as a relationship from the narrative to the fact:

EdgeWhat it means
corroboratesThe prose agrees with what the record holds
enrichesThe prose adds context the record does not carry
conflictsThe prose disagrees with the record

A narrative never mutates the fact it relates to, and is never promoted into one. This matters most for conflicts: when a note contradicts the record, the fact keeps its value, status and confidence, and the disagreement is recorded beside it with the reasoning behind it.

That is deliberate. A note saying a medication was stopped might be an error, a draft, or the most current information available, and the document alone cannot tell you which. Rewriting the fact would settle that question silently and lose the evidence for it. Recording the disagreement keeps both readings visible and leaves the decision to the reader.

See Relationship Inference for how these relationships are typed and stored.

When narratives are created

Narratives are built during ingestion, and the checks against facts run in the same pass. Each ingest works over what it changed on either side: the facts it just resolved are checked against the narratives already held, and the narratives it just built are checked against the facts already held.

Each ingest rewrites the relationships for what it touched. A comparison that finds nothing worth recording writes no relationship, and one that no longer holds is removed rather than left standing, so what you read is always the current judgement.

Not every pair is compared

Two things that were both already in the record are not re-examined unless something already links them, and each side is capped at a fixed number of partners per ingest so that cost follows the change rather than the size of the record. A missing relationship therefore means no judgement stands today, which is not the same as the pair having been ruled out.

Where narratives show up

Every narrative linked to a condition is readable under that condition at _narratives/, and the condition's story ends with a section linking each one. See VFS Paths for the full path reference.

Narrative content is not searchable

Those two paths are the only routes to a narrative. Narrative content is not in the full-text index, so search will not find a phrase that appears only in the document's prose.

Reading the original text

A narrative gives you the reasoning behind a judgement, whether it corroborates, enriches or conflicts with a fact. It does not give you the note it was drawn from. To read the wording as it was originally recorded, browse the document under /sources/.

On this page