Skip to content

CDWAgent v0.5.1 — BioRouter Extension Bundle

Choose a tag to compare

@Broccolito Broccolito released this 20 Jun 23:46
· 2 commits to main since this release
c0207dd

CDWAgent v0.5.1 — BioRouter Extension Bundle

Major reliability, performance, and multimodal-coverage overhaul (v0.5.0 + v0.5.1),
verified end-to-end against the live UCSF CDW (CDW_NEW.deid_uf, 7.17M patients).

Highlights

  • New build_cohort tool (22 tools total) — answers "how many patients with X" /
    "find patients with X" in ONE call across 8 modalities: diagnosis, medication,
    procedure, lab, imaging/radiology, immunization, allergy, vitals/flowsheets.
    Returns the count, the matched codes/names (cohort transparency), and a reusable
    cohort_subquery for composing multi-step / cross-modality questions.
  • DATA MODALITIES guide in the server instructions for the long tail (surgical/OR,
    ADT/admissions, cancer staging, radiology report notes, note section headings).

Correctness fixes (found on live data)

  • Apostrophe diseases (Crohn's, Parkinson's, Graves') no longer crash SQL (escaped).
  • Removed a key-cap that undercounted broad cohorts >100× (type 2 diabetes 1,227 → 219,352).
  • RFC-4180 CSV so comma/quote/newline values (note text) don't corrupt output.
  • search_procedures_by_code uses ProcedureDim (the old terminology table had no key → dead end).
  • crossmap_patient no longer re-parses its own CSV.

Performance (live-measured)

  • Key resolution 3–6× faster: name terms = name-dim UNION terminology DisplayString
    (full recall); code terms prefix-match only the code column. diabetes 219,352 in ~17s
    (was ~57s); G35 13,516 / I10 457,980 in ~3s.
  • vital cohort no longer times out (resolves FlowsheetRowKey via FlowsheetRowDim first).
  • summarize_table one bounded pass (was up to 51 scans); cohort_summary one GROUPING SETS pass.
  • Per-query/login timeouts; opt-in approximate count (APPROX_COUNT_DISTINCT, ~3× faster).

Robustness

  • Invalid column/object name errors are enriched with the closest real names from the
    bundled schema reference, so the agent self-corrects after a CDW schema change.

See CHANGELOG.md and eval/ for the full methodology and the 100-question modality-complete suite.