Coding Icd10 logo

Coding Icd10

CommunityPopular
maziyarpanahi
coding-icd10

Suggests candidate ICD-10-CM diagnosis codes (and ICD-10-PCS procedure codes) for diagnoses and procedures extracted by OpenMed, with rationale and a human-coder caveat. Use when the user wants to code a problem list, map a diagnosis span to a billable ICD-10-CM code, route a finding to the right chapter, cross-walk ICD-9 via GEMs, or pre-fill an encounter for coder review. Trigger keywords: ICD-10-CM, ICD-10-PCS, diagnosis coding, billable code, GEMs, problem list coding, encounter diagnosis, chapter range, CMS code lookup. references/icd10-chapters.md holds the chapter/section ranges. Pairs after OpenMed NER: consume Disease/Pathology entities from openmed.analyze_text and propose codes a certified coder validates. ICD-10-CM/PCS files are public domain from CMS — no license barrier (unlike CPT, which is restricted and out of scope).

Overview

Publishermaziyarpanahi
Repositoryopenmed
Skill namecoding-icd10
Stars
5.3K
Forks
677
Bundled files
1
LicenseApache-2.0
Links
  • Markdown instructions

    A SKILL.md file the model loads on demand, so it only costs tokens when a request actually matches.

  • Works with any LLM

    AI skills are plain Markdown, not provider-specific code, so this works with GPT, Claude, Gemini, Grok, or a local model.

  • 1 bundled files

    Scripts, templates, and references the model can read while it works. Files are read-only and never executed.

  • Open source

    Published by maziyarpanahi on GitHub. Read the source before you install it.

Installation

Install the Coding Icd10 AI skill in TypingMind to use it with any LLM, or drop it into another agent that reads SKILL.md.

1

Install in TypingMind

TypingMind installs a skill straight from its GitHub folder — it reads SKILL.md, bundles the resource files, and stores the result locally.

  1. Open the app and go to Plugins → Skills.
  2. Choose "Install from GitHub".
  3. Paste the skill folder URL below and confirm.
  4. Enable the skill in any chat where you want it available.
Plugins → Skills → Add skill → From GitHub URL, then paste the folder URL and press Continue.
2

Install in another agent

Any agent that reads the Agent Skills format can use this skill — copy the folder into that agent's skills directory.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/maziyarpanahi/openmed.git /tmp/openmed
mkdir -p .claude/skills
cp -r /tmp/openmed/skills/coding-icd10 .claude/skills/coding-icd10
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Coding Icd10 in any TypingMind chat and the model takes it from there. Its name and description sit in the system prompt, and the moment a request matches, the model loads the full instructions itself — you never invoke it by hand, and it costs no tokens until it is actually used.

The model loads Coding Icd10 on its own as soon as a request matches it.

Works with any AI model

AI skills are plain Markdown instructions rather than provider-specific code, so Coding Icd10 is not tied to the model it was written for. Install it once in TypingMind and use it with GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama, or a local model you run yourself — all on your own API keys.

  • Loaded only when it is needed

    The system prompt carries just the name and description. The instructions are fetched on the first matching request, so an idle skill costs nothing.

  • Switch models mid-chat

    Because the skill is instructions rather than code, changing model does not break it — the next model reads the same SKILL.md.

Skill instructions

This is the SKILL.md content the model loads. Read it before installing — a skill is instructions your model will follow.

Coding OpenMed diagnoses to ICD-10-CM / PCS

Suggest ICD-10-CM diagnosis codes (and ICD-10-PCS for inpatient procedures) for the diagnosis and procedure spans OpenMed extracts. This is decision support for a certified coder, not autonomous billing: OpenMed + this skill narrow the candidate set and explain why; a human validates the final, billable code.

