SDTM All lessons Scene 1 / 12

SDTM · Interactive Lesson

SDTM AE Domain Mapping Example

12 scenes· ~22 min· pairs with the article

Step through the scenes, pass the checkpoint quizzes, and try the hands-on exercises. Progress saves locally in this browser — no account, no tracking.

Scene index · 12 scenes
  1. ConceptThe Tuesday AE Extract
  2. ConceptIdentifiers and the Verbatim Term
  3. ConceptAEDECOD from a Pinned Coding Deliverable
  4. ConceptAESEV and the Six Seriousness Criteria
  5. ConceptDates Are ISO 8601 Strings
  6. ConceptAESEQ: Deterministic, Because SUPPAE Depends on It
  7. CheckpointCheckpoint: Mapping Fundamentals
  8. ConceptWalkthrough: Five Delivered AE Rows
  9. Hands-onHands-on: Route the SUPPAE Qualifiers
  10. ConceptValidate with CORE, Triage by Rule ID
  11. CheckpointFinal Check: AE Domain Decisions
  12. ConceptFrom Extract to a Reviewable AE Domain
Concept1 / 12

The Tuesday AE Extract

The Tuesday AE Extract

Raw AE EDC data is rarely SDTM-ready — mapping decisions come before code.

Material Facts from the Extract

• Five subject-level AE pages — every page has AEYN = 'Yes'

• Sites: 74001 and 74003

• Demo case: 043-18101-74001-001

• Five events: ALT Increase, AST Increase, Blood Bilirubin Increase, Confusion, Delirium

• Source reminders: USUBJID, verbatim condition, AEYN, site, and event pages are the unit of truth.

Continuing rule: show only values/traces backed by the provided extracts; label missing information rather than inventing it.

Today’s Mapping Work

① Subject and term identifiers — USUBJID / AETERM

② Medical coding — AEDECOD via MedDRA

③ Severity and seriousness flags — AESEV / AESER

④ Study dates in ISO 8601 — AESTDTC / AEENDTC

⑤ Deterministic AESEQ with SUPPAE, then CORE validation triage

Opening scenario: a raw EDC AE extract lands and is far from submission-ready. This lesson works a real, small AE mapping example under the discipline that every shown value traces to the provided extracts. (Opening, L1)

Speaker notes

Tuesday's raw Adverse Event (AE) extract comes from Electronic Data Capture (EDC), and it is not yet Study Data Tabulation Model (SDTM)-ready. The source shows five subject-level AE pages, all with Adverse Event Yes/No (AEYN) equal to Yes, across sites 74001 and 74003. For the demo subject at site 74001, the five events are alanine aminotransferase (ALT) Increase, aspartate aminotransferase (AST) Increase, Blood Bilirubin Increase, Confusion, and Delirium. We will map Unique Subject Identifier (USUBJID) and Adverse Event Term (AETERM), Medical Dictionary for Regulatory Activities (MedDRA) decoding to Adverse Event Decoded Term (AEDECOD), and International Organization for Standardization (ISO) 8601 dates. Then we add deterministic Adverse Event Sequence Number (AESEQ) with Supplemental Qualifiers for Adverse Events (SUPPAE), and triage validation findings; any value or Statistical Analysis System (SAS) line shown comes from the material facts, and missing information is flagged, never invented.

Concept2 / 12

Identifiers and the Verbatim Term

Identifiers and the Verbatim Term

Identifier Variables — Assigned vs. Composed

• STUDYID = '043-18101' — an assigned constant

• DOMAIN = 'AE' — an assigned domain label

• USUBJID = 043-18101-74001-001 — identical in all domains

Verbatim Term — AETERM

• AETERM = the term exactly as collected, minus blanks

• 'ALT Increase', 'AST Increase', 'Confusion' stay as-is

• Standardization belongs in AEDECOD — never rewrite AETERM

• Cleaning AETERM breaks CRF reconciliation and coding joins

usubjid = catx('-', studyid, siteid, subjid);

aeterm = strip(ae_term);

Establish how the SDTM key variables are built and why AETERM must stay exactly as collected. (Concept, L1)

Speaker notes

