---
name: coding-medical-encounters
language: en
description: Assigns ICD-10-CM diagnosis codes and CPT/HCPCS procedure codes with supporting documentation validation. Use when coding medical visits, selecting diagnosis codes, or assigning procedure codes.
tags:
  - coding
  - medical-coding-and-billing
metadata:
  author: casemark
  practice_areas:
    - Medical Coding
    - Revenue Cycle
    - Health Information Management
  document_types:
    - Coded Record
  skill_modes:
    - Coding
    - Classification
---

# Coding Medical Encounters

Assigns ICD-10-CM diagnosis codes and CPT/HCPCS procedure codes to clinical encounters. Validates documentation sufficiency and ensures sequencing compliance.

## Related Skills

| Skill | Use When |
|-------|----------|
| `auditing-coding-accuracy` | Post-coding accuracy review or compliance audit |
| `managing-evaluation-management-coding` | Deep E/M level selection questions |
| `managing-modifier-applications` | Complex modifier stacking scenarios |
| `managing-bundling-rules` | NCCI edit resolution or unbundling questions |
| `managing-cdi-programs` | Documentation gaps require provider queries |

## Why This Skill Exists

Every code assigned to a medical encounter has downstream impact:

- **Revenue** — incorrect codes cause denials, underpayment, or overpayment
- **Compliance** — upcoding and unbundling trigger OIG audits and False Claims Act liability
- **Data quality** — HCC risk adjustment, quality measures, and population health analytics depend on accurate coding
- **Legal defensibility** — "if it's not documented, it didn't happen" is the foundational coding principle

This skill enforces a structured, documentation-driven coding workflow that reduces error rates and produces auditable output.

---

## Checkpoint A: Pre-Draft Intake (Mandatory)

Before assigning any code, confirm all inputs. Present this table and fill with user-supplied or document-derived answers:

| Input | Value | Source |
|-------|-------|--------|
| Encounter type | _(E/M, procedure, consult, telehealth, observation, etc.)_ | |
| Setting | _(outpatient, inpatient, ED, ASC, etc.)_ | |
| Provider specialty | | |
| Payer | _(Medicare, Medicaid, commercial, MA plan)_ | |
| Documentation available | _(progress note, op report, H&P, discharge summary)_ | |
| Date of service | | |
| Patient age / sex | _(affects code specificity)_ | |
| Prior coding exists? | _(yes/no — if yes, this is a review)_ | |

**Stop conditions** — Do NOT proceed if:
- Clinical documentation is incomplete or unsigned
- Encounter type is ambiguous and cannot be inferred
- No provider attestation exists for the services rendered

Flag missing items with `[QUERY PROVIDER]` and escalate to the CDI workflow (`managing-cdi-programs`).

---

## Step 1: Assign Diagnosis Codes (ICD-10-CM)

### Sequencing Rules

1. **Principal/primary diagnosis** — the condition established after study to be chiefly responsible for the encounter
2. **Secondary diagnoses** — conditions that affect treatment, require monitoring, or increase complexity
3. **Chronic conditions** — code only if addressed, treated, or affecting management during this encounter
4. **External cause codes** (V00-Y99) — required for injuries; never principal
5. **Z-codes** — for encounters driven by factors other than disease (screening, history, status)

### Specificity Requirements

Always code to the **highest level of specificity** the documentation supports:

- Laterality (right, left, bilateral) when the code set requires it
- Episode of care (initial, subsequent, sequela) for injury codes
- Trimester for obstetric codes
- Type 1 vs Type 2 for diabetes with manifestations

**Common specificity failures:**
- Using unspecified site when laterality is documented
- Defaulting to `.9` (unspecified) when a more specific code exists
- Missing 7th character extensions on injury/fracture codes

### Output: Diagnosis Code Table

| Seq | ICD-10-CM | Description | Specificity | Documentation Reference |
|-----|-----------|-------------|-------------|------------------------|
| 1 (Dx) | | | Full / Partial / `[QUERY]` | Page/section of note |
| 2 | | | | |
| 3 | | | | |

Mark any code where documentation is insufficient as `[QUERY PROVIDER]` with the specific deficiency noted.

---

## Step 2: Assign Procedure/Service Codes (CPT / HCPCS)

### E/M Code Selection (2021+ Guidelines)

For evaluation and management services, determine the level using **Medical Decision Making (MDM)**:

