T.01Knowledge Base

Why 7-character ICD-10 specificity is a medical ontology problem, not a model training problem

Language models reliably identify the diagnostic category. Laterality, encounter type, and episode of care require live traversal of the ICD-10 hierarchy — a constraint no training corpus eliminates.

ICD-10-CMUMLSOntology

Category identification is the easy half

A clinical language model trained on production documentation will identify the diagnostic category of a note with high reliability. Given a discharge summary describing a fall with subsequent wrist pain and imaging confirming a fracture, almost any competent model will land on the correct three-character category. That part of the problem has been effectively solved by scale: the category is a lexical and semantic inference over language the model has seen many thousands of times.

Category-level identification, however, is not a billable outcome. Payers adjudicate against fully specified codes, and for large parts of the ICD-10-CM code set full specification means seven characters. A three-character category submitted to a payer is not a partially correct claim — it is an invalid claim, rejected at the clearinghouse or denied on adjudication.

The remaining characters encode laterality, anatomic subsite, encounter type, and episode of care. These attributes are not distributed through the narrative in the way diagnostic language is. They live in the structure of the code set itself, in the instructional notes that govern which leaf nodes are legal, and in the interaction between the documentation and a hierarchy the model cannot see at inference time unless you give it to it.

What the seventh character actually asks of a system

Consider a fracture code family. The category identifies the bone. The fourth and fifth characters narrow the anatomic subsite. The sixth encodes laterality — right, left, or unspecified. The seventh encodes the encounter: initial encounter for closed fracture, subsequent encounter for fracture with routine healing, subsequent encounter with delayed healing, subsequent encounter with nonunion, subsequent encounter with malunion, sequela.

None of those seventh-character values can be inferred from the clinical description of the injury. They are properties of the encounter's position in a treatment timeline. Determining whether an encounter is initial or subsequent requires knowing whether the patient has received active treatment for this injury before, which is a question about the patient's record rather than about the note in front of the model.

This is why fracture coding, obstetric coding, and injury coding are the encounter types where flat-classification systems degrade most sharply. The label space is enormous, the discriminating evidence is thin, and the correct answer depends on state that lives outside the document.

Traversal as an architectural requirement

Valid code selection requires walking the ICD-10-CM hierarchy at inference time. The system starts at the category the model proposed, enumerates the legal children at each level, and asks a narrow, answerable question at every branch: does the documentation support laterality, and if so which side; does the documentation establish encounter type; is this leaf node excluded by an Excludes1 note attached to a code already assigned on this claim.

Framed this way, the hard part of specificity becomes a sequence of small decisions with explicit evidence requirements, rather than one large decision over a label space of seventy thousand codes. Each branch decision is auditable. Each unsupported branch produces a specific, actionable documentation query rather than an unspecified code.

Traversal also gives you a principled place to stop. When the documentation genuinely does not support a laterality determination, the correct output is the unspecified code plus a flagged query — not a guess. A classifier trained on historical claims will happily guess, because the training distribution rewarded guessing whatever was most common.

Why this is not solved by more training data

The ICD-10-CM code set changes annually. Codes are added, deleted, expanded, and re-parented; instructional notes are revised. A system that encodes the code set in model weights inherits that churn as a retraining and revalidation cost every October, with no guarantee that the new weights preserve behaviour on the unchanged parts of the hierarchy.

A system that treats the code set as data absorbs the update as data. The traversal logic does not change when a category gains three new children; the enumeration at that branch simply returns three more candidates. Validation shifts from full-model revalidation to targeted regression on the branches that changed.

There is also a coverage argument. Long-tail codes appear rarely or never in any realistic training corpus, but they are legal and occasionally correct. Traversal reaches them because they exist in the hierarchy. A classifier reaches them only if it saw them, which for a substantial fraction of the code set it did not.

What this means for evaluation

Evaluate at the character level, not the category level. A model that reaches the correct three-character category but the wrong seventh character produces a denial, not partial credit. Report exact-match rate at full specificity, and separately report the rate at which the system correctly declines to specify — because a system that never declines is inflating its apparent accuracy by guessing.

Stratify by encounter type. Fracture, injury, and obstetric encounters should be reported separately from chronic-condition encounters, because their specificity requirements differ by an order of magnitude in difficulty.

Finally, ask any vendor to show the traversal. If a system cannot explain which branch decisions it made and what documentation supported each one, its output is not defensible in an audit regardless of what its aggregate accuracy figure says.

← Back to the knowledge base