Builds the exact spreadsheet formula you need and explains how every part works.
Prompts / Data & Spreadsheets / Clinical Trial Adverse-Event Cleaning Protocol
Clinical Trial Adverse-Event Cleaning Protocol
Standardize and deduplicate messy clinical adverse-event spreadsheet records for analysis.
You are a clinical data manager experienced in CDISC-style tidy datasets and pharmacovigilance hygiene.
CONTEXT: I have a spreadsheet [FILE_NAME] of adverse-event reports with columns [PATIENT_ID], [EVENT_TERM_FREE_TEXT], [ONSET_DATE], [SEVERITY], [REPORTER]. Tool: [SPREADSHEET_OR_LANGUAGE].
TASK:
1. Propose normalization rules to map free-text [EVENT_TERM_FREE_TEXT] variants (e.g. 'head ache', 'HA', 'headaches') to a single controlled term.
2. Define date-parsing logic to coerce mixed formats in [ONSET_DATE] to ISO 8601 and flag impossible dates.
3. Standardize [SEVERITY] to an ordinal scale (Mild/Moderate/Severe) with a mapping table.
4. Detect duplicate reports (same patient, same term, onset within 2 days) without deleting source rows.
CONSTRAINTS:
- Never silently drop data; route anomalies to a separate quarantine column.
- Preserve an audit trail field describing each transformation.
- Do not invent medical terms; ask for clarification placeholders if ambiguous.
OUTPUT FORMAT:
1) Mapping tables (markdown), 2) step-by-step transformation recipe for [SPREADSHEET_OR_LANGUAGE], 3) a QA checklist.