admiral-adsl

Generates QC-ready R code deriving ADaM ADSL datasets from SDTM domains using admiral.

13|6|Updated Aug 9, 2026
One-click install
npx skills add https://github.com/kaipingyang/CDISC_training --skill admiral-adsl-kaipingyang
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: admiral-adsl
Source: https://github.com/kaipingyang/CDISC_training/tree/main/.claude/skills/admiral/admiral-adsl
Command: npx skills add https://github.com/kaipingyang/CDISC_training --skill admiral-adsl-kaipingyang

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires admiral, dplyr, lubridate, metacore, xportr, pharmaversesdtm, pharmaverseadam, and includes references (resource) components.

What problem does it solve? Deriving a CDISC-conformant ADSL dataset requires deep knowledge of admiral function selection, ADaMIG conventions, and protocol-specific decisions. This Skill encodes that expertise so an AI agent can generate audit-traceable, QC-ready R code from SDTM inputs and an ADaM specification. ## Core Features & Use Cases - Step-by-step ADSL workflow: Covers treatment dates, planned/actual treatment, disposition, baseline demographics, and population flags (SAFFL, ITTFL, PPROTFL) using idiomatic admiral functions like derive_vars_merged() and derive_vars_dt(). - CDISC convention enforcement: Applies flag conventions ("Y"/NA never "N"), date imputation rules, study day calculation, and one-record-per-subject assertions. - Human review annotations: Inserts # REVIEW: comments at every protocol-specific decision point so statisticians can verify population flag definitions and cut-points. - Use Case: A clinical programmer needs ADSL for a two-arm study. Provide DM, EX, DS from pharmaversesdtm plus the ADaM spec, and the agent generates sectioned R code with assertions, imputation flags, and xportr-based attribute application. ## Quick Start Ask the agent to derive an ADSL dataset from the DM, EX, and DS SDTM domains using admiral, following the study's ADaM specification for population flags and age groupings.

Frequently Asked Questions about admiral-adsl

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I derive an ADSL dataset in R with admiral?

Start from DM as the subject spine, then use derive_vars_merged() to pull treatment dates from EX and disposition from DS, derive_vars_dt() for date conversions, and derive_var_merged_exist_flag() for SAFFL. Finish with stopifnot() checks for one record per USUBJID and apply attributes via xportr.

What SDTM domains are required for ADSL derivation?

DM, EX, and DS are required: DM provides the subject spine, EX provides treatment dates and the safety flag basis, and DS provides end-of-study status and discontinuation reasons. DV, MH, and VS are optional depending on whether PPROTFL, medical history flags, or baseline vitals are in scope.

Why should population flags use Y and NA instead of Y and N?

CDISC ADaM convention requires flag variables to be "Y" or NA, never "N". This applies to all population flags like SAFFL and ITTFL as well as baseline flags. Using "N" violates the ADaMIG and is a common regulatory reviewer finding.

How does admiral handle partial SDTM dates in ADSL?

Use derive_vars_dt() or derive_vars_dtm() with date_imputation set to "first" for start dates and "last" for end dates, plus flag_imputation = "auto" to retain traceability flags. Never call as.Date() directly on --DTC variables, as partial dates silently return NA.

What are the limitations of this ADSL derivation approach?

It covers standard ADSL for parallel-group and simple crossover studies only. Non-ADSL datasets, SAS implementations, therapeutic-area extensions like admiralonco, complex multi-period crossovers, and integrated analyses across studies are out of scope.