← 返回 Skills 市场
aipoch-ai

Adverse Event Narrative

作者 AIpoch · GitHub ↗ · v0.1.0 · MIT-0
cross-platform ⚠ suspicious
238
总下载
0
收藏
0
当前安装
1
版本数
在 OpenClaw 中安装
/install adverse-event-narrative
功能描述
Generate CIOMS-compliant adverse event narratives for Individual Case Safety Reports (ICSR). Creates structured pharmacovigilance documents following CIOMS I...
使用说明 (SKILL.md)

Adverse Event Narrative Generator

Overview

Regulatory-grade narrative generation tool that transforms adverse event case data into CIOMS-compliant ICSR narratives suitable for submission to FDA, EMA, and other health authorities.

Key Capabilities:

  • CIOMS I Compliance: Standardized narrative structure per international guidelines
  • ICH E2B Integration: Electronic submission format compatibility
  • Temporal Analysis: Timeline reconstruction and causality assessment
  • Medical Accuracy: Clinical terminology and MedDRA coding
  • Multi-Case Processing: Batch narrative generation for periodic reporting
  • Quality Validation: Automated checks for completeness and consistency

When to Use

✅ Use this skill when:

  • Drafting ICSR narratives for regulatory submissions
  • Converting safety case data to standardized text
  • Preparing adverse event reports for health authorities
  • Generating case summaries for signal detection
  • Creating pharmacovigilance documentation for clinical trials
  • Standardizing narrative format across safety teams
  • Training new drug safety associates on narrative writing

❌ Do NOT use when:

  • Case requires medical judgment or causality assessment → Use qualified safety physician
  • Narrative for litigation or legal proceedings → Use legal documentation standards
  • Patient-facing communications → Use lay-summary-gen
  • Aggregate safety summaries → Use safety-summary-reports
  • Coding MedDRA terms from verbatim → Use meddra-coder

Integration:

  • Upstream: meddra-coder (MedDRA term coding), clinical-data-cleaner (data preparation)
  • Downstream: safety-summary-reports (aggregate analysis), regulatory-submission-prep (FDA/EMA filing)

Core Capabilities

1. CIOMS I Narrative Structure

Generate standardized sections per CIOMS guidelines:

from scripts.narrative_generator import NarrativeGenerator

generator = NarrativeGenerator()

# Generate complete narrative
narrative = generator.generate(
    case_data=case_json,
    format="cioms_i",  # or "ich_e2b", "fda_medwatch"
    include_meddra=True
)

narrative.save("ICSR_2024_001_narrative.txt")

Standard Sections:

  1. Patient Demographics - Age, sex, weight, relevant characteristics
  2. Medical History - Significant pre-existing conditions
  3. Concomitant Medications - Other drugs at time of event
  4. Suspect Drug(s) - Medication(s) in question with dosing
  5. Adverse Event - Detailed reaction description with MedDRA terms
  6. Diagnostic Results - Lab values, imaging, procedures
  7. Treatment - Medical management of the event
  8. Dechallenge/Rechallenge - Effect of drug withdrawal/reintroduction
  9. Outcome - Final patient status and sequelae
  10. Causality Assessment - Reporter's relationship evaluation

2. Temporal Relationship Analysis

Reconstruct timeline and assess temporal plausibility:

# Analyze temporal relationships
timeline = generator.analyze_timeline(
    drug_start="2024-01-15",
    drug_stop="2024-02-01",
    ae_onset="2024-01-28",
    dechallenge_date="2024-02-01",
    rechallenge_date=None
)

# Output shows temporal assessment
# "AE onset 13 days after drug initiation, positive dechallenge within 24h"

Assessments Generated:

  • Time to onset (latency period)
  • Dechallenge response (positive/negative/unknown)
  • Rechallenge response (if applicable)
  • Temporal plausibility (consistent with known drug profile)

3. Causality Evaluation Support

Structure causality assessment per WHO-UMC criteria:

# Generate causality section
causality = generator.assess_causality(
    case_data=case,
    criteria="who_umc",  # or "naranjo", "cochrane"
    include_rationale=True
)

# Output structured assessment with points for each criterion

