Skip to main content
Industries

Scaling oncology data extraction with Databricks

How Flatiron Health used Databricks to operationalize learning from 6M patients, including its Panoramic cohorts.

by Flatiron Health, Vlad Marin and Javier Poveda Panter

  • Flatiron Health uses LLMs to extract research variables from clinical notes and reports. The team checks model output against labels from expert clinical abstractors.
  • With Ray on Databricks, engineers can run the same extraction code on a few thousand charts or a full cohort. Each pipeline defines and provisions its own compute.
  • Monthly LLM extraction now covers nearly 2.5 million patients across four Panoramic cohorts within Flatiron’s broader 6 million-patient population.

In early 2025, Flatiron Health bet the future of its flagship Panoramic research datasets on large language models. The team had experience running production workloads at scale on Databricks, but LLMs were new to the team. By February, the team was scoring a 1-million-patient breast cancer cohort each month, and by 2026, LLM extraction covered nearly 2.5 million patients across four cancer types. Getting there changed what Flatiron delivers to researchers, how its teams work, and what it needs from its infrastructure. In this joint post with Databricks, Flatiron explains how the Databricks Platform made that shift possible and how a team of three to five engineers helped Flatiron go from a ceiling of 100,000 patients to extracting data from 6 million patients.

Unlocking the rich clinical detail trapped inside millions of unstructured patient records is core to our mission of transforming cancer care. Our Panoramic data only works when extraction meets the rigorous clinical quality standard our abstractors set. With Databricks infrastructure, our team can focus on building that quality into our data pipelines on a technical foundation that can seamlessly scale across our network.- Allison Candido, Chief Technology Officer, Flatiron Health

Flatiron’s core business is its Panoramic datasets: research-ready histories of cancer care across many cancer types and four countries, detailed down to the biomarker level. Datasets for breast cancer, prostate cancer, and non-small cell lung cancer are available now, with six new blood cancer groups and expansion to the UK, Germany, and Japan underway. Much of what researchers need from those histories is not captured in structured Electronic Health Record (EHR) fields. Pathologic diagnosis, treatment rationale, response, progression, and performance status are written in pathology reports, doctors’ notes, radiology reports, and discharge summaries. Flatiron’s data curation systems use LLMs to extract and reason with data from these documents to generate variables that are critical to understanding the patient journey. Regulators and pharmaceutical companies rely on Panoramic data as real-world evidence, so it has to meet the standard set by its expert human clinical abstractors. Under its published VALID framework, Flatiron measures its models against the abstractors’ work.

Deep learning at scale

Originally, clinical experts abstracted the data by hand to meet Flatiron’s high-quality standards for disease-specific datasets, which limited how far those projects could scale. From 2019 through 2022, Flatiron’s unstructured data processing predominantly relied on in-house deep learning models running on large, relatively static batch pipelines on an ad hoc compute platform. During this period, projects continued to reach a ceiling of around 100,000-patient cohorts. Projects that required greater scale and precision were difficult to support because the existing batch architecture could not provide the workload isolation, elastic compute, and operational simplicity needed for substantially larger cohorts. As a result, Flatiron was unable to learn from its full network of clinical partners and patients.

Adopting Databricks removed that ceiling. By late 2023, the engineering team had transitioned from a shared compute model to cost-efficient, ephemeral clusters dedicated to individual jobs, giving each pipeline fit-for-purpose compute and stronger workload isolation. By the end of 2024, the same class of pipelines was producing 1.5 billion extracted data points from millions of patients, and just as importantly, without a step change in operational load for the engineering and data science teams. That meant the team could scale without hand-optimizing every model on its way to production.

The Panoramic pivot to LLMs

With LLMs, Flatiron saw an opportunity to achieve abstractor-level quality at scale. The labels Flatiron’s clinical abstractors had produced became a critical input for building and evaluating models that meet the bar its customers expect and its VALID framework tests.

Flatiron scaled its LLM pipelines quickly on Databricks. The first LLM variables were delivered by the data science team in December 2024, and had previously been tested only on tens of thousands of patients. After a few compressed weeks of work in January, the February production run scored three variables on the full 1 million-patient Breast Panoramic cohort in production. While Ray on Databricks provided the technical foundation, reaching production at that scale on a compressed timeline required careful tuning across compute, orchestration, and model-service throughput, as well as close collaboration with data science.

Within a couple of months, Flatiron had gone from having no LLM experience to running multiple production pipelines on Databricks each month. By 2026, LLM extraction covered nearly 2.5 million patients across the Breast, Prostate, NSCLC, and Heme Panoramic datasets. Because LLM scoring is rolled out cohort by cohort, the figure represents the disease-specific populations covered to date rather than the full 6-million-patient pan-tumor base.

Compute as application code

For both deep learning and LLM workloads, the Databricks workspace gives Flatiron a clear boundary between infrastructure and application. On one side is the pipeline logic, model packaging, and application code; on the other is cluster provisioning, identity and access management (IAM), networking, and runtime. Flatiron’s ML application engineers don’t touch Terraform or manage virtual machines (VMs), yet they keep real control over the compute their code runs on, because cluster definitions live in code, via the Databricks SDK or Declarative Automation Bundles (DABs).

That property matters even more as Flatiron brings different workflow shapes to Databricks, including LLM workloads that use Amazon Bedrock for model inference. Extracting a single variable can require generating up to one million large prompts, each averaging approximately 20,000 tokens. An individual pipeline can run for days. With dozens of variables in flight, that only works if each pipeline provisions exactly the compute it needs, on ephemeral clusters, and tears it down afterward. With Databricks, each pipeline bootstraps its own infrastructure and cluster topology in Python, without a separate Terraform change or an additional platform team in the loop. Engineers define the compute each pipeline needs in the same file as its application logic.

