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:

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
Drag to pan · scroll or use +/− to zoom · reconstructed from the source's described component topology

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
“We start by querying our EMR database to gather all the upcoming patient appointments scheduled over the next 14 days.”transcript, stated
“Next, we retrieve all the radiology These notes contain the crucial information that can be used to identify potential diagnosis”transcript, stated
“Within this database, we apply data manipulation and filtering to assign a load value to each CPT code. We filter out codes that are already”transcript, stated
“During the patient visit, the provider receives a best best practice alert containing the suggested HCC codes.”transcript, stated

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
“all 25 hospitals in our system are on the same EMR system and follow the same standard procedures, making newer implementations easier to scale.”transcript, stated
“We use this confidence score to further filter our CPT codes. As an AI team in healthcare, we are often posed with a problem that, "Hey,”transcript, stated
“We filter out codes that are already attached to the patient diagnosis chart, as well as those that have low confidence level according to the model.”transcript, stated
“Importantly, these responses are tracked for future validation and audit purposes, allowing us to refine our process and ensure accuracy.”transcript, stated

Models used: John Snow Labs Spark NLP Healthcare · John Snow Labs Healthcare NLP model

Scale

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.

“These codes are derived from clinical unstructured patient documents, which make this task both extensive and detail-oriented.”transcript, stated
“to keep up with, which often leads to some HCC codes missing from patient diagnosis chart. This can happen despite the best efforts”transcript, stated

Load every extracted code into the EMR

Rejected because: WVU filters out low-confidence, already-attached, or population-irrelevant codes before provider alerts.

“we filter out the codes that are not applicable to our patient population. Finally, these CPT codes are mapped to”transcript, stated
“We filter out codes that are already attached to the patient diagnosis chart, as well as those that have low confidence level according to the model.”transcript, stated

Rescan documents for every future appointment

Rejected because: Document tracking avoids duplicate work and keeps runtime fast.

“We maintain a record of all scanned documents to avoid re-scanning the same files when a patient scheduled another appointment.”transcript, stated

Patterns

confidence-thresholding (quality-control)

The model emits confidence scores and WVU filters low-confidence CPT codes before loading suggestions into the EMR.

“confidence is the confidence level by which our model predicts a certain diagnosis in clinical note.”transcript, stated
“We use this confidence score to further filter our CPT codes.”transcript, stated

human-in-the-loop-gate (clinical-governance)

Provider best-practice alerts present suggested HCC codes, but clinicians accept, reject, or invalidate the code.

“The provider is given three options: accept the code, reject the code, or mark the code as invalid.”transcript, stated
“If the provider confirms that the code is accurate, it is then added to the patient record”transcript, stated

observability-tracing (audit)

Provider decisions are tracked so the team can validate the process and audit outcomes over time.

“Importantly, these responses are tracked for future validation and audit purposes, allowing us to refine our process and ensure accuracy.”transcript, stated

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.

“During the patient visit, the provider receives a best best practice alert containing the suggested HCC codes.”transcript, stated
“The provider is given three options: accept the code, reject the code, or mark the code as invalid.”transcript, stated

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.

“Next, we plan to expand our process beyond radiology documents to include progress notes as well.”transcript, stated

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.

“We maintain a record of all scanned documents to avoid re-scanning the same files when a patient scheduled another appointment.”transcript, stated

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.

“we filter out the codes that are not applicable to our patient population.”transcript, stated
“A load value of one indicates the CPT code should be loaded in our EMR system and a load value of zero indicates it should not be.”transcript, stated

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.

“Whenever we have a latest Johnsnow Labs model, we have an elaborate process of upgrading this current model to our latest model.”transcript, stated
“We are actively working on improving our infrastructure such that the model upgrade is just a single line code change in future.”transcript, stated

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.

“The success of such initiatives heavily depend on thorough clinical data validation and meticulous workflow evaluation”transcript, stated
“By leveraging Johnsnow Labs professional services, we were able to implement our our ideas using state-of-the-art AI tools and see them through to completion within just a few months.”transcript, stated

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
“Since December 2023, our model has extracted over more than 27,000 HCC codes.”transcript, stated
“Of these, 18.4% were accepted by providers, positively impacting over 5,000 patients.”transcript, stated
“This streamlines the process and ensures a fast run time with the operation completed within under an hour.”transcript, stated

Outcomes

The system runs across a 25-hospital health system with a shared EMR and a 14-day appointment lookahead.

3 supporting quotes
“Having gone live with this workflow in December 2023, we are still in process of training our providers to use it effectively.”transcript, stated
“Of these, 18.4% were accepted by providers, positively impacting over 5,000 patients.”transcript, stated
“all 25 hospitals in our system are on the same EMR system and follow the same standard procedures”transcript, stated