WHO-UMC Categories:

  • Certain - Event reproduced on rechallenge
  • Probable/Likely - Reasonable time, positive dechallenge, alternative causes unlikely
  • Possible - Compatible time, but alternative causes possible
  • Unlikely - Incompatible time or alternative cause probable
  • Conditional/Unclassified - Insufficient information
  • Unassessable/Unclassifiable - Data contradictory or incomplete

4. Multi-Format Output

Generate narratives for different regulatory contexts:

# FDA MedWatch Form 3500A
fda_narrative = generator.generate(
    case_data=case,
    format="fda_medwatch",
    max_length=2000  # Character limit
)

# EMA E2B(R3) electronic format
ema_narrative = generator.generate(
    case_data=case,
    format="ich_e2b",
    version="R3"
)

# CIOMS I paper format
cioms_narrative = generator.generate(
    case_data=case,
    format="cioms_i"
)

Common Patterns

Pattern 1: Serious Adverse Event (Hospitalization)

Scenario: Patient hospitalized for severe drug reaction.

{
  "case_id": "2024-SAE-001",
  "patient_age": "58 years",
  "patient_sex": "Female",
  "suspect_drugs": [{
    "drug_name": "Metformin",
    "dose": "1000 mg BID",
    "dates": "2024-01-15 to 2024-02-01"
  }],
  "adverse_events": [{
    "meddra_pt": "Lactic acidosis",
    "seriousness": "Hospitalization",
    "onset": "2024-01-28"
  }],
  "outcome": "Recovered with sequelae"
}

Narrative Emphasis:

  • Hospitalization details (admission/discharge dates)
  • Severity markers (ICU stay, intubation)
  • Lactate levels and trend
  • Renal function status
  • Complete recovery timeline

Pattern 2: Fatal Outcome Case

Scenario: Death suspected to be drug-related.

# Fatal case handling
narrative = generator.generate(
    case_data=fatal_case,
    format="cioms_i",
    include_autopsy=True,
    cause_of_death_analysis=True
)

Critical Elements:

  • Complete medical history relevant to death
  • Concomitant medications contributing
  • Autopsy findings (if performed)
  • Cause of death per death certificate
  • Alternative causes ruled out
  • Reporter's opinion on contribution to death

Pattern 3: Rechallenge Case

Scenario: Positive rechallenge confirms drug causation.

Key Documentation:

  • First exposure dates and reaction
  • Dechallenge response
  • Rechallenge dates and circumstances
  • Recurrence of same reaction
  • Any differences in severity
  • Conclusion on causality

Narrative Structure:

First Exposure:
- Drug X initiated [date]
- AE occurred [date], [description]
- Drug discontinued [date]
- Dechallenge: [positive/negative]

Rechallenge:
- Drug X reintroduced [date]
- Same AE recurred [date]
- Drug discontinued [date]
- Outcome: [status]

Causality: Certain (positive rechallenge)

Pattern 4: Multi-Drug Reaction

Scenario: Multiple suspect drugs, need to identify most likely culprit.

Analysis Approach:

  • Temporal sequence of drug initiations
  • Time to onset for each drug
  • Known adverse reaction profiles
  • Dechallenge attempts (if any)
  • Rechallenge data (if any)
  • Reporter's primary suspect

Narrative Organization:

  1. List all suspect drugs with indication and dates
  2. Describe temporal relationship for each
  3. Discuss dechallenge/rechallenge for each
  4. Present reporter's causality assessment
  5. Include alternative explanations

Complete Workflow Example

From case data to regulatory submission:

# Step 1: Generate narrative
python scripts/main.py \
  --input case_data.json \
  --format cioms_i \
  --output narrative.txt

# Step 2: Validate completeness
python scripts/validate.py \
  --narrative narrative.txt \
  --check cioms_completeness \
  --output validation_report.txt

# Step 3: Generate E2B format for electronic submission
python scripts/main.py \
  --input case_data.json \
  --format ich_e2b \
  --output e2b_narrative.xml

# Step 4: Medical review markup
python scripts/review.py \
  --narrative narrative.txt \
  --output review_version.txt

Python API:

from scripts.narrative_generator import NarrativeGenerator
from scripts.validator import NarrativeValidator

# Initialize
generator = NarrativeGenerator()
validator = NarrativeValidator()

# Load case data
import json
with open("case_001.json", "r") as f:
    case = json.load(f)