In this scene, we focus on identifiers and the verbatim term rule for the Adverse Event Term, or AETERM. The Study Data Tabulation Model, or SDTM, requires a Unique Subject Identifier, USUBJID, built once with catx, joining the study identifier, site identifier, and subject identifier with hyphens. That same USUBJID must appear identically across every domain, so never reuse the Electronic Data Capture subject number alone. For AETERM, store the verbatim term exactly as collected, stripped only of surrounding blanks, so terms like 'Confusion' stay as-is. Standardization belongs in the Adverse Event Decoded Term, AEDECOD, never by rewriting AETERM, because cleaning AETERM breaks the reviewer's ability to reconcile the submission against the Case Report Form and coding-file joins break.

Concept3 / 12

AEDECOD from a Pinned Coding Deliverable

AEDECOD — Joined, Never Guessed

Standard MedDRA Preferred Terms come only from the coding deliverable.

Never typed from memory, never guessed by a model.

AESEQ=1 “ALT Increase” — MedDRA path

Deliverable guardrails

LLT  ALT increased (10001845)

PT (AEDECOD)  Alanine aminotransferase increased (10001551)

HLT  Liver function analyses (10024689)

HLGT  Hepatobiliary investigations (10019809)

SOC  Investigations (10022891)

• Pin one MedDRA version per data cut

• Declare version in define-XML

• Uncontrolled recode causes drift

• AEDECOD blank while coding pending

• AELLT, AEHLT, AEBODSYS, codes ride

Teach that standardized AE terms come only from the MedDRA coding deliverable, with version pinning and hierarchy variables. (Concept, L1)

Speaker notes

The Adverse Event Dictionary-Derived Preferred Term, or AEDECOD, comes only from the version-pinned Medical Dictionary for Regulatory Activities coding deliverable—never typed from memory or guessed. In the delivered row, "ALT Increase" maps through the hierarchy: Lowest Level Term "ALT increased", Preferred Term "Alanine aminotransferase increased", High Level Term "Liver function analyses", High Level Group Term "Hepatobiliary investigations", and System Organ Class "Investigations". Pin one MedDRA version per data cut, declare it in define-XML, and avoid uncontrolled recoding that causes MedDRA drift and silently changes adverse event summaries. When coding is pending, AEDECOD stays blank, the row still ships, and an open query ID tracks the gap—guessing a term is a submission defect; the related hierarchy variables and their numeric codes ride with the same deliverable.

Concept4 / 12

AESEV and the Six Seriousness Criteria

AESEV and the Six Seriousness Criteria

AESEV — Severity (CDISC CT)

AESER — Seriousness (Y/N)

• MILD · MODERATE · SEVERE (CDISC CT)

• Raw scales collapse via explicit decision rows

• Y only when the CRF confirms a serious event

• Blank criterion ≠ 'No' — never default to N

Six seriousness criteria — Y only when the CRF box is checked

AESDTH

AESLIFE

AESHOSP

AESDISAB

AESCONG

AESMIE

• QC check: every AESER='Y' record must carry at least one criterion = 'Y'

• Serious event with no criterion = reviewer question + data query

• Delivered rows: all 5 events AESER='N'; six criterion columns blank

Explain controlled terminology for severity and the distinction between a blank seriousness criterion and a 'No'. (Concept, L1)

Speaker notes

CDISC, the Clinical Data Interchange Standards Consortium, defines AESEV, Adverse Event Severity, with three controlled terms: MILD, MODERATE, and SEVERE; raw severity scales collapse into these terms through explicit decision rows in your mapping specification. AESER, Serious Event, maps to Y or N via a decision table, and the six seriousness criteria get Y only when the Case Report Form, or CRF, box is checked. A blank criterion means the box was left unchecked, while an explicit 'No' means the criterion was denied; never default a blank to N. For quality control, or QC, every record with AESER='Y' must have at least one criterion equal to 'Y'. A serious event with no criterion triggers a data query. In the delivered data, all five events have AESER='N', and the six criterion columns are blank.

Concept5 / 12

Dates Are ISO 8601 Strings

Dates Are ISO 8601 Strings

Key Handling Rules

