Healthcare Patient Journey Analysis Platform with Multimodal LLMs

john_snow_labs · Healthcare · 2024 · source Agentic: yes · promotional bias: high · source-backed · extracted with prompt 0.5.6 (schema v2)

Generated from extraction.json — do not edit by hand. Every claim cites verbatim source evidence; stated means the quote directly asserts the claim, implied means it supports it indirectly.

Problem

Domain: healthcare multimodal patient-journey analytics

John Snow Labs needed an enterprise healthcare platform that could unify messy structured, unstructured, FHIR, and imaging-derived patient data into longitudinal patient journeys, then answer natural-language clinical and cohort questions with references, explanations, and production-grade privacy controls.

Constraints:

Architecture

John Snow Labs built a customer-hosted Kubernetes platform that ingests structured EHR data, unstructured clinical notes, FHIR resources, imaging-derived data, and other documents. Healthcare-specific LLMs extract clinical entities, assertion status, relations, codes, and dates; terminology services normalize those entities to SNOMED and other code systems; temporal normalization maps relative dates to concrete dates; and a reasoning/deduplication layer builds a patient knowledge graph with provenance, confidence, and traceability. The normalized record is stored in an OMOP-based relational database, extended where needed for explainability and confidence metadata. On top of that database, a natural-language query agent uses a RAG-like query-template tool, terminology expansion, schema/SQL adjustment, optimized execution, and explanation rendering so users can ask patient, cohort, risk-score, and decision-support questions without manually writing SQL.

Diagram confidence: reconstructed (reconstructed from prose).

flowchart LR
  A["Customer infrastructure deployment"] --> B["Multimodal data connectors"]
  A --> C["Kubernetes runtime"]
  B --> D["Information extraction LLMs"]
  D --> E["Terminology service"]
  D --> F["Temporal normalization service"]
  E --> G["Reasoning and deduplication layer"]
  F --> G
  G --> H["OMOP relational store"]
  H --> I["Natural-language query agent"]
  I --> J["RAG query-template tool"]
  J --> K["Schema adjustment tool"]
  I --> E
  K --> L["Optimized query execution layer"]
  L --> H
  L --> M["Explanation and reference UI"]
  H --> N["BI and data science tools"]
  H --> O["Risk-score containers"]
Drag to pan · scroll or use +/− to zoom · reconstructed from the source's described component topology

Components

Component Role Interacts with
Customer infrastructure deployment On-prem, cloud, or data-platform deployment boundary where PHI, processing, models, and data remain inside the customer's security perimeter. Multimodal data connectors, Kubernetes runtime
Kubernetes runtime Container orchestration layer with separately scalable components for GPU, CPU, OCR, data loading, failover, and monitoring. Information extraction LLMs, Terminology service, Temporal normalization service, Reasoning and deduplication layer
Multimodal data connectors Loads structured data, unstructured notes, FHIR resources, PDFs, imaging-derived data, and tabular free-text fields. Information extraction LLMs, Terminology service
Information extraction LLMs Healthcare-specific LLMs and NLP models that extract medications, diagnoses, social determinants, family history, negation, plans, biomarkers, radiology findings, and other clinical entities. Terminology service, Temporal normalization service, Reasoning and deduplication layer
Terminology service Maps extracted terms and source codes to standard clinical vocabularies such as SNOMED, RxNorm, NDC, and other terminologies. Reasoning and deduplication layer, Natural-language query agent
Temporal normalization service Resolves relative dates and temporal expressions into concrete dates so patient timelines and time-window queries can be answered. Reasoning and deduplication layer
Reasoning and deduplication layer Merges duplicate, uncertain, repeated, or conflicting extracted facts into a patient knowledge graph while preserving confidence, specificity, and provenance. OMOP relational store
OMOP relational store Extended OMOP common data model used as the open relational substrate for unified patient data, traceability, confidence, SQL access, dashboards, and notebooks. Natural-language query agent, BI and data science tools, Risk-score containers
Natural-language query agent Multi-step agent that maps user questions to optimized query templates, terminology expansions, SQL/schema edits, execution, aggregation, and explanations. RAG query-template tool, Terminology service, Schema adjustment tool, Optimized query execution layer, Explanation and reference UI
RAG query-template tool Retrieves similar prebuilt queries that are known to run efficiently and correctly over the patient database. Natural-language query agent, Schema adjustment tool
Schema adjustment tool Adapts retrieved SQL or query shapes by adding, removing, or replacing fields to match the user request. Optimized query execution layer
Optimized query execution layer Executes approved optimized queries using indexes, materialized views, caching, and query constraints to avoid unsafe broad scans. OMOP relational store, Explanation and reference UI
Explanation and reference UI Shows answers, source document references, business logic, supporting rows, and interactive explanations so users can inspect why a patient or cohort matched. Natural-language query agent
BI and data science tools Existing Tableau, PowerBI, SQL, and Python notebook workflows that can use the same relational patient model. OMOP relational store
Risk-score containers Customer or research risk models containerized and run over the unified patient data with provenance, versioning, and confidence. OMOP relational store