# Generate narrative
narrative = generator.generate(
    case_data=case,
    format="cioms_i",
    include_meddra=True,
    language="en"
)

# Validate
validation = validator.check(
    narrative=narrative,
    criteria=["cioms_completeness", "temporal_logic", "meddra_accuracy"]
)

if validation.passed:
    with open("final_narrative.txt", "w") as f:
        f.write(narrative.text)
    print("✓ Narrative validated and saved")
else:
    print(f"⚠ Issues: {validation.issues}")

Quality Checklist

Pre-Generation:

  • Case ID unique and formatted per SOP
  • Patient age/sex complete
  • Suspect drug(s) clearly identified
  • Adverse event(s) coded with MedDRA PT
  • Dates consistent (no future dates)
  • Reporter information included

Narrative Content:

  • All CIOMS I sections present
  • Temporal sequence clear and logical
  • Dechallenge/rechallenge described (if applicable)
  • Lab values with reference ranges
  • Concomitant medications listed
  • Medical history relevant to event
  • Outcome clearly stated
  • Causality assessment justified

Post-Generation:

  • MedDRA terms accurate and current
  • No contradictory information
  • Language objective and factual
  • No speculation or opinion (except causality section)
  • Patient identifiers removed or de-identified
  • CRITICAL: Medical review completed
  • CRITICAL: Causality assessment by qualified physician

Common Pitfalls

Completeness Issues:

  • Missing dechallenge information → Cannot assess causality

    • ✅ Always document effect after drug discontinuation
  • Vague temporal information → "Recently started" vs. specific dates

    • ✅ Use exact dates when available
  • Incomplete concomitant medication list → Alternative causes missed

    • ✅ Include all medications within relevant timeframe

Medical Accuracy Issues:

  • Incorrect MedDRA coding → Wrong medical concept

    • ✅ Use current MedDRA version; verify with medical reviewer
  • Confusing correlation with causation → Temporal = causal

    • ✅ Clearly state "temporally associated" vs. "causally related"
  • Omitting alternative diagnoses → Biased toward drug causation

    • ✅ Include all differential diagnoses considered

Regulatory Issues:

  • Opinion in narrative body → "Clearly caused by drug"

    • ✅ Reserve opinion for causality section; narrative should be factual
  • Patient identifiers → HIPAA/privacy violation

    • ✅ De-identify per regulatory requirements
  • Abbreviations not defined → Assumes reader knowledge

    • ✅ Spell out on first use in each narrative

References

Available in references/ directory:

  • cioms_i_guidelines.pdf - CIOMS I international reporting standards
  • ich_e2b_specifications.md - ICH E2B(R3) electronic format details
  • meddra_coding_guide.md - MedDRA terminology and coding principles
  • who_umc_causality.md - WHO causality assessment criteria
  • fda_medwatch_guide.md - FDA Form 3500A instructions
  • gvp_module_vi.md - EU Good Pharmacovigilance Practices
  • narrative_templates.md - Example narratives by case type

Scripts

Located in scripts/ directory:

  • main.py - CLI interface for narrative generation
  • narrative_generator.py - Core narrative composition engine
  • temporal_analyzer.py - Timeline reconstruction and analysis
  • causality_assessor.py - Causality evaluation support
  • meddra_integrator.py - Medical terminology and coding
  • validator.py - Completeness and quality checks
  • format_converter.py - Convert between CIOMS, E2B, MedWatch formats
  • batch_processor.py - Multi-case narrative generation

Limitations

  • Medical Review Required: Generates draft only; requires physician review before submission
  • Causality Assessment: Structures reporter's assessment; does not perform independent causality evaluation
  • MedDRA Version: Uses installed MedDRA version; may not have latest terms
  • Language: Optimized for English; other languages may need translation
  • Literature Integration: Does not automatically search literature for similar cases
  • Signal Detection: Individual case narratives only; aggregate analysis requires other tools
  • Legal Proceedings: Not suitable for litigation support or expert witness reports

⚠️ CRITICAL: This tool generates draft narratives for efficiency. All adverse event narratives require review by qualified drug safety physicians before regulatory submission. Causality assessment must be performed by healthcare professionals with access to complete medical records.