SituationSDTM handling
AESTDTC / AEENDTCCharacter ISO 8601 exactly as collected — not a SAS numeric date
Partial date ('YYYY-MM')Valid — ship unchanged; never silently complete
Missing / unknown AE endAEENDTC stays missing; raise a data query
Ongoing eventAEENRF='ONGOING'; AEENDTC blank
Imputation per SAPPerform in ADaM (Analysis Data Model) with documentation — never in SDTM

Teach the SDTM date rule: character ISO 8601 as collected, including partial precision, with no silent completion. (Concept, L1)

Speaker notes

Every --DTC in the Study Data Tabulation Model, or SDTM, is a character International Organization for Standardization 8601 string, exactly as collected. So the adverse event start date/time, AESTDTC, and adverse event end date/time, AEENDTC, are never SAS numeric dates. The delivered rows show AESTDTC='2019-05-20' with AESTDY=13 for the alanine aminotransferase (ALT) and aspartate aminotransferase (AST) events, and AESTDTC='2019-05-17' with AESTDY=10 for the later three events. Partial dates like 'YYYY-MM' are valid and ship unchanged; completing them changes clinical meaning. If the end date is missing or unknown, AEENDTC stays missing and you raise a data query; an ongoing event carries the adverse event end relative to reference period flag, AEENRF='ONGOING', with AEENDTC blank. Imputation, when the Statistical Analysis Plan calls for it, happens later in the Analysis Data Model, or ADaM — never in SDTM.

Concept6 / 12

AESEQ: Deterministic, Because SUPPAE Depends on It

AESEQ: Deterministic,

Because SUPPAE Depends on It

• AESEQ — never reuse EDC row / event numbers

• AEREFID (6,7,4,8,9) — source reference

• AESEQ (1–5) — derived, reproducible order

• same raw input → same AESEQ every rerun

• SUPPAE link: IDVAR='AESEQ' + IDVARVAL

• reshuffled AESEQ silently orphans SUPPAE rows

• no AE home → vertical SUPPAE (nab ACN/REL)

/* stable sort order (subject + start date + term) — merges stay reproducible */

proc sort data=ae out=ae_srt; by usubjid aestdtc aedecod; run;

data ae2; set ae_srt; aeseq = _n_; run;

Explain reproducible within-subject sequencing and the supplemental qualifier link that makes it non-negotiable. (Concept, L1/L2)

Speaker notes

Adverse Event Sequence Number (AESEQ) must be deterministic because SUPPAE, or Supplemental Qualifiers for Adverse Events, depends on it. Never reuse Electronic Data Capture (EDC) row or event numbers for AESEQ. In the delivered extract, AEREFID (6, 7, 4, 8, 9) is the source reference, while AESEQ (1-5) is the derived, reproducible sequence. SUPPAE rows link back through IDVAR equals AESEQ and IDVARVAL, so any rerun that reshuffles sequence numbers silently orphans the supplemental qualifiers attached to those records. For supplemental data, values with no adverse event home go vertical to SUPPAE, such as nab-paclitaxel-specific action taken and relationship beside the standard action taken and causality variables. A stable sort order on subject, start date, and term, then aeseq equals underscore n underscore after sorting, keeps downstream merges reproducible.

Checkpoint7 / 12

Checkpoint: Mapping Fundamentals

1 Which statement correctly describes the mapping rules for the Unique Subject Identifier (USUBJID) and the Reported Term for the Adverse Event (AETERM) in a Study Data Tabulation Model (SDTM) Adverse Event (AE) domain?

2 When creating the SDTM AE domain from coded safety data, which two statements correctly explain how to use the Medical Dictionary for Regulatory Activities (MedDRA) version for the Dictionary-Derived Term (AEDECOD)? Select two. (select all that apply, then Check)

3 A programmer is finalizing SDTM AE records and creating the Supplemental Qualifiers for Adverse Events (SUPPAE) dataset. Which three statements are consistent with SDTM mapping rules? (select all that apply, then Check)

Speaker notes