Data flow

Raw patient data enters through APIs, EHR stores, FHIR messages, PDFs, images, or structured databases inside the customer's infrastructure. Information-extraction models read free text and embedded text to extract clinical entities, assertion status, relations, clinical codes, and dates. Terminology services map source codes to standard vocabularies, temporal normalization resolves relative dates, and healthcare-specific deduplication merges repeated or conflicting events into a patient knowledge graph. The graph and traceability metadata are persisted to an extended OMOP relational database. A user then asks a natural-language question; the agent retrieves an efficient prebuilt query pattern, expands terms through the terminology service, adjusts schema and SQL for the requested dimensions, executes optimized queries, and returns answers with references and business-logic explanations.

3 supporting quotes
“we want to be able to you know either upload or more commonly through an API load all the documents about a patient from different sources different modalities”transcript, stated
“the first set of H models that you need in place and this kind of really the first kind of medical llms that we put in use here do information extraction”transcript, stated
“what we are finding is U not only are current X to sigment not solving it it is probably that it's not even a something T to SQL models by themselves will be able to do later”transcript, stated

Why this architecture

The platform rejects both clean-table assumptions and pure text-to-SQL because healthcare questions require messy multimodal ingestion, clinical normalization, temporal reasoning, optimized database execution, and explainable business logic. OMOP gives customers an open relational substrate that existing teams and tools understand, while the agent layer hides terminology, schema, and query complexity from clinicians and administrators. Keeping the system inside the customer's infrastructure is necessary because the data contains PHI.

3 supporting quotes
“if this really is to become an Enterprise data infrastructure it needs to be open it needs to be scalable”transcript, stated
“we've turned into is really building an agent an AI agent that takes multiple steps to really resolve some of the issues I just described”transcript, stated
“under no circumstance are going to send Phi outside your network or to Johnson Labs or to any other third party”transcript, stated

Models used: John Snow Labs medical LLMs · Healthcare-specific LLMs · Healthcare NLP · terminology resolvers · RAG query-template component · GPT-4o comparison baseline

Scale

Alternatives considered (roads not taken)

Analyze clean relational tables or single documents only

Rejected because: The platform is built for raw dirty clinical data, unstructured notes, inconsistent codes, conflicting labs, and multimodal patient histories rather than clean analytic tables.

“that's not what you're looking for because that means that all of the really hard work of working really with the with the dirty data as it comes”transcript, stated
“the goal is to work you know when they say in all data driven systems garbage in garbage out we want garbage in”transcript, stated

Put all patient context into a long-context LLM

Rejected because: The speaker says this is meaningless at the intended corpus scale of millions of patients, billions of pages, and very large longitudinal histories.

“having like you know a really long context llm is completely meaningless right because we we're dealing here with you know a billion pages”transcript, stated

Build a proprietary clinical data model from scratch

Rejected because: John Snow Labs chose OMOP because an open relational standard lets multiple groups and tools interact with the data and extend it where needed.

“it was either we build our own proprietary CLA models that does that is perfect and does everything we want or start with an open model and really just extend it where we need to”transcript, stated
“we chose to go with an open standard ER because I I strongly believe that if you're going to use this as kind of as a really as a unified patient data model”transcript, stated

Treat natural-language cohorting as ordinary text-to-SQL

Rejected because: Healthcare queries require terminology expansion, temporal logic, optimized query templates, schema adjustments, and explanations that a single text-to-SQL generation step cannot reliably provide.