This narrows the boundary between prototyping and production. The artifact a data scientist builds while iterating on a few thousand charts is the artifact the team can evaluate against abstractor labels and then run across the full cohort. Getting there is a matter of pointing the same code at more compute, with no re-implementation. This is especially true in conjunction with Ray on Databricks. With Ray, optimization happens in Python at the bottleneck, and engineers can tune the actual hotspot without having to reshape their code to fit an external framework’s rules.

Broadening who can build at scale

Flatiron is preparing for the next phase of growth for its Panoramic business line. These workflows are starting to broaden who can generate data science insights at scale – not just engineers, but clinicians and data scientists working directly. Some examples:

Interactive applications over patient cohorts. A clinical researcher querying unstructured patient histories expects an answer in minutes, even though that query runs extraction across hundreds of thousands of charts. Flatiron built an application that has access to all unstructured documents in its network, so that through a web-based UI a researcher can ask, “Which patients are relapsed or refractory – progressed after two or more lines of therapy?” This distinction lives only in the narrative of a chart, not in any structured field. The engine retrieves the supporting evidence and summarizes it with LLMs, at scale and in minutes.

Bootstrapping new LLM-extracted variables. When a new variable is added – a new clinical concept to be extracted across the dataset – the work of generating labeled examples, evaluating prompt variants, and validating against expert abstractors is itself a massively parallel workload, and a different shape from a production batch. It benefits from being able to fan out widely and opportunistically across a large pool of compute, without the overhead of authoring a production pipeline for what is fundamentally an exploratory loop.

To support both workflows, the team built an internal Ray-as-a-primitive interface that allows remote applications to dispatch to an ephemeral Databricks cluster via a decorator-based API. A Databricks job is already a queue and an execution engine, addressable through the SDK, so the team didn’t need separate orchestration infrastructure to coordinate that dispatch.

What’s possible now, and what’s next

The Databricks compute platform helped unlock increased business capacity without a matching growth in system or team complexity. The technical ceremony around infrastructure tooling – e.g., separate Terraform changes, Jenkins jobs, and continuous integration (CI) pipelines – often leads to context switches, extra process, cognitive load, and brittle handoffs. For an engineer working with Databricks, infrastructure isn’t something to fight separately, and context stays in one place. An engineer or AI agent determines the compute topology a workload requires and implements it within the same mental and technical framework as the pipeline itself.

AI is changing quickly, and our ambitions continue to grow. Databricks gives us the headroom to bring our Panoramic data to the UK, Germany, and Japan while also unlocking new use cases for data extraction so we can keep learning from every patient’s journey to be able to answer every question about oncology in an increasingly agentic system.- Allison Candido, Chief Technology Officer, Flatiron Health

Before migrating to Databricks, projects at Flatiron that required a certain level of scale might have been scoped to take months, or, worse, might never have been prioritized. Now it can take a sprint. Several projects bear this out. In one case involving the processing and delivery of millions of biomarker documents to a vendor, the need to scale arose much sooner than expected. But because the workflow was built to target distributed compute on Databricks, one engineer scaled the pipeline within a sprint, and the conversations shifted from managing expectations to completing the delivery. In another case, an AI agent simplified a deterministic pipeline that measures how upstream LLM changes ripple through complex lines-of-therapy rules, collapsing 9 steps into 1. The original pipeline had a non-trivial infrastructure footprint, but this rewrite was straightforward because infrastructure and application code are adjacent in Databricks.

Today, LLM extraction across millions of patients is a routine monthly process at Flatiron, without growing or burdening the teams overseeing the platform. Flatiron is bringing the same approach to its international datasets, and to agent-driven workflows that let clinicians and data scientists ask new questions of the data directly. Databricks helps Flatiron maintain this trajectory with a platform team that can remain small, so that more teams can build on top of it and remain focused on the important problems – to keep learning from Flatiron’s entire network.

 

FAQs

How can I use LLMs to extract structured data from unstructured documents?

Define the fields you need and prompt a large language model (LLM) to extract their values from the text. Flatiron Health uses this approach to capture details such as treatment response and disease progression from clinical notes, where those details often appear only in narrative form.

How can I measure the accuracy of LLM-extracted data?

Compare the model’s output with values that subject matter experts have assigned to the same documents. Under its VALID framework, Flatiron uses labels from expert clinical abstractors to evaluate how accurately a model extracts each variable. The team also uses labeled examples to compare prompt variants.

How can I scale an LLM extraction pipeline from a pilot to millions of documents?

Run the extraction code across a cluster and tune how quickly it sends work to the model. Flatiron uses Ray on Databricks to run the same Python code on a few thousand charts and on a full research cohort. By 2026, its monthly LLM extraction pipelines covered nearly 2.5 million patients across four oncology cohorts.

How can I manage compute for long-running LLM batch jobs?

Give each job a temporary cluster sized for its workload, then shut it down when the job finishes. Flatiron defines the cluster alongside its pipeline code. Engineers can adjust compute for a run that takes days without a separate infrastructure change.

How can users ask questions across a large document collection?

Build an application that retrieves relevant passages and uses an LLM to summarize the evidence. Flatiron’s researchers can ask which patients’ records show disease progression after two or more lines of therapy. The application searches hundreds of thousands of charts and returns supporting evidence in minutes.

Related tags:

Customers, Healthcare & Life Sciences, Data Science and ML, LLMs, MLOps & LLMOps and AI Evaluation

Get the latest posts in your inbox

Subscribe to our blog and get the latest posts delivered to your inbox.