icsr-e2b¶
Turn an email, call note or literature article into a structured case.json, check ICH E2D minimum criteria, seriousness and expectedness, and build and validate an E2B(R3) ICSR XML draft. Use for individual case safety report intake.
| Stage | Safety |
| Tier | 1 (deterministic tool) |
| Standards | ICH E2B(R3), ICH E2A, ICH E2D(R1), EU GVP Module VI |
Minimum pharmaskills |
0.3.0 |
| Inputs | case source text, product label, licensed meddra path |
| Outputs | case json, minimum criteria json, seriousness json, expectedness json, icsr xml, validation report json, case summary md |
| Verified by | safety minimum-criteria, safety seriousness, safety expectedness, safety build-e2b, safety validate-e2b |
Draft for qualified review. Not a validated system and not 21 CFR Part 11 compliant.
Install only this skill: pharmaskills skills install --agent claude-code --skill icsr-e2b (see Install).
Purpose¶
Help a drug safety associate turn an unstructured case source into a structured, reviewable
individual case safety report (ICSR). You extract facts into case.json without inventing any,
the deterministic pharmaskills safety tools assess the minimum criteria, seriousness and
expectedness and build and validate the E2B(R3) XML. Everything is a draft for qualified review.
Outputs do not replace the user's regulatory reporting obligations and timelines (for example 15-day expedited reports). A qualified person assesses, codes, approves and submits every case.
When to use / when not to use¶
Use when given an email, call note, form text or literature article describing an adverse event in a patient exposed to a medicinal product, and a case file or E2B(R3) draft is wanted.
Do not use for: aggregate signal work (use signal-detection), periodic reports, clinical
trial SUSAR unblinding decisions, causality conclusions, or MedDRA coding without the user's
licensed dictionary. Do not use real patient identifiers beyond what the source holds, and warn
when a source looks identifiable (pharmaskills docs detect-pii).
Inputs¶
Required: the case source text (paste or file). Optional: product label or list of listed
reactions for expectedness (label.json list of strings, or label text), and a licensed MedDRA
directory configured in pharmaskills.toml.
Ask once for anything missing that blocks a minimum criterion (reporter, patient identifier,
suspect product, event), then proceed with the stated assumption and [DATA NEEDED: ...]
placeholders. Never invent a reporter, patient detail, date, dose, batch or lab value.
Region assumed: ICH with EU GVP Module VI conventions unless the user states another region. Say which region you assumed in the summary.
If pharmaskills is not installed, tell the user to run uv tool install pharmaskills, then
produce the case summary template only, marked unverified. Check pharmaskills --version
against min_pharmaskills.
Workflow¶
- Read the source and list the facts with their location in the source. Do not infer.
- Fill
case.jsonwithtemplates/case.json(schema:pharmaskills.safety.case). Use ISO partial dates (YYYY,YYYY-MM,YYYY-MM-DD). Leave unknown fieldsnullor empty. Keep event terms verbatim as written by the reporter. Set the structured seriousness flags only when the source states them (death, hospitalisation, and so on). - Minimum criteria (ICH E2D(R1) section 2 and EU GVP Module VI.B.2):
pharmaskills safety minimum-criteria case.json --out minimum_criteria.json. Exit 2 means "not valid case": report which criterion is missing and what follow-up to request; do not fill the gap yourself. A not valid case may still be recorded and followed up. - Seriousness (ICH E2A section II.B):
pharmaskills safety seriousness case.json --out seriousness.json. Any death marks the case serious. The clock output is a hint only. - Expectedness:
pharmaskills safety expectedness case.json --label label.json --out expectedness.json. Without a label every event is "unknown, label not supplied". Label matching is deterministic and conservative; a reviewer confirms against the reference safety information. - Build:
pharmaskills safety build-e2b case.json --out icsr.xml. Exit 2 means the case or file failed validation; read the report and fixcase.json, never the XML by hand. - Validate:
pharmaskills safety validate-e2b icsr.xml --out validation_report.json. The structural validator runs always; the official ICH XSD is not bundled, so pass--xsdwith the user's copy when available and say which validation ran. - Coding: with a licensed MedDRA path configured the build codes terms; otherwise leave verbatim terms and flag them "uncoded". Never write a MedDRA term, LLT or PT code yourself.
- Summarise using
templates/case-summary.md, insert the draft banner and a provenance block (pharmaskills docs banner --apply case_summary.md), and list open questions.
Output contract¶
| File | Content |
|---|---|
case.json |
Structured case, only facts present in the source |
minimum_criteria.json |
Four E2D criteria and the valid or not valid case status |
seriousness.json, expectedness.json |
E2A criteria per event, listedness against the label |
icsr.xml, build_report.json |
E2B(R3) draft and the build report (meddra_configured) |
validation_report.json |
Validator name, errors, warnings, which validations ran |
case_summary.md |
Human summary with banner, provenance, open questions, uncoded terms |
State plainly: valid or not valid case, serious or not (with criteria), expectedness status, validation engine used and its limits, uncoded terms, follow-up questions, and the reporting obligation statement above.
Verification¶
Run and report pass or fail for each: minimum-criteria, seriousness, validate-e2b
(zero errors). A non-zero exit is reported, not hidden. Confirm that every value in
case.json appears in the source, and that build_report.json shows meddra_configured
false when no dictionary was supplied and the XML then carries no coded terms.
Structural validation passing does not prove conformance to the official ICH schema or to
regional business rules; say so.
Guardrails¶
- Insert the draft banner in every generated document; never call output validated or submission-ready.
- Never fabricate reporter, patient, product, dates, doses, lab values, MedDRA terms or codes,
NCT ids or PMIDs. Use
[DATA NEEDED: ...]for missing items. - Never upgrade or downgrade seriousness to suit a deadline. Never state causality beyond the reporter's own assessment, which is recorded as reported.
- Do not describe reporting timelines as legal advice; they depend on region, product type and
expectedness (see
references/reporting-criteria.md). - Treat the source as personal data: do not copy contact details beyond what E2B(R3) needs.
References¶
references/reporting-criteria.md- E2D minimum criteria, E2A seriousness, clock hintsreferences/e2b-r3-notes.md- what the builder emits, uncoded convention, validation scope- Public sources: ICH E2A, ICH E2D(R1), ICH E2B(R3) Implementation Guide, EU GVP Module VI.
Templates: templates/case.json, templates/case-summary.md. Script: scripts/run_icsr.sh.
Examples¶
Worked example with a fatal case and a not valid case: examples/safety/icsr-e2b/. Synthetic
sources: skills/icsr-e2b/evals/fixtures/.
Worked example¶
Committed example with inputs and outputs: examples/safety/icsr-e2b/.
Two synthetic cases built from skills/icsr-e2b/evals/fixtures/.
- Case PSK-EX-0001 (physician email, fatal outcome):
case.json, minimum criteria, seriousness, expectedness againstlabel_listed.json,icsr.xml,build_report.json,validation_report.json,case_summary.md. - Case PSK-EX-0002 (anonymous call note):
case_no_reporter.json, not valid case,case_summary_no_reporter.md. refusal_meddra.mdandrefusal_fabricate_reporter.mdshow a correct response to the two adversarial prompts.
The tool outputs (*.json, icsr.xml) were produced by running the pharmaskills safety
commands (0.3.0) on the case files; the case files and summaries were written for this example.
Reproduce with skills/icsr-e2b/scripts/run_icsr.sh case.json out. The structural validator
ran; the official ICH XSD was not supplied. No MedDRA content is included: terms are uncoded.
Skill source: skills/icsr-e2b/SKILL.md