← 返回 Skills 市场
49
总下载
0
收藏
0
当前安装
1
版本数
在 OpenClaw 中安装
/install redcap-crf-generator
功能描述
REDCap 数据字典生成器 - 将 Word 文档(CRF/方案)转换为 CSV 格式的 REDCap 数据字典。 适用场景: - 用户上传临床试验 CRF/方案 Word 文档,要求生成数据字典 - 将问卷/调查表转换为 REDCap 可导入的 CSV 格式 功能特点: - 智能识别表单、分节、字段结构 -...
使用说明 (SKILL.md)
REDCap CRF 数据字典生成器
概述
本技能将 Word 格式的临床试验方案/CRF 表单转换为符合 REDCap 标准的数据字典 CSV 文件。
数据字典格式(REDCap CSV)
| 列名 | 说明 | 示例 |
|---|---|---|
| Variable / Field Name | 字段变量名,CDISC规范 | sex, js_1, ws_22 |
| Form Name | 表单英文名 | demographics, basic_info |
| Section Header | 分节标题(仅首字段填写) | 人口学特征 |
| Field Type | 字段类型 | text, dropdown, radio, checkbox, calc, notes, file |
| Field Label | 字段中文标签 | 性别, 您对工作满意吗 |
| Choices, Calculations, OR Slider Labels | 选项(radio/checkbox/dropdown用) | 0, 否 | 1, 是 |
| Field Note | 特殊说明/格式要求 | 反向计分, YYYY-MM-DD |
| Text Validation Type | 验证类型 | date, phone, email, number, integer |
| Text Validation Min/Max | 数值范围 | 0, 100 |
| Identifier? | 是否隐私字段 | y(是)或留空 |
| Branching Logic | 分支逻辑 | [sex] = "0" |
| Required Field? | 是否必填 | y(是)或留空 |
⚠️ 重要:Section Header 规则
Section Header 仅第一个字段填写,后续同组字段留空!
这是 REDCap 数据字典的标准要求。同一个分节的字段,第一个字段标注 Section Header,后续字段该列留空。
示例:
Variable / Field Name,Form Name,Section Header,Field Type,Field Label,...
bi_1,basic_info,人口学特征,radio,您的性别,...
bi_2,basic_info,,radio,您的年龄,...
bi_3,basic_info,,radio,您的户籍,...
支持的字段类型
| 类型 | 说明 | Choices 格式 |
|---|---|---|
text |
单行文本 | 无 |
notes |
多行文本/备注 | 无 |
dropdown |
下拉选择 | 0, 选项1 | 1, 选项2 |
radio |
单选按钮 | 0, 选项1 | 1, 选项2 |
checkbox |
多选框 | 0, 选项1 | 1, 选项2 | 2, 选项3 |
calc |
计算字段 | round([weight]*10000/([height]^2),1) |
file |
文件上传 | 无 |
date |
日期(用text类型+date验证) | 无 |
量表支持
Likert 量表(职业压力等)
- 格式:
1, 非常符合 | 2, 基本符合 | 3, 有点不符合 | 4, 非常不符合 - 反向计分题选项顺序颠倒:
1, 非常不符合 | 2, 有点不符合 | 3, 基本符合 | 4, 非常符合
频率量表(工作状态等)
- 格式:
0, 从未发生 | 1, 一年几次或更少 | 2, 一月一次或更少 | 3, 一月几次 | 4, 一周一次 | 5, 一周几次 | 6, 每天发生
CDISC 变量命名规范
| 表单前缀 | 说明 | 示例 |
|---|---|---|
bi_ |
basic_info 基本信息 | bi_1, bi_2 |
js_ |
job_stress 职业压力 | js_1, js_31 |
ws_ |
work_status 工作状态 | ws_1, ws_22 |
mh_ |
mental_health 心理健康 | mh_1, mh_10 |
规则:
- 小写字母 + 下划线 + 数字
- 题号后缀便于溯源(如
js_5= job_stress 第5题) - 避免缩写,使用通用词汇
处理流程
- 读取 Word 文档 → 使用 python-docx 解析
- 识别结构 → 段落(基本信息和第四部分)/ 表格(第二、三部分量表)
- 字段解析 → 提取题目、选项、量表类型
- 智能推断 → 字段类型、验证规则、反向计分标记
- 生成 CSV → REDCap 标准格式,UTF-8 编码
使用方式
当用户上传 Word 文档并要求生成数据字典时:
- 读取文档内容
- 解析表单结构和字段
- 生成符合上述格式的 CSV
- 通过飞书发送文件给用户
依赖
pip install python-docx lxml
安全使用建议
This appears safe for its stated purpose. Before installing, use a trusted Python environment, confirm Feishu delivery is appropriate for the documents you upload, and avoid opening generated CSVs from untrusted Word files in spreadsheet software without review. Confidence is medium because one provided source file was truncated in the review context, although the visible code and static scan show no suspicious behavior.
功能分析
Type: OpenClaw Skill
Name: redcap-crf-generator
Version: 1.0.0
The skill bundle is a legitimate utility designed to convert Word documents (CRFs) into REDCap-compatible CSV data dictionaries. The Python scripts (generate_datadict.py and process_upload.py) use standard libraries like python-docx to parse document structure and extract field metadata without any evidence of malicious execution, data exfiltration, or obfuscation. The instructions in SKILL.md are well-defined and align strictly with the stated purpose of clinical data management.
能力评估
Purpose & Capability
The stated purpose is to convert uploaded Word CRF/protocol documents into REDCap CSV data dictionaries, and the visible scripts read DOCX files and write CSV output consistent with that purpose.
Instruction Scope
The skill is user-invoked and does not show prompt hijacking behavior, but it does instruct delivery of the generated file through Feishu, which users should recognize as an external sharing path.
Install Mechanism
The skill uses standard Python packages, but the SKILL.md setup text installs PyPI dependencies without version pins. This is common, but users should install in a trusted environment.
Credentials
Reading the selected Word document and writing a CSV are proportionate to the purpose. Because document text is copied into CSV fields, users should treat untrusted source documents and generated CSVs carefully.
Persistence & Privilege
No credentials, persistent background process, privileged path writes, account access, or long-running autonomous behavior are shown in the provided artifacts.
如何使用
- 确保已安装 OpenClaw(本地或 Docker 部署)
- 在对话框中输入安装命令:
/install redcap-crf-generator - 安装完成后,直接呼叫该 Skill 的名称或使用
/redcap-crf-generator触发 - 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v1.0.0
Initial release
元数据
常见问题
Redcap Crf Generator 是什么?
REDCap 数据字典生成器 - 将 Word 文档(CRF/方案)转换为 CSV 格式的 REDCap 数据字典。 适用场景: - 用户上传临床试验 CRF/方案 Word 文档,要求生成数据字典 - 将问卷/调查表转换为 REDCap 可导入的 CSV 格式 功能特点: - 智能识别表单、分节、字段结构 -... 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 49 次。
如何安装 Redcap Crf Generator?
在 OpenClaw 或 Claude Code 对话框中运行命令「/install redcap-crf-generator」即可一键安装,无需额外配置。
Redcap Crf Generator 是免费的吗?
是的,Redcap Crf Generator 完全免费,采用 MIT-0 许可证,可自由下载、安装和使用。
Redcap Crf Generator 支持哪些平台?
Redcap Crf Generator 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。
谁开发了 Redcap Crf Generator?
由 kenlcj(@kenlcj)开发并维护,当前版本 v1.0.0。
推荐 Skills