dsh-icd-rule-check
Flags ICD coding pairs that need a coder's attention - dagger and asterisk combinations, combination codes - against GB/T 14396-2016 and published ICD usage notes. Reports the pairs it finds rather than resolving them; the coding decision stays with the coder.
Install
dsh plugin --profile web add dsh-icd-rule-check
Sandbox test results
| Stage | Result |
|---|---|
| 1 install | ✓ |
| 2 list | ✓ |
| 3 mount | ✓ |
| 4 boot | — |
Four stages run in an isolated sandbox: install (network on) → list → mount → boot (last three with no network).
README
dsh-icd-rule-check — ICD coding rule check for one coded inpatient episode: combined-code and dagger/asterisk pairing hints
[English](README.md) · [简体中文](README-zh.md) · [Español](README-es.md) · [Português](README-pt.md) · [हिन्दी](README-hi.md)
<!-- topblock:v1 -->
What it is — ICD coding rule check for one coded inpatient episode: combined-code and dagger/asterisk pairing hints. It returns a list of what is inconsistent, where, and what to fix.
Who it is for — medical coders and quality control; no command line required.
What you give it — the source material the check works on (a table, register or document); the original is never modified. Excel can be converted to JSON/YAML first, in chat if the platform supports it.
What it does not do — no compliance verdict, no liability finding, no replacement for the reviewer; differences only.
How to start — search "Medical Record QC Suite" in WorkBuddy / Coze (this check is one part of it; availability as listed); or:
dsh plugin --profile <name> add dsh-icd-rule-check
<!-- /topblock:v1 -->


dsh-icd-rule-check reads one coded inpatient episode — the principal diagnosis, the other diagnoses, the principal procedure, the other procedures and the admission-condition codes — and checks that episode's own structure and cross-references: that every diagnosis code has ICD-10 form and every procedure code ICD-9-CM-3 form (the † / * markers are stripped before the form test), that the same diagnosis code is not listed twice, that an asterisk code has its dagger partner in the same episode, that a principal diagnosis is present, and that the fields each check needs are filled. Every difference names the clause it came from, and every check that could not run is listed in skipped rather than passing silently. It never looks a code up in a catalogue.
Install
dsh plugin --profile <name> add dsh-icd-rule-check dsh --profile <name> --dump-config | grep 'dsh-icd-rule-check'
What it looks like
Workflow overview: document → rule pack → findings. The examples below use the real command surface.
What it answers
Examples
The table below is the example set: the first row is the detailed walkthrough, the remaining rows are short cases.
Detailed output
Tool icd_rule_check
Input
~~~json
{"principalDiagnosis":{"code":"急性心肌梗死","name":"急性心肌梗死"},"otherDiagnoses":[{"code":"I10","name":"高血压"}],"principalProcedure":{"code":"36.0600","name":"冠状动脉支架植入术"}}
~~~
Output
~~~json
{
"id": "dsh-icd-rule-check.IC-001.5a91e9d3",
"ruleId": "IC-001",
"severity": "error",
"locator": {
"column": "主要诊断",
"cell": "急性心肌梗死"
},
"found": "诊断编码「急性心肌梗死」不符合 ICD-10 形式",
"expected": "疾病诊断编码应当统一使用 ICD-10,形式为 ^[A-Z][0-9]{2}(\\.[0-9A-Z]{1,4})?$"
}
~~~
Observed from dsh-icd-rule-check/tests/fixtures/IC-001/IC-001-unsafe.json
You ask · What it answers
Our export stores the diagnosis code as A18.1†. Will the dagger make the form check fire? · No. IC-001 strips the dagger and asterisk markers († / *) before it tests the code, so the marker alone never produces a finding. It checks the code's form only: a well-formed code that your catalogue does not actually contain still passes, because verifying that needs a licensed catalogue of the same version the coder uses.
The principal diagnosis field is empty. What is reported? · IC-009 reports that the record carries no principal diagnosis and asks for it to be filled in. Its limit is that it checks only whether the field is filled, not whether the diagnosis chosen as principal is the right one — that choice belongs to the coder, and the rule does not make it.
There is an asterisk code in the list and no dagger code to go with it. · IC-003 reports the asterisk code when the dagger code the pairing table assigns to it is absent from the same episode. It is the pack's most mechanical determination, and it needs your own table in pairs; with pairs empty the rule reports that it could not run instead of passing silently. Its limit is the pairing itself: the pack does not adopt the reading, common in Chinese medical-record practice, that an asterisk code may not be the principal diagnosis.
The same diagnosis code is listed twice. · IC-002 reports the repeated code, treating it as the same diagnosis listed twice. It is capped at warn: no clause was found that forbids repetition in those words, so its basis is a principle and it points the row out for review instead of blocking.
The principal diagnosis is a T82 complication and no other diagnosis is listed. · IC-011 reports that row. For a principal diagnosis in the T80-T88 series it asks only whether any other diagnosis is present at all: the clause requires an additional code to describe the complication but does not say which one, so the rule does not choose it — that belongs to the coder and to the catalogue in use.
IC-005 never reports anything on our export — does that mean the principal procedure matches the principal diagnosis? · No. IC-005 ships with its correspondence table empty, so it declares itself in skipped with the reason that the table is not configured; an empty finding list there is not a pass. Fill correspondence with your own diagnosis→procedure groupings — an empty procedures list means that group should carry no principal procedure — and the rule starts comparing.
Standards it follows
Document · Number · Cited by rules
《住院病案首页数据填写质量规范(暂行)》 · 国卫办医发〔2016〕24号 · IC-001, IC-0
…(truncated)
Rendered from the README published on npm. Formatted only, not edited.
Versions
Published on npm::10,最后更新 2026-11-04