Review ask

As a clinical trial statistician or programmer, answer three short questions in Your review: the task, the inputs and outputs, and the AI-assisted review. Agreeing with all three approves this benchmark; disagreeing with any needs a comment. Propose a fix with the Edit button on any source file, or add it to your comments.

We suggest spending no more than 5 minutes on a review. The other tabs beside Your review are background for assessment, not under review.

Summary

Lifecycle: draftEditUnder review
What this benchmark means
README.md

Public entries: Python and R. Passing coverage requires an installed inventory.

Goal: create a trial summary (TS) record for each protocol parameter, with its value (TSVAL), controlled term code (TSVALCD) and reference terminology (TSVCDREF).

Input: a protocol-authoring system export, with a study identifier, trial title, phase, randomization decision and planned enrollment.

Variables:

  • TSSEQ orders the parameters: title, phase, randomization, then planned enrollment.
  • TSPARMCD and TSPARM identify and name each parameter.
  • TSVAL holds the protocol title, the standard phase term, Y for a randomized trial or N otherwise, or the planned enrollment as text.
  • TSVALCD holds the NCI concept code for phase and randomization; it is empty for the title and planned enrollment.
  • TSVCDREF is CDISC for those controlled terms and empty for uncoded values.

Note: a missing protocol parameter stops the run. Each value fits in one trial summary record.

Inputs

Under review
1 source file

input/protocol.csv

Edit
1 row
input/protocol.csv
StudyTitlePhaseRandomizedPlannedSubjects
PK201A randomized phase II study of ZX-201Phase 2Yes48

Expected output

Under review
4 expected rows

expected/ts.csv

Edit
4 rows
expected/ts.csv
DOMAINSTUDYIDTSSEQTSPARMCDTSPARMTSVALTSVALCDTSVCDREF
TSPK2011TITLETrial TitleA randomized phase II study of ZX-201——
TSPK2012TPHASETrial Phase ClassificationPHASE II TRIALC15601CDISC
TSPK2013RANDOMTrial is RandomizedYC49488CDISC
TSPK2014PLANSUBPlanned Number of Subjects48——
Shaded columns are derived— = missing value

Human review and assessment

Your review

3 questions and your comments · View benchmark discussions

Mapping spec

Generated from the benchmark YAML; do not edit by hand

Variable NameVariable LabelTypeLengthControlled Terms or FormatOriginCoreConversion DefinitionVariable TypeVariable OrderComments for Define
DOMAINDomain AbbreviationCharAssignedSet constant value "TS".SDTM1
STUDYIDStudy IdentifierCharCollectedCopy value from PROTOCOL.Study.SDTM2
TSSEQSequence NumberNumDerivedSet per constructed row; see the Row construction sheet.SDTM3
TSPARMCDTrial Summary Parameter Short NameCharDerivedSet per constructed row; see the Row construction sheet.SDTM4
TSPARMTrial Summary Parameter NameCharDerivedSet per constructed row; see the Row construction sheet.SDTM5
TSVALParameter ValueCharDerivedSet per constructed row; see the Row construction sheet.SDTM6
TSVALCDParameter Value CodeCharDerivedSet per constructed row; see the Row construction sheet.SDTM7
TSVCDREFName of the Reference TerminologyCharDerivedSet per constructed row; see the Row construction sheet.SDTM8
TemplateInclude whenTSSEQTSPARMCDTSPARMTSVALTSVALCDTSVCDREF
titleConstant "1"Constant "TITLE"Constant "Trial Title"Copy PROTOCOL.TitleConstant "None"Constant "None"
phaseConstant "2"Constant "TPHASE"Constant "Trial Phase Classification"Recode PROTOCOL.Phase: "Phase 2" → "PHASE II TRIAL"; missing values stay missing; unlisted values are errorsRecode PROTOCOL.Phase: "Phase 2" → "C15601"; missing values stay missing; unlisted values are errorsConstant "CDISC"
randomizedConstant "3"Constant "RANDOM"Constant "Trial is Randomized"Recode PROTOCOL.Randomized: "Yes" → "Y", "No" → "N"; missing values stay missing; unlisted values are errorsRecode PROTOCOL.Randomized: "Yes" → "C49488", "No" → "C49487"; missing values stay missing; unlisted values are errorsConstant "CDISC"
planned-enrollmentConstant "4"Constant "PLANSUB"Constant "Planned Number of Subjects"Copy PROTOCOL.PlannedSubjectsConstant "None"Constant "None"
VersionDateAuthorDescriptionReviewerSign-off
1.72026-10-20yamaa docs buildRead a specification in the 1.0 surface as its 0.5 counterpart; state that missing values stay missing where a mapping declares no missing handler, and leave out a declared missing answer that restates a handler's default
1.62026-10-17yamaa docs buildDescribe collected date parts written as ISO 8601 date text and times of day counted in seconds since midnight
1.52026-10-17yamaa docs buildName collected precision in words instead of letter codes; state imputation fallbacks, minimum source precision, bounds ignored outside the collected period, and invalid text with no handler as an error; describe date and datetime shifts, imputation flag codes, and partial text giving no date part
1.42026-10-15yamaa docs buildState datetime precision codes through the hour and minute, and complete only the time parts a collected datetime lacks
1.32026-09-29yamaa docs buildShow study codelist names, external dictionaries, and ISO 8601 formats in variable rows; list the document's codelist values and metadata
1.22026-09-29yamaa docs buildClassify ADaM copies from a declared input as Predecessor and recodes as Derived, and SDTM recodes of locally derived columns as Derived
1.12026-09-29yamaa docs buildResolve lookups into the donor record they select, and give every derivation shape a plain-language rule instead of its raw YAML
1.0yamaa docs buildInitial generation from spec.yaml

