Monday, 16 November 2026

From Diagnosis to Trajectory & Pathways: Care Trajectory–Oriented Context-Aware EMR in VibeRounds


In the previous post, we introduced the Context-Aware EMR Enhancer Plugin: type a diagnosis, and the EMR reshapes itself, generating disease-specific fields mapped to FHIR R4, SNOMED CT and LOINC. For a snake-bite or DKA case, that works well.

But real patients rarely arrive as a single diagnosis.

A patient admitted with DKA may also have CKD and an infected foot ulcer. A disease-specific template fits one of those problems and ignores the other two. Worse, some of the most useful structure in a chart is not a disease at all. HbA1c monitoring, a sliding-scale insulin protocol, or a vitals chart attach to any patient, whatever the diagnosis.

This post covers the next step: the Care Trajectory–Oriented Context-Aware EMR.

The Core Concept: Start Blank, Compose as the Patient Evolves

The idea is a clean slate. A clinician opens a new case and sees one thing: a case narrative, a plain-text, FHIR-interoperable box. No forced template, no mandatory fields.

From there, the clinician adds elements or element sets as the care unfolds:

  • Vitals
  • A basic EMR template (history, examination, plan)
  • HbA1c monitoring with a sliding-scale insulin protocol
  • A disease context such as snake envenomation or DKA

Disease-specific templates break when a patient has three problems at once. Element sets compose; templates don't.

One Concept: The Element Set

To keep the design simple, everything becomes an element set, with a kind field that says what it is:


  • Kind
  • What it is
  • Example
  • disease
  • Context generated from a diagnosis (our existing LLM flow)
  • Snake envenomation, DKA
  • care
  • A care pathway that is not a diagnosis
  • HbA1c monitoring, sliding-scale insulin
  • template
  • A general-purpose structure
  • Basic EMR template
  • pathway
  • An ordered bundle of other element sets, applied in one click
  • DKA admission pathway
  • custom
  • Built by the clinician or institution
  • Unit-specific checklist



Our existing schema contract already fits this. We only add kind, id, version, and optional requires / suggests links. The earlier disease flow simply becomes: generate an element set from a diagnosis.

The case model

A case is now:

  • a narrative (the root), plus
  • a list of applied element sets, stored as case.applied = [{ setId, addedAt }], with entered data in case.values.

Because composition is additive, the FHIR bundle builder keeps working unchanged in spirit: it iterates over all applied sets instead of one.

Separating Disease Context from Care Context

This is the key design insight. A disease context answers "what is wrong?" A care context answers "how are we managing and watching this patient?"

HbA1c monitoring with sliding-scale insulin is a care pathway. It belongs to the patient's journey, not to a diagnosis, so it can be attached to a DKA patient, a post-operative patient, or a steroid-induced hyperglycaemia patient alike. This is what makes the phrase "context can be expanded" a real property of the system rather than a slogan.

Pathway Templates: Bundles of Element Sets

Adding element sets one by one gives flexibility, but for common situations clinicians want a head start. That is what pathway templates are for.

A pathway template is a named, ordered bundle of element sets that can be applied in one click. For example, a "DKA admission pathway" might bundle:

  • Vitals
  • Basic EMR template
  • DKA disease context
  • Glucose monitoring with sliding-scale insulin
  • HbA1c monitoring

Other pathways could cover a post-operative diabetic patient, an ICU admission, or a snake-bite protocol.

How pathways fit the model

  • A pathway is just another registry entry with kind: "pathway", containing a list of member setIds (plus optional requires / suggests links).
  • Applying a pathway adds each member to case.applied individually, so the case stays a flat, additive composition. Nothing about the FHIR builder or analytics changes.
  • The application can record which pathway a set came from (for example fromPathway), so the clinician can see the origin and so analytics can measure pathway usage.
  • A pathway is a starting point, not a lock-in. After applying it, the clinician can remove sets they don't need or add others, and the narrative box stays the root throughout.

Who defines pathways

Pathways reflect institutional practice, so they are clinician- or institution-defined data, versioned and editable, not generated by an LLM. A clinician can also build a pathway from a case they have already composed ("save this combination as a pathway"). Pathways then become the most-used chips in the sidebar, alongside individual sets, so a whole admission workup is one click away.