This checkpoint confirms your mastery of the core Study Data Tabulation Model (SDTM) Adverse Event (AE) mapping concepts before we apply them to real rows. Question 1 asks how the Unique Subject Identifier (USUBJID) and the Reported Term for the Adverse Event (AETERM) are mapped, and the correct answer is A. Option A is right because USUBJID must uniquely identify the subject in the study, while AETERM must remain the verbatim source term and not be changed into a coded or cleaned version. Question 2 asks how to use the Medical Dictionary for Regulatory Activities (MedDRA) version when creating the Dictionary-Derived Term (AEDECOD), and the correct answers are A and C. A and C are right because AEDECOD must come from the sponsor's official MedDRA coding deliverable using the exact MedDRA version that produced the code, and pinning that version prevents version drift across the clinical database, safety reports, the coding deliverable, SDTM, and downstream analyses. Question 3 asks which statements are consistent with SDTM AE mapping rules when finalizing records and creating the Supplemental Qualifiers for Adverse Events (SUPPAE), and the correct answers are A, B, and C. The AE sequence-number variable (AESEQ) must be assigned with a deterministic rule so each AE record has a stable sequence number and SUPPAE can use it as an identifier; record N when the source explicitly says No for a seriousness criterion but leave the variable blank when the criterion was not evaluated; and preserve partial date information in the adverse event start date/time (AESTDTC) without adding artificial day or month components.

Concept8 / 12

Walkthrough: Five Delivered AE Rows

Walkthrough: Five Delivered AE Rows

USUBJID 043-18101-74001-001 · SDTM.AE + SUPPAE

Reviewing delivered rows — not raw EDC source lines

AESEQAEREFIDEPOCHAESTDTCAEENDTCAEENRF
16SAFETY FOLLOW-UP2019-05-20ONGOING
27SAFETY FOLLOW-UP2019-05-20ONGOING
34TREATMENT2019-05-17ONGOING
48TREATMENT2019-05-17ONGOING
59TREATMENT2019-05-17ONGOING
Variable(s)Value origin
AETERMVerbatim
AEDECOD / AEBODSYSCoding deliverable
AESEV / AESER / AERELCT mapping
AEOUT / AEACNCT mapping
AESTDTC / AEENDTCCollected ISO 8601
AESEQ / AESTDYDerived
AEACNNP / AERELNPSupplemental

Focal row AESEQ=1: AETERM='ALT Increase' · AEDECOD='Alanine aminotransferase increased' · AESEV='MILD' · AESER='N' · AEREL='RELATED' · AESTDTC='2019-05-20' · AESTDY=13

Step through the actual delivered SDTM AE rows for subject 043-18101-74001-001, classifying the origin of each value. (Real-data walkthrough, L1)

Speaker notes

In this walkthrough, we review five delivered Adverse Events (AE) rows from the Study Data Tabulation Model (SDTM) domain and its Supplemental Qualifiers for Adverse Events (SUPPAE). These are delivered rows, not raw Electronic Data Capture (EDC) source lines. For the demo subject, the first two events are in the safety follow-up epoch starting 2019-05-20, while the next three are in the treatment epoch starting 2019-05-17. Look at the focal row, sequence number 1: the verbatim term is 'ALT Increase', the coded term is 'Alanine aminotransferase increased', severity is 'MILD', seriousness is 'N', and relationship is 'RELATED'—all Controlled Terminology (CT) mappings. Outcome is 'NOT RECOVERED/NOT RESOLVED', start study day is 13, and the end relative to reference is 'ONGOING' with the end date blank; classify values by origin: verbatim, coding, CT, collected International Organization for Standardization (ISO) 8601, derived, or supplemental.

Hands-on9 / 12

Hands-on: Route the SUPPAE Qualifiers

Hands-on interactive — if it does not load, open the paired article and try the exercise there.

Speaker notes

This segment is hands-on, so pause the video and open the exercise on the website at jaimeyan.com/learn. There you will practice routing each Supplemental Qualifiers for Adverse Events (SUPPAE) row to its correct parent adverse event (AE) row, matching qualifiers such as action taken and relationship to the right event term through the Adverse Event Sequence Number (AESEQ), and you will run straight into the classic identity trap where the Identifying Variable Value (IDVARVAL) is character while the parent AESEQ is numeric. Try it right after the video, and take the explicit conversion seriously, because that detail is exactly what the exercise is built to teach.

