Codex

How AI reads a clinical note and picks the right CPT code

Diagram showing clinical note sections being mapped to medical billing codes

CPT assignment begins with a clinical judgment about what the signed note actually supports. In a four-provider internal medicine practice, a completed chart note averages between 600 and 1,400 words across templates, SOAP fields, checkboxes, and provider addenda. Before selecting a code, the system must sort those elements into functional zones and identify the billable clinical signal. That sorting does most of the substantive work.

What a clinical note actually contains

EHR notes do not follow one uniform structure. For the same encounter type, eClinicalWorks and Athena Health can place identical clinical content in different fields. Chief complaint may be entered as free text or chosen from a dropdown. HPI may come from a populated template or a dictated paragraph. Assessment may appear as a numbered problem list or as prose combining findings and recommendations.

NLP first divides the note into these zones, before code rules are applied. Chief complaint supplies encounter context. HPI, including templated HPI, carries E/M complexity signals such as symptom duration, associated factors, pertinent positives and negatives, and referenced prior workup. Assessment guides diagnosis selection. Plan verifies which procedures or services were delivered and therefore which CPT candidates fit. These sections cannot be treated as interchangeable. A diagnosis mentioned in HPI but absent from assessment is not the encounter's principal diagnosis, even when clinically important.

How E/M level gets scored under the 2021 framework

Since 2021, CMS outpatient office evaluation and management coding follows a two-track model: medical decision making, MDM, or total time. In most automated coding workflows, MDM is the relevant track. Total time requires a specific attestation documenting time spent, and providers do not record it consistently for every encounter type.

MDM has three components, each scored separately: the number and complexity of problems addressed, the amount and complexity of data reviewed or ordered, and the risk of the management decision. The system examines the note section by section to score all three.

Problem complexity depends on whether a problem is new to the practice or an established chronic condition, whether further workup is needed, and whether multiple chronic conditions are managed together. A visit for hypertension alone has a different profile from a visit addressing hypertension, Type 2 diabetes, and newly presenting chest discomfort. The note needs sufficient clinical language to separate those situations, rather than merely listing them.

Data complexity reflects external records reviewed, lab or imaging results ordered and independently interpreted, and relevant historical documentation consulted. "Reviewed prior ECG, no change from baseline" documents a data review activity that contributes to MDM. "ECG done" documents a service, but does not establish that the provider interpreted it.

Risk review looks for prescription drug management, a decision about elective surgery, or management of a condition that could severely worsen. Prescribing a controlled substance for chronic pain carries a different risk level from changing a lisinopril dose for uncomplicated hypertension.

Mapping procedure codes: the assessment-plan connection

When a visit includes a procedure, coding moves from E/M scoring to identifying the procedure directly. The system locates the procedure note or plan reference, pulls out the description, anatomic site, and laterality, then compares those details with CPT nomenclature.

A family medicine provider documenting "administered corticosteroid injection to right knee, 40mg triamcinolone, 1cc 1% lidocaine" maps to CPT 20610. The procedure code is only part of the claim, however. Its diagnosis must connect to the clinical reason for the procedure. "Knee pain, right" with M25.561 is technically complete, but less informative than an assessment naming M17.11 for primary osteoarthritis of the right knee, or M75.5 for rotator cuff syndrome when a different joint was injected. The system tests the procedure and diagnosis pairing and flags a vague diagnosis beside a specific procedure.

Where documentation quality changes the output

In chart sets from early-access practices, differences between the automated suggestion and a human coder's assignment followed a small group of recurring patterns. The issue was not faulty clinical reasoning. It was missing documentation that would challenge a human coder working from the same chart.

The first pattern was absent or unclear laterality. "Shoulder pain" without left or right leads the system toward an unspecified code. M25.511 identifies right shoulder pain, M25.512 left shoulder pain, and M25.519 unspecified shoulder pain. The unspecified code is valid, but the payer may request documentation based on the procedure billed. Laterality may appear in exam findings or the procedure description, but when it is missing from assessment, the system does not automatically attach it to the diagnosis.

The second pattern was failure to capture a chronic disease complication. A patient with Type 2 diabetes receiving a diabetic foot exam should be coded E11.40 for diabetic neuropathy, unspecified, or E11.41 or E11.42 when the documented neuropathy type is more specific, rather than E11.9 alone. Medicare Advantage risk adjustment relies on capturing complication codes. General assessment language does not establish that link, and the system cannot infer the more specific code without it.

The third pattern was incomplete procedure detail. Lesion removal claims need lesion size to select the appropriate CPT code in the 11400 through 11406 series for benign lesions. If a note says "excision of skin lesion, right forearm" but gives no dimensions, the system flags the missing size instead of guessing. Billing staff see that flag before claim assembly, rather than after a denial.

Why the system does not produce codes it cannot defend

A defensible code is one supported by the chart as written, without supplemental information. That is the auditor's standard and ours. We do not select a code because the patient's broader clinical context might justify it. We select what the documentation recorded at the encounter actually supports.

This distinction matters because small practices most often face inconsistency, not upcoding. The same clinical situation may be coded differently by provider, on different days, or in the front and back portions of a template. Reading the complete note consistently, without fatigue, reduces that variation. The result is a candidate code set billing staff can review, override, or submit. The practice retains the decision to submit.

The practical change is the point in the workflow when review occurs. If coding happens when the chart is completed instead of the following morning in the billing queue, the provider remains available, the encounter is current, and a gap that might prompt a phone call on day three of claim hold can be resolved in five minutes. Earlier review makes clarification faster while the clinical details are still available.

Try coding at chart sign-off

See how Arintra assigns CPT and ICD-10 codes at chart sign-off. Request early access for your workflow.

Request Early Access

More from Codex