Inferensys

Prompt

FDA Adverse Event Extraction Prompt for Safety Reports

A production-ready prompt playbook for pharmacovigilance teams extracting structured adverse event information from narrative safety reports. Covers MedDRA-coded events, suspect products, patient demographics, outcome classifications, seriousness criteria, and causality confidence scoring.
Wide-angle shot of a modern WeWork open floor plan with creative walls covered in AI system architecture diagrams, product team collaborating in standing desk area with industrial lighting.
PROMPT PLAYBOOK

When to Use This Prompt

Defines the precise job-to-be-done, target user, required context, and explicit limitations for the FDA adverse event extraction prompt.

This prompt is built for pharmacovigilance and drug safety teams who need to convert unstructured narrative reports (CIOMS forms, MedWatch reports, clinical trial SAE narratives, call center intake notes) into structured, auditable records suitable for safety database ingestion and regulatory submission. Use this prompt when you need typed extraction of adverse events with MedDRA coding, suspect product identification with dosage and route, patient demographics, seriousness criteria assessment against FDA definitions, and causality confidence scoring. The ideal user is a safety data analyst, PV operations engineer, or drug safety physician who understands ICH E2B(R3) data elements and needs extraction output that maps directly to safety database fields without manual rework.

This is not a general clinical extraction prompt. It assumes the source text describes a suspected adverse reaction to a medicinal product and requires domain-specific output fields aligned with E2B(R3) and ICH guidelines. The prompt is designed for a single-report extraction workflow, not batch processing or cross-report signal detection. Do not use this prompt for extracting clinical findings from discharge summaries, for general medical coding without the adverse event context, or for processing social media mentions where the reporter-product-reaction relationship is ambiguous. The prompt expects narrative text that contains at minimum an identifiable patient, a suspect product, and a described adverse event—if any of these three elements is missing, the prompt should return null fields with confidence annotations rather than hallucinating values.

Before deploying this prompt, ensure your input pipeline can isolate individual case narratives from batch submissions, redact reporter and patient identifiers according to your privacy requirements, and validate that the source text contains sufficient clinical detail for extraction. The prompt includes explicit instructions for handling missing data, ambiguous seriousness criteria, and multiple suspect products. It also requires the model to flag cases where causality cannot be assessed due to insufficient information. Wire the output through a validation layer that checks MedDRA code validity against your licensed terminology version, verifies date formats against E2B(R3) specifications, and confirms that seriousness criteria selections are mutually consistent. Cases with low confidence scores or failed validation should route to human review rather than automatic database insertion.

PRACTICAL GUARDRAILS

Use Case Fit

Where this prompt delivers reliable extraction and where you should choose a different approach.

01

Good Fit: Structured Narrative Reports

Use when: You have narrative adverse event reports (CIOMS, MedWatch, or clinical narratives) that follow predictable section structures. The prompt reliably extracts patient demographics, suspect products, and coded events when the source text contains explicit statements.

Guardrail: Pre-process to segment reports into standard sections (e.g., 'Patient History', 'Event Description', 'Lab Data') before extraction to improve field-level accuracy.

02

Bad Fit: Unstructured Social Media or Forum Posts

Avoid when: Source text is informal, lacks standard medical terminology, or mixes multiple patient stories in one thread. The prompt will hallucinate structured fields from ambiguous pronouns and non-clinical language.

Guardrail: Route informal sources through a triage classifier first. Only send text classified as 'clinical narrative' or 'structured report' to this extraction prompt.

03

Required Inputs: MedDRA Terminology Access

Risk: Without MedDRA term grounding, the model will invent plausible-sounding but incorrect preferred terms for adverse events. This breaks downstream safety database ingestion.

Guardrail: Provide a retrieval step that searches MedDRA for the closest matching LLT or PT before final coding. Include the top 3 candidate terms in the prompt context for the model to select from.

04

Operational Risk: Causality Overstatement

Risk: The model may confidently assert a causal relationship between a product and an event even when the source text only reports temporal association. This creates false safety signals.

Guardrail: Require the prompt to output a separate causality_evidence field that quotes the exact source language supporting any causality assessment. Flag for human review when evidence is only temporal.

05

Operational Risk: Seriousness Criteria Misclassification

Risk: The model may incorrectly apply FDA seriousness criteria (death, life-threatening, hospitalization, disability, congenital anomaly, other medically important) when clinical context is subtle or implied rather than stated.

