← 返回 Skills 市场
colifire

Test Skills Upload

作者 lin-ke · GitHub ↗ · v1.0.0 · MIT-0
cross-platform ⚠ suspicious
24
总下载
0
收藏
0
当前安装
1
版本数
在 OpenClaw 中安装
/install test-skill-upload
功能描述
将中文门诊复诊病历文本结构化为细粒度字段,输出 JSON(如现病史/既往史/诊断/处理意见等)。
使用说明 (SKILL.md)

门诊复诊病历结构化

概述

给定一份中文门诊 复诊病历文本(医生已书写),本技能抽取并规范化为细粒度字段 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
安全使用建议
Review carefully before installing. Treat this skill as sending medical-record content to shangbao.yunzhisheng.cn, remove patient identifiers yourself unless redaction is independently verified, avoid --save-prepared for sensitive data, and use trusted, patched document-conversion tools.
功能分析
Type: OpenClaw Skill Name: test-skill-upload Version: 1.0.0 The skill bundle is designed to structure Chinese medical record text into JSON format. It includes a preprocessing script (scripts/run.py) that handles various file formats (PDF, DOCX, XLSX, and images) using legitimate external tools like LibreOffice, Tesseract, and pdftotext via subprocess calls. The processed data is then sent to a documented external API (shangbao.yunzhisheng.cn) for structuring. All high-risk operations, such as network access and external command execution, are transparently documented in SKILL.md and are strictly necessary for the stated functionality. No evidence of malicious intent, data exfiltration to unauthorized endpoints, or prompt injection was found.
能力评估
Purpose & Capability
The stated goal of structuring Chinese follow-up outpatient records is coherent, but the artifacts show direct transmission of medical-record text to an external service while promising de-identification.
Instruction Scope
SKILL.md invites direct use of scripts/struct_followup_record.py, and that script reads the input file and posts it as his_record without visible redaction or user confirmation.
Install Mechanism
There is no install spec, while SKILL.md documents optional user-directed pip and apt installs for document/OCR support. These are purpose-aligned but unpinned.
Credentials
Handling outpatient medical records through an external API is high impact, and the artifacts do not provide concrete bounds for de-identification, retention, provider use, or approval.
Persistence & Privilege
The scripts write structured JSON output and SKILL.md documents --save-prepared for saving normalized text. This is user-directed, but it can persist medical data despite broad no-persistence language.
如何使用
  1. 确保已安装 OpenClaw(本地或 Docker 部署)
  2. 在对话框中输入安装命令:/install test-skill-upload
  3. 安装完成后,直接呼叫该 Skill 的名称或使用 /test-skill-upload 触发
  4. 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v1.0.0
test upload skill
元数据
Slug test-skill-upload
版本 1.0.0
许可证 MIT-0
累计安装 0
当前安装数 0
历史版本数 1
常见问题

Test Skills Upload 是什么?

将中文门诊复诊病历文本结构化为细粒度字段,输出 JSON(如现病史/既往史/诊断/处理意见等)。 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 24 次。

如何安装 Test Skills Upload?

在 OpenClaw 或 Claude Code 对话框中运行命令「/install test-skill-upload」即可一键安装,无需额外配置。

Test Skills Upload 是免费的吗?

是的,Test Skills Upload 完全免费,采用 MIT-0 许可证,可自由下载、安装和使用。

Test Skills Upload 支持哪些平台?

Test Skills Upload 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。

谁开发了 Test Skills Upload?

由 lin-ke(@colifire)开发并维护,当前版本 v1.0.0。

💬 留言讨论