Pathway templates are also the clearest example of why the clean slate matters: the starting point is empty, but the shortcuts to a complete structure are always one click away.

Care Needs Time: Repeating Fields and Trajectories

A form captures a snapshot. Care is a trajectory.

HbA1c is measured repeatedly. Sliding-scale insulin is a series of glucose readings, each with a dose given against a band. So the schema gains one important feature: fields can be marked repeat: true, turning a single value into a mini-table of timestamp + value entries.

On top of that sits a trajectory view: repeated values plotted over time as lightweight inline SVG charts, with no heavy charting library. This is the change that turns the tool from a form builder into a care-trajectory tool.

Handling Protocols Safely: The Sliding Scale

Sliding-scale insulin is a protocol, and protocols affect patient safety. Our rules:

  • The scale (glucose band → units) is editable data defined by the clinician or institution, not something an LLM invents.
  • It is labelled "protocol-defined, clinician-verified."
  • Dosing logic stays user-entered. The LLM never suggests doses.
  • The "not for clinical use, synthetic data" banner stays prominent.

LLMs are useful for generating context (which fields matter for a condition). They should not be the source of dosing numbers.

One-Click Access: Usage-Ranked Suggestions

Clinicians repeat themselves. The sidebar therefore shows the most-used element sets as one-click chips, with a search box for the rest.

This is personalisation without machine learning: a simple counter in localStorage increments whenever a set is applied, and the top 5 to 8 appear as suggestions. A later extension can rank by diagnosis ("sets most used with this diagnosis"), which is where context-aware and most-used meet.

Narrative to FHIR

The narrative box starts simple: plain text saved into the FHIR bundle as a Composition text section (or DocumentReference). An optional LLM button, "suggest element sets from this narrative", reads the free text and proposes relevant sets, a natural step toward true context-awareness while keeping the clinician in control of what gets applied.

Future Scope, Built In as Data

A contexts registry sits at the top of the UI as a dropdown. Today it offers:

  • Disease
  • Care pathway

Alongside them are disabled placeholders for future contexts:

  • Specialty (e.g. cardiology, nephrology)
  • Setting (ICU, OPD, ward)
  • Population (paediatric, geriatric, obstetric)

Because contexts are registry data rather than hard-coded logic, adding a new axis later is cheap, and the expansion story is visible in the interface today.

Codes: Verify Before You Bind

Care elements such as HbA1c, glucose, blood pressure and heart rate have well-known LOINC codes. We keep the same rule as before: a code enters the verified table only after it has been looked up and confirmed, never copied from model output.

Why This Matters

Static EMRs force the patient into the form. Disease-specific EMRs improved on that, but still assume one problem at a time. A trajectory-oriented, composable EMR follows the patient instead: blank at the start, enriched as the clinical picture develops, and structured and interoperable throughout.

Project repository: VibeRounds-Clinical-Analytics-App

Live demo: https://viberounds-clinical-analytics-app.onrender.com/ (contact me for access: avi33tbtt@gmail.com)

Disclaimer: this is a prototype using synthetic data and is not for clinical use.

Sunday, 15 November 2026

Beyond Static EMRs: Introducing the Context-Aware EMR Enhancer Plugin in VibeRounds

Traditional Electronic Medical Records (EMRs) are built like filing cabinets. They offer static, rigid forms designed for billing and retrospective auditing rather than active clinical cognition. If a patient presents with Acute Snake Envenomation, a standard EMR presents the same generic vitals and chief complaint boxes as it would for a routine ankle sprain or a routine checkup.

In high-acuity, time-sensitive clinical environments, static forms fail. They miss critical context. For instance, in snake envenomation, the exact time gap between the bite and the administration of Anti-Snake Venom (ASV) is a primary prognostic determinant. If your EMR doesn't explicitly prompt for it, structure it, and map it, vital data gets buried in unstructured clinical notes.

To bridge this gap, we are introducing the Context-Aware EMR Enhancer Plugin into the open-source VibeRounds Clinical Analytics App.

The Core Concept: Diagnosis as an Active Schema Modifier

The philosophy behind the EMR Enhancer is simple: The diagnosis should dictate the data structure.