Guardrail: Add a validation step that checks each seriousness flag against explicit source evidence. Route any case with 'other medically important' classification to human review unless the narrative contains explicit clinician judgment.

06

Bad Fit: Real-Time Streaming Triage

Avoid when: You need sub-second extraction from high-volume adverse event streams for real-time alerting. The prompt's multi-field structured extraction and MedDRA coding steps add latency incompatible with streaming triage.

Guardrail: Use a lightweight classifier for initial streaming triage (seriousness flag + product detection only). Reserve full structured extraction for batch processing or cases flagged by the triage layer.

PROMPT PLAYBOOK

Copy-Ready Prompt Template

A copy-ready system and user prompt pair for extracting structured FDA adverse event data from narrative safety reports.

This section provides the complete prompt template you will paste into your AI system. It is split into a system prompt, which establishes the model's role as a pharmacovigilance extraction specialist and enforces strict output discipline, and a user prompt, which carries the source text and specific extraction instructions. The system prompt defines the exact JSON schema, MedDRA coding requirements, seriousness criteria, and causality assessment rules. The user prompt is where you inject the narrative report and any run-specific constraints. Every square-bracket placeholder must be replaced with your actual data before execution.

text
SYSTEM:
You are an expert pharmacovigilance data extraction specialist. Your task is to read narrative adverse event reports and extract structured information with high precision. You must adhere strictly to the output schema. Do not infer or hallucinate data not present in the text. If a field is not mentioned, its value must be null. For every extracted field, you must include a confidence score (HIGH, MEDIUM, LOW) and a direct quote from the source text as evidence. Use MedDRA Preferred Terms (PT) for adverse event names. Classify seriousness according to FDA criteria (death, life-threatening, hospitalization, disability, congenital anomaly, other serious). Assess causality using the WHO-UMC scale (Certain, Probable, Possible, Unlikely, Unclassified).

USER:
Extract the adverse event information from the following safety report narrative. Return ONLY a valid JSON object conforming to the schema below. Do not include any text outside the JSON.

[OUTPUT_SCHEMA]
{
  "report_id": "string | null",
  "patient": {
    "age": "number | null",
    "age_unit": "string | null",
    "sex": "string | null",
    "weight_kg": "number | null"
  },
  "suspect_products": [
    {
      "name": "string",
      "active_substance": "string | null",
      "dosage_form": "string | null",
      "dose": "string | null",
      "route": "string | null",
      "indication": "string | null",
      "start_date": "string | null",
      "end_date": "string | null"
    }
  ],
  "adverse_events": [
    {
      "meddra_pt": "string",
      "verbatim": "string",
      "onset_date": "string | null",
      "outcome": "string | null",
      "seriousness_criteria": ["string"],
      "causality_assessment": {
        "score": "string",
        "rationale": "string"
      }
    }
  ],
  "evidence": [
    {
      "field_path": "string",
      "quote": "string",
      "confidence": "string"
    }
  ]
}

[CONSTRAINTS]
- All dates must be in ISO 8601 format (YYYY-MM-DD).
- The "outcome" field must be one of: Recovered/Resolved, Recovering/Resolving, Not Recovered/Not Resolved, Recovered with Sequelae, Fatal, Unknown.
- The "seriousness_criteria" array must only contain values from: Death, Life Threatening, Hospitalization, Disability, Congenital Anomaly, Other Serious.
- The "causality_assessment.score" must be one of: Certain, Probable, Possible, Unlikely, Unclassified.
- If multiple suspect products exist, list them all.
- If the narrative contains no adverse event information, return a valid JSON object with empty arrays and null fields, not an error message.

[SOURCE_TEXT]
[INSERT_NARRATIVE_REPORT_HERE]

How to adapt this template: Replace [INSERT_NARRATIVE_REPORT_HERE] with the full text of the safety report. If your downstream system requires a different schema, modify the [OUTPUT_SCHEMA] block, but keep the field names and types consistent with your ingestion contract. If you are using a model that does not support a separate system prompt, prepend the system instructions to the user message. For high-risk production use, always pair this prompt with a post-extraction validation step that checks schema compliance, MedDRA code validity, and confidence thresholds before the data enters your safety database. If any field has LOW confidence, route the record for human review rather than automated ingestion.

IMPLEMENTATION TABLE

Prompt Variables

Every placeholder the FDA Adverse Event Extraction Prompt expects, its purpose, a concrete example, and actionable validation checks to apply before sending the prompt to the model.

PlaceholderPurposeExampleValidation Notes

[SAFETY_REPORT_TEXT]

