IB Summarizer
Description
Summarize core safety information from Investigator's Brochures (IB), helping clinical researchers quickly obtain key drug safety data.
Functions
- - Extract Core Safety Information (CSI) from IB documents
- Identify and summarize:
- Known Adverse Drug Reactions (ADRs) and their incidence rates
- Contraindications
- Warnings and Precautions
- Drug Interactions
- Special population precautions
- Overdose Management
- Important safety updates
Usage
CODEBLOCK0
Parameters
| Parameter | Type | Default | Required | Description |
|---|
| INLINECODE0 | string | - | Yes | IB document path (PDF/Word/TXT) |
| INLINECODE1 |
string | stdout | No | Output file path |
|
-f, --format | string | markdown | No | Output format (json, markdown, text) |
|
-l, --language | string | zh | No | Output language (zh, en) |
Examples
CODEBLOCK1
Output Structure
Markdown Format
CODEBLOCK2
JSON Format
CODEBLOCK3
Dependencies
- - Python 3.8+
- PyPDF2 / pdfplumber (PDF parsing)
- python-docx (Word parsing)
- Optional: openai / anthropic (for AI-enhanced extraction)
Installation
CODEBLOCK4
Notes
- 1. Input documents should be readable PDF or Word format
- Scanned PDFs require OCR processing first
- For complex table structures, manual verification may be needed
- Information extracted by this tool is for reference only and does not constitute medical advice
Risk Assessment
| Risk Indicator | Assessment | Level |
|---|
| Code Execution | Python/R scripts executed locally | Medium |
| Network Access |
No external API calls | Low |
| File System Access | Read input files, write output files | Medium |
| Instruction Tampering | Standard prompt guidelines | Low |
| Data Exposure | Output files saved to workspace | Low |
Security Checklist
- - [ ] No hardcoded credentials or API keys
- [ ] No unauthorized file system access (../)
- [ ] Output does not expose sensitive information
- [ ] Prompt injection protections in place
- [ ] Input file paths validated (no ../ traversal)
- [ ] Output directory restricted to workspace
- [ ] Script execution in sandboxed environment
- [ ] Error messages sanitized (no stack traces exposed)
- [ ] Dependencies audited
Prerequisites
CODEBLOCK5
Evaluation Criteria
Success Metrics
- - [ ] Successfully executes main functionality
- [ ] Output meets quality standards
- [ ] Handles edge cases gracefully
- [ ] Performance is acceptable
Test Cases
- 1. Basic Functionality: Standard input → Expected output
- Edge Case: Invalid input → Graceful error handling
- Performance: Large dataset → Acceptable processing time
Lifecycle Status
- - Current Stage: Draft
- Next Review Date: 2026-03-06
- Known Issues: None
- Planned Improvements:
- Performance optimization
- Additional feature support
IB摘要生成器
描述
从研究者手册(IB)中提取核心安全信息并进行摘要,帮助临床研究人员快速获取关键药物安全数据。
功能
- - 从IB文档中提取核心安全信息(CSI)
- 识别并总结:
- 已知药物不良反应(ADR)及其发生率
- 禁忌症
- 警告与注意事项
- 药物相互作用
- 特殊人群注意事项
- 过量用药处理
- 重要安全更新
使用方法
bash
python scripts/main.py <输入文件> [选项]
参数
| 参数 | 类型 | 默认值 | 必填 | 描述 |
|---|
| input_file | 字符串 | - | 是 | IB文档路径(PDF/Word/TXT) |
| -o, --output |
字符串 | 标准输出 | 否 | 输出文件路径 |
| -f, --format | 字符串 | markdown | 否 | 输出格式(json, markdown, text) |
| -l, --language | 字符串 | zh | 否 | 输出语言(zh, en) |
示例
bash
基本用法
python scripts/main.py /path/to/IB.pdf
输出为JSON文件
python scripts/main.py /path/to/IB.pdf -o summary.json -f json
英文输出
python scripts/main.py /path/to/IB.docx -l en -o summary.md
输出结构
Markdown格式
markdown
IB安全信息摘要
基本药物信息
- - 药物名称: XXX
- 版本: X.X
- 日期: YYYY-MM-DD
核心安全信息
已知不良反应
| 系统器官分类 | 不良反应 | 发生率 | 严重程度 |
|---|
| ... | ... | ... | ... |
禁忌症
警告与注意事项
药物相互作用
特殊人群
... |
| 儿童 | ... |
| 老年人 | ... |
| 肝/肾功能不全者 | ... |
过量用药
安全更新历史
JSON格式
json
{
drug_info: {
name: 药物名称,
version: 版本号,
date: 日期
},
coresafetyinfo: {
adverse_reactions: [...],
contraindications: [...],
warnings: [...],
drug_interactions: [...],
special_populations: {...},
overdose: {...},
safety_updates: [...]
}
}
依赖项
- - Python 3.8+
- PyPDF2 / pdfplumber(PDF解析)
- python-docx(Word解析)
- 可选:openai / anthropic(用于AI增强提取)
安装
bash
pip install -r requirements.txt
注意事项
- 1. 输入文档应为可读的PDF或Word格式
- 扫描版PDF需先进行OCR处理
- 对于复杂表格结构,可能需要人工验证
- 本工具提取的信息仅供参考,不构成医疗建议
风险评估
| 风险指标 | 评估 | 等级 |
|---|
| 代码执行 | 本地执行Python/R脚本 | 中 |
| 网络访问 |
无外部API调用 | 低 |
| 文件系统访问 | 读取输入文件,写入输出文件 | 中 |
| 指令篡改 | 标准提示词指南 | 低 |
| 数据泄露 | 输出文件保存至工作区 | 低 |
安全检查清单
- - [ ] 无硬编码凭据或API密钥
- [ ] 无未经授权的文件系统访问(../)
- [ ] 输出不泄露敏感信息
- [ ] 已实施提示注入防护
- [ ] 已验证输入文件路径(无../遍历)
- [ ] 输出目录限制在工作区内
- [ ] 在沙盒环境中执行脚本
- [ ] 错误信息已清理(不暴露堆栈跟踪)
- [ ] 依赖项已审计
前置条件
bash
Python依赖项
pip install -r requirements.txt
评估标准
成功指标
- - [ ] 成功执行主要功能
- [ ] 输出符合质量标准
- [ ] 优雅处理边缘情况
- [ ] 性能可接受
测试用例
- 1. 基本功能:标准输入 → 预期输出
- 边缘情况:无效输入 → 优雅的错误处理
- 性能:大数据集 → 可接受的处理时间
生命周期状态
- - 当前阶段:草案
- 下次审核日期:2026-03-06
- 已知问题:无
- 计划改进:
- 性能优化
- 增加更多功能支持