sdtm to adam workflow · clinical trial tfl programming
Automating the SDTM-to-ADaM-to-TFL Pipeline in Clinical Trials
December 3, 2026
8 min read
Trace a safety table from SDTM to ADaM, choose R tools for each handoff, and assess AI-generated code and FDA electronic-record controls.

- 01For each treatment group, count each safety-population participant with a qualifying event once. Take the denominator from all safety-population participants in that group in ADSL, including those without events.
- 02Choose automation by handoff. Reuse SDTM mapping functions, match ADaM derivations to the study plan, and keep table formatting separate from computed results.
- 03Review generated derivations against approved rules and test them on data with known results. When testing independence, introduce reference outputs only when comparing the finished result.
- 04Confirm the FDA standards and versions that apply to the submission. Assess each record under Part 11 using the underlying FDA requirement and how the record is used and maintained. Validate electronic systems in clinical investigations based on intended use and the importance of the data.
- 05Start with one consequential display. Retain the exact input snapshot, approved rules, program and package versions, and run instructions. Ask a second programmer to regenerate it and explain one numerator, its denominator, and one excluded record.
A clinical trial safety table might report the percentage of participants who experienced an adverse event after treatment began. A program can reproduce that percentage to the last decimal place and still give the wrong answer. If a participant had three qualifying events, does the numerator count one person or three events? If the denominator comes from the event dataset, what happened to participants who experienced no events?
Those questions define the work of automating a clinical reporting pipeline. The Study Data Tabulation Model (SDTM) organizes observations. The Analysis Data Model (ADaM) represents the data and derivations needed for a particular analysis. Tables, figures, and listings (TFLs) present the results. SDTM and ADaM are CDISC standards. A TFL is a study output whose content depends on the analysis plan and the question being answered. CDISC SDTM and CDISC ADaM.
Follow a safety table back to its inputs
Suppose a statistical analysis plan calls for a table of participants with at least one treatment-emergent adverse event, grouped by treatment received. The following example illustrates how the team could implement that specification. The actual study plan determines the population, time window, and treatment-emergence rules.
| Handoff | What the program does | What to verify |
|---|---|---|
| Collected data to SDTM | Maps adverse event records into the AE domain and exposure records into EX. Preserves participant identifiers, timing information, and the distinction between separate events. | Reconcile events to the source extract. Identify incomplete dates and check that the mapping preserves their original precision. |
| SDTM to ADaM | Builds the subject-level analysis dataset (ADSL) with the safety population and treatment group. Builds an adverse event analysis dataset (ADAE) with the information needed to classify events. | Trace selected classifications back to the event and treatment records. Check the analysis plan's handling of incomplete dates, events around the first dose, and pre-existing events that worsen. |
| ADaM to table | For each treatment group, counts each safety-population participant with at least one qualifying event once in the numerator. Takes the denominator from all safety-population participants in that group in ADSL, including those with no event. | Reconcile counts before rounding percentages. Check a participant with repeated events and one without events. Confirm the heading says “participants” and the footnote identifies the population and counting rule. |
A useful review works backward from one cell. Identify the participants in its numerator, inspect their qualifying event records, and follow the flags to the source observations and derivation rules. Then reconstruct the denominator separately. If a participant has events in two categories, they can appear in both category rows while contributing only once to the overall total. Adding category counts would give the wrong overall figure.
Define-XML carries metadata about the submitted datasets, variables, terminology, and origins. Generating it from the same approved specifications used by the programs can reduce transcription work. Compare the metadata against the delivered data. A late code change can leave the metadata describing an earlier derivation. CDISC Define-XML.
Lower end of the variable-level match rates reported by Merck researchers in a public benchmark covering five ADaM datasets
Upper end of the variable-level match rates reported by Merck researchers in a public benchmark covering five ADaM datasets
Map adverse events to AE and exposure records to EX. Preserve participant identifiers, timing, and the distinction between separate events.
Build ADSL with the safety population and treatment group. Build ADAE with the information needed to classify events.
For each treatment group, count each safety-population participant with a qualifying event once. Use all safety-population participants in that group in ADSL as the denominator.
Reconcile counts before rounding percentages. Check a participant with repeated events and one without events.
“Successful regeneration demonstrates reproducibility. The explanation tests whether the pipeline answered the study question.
Choose automation for a specific handoff
Mapping to SDTM. The pharmaverse R package sdtm.oak implements reusable mapping functions. Programmers supply source datasets and variables and select the applicable algorithm. The maintainers identify sponsor-specific handling of lab metadata, unit conversions, and coding as areas that may need separate logic. A mapping specification should record those choices alongside the inputs so a later extract can be processed consistently. sdtm.oak documentation.
Deriving ADaM. The admiral package provides modular R functions for creating analysis datasets. A team can reuse a derivation across studies when its assumptions match the study plan. For a rule such as assigning baseline, specify which observations are eligible and how to break a tie before selecting the function. Build a small example where changing the tie rule changes the result. That example can expose an incorrect implementation even when the full dataset passes structural checks. admiral project documentation.
Producing displays. A table shell defines headings, row groups, footnotes, and display precision. Keeping this formatting distinct from the computed counts and estimates lets a reviewer inspect both. GSK's open-source tfrmt package applies display metadata to analysis results and supports mock tables before results are available. The same results can then be compared before and after a formatting change. tfrmt documentation.
A team can adopt these pieces incrementally. In a presentation on an FDA submission, Novo Nordisk programmers described using R for the displays and selected ADaM datasets. They explained that statistical analyses still ran in SAS and supplied results that the R programs displayed. For a public example that can be inspected, the R Consortium's Pilot 3 includes R scripts for generating ADaM datasets and displays, instructions for reviewers, and a specified package environment. The working group reports that FDA staff reproduced the pilot results. Novo Nordisk presentation and transcript and R Consortium Pilot 3 review.
What AI-assisted programming has demonstrated
Retrieving an answer for a programmer and generating code that changes an analysis carry different consequences. Roche's OCEAN Assistant retrieves relevant internal material to answer questions about its clinical programming environment. A programmer can check a suggested answer against the cited documentation. Test a generated derivation on data for which the expected result is known. Roche's PHUSE paper on OCEAN Assistant.
In a 2026 proof of concept, Takeda researchers used Claude through Amazon Bedrock to review ADaM specifications and draft SAS code. They reported generating initial programs for ADSL and ADAE using public pilot materials. A programmer can review each generated derivation alongside the approved rule. If the specification leaves a treatment-emergence decision unresolved, a statistically plausible choice in the draft is still a decision for the study team. Takeda authors' PharmaSUG paper.
A separate experiment by Merck researchers shows what can go wrong with automated quality control. In a public benchmark covering five ADaM datasets, they reported variable-level match rates of 97.1% to 100%. Their code review also found that one generated program read the reference ADSL dataset to infer how to group sites. That particular match could therefore say little about whether a second implementation derived the grouping independently. In a review designed to test independence, give the derivation program the specification and permitted source inputs. Introduce reference outputs only when comparing the finished result. Merck authors' PharmaSUG paper.
- Roche's OCEAN Assistant retrieves internal material to answer questions about its clinical programming environment.
- Check the suggested answer against the documentation it cites.
- Takeda researchers used Claude through Amazon Bedrock to review ADaM specifications and draft SAS code.
- Review each generated derivation against the approved rule.
- Merck researchers found a generated program that used the reference ADSL dataset to infer how to group sites.
Which U.S. regulatory controls apply?
For a drug or biologic submission, check the applicable FDA Data Standards Catalog entry and Study Data Technical Conformance Guide for the center, submission type, and study start date. Identify the accepted versions before configuring generators and conformance checks. A CDISC implementation guide describes a standard. FDA identifies the standards and versions applicable to a particular submission. FDA study data standards resources.
For 21 CFR Part 11, identify each record and the underlying FDA requirement, often called a predicate rule. Consider records submitted electronically under predicate rules, records kept electronically in place of required paper records, and electronic records relied on for regulated activities when a paper copy also exists. FDA's scope guidance specifically addresses an intermediate record used to generate a submission. If the record itself is not submitted, using it to prepare the submission does not by itself make it a Part 11 record. The relevant questions are whether a predicate rule requires retention and whether the record is maintained electronically. The fact that a model wrote a draft SAS or R program does not resolve those questions. Document which records are in scope and why. FDA Part 11 scope guidance, section III.B.
System assurance is a separate question. FDA's final guidance on electronic systems in clinical investigations recommends a risk-based approach to validation informed by intended use and the importance of the data. A formatting tool that changes a page break and a derivation that selects participants for the primary analysis have different failure consequences. FDA's February 2026 Computer Software Assurance for Production and Quality Management System Software supersedes the September 2025 edition and addresses medical-device production and quality management systems. It does not establish a general validation framework for drug-submission programming. FDA clinical investigations Q&A, question 7 and FDA medical-device software assurance guidance.
For a first implementation, choose one consequential display and retain the exact input snapshot, approved rules, program and package versions, and run instructions. Ask a second programmer to regenerate it and independently explain one numerator, its denominator, and one excluded record. Successful regeneration demonstrates reproducibility. The explanation tests whether the pipeline answered the study question.
About IntuitionLabs
Build practical AI for pharma and biotech with IntuitionLabs. We help life-science teams turn complex information and workflows into useful software, governed knowledge systems and AI tools.
IntuitionLabs is an AI consulting, custom software development and data engineering firm serving pharmaceutical, biotechnology, medical-device and other life-science organizations. We work with clinical, regulatory, medical-affairs, commercial, quality and IT teams to connect technology decisions with the work people need to accomplish.
AI consulting and adoption
Our AI enablement services cover readiness assessments, use-case selection, governance and policies, team workshops, adoption measurement and ongoing advisory support. We help organizations structure the information layer behind AI: source material, context, permissions and maintained knowledge that make generated answers useful and reviewable. Private LLM inference and hosted AI options support teams evaluating how to operate AI with appropriate control over their data and infrastructure.
Software, data and life-science workflows
IntuitionLabs develops custom software for pharma and biotech, integrates enterprise systems, and builds data engineering and business intelligence solutions. Areas of focus include AI agents, regulatory research, medical writing, medical affairs, CMC information, competitive intelligence and clinical-document workflows. Our eTMF intelligence work includes cross-system reconciliation and inspection-readiness support.
Enterprise platforms and regulated delivery
We provide Veeva services, application support, managed services, integrations and custom applications, alongside enterprise content work involving platforms such as Egnyte. For regulated workflows, our services include GxP enablement, computer-system validation and software development addressing 21 CFR Part 11 requirements. The applicable controls, validation responsibilities and acceptance criteria are defined for each engagement.
Work with IntuitionLabs
Explore AI enablement, pharma and biotech software development, data engineering and BI, and Veeva services. Contact IntuitionLabs to discuss your workflow, information sources and implementation needs.
IntuitionLabs publishes educational research to help life-science teams make informed technology decisions. Coverage of a product or organization does not imply a client relationship, endorsement or partnership.