The full narrative text of the adverse event report to be extracted.

Patient is a 45-year-old female who developed severe nausea and vomiting after taking DrugX 50mg. Symptoms started 2 hours after first dose. Patient was hospitalized.

Check that the string is non-empty and contains at least 50 characters. Reject if only metadata or headers are present without narrative content.

[MEDDRA_VERSION]

The specific MedDRA version to use for coding terms. Ensures consistent terminology across extraction runs.

27.0

Validate against a list of allowed MedDRA version strings. Reject if version is unsupported or not in the format XX.X.

[OUTPUT_SCHEMA]

The JSON schema definition that dictates the exact structure of the output, including required fields and types.

{"type": "object", "properties": {"patient_demographics": {"type": "object"}, "events": {"type": "array"}}, "required": ["events"]}

Parse as JSON and validate it is a valid JSON Schema (Draft 7 or later). Reject if schema parsing fails or if the 'events' array is not defined as required.

[SERIOUSNESS_CRITERIA]

A list of FDA seriousness criteria to assess for each event, such as hospitalization, life-threatening, or disability.

["Hospitalization", "Life-Threatening", "Death", "Disability", "Congenital Anomaly", "Other Medically Important Condition"]

Check that it is a non-empty array of strings. Validate each string against a predefined set of acceptable seriousness criteria enums.

[CAUSALITY_CONFIDENCE_THRESHOLD]

The minimum confidence score (0.0 to 1.0) required to assert a causal relationship between a suspect product and an event.

0.7

Parse as a float. Validate that the value is between 0.0 and 1.0 inclusive. Reject if not a number or out of range.

[SUSPECT_PRODUCT_DICTIONARY]

A list of known product names and their standardised identifiers to aid in accurate suspect product extraction and normalization.

["DrugX 50mg Tablet", "VaccineY Injection", "PlaceboZ Capsule"]

Check that it is a non-empty array of strings. Validate that each entry has a name string. A null value is allowed if no dictionary is to be used.

[PATIENT_DEMOGRAPHIC_FIELDS]

An array of patient demographic fields to extract, such as age, sex, and weight, if present in the report.

["age", "sex", "weight_kg"]

Validate that it is an array of strings. Check each string against a predefined set of allowed demographic field names. Reject if an unsupported field is requested.

PROMPT PLAYBOOK

Implementation Harness Notes

How to wire the FDA adverse event extraction prompt into a production pharmacovigilance workflow with validation, retry, logging, and human review.

This prompt is not a standalone tool—it is one step in a regulated safety data pipeline. The implementation harness must enforce schema compliance, handle extraction failures gracefully, and maintain a complete audit trail. In a production pharmacovigilance system, every extracted field that flows into a safety database or E2B submission must be traceable back to the source narrative and the model's confidence in that extraction. The harness described here assumes the prompt is called via an API (such as OpenAI, Anthropic, or a self-hosted model) and that the response is processed before any downstream ingestion.

Validation and retry logic is the first line of defense. After the model returns a JSON payload, validate it against the expected schema: check that required fields like [SERIOUSNESS_CRITERIA], [SUSPECT_PRODUCT], and [EVENT_TERM] are present and correctly typed. Use a library like Pydantic or JSON Schema validators to catch missing fields, incorrect enums, or malformed MedDRA codes. If validation fails, construct a retry prompt that includes the original input, the failed output, and the specific validation errors. Limit retries to a maximum of 2 attempts. After the second failure, route the case to a human review queue with the partial extraction and error log attached. Never silently drop a failed extraction in a safety context.

Logging and audit evidence must capture every model interaction. For each extraction request, log: the prompt template version, the full model request payload, the raw model response, the validated output, any retry attempts with their error messages, and the final disposition (auto-accepted, auto-rejected, or escalated). Store these logs in an append-only system with retention aligned to your organization's record-keeping obligations—typically 10+ years for adverse event records. Include a unique extraction_id that ties the log entry to the source document and any downstream ICSR (Individual Case Safety Report) it generates.

Human review integration is required for high-risk or low-confidence outputs. The prompt includes a [CONFIDENCE_SCORE] field for each extracted element. Define a confidence threshold (e.g., below 0.7 for seriousness criteria or suspect product identification) that triggers mandatory human review. Build a review interface that presents the original narrative side-by-side with the extracted fields, highlights low-confidence spans, and allows a safety professional to accept, edit, or reject each field. The reviewer's actions must be logged as part of the audit trail, and corrected fields should be fed back into the system of record—not used to fine-tune the model without appropriate governance.