Instead of forcing clinicians to hunt through endless menus or rely on memory to capture disease-specific nuances, the enhancer turns the primary diagnosis into an active schema modifier.

  1. Contextual Generation: The clinician inputs a diagnosis (e.g., Hemotoxic Snake Envenomation) alongside any custom clinical instructions or institutional trial protocols.

  2. LLM Orchestration + Deterministic Guardrails: Leveraging the app's BYOK (Bring Your Own Key) architecture, the system queries an LLM to generate high-yield, disease-specific clinical fields tailored precisely to that presentation.

  3. Standards-Compliant Interoperability: Every generated field is automatically mapped to standard FHIR R4 resources (Observation, Condition, MedicationAdministration) and anchored to international healthcare ontologies (SNOMED CT and LOINC).

What the Enhancer Delivers

When you run a diagnosis through the plugin, the output goes far beyond a basic text box. It delivers three core pillars:

1. Context-Aware Clinical Fields

The plugin generates granular parameters that matter for that specific condition. Taking Snake Envenomation as an example, the dynamically rendered form immediately prompts for:

  • Time Elapsed: Precise duration between bite and ASV administration.

  • Coagulopathy Screening: Standardized inputs for the 20-Minute Whole Blood Clotting Test (20WBCT).

  • Therapeutic Tracking: Exact vial counts, administration routes, and immediate adverse reaction monitoring.

2. Native FHIR R4 Integration

Data capture shouldn't create data silos. Every user input is dynamically wrapped into valid FHIR R4 JSON bundles, ensuring your clinical workflow is instantly interoperable with external health data systems and VibeRounds' core analytical engine.

3. Rigorous Ontology Bindings

Ambiguity is the enemy of clinical data science. The plugin automatically assigns:

  • SNOMED CT codes for clinical findings, procedures, and conditions.

  • LOINC codes for lab values, timing intervals, and quantitative metrics.

Closing the Loop: Contextual Data Analytics

Collecting structured data is only half the battle. The new EMR Enhancer tab includes an integrated Analytics Dashboard designed to evaluate case cohorts in real time:

  • Protocol Adherence & Timing Metrics: Instantly compute cohort-wide medians (e.g., tracking whether ASV administration times are staying within the critical golden window).

  • Data Coverage & Completeness: Measure how thoroughly high-yield contextual fields are being populated across different clinical cases.

  • Ontological Binding Rates: Track the proportion of captured narrative data successfully mapped to standardized terminologies.

Open Source & Built for Adaptability

True to the VibeRounds ethos, this plugin is open-source, modular, and privacy-first. By combining deterministic analytics with flexible LLM prompt orchestration, clinicians and health IT developers can rapidly spin up disease-specific EMR schemas for any clinical domain—from toxicology and acute trauma to rare chronic conditions.

The code and architecture are live in the repository. We invite clinicians, informatics researchers, and developers to explore the codebase, test out the new EMR Enhancer tab, and contribute to building truly intelligent, patient-centered health systems.

Check out the project repository on GitHub: VibeRounds-Clinical-Analytics-App

Next post - From Diagnosis to Trajectory & Pathways: Care Trajectory–Oriented Context-Aware EMR in VibeRounds 

live demo project - https://viberounds-clinical-analytics-app.onrender.com/  ( contact me to get access  - avi33tbtt@gmail.com )


A pattern encyclopedia for clinical analytics: adding context, time and uncertainty on top of existing EHR data

 

A pattern encyclopedia for clinical analytics: adding context, time and uncertainty on top of existing EHR data

By [author name]. Written for clinical health informatics readers.

Most EHR data reaches analysts as flat labels: a diagnosis code, a drug code, a date. The clinical reasoning that produced those labels, such as how the diagnosis changed, which qualifiers applied and how sure anyone was, is mostly lost. This article explains the reasoning behind a design for the Vibe Rounds clinical analytics app: a clinical pattern encyclopedia that sits on top of data an institution already has, expresses clinical knowledge in plain English and in machine-readable form, runs it with deterministic code, and attaches explicit labels for uncertainty to every result.

Status. The analytics engine, terminology tools and review workflows described in section 7 exist in the app. The encyclopedia itself is a design plan that has not been built yet. Where this article describes planned work, it says so.

1. The problem: a diagnosis that does not stay still

