test-skill-upload

将中文门诊复诊病历文本结构化为细粒度字段,输出 JSON(如现病史/既往史/诊断/处理意见等)。

Safety Notice

This listing is from the official public ClawHub registry. Review SKILL.md and referenced scripts before running.

Copy this and send it to your AI assistant to learn

Install skill "test-skill-upload" with this command: npx skills add colifire/test-skill-upload

门诊复诊病历结构化

概述

给定一份中文门诊 复诊病历文本(医生已书写),本技能抽取并规范化为细粒度字段 JSON,例如:

  • 现病史.病情概述
  • 现病史.药物
  • 现病史.其他治疗措施
  • 现病史.病情转归
  • 现病史.一般情况
  • 既往史.疾病
  • 既往史.其他信息
  • 既往史.手术史
  • 既往史.过敏史
  • 既往史.输血史
  • 婚育史
  • 月经史
  • 个人史
  • 家族史
  • 查体
  • 辅助检查
  • 诊断
  • 处理意见.药物
  • 处理意见.其他建议

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

  • 最小必要原则:仅处理结构化抽取所必需的文本内容;不要求也不鼓励包含姓名、证件号、手机号、详细地址等身份信息。
  • 严格脱敏:在发送至任何模型/接口前,会对可识别个人身份的信息进行脱敏/去标识化处理(如姓名、证件号、手机号、详细地址、人脸/影像等)。仅传递脱敏后的必要信息用于本次 skill 调用。
  • 不做本地持久化:不将用户输入与中间结果写入本地持久化存储(包含磁盘文件、数据库、日志)。仅在内存中短暂处理;本次调用结束即销毁
  • 第三方 API 风险提示:在功能需要时,可能会调用第三方模型/服务接口;此时仅会发送脱敏后的必要信息,并使用加密传输。除完成本次请求外,不用于任何其他用途(如训练、画像、营销)。
  • 医疗边界:本技能输出为文本抽取与结构化结果,不构成医疗诊断或治疗建议;如涉及临床判断请以执业医生意见为准。

输入格式

纯文本病历(UTF-8),可包含如下分段:

主诉:…… 现病史:…… 既往史:…… 婚育史:…… 月经史:…… 个人史:…… 家族史:…… 查体:…… 辅助检查:…… 诊断:…… 处理:……

也支持通过统一入口 scripts/run.py 直接输入 pdf/doc/docx/xls/xlsx/csv/txt/json。 预处理成功后,会先归一化为标准复诊病历文本,再调用本 skill 的原始结构化逻辑。

快速开始

# 从 skills 目录运行
python3 scripts/run.py \
  --input data/med-followup-record-struct/followup_record.txt

# 或继续直接使用原始文本入口
python3 scripts/struct_followup_record.py \
  --input data/med-followup-record-struct/followup_record.txt

参数说明

  • --input PATH
    • 输入复诊病历文本路径(UTF-8)。
  • --output PATH
    • 输出结构化 JSON 路径(默认:../runs/med-followup-record-struct/structured.json)。
  • --timeout SECONDS
    • 超时秒数;0 表示一直等待(默认:0)。
  • --diag-id STRING
    • 对话/就诊 ID(默认:skill-diag)。
  • --department STRING
    • 科室(可选)。

统一入口附加参数(scripts/run.py

  • --input-type auto|pdf|doc|docx|xls|xlsx|csv|txt|json
    • 输入类型;默认 auto
  • --sheet STRING
    • 读取 Excel 时指定 sheet(可选)。
  • --encoding STRING
    • txt/csv 编码(默认:utf-8)。
  • --save-prepared
    • 保存预处理后的标准复诊病历文本,便于调试。

输出约定

  • 输出为 UTF-8 JSON,key 形如 现病史.病情概述现病史.药物既往史.疾病诊断处理意见.药物 等。
  • 未提及字段在服务支持的情况下可能填充为“未提及”。

依赖

运行环境

  • Python 3.7+

外部 API

  • 后端结构化服务:https://shangbao.yunzhisheng.cn/skills/record-struct/gen_abstract_by_his
    • 方法:POST,Content-Type: application/json
    • 需要网络访问 shangbao.yunzhisheng.cn

Python 第三方包(可选,按输入格式需要)

包名用途必要条件
openpyxl读取 .xlsx 文件输入为 xlsx 时必须
pypdf提取 PDF 文本输入为 pdf 时必须(或用 pdftotext 替代)

安装:pip install openpyxl pypdf

外部工具(可选,按输入格式需要)

工具用途必要条件
LibreOffice (soffice)转换 .doc / .xls 为文本输入为 doc/xls 时必须
pdftotext(poppler-utils)提取 PDF 文本输入为 pdf 且未安装 pypdf 时必须
tesseract(含 chi_sim+eng 语言包)图片 OCR输入为 png/jpg/bmp/tif 等图片时必须

安装(Ubuntu/Debian):sudo apt-get install libreoffice poppler-utils tesseract-ocr tesseract-ocr-chi-sim

仅使用 TXT/JSON 输入时,无需安装任何第三方包或外部工具。

测试命令

skills 目录执行(网络自测):

python3 self_tests/med-followup-record-struct/self_test_followup_record_struct.py --run-network

Source Transparency

This detail page is rendered from real SKILL.md content. Trust labels are metadata-based hints, not a safety guarantee.

Related Skills

Related by shared tags or category signals.

General

ClawHub Demo Skill

Use this tiny demo skill to verify that a ClawHub skill can be published, installed, and invoked; it returns a short confirmation message and optionally echo...

Registry SourceRecently Updated
00Profile unavailable
General

meowtest

Captures learnings, errors, and corrections to enable continuous improvement. Use when: (1) A command or operation fails unexpectedly, (2) User corrects Clau...

Registry SourceRecently Updated
3110Profile unavailable
General

Test Gas Skill

Find and monitor estimated gas prices within a US radius, focusing on Costco discounts and providing daily alerts for chosen fuel types.

Registry SourceRecently Updated
7940Profile unavailable
General

spec-task

结构化任务管理与生命周期强制执行。以下场景必须使用:(1) 任何被 coordinator 通过 sessions_spawn 派发的任务 (2) 可拆解步骤≥3 的复杂任务 (3) 工作区已存在 spec-task/ 目录时的后续任务 (4) 用户显式要求使用 spec-task (5) prependCont...

Registry SourceRecently Updated
2230Profile unavailable