Model choice and deployment decisions affect reliability and latency. For high-stakes pharmacovigilance, prefer a model with strong instruction-following and structured output capabilities (e.g., GPT-4o, Claude 3.5 Sonnet) and enable structured output mode if the provider supports it. Run the prompt in a dedicated, private deployment if source narratives contain patient-identifiable information. Do not send PHI to consumer-grade model endpoints. If using a self-hosted open-weight model, validate extraction quality against a golden dataset of 200+ annotated safety narratives before production use, and re-validate after any model or prompt change.

What to avoid: Do not treat this prompt as a replacement for a certified safety database or a qualified human assessor. Do not auto-submit extracted data to regulators (e.g., FDA E2B gateway) without human review. Do not use the model's output to close a case or determine causality without a qualified safety professional's assessment. The prompt is an acceleration tool for structured data entry, not a clinical or regulatory decision-maker. Build the harness to stop and escalate when uncertain, and design your workflow so that every automated extraction can be overridden by a human with domain expertise.

IMPLEMENTATION TABLE

Expected Output Contract

The JSON structure the prompt must return. Validate every field before ingestion.

Field or ElementType or FormatRequiredValidation Rule

report_id

string

Must match the [REPORT_ID] input exactly; no generation or modification

extraction_timestamp

ISO 8601 datetime

Must be a valid ISO 8601 UTC timestamp; parse with Date.parse()

adverse_events

array of objects

Must be a non-empty array; each element must conform to the adverse_event schema

adverse_events[].meddra_term

string

Must be a valid MedDRA Preferred Term; validate against [MEDDRA_VERSION] dictionary

adverse_events[].seriousness_criteria

array of strings

Must contain only values from the enum: Death, Life-Threatening, Hospitalization, Disability, Congenital Anomaly, Other Medically Important; at least one required

suspect_products

array of objects

Must be a non-empty array; each element must have product_name and active_ingredient fields

suspect_products[].product_name

string

Must not be empty or null; match against [PRODUCT_DICTIONARY] if provided

suspect_products[].causality_score

string

Must be one of: Certain, Probable, Possible, Unlikely, Unassessable; default to Unassessable if insufficient evidence

patient_demographics.age

integer or null

If present, must be a positive integer between 0 and 130; null allowed when age not reported

patient_demographics.sex

string or null

If present, must be one of: Male, Female, Unknown; null allowed when not reported

outcome

string

Must be one of: Recovered, Recovering, Not Recovered, Recovered with Sequelae, Fatal, Unknown; default to Unknown if not stated

narrative_summary

string

Must be a concise summary of the event narrative; length between 50 and 500 characters

source_evidence_spans

array of objects

Each span must include field_name, start_char, end_char, and excerpt; start_char must be less than end_char

confidence_notes

array of objects

If present, each note must have field_name, confidence_level (High, Medium, Low), and rationale string

extraction_warnings

array of strings

If present, each warning must describe a specific extraction ambiguity or missing information; no generic messages

PRACTICAL GUARDRAILS

Common Failure Modes

Production extraction of adverse events from narrative safety reports fails in predictable ways. These are the most common failure patterns and the specific guardrails to prevent them.

01

Hallucinated MedDRA Codes

What to watch: The model generates a plausible-sounding MedDRA term and code that does not exist in the official dictionary. This is especially common with rare or multi-word events. Guardrail: Validate every returned MedDRA code against a lookup table or API before ingestion. If the code is not found, fall back to a retrieval step that searches the dictionary by the reported term.

02

Causality Confusion with Listedness

What to watch: The model conflates causality assessment with whether an event appears on the product label, treating listed events as automatically causally related. Guardrail: Separate the extraction of listedness from the causality scoring prompt. Require the model to cite specific dechallenge/rechallenge or temporal evidence before assigning a causality score above 'possible'.

03

Patient History Leakage into Adverse Event

What to watch: The model extracts a pre-existing condition from the patient's medical history section and incorrectly classifies it as a new adverse event. Guardrail: Add a constraint requiring the model to identify the source section for each extracted event. Flag any event where the only evidence span comes from the 'Medical History' section for human review.

04

Suspect Product Misattribution in Polypharmacy

What to watch: When a patient is on multiple drugs, the model assigns the adverse event to the wrong suspect product, often defaulting to the first drug mentioned. Guardrail: Prompt the model to extract the specific drug-event pair relationship explicitly stated in the narrative. If the narrative does not link a specific drug to the event, mark the suspect product as 'unclear' rather than guessing.