A patient arrives and is given a diagnosis. Qualifiers are added. The diagnosis is refined, sometimes replaced. Other departments join, each with its own vocabulary: pathology describes morphology, radiology describes imaging findings, primary care describes syndromes. Complexity grows with every handover.

A single code at the end of the episode cannot hold this story. Yet the questions analysts and researchers ask later often depend on exactly the lost detail: which side, how severe, confirmed or only suspected, treated or not, and in what order.

2. What SNOMED CT gives you, and what it does not

SNOMED CT is a clinical terminology, not a patient database. It contributes three things that matter here.

  • A hierarchy built on description logic. Concepts are linked by is-a relationships, so a query for a parent concept can include every child. A record coded with a specific disorder is still found by a query for its broader category.
  • Post-coordination. When no single concept captures the clinical meaning, a concept can be combined with attribute-value pairs such as finding site or laterality. The Machine Readable Concept Model (MRCM) defines which attributes may attach to which concepts, which in principle prevents impossible combinations.
  • History of the terminology itself. Retired or replaced concepts carry historical associations, so old records stay interpretable across releases.

What SNOMED CT does not do is store a timeline. How a diagnosis moves from suspected to confirmed to resolved, who changed it and when, is the job of the record model. In FHIR, for example, the Condition resource has fields for clinical status, verification status, severity, body site, onset and abatement. SNOMED CT supplies the meaning of the values; the record structure supplies the time and the status.

3. Where context gets captured

Context can be added at three points, and they are not equal.

  • At the point of care. The clinician chooses qualifiers in the interface and the system builds the structured record. This is a deterministic assertion: the clinician said it.
  • At mapping time. A terminologist maps local codes to concepts or expressions when legacy systems are connected.
  • Retrospectively, in an analytics layer. Code, rules or models read what exists and reconstruct context afterward. This is inference, not assertion. If laterality was never recorded, no reconstruction can supply it.

Two storage choices follow. One is to store post-coordinated expressions as strings. The other is to decompose them into dedicated fields, such as body site, severity and verification status. Decomposed fields are far easier to index and query in a relational database without a live reasoner, which is why many pragmatic designs prefer them.

A subtler problem is where the terminology ends and the data model begins. Is “suspected acute appendicitis” one concept, or appendicitis plus a verification status plus an acuity? Two hospitals can make different choices, and both can be standards-compliant. The result is data that can be exchanged but whose clinical context is not interoperable. Documentation habits add another layer: if a screen makes qualifiers easy to record, one site looks sicker than another simply because it recorded more detail.

In practice, ontology-driven data entry, where the terminology itself decides which qualifiers the form asks for, is uncommon in routine clinical systems. Most deployments use templates and value sets that informaticists maintain by hand, which keeps screens predictable and fast. Specialized platforms built on FHIR questionnaires with a terminology server, and openEHR systems built on archetypes and templates, can enforce more structure, but they bring their own cost: dedicated repositories, a different query language and substantial modelling work before the first screen exists. They are powerful and heavy.

4. Two halves of one problem

The central insight of this design is that the problem splits into two parts that need different treatment.

Representation is translating clinical meaning into a machine-readable form. It is an engineering problem. With good terminology, careful profiling and validation, it is solvable.

Epistemics is about what kind of knowledge a record holds. A serum creatinine value is a measurement. “Acute-on-chronic kidney injury secondary to sepsis” is a clinician’s synthesis that may be revised tomorrow. A working diagnosis is not a confirmed one. Two skilled clinicians document at different levels of detail. No amount of better representation removes this. It has to be carried with the data and shown to the reader.

Many systems solve the first half and silently ignore the second. This design treats both as first-class.

5. The middle-module idea

Waiting for every EHR to redesign its screens is not a plan. The alternative is a module that sits downstream of the existing registry, reads the data already there and adds meaning afterward. It needs no change to clinical workflow and works on historical data, which makes it backward compatible until systems capture richer context at source.

The cost is honesty about what retrospective work can do. It is reconstruction, not assertion. So every reconstructed element needs provenance and a label that says how it was obtained. Section 10 describes those labels.

A custom study pipeline solves one question at a time. The step proposed here is to make the knowledge reusable: an encyclopedia of patterns, each stored, reviewed and runnable, in the way a terminology stores concepts.

