← Back to Skills Marketplace
unisound-llm

unisound-diagnosis-sufficiency-review

by Unisound-LLM · GitHub ↗ · v1.0.0 · MIT-0
cross-platform ⚠ suspicious
94
Downloads
0
Stars
0
Active Installs
1
Versions
Install in OpenClaw
/install unisound-diagnosis-sufficiency-review
Description
诊断依据充分性审核。输入结构化病案 record 与待审核诊断列表,输出诊断依据充分性审核结果。
README (SKILL.md)

诊断依据充分性审核

概述

给定结构化病案 record 和待审核诊断列表,本技能从诊断依据充分性规则库读取指南,核对病历文书证据,输出诊断依据是否充分。

本技能会:

  • diagnosis_sufficiency_guidelines 读取诊断依据充分性审核指南。
  • 按诊断 role 区分主诊断和其他诊断,分别匹配指南适用范围。
  • 优先按用户提供的 diagnoses 候选列表审核;未提供时,默认审核 record.diagnosis.primaryDiagnosisrecord.diagnosis.otherDiagnoses 中的全部诊断。
  • 调用 skill 内置的 review_diagnosis_sufficiency_record function 完成审核。
  • 通过 scripts/run.py 提供统一 CLI 入口;不转发、不调用当前项目已有 API 服务,也不导入当前项目 app.* 模块。

数据安全、隐私与伦理声明

  • 最小必要原则:仅处理审核所需的病案文书、诊断编码和诊断名称。
  • 严格脱敏:调用方应在传入前完成姓名、证件号、手机号、详细地址等可识别身份信息的脱敏。
  • 不做本地持久化:本技能不把请求体、中间结果或审核结果写入本地文件或数据库。
  • 数据库用途:数据库仅用于读取诊断依据充分性规则库。
  • 模型调用说明:默认使用内部医疗大模型生成依据充分性判断;鉴权 appkey 必须由调用方传入。如需完全离线规则回退,可传 use_llm=false
  • 医疗边界:输出为医保编码审核辅助信息,不构成医疗诊断或治疗建议。

输入格式

统一入口支持 pdf/doc/docx/xls/xlsx/csv/txt/json。JSON 可为结构化病案;其他格式会先预处理为一份完整病历文书。未显式传入 diagnoses 时,会自动审核结构化病案中的主诊断和全部其他诊断;普通病历文件需要通过参数传入待审核诊断列表。

{
  "record": {
    "hospitalId": "988",
    "serialNum": "0001092574",
    "docs": [
      {
        "docName": "首次病程记录",
        "fileName": "首次病程记录",
        "docClassName": "首次病程记录",
        "content": "..."
      }
    ],
    "diagnosis": {
      "primaryDiagnosis": {"name": "2型糖尿病", "code": "E11.901"},
      "otherDiagnoses": []
    }
  },
  "diagnoses": [
    {"role": "primary", "code": "E11.901", "name": "2型糖尿病"}
  ],
  "appkey": "由平台分配的鉴权 key",
  "model": "",
  "use_llm": true
}

字段说明:

  • record必填。结构化病案 JSON。
  • diagnoses:可选。待审核诊断候选数组;每项包含 rolecodename
  • roleprimary 表示主诊断;其他值按其他诊断处理。
  • appkey必填。内部医疗大模型鉴权 key,由平台分配;调用时使用 Bearer 鉴权。
  • model:可选。内部医疗大模型名称,默认 u1-insuremed
  • use_llm:可选,默认 true。传 false 时不调用模型,仅使用本地回退审核逻辑。

审核规则

  • 候选优先:只审核输入候选或病案首页中已有诊断,不自由生成候选列表外的诊断名称或编码。
  • 证据优先:依据充分必须来自病程、出院记录、检查检验、治疗经过等病历文书明确支持;不能把病案首页诊断列表本身当作充分临床依据。
  • 主诊断边界:主诊断应体现本次住院主要诊疗原因、主要资源消耗或核心治疗目标;仅有既往史、伴随疾病或偶然检出,不能自动视为主诊断依据充分。
  • 其他诊断边界:其他诊断应有明确并存、影响检查治疗、用药、护理、病情评估或资源消耗的证据;仅名称出现时需保守。
  • 父类/子类边界:父类诊断证据不能自动证明子类分型、并发症、部位、病因成立;缺少细分证据时输出 待人工复核依据不充分
  • 同义词/简称边界:仅当简称、同义词与候选诊断在医学内涵和编码归类上明确一致时可作为证据。
  • 模糊保守:疑似、待排、排除、术前诊断未证实、既往史、家族史、患者自述未被医生确认等,不应直接判为依据充分。
  • DRG/CC 边界:严重合并症或并发症、一般合并症或并发症、无合并症或并发症的边界必须由病历明确支持;不能用模型常识或编码父类自动升级。

