Automated HCC Code Extraction from Clinical Notes Using Healthcare NLP
wvu_medicine · Healthcare · 2023 · source Agentic: no · promotional bias: med · source-backed · extracted with prompt 0.5.4 (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
WVU Medicine needed to help providers capture HCC chronic-condition codes from unstructured clinical documents without adding more manual documentation burden during patient care.
Constraints:
- clinical notes are unstructured and extensive
- HCC codes affect patient care, population health, regulatory reporting, and Medicare Advantage risk adjustment
- providers must retain final clinical judgment
- the health system spans 25 hospitals but uses a shared EMR and standard procedures
Architecture
WVU Medicine built an HCC coding workflow around John Snow Labs Spark NLP Healthcare. The system retrieves radiology notes for patients with appointments in the next 14 days, extracts diagnoses from the notes, converts them to CPT codes, filters by population relevance, already-attached diagnoses, and model confidence, then stores loadable codes in an output database. A data-architecture process creates flat files for the EMR, whose internal process maps CPT to HCC and displays real-time best-practice alerts during patient visits. Providers accept, reject, or mark suggestions invalid, and those decisions are tracked for validation and audit.
Diagram confidence: explicit (topology described by the source).
flowchart LR emr-appointment-query[EMR appointment query] --> radiology-note-retrieval[Radiology note retrieval] radiology-note-retrieval --> spark-nlp-extraction-engine[Spark NLP extraction engine] spark-nlp-extraction-engine --> confidence-filter[Confidence filter] spark-nlp-extraction-engine --> cpt-to-hcc-mapping[CPT to HCC mapping] confidence-filter --> output-code-table[Output code table] output-code-table --> flat-file-generator[Flat file generator] flat-file-generator --> emr-front-end[EMR front end] cpt-to-hcc-mapping --> emr-front-end emr-front-end --> provider-response-tracking[Provider response tracking] document-tracking-system[Document tracking system] --> radiology-note-retrieval
Components
| Component | Role | Interacts with |
|---|---|---|
EMR appointment query |
Finds upcoming patient appointments so the model processes timely clinical documents. | Radiology note retrieval, EMR front end |
Radiology note retrieval |
Collects unstructured radiology notes for upcoming patients. | EMR appointment query, Spark NLP extraction engine |
Spark NLP extraction engine |
John Snow Labs Healthcare NLP module customized by WVU to extract diagnoses from clinical notes. | Radiology note retrieval, Confidence filter, CPT to HCC mapping |
Confidence filter |
Filters extracted CPT codes using confidence scores, patient-population applicability, and existing diagnosis-chart contents. | Spark NLP extraction engine, Output code table |
Output code table |
Stores extracted CPT codes and load values for downstream EMR ingestion. | Confidence filter, Flat file generator |
Flat file generator |
Scans loadable codes and creates the file payload consumed by the EMR process. | Output code table, EMR front end |
CPT to HCC mapping |
Maps extracted CPT codes to HCC codes through EMR code-mapping techniques. | Spark NLP extraction engine, EMR front end |
EMR front end |
Displays suggested HCC codes as real-time best-practice alerts during patient visits. | EMR appointment query, Flat file generator, Provider response tracking |
Provider response tracking |
Captures accept, reject, and invalid choices for validation and audit. | EMR front end |
Document tracking system |
Avoids rescanning the same clinical documents for repeat appointments. | Radiology note retrieval |
Data flow
The workflow queries the EMR for upcoming appointments in the next 14 days, pulls the relevant radiology notes, and runs a Spark NLP Healthcare extraction engine over the clinical text. The engine extracts diagnoses, translates them to CPT, filters out irrelevant, already-present, or low-confidence codes, and marks remaining codes with load value 1. A downstream process scans the output tables, builds a flat-file payload with patient and code data, and the EMR converts CPT to HCC before showing best-practice alerts during the encounter. Provider responses then feed validation and audit tracking.
4 supporting quotes
Why this architecture
The architecture keeps machine extraction upstream of provider judgment. WVU can scale the workflow because all hospitals share an EMR and standard procedures, but the code suggestions are filtered before reaching clinicians and then surfaced as best-practice alerts only at the point of care. Confidence scores, duplicate-code filtering, document tracking, and provider responses reduce false-positive burden, while the flat-file EMR integration fits the existing clinical system rather than requiring a new provider workflow.
4 supporting quotes
Models used: John Snow Labs Spark NLP Healthcare · John Snow Labs Healthcare NLP model
Scale
- WVU Medicine spans 25 hospitals.“WV Medicine is a comprehensive health system that spans across 25 hospitals. These hospitals are in several key”transcript, implied
- The workflow looks ahead 14 days of appointments.“We start by querying our EMR database to gather all the upcoming patient appointments scheduled over the next 14 days.”transcript, stated
- Since December 2023, the model extracted more than 27,000 HCC codes.“Since December 2023, our model has extracted over more than 27,000 HCC codes. Of these, 18.4% were accepted by providers,”transcript, stated
- Providers accepted 18.4% of extracted HCC codes.“Of these, 18.4% were accepted by providers, positively impacting over 5,000 patients. By effectively coding HCC codes, we were”transcript, stated
- The operation completes in under an hour.“This streamlines the process and ensures a fast run time with the operation completed within under an hour. Overall, these elements combine to make”transcript, stated
Alternatives considered (roads not taken)
Manual provider-only HCC discovery
Rejected because: The task is extensive and detail-oriented, causing missed codes despite providers' best efforts.
Load every extracted code into the EMR
Rejected because: WVU filters out low-confidence, already-attached, or population-irrelevant codes before provider alerts.
Rescan documents for every future appointment
Rejected because: Document tracking avoids duplicate work and keeps runtime fast.
Patterns
confidence-thresholding (quality-control)
The model emits confidence scores and WVU filters low-confidence CPT codes before loading suggestions into the EMR.
human-in-the-loop-gate (clinical-governance)
Provider best-practice alerts present suggested HCC codes, but clinicians accept, reject, or invalidate the code.
observability-tracing (audit)
Provider decisions are tracked so the team can validate the process and audit outcomes over time.
Tradeoffs
Real-time alerts with provider choice
Chose best-practice alerts that clinicians can accept, reject, or invalidate over automatic chart updates from model output.
Rationale: Clinical coding affects patient records and care, so the model proposes codes while providers retain final judgment.
Radiology-first rollout
Chose radiology notes as the initial document source over all clinical document types from day one.
Rationale: Radiology notes provided a focused document stream; progress notes are planned later for broader coverage.
Document tracking optimization
Chose records of scanned documents over rescanning the same files for subsequent appointments.
Rationale: Avoiding duplicate scans keeps the pipeline fast enough for the upcoming-appointment workflow.
Gotchas (what bit them)
Provider suggestions can overload the EMR if not filtered.
Root cause: Raw extraction includes low-confidence, duplicate, and population-irrelevant codes.
Resolution: WVU applies confidence, existing-chart, and population filters before assigning load values.
Model upgrades were operationally elaborate.
Root cause: The current workflow required a cumbersome process to adopt the latest John Snow Labs model.
Resolution: The team is improving infrastructure so future model upgrades can become a single-line code change.
Clinical AI success depended on operational partners, not just the model.
Root cause: Clinical data validation and workflow evaluation require operational expertise.
Resolution: WVU leaned on business partners and John Snow Labs professional services to complete the project within a few months.
Evaluation
WVU evaluates the workflow through provider accept/reject/invalid responses, validation/audit tracking, runtime monitoring, and ongoing provider training after the December 2023 go-live.
Metrics: 27,000+ HCC codes extracted · 18.4% accepted by providers · 5,000+ patients positively impacted · operation completed within under an hour
3 supporting quotes
Outcomes
- The workflow extracted more than 27,000 HCC codes after going live in December 2023.
- Providers accepted 18.4% of suggestions.
- WVU reports more than 5,000 patients positively impacted through clearer health-status documentation.
- The pipeline completes in under an hour.
The system runs across a 25-hospital health system with a shared EMR and a 14-day appointment lookahead.