05

Seriousness Criteria Over-Application

What to watch: The model applies 'serious' criteria too broadly, classifying events as life-threatening or requiring hospitalization based on weak signals or general severity rather than the strict regulatory definitions. Guardrail: Include the verbatim FDA seriousness definitions in the prompt. Require the model to quote the specific clinical intervention or outcome that meets the threshold. Default to 'non-serious' when evidence is missing.

06

Narrative Temporal Sequencing Errors

What to watch: The model misorders the sequence of drug administration, event onset, and outcome, leading to incorrect time-to-onset calculations or causality assessments. Guardrail: Add a dedicated extraction field for 'event timeline' as an ordered list of date-stamped facts. Run a secondary validation check that ensures the onset date is not before the drug start date.

IMPLEMENTATION TABLE

Evaluation Rubric

Run these checks against a golden dataset of 50+ manually extracted safety reports before deploying the FDA Adverse Event Extraction prompt to production. Each criterion targets a specific failure mode observed in pharmacovigilance extraction workflows.

CriterionPass StandardFailure SignalTest Method

MedDRA Term Exact Match

≥ 95% of extracted PT/LLT codes match the golden dataset exactly

Extracted term is a synonym or broader concept not matching the coded reference

String comparison of [EXTRACTED_MEDDRA_CODE] against golden label per report

Seriousness Criteria Recall

≥ 98% recall on all 6 seriousness criteria flags (death, life-threatening, hospitalization, disability, congenital anomaly, other)

Any true-positive seriousness criterion is missed or incorrectly set to false

Boolean flag comparison per criterion field against golden dataset annotations

Suspect Product Identification

≥ 90% exact match on active ingredient and trade name for primary suspect product

Wrong product flagged as primary suspect; excipient or concomitant medication misclassified

Exact string match on [PRODUCT_ACTIVE_INGREDIENT] and [PRODUCT_TRADE_NAME] fields

Causality Confidence Calibration

Confidence score deviation ≤ 0.15 from expert-assigned scores on a 0-1 scale

High confidence assigned to cases with insufficient dechallenge/rechallenge evidence

Mean absolute error between [CAUSALITY_CONFIDENCE] and golden dataset expert score

Patient Demographic Completeness

≥ 98% of required demographic fields populated when present in source narrative

Age, sex, or weight present in narrative but null in output

Null rate check on [PATIENT_AGE], [PATIENT_SEX], [PATIENT_WEIGHT] against source availability

Outcome Classification Accuracy

≥ 95% exact match on outcome category (recovered, recovering, not recovered, fatal, unknown)

Fatal outcome misclassified as not recovered; ongoing case misclassified as recovered

Enum comparison of [OUTCOME] field against golden dataset classification

Narrative Span Citation

≥ 90% of extracted fields have a valid character span that maps to the source text

Citation span points to wrong sentence or is empty when evidence exists in source

Span offset verification: check that [CITATION_START] and [CITATION_END] extract the correct substring

Null Handling Discipline

Null rate on optional fields matches golden dataset null rate within ±5 percentage points

Hallucinated values in fields where source narrative provides no evidence

Compare null frequency per field between extraction output and golden dataset

ADAPTATION OPTIONS

Adapt This Prompt

How to adapt

Use the base prompt with a frontier model (GPT-4o, Claude 3.5 Sonnet) and minimal validation. Start with a single narrative report and iterate on the output schema until extraction coverage meets your minimum viable product needs.

code
Extract adverse events from [SAFETY_REPORT_NARRATIVE].
Return JSON with patient_demographics, suspect_products, adverse_events, and outcome.

Watch for

  • Missing seriousness criteria assessment without explicit instruction
  • Hallucinated MedDRA codes when the narrative is vague
  • Inconsistent causality confidence scoring across multiple runs
  • No handling for concomitant medications vs. suspect products
Prasad Kumkar

About the author

Prasad Kumkar

CEO & MD, Inference Systems

Prasad Kumkar is the CEO & MD of Inference Systems and writes about AI systems architecture, LLM infrastructure, model serving, evaluation, and production deployment. Over 5+ years, he has worked across computer vision models, L5 autonomous vehicle systems, and LLM research, with a focus on taking complex AI ideas into real-world engineering systems.

His work and writing cover AI systems, large language models, AI agents, multimodal systems, autonomous systems, inference optimization, RAG, evaluation, and production AI engineering.