ICD-10-CM and ICD-10-PCS are public domain. CMS publishes the complete annual code files, addenda, and indexes for free. (CPT/HCPCS procedure codes are AMA-licensed and restricted — out of scope here; obtain those separately under the user's own AMA license.)

When to use

  • A note yields diagnoses ("type 2 diabetes with diabetic CKD", "community- acquired pneumonia") and you want candidate ICD-10-CM codes plus rationale.
  • You need to route a span to the right chapter quickly (see references/icd10-chapters.md for code ranges).
  • You hold legacy ICD-9 codes and need an approximate GEM cross-walk.
  • You are pre-filling encounter diagnoses for a coder's review queue.

For clinical-meaning codes use mapping-to-snomed; for HCC/risk capture use coding-hcc-risk-adjustment; this skill is for the ICD-10 classification.

Quick start (public data + public FHIR lookup)

Two complementary paths, both license-clean:

A) CMS files, loaded locally (public domain; you download once):

python
# CMS publishes the order/addenda file; load the code->description table.
# Columns: code (no dot), description; you insert the dot for display.
icd10cm = {}                       # "E1122" -> "Type 2 diabetes mellitus with diabetic chronic kidney disease"
with open("icd10cm_order_2025.txt", encoding="latin-1") as fh:
    for line in fh:
        code = line[6:13].strip()
        billable = line[14] == "1"     # '1' = valid billable code
        long_desc = line[77:].strip()
        if billable:
            icd10cm[code] = long_desc

def search_local(term: str, limit: int = 5):
    t = term.lower()
    hits = [(c, d) for c, d in icd10cm.items() if t in d.lower()]
    return sorted(hits, key=lambda cd: len(cd[1]))[:limit]

B) A FHIR terminology server that hosts ICD-10-CM (public servers exist; e.g. an NLM Clinical Tables endpoint or your own HAPI/Ontoserver):

python
import requests

# NLM Clinical Tables (public, no key) — ICD-10-CM autocomplete/search:
def search_icd10cm(term: str, count: int = 7):
    r = requests.get(
        "https://clinicaltables.nlm.nih.gov/api/icd10cm/v3/search",
        params={"sf": "code,name", "terms": term, "maxList": count}, timeout=10,
    )
    r.raise_for_status()
    _total, codes, _extra, display = r.json()
    return list(zip(codes, [d[1] for d in display]))   # [(code, name), ...]

print(search_icd10cm("type 2 diabetes nephropathy"))

Workflow

  1. Extract diagnosis/procedure spans with OpenMed (Disease/Pathology models).
  2. Route to a chapter using the span's clinical theme and references/icd10-chapters.md (e.g. endocrine → E00–E89, circulatory → I00–I99). This shrinks the search space and catches obvious mis-hits.
  3. Search the code text (local CMS table or the NLM API) for candidates.
  4. Apply ICD-10-CM specificity rules in your rationale: laterality, acute/chronic, episode of care, "with"/"due to" combination codes, and "code first / use additional code" notes. Flag where the note lacks the detail a billable code requires.
  5. Rank candidates; present the top few with rationale and the missing- detail caveat, not a single auto-selected code.
  6. Emit {system: "http://hl7.org/fhir/sid/icd-10-cm", code, display} marked status: needs-coder-review, with OpenMed source offsets.

Hand-off from OpenMed

openmed.analyze_text(..., output_format="dict") returns entities, each a dict with text, label, confidence, start, end. Consume Disease/Pathology spans:

python
import openmed

note = "Assessment: type 2 diabetes with diabetic nephropathy; CAP."
result = openmed.analyze_text(
    note,
    model_name="disease_detection_superclinical",   # Disease category
    output_format="dict",
)

DX_LABELS = {"DISEASE", "CONDITION", "PATHOLOGY"}
for ent in result["entities"]:
    if ent["label"] in DX_LABELS:
        candidates = search_icd10cm(ent["text"], count=5)
        print(ent["text"], ent["start"], ent["end"],
              f"(conf {ent['confidence']:.2f}) ->", candidates)
        # surface as SUGGESTIONS for a coder — never auto-bill

Keep OpenMed's start/end offsets next to each suggested code so the coder can jump to the exact supporting text. Store offsets and codes only — never the raw note in your suggestion log.