“this actually isn't a text to SQL problem right so so initially when you look at you can say okay you ask for all diabetic patient and you translate to a SQL query”transcript, stated
“really this is a multi-step process that an agent is much better fit to do so that's what we're building here”transcript, stated

Let generated SQL run freely over the database

Rejected because: The speaker warns that unconstrained query generation can scan hundreds of millions of rows and crash the server, so the agent must use optimized query patterns, indexes, materialized views, and caching.

“someone is going to do a select star from a table that has 200 or 300 million rows and the whole server is going to come crushing down on everyone”transcript, stated
“you need to use things like indices you need to use things like materialized views right you need to have caching”transcript, stated

Use general-purpose LLMs for clinical tasks

Rejected because: John Snow Labs argues for healthcare-specific LLMs, citing blind randomized physician evaluation where its tuned medical models beat GPT-4o on clinical summarization, extraction, and question answering.

“you definitely need to use Healthcare specific llms um and here's a you know one example here on the right we we have tried to look at a fairly simple queries”transcript, stated
“our models at this point in time significally outperform GPT for for ER which is not surprising they find F tune right to to these data sets”transcript, stated

Patterns

tool-use-orchestration (agent architecture)

The cohort-query layer is an explicit multi-step agent that calls a query-template retrieval tool, terminology service, schema-adjustment tool, optimized execution path, aggregation, and explanation renderer instead of emitting a one-shot SQL query.

“when we look at a query we we actually the first step is we we call a tool that has a rug component that tries to map the query”transcript, stated
“the third step is to basically fix the schema because what you get in the in the first the first question you come say oh here's the SQL query”transcript, stated

rag-retrieval (retrieval)

The agent retrieves similar prebuilt queries that are already known to run efficiently and accurately, then adapts them to the user's specific request.

“we call a tool that has a rug component that tries to map the query to basically pre-build queries that we know how to run efficiently and we know how to run well”transcript, stated
“we trying to find the most similar query right so for example it could be oh we have a query to find patients you know with some disease”transcript, stated

fine-tuning-adaptation (model adaptation)

John Snow Labs uses its own healthcare-specific LLMs trained and fine-tuned on real-world medical data for extraction, summarization, query understanding, and medical question answering.

“we train fine tune and use our own medical llms for all of the tasks here”transcript, stated
“they find F tune right to to these data sets right a lot of real world data medical doctors will find tune them to those specific tasks”transcript, stated

eval-driven-development (evaluation)

The medical models were benchmarked through blind randomized evaluations by practicing physicians across factuality, clinical relevance, and conciseness before being positioned as better than GPT-4o for the platform tasks.

“recently they've been B Mark in a blind randomized evaluation by practicing medical doctors on three tasks clinical text summarization clinical information extraction and medical question answering”transcript, stated
“we asked them to evalue three things factual factuality right so is is the answer correct right if it's a summary are the fact in the summary not hallucinated”transcript, stated

structured-output-contract (data contract)

The platform normalizes extracted multimodal facts into an extended OMOP relational schema so downstream SQL, dashboards, notebooks, and natural-language queries operate over a stable open data model.

“everything including the the explainability the traceability the confidence levels everything we extracted everything goes into a relational database based on the the OM of common data model”transcript, stated
“because it's a relational database it means that on it yes we are going to have the natural language queries right and we'll have the specialized llm”transcript, stated

privacy-preserving-processing (safety)

The platform is deployed inside the customer's infrastructure, runs John Snow Labs' own LLMs locally, and avoids sending PHI to John Snow Labs, OpenAI, cloud providers, or other external APIs.

“everything runs within your environment the data the processing H so all of that is there”transcript, stated
“also because we use our own llms there's no calls to any API or llm API that's a third party API nothing will ever leave your system”transcript, stated

observability-tracing (traceability)

The extracted patient model carries source references, traceability, confidence levels, and explanation metadata so users can inspect where answers and cohort membership came from.

“we expect uh to to get straight answers accurate answers including references to the specific documents right those specific rols from the patient story”transcript, stated
“and they want to see this person specifically where did this come from okay do we did we run the lab results did they say they're diabetic”transcript, stated

safety-policy-enforcement (governance)

Healthcare-specific business logic, query explanations, and PHI deployment boundaries enforce clinical and privacy requirements rather than letting users run opaque or unsafe generated SQL.