6. Temporality: code instead of CQL, for now

Clinical Quality Language (CQL) is the standard for expressing clinical logic with time, such as “within 30 days after discharge”. Its strengths are real: portability between systems, the ability to run published quality measures, and interval operators designed for clinical time. Its costs depend on the setting. CQL is translated to an intermediate form and executed by an engine that usually evaluates one patient at a time, which adds toolchain and can be slow for population analytics.

Vibe Rounds takes a different route. FHIR data is imported into PostgreSQL tables, grouped in batches and populations, and temporal logic is written as set-based SQL with an explicit as-of date. The existing analytics already compute time windows, first and last events, time to event, 30-day readmission, medication fill intervals and persistence, and landmark study designs.

The decision for now is to stay with SQL and to keep the new pattern specification declarative and small, so it can later be exported to a standard format. What is given up is the ability to run third-party measures as written. If that becomes a requirement, an import path can be added.

7. What the app already does

The encyclopedia is designed to reuse existing parts, not replace them.

  • Data and scope. Imported FHIR resources live in per-batch PostgreSQL tables. Populations, batches and saved cohorts define the scope of every analysis.
  • Data-quality levels. The analytics catalog runs in five modes, from text matching only, through source codes, to codes with time and reviewed enrichment. A reader can see how much each result depends on code quality.
  • Dictionary and hierarchy. A dictionary can be built from the codes actually present in the imported data. A separate hierarchy of is-a links can be loaded from a bundled demo set, a CSV file or real SNOMED CT release files. A query builder uses it to include descendants or ancestors. The dictionary alone does not create hierarchy; the loaded links do. Today only the query builder and cohort criteria use hierarchy.
  • Reviewed enrichment. Free-text entries can be proposed codes by a model, then approved, edited or rejected by a person. The record keeps assertion (confirmed, suspected, negated), confidence, model, prompt version and reviewer.
  • Guardrailed AI. A study-planning feature lets a model propose analyses from aggregate counts only. The server rebuilds every proposal from a fixed list of templates and drops unknown codes. A read-only SQL guard protects free-form queries.
  • Exploration and trace. Care pathways, a patient explorer, a cohort knowledge graph and an audit log, including a class for requests sent to an external model.

Two limits matter for what follows. First, resolution dates, medication end dates and stop reasons are not extracted as fields, so they cannot define a pattern yet. Second, the app does not capture post-coordinated qualifiers at entry; it works with what the source data contains.

8. The pattern encyclopedia

An entry has four parts: a plain-English statement, a machine-readable specification, epistemic labels, and a review state. Entries are data, so adding knowledge does not require adding code.

The specification uses only things the app can already compute.

  • Value sets. Named sets of codes for conditions, medications, labs or procedures, either exact codes or a concept with its descendants, taken from the loaded hierarchy.
  • Events. For example, the first diagnosis from a value set, or the first fill of a drug on or after it.
  • Time relations. A short, fixed list: within a number of days, before, after, none in a window, no refill after the supply ends plus a grace period, return within a number of days, latest value in a window, and at least a number of occurrences. These mirror logic the analytics already run. Anything outside the list is rejected.
  • Needs. The fields a patient must have to be evaluated.

The executor is ordinary code. It turns a validated specification into parameterized SQL over the same scoped views the analytics use. No model text ever enters SQL. A patient who lacks the needed dates is reported as “cannot evaluate”, with the reason, and is never silently counted as “no match”. Small groups are hidden using the same minimum-cell rule the care-pathway feature uses.

Three ways to create a pattern

All three produce a draft that a reviewer must approve before it can run on a full population.

  • From one case. A clinician picks a patient. Code abstracts the case: identifiers, names, birth date and address are removed, dates become day offsets from the first event, age becomes a band, and free-text narrative is dropped. A draft specification is built from the ordered events. A model may be used only to word the plain-English statement, and only if an explicit setting allows it and the request is audited. A single abstracted case can still be identifying when the combination of events is rare, so this is a policy decision as much as a technical one.
  • From a few cases. Code finds the codes shared by most selected patients, including descendants when a hierarchy is loaded, together with their usual order and the range of days between events. Only these aggregates are used, and groups below the minimum-cell rule are not summarized.
  • From an external library. Patterns can be imported from a file in the app’s own format, which also allows export between deployments. Every imported pattern is validated and arrives as a draft. Converters from other formats, such as OHDSI cohort definitions or CQL, are future work.

