Research project 01

Clinical notes to research data

Turning free-text clinical records into research variables that researchers can analyze and clinicians can trust.

Role
Data Science Research Fellow: pipelines, model deployment, evaluation
Setting
U.S. Department of Veterans Affairs, January 2025 to present
Methods
Python, SQL, fine-tuned transformers, open-weight LLMs (vLLM, 4-bit AWQ)
Outputs
Manuscript under review, two SLEEP 2026 abstracts, IEEE AIxSET 2025 paper
  1. 01Objective
  2. 02Current practice
  3. 03Approach
  4. 04Impact
  5. 05Risks
  6. 06Resources
  7. 07Timeline
  8. 08Evaluation
01 Objective

What are we trying to do?

Extract the measurements clinicians write in their notes, reliably enough that researchers can build cohorts and run analyses on them, across more than a million records.

Many values that matter for sleep medicine research, such as the results of multiple sleep latency tests, live in narrative notes rather than structured fields. If they can be extracted faithfully, studies that would otherwise depend on manual chart review become possible at the scale of the whole record.

02 Current practice

How is it done today, and what are the limits?

  • Manual chart review is accurate, but slow and costly. It does not scale to 1.25M+ records.
  • Keyword and rule-based search is fast, but brittle against the many ways clinicians phrase the same finding.
  • Structured fields are easy to query, but often missing the values researchers need.
  • General-purpose language models are flexible, but can invent values, and clinical text cannot be sent to outside services.
03 Approach

What is new, and why should it work?

Treat extraction as measurement: define each variable with clinicians, filter before extracting, run models where the data lives, and evaluate errors by type rather than by a single accuracy number.

  • Clinician-defined variables. Research variables are agreed with clinicians and interdisciplinary researchers before any model runs, with evaluation protocols for reliability and validity.
  • An upstream filter. A fine-tuned transformer classifier screens notes before extraction, which reduced downstream hallucination. On 5,486 annotated notes, it identified notes reporting multiple sleep latency test results with an F1 score of 0.900, against 0.895 for a bag-of-words baseline, and was preferred for its robustness to varied clinical language (SLEEP 2026 abstract).
  • Open-weight models on internal hardware. Models of two sizes are served with vLLM, 4-bit quantization and pipeline parallelism across an 8-GPU cluster, so large models fit fixed hardware and records never leave VA systems.
  • Error analysis by type. Evaluation tooling separates hallucination, omission and mismatch errors against 5,486 labeled examples, and model sizes are benchmarked on accuracy and cost.
04 Impact

Who cares, and what difference does it make?

Researchers get the variables they need at the scale of the whole record, without months of chart review.

  • Clinician-researchers studying narcolepsy, hypersomnia and other sleep disorders in veterans can define and study cohorts that were previously impractical to assemble.
  • VA leadership gets model choices grounded in measured accuracy and cost, rather than in model size alone.
  • Program evaluation benefits from the same data infrastructure: a SQL database over the enterprise data warehouse, R dashboards for the Office of Rural Health telehealth evaluation, and Streamlit dashboards for stakeholders.
  • Clinical studies can use measures that used to require chart review. A co-authored SLEEP 2026 abstract compared narcolepsy subtypes across 13,122 veterans, using mean sleep latency, sleep-onset REM periods and Epworth scores extracted from notes by an NLP pipeline with over 90% accuracy (abstract).
  • The clinical NLP community gets peer-reviewed evidence: an IEEE AIxSET 2025 paper, two SLEEP 2026 late-breaking abstracts and a manuscript under review.
05 Risks

What could go wrong?

Risk
Mitigation
Invented values enter the dataset and look like findings
Upstream filtering, and hallucination tracked as its own error category
Missed values quietly bias cohorts
Omissions measured separately from other errors
Clinical text cannot leave VA systems
Open-weight models served on internal infrastructure
Fixed compute limits model size
4-bit quantization and pipeline parallelism, plus a size-versus-cost benchmark
A measure is extractable but not meaningful
Variables defined with clinicians, and protocols for reliability and validity
06 Resources

What does it take?

No new hardware and no per-query fees: the cost is mainly people's time.

  • Compute. An existing 8-GPU cluster, made sufficient by 4-bit quantization.
  • Models. Open-weight, so there are no licensing or per-token costs.
  • Expertise. Clinician and researcher time to define variables and label 5,486 evaluation examples.
  • Data. 1.25M+ records queried with SQL from the enterprise data warehouse.
07 Timeline

How long does it take?

WhenMilestone
Jan 2025Fellowship begins. Pipelines from the data warehouse to analysis-ready datasets.
2025IEEE AIxSET 2025: ordering an LLM cascade to extract mean sleep latency from MSLT reports.
2026SLEEP 2026: bag of words versus transformers for identifying MSLT reports, and a national cohort study of narcolepsy subtypes.
2026Manuscript under review: LLM extraction of narcolepsy and hypersomnia metrics.
OngoingModel-size benchmarking, error analysis and stakeholder reporting.
08 Evaluation

How do we know it is working?

Midterm checks

  • Error rates by type on the labeled set
  • Whether the upstream filter lowers hallucination downstream
  • Whether deployment fits the cluster's memory and time budget

Final checks

  • Agreement with clinician judgment (validity) and consistency across runs (reliability)
  • Accuracy against cost for each model size
  • Datasets used in peer-reviewed research

No patient data appears on this page.