Fundamentals

Apr 22, 2026 · 9 min read

How Medical Coding Works: From Patient Visit to Paid Claim

Walk through the seven-step journey a clinical encounter takes to become a coded, billed, and paid claim — and where each handoff can go wrong.

By MedicalCode AI Editorial

Clinician working at a laptop in a medical environment

A patient sees a doctor. Weeks later, money moves between an insurer and a hospital. The seven steps in between — most of them invisible to the patient — are what we call the revenue cycle. Medical coding sits in the middle of that cycle, and understanding the whole pipeline makes it much easier to see why coding decisions matter so much.

Step 1 — Pre-registration and eligibility

Before the visit even happens, the front desk pulls insurance information, verifies eligibility, and captures any prior authorizations that the planned services need. Mistakes here — wrong insurance ID, expired authorization — show up downstream as denied claims, but they happen long before any code is assigned.

Step 2 — The clinical encounter

The visit happens. The clinician documents what they did and why, ideally in real time inside the EHR. The quality of that documentation is the upstream limit on coding quality — coders cannot code what is not written down. This is where clinical documentation improvement programs spend their time, working with physicians to make documentation specific enough to support the codes that the patient's actual care justifies.

Step 3 — Charge capture

Charges (the things that will eventually become billable line items) are pulled from the EHR — sometimes automatically, sometimes by a human reviewer. This is a separate step from coding because not everything that gets coded is billable, and not everything billable shows up cleanly in clinical notes (durable medical equipment, supplies, drugs).

Step 4 — Medical coding

A certified coder reads the documentation and assigns ICD-10-CM diagnosis codes, ICD-10-PCS or CPT procedure codes, and any HCPCS codes for equipment or services. They sequence the diagnoses (Principal vs Secondary), select modifiers where applicable, and apply official guidelines for the encounter type.

For an inpatient stay, the coder also assigns a DRG (Diagnosis-Related Group) — the bundled payment category Medicare uses to reimburse hospitals. DRG selection is heavily dependent on which Secondary Diagnoses count as CCs (complications/comorbidities) or MCCs (major complications/comorbidities), and small documentation differences can move an entire case into a different payment tier.

Step 5 — Claim submission

The codes, along with patient and payer information, are assembled into a claim and submitted electronically to the insurer (in the U.S., typically as an X12 837 transaction). Front-end edits run before submission to catch obvious errors, and any claim that fails an edit goes back to billing for cleanup.

Step 6 — Adjudication

The payer adjudicates the claim — applies the patient's benefits, runs the codes through their own medical-policy and payment-rules engines, and decides what to pay. The remittance advice (an X12 835 transaction) tells the provider what was paid, what was denied, and why.

Denials are common, and many of them tie back to coding: the diagnosis did not support the procedure, the documentation did not support the level of service, the modifier was missing or wrong. Working denials is a major part of revenue-cycle work and a fast-growing specialty within coding teams.

Step 7 — Posting and patient billing

Payments post against the patient's account. Anything left over (deductible, coinsurance, non-covered services) becomes the patient's balance and gets billed to them. Patient-pay collections close the cycle.

Try it yourself

Each one of those seven steps creates an opportunity for error — and most of them depend, directly or indirectly, on getting the codes right. AI-assisted coding makes step four faster and more accurate, which has a knock-on effect on every step that follows.

See it in action

Watch a clinical note become coded claims, live.

Free to try — create an account in under a minute. No credit card required.