Agent prompt

The request an agent receives with the input files; each tier states no more than the one above

prompts/sdtm-ts-trial-summary/full.md

Edit
23 lines

Following CDISC SDTM standards, use the provided PROTOCOL dataset to create a TS dataset with one record per protocol parameter per study.

The output dataset should contain the following columns in this order: DOMAIN, STUDYID, TSSEQ, TSPARMCD, TSPARM, TSVAL, TSVALCD, TSVCDREF

DOMAIN is "TS", and STUDYID is the protocol Study identifier. For title, TSSEQ is 1, TSPARMCD is "TITLE", TSPARM is "Trial Title", and TSVAL is the protocol Title. For phase, TSSEQ is 2, TSPARMCD is "TPHASE", and TSPARM is "Trial Phase Classification"; Phase "Phase 2" has TSVAL "PHASE II TRIAL" and TSVALCD "C15601". For randomization, TSSEQ is 3, TSPARMCD is "RANDOM", and TSPARM is "Trial is Randomized"; Randomized "Yes" has TSVAL "Y" and TSVALCD "C49488". For planned enrollment, TSSEQ is 4, TSPARMCD is "PLANSUB", and TSPARM is "Planned Number of Subjects"; TSVAL is PlannedSubjects as integer text with no decimal point. TSVCDREF is "CDISC" for phase and randomization. For title and planned enrollment, TSVALCD has no value, and TSVCDREF has no value.

Read the source datasets from /app/input and save the completed dataset as /app/output/ts.csv.

prompts/sdtm-ts-trial-summary/conventions.md

Edit
15 lines

Following CDISC SDTM standards, use the provided PROTOCOL dataset to create a TS dataset with one record per protocol parameter per study.

The output dataset should contain the following columns in this order: DOMAIN, STUDYID, TSSEQ, TSPARMCD, TSPARM, TSVAL, TSVALCD, TSVCDREF

DOMAIN is "TS". TSPARMCD and TSPARM are "TITLE" and "Trial Title", "TPHASE" and "Trial Phase Classification", "RANDOM" and "Trial is Randomized", or "PLANSUB" and "Planned Number of Subjects". TSVALCD is "C15601" for "PHASE II TRIAL", "C49488" for "Y", or has no value. TSVCDREF is "CDISC" or has no value. For planned enrollment, TSVAL is integer text with no decimal point.

Read the source datasets from /app/input and save the completed dataset as /app/output/ts.csv.

prompts/sdtm-ts-trial-summary/brief.md

Edit
8 lines

Following CDISC SDTM standards, use the provided PROTOCOL dataset to create a TS dataset with one record per protocol parameter per study.

The output dataset should contain the following columns in this order: DOMAIN, STUDYID, TSSEQ, TSPARMCD, TSPARM, TSVAL, TSVALCD, TSVCDREF

Read the source datasets from /app/input and save the completed dataset as /app/output/ts.csv.

yamaa code

Public calls generated from benchmark.yaml; results must match the expected output

R

Edit
3 lines
library(yamaa)yamaa_spec("spec.yaml")$run()$output

Python

Edit
3 lines
import yamaayamaa.spec("spec.yaml").run().output

Solution without yamaa

Written from the full prompt and the inputs alone; CI checks it reproduces the expected output

solutions/sdtm-ts-trial-summary/result.R