| MDM Element | Straightforward (99212/99202) | Low (99213/99203) | Moderate (99214/99204) | High (99215/99205) |
|-------------|-------------------------------|-------------------|------------------------|---------------------|
| **Problems** | 1 self-limited or minor | 2+ self-limited; or 1 stable chronic | 1+ chronic with exacerbation; or 2+ stable chronic; or 1 undiagnosed new problem | 1+ chronic illness with severe exacerbation; or 1 acute/chronic illness posing threat to life |
| **Data** | Minimal or none | Limited (order/review tests, review external notes) | Moderate (order/review tests + independent interpretation; or discussion with external physician) | Extensive (independent interpretation + discussion with external physician; or discussion of management with external physician) |
| **Risk** | Minimal risk of morbidity | Low risk; OTC drug management | Moderate risk; prescription drug management; minor surgery with risk factors | High risk; drug therapy requiring intensive monitoring; decisions about hospitalization; decisions about emergency surgery |

**Level requires 2 of 3 elements to meet or exceed the threshold.**

For the full MDM grid with examples, load `references/CODING-REFERENCE.md`.

### Non-E/M Procedure Codes

For procedures, surgeries, and ancillary services:

1. Identify the procedure performed from the operative/procedure note
2. Match to the most specific CPT or HCPCS Level II code
3. Check NCCI edits for bundling conflicts with other codes on the same DOS
4. Apply modifiers as needed (see Modifier section below)
5. Verify units if applicable (e.g., infusion time, lesion count)

### Modifier Application

Apply modifiers only when documentation supports them:

| Modifier | Use When | Common Error |
|----------|----------|--------------|
| -25 | Significant, separately identifiable E/M on same day as procedure | Appending without documented separate E/M |
| -59 / XE/XS/XP/XU | Distinct procedural service to bypass NCCI edit | Using -59 as a blanket unbundling tool |
| -76 | Repeat procedure by same physician, same day | Confusing with -77 (different physician) |
| -57 | Decision for major surgery during E/M | Using for minor procedures (use -25 instead) |
| -26 | Professional component only | Omitting when facility bills technical component |
| -LT / -RT | Left / right side | Missing laterality on bilateral procedures |

### Output: Procedure Code Table

| CPT/HCPCS | Description | Modifier(s) | Units | NCCI Check | Documentation Reference |
|-----------|-------------|-------------|-------|------------|------------------------|
| | | | | Pass / Conflict / N/A | Page/section |

---

## Step 3: Validate Code-to-Documentation Linkage

Every code must trace back to a specific documentation element. Complete this validation:

```
- [ ] Each diagnosis code supported by documented clinical finding, test result, or provider assessment
- [ ] Each procedure code supported by procedure note, operative report, or provider documentation
- [ ] E/M level supported by at least 2 of 3 MDM elements at or above the billed level
- [ ] Modifiers supported by documentation of distinct service, laterality, or separate encounter
- [ ] Sequencing follows principal diagnosis rules for the encounter type
- [ ] No unspecified codes when specific information is available in the documentation
- [ ] HCC-relevant diagnoses captured if payer is Medicare Advantage
```

---

## Checkpoint B: Post-Draft Alignment (Mandatory)

Present the complete coded encounter to the user before finalizing:

### Coded Encounter Summary

**Encounter:** [type] | **DOS:** [date] | **Provider:** [name] | **Payer:** [payer]

**Diagnosis Codes:**
_(Diagnosis Code Table from Step 1)_

**Procedure Codes:**
_(Procedure Code Table from Step 2)_

**Flags:**
- Queries pending: [count] — list each `[QUERY PROVIDER]` item
- NCCI conflicts: [count] — list each with resolution
- Specificity gaps: [count] — list codes that could be more specific

Ask: _"Does this coded encounter accurately reflect the services documented? Should any codes be added, removed, or changed?"_

Do NOT finalize until the user confirms.

---

## Quality Audit

Run these checks on every coded encounter before delivery:

| Check | Pass Criteria | Result |
|-------|---------------|--------|
| Specificity | No `.9` (unspecified) codes when documentation supports specificity | |
| Sequencing | Principal diagnosis is the condition chiefly responsible after study | |
| NCCI compliance | No unbundled code pairs without valid modifier and documentation | |
| Laterality | All applicable codes include laterality when documented | |
| 7th character | Injury/fracture codes include episode of care extension | |
| E/M level | MDM grid completed; 2 of 3 elements support billed level | |
| Modifier validity | Each modifier has documented clinical justification | |
| HCC capture | All HCC-eligible chronic conditions coded if MA payer | |
| Documentation linkage | Every code maps to a specific note section | |
| Upcoding risk | No codes assigned beyond what documentation supports | |

**If any check fails:** flag the specific code, cite the deficiency, and recommend corrective action before finalizing.

---