Concept10 / 12

Validate with CORE, Triage by Rule ID

Validate with CORE

Triage by Rule ID

RUN — Validate every rebuilt domain with CDISC CORE; free / open source, public YAML rules, one finding per row.

TRIAGE — Group findings by Rule ID; record a disposition on every one: fixed, or waived with a written reason.

CI LOG — Run CORE in CI per data drop; keep the triage log as a versioned, reviewer-accessible file beside the code.

BOUNDARY — Single-domain engine: a clean run covers only what its rules express; the same event in both AE and MH still needs eyeball QC.

L3 NOTE — Last verified 2026-08-30: agents may invent MedDRA terms or complete partial dates; join real coding source and diff every date string.

Describe running CDISC CORE on every build, triaging findings by rule ID with written dispositions, and the limits of single-domain validation. (Concept, L2/L3)

Speaker notes

Validate every rebuilt domain with the Clinical Data Interchange Standards Consortium (CDISC) Open Rules Engine, or CORE. CORE is free and open source, its rules are public YAML Ain't Markup Language files, and output gives one finding per row. Triage by Rule ID and record a disposition for every finding: fixed, or waived with a written reason, so a waiver ships with its justification. Run CORE in continuous integration per data drop, and keep triage log as a versioned, reviewer-accessible file beside the code. But a clean run covers what its rules express, so cross-domain contradictions, such as the same event in adverse event and medical history, need eyeball quality control listings. Finally, agents may invent Medical Dictionary for Regulatory Activities terms or complete partial dates, so join real coding source and diff every date string against collection.

Checkpoint11 / 12

Final Check: AE Domain Decisions

1 When building the SDTM.AE domain for a single reported adverse event, you combine the raw safety data, a MedDRA coding deliverable, and a decision-table mapping. Which statement correctly describes the role of AETERM and the source of the other vocabulary variables?

2 While programming the SDTM.AE domain, you encounter an AE with reported start date '2021' and no reported end date because the event is ongoing. Which statements follow CDISC SDTMIG and ADaM conventions? Select all that apply. (select all that apply, then Check)

3 During final QC of an AE pipeline, SDTM.AE has AESEQ assigned by sorting on USUBJID, AESTDTC, and AETERM, with no extra tie-breaker. AESEQ is numeric. SDTM.SUPPAE has IDVAR='AESEQ' and IDVARVAL populated as left-aligned character strings. One AE in a subject is AESER='Y', another AE in the same subject is explicitly AESER='N', and a third AE has AESER='' (blank). After running CORE rules, no errors are reported. Write a short QC comment that covers the following: (a) what is wrong with the AESEQ creation strategy and how to merge AE to SUPPAE without falling into the character-versus-numeric IDVARVAL trap; (b) why blank AESER cannot be treated as AESER='N' when deriving an ADAE serious-event flag; and (c) why a clean CORE run is not enough to rule out cross-domain contradictions between the AESER='Y' record and other submission data. (reflect, then reveal)

Reveal analysis
A deterministic AESEQ must avoid non-unique or unstable sort keys. Sorting on USUBJID, AESTDTC, and AETERM is not sufficient when duplicates exist for the same subject, especially with partial or missing start dates. Add a unique raw record identifier as the final sort key. When merging AE and SUPPAE, convert AE.AESEQ to a trimmed character variable using strip(put(AESEQ,best.)) and merge by USUBJID and that character key, after restricting SUPPAE to IDVAR='AESEQ'. A blank AESER is not a controlled 'N' value. 'N' means the AE is explicitly not serious, whereas blank may mean the assessment is missing or unknown. Deriving a serious-event flag as 'Y' versus not 'Y' would silently convert blank to no and can create false negatives. CORE rules can validate code lists, date formats, uniqueness of AESEQ, and the presence of required variables. However, a successful CORE run does not prove that every AESER='Y' record is clinically supported by, or consistent with, other source data and domains; cross-domain contradictions are semantic and require manual or targeted SAS review.
Speaker notes