快速开始

# JSON 结构化病历;未显式传入候选时审核主诊断和全部其他诊断
python3 doctor/icd-drg/diagnosis-sufficiency-review/scripts/run.py \
  --input doctor/icd-drg/diagnosis-sufficiency-review/example/10109_A5204171_1.json \
  --appkey \x3Cyour-appkey> \
  --no-llm

# TXT/PDF 等普通病历文件;必须传入待审核诊断,可重复传入主诊断和其他诊断
python3 doctor/icd-drg/diagnosis-sufficiency-review/scripts/run.py \
  --input /path/to/record.txt \
  --appkey \x3Cyour-appkey> \
  --diagnosis 'primary|E11.901|2型糖尿病' \
  --diagnosis 'other|I10.x00|高血压' \
  --save-prepared

参数说明

  • --input PATH必填。结构化病案 JSON,或包含 record 的请求体 JSON。
  • --input-type auto|pdf|doc|docx|xls|xlsx|csv|txt|json:输入类型,默认 auto
  • --sheet STRING:读取 Excel 时指定 sheet(可选)。
  • --encoding STRINGtxt/csv 编码,默认 utf-8
  • --diagnosis STRING:待审核诊断,格式 role|code|namecode|name;可重复。
  • --diagnoses-json STRING:待审核诊断 JSON 字符串或文件路径。
  • 普通 txt/pdf/doc/docx/xls/xlsx/csv 文件不会自动知道待审核诊断,必须传 --diagnosis--diagnoses-json
  • --appkey STRING必填。内部医疗大模型鉴权 key,由平台分配;调用时使用 Bearer 鉴权。
  • --base URL:内部大模型 base URL,默认 https://maas-api.hivoice.cn/v1
  • --model STRING:模型名称,默认 u1-insuremed
  • --timeout SECONDS:HTTP 超时秒数;0 表示一直等待,默认 0
  • --no-llm:可选。禁用 LLM,仅使用本地回退逻辑。
  • --output-json PATH:可选。保存响应 JSON;同时传 --output 时优先使用该参数。
  • --output PATH:可选。兼容旧调用方式,等同于 --output-json
  • --save-prepared:可选。保存预处理后的病历文本到 doctor/icd-drg/runs/diagnosis-sufficiency-review/ 或输出文件所在目录;路径提示输出到 stderr。

输出约定

CLI 只输出 JSON,不输出 Markdown、序号或额外提示语。响应结构:

{
  "final_decision": "依据充分",
  "reasoning": "E11.901 2型糖尿病:依据充分。病历文书存在可支撑该诊断的明确临床依据。"
}

final_decision 只能为 依据充分依据不充分待人工复核reasoning 只写面向用户的简洁依据,不展示内部 chain-of-thought。

示例

  • 正例:候选主诊断 E11.901 2型糖尿病,病程记录、检验结果和治疗经过均支持本次住院围绕糖尿病诊疗,可输出 依据充分
  • 正例:候选其他诊断有明确检查结果、用药或治疗调整,且影响本次诊疗,可输出 依据充分
  • 多项审核例:结构化病案包含 primaryDiagnosis 和多个 otherDiagnoses 时,未传 --diagnosis 也会审核主诊断和全部其他诊断;普通文件需用多个 --diagnosis 显式列出。
  • 边界例:文书只支持糖尿病父类诊断,未明确候选子类所需并发症或分型,应输出 待人工复核
  • 不应匹配例:仅病案首页诊断列表出现候选名称,正文无症状、检查、治疗或病程依据,不应直接判为依据充分。

依赖

运行环境

  • Python 3.11+
  • psycopg[binary]psycopg2

外部服务

  • PostgreSQL:读取 diagnosis_sufficiency_guidelines
  • 内部医疗大模型:https://maas-api.hivoice.cn/v1/chat/completions

测试命令

skills 根目录执行:

python3 self_tests/med-icd-drg-review/self_test_icd_drg_review.py