Edge cases & gotchas

  • Human-in-the-loop is mandatory. ICD-10-CM coding has legal/financial weight. Output candidates with rationale; a certified coder assigns the final billable code. Never present a suggestion as an authorized claim.
  • Specificity & unspecified codes. Many billable codes demand laterality, episode, or "with" detail the note may not state. Prefer flagging "documentation insufficient for a specific code" over forcing an .9/unspecified code.
  • Combination codes. ICD-10-CM bundles related conditions (e.g. E11.22 = diabetes with diabetic CKD). Don't emit two separate codes where one combination code is required; let the search surface combinations.
  • "Code first" / "use additional code" / Excludes1/Excludes2 sequencing notes change which codes coexist. Carry these as rationale for the coder.
  • GEMs are approximate. ICD-9↔ICD-10 General Equivalence Mappings are many-to-many and lossy; treat a GEM result as a starting hint, not a billable mapping.
  • Annual updates. Codes change every fiscal year (Oct 1). Pin the file year you loaded and refresh annually; record which version produced a suggestion.
  • Licensing. ICD-10-CM/PCS are public domain (CMS). Do not pull in CPT or proprietary code maps that require an AMA/other license — those stay user-supplied and out-of-process.
  • Local-first. OpenMed NER runs on-device; if you query the NLM API, send only the de-identified diagnosis string. No PHI over the wire.

Standards & references

Bundled files

The model reads these on demand while the skill is loaded. They are exposed as readable files and are never executed.

Frequently asked questions

What does the Coding Icd10 AI skill do?

Suggests candidate ICD-10-CM diagnosis codes (and ICD-10-PCS procedure codes) for diagnoses and procedures extracted by OpenMed, with rationale and a human-coder caveat. Use when the user wants to code a problem list, map a diagnosis span to a billable ICD-10-CM code, route a finding to the right chapter, cross-walk ICD-9 via GEMs, or pre-fill an encounter for coder review. Trigger keywords: ICD-10-CM, ICD-10-PCS, diagnosis coding, billable code, GEMs, problem list coding, encounter diagnosis, chapter range, CMS code lookup. references/icd10-chapters.md holds the chapter/section ranges. Pai...

Why use Coding Icd10 on TypingMind?

Because you install it once and use it with any model. Coding Icd10 is plain Markdown rather than provider-specific code, so the same skill runs on GPT-5, Claude, Gemini, Grok, or a local model — and you can switch model mid-chat without it breaking. TypingMind runs on your own API keys, so you pay providers directly instead of a per-seat subscription, and your skills and chats stay in your own storage.

How do I install Coding Icd10 in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/maziyarpanahi/openmed/tree/master/skills/coding-icd10. TypingMind reads its SKILL.md and bundles its files and installs it as a skill you can enable per chat.

Which AI models can use Coding Icd10?

Any model you connect in TypingMind. AI skills are plain Markdown instructions rather than provider-specific code, so GPT, Claude, Gemini, Grok, and local models can all load this skill when a request matches it.

How many AI models can I use with Coding Icd10?

As many as you like. As long as a model supports skills, you can use Coding Icd10 with it — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama and more — all on TypingMind with your own API keys.

Is the Coding Icd10 AI skill free?

Yes. It is published on GitHub by maziyarpanahi under the Apache-2.0 license. You only pay your own AI provider for the tokens you use.

What are AI skills?

An AI skill is a reusable instruction bundle that teaches an AI model how to do one specific task. It follows the open Agent Skills format: a SKILL.md file with a name and description, plus any scripts, templates or reference files the model may need. The model reads the instructions only when your request matches the skill, so an installed skill costs nothing until it is used.

How are AI skills different from plugins or MCP servers?

A plugin or MCP server gives a model new tools to call — code that runs somewhere and returns a result. An AI skill gives the model knowledge and process instead: how to approach a task, which steps to follow, what good output looks like. Skills are plain Markdown, so they need no server, no API key and no runtime, and they work with any model.

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