This checkpoint covers three Study Data Tabulation Model (SDTM) Adverse Events (AE) mapping decisions. For the single-choice question, when you combine raw safety data, a Medical Dictionary for Regulatory Activities (MedDRA) coding deliverable, and a decision-table mapping to build the SDTM.AE domain, the correct answer is B: keep the Adverse Event Reported Term (AETERM) exactly as reported, take the Adverse Event Decoded Term (AEDECOD) from the coding deliverable, and often set the Adverse Event Body System or Organ Class (AEBODSYS) from the dictionary hierarchy or decision-table mapping. That preserves traceability because neither the coding deliverable nor the decision table should rewrite the verbatim term. For the multiple-select question about an ongoing AE with reported start date '2021' and no end date, the correct answers are A and C: the SDTM.AE domain can store the Adverse Event Start Date/Time (AESTDTC) as the International Organization for Standardization (ISO) 8601 partial date '2021', and the Analysis Data Model (ADaM) layer is where imputed analysis dates and their flags, such as Analysis Start Date (ASTDT) and Analysis Start Date Imputation Flag (ASTDTF), belong. Partial dates stay as reported in SDTM for traceability, imputation belongs in ADaM, and the Adverse Event End Date/Time (AEENDTC) should remain unpopulated for an ongoing event rather than forced to an arbitrary far date. For the short-answer question, the model answer is that the Adverse Event Sequence Number (AESEQ) must be made deterministic by adding a unique raw record identifier as the final sort key, and the AE-to-Supplemental Qualifiers for Adverse Events (SUPPAE) merge must convert numeric AESEQ to trimmed character—for example with strip(put(AESEQ,best.))—before matching on the unique subject identifier and the Identifying Variable Value (IDVARVAL), because blank Adverse Event Seriousness (AESER) cannot be treated as AESER='N' when deriving an analysis serious-event flag, and a clean Clinical Data Interchange Standards Consortium (CDISC) Open Rules Engine (CORE) run only confirms structural conformance, not cross-domain contradictions such as an AESER='Y' record lacking consistent supporting data elsewhere.

Concept12 / 12

From Extract to a Reviewable AE Domain

From Extract to a Reviewable AE Domain

1 · AETERM / AEDECOD

• AETERM stays verbatim

• AEDECOD from pinned MedDRA

• Never guess a pending code

2 · AESEV / AESER

• Map via decision tables

• Seriousness stays blank

• Never default severity to N

3 · Dates / AESEQ

• Ship --DTC as collected

• Include partial dates

• AESEQ stable for SUPPAE links

4 · SUPPAE / QC

• No SDTM home → SUPPAE

• CORE validation per build

• Log disposition of findings

Source article: /blog/sdtm-ae-domain-mapping-example.html

Previous: SDTM domain basics

Next: How to write an SDTM mapping specification

All values trace to raw · AE · SUPPAE extracts + SAS snippets

No patient data invented · material gaps flagged

Summary slide that consolidates the mapping rules, points back to the source article, and is explicit about what the provided materials can and cannot support. (Summary, L1/L2/L3)

Speaker notes

Keep the Adverse Event Term, or AETERM, verbatim, and get the Adverse Event Dictionary-Derived Term, or AEDECOD, only from a version-pinned Medical Dictionary for Regulatory Activities, or MedDRA, deliverable; never guess a pending code. Map Adverse Event Severity, or AESEV, and Adverse Event Seriousness, or AESER, through decision tables; leave seriousness criteria blank unless checked, and never default to N. Ship date/time variables exactly as collected, partials included, and the Adverse Event Sequence Number, or AESEQ, is deterministic because Supplemental Adverse Events, or SUPPAE, links depend on it. Route collected values with no Study Data Tabulation Model, or SDTM, home to SUPPAE, validate with the standard rules engine per build, and record a disposition for every finding. For further reading, see the source article plus the previous and next pieces; all values trace to the provided extracts, with no patient data invented and material gaps flagged.

✓

Lesson complete

Nice work — every scene seen. Keep the momentum going.

← → Space to navigate · progress is saved locally in your browser

AI Tutor

Ask the tutor