“you have to be able to explain the business logic to your end users and right now if you type a query like the query you saw in the previous slide you get here's the SQL”transcript, stated
“it only runs within your infrastructure so under no circumstance are going to send Phi outside your network”transcript, stated

Tradeoffs

Use an open OMOP relational model with extensions

Chose an open standard relational model extended for traceability and confidence over a proprietary model that perfectly matched internal requirements.

Rationale: OMOP gives healthcare teams, BI tools, SQL users, data scientists, and open-source ecosystem tools a common substrate, while targeted extensions cover missing traceability fields.

“after much deliberation we have chosen to adopt the omop common data model so first of all it's a relational data model”transcript, stated
“some of the traceability features that we wanted were not specifically in the standard some of the more specific levels of confidence we wanted to track were not there”transcript, stated

Build an agentic query workflow instead of one-shot text-to-SQL

Chose a multi-step agent with query retrieval, terminology expansion, schema adjustment, execution, aggregation, and explanation over direct natural-language-to-SQL generation.

Rationale: Healthcare cohort questions require complex reasoning over terminology, schemas, time windows, and optimized database operations; the speaker says text-to-SQL alone is insufficient.

“what we've turned into is really building an agent an AI agent that takes multiple steps to really resolve some of the issues I just described”transcript, stated
“because of the complexity of the reasoning that's require here and the fact that really this is a multi-step process that an agent is much better fit to do”transcript, stated

Constrain query execution to optimized patterns

Chose prebuilt efficient query types, indexes, materialized views, and caching over allowing arbitrary SQL generated from user prompts.

Rationale: The system targets end users who do not understand database performance, so the agent must avoid unsafe full-table scans over huge clinical tables.

“we are targeting these to end users who know nothing about relational database and how you optimize them and what it means to operate them effectively”transcript, stated
“please use those okay and that's a very important thing in practice because if you remember we are targeting these to end users”transcript, stated

Run everything inside customer infrastructure

Chose customer-hosted software and models with no external LLM API calls over sending PHI to John Snow Labs, OpenAI, cloud LLM APIs, or third-party services.

Rationale: The platform handles PHI and is sold into healthcare organizations that require data, processing, and custom IP to remain inside their environment.

“it's deployed on new infrastructure within your security perimeter okay it does not call any external llm it does not send data to John SBS”transcript, stated
“so the data is not shared with anyone we'll never have access to it any models that you build any workflows that you build on top of the data completely yours”transcript, stated

Use healthcare-specific LLMs rather than general-purpose models

Chose John Snow Labs' medical LLMs trained and evaluated on clinical tasks over general-purpose GPT-4o-style models for extraction, summarization, and query answering.

Rationale: The source argues that clinical accuracy, consistency, and domain terminology require specialized models, and reports physician blind evaluations favoring the specialized models.

“the first problem you're going to have is accuracy it just not going to return the accurate answer period”transcript, stated
“we generate responses with the two models we showed them to practice the medical doct they don't know which answer came from which model”transcript, stated

Return explanations and references instead of opaque answers

Chose answers with source references, highlights, business logic, and patient-level provenance over black-box natural-language answers.

Rationale: Healthcare users need to verify why a patient matched a cohort or why a conclusion was made, especially when definitions differ by role and use case.

“we expect an explanation we expect to be able as you can see here to be able to link and and see where inside the long document a specific answer came from”transcript, stated
“the only way to do that is is really is to show those explanations to the users enableing to interact enable them to change their answers”transcript, stated

Gotchas (what bit them)

Clean-table assumptions fail on real patient journeys.

Root cause: Patient data arrives dirty, inconsistent, incomplete, uncertain, duplicated, and spread across structured records, notes, FHIR, claims, outside providers, and imaging or document systems.

Resolution: The platform starts from raw multimodal data, extracts and normalizes facts, and builds a unified patient journey rather than assuming a clean database is already available.

“with unstructured data with data that is not normalized across right terms and terminologies and codes data is is inconsistent”transcript, stated
“patients will go to different providers they go to to Specialties specialist they go out of network they'll buy medications out of it”transcript, stated

Long-context LLMs do not solve patient-scale longitudinal analytics.

Root cause: The target corpus is not a single document or million-character prompt; it spans millions of patients, billions of pages, and continuously updated records.

Resolution: John Snow Labs normalizes extracted facts into an OMOP relational store and uses optimized queries rather than putting all patient context into the model prompt.