Need Expert Guidance on This Topic?
Let's discuss how IntuitionLabs can help you navigate the challenges covered in this article.
I'm Adrien Laurent, Founder & CEO of IntuitionLabs. With 25+ years of experience in enterprise software development, I specialize in creating custom AI solutions for the pharmaceutical and life science industries.
The information contained in this document is provided for educational and informational purposes only. We make no representations or warranties of any kind, express or implied, about the completeness, accuracy, reliability, suitability, or availability of the information contained herein. Any reliance you place on such information is strictly at your own risk. In no event will IntuitionLabs.ai or its representatives be liable for any loss or damage including without limitation, indirect or consequential loss or damage, or any loss or damage whatsoever arising from the use of information presented in this document. This document may contain content generated with the assistance of artificial intelligence technologies. AI-generated content may contain errors, omissions, or inaccuracies. Readers are advised to independently verify any critical information before acting upon it. All product names, logos, brands, trademarks, and registered trademarks mentioned in this document are the property of their respective owners. All company, product, and service names used in this document are for identification purposes only. Use of these names, logos, trademarks, and brands does not imply endorsement by the respective trademark holders. IntuitionLabs.ai is an AI software development company specializing in helping life-science companies implement and leverage artificial intelligence solutions. Founded in 2023 by Adrien Laurent and based in San Jose, California. This document does not constitute professional or legal advice. For specific guidance related to your business needs, please consult with appropriate qualified professionals.