备注

  • 数据库连接配置硬编码在 scripts/diagnosis_sufficiency_review.pyHARDCODED_DATABASE
  • scripts/run.py 是唯一对外入口,复用 scripts/diagnosis_sufficiency_review.py 的核心审核逻辑。
  • LLM 鉴权 appkey 由用户在调用时传入,脚本不硬编码。
  • 发布目录只保留 SKILL.md_meta.jsonscripts/;示例输入、运行输出、自测脚本放在 skill 包外。
Usage Guidance
Before installing, confirm who operates the PostgreSQL database and LLM endpoint, require proper secret management instead of hardcoded database credentials, de-identify medical records, and avoid `--save-prepared` or output-file options unless you intentionally want local copies of sensitive case data.
Capability Analysis
Type: OpenClaw Skill Name: unisound-diagnosis-sufficiency-review Version: 1.0.0 The skill bundle is classified as suspicious due to the presence of hardcoded internal network infrastructure details (IP `10.10.20.15`, port `15432`) and database credentials in `scripts/diagnosis_sufficiency_review.py`. While the code's logic appears consistent with its stated purpose of medical diagnosis review using an external LLM API (`maas-api.hivoice.cn`), the inclusion of internal database targets is a high-risk configuration that could be used for unauthorized internal network access. No explicit evidence of intentional data exfiltration or backdoors was found, but the hardcoded environment-specific details and the processing of sensitive medical records warrant caution.
Capability Tags
requires-sensitive-credentials
Capability Assessment
Purpose & Capability
The stated purpose—checking diagnosis sufficiency against medical guidelines—matches the code paths for reading a record, selecting diagnoses, querying guidelines, and optionally using an LLM. The workflow handles sensitive medical records, so users should understand the data flow.
Instruction Scope
The instructions are generally scoped to the audit task and do not show prompt-injection or goal-hijack behavior. However, the privacy statement says the skill does not persist request/intermediate/result data while the documented CLI options allow saving prepared text and JSON output.
Install Mechanism
There is no install spec, but the code depends on external Python packages and a shared preprocessing module outside the included skill manifest. This is a provenance/runtime-completeness gap rather than clear malicious behavior.
Credentials
The skill requires sensitive credentialed access for an internal LLM and a PostgreSQL guideline database, but registry requirements declare no credentials or env vars, and the source hardcodes database connection fields.
Persistence & Privilege
The PostgreSQL account configuration is embedded in source, and optional flags can write medical text or output JSON locally. The local writes are user-directed, but the hardcoded database credential pattern is a material permission-boundary concern.
How to Use
  1. Make sure OpenClaw is installed (local or Docker)
  2. Run the install command in chat: /install unisound-diagnosis-sufficiency-review
  3. After installation, invoke the skill by name or use /unisound-diagnosis-sufficiency-review
  4. Provide required inputs per the skill's parameter spec and get structured output
Version History
v1.0.0
- Initial release of the med-diagnosis-sufficiency-review skill for structured medical record diagnosis sufficiency audits. - Accepts structured medical records and candidate diagnosis lists, checking sufficiency of evidence based on configurable guidelines. - Supports both model-based and rule-based sufficiency review; allows LLM usage to be toggled. - Ensures data privacy: requires de-identified input, no local persistence, uses database only for rule access. - Provides a unified CLI (`scripts/run.py`) supporting multiple input formats (json, pdf, docx, xls, etc.). - Outputs clear and concise sufficiency verdicts for each diagnosis candidate.
Metadata
Slug unisound-diagnosis-sufficiency-review
Version 1.0.0
License MIT-0
All-time Installs 0
Active Installs 0
Total Versions 1
Frequently Asked Questions

What is unisound-diagnosis-sufficiency-review?

诊断依据充分性审核。输入结构化病案 record 与待审核诊断列表,输出诊断依据充分性审核结果。 It is an AI Agent Skill for Claude Code / OpenClaw, with 94 downloads so far.

How do I install unisound-diagnosis-sufficiency-review?

Run "/install unisound-diagnosis-sufficiency-review" in the OpenClaw or Claude Code chat to install it in one step — no extra setup required.

Is unisound-diagnosis-sufficiency-review free?

Yes, unisound-diagnosis-sufficiency-review is completely free, licensed under MIT-0. You can download, install and use it at no cost.

Which platforms does unisound-diagnosis-sufficiency-review support?

unisound-diagnosis-sufficiency-review is cross-platform and runs anywhere OpenClaw / Claude Code is available (cross-platform).

Who created unisound-diagnosis-sufficiency-review?

It is built and maintained by Unisound-LLM (@unisound-llm); the current version is v1.0.0.

💬 Comments