Edit
23 lines
protocol <- read.csv("/app/input/protocol.csv", stringsAsFactors = FALSE, check.names = FALSE)rows <- lapply(seq_len(nrow(protocol)), function(i) {  p <- protocol[i, ]  data.frame(    DOMAIN = rep("TS", 4),    STUDYID = rep(p$Study, 4),    TSSEQ = 1:4,    TSPARMCD = c("TITLE", "TPHASE", "RANDOM", "PLANSUB"),    TSPARM = c("Trial Title", "Trial Phase Classification", "Trial is Randomized", "Planned Number of Subjects"),    TSVAL = c(p$Title,              if (p$Phase == "Phase 2") "PHASE II TRIAL" else NA_character_,              if (p$Randomized == "Yes") "Y" else NA_character_,              as.character(as.integer(p$PlannedSubjects))),    TSVALCD = c(NA_character_, if (p$Phase == "Phase 2") "C15601" else NA_character_,                if (p$Randomized == "Yes") "C49488" else NA_character_, NA_character_),    TSVCDREF = c(NA_character_, "CDISC", "CDISC", NA_character_),    stringsAsFactors = FALSE  )})ts <- do.call(rbind, rows)write.csv(ts, "/app/output/ts.csv", row.names = FALSE, na = "")stopifnot(identical(names(ts), c("DOMAIN", "STUDYID", "TSSEQ", "TSPARMCD", "TSPARM", "TSVAL", "TSVALCD", "TSVCDREF")),          nrow(ts) == 4L * nrow(protocol))

solutions/sdtm-ts-trial-summary/result.py

Edit
41 lines
import csvfrom decimal import Decimalfrom pathlib import Pathinput_dir = Path("/app/input")output_dir = Path("/app/output")output_dir.mkdir(exist_ok=True)columns = [    "DOMAIN",    "STUDYID",    "TSSEQ",    "TSPARMCD",    "TSPARM",    "TSVAL",    "TSVALCD",    "TSVCDREF",]with (input_dir / "protocol.csv").open(newline="", encoding="utf-8-sig") as source:    protocols = list(csv.DictReader(source))rows = []for protocol in protocols:    study = protocol["Study"]    phase_value, phase_code = {"Phase 2": ("PHASE II TRIAL", "C15601")}[        protocol["Phase"]    ]    random_value, random_code = {"Yes": ("Y", "C49488")}[protocol["Randomized"]]    planned = Decimal(protocol["PlannedSubjects"])    if planned != planned.to_integral_value():        raise ValueError("PlannedSubjects must be an integer")    parameters = [        (1, "TITLE", "Trial Title", protocol["Title"], "", ""),        (2, "TPHASE", "Trial Phase Classification", phase_value, phase_code, "CDISC"),        (3, "RANDOM", "Trial is Randomized", random_value, random_code, "CDISC"),        (4, "PLANSUB", "Planned Number of Subjects", str(int(planned)), "", ""),    ]    for parameter in parameters:        rows.append(["TS", study, *parameter])with (output_dir / "ts.csv").open("w", newline="", encoding="utf-8") as target:    writer = csv.writer(target)    writer.writerow(columns)    writer.writerows(rows)

solutions/sdtm-ts-trial-summary/result.sas

Edit
46 lines
proc import datafile='/app/input/protocol.csv' out=protocol dbms=csv replace;  getnames=yes;run;data ts;  length DOMAIN $2 STUDYID $200 TSSEQ 8 TSPARMCD $8 TSPARM $40 TSVAL $1000 TSVALCD $20 TSVCDREF $20;  set protocol;  DOMAIN='TS';  STUDYID=Study;  TSSEQ=1;  TSPARMCD='TITLE';  TSPARM='Trial Title';  TSVAL=Title;  TSVALCD='';  TSVCDREF='';  output;  TSSEQ=2;  TSPARMCD='TPHASE';  TSPARM='Trial Phase Classification';  if Phase='Phase 2' then do;    TSVAL='PHASE II TRIAL';    TSVALCD='C15601';  end;  TSVCDREF='CDISC';  output;  TSSEQ=3;  TSPARMCD='RANDOM';  TSPARM='Trial is Randomized';  if Randomized='Yes' then do;    TSVAL='Y';    TSVALCD='C49488';  end;  TSVCDREF='CDISC';  output;  TSSEQ=4;  TSPARMCD='PLANSUB';  TSPARM='Planned Number of Subjects';  TSVAL=strip(put(PlannedSubjects, 12.));  TSVALCD='';  TSVCDREF='';  output;  keep DOMAIN STUDYID TSSEQ TSPARMCD TSPARM TSVAL TSVALCD TSVCDREF;run;proc export data=ts outfile='/app/output/ts.csv' dbms=csv replace;run;