安全使用建议
This skill appears to do what it claims (generate CIOMS/ICSR narratives) and is bundled as a local Python script with reference docs and samples. Before installing/using it with real case data: 1) Verify the code: confirm scripts/main.py is complete and search it for network calls (requests, urllib, socket), subprocess/os.system calls, or any code that reads files outside the supplied inputs. 2) Confirm the documentation mismatch (SKILL.md references scripts.narrative_generator.NarrativeGenerator while the package provides CIOMSNarrativeGenerator in scripts/main.py) — update usage examples or ensure the expected module exists. 3) Run the tool in an isolated sandbox with non‑PHI test data to check behavior and outputs. 4) Ensure narratives produced do not accidentally include patient identifiers (PHI) — the docs say to exclude identifiers but the script may not enforce it. 5) If you will integrate this into automated pipelines, audit for any commands that would allow arbitrary shell execution (allowed-tools includes Bash), and restrict execution privileges or sandbox the agent. If you want higher assurance, ask the author for a full code review or a signed provenance/source repository (homepage/owner info is missing).
功能分析
Type: OpenClaw Skill Name: adverse-event-narrative Version: 0.1.0 The skill bundle is a legitimate tool for generating medical adverse event narratives (CIOMS/ICSR) from JSON data. The primary script, `scripts/main.py`, performs safe string formatting and data validation using only Python standard libraries, with no evidence of network calls, shell execution, or unauthorized file access. The instructions in `SKILL.md` and the supporting documentation in the `references/` directory are strictly aligned with the stated pharmacovigilance purpose and do not contain any malicious prompt injection or exfiltration attempts.
能力评估
Purpose & Capability
The name, description, reference docs, sample JSON, and the included Python script align with a narrative generator for ICSR/CIOMS purposes. However the SKILL.md examples show usage of scripts.narrative_generator.NarrativeGenerator while the repository contains scripts/main.py defining CIOMSNarrativeGenerator — a documentation/code mismatch that could confuse integrators or indicate outdated docs.
Instruction Scope
SKILL.md instructs only on narrative generation, timeline and causality analysis, and running the included script. It does not instruct reading unrelated system paths or requesting credentials. The allowed-tools line includes Bash/Edit/Read/Write (so the agent may run the script or edit files), which is reasonable for a file-based generator but means you should ensure the agent's execution environment is sandboxed before running with sensitive data.
Install Mechanism
No install spec (instruction-only plus a bundled script). No downloads or external package installs are declared. The included Python script uses only stdlib imports in the available excerpt, so install risk is low — but verify the full script for third-party/network imports.
Credentials
The skill declares no required environment variables, credentials, or config paths, which is proportional for a local narrative generator. There are no declared secrets or external service tokens required.
Persistence & Privilege
always:false and the skill is user-invocable; it does not request permanent inclusion or cross-skill config modification. Normal autonomous invocation remains possible (platform default) but is not combined with other high-risk factors here.
如何使用
  1. 确保已安装 OpenClaw(本地或 Docker 部署)
  2. 在对话框中输入安装命令:/install adverse-event-narrative
  3. 安装完成后,直接呼叫该 Skill 的名称或使用 /adverse-event-narrative 触发
  4. 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v0.1.0
Initial release of Adverse Event Narrative Generator — transforms safety case data into CIOMS-compliant narratives for regulatory submission. - Generates structured ICSR narratives per CIOMS I and ICH E2B guidelines. - Supports temporal analysis, causality assessment, and MedDRA coding. - Enables batch processing for multi-case reporting and quality validation. - Produces outputs in CIOMS I, FDA MedWatch, and EMA E2B formats. - Integrates with upstream and downstream pharmacovigilance workflows.
元数据
Slug adverse-event-narrative
版本 0.1.0
许可证 MIT-0
累计安装 0
当前安装数 0
历史版本数 1
常见问题

Adverse Event Narrative 是什么?

Generate CIOMS-compliant adverse event narratives for Individual Case Safety Reports (ICSR). Creates structured pharmacovigilance documents following CIOMS I... 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 238 次。

如何安装 Adverse Event Narrative?

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

Adverse Event Narrative 是免费的吗?

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

Adverse Event Narrative 支持哪些平台?

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

谁开发了 Adverse Event Narrative?

由 AIpoch(@aipoch-ai)开发并维护,当前版本 v0.1.0。

💬 留言讨论