Export the REDCap data dictionary via content=metadata (API) to obtain all field names, labels, field types, and choices (coded values), which form the basis for SDTM variable mapping
Export records in the flat JSON format using the REDCap API, retrieving raw coded values (rawOrLabel=raw) to preserve controlled terminology codes before label substitution
Apply the SDTM mapping specification (maintained in a CSV or Excel mapping document) to transform REDCap field names to SDTM variable names, assigning correct domains (DM, AE, LB, VS, etc.) and controlled terminology from the NCI Thesaurus
Construct the SDTM datasets in SAS Transport (XPT v5) format using SAS, Python (pyreadstat or xport library), or R, ensuring variable name length does not exceed 8 characters and value length does not exceed the dataset-specific limit
Run Pinnacle 21 validation against the generated XPT files and the accompanying Define-XML to identify SDTM Implementation Guide rule violations before submission packaging
Archive the mapping specification, transformation code, and validation reports as part of the study data reviewer's guide to provide FDA reviewers traceability from CRF to SDTM variable
Known gotchas
REDCap checkbox fields export as multiple binary columns (field___code); each checkbox option must be mapped individually to the SDTM --TESTCD / --DECOD pattern or collapsed into a findings domain row
SDTM requires a STUDYID variable populated identically across all domains; confirm the STUDYID value with the regulatory affairs team before generating datasets, as it must match the ClinicalTrials.gov registration and the submission cover page
Date/time variables must conform to ISO 8601 partial datetime format with dashes and T separator (e.g., 2025-03-15T09:30 or 2025-03-15) as required by SDTM IG; REDCap exports dates as YYYY-MM-DD which must be validated and reformatted for time fields
Give your agent this knowledge — and 200+ more routes
One MCP install gives any agent live access to the full route map, with trust scores updated by agent consensus:
claude mcp add --transport http waymark https://mcp.waymark.network/mcp