## Reference Files

| File | Contents |
|------|----------|
| `references/CODING-REFERENCE.md` | E/M MDM level grid with examples, modifier table, ICD-10-CM structure, top coding pitfalls |


---
Source attribution: CaseMark
Original project: https://github.com/CaseMark/skills/blob/449269ec49b6a8f1b4614cea52aa44b2a76e4e94/skills/med/coding-medical-encounters/SKILL.md
License: Apache-2.0
License information: https://www.apache.org/licenses/LICENSE-2.0
Original upstream instructions; downloaded from Dave AI.

## Upstream license notice

                                 Apache License
                           Version 2.0, January 2004
                        http://www.apache.org/licenses/

   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION

   1. Definitions.

      "License" shall mean the terms and conditions for use, reproduction,
      and distribution as defined by Sections 1 through 9 of this document.

      "Licensor" shall mean the copyright owner or entity authorized by
      the copyright owner that is granting the License.

      "Legal Entity" shall mean the union of the acting entity and all
      other entities that control, are controlled by, or are under common
      control with that entity. For the purposes of this definition,
      "control" means (i) the power, direct or indirect, to cause the
      direction or management of such entity, whether by contract or
      otherwise, or (ii) ownership of fifty percent (50%) or more of the
      outstanding shares, or (iii) beneficial ownership of such entity.

      "You" (or "Your") shall mean an individual or Legal Entity
      exercising permissions granted by this License.

      "Source" form shall mean the preferred form for making modifications,
      including but not limited to software source code, documentation
      source, and configuration files.

      "Object" form shall mean any form resulting from mechanical
      transformation or translation of a Source form, including but
      not limited to compiled object code, generated documentation,
      and conversions to other media types.

      "Work" shall mean the work of authorship, whether in Source or
      Object form, made available under the License, as indicated by a
      copyright notice that is included in or attached to the work
      (an example is provided in the Appendix below).

      "Derivative Works" shall mean any work, whether in Source or Object
      form, that is based on (or derived from) the Work and for which the
      editorial revisions, annotations, elaborations, or other modifications
      represent, as a whole, an original work of authorship. For the purposes
      of this License, Derivative Works shall not include works that remain
      separable from, or merely link (or bind by name) to the interfaces of,
      the Work and Derivative Works thereof.

      "Contribution" shall mean any work of authorship, including
      the original version of the Work and any modifications or additions
      to that Work or Derivative Works thereof, that is intentionally
      submitted to the Licensor for inclusion in the Work by the copyright owner
      or by an individual or Legal Entity authorized to submit on behalf of
      the copyright owner. For the purposes of this definition, "submitted"
      means any form of electronic, verbal, or written communication sent
      to the Licensor or its representatives, including but not limited to
      communication on electronic mailing lists, source code control systems,
      and issue tracking systems that are managed by, or on behalf of, the
      Licensor for the purpose of discussing and improving the Work, but
      excluding communication that is conspicuously marked or otherwise
      designated in writing by the copyright owner as "Not a Contribution."

      "Contributor" shall mean Licensor and any individual or Legal Entity
      on behalf of whom a Contribution has been received by the Licensor and
      subsequently incorporated within the Work.

   2. Grant of Copyright License. Subject to the terms and conditions of
      this License, each Contributor hereby grants to You a perpetual,
      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
      copyright license to reproduce, prepare Derivative Works of,
      publicly display, publicly perform, sublicense, and distribute the
      Work and such Derivative Works in Source or Object form.

   3. Grant of Patent License. Subject to the terms and conditions of
      this License, each Contributor hereby grants to You a perpetual,
      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
      (except as stated in this section) patent license to make, have made,
      use, offer to sell, sell, import, and otherwise transfer the Work,
      where such license applies only to those patent claims licensable
      by such Contributor that are necessarily infringed by their
      Contribution(s) alone or by combination of their Contribution(s)
      with the Work to which such Contribution(s) was submitted. If You
      institute patent litigation against any entity (including a
      cross-claim or counterclaim in a lawsuit) alleging that the Work
      or a Contribution incorporated within the Work constitutes direct
      or contributory patent infringement, then any patent licenses
      granted to You under this License for that Work shall terminate
      as of the date such litigation is filed.

   4. Redistribution. You may reproduce and distribute copies of the
      Work or Derivative Works thereof in any medium, with or without
      modifications, and in Source or Object form, provided that You
      meet the following conditions:

      (a) You must give any other recipients of the Work or
          Derivative Works a copy of this License; and

      (b) You must cause any modified files to carry prominent notices
          stating that You changed the files; and

      (c) You must retain, in the Source form of any Derivative Works
          that You distribute, all copyright, patent, trademark, and
          attribution notices from the Source form of the Work,
          excluding those notices that do not pertain to any part of
          the Derivative Works; and

      (d) If the Work includes a "NOTICE" text file as part of its
          distribution, then any Derivative Works that You distribute must
          include a readable copy of the attribution notices contained
          within such NOTICE file, excluding any notices that do not
          pertain to any part of the Derivative Works, in at least one
          of the following places: within a NOTICE text file distributed
          as part of the Derivative Works; within the Source form or
          documentation, if provided along with the Derivative Works; or,
          within a display generated by the Derivative Works, if and
          wherever such third-party notices normally appear. The contents
          of the NOTICE file are for informational purposes only and
          do not modify the License. You may add Your own attribution
          notices within Derivative Works that You distribute, alongside
          or as an addendum to the NOTICE text from the Work, provided
          that such additional attribution notices cannot be construed
          as modifying the License.

      You may add Your own copyright statement to Your modifications and
      may provide additional or different license terms and conditions
      for use, reproduction, or distribution of Your modifications, or
      for any such Derivative Works as a whole, provided Your use,
      reproduction, and distribution of the Work otherwise complies with
      the conditions stated in this License.

   5. Submission of Contributions. Unless You explicitly state otherwise,
      any Contribution intentionally submitted for inclusion in the Work
      by You to the Licensor shall be under the terms and conditions of
      this License, without any additional terms or conditions.
      Notwithstanding the above, nothing herein shall supersede or modify
      the terms of any separate license agreement you may have executed
      with Licensor regarding such Contributions.

   6. Trademarks. This License does not grant permission to use the trade
      names, trademarks, service marks, or product names of the Licensor,
      except as required for reasonable and customary use in describing the
      origin of the Work and reproducing the content of the NOTICE file.

   7. Disclaimer of Warranty. Unless required by applicable law or
      agreed to in writing, Licensor provides the Work (and each
      Contributor provides its Contributions) on an "AS IS" BASIS,
      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
      implied, including, without limitation, any warranties or conditions
      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
      PARTICULAR PURPOSE. You are solely responsible for determining the
      appropriateness of using or redistributing the Work and assume any
      risks associated with Your exercise of permissions under this License.

   8. Limitation of Liability. In no event and under no legal theory,
      whether in tort (including negligence), contract, or otherwise,
      unless required by applicable law (such as deliberate and grossly
      negligent acts) or agreed to in writing, shall any Contributor be
      liable to You for damages, including any direct, indirect, special,
      incidental, or consequential damages of any character arising as a
      result of this License or out of the use or inability to use the
      Work (including but not limited to damages for loss of goodwill,
      work stoppage, computer failure or malfunction, or any and all
      other commercial damages or losses), even if such Contributor
      has been advised of the possibility of such damages.

   9. Accepting Warranty or Additional Liability. While redistributing
      the Work or Derivative Works thereof, You may choose to offer,
      and charge a fee for, acceptance of support, warranty, indemnity,
      or other liability obligations and/or rights consistent with this
      License. However, in accepting such obligations, You may act only
      on Your own behalf and on Your sole responsibility, not on behalf
      of any other Contributor, and only if You agree to indemnify,
      defend, and hold each Contributor harmless for any liability
      incurred by, or claims asserted against, such Contributor by reason
      of your accepting any such warranty or additional liability.

   END OF TERMS AND CONDITIONS

   Copyright 2025 CaseMark, Inc.

   Licensed under the Apache License, Version 2.0 (the "License");
   you may not use this file except in compliance with the License.
   You may obtain a copy of the License at

       http://www.apache.org/licenses/LICENSE-2.0

   Unless required by applicable law or agreed to in writing, software
   distributed under the License is distributed on an "AS IS" BASIS,
   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   See the License for the specific language governing permissions and
   limitations under the License.



# Dave AI resource metadata

Creator / publisher: CaseMark
Original project: https://github.com/CaseMark/skills/blob/449269ec49b6a8f1b4614cea52aa44b2a76e4e94/skills/med/coding-medical-encounters/SKILL.md
Attribution basis: Source repository record

Fields of work: Healthcare & Life Sciences, Sales
Roles: Clinical Research, Health Informatics, Medical Writer, Revenue Operations
Specialties: Specialty not specified
Tools: Tool not specified
Country applicability: Country not specified
Classification basis: Source catalog labels
Instruction SHA-256: 143a043aaf8b2463692d45fe045a0aa8e5a225d2de43ba747b25a7b543ffdf97