“it's really not useful to have a set of documents that can add once into the context of an llm”transcript, stated
“everything including the the explainability the traceability the confidence levels everything we extracted everything goes into a relational database”transcript, stated

Clinical codes alone miss too much patient evidence.

Root cause: Diagnoses, medications, comorbidities, visits, and other history can be missing from structured codes even when they appear in notes or external sources.

Resolution: The system combines structured, unstructured, FHIR, and other modalities so downstream coding, risk adjustment, decision support, and analytics see richer evidence.

“these the right codes are going to be missing and not from 5% of the patients they're going to be missing usually from between like one3 to one half of the patients”transcript, stated
“unless you you don't actually have all of my hospital visits you haven't actually read and extracted from the unstructured text”transcript, stated

Generated healthcare SQL can be both wrong and operationally dangerous.

Root cause: Healthcare cohort questions require complex joins, large tables, terminology hierarchies, and time windows; unconstrained generated SQL may produce inaccurate answers or heavy scans.

Resolution: The agent retrieves known efficient query patterns, expands terms, adjusts schema, and uses optimized indexes, materialized views, and caching.

“so those are much more complex query than most kind of text to SQL model usually deal with or try to deal with”transcript, stated
“you cannot just do any SQL you want you need to come say look here are specific types of queries that I've optimized for”transcript, stated

The same clinical term means different things to different users.

Root cause: Billing, clinical, quality, research, and departmental users may define diabetes, patient membership, gender, or cohort inclusion differently.

Resolution: The system must expose business logic and patient-level provenance so users can inspect, challenge, and adjust how a query was interpreted.

“people within your organizations whether you're you provider pair research Pharma are going to have very different definitions of what does it mean for someone to have diabetes”transcript, stated
“they want to see your business logic okay so what did you count as diting and they want to see this person specifically where did this come from”transcript, stated

Deduplicating longitudinal clinical facts is field-specific rather than generic.

Root cause: Repeated mentions, varying specificity, changing symptoms, and multiple measurements need different merge logic depending on the clinical field.

Resolution: The reasoning layer deduplicates and summarizes with healthcare-specific logic, preserving uncertainty and choosing the most relevant specificity or aggregate.

“there's going to be a lot of repetition a lot of duplication right so you know if I spent three days at the hospital could easily be 30 or 40 progress notes”transcript, stated
“in general there's a lot of very Healthcare specific logic because it's field by field for how we merge data how we D duplicate data and how we deal with uncertainty”transcript, stated

Evaluation

John Snow Labs evaluated its medical LLMs through blind randomized physician comparisons against GPT-4o on clinical text summarization, clinical information extraction, and medical question answering, asking doctors to judge factuality, clinical relevance, and conciseness. The platform also emphasizes consistency as a production requirement for user trust, optimized query execution as an operational guard, and explanation/provenance as a user-facing correctness check.

Metrics: blind randomized practicing-physician evaluation · three evaluated tasks: clinical text summarization, clinical information extraction, and medical question answering · three physician-rated dimensions: factuality, clinical relevance, and conciseness · John Snow Labs reports nearly 2:1 preference over GPT-4o on those dimensions · consistency requirement: same question should return the same answer repeatedly · query safety requirement: avoid broad scans over 200-300 million row tables

3 supporting quotes
“the evaluation was blind meaning we we generate responses with the two models we showed them to practice the medical doct they don't know which answer came from which model”transcript, stated
“we asked them to evalue three things factual factuality right so is is the answer correct right if it's a summary are the fact in the summary not hallucinated”transcript, stated
“if you don't consistently return the same response time after time right and I asked you like a very you know straight question”transcript, stated

Outcomes

The platform is positioned for enterprise healthcare organizations serving 10-30 million patients per year, with millions of patients, billions of documents, 200-300 million row tables, and customer-specific 12-week implementation projects.

4 supporting quotes
“this is a system that that exists it's ready to deploy today if you are interested in this H it has two components there's a software and the model”transcript, stated
“whether you're on premise on AWS on Azure on data bricks on slowflake on oracl yes we have deployed there we can deploy there”transcript, stated
“we make sure we actually have a production system that works”transcript, stated
“this seems to be from what we hear a great way to productize those models right so come say oh you know I build this you know really cool thing”transcript, stated