← Back to Skills Marketplace
colifire

Test Skills Upload

by lin-ke · GitHub ↗ · v1.0.0 · MIT-0
cross-platform ⚠ suspicious
24
Downloads
0
Stars
0
Active Installs
1
Versions
Install in OpenClaw
/install test-skill-upload
Description
将中文门诊复诊病历文本结构化为细粒度字段,输出 JSON(如现病史/既往史/诊断/处理意见等)。
README (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
Usage Guidance
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.
Capability Analysis
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.
Capability Assessment
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.
How to Use
  1. Make sure OpenClaw is installed (local or Docker)
  2. Run the install command in chat: /install test-skill-upload
  3. After installation, invoke the skill by name or use /test-skill-upload
  4. Provide required inputs per the skill's parameter spec and get structured output
Version History
v1.0.0
test upload skill
Metadata
Slug test-skill-upload
Version 1.0.0
License MIT-0
All-time Installs 0
Active Installs 0
Total Versions 1
Frequently Asked Questions

What is Test Skills Upload?

将中文门诊复诊病历文本结构化为细粒度字段,输出 JSON(如现病史/既往史/诊断/处理意见等)。 It is an AI Agent Skill for Claude Code / OpenClaw, with 24 downloads so far.

How do I install Test Skills Upload?

Run "/install test-skill-upload" in the OpenClaw or Claude Code chat to install it in one step — no extra setup required.

Is Test Skills Upload free?

Yes, Test Skills Upload is completely free, licensed under MIT-0. You can download, install and use it at no cost.

Which platforms does Test Skills Upload support?

Test Skills Upload is cross-platform and runs anywhere OpenClaw / Claude Code is available (cross-platform).

Who created Test Skills Upload?

It is built and maintained by lin-ke (@colifire); the current version is v1.0.0.

💬 Comments