9. Where AI fits

The model is a drafter and an explainer, not a source of numbers or diagnoses.

  • It writes the specification as structured data, never SQL. A validator rejects unknown relations, fields and out-of-range values.
  • Code choices come from candidate lists built from the app’s dictionary. The model may not invent codes.
  • Every draft records the model, prompt version, time and source.
  • A model can never raise certainty above “hypothesis”. Only a reviewer can.
  • Counts come only from the executor. The explanation step may not add figures, and it must state the uncertainty labels first.

This follows a pattern the app already uses for study planning: the model proposes, the server checks, and only checked output reaches the user.

10. Epistemic uncertainty

Uncertainty lives at three layers, and each gets a few fixed labels now. A free list of tags is reserved so a broader structure can be added later without changing the specification.

Knowledge layer (the pattern). How well established is the clinical statement?

  • Certainty: established (a guideline or consensus states it), supported (some studies or clear expert practice), hypothesis (plausible or seen in data, not confirmed), contested (sources disagree, and a note says how).
  • Basis: guideline, literature, expert, observed in data, model suggested.
  • Claim: descriptive (what usually happens), association (two things go together), causal (one is claimed to cause the other).

Data layer (each record). How firm is the fact in the source?

  • Assertion: confirmed, suspected, negated (already in the app).
  • Evidence: documented (a coded field in the source), derived (computed from dates and gaps, for example “stopped” meaning no refill), inferred (from text or a model).

Run layer (this result). Can this run be trusted as it stands? Code computes these from numbers alone.

  • Thin: fewer eligible patients than a low-number limit, or matches below the minimum-cell rule.
  • Gappy: a large share of eligible patients cannot be evaluated because data is missing.
  • Weak hierarchy: the pattern uses descendants but only demo links, or none, are loaded.

Several rules keep the labels honest. Model drafts and patterns mined from cases start at “hypothesis”. “Established” and “supported” require a source note. A causal claim requires at least “supported”, otherwise it is rejected and the result is treated as an association. Suspected and negated records are not counted as confirmed unless the pattern says so. Every change of certainty is written to the audit log with who, when, from, to and why.

Every result carries three chips: knowledge, data and run. For example: Knowledge: hypothesis, observed in data. Data: 70% documented, 30% derived. Run: thin, gappy. A reader sees at a glance how much weight the result can bear.

11. A worked example

Take the plain-English statement: viral fever patients were given antibiotics for five days, but the illness resolved in three days, so they stopped the medication.

The sentence mixes three kinds of meaning. The concepts (viral illness, antibacterial drug) belong to the terminology. The timing (given for five days, resolved in three) belongs to temporal logic. The causal clause (so they stopped) is an interpretation that no database field can confirm.

In the app today there is no resolution date and no medication end date as fields. The pattern is therefore written with definitions derived from what exists:

  • the illness is “resolved” when there is no further record of it within a window after the first diagnosis;
  • the antibiotic is “stopped” when there is no refill after the supply period plus a grace period;
  • the antibiotic starts within a few days of diagnosis.

The run reports how many patients match, how many could not be evaluated and why, and how much of the evidence was derived. The pattern is labeled as an association at the “hypothesis” level.

The reading of such a result needs care. A missing record does not prove recovery: the patient may have gone elsewhere, or the first diagnosis may have been wrong. That is why derived evidence and the claim type are shown next to the count, and why the explanation is limited to “is associated with”.

12. Limits and open questions

  • Derived is not documented. Absence of a record is not absence of an event. Derived definitions should be replaced by documented fields when the data allows.
  • Retrospective work cannot create context that was never recorded. The design reports gaps; it does not fill them with guesses.
  • Hierarchy quality depends on what is loaded. Real descendants need a real terminology release, and its licence terms must be checked for the deployment’s country.
  • Documentation bias remains. A pattern may look rare because one site rarely records the needed fields. A per-site completeness report is planned.
  • Privacy of single cases is reduced by abstraction but not eliminated.
  • Not decision support. Patterns are for exploration, research and review, not for guiding treatment.
  • Prior art exists. Cohort and phenotype definitions in the OHDSI community already store concept sets with descendants and temporal criteria in a structured format. What this design adds is the combination: a plain-English encyclopedia, a validated compile-and-review loop, and uncertainty labels that travel with every result.
  • It needs evaluation. Clinician agreement with drafted patterns, and the accuracy of derived definitions against documented ones, should be measured on real data.

13. Roadmap

The plan has six build phases, each small and tested on synthetic data:

  1. A pattern store and validator, including the uncertainty fields and their rules.
  2. An executor with three hand-written patterns, one checked against the existing readmission analytic, and computation of the run labels.
  3. Creation from one case.
  4. Creation from a few cases.
  5. Import and export of a library file.
  6. A review screen and a patterns tab showing the three chips on every result.

Future development covers: reading resolution, stop and status fields from the source, using the hierarchy throughout the analytics catalog, loading SNOMED attributes for constraint queries, hierarchies for drugs and labs, post-coordinated qualifiers as fields, pattern discovery from frequent sequences, converters for other pattern formats, other source formats such as openEHR, per-site documentation-bias reports, pattern sharing with versioning, and a broader uncertainty structure with graded evidence and listed supporting and conflicting sources.

14. Conclusion

The design rests on a simple separation. Terminologies such as SNOMED CT give machines a precise language. Record standards such as FHIR give that language a time and a status. A deterministic engine gives questions a reliable answer. And an explicit uncertainty layer keeps anyone, human or model, from mistaking an inference for a fact.

Building this as a middle module over existing data means the approach can start small, with a few patterns and a few dozen patients, and grow with the data and the institution. The most important feature is not any one pattern. It is that every result says what kind of knowledge it is, where it came from and how far it can be trusted.

Where feedback would help

  • Are four certainty labels and three claim types the right size to start with, or are they too coarse?
  • Which derived definitions, such as “resolved” or “stopped”, would your clinicians accept before documented fields exist?
  • What would you need to see before trusting a pattern drafted from a single abstracted case?

How SNOMED CT Keeps Meaning Intact When a Patient's Diagnosis Keeps Changing

 

How SNOMED CT Keeps Meaning Intact When a Patient's Diagnosis Keeps Changing

A patient arrives. A diagnosis is assigned. Qualifiers get added, then revised, and sometimes the diagnosis itself shifts. Care spreads across departments and complexity grows. How does a clinical terminology cope with that?


Note :- written with help of Ai.


The Short Answer

SNOMED CT is a clinical terminology, not an EHR database. It does not store a patient's timeline. What it provides is the meaning layer: a formal, machine-readable vocabulary that lets every system and department describe the same clinical reality in the same way, at every point in the journey.

The timeline itself is the job of the EHR or data standard (HL7 FHIR, openEHR) that uses SNOMED CT codes. The two work as a pair:

LayerResponsibility
SNOMED CTWhat does this term mean? How does it relate to other concepts?
EHR / FHIR / openEHRWhen was it recorded? By whom? Is it active, resolved, or ruled out?

1. Qualifiers That Accumulate: Pre- and Post-Coordination

A diagnosis rarely stays simple. Severity, laterality, clinical course and cause get added over time. SNOMED CT handles this in two ways.

Pre-coordination: a single concept already bundles the condition and its qualifier, such as Acute viral pharyngitis.

Post-coordination: when no pre-coordinated concept exists, you build an expression using SNOMED CT's compositional grammar, combining a base concept with attribute-value pairs:

64572001 |Disease| :
    363698007 |Finding site| = 39607008 |Lung structure|,
    116676008 |Associated morphology| = 23583003 |Inflammation|

This means the record can carry precisely the qualifiers a clinician has established so far, without SNOMED CT needing a new concept for every possible combination.


2. Diagnoses That Get Refined: Subsumption and Description Logic

As a patient moves through care, a vague presentation typically becomes specific:

Abdominal pain → Right lower quadrant pain → Acute appendicitis

SNOMED CT is built on description logic. Every concept is formally defined by its relationships, chiefly the Is-a hierarchy. Because of this, systems can run subsumption queries: Acute appendicitis is recognised as a kind of Appendicitis, which sits under broader disorder concepts.

The practical payoff is that nothing is lost when a specialist records a very specific diagnosis. A GP's summary view, a population-health query or a department-level report that asks for the broader parent category will still find the patient.


3. Bridging Departmental Silos

Pathology talks in morphology. Radiology talks in imaging findings. Primary care talks in syndromes. Left alone, each builds its own local vocabulary and the data fragments.

SNOMED CT cross-links anatomy, morphology, findings, procedures and disorders in one connected model. A finding recorded in pathology can therefore be logically linked to, and queried by, oncology or cardiology. The result is a shared semantic foundation rather than department-specific jargon.


4. Tracking the Timeline: Where FHIR Comes In

This is where SNOMED CT's meaning meets the EHR's memory. In FHIR R4, the Condition resource carries the SNOMED CT concept alongside the lifecycle information that terminology deliberately leaves out.

FHIR elementRole in longitudinal trackingSNOMED CT involvement
Condition.codeThe diagnosis itselfSNOMED CT concept or expression
Condition.bodySiteAnatomical locationSNOMED CT body structure
Condition.severitySeverity as it evolvesSNOMED CT qualifier values
Condition.stageDisease stageSNOMED CT or specialty scales
Condition.clinicalStatusactive, recurrence, relapse, inactive, remission, resolvedHL7 value set
Condition.verificationStatusunconfirmed, provisional, differential, confirmed, refuted, entered-in-errorHL7 value set
Condition.onset[x] / abatement[x]When it began and endedn/a
Condition.recordedDate, recorder, encounterWho recorded it, when and in which encountern/a
Provenance / AuditEventWho changed what, and which departmentn/a

A simple, realistic evolution might look like this:

  1. Day 1, Emergency: Condition with Abdominal pain, verificationStatus = provisional.
  2. Day 1, Surgery: a new Condition with Acute appendicitis, confirmed. The earlier pain record is marked resolved or linked as a symptom.
  3. Day 3, Pathology: an Observation or DiagnosticReport adds morphology findings, also coded in SNOMED CT.
  4. Later, Primary care: a query for the broader parent concept still returns this patient.

Each step is a new, timestamped, attributable record. SNOMED CT guarantees that the meaning of each code is the same in every department.

Querying with the hierarchy

FHIR terminology services expose SNOMED CT's logic directly:

  • ValueSet/$expand with an ECL (Expression Constraint Language) filter, e.g. << 74400008 |Appendicitis|, returns all descendants.
  • CodeSystem/$subsumes tests whether one concept is a subtype of another.
  • Post-coordinated expressions can be carried in Coding.code with the SNOMED CT system URI (http://snomed.info/sct), though support varies between systems, so check your terminology server.

5. When the Terminology Itself Changes

SNOMED International publishes releases regularly, and over the life of a long record, concepts can be retired, replaced or split. SNOMED CT handles this with Historical Association Reference Sets, machine-readable maps such as REPLACED BY, SAME AS, POSSIBLY EQUIVALENT TO and MAY BE A. These keep decade-old records connected to current concepts, so analytics and decision support do not break.

Note that some associations point to more than one candidate, so migrating old data is not always automatic and sometimes needs clinical review.


Is It a "Single Source of Truth"?

Close, with one precision: SNOMED CT is the single source of truth for meaning, not for the patient record. It helps to ensure that:

  • Semantic drift is prevented. Myocardial infarction means the same in the ED, in cardiology, in research and in billing.
  • FHIR bindings have teeth. Coded resources can be validated, queried and reasoned over, not just stored as free text.
  • Handovers stay coherent. The patient's narrative survives every transfer between departments.

The record's truth (what happened, when, and who said so) still lives in the EHR's data model, provenance and versioning.


Key Takeaways

  1. SNOMED CT supplies meaning; the EHR supplies time and workflow.
  2. Post-coordination absorbs shifting qualifiers without concept explosion.
  3. Subsumption means refining a diagnosis never hides the patient from broader queries.
  4. In FHIR, pair SNOMED CT codes with clinicalStatus, verificationStatus and Provenance to track the journey.
  5. Historical associations protect old records as the terminology evolves.

Note: SNOMED CT concept IDs and FHIR element behaviours above are illustrative. Verify against the current SNOMED International release and the FHIR R4 specification before implementing.