tooluniverse-pharmacovigilance
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChinesePharmacovigilance Safety Analyzer
药物警戒安全分析器
Systematic drug safety analysis using FAERS adverse event data, FDA labeling, PharmGKB pharmacogenomics, and clinical trial safety signals.
KEY PRINCIPLES:
- Report-first approach - Create report file FIRST, update progressively
- Signal quantification - Use disproportionality measures (PRR, ROR)
- Severity stratification - Prioritize serious/fatal events
- Multi-source triangulation - FAERS, labels, trials, literature
- Pharmacogenomic context - Include genetic risk factors
- Actionable output - Risk-benefit summary with recommendations
- English-first queries - Always use English drug names and search terms in tool calls, even if the user writes in another language. Only try original-language terms as a fallback. Respond in the user's language
利用FAERS不良事件数据、FDA标签、PharmGKB药物基因组学和临床试验安全信号进行系统化药物安全分析。
核心原则:
- 报告优先方法 - 首先创建报告文件,逐步更新内容
- 信号量化 - 使用不相称性指标(PRR、ROR)
- 严重程度分层 - 优先处理严重/致命事件
- 多源三角验证 - 结合FAERS、标签、试验、文献数据
- 药物基因组学背景 - 纳入遗传风险因素
- 可落地输出 - 包含建议的风险获益总结
- 英文优先查询 - 即使用户使用其他语言提问,工具调用时始终使用英文药物名称和搜索词,仅在失败时尝试原语言术语。用用户的语言回复
When to Use
使用场景
Apply when user asks:
- "What are the safety concerns for [drug]?"
- "What adverse events are associated with [drug]?"
- "Is [drug] safe? What are the risks?"
- "Should I be concerned about [specific adverse event] with [drug]?"
- "Compare safety profiles of [drug A] vs [drug B]"
- "Pharmacovigilance analysis for [drug]"
当用户提出以下问题时适用:
- "[药物名称]有哪些安全隐患?"
- "[药物名称]会引发哪些不良事件?"
- "[药物名称]安全吗?有哪些风险?"
- "使用[药物名称]时,我需要担心[特定不良事件]吗?"
- "对比[药物A]和[药物B]的安全性特征"
- "对[药物名称]进行药物警戒分析"
Critical Workflow Requirements
关键工作流要求
1. Report-First Approach (MANDATORY)
1. 报告优先方法(强制要求)
-
Create the report file FIRST:
- File name:
[DRUG]_safety_report.md - Initialize with all section headers
- Add placeholder text:
[Researching...]
- File name:
-
Progressively update as you gather data
-
Output separate data files:
- - Ranked AEs with counts/signals
[DRUG]_adverse_events.csv - - PGx variants and recommendations
[DRUG]_pharmacogenomics.csv
-
首先创建报告文件:
- 文件名:
[DRUG]_safety_report.md - 初始化所有章节标题
- 添加占位文本:
[研究中...]
- 文件名:
-
收集数据时逐步更新
-
输出独立数据文件:
- - 带计数/信号的不良事件排名表
[DRUG]_adverse_events.csv - - 药物基因组学变异体及建议
[DRUG]_pharmacogenomics.csv
2. Citation Requirements (MANDATORY)
2. 引用要求(强制要求)
Every safety signal MUST include source:
markdown
undefined每个安全信号必须包含来源:
markdown
undefinedSignal: Hepatotoxicity
信号: 肝毒性
- PRR: 3.2 (95% CI: 2.8-3.7)
- Cases: 1,247 reports
- Serious: 892 (71.5%)
- Fatal: 23
Source: FAERS via (Q1 2020 - Q4 2025)
FAERS_count_reactions_by_drug_event
---- PRR: 3.2 (95% CI: 2.8-3.7)
- 案例数: 1,247份报告
- 严重事件: 892例(71.5%)
- 致命事件: 23例
来源: FAERS via (2020年第一季度 - 2025年第四季度)
FAERS_count_reactions_by_drug_event
---Phase 0: Tool Verification
工具验证阶段
CRITICAL: Verify tool parameters before calling.
关键: 调用工具前先验证参数。
Known Parameter Corrections
已知参数修正
| Tool | WRONG Parameter | CORRECT Parameter |
|---|---|---|
| | |
| | |
| | |
| | |
| 工具 | 错误参数 | 正确参数 |
|---|---|---|
| | |
| | |
| | |
| | |
Workflow Overview
工作流概览
Phase 1: Drug Disambiguation
├── Resolve drug name (brand → generic)
├── Get identifiers (RxCUI, ChEMBL, DrugBank)
└── Identify drug class and mechanism
↓
Phase 2: Adverse Event Profiling (FAERS)
├── Query FAERS for drug-event pairs
├── Calculate disproportionality (PRR, ROR)
├── Stratify by seriousness
└── OUTPUT: Ranked AE table
↓
Phase 3: Label Warning Extraction
├── DailyMed boxed warnings
├── Contraindications
├── Warnings and precautions
└── OUTPUT: Label safety summary
↓
Phase 4: Pharmacogenomic Risk
├── PharmGKB clinical annotations
├── High-risk genotypes
├── Dosing recommendations
└── OUTPUT: PGx risk table
↓
Phase 5: Clinical Trial Safety
├── ClinicalTrials.gov safety data
├── Phase 3/4 discontinuation rates
├── Serious AEs in trials
└── OUTPUT: Trial safety summary
↓
Phase 5.5: Pathway & Mechanism Context (NEW)
├── KEGG: Drug metabolism pathways
├── Reactome: Mechanism-linked pathways
├── Target pathway analysis
└── OUTPUT: Mechanistic safety context
↓
Phase 5.6: Literature Intelligence (ENHANCED)
├── PubMed: Published safety studies
├── BioRxiv/MedRxiv: Recent preprints
├── OpenAlex: Citation analysis
└── OUTPUT: Literature evidence
↓
Phase 6: Signal Prioritization
├── Rank by PRR × severity × frequency
├── Identify actionable signals
├── Risk-benefit assessment
└── OUTPUT: Prioritized signal list
↓
Phase 7: Report Synthesis阶段1: 药物身份解析
├── 解析药物名称(品牌名→通用名)
├── 获取标识符(RxCUI、ChEMBL、DrugBank)
└── 识别药物类别和作用机制
↓
阶段2: 不良事件特征分析(FAERS)
├── 查询FAERS获取药物-事件对
├── 计算不相称性指标(PRR、ROR)
├── 按严重程度分层
└── 输出: 不良事件排名表
↓
阶段3: 标签警告提取
├── DailyMed黑框警告
├── 禁忌症
├── 警告与注意事项
└── 输出: 标签安全总结
↓
阶段4: 药物基因组学风险
├── PharmGKB临床注释
├── 高风险基因型
├── 给药建议
└── 输出: 药物基因组学风险表
↓
阶段5: 临床试验安全性
├── ClinicalTrials.gov安全数据
├── 3/4期试验停药率
├── 试验中的严重不良事件
└── 输出: 试验安全总结
↓
阶段5.5: 通路与机制背景(新增)
├── KEGG: 药物代谢通路
├── Reactome: 机制关联通路
├── 靶点通路分析
└── 输出: 机制性安全背景
↓
阶段5.6: 文献情报(增强版)
├── PubMed: 已发表的安全性研究
├── BioRxiv/MedRxiv: 最新预印本
├── OpenAlex: 引用分析
└── 输出: 文献证据
↓
阶段6: 信号优先级排序
├── 按PRR × 严重程度 × 频率排名
├── 识别可落地信号
├── 风险获益评估
└── 输出: 优先级信号列表
↓
阶段7: 报告合成Phase 1: Drug Disambiguation
阶段1: 药物身份解析
1.1 Resolve Drug Identity
1.1 确认药物身份
python
def resolve_drug(tu, drug_query):
"""Resolve drug name to standardized identifiers."""
identifiers = {}
# DailyMed for NDC and SPL
dailymed = tu.tools.DailyMed_search_spls(drug_name=drug_query)
if dailymed:
identifiers['ndc'] = dailymed[0].get('ndc')
identifiers['setid'] = dailymed[0].get('setid')
identifiers['generic_name'] = dailymed[0].get('generic_name')
# ChEMBL for molecule data
chembl = tu.tools.ChEMBL_search_drugs(query=drug_query)
if chembl:
identifiers['chembl_id'] = chembl[0].get('molecule_chembl_id')
identifiers['max_phase'] = chembl[0].get('max_phase')
return identifierspython
def resolve_drug(tu, drug_query):
"""将药物名称解析为标准化标识符。"""
identifiers = {}
# 通过DailyMed获取NDC和SPL
dailymed = tu.tools.DailyMed_search_spls(drug_name=drug_query)
if dailymed:
identifiers['ndc'] = dailymed[0].get('ndc')
identifiers['setid'] = dailymed[0].get('setid')
identifiers['generic_name'] = dailymed[0].get('generic_name')
# 通过ChEMBL获取分子数据
chembl = tu.tools.ChEMBL_search_drugs(query=drug_query)
if chembl:
identifiers['chembl_id'] = chembl[0].get('molecule_chembl_id')
identifiers['max_phase'] = chembl[0].get('max_phase')
return identifiers1.2 Output for Report
1.2 报告输出示例
markdown
undefinedmarkdown
undefined1. Drug Identification
1. 药物识别信息
| Property | Value |
|---|---|
| Generic Name | Metformin |
| Brand Names | Glucophage, Fortamet, Glumetza |
| Drug Class | Biguanide antidiabetic |
| ChEMBL ID | CHEMBL1431 |
| Mechanism | AMPK activator, hepatic gluconeogenesis inhibitor |
| First Approved | 1994 (US) |
Source: DailyMed via , ChEMBL
DailyMed_search_spls
---| 属性 | 值 |
|---|---|
| 通用名 | 二甲双胍 |
| 品牌名 | Glucophage、Fortamet、Glumetza |
| 药物类别 | 双胍类降糖药 |
| ChEMBL ID | CHEMBL1431 |
| 作用机制 | AMPK激活剂、肝糖异生抑制剂 |
| 首次获批时间 | 1994年(美国) |
来源: DailyMed via , ChEMBL
DailyMed_search_spls
---Phase 2: Adverse Event Profiling
阶段2: 不良事件特征分析
2.1 FAERS Query Strategy
2.1 FAERS查询策略
python
def get_faers_events(tu, drug_name, top_n=50):
"""Query FAERS for adverse events."""
# Get event counts
events = tu.tools.FAERS_count_reactions_by_drug_event(
drug_name=drug_name,
limit=top_n
)
# For each event, get detailed breakdown
detailed_events = []
for event in events:
detail = tu.tools.FAERS_get_event_details(
drug_name=drug_name,
reaction=event['reaction']
)
detailed_events.append({
'reaction': event['reaction'],
'count': event['count'],
'serious': detail.get('serious_count', 0),
'fatal': detail.get('death_count', 0),
'hospitalization': detail.get('hospitalization_count', 0)
})
return detailed_eventspython
def get_faers_events(tu, drug_name, top_n=50):
"""查询FAERS获取不良事件数据。"""
# 获取事件计数
events = tu.tools.FAERS_count_reactions_by_drug_event(
drug_name=drug_name,
limit=top_n
)
# 为每个事件获取详细分类
detailed_events = []
for event in events:
detail = tu.tools.FAERS_get_event_details(
drug_name=drug_name,
reaction=event['reaction']
)
detailed_events.append({
'reaction': event['reaction'],
'count': event['count'],
'serious': detail.get('serious_count', 0),
'fatal': detail.get('death_count', 0),
'hospitalization': detail.get('hospitalization_count', 0)
})
return detailed_events2.2 Disproportionality Analysis
2.2 不相称性分析
Proportional Reporting Ratio (PRR):
PRR = (A/B) / (C/D)
Where:
A = Reports of drug X with event Y
B = Reports of drug X with any event
C = Reports of event Y with any drug (excluding X)
D = Total reports (excluding drug X)Signal Thresholds:
| Measure | Signal Threshold | Strong Signal |
|---|---|---|
| PRR | >2.0 | >3.0 |
| Chi-squared | >4.0 | >10.0 |
| N (case count) | ≥3 | ≥10 |
比例报告比(PRR):
PRR = (A/B) / (C/D)
其中:
A = 药物X发生事件Y的报告数
B = 药物X发生任何事件的报告数
C = 除X外其他药物发生事件Y的报告数
D = 除X外的总报告数信号阈值:
| 指标 | 信号阈值 | 强信号 |
|---|---|---|
| PRR | >2.0 | >3.0 |
| 卡方值 | >4.0 | >10.0 |
| 案例数N | ≥3 | ≥10 |
2.3 Severity Classification
2.3 严重程度分类
| Category | Definition | Priority |
|---|---|---|
| Fatal | Death outcome | Highest |
| Life-threatening | Immediate death risk | Very High |
| Hospitalization | Required/prolonged hospitalization | High |
| Disability | Persistent impairment | High |
| Congenital anomaly | Birth defect | High |
| Other serious | Medical intervention required | Medium |
| Non-serious | No serious criteria | Low |
| 类别 | 定义 | 优先级 |
|---|---|---|
| 致命 | 死亡结局 | 最高 |
| 危及生命 | 存在即时死亡风险 | 极高 |
| 住院 | 需要/延长住院时间 | 高 |
| 残疾 | 持续性功能障碍 | 高 |
| 先天异常 | 出生缺陷 | 高 |
| 其他严重事件 | 需要医学干预 | 中 |
| 非严重事件 | 不满足严重事件标准 | 低 |
2.4 Output for Report
2.4 报告输出示例
markdown
undefinedmarkdown
undefined2. Adverse Event Profile (FAERS)
2. 不良事件特征(FAERS)
Data Period: Q1 2020 - Q4 2025
Total Reports for Drug: 45,234
数据周期: 2020年第一季度 - 2025年第四季度
药物总报告数: 45,234
2.1 Top Adverse Events by Frequency
2.1 按频率排序的Top不良事件
| Rank | Adverse Event | Reports | PRR | 95% CI | Serious (%) | Fatal |
|---|---|---|---|---|---|---|
| 1 | Diarrhea | 8,234 | 2.3 | 2.1-2.5 | 12% | 3 |
| 2 | Nausea | 6,892 | 1.8 | 1.6-2.0 | 8% | 0 |
| 3 | Lactic acidosis | 1,247 | 15.2 | 12.8-17.9 | 89% ⚠️ | 156 ⚠️ |
| 4 | Hypoglycemia | 2,341 | 2.1 | 1.9-2.4 | 34% | 8 |
| 5 | Vitamin B12 deficiency | 892 | 8.4 | 7.2-9.8 | 23% | 0 |
| 排名 | 不良事件 | 报告数 | PRR | 95%置信区间 | 严重事件占比 | 致命事件数 |
|---|---|---|---|---|---|---|
| 1 | 腹泻 | 8,234 | 2.3 | 2.1-2.5 | 12% | 3 |
| 2 | 恶心 | 6,892 | 1.8 | 1.6-2.0 | 8% | 0 |
| 3 | 乳酸性酸中毒 | 1,247 | 15.2 | 12.8-17.9 | 89% ⚠️ | 156 ⚠️ |
| 4 | 低血糖 | 2,341 | 2.1 | 1.9-2.4 | 34% | 8 |
| 5 | 维生素B12缺乏 | 892 | 8.4 | 7.2-9.8 | 23% | 0 |
2.2 Serious Adverse Events Only
2.2 仅严重不良事件
| Adverse Event | Serious Reports | Fatal | PRR | Signal |
|---|---|---|---|---|
| Lactic acidosis | 1,110 | 156 | 15.2 | STRONG ⚠️ |
| Acute kidney injury | 678 | 34 | 4.2 | Moderate |
| Hepatotoxicity | 234 | 12 | 3.1 | Moderate |
| 不良事件 | 严重事件报告数 | 致命事件数 | PRR | 信号强度 |
|---|---|---|---|---|
| 乳酸性酸中毒 | 1,110 | 156 | 15.2 | 强信号 ⚠️ |
| 急性肾损伤 | 678 | 34 | 4.2 | 中等 |
| 肝毒性 | 234 | 12 | 3.1 | 中等 |
2.3 Signal Interpretation
2.3 信号解读
Strong Signal: Lactic Acidosis ⚠️
- PRR of 15.2 indicates 15x higher reporting rate than expected
- 89% classified as serious
- 156 fatalities (12.5% case fatality)
- Known class effect of biguanides
- Risk factors: renal impairment, hypoxia, contrast agents
Source: FAERS via
FAERS_count_reactions_by_drug_event
---强信号: 乳酸性酸中毒 ⚠️
- PRR为15.2,意味着报告率比预期高15倍
- 89%被归类为严重事件
- 156例死亡(病例死亡率12.5%)
- 双胍类药物的已知类别效应
- 风险因素: 肾功能损害、缺氧、造影剂
来源: FAERS via
FAERS_count_reactions_by_drug_event
---Phase 3: Label Warning Extraction
阶段3: 标签警告提取
3.1 DailyMed Query
3.1 DailyMed查询
python
def extract_label_warnings(tu, setid):
"""Extract safety sections from FDA label."""
label = tu.tools.DailyMed_get_spl_by_set_id(setid=setid)
warnings = {
'boxed_warning': label.get('boxed_warning'),
'contraindications': label.get('contraindications'),
'warnings_precautions': label.get('warnings_and_precautions'),
'adverse_reactions': label.get('adverse_reactions'),
'drug_interactions': label.get('drug_interactions')
}
return warningspython
def extract_label_warnings(tu, setid):
"""从FDA标签中提取安全相关章节。"""
label = tu.tools.DailyMed_get_spl_by_set_id(setid=setid)
warnings = {
'boxed_warning': label.get('boxed_warning'),
'contraindications': label.get('contraindications'),
'warnings_precautions': label.get('warnings_and_precautions'),
'adverse_reactions': label.get('adverse_reactions'),
'drug_interactions': label.get('drug_interactions')
}
return warnings3.2 Warning Severity Categories
3.2 警告严重程度类别
| Category | Symbol | Description |
|---|---|---|
| Boxed Warning | ⬛ | Most serious, life-threatening |
| Contraindication | 🔴 | Must not use |
| Warning | 🟠 | Significant risk |
| Precaution | 🟡 | Use caution |
| 类别 | 符号 | 描述 |
|---|---|---|
| 黑框警告 | ⬛ | 最严重、危及生命 |
| 禁忌症 | 🔴 | 绝对禁止使用 |
| 警告 | 🟠 | 显著风险 |
| 注意事项 | 🟡 | 需谨慎使用 |
3.3 Output for Report
3.3 报告输出示例
markdown
undefinedmarkdown
undefined3. FDA Label Safety Information
3. FDA标签安全信息
3.1 Boxed Warning ⬛
3.1 黑框警告 ⬛
LACTIC ACIDOSIS
Metformin can cause lactic acidosis, a rare but serious complication. Risk increases with renal impairment, sepsis, dehydration, excessive alcohol intake, hepatic impairment, and acute heart failure.Contraindicated in patients with eGFR <30 mL/min/1.73m²
乳酸性酸中毒
二甲双胍可能引发乳酸性酸中毒,这是一种罕见但严重的并发症。 肾功能损害、败血症、脱水、过量饮酒、肝功能损害和急性心力衰竭会增加风险。eGFR <30 mL/min/1.73m²的患者禁用
3.2 Contraindications 🔴
3.2 禁忌症 🔴
| Contraindication | Rationale |
|---|---|
| eGFR <30 mL/min/1.73m² | Lactic acidosis risk |
| Acute/chronic metabolic acidosis | May worsen acidosis |
| Hypersensitivity to metformin | Allergic reaction |
| 禁忌症 | 理由 |
|---|---|
| eGFR <30 mL/min/1.73m² | 乳酸性酸中毒风险 |
| 急性/慢性代谢性酸中毒 | 可能加重酸中毒 |
| 对二甲双胍过敏 | 过敏反应 |
3.3 Warnings and Precautions 🟠
3.3 警告与注意事项 🟠
| Warning | Clinical Action |
|---|---|
| Vitamin B12 deficiency | Monitor B12 levels annually |
| Hypoglycemia with insulin | Reduce insulin dose |
| Radiologic contrast | Hold 48h around procedure |
| Surgical procedures | Hold day of surgery |
Source: DailyMed via
DailyMed_get_spl_by_set_id
---| 警告 | 临床措施 |
|---|---|
| 维生素B12缺乏 | 每年监测B12水平 |
| 与胰岛素联用引发低血糖 | 减少胰岛素剂量 |
| 放射造影剂 | 检查前后48小时停药 |
| 手术 | 手术当日停药 |
来源: DailyMed via
DailyMed_get_spl_by_set_id
---Phase 4: Pharmacogenomic Risk
阶段4: 药物基因组学风险
4.1 PharmGKB Query
4.1 PharmGKB查询
python
def get_pharmacogenomics(tu, drug_name):
"""Get pharmacogenomic annotations."""
# Search PharmGKB
pgx = tu.tools.PharmGKB_search_drug(query=drug_name)
annotations = []
for result in pgx:
if result.get('clinical_annotation'):
annotations.append({
'gene': result['gene'],
'variant': result['variant'],
'phenotype': result['phenotype'],
'recommendation': result['recommendation'],
'level': result['level_of_evidence']
})
return annotationspython
def get_pharmacogenomics(tu, drug_name):
"""获取药物基因组学注释信息。"""
# 查询PharmGKB
pgx = tu.tools.PharmGKB_search_drug(query=drug_name)
annotations = []
for result in pgx:
if result.get('clinical_annotation'):
annotations.append({
'gene': result['gene'],
'variant': result['variant'],
'phenotype': result['phenotype'],
'recommendation': result['recommendation'],
'level': result['level_of_evidence']
})
return annotations4.2 PGx Evidence Levels
4.2 药物基因组学证据等级
| Level | Description | Clinical Action |
|---|---|---|
| 1A | CPIC/DPWG guideline, implementable | Follow guideline |
| 1B | CPIC/DPWG guideline, annotation | Consider testing |
| 2A | VIP annotation, moderate evidence | May inform |
| 2B | VIP annotation, weaker evidence | Research |
| 3 | Low-level annotation | Not actionable |
| 等级 | 描述 | 临床措施 |
|---|---|---|
| 1A | CPIC/DPWG指南,可直接落地 | 遵循指南 |
| 1B | CPIC/DPWG指南,注释类 | 考虑检测 |
| 2A | VIP注释,中等证据 | 可参考 |
| 2B | VIP注释,较弱证据 | 研究用途 |
| 3 | 低水平注释 | 无落地价值 |
4.3 Output for Report
4.3 报告输出示例
markdown
undefinedmarkdown
undefined4. Pharmacogenomic Risk Factors
4. 药物基因组学风险因素
4.1 Clinically Actionable Variants
4.1 临床可落地变异体
| Gene | Variant | Phenotype | Recommendation | Level |
|---|---|---|---|---|
| SLC22A1 | rs628031 | Reduced OCT1 | Reduced metformin response | 2A |
| SLC22A1 | rs36056065 | Loss of function | Consider alternative | 2A |
| ATM | rs11212617 | Increased response | Standard dosing | 3 |
| 基因 | 变异体 | 表型 | 建议 | 证据等级 |
|---|---|---|---|---|
| SLC22A1 | rs628031 | OCT1功能降低 | 二甲双胍反应性降低 | 2A |
| SLC22A1 | rs36056065 | 功能丧失 | 考虑替代药物 | 2A |
| ATM | rs11212617 | 反应性增强 | 标准剂量 | 3 |
4.2 Clinical Implications
4.2 临床意义
OCT1 (SLC22A1) Poor Metabolizers:
- ~9% of Caucasians carry two loss-of-function alleles
- Reduced hepatic uptake of metformin
- May have decreased efficacy
- Consider higher doses or alternative agent
No CPIC/DPWG guidelines currently exist for metformin
Source: PharmGKB via
PharmGKB_search_drug
---OCT1 (SLC22A1) 弱代谢者:
- 约9%的白种人携带两个功能丧失等位基因
- 二甲双胍肝脏摄取减少
- 疗效可能降低
- 考虑增加剂量或更换药物
目前尚无针对二甲双胍的CPIC/DPWG指南
来源: PharmGKB via
PharmGKB_search_drug
---Phase 5: Clinical Trial Safety
阶段5: 临床试验安全性
5.1 ClinicalTrials.gov Query
5.1 ClinicalTrials.gov查询
python
def get_trial_safety(tu, drug_name):
"""Get safety data from clinical trials."""
# Search completed phase 3/4 trials
trials = tu.tools.search_clinical_trials(
intervention=drug_name,
phase="Phase 3",
status="Completed",
pageSize=20
)
safety_data = []
for trial in trials:
if trial.get('results_posted'):
results = tu.tools.get_clinical_trial_results(
nct_id=trial['nct_id']
)
safety_data.append(results.get('adverse_events'))
return safety_datapython
def get_trial_safety(tu, drug_name):
"""从临床试验中获取安全数据。"""
# 搜索已完成的3/4期试验
trials = tu.tools.search_clinical_trials(
intervention=drug_name,
phase="Phase 3",
status="Completed",
pageSize=20
)
safety_data = []
for trial in trials:
if trial.get('results_posted'):
results = tu.tools.get_clinical_trial_results(
nct_id=trial['nct_id']
)
safety_data.append(results.get('adverse_events'))
return safety_data5.2 Output for Report
5.2 报告输出示例
markdown
undefinedmarkdown
undefined5. Clinical Trial Safety Data
5. 临床试验安全数据
5.1 Phase 3 Trial Summary
5.1 3期试验总结
| Trial | N | Duration | Serious AEs (Drug) | Serious AEs (Placebo) | Deaths |
|---|---|---|---|---|---|
| UKPDS | 1,704 | 10 yr | 12.3% | 14.1% | 8.2% vs 9.1% |
| DPP | 1,073 | 3 yr | 4.2% | 3.8% | 0.1% |
| SPREAD | 884 | 2 yr | 5.1% | 4.9% | 0.2% |
| 试验 | 样本量 | 持续时间 | 试验组严重不良事件率 | 安慰剂组严重不良事件率 | 死亡率 |
|---|---|---|---|---|---|
| UKPDS | 1,704 | 10年 | 12.3% | 14.1% | 8.2% vs 9.1% |
| DPP | 1,073 | 3年 | 4.2% | 3.8% | 0.1% |
| SPREAD | 884 | 2年 | 5.1% | 4.9% | 0.2% |
5.2 Common Adverse Events in Trials
5.2 试验中常见不良事件
| Adverse Event | Drug (%) | Placebo (%) | Difference |
|---|---|---|---|
| Diarrhea | 53% | 12% | +41% ⚠️ |
| Nausea | 26% | 8% | +18% |
| Flatulence | 12% | 6% | +6% |
| Asthenia | 9% | 6% | +3% |
Source: ClinicalTrials.gov via
search_clinical_trials
---| 不良事件 | 试验组发生率 | 安慰剂组发生率 | 差异 |
|---|---|---|---|
| 腹泻 | 53% | 12% | +41% ⚠️ |
| 恶心 | 26% | 8% | +18% |
| 胃肠胀气 | 12% | 6% | +6% |
| 乏力 | 9% | 6% | +3% |
来源: ClinicalTrials.gov via
search_clinical_trials
---Phase 5.5: Pathway & Mechanism Context (NEW)
阶段5.5: 通路与机制背景(新增)
5.5.1 Drug Metabolism Pathways (KEGG)
5.5.1 药物代谢通路(KEGG)
python
def get_drug_pathway_context(tu, drug_name, drug_targets):
"""Get pathway context for mechanistic safety understanding."""
# KEGG drug metabolism
metabolism = tu.tools.kegg_search_pathway(
query=f"{drug_name} metabolism"
)
# Target pathways
target_pathways = {}
for target in drug_targets:
pathways = tu.tools.kegg_get_gene_info(gene_id=f"hsa:{target}")
target_pathways[target] = pathways.get('pathways', [])
return {
'metabolism_pathways': metabolism,
'target_pathways': target_pathways
}python
def get_drug_pathway_context(tu, drug_name, drug_targets):
"""获取机制性安全理解的通路背景。"""
# KEGG: 药物代谢
metabolism = tu.tools.kegg_search_pathway(
query=f"{drug_name} metabolism"
)
# 靶点通路
target_pathways = {}
for target in drug_targets:
pathways = tu.tools.kegg_get_gene_info(gene_id=f"hsa:{target}")
target_pathways[target] = pathways.get('pathways', [])
return {
'metabolism_pathways': metabolism,
'target_pathways': target_pathways
}5.5.2 Output for Report
5.5.2 报告输出示例
markdown
undefinedmarkdown
undefined5.5 Pathway & Mechanism Context
5.5 通路与机制背景
Drug Metabolism Pathways (KEGG)
药物代谢通路(KEGG)
| Pathway | Relevance | Safety Implication |
|---|---|---|
| Drug metabolism - cytochrome P450 | Primary metabolism | CYP2C9 interactions |
| Gluconeogenesis inhibition | MOA | Lactic acidosis mechanism |
| Mitochondrial complex I | Off-target | Lactic acid accumulation |
| 通路 | 相关性 | 安全意义 |
|---|---|---|
| 药物代谢-细胞色素P450 | 主要代谢途径 | CYP2C9相互作用 |
| 糖异生抑制 | 作用机制 | 乳酸性酸中毒机制 |
| 线粒体复合物I | 脱靶效应 | 乳酸堆积 |
Target Pathway Analysis
靶点通路分析
Primary Target: AMPK
- Pathway: AMPK signaling (hsa04152)
- Downstream: mTOR inhibition, autophagy
- Safety relevance: Explains metabolic effects
Mechanistic Basis for Key AEs:
| Adverse Event | Pathway Mechanism |
|---|---|
| Lactic acidosis | Mitochondrial complex I inhibition |
| GI intolerance | Serotonin release in gut |
| B12 deficiency | Intrinsic factor interference |
Source: KEGG, Reactome
---主要靶点: AMPK
- 通路: AMPK信号通路(hsa04152)
- 下游: mTOR抑制、自噬
- 安全相关性: 解释代谢效应
关键不良事件的机制基础:
| 不良事件 | 通路机制 |
|---|---|
| 乳酸性酸中毒 | 线粒体复合物I抑制 |
| 胃肠道不耐受 | 肠道5-羟色胺释放 |
| B12缺乏 | 内因子干扰 |
来源: KEGG, Reactome
---Phase 5.6: Literature Intelligence (ENHANCED)
阶段5.6: 文献情报(增强版)
5.6.1 Published Safety Studies
5.6.1 已发表的安全性研究
python
def comprehensive_safety_literature(tu, drug_name, key_aes):
"""Search all literature sources for safety evidence."""
# PubMed: Peer-reviewed
pubmed = tu.tools.PubMed_search_articles(
query=f'"{drug_name}" AND (safety OR adverse OR toxicity)',
limit=30
)
# BioRxiv: Preprints
biorxiv = tu.tools.BioRxiv_search_preprints(
query=f"{drug_name} mechanism toxicity",
limit=10
)
# MedRxiv: Clinical preprints
medrxiv = tu.tools.MedRxiv_search_preprints(
query=f"{drug_name} safety",
limit=10
)
# Citation analysis for key papers
key_papers = pubmed[:10]
for paper in key_papers:
citation = tu.tools.openalex_search_works(
query=paper['title'],
limit=1
)
paper['citations'] = citation[0].get('cited_by_count', 0) if citation else 0
return {
'pubmed': pubmed,
'preprints': biorxiv + medrxiv,
'key_papers': key_papers
}python
def comprehensive_safety_literature(tu, drug_name, key_aes):
"""搜索所有文献来源获取安全证据。"""
# PubMed: 同行评审文献
pubmed = tu.tools.PubMed_search_articles(
query=f'"{drug_name}" AND (safety OR adverse OR toxicity)',
limit=30
)
# BioRxiv: 预印本
biorxiv = tu.tools.BioRxiv_search_preprints(
query=f"{drug_name} mechanism toxicity",
limit=10
)
# MedRxiv: 临床预印本
medrxiv = tu.tools.MedRxiv_search_preprints(
query=f"{drug_name} safety",
limit=10
)
# 关键论文的引用分析
key_papers = pubmed[:10]
for paper in key_papers:
citation = tu.tools.openalex_search_works(
query=paper['title'],
limit=1
)
paper['citations'] = citation[0].get('cited_by_count', 0) if citation else 0
return {
'pubmed': pubmed,
'preprints': biorxiv + medrxiv,
'key_papers': key_papers
}5.6.2 Output for Report
5.6.2 报告输出示例
markdown
undefinedmarkdown
undefined5.6 Literature Evidence
5.6 文献证据
Key Safety Studies
关键安全性研究
| PMID | Title | Year | Citations | Finding |
|---|---|---|---|---|
| 29234567 | Metformin and lactic acidosis: meta-analysis | 2020 | 245 | Risk 4.3/100,000 |
| 28765432 | Long-term cardiovascular outcomes... | 2019 | 567 | CV benefit confirmed |
| 30123456 | B12 deficiency prevalence study | 2021 | 123 | 30% after 4 years |
| PMID | 标题 | 年份 | 引用数 | 发现 |
|---|---|---|---|---|
| 29234567 | 二甲双胍与乳酸性酸中毒: 荟萃分析 | 2020 | 245 | 风险4.3/100,000 |
| 28765432 | 长期心血管结局... | 2019 | 567 | 心血管获益得到确认 |
| 30123456 | B12缺乏患病率研究 | 2021 | 123 | 4年后患病率30% |
Recent Preprints (Not Peer-Reviewed)
最新预印本(未经过同行评审)
| Source | Title | Posted | Relevance |
|---|---|---|---|
| MedRxiv | Novel metformin safety signal in elderly | 2024-01 | Age-related risk |
| BioRxiv | Gut microbiome and metformin GI effects | 2024-02 | Mechanistic |
⚠️ Note: Preprints have NOT undergone peer review.
| 来源 | 标题 | 发布日期 | 相关性 |
|---|---|---|---|
| MedRxiv | 老年人群中二甲双胍的新安全信号 | 2024-01 | 年龄相关风险 |
| BioRxiv | 肠道微生物组与二甲双胍胃肠道效应 | 2024-02 | 机制性研究 |
⚠️ 注意: 预印本未经过同行评审。
Evidence Summary
证据总结
| Evidence Type | Count | High-Impact |
|---|---|---|
| Systematic reviews | 12 | 5 |
| RCTs with safety data | 28 | 8 |
| Mechanistic studies | 15 | 3 |
| Case reports | 45 | - |
Source: PubMed, BioRxiv, MedRxiv, OpenAlex
---| 证据类型 | 数量 | 高影响力 |
|---|---|---|
| 系统综述 | 12 | 5 |
| 含安全数据的随机对照试验 | 28 | 8 |
| 机制性研究 | 15 | 3 |
| 病例报告 | 45 | - |
来源: PubMed, BioRxiv, MedRxiv, OpenAlex
---Phase 6: Signal Prioritization
阶段6: 信号优先级排序
6.1 Signal Scoring Formula
6.1 信号评分公式
Signal Score = PRR × Severity_Weight × log10(Case_Count + 1)
Severity Weights:
- Fatal: 10
- Life-threatening: 8
- Hospitalization: 5
- Disability: 5
- Other serious: 3
- Non-serious: 1信号评分 = PRR × 严重程度权重 × log10(案例数 + 1)
严重程度权重:
- 致命: 10
- 危及生命: 8
- 住院: 5
- 残疾: 5
- 其他严重事件: 3
- 非严重事件: 16.2 Output for Report
6.2 报告输出示例
markdown
undefinedmarkdown
undefined6. Prioritized Safety Signals
6. 优先级安全信号
6.1 Critical Signals (Immediate Attention)
6.1 关键信号(需立即关注)
| Signal | PRR | Fatal | Score | Action |
|---|---|---|---|---|
| Lactic acidosis | 15.2 | 156 | 482 | Boxed warning exists |
| Acute kidney injury | 4.2 | 34 | 89 | Monitor renal function |
| 信号 | PRR | 致命事件数 | 评分 | 措施 |
|---|---|---|---|---|
| 乳酸性酸中毒 | 15.2 | 156 | 482 | 已有黑框警告 |
| 急性肾损伤 | 4.2 | 34 | 89 | 监测肾功能 |
6.2 Moderate Signals (Monitor)
6.2 中等信号(需监测)
| Signal | PRR | Serious | Score | Action |
|---|---|---|---|---|
| Hepatotoxicity | 3.1 | 234 | 52 | Check LFTs if symptoms |
| Pancreatitis | 2.8 | 178 | 41 | Monitor lipase |
| 信号 | PRR | 严重事件数 | 评分 | 措施 |
|---|---|---|---|---|
| 肝毒性 | 3.1 | 234 | 52 | 出现症状时检查肝功能 |
| 胰腺炎 | 2.8 | 178 | 41 | 监测脂肪酶 |
6.3 Known/Expected (Manage Clinically)
6.3 已知/预期事件(临床管理)
| Signal | PRR | Frequency | Management |
|---|---|---|---|
| Diarrhea | 2.3 | 18% | Start low, titrate slow |
| Nausea | 1.8 | 12% | Take with food |
| B12 deficiency | 8.4 | 2% | Annual monitoring |
---| 信号 | PRR | 发生率 | 管理措施 |
|---|---|---|---|
| 腹泻 | 2.3 | 18% | 小剂量起始,缓慢加量 |
| 恶心 | 1.8 | 12% | 随餐服用 |
| B12缺乏 | 8.4 | 2% | 每年监测 |
---Report Template
报告模板
File:
[DRUG]_safety_report.mdmarkdown
undefined文件:
[DRUG]_safety_report.mdmarkdown
undefinedPharmacovigilance Safety Report: [DRUG]
药物警戒安全报告: [药物名称]
Generated: [Date] | Query: [Original query] | Status: In Progress
生成日期: [日期] | 查询内容: [原始查询] | 状态: 进行中
Executive Summary
执行摘要
[Researching...]
[研究中...]
1. Drug Identification
1. 药物识别信息
1.1 Drug Information
1.1 药物基本信息
[Researching...]
[研究中...]
2. Adverse Event Profile (FAERS)
2. 不良事件特征(FAERS)
2.1 Top Adverse Events
2.1 Top不良事件
[Researching...]
[研究中...]
2.2 Serious Adverse Events
2.2 严重不良事件
[Researching...]
[研究中...]
2.3 Signal Analysis
2.3 信号分析
[Researching...]
[研究中...]
3. FDA Label Safety Information
3. FDA标签安全信息
3.1 Boxed Warnings
3.1 黑框警告
[Researching...]
[研究中...]
3.2 Contraindications
3.2 禁忌症
[Researching...]
[研究中...]
3.3 Warnings and Precautions
3.3 警告与注意事项
[Researching...]
[研究中...]
4. Pharmacogenomic Risk Factors
4. 药物基因组学风险因素
4.1 Actionable Variants
4.1 可落地变异体
[Researching...]
[研究中...]
4.2 Testing Recommendations
4.2 检测建议
[Researching...]
[研究中...]
5. Clinical Trial Safety
5. 临床试验安全性
5.1 Trial Summary
5.1 试验总结
[Researching...]
[研究中...]
5.2 Adverse Events in Trials
5.2 试验中的不良事件
[Researching...]
[研究中...]
6. Prioritized Safety Signals
6. 优先级安全信号
6.1 Critical Signals
6.1 关键信号
[Researching...]
[研究中...]
6.2 Moderate Signals
6.2 中等信号
[Researching...]
[研究中...]
7. Risk-Benefit Assessment
7. 风险获益评估
[Researching...]
[研究中...]
8. Clinical Recommendations
8. 临床建议
8.1 Monitoring Recommendations
8.1 监测建议
[Researching...]
[研究中...]
8.2 Patient Counseling Points
8.2 患者宣教要点
[Researching...]
[研究中...]
8.3 Contraindication Checklist
8.3 禁忌症清单
[Researching...]
[研究中...]
9. Data Gaps & Limitations
9. 数据缺口与局限性
[Researching...]
[研究中...]
10. Data Sources
10. 数据来源
[Will be populated as research progresses...]
---[将随研究进展逐步填充...]
---Evidence Grading
证据分级
| Tier | Symbol | Criteria | Example |
|---|---|---|---|
| T1 | ⚠️⚠️⚠️ | PRR >10, fatal outcomes, boxed warning | Lactic acidosis |
| T2 | ⚠️⚠️ | PRR 3-10, serious outcomes | Hepatotoxicity |
| T3 | ⚠️ | PRR 2-3, moderate concern | Hypoglycemia |
| T4 | ℹ️ | PRR <2, known/expected | GI side effects |
| 层级 | 符号 | 标准 | 示例 |
|---|---|---|---|
| T1 | ⚠️⚠️⚠️ | PRR>10、致命结局、黑框警告 | 乳酸性酸中毒 |
| T2 | ⚠️⚠️ | PRR 3-10、严重结局 | 肝毒性 |
| T3 | ⚠️ | PRR 2-3、中等关注 | 低血糖 |
| T4 | ℹ️ | PRR<2、已知/预期事件 | 胃肠道副作用 |
Completeness Checklist
完整性检查清单
Phase 1: Drug Identification
阶段1: 药物识别
- Generic name resolved
- Brand names listed
- Drug class identified
- ChEMBL/DrugBank ID obtained
- Mechanism of action stated
- 通用名已解析
- 品牌名已列出
- 药物类别已识别
- 已获取ChEMBL/DrugBank ID
- 已说明作用机制
Phase 2: FAERS Analysis
阶段2: FAERS分析
- ≥20 adverse events queried
- PRR calculated for top events
- Serious/fatal counts included
- Signal thresholds applied
- Time period stated
- 已查询≥20种不良事件
- 已为Top事件计算PRR
- 已包含严重/致命事件计数
- 已应用信号阈值
- 已说明时间周期
Phase 3: Label Warnings
阶段3: 标签警告
- Boxed warnings extracted (or "None")
- Contraindications listed
- Key warnings summarized
- Drug interactions noted
- 已提取黑框警告(或标注"无")
- 已列出禁忌症
- 已总结关键警告
- 已记录药物相互作用
Phase 4: Pharmacogenomics
阶段4: 药物基因组学
- PharmGKB queried
- Actionable variants listed (or "None")
- Evidence levels provided
- Testing recommendations stated
- 已查询PharmGKB
- 已列出可落地变异体(或标注"无")
- 已提供证据等级
- 已说明检测建议
Phase 5: Clinical Trials
阶段5: 临床试验
- Phase 3/4 trials searched
- Serious AE rates compared
- Discontinuation rates noted
- 已搜索3/4期试验
- 已对比严重不良事件发生率
- 已记录停药率
Phase 6: Signal Prioritization
阶段6: 信号优先级排序
- Signals ranked by score
- Critical signals flagged
- Actions recommended
- 已按评分对信号排名
- 已标记关键信号
- 已给出建议措施
Phase 7-8: Synthesis
阶段7-8: 合成
- Risk-benefit assessment provided
- Monitoring recommendations listed
- Patient counseling points included
- 已提供风险获益评估
- 已列出监测建议
- 已包含患者宣教要点
Fallback Chains
备选工具链
| Primary Tool | Fallback 1 | Fallback 2 |
|---|---|---|
| | Literature search |
| | DailyMed website |
| | Literature search |
| | PubMed for trial results |
| 主工具 | 备选工具1 | 备选工具2 |
|---|---|---|
| | 文献搜索 |
| | DailyMed官网 |
| | 文献搜索 |
| | PubMed试验结果搜索 |
Tool Reference
工具参考
See TOOLS_REFERENCE.md for complete tool documentation.
完整工具文档请参考 TOOLS_REFERENCE.md。