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: turn noncompartmental analysis estimates into pharmacokinetic parameter (PP) records, with standard parameter codes and names.

Input: a noncompartmental analysis software export with subject, analyte, software parameter name, estimate, unit and reference dose time. The estimates have already been calculated from plasma concentrations.

Variables:

  • PPSEQ numbers parameters within each subject by reference dose time, analyte and standard parameter code.
  • PPTESTCD identifies the software's Cmax, Tmax and AUClast as CMAX, TMAX and AUCLST; it is missing when the parameter is absent.
  • PPTEST names those parameters as Max Conc, Time of CMAX Observation and AUC to Last Nonzero Conc; it is missing when the parameter code is absent.
  • PPCAT carries the analyte name, or is missing when none is supplied.
  • PPORRES retains the estimate as text, including its reported decimal places; it is missing when the estimate is absent.
  • PPORRESU retains the analysis unit supplied for that estimate, without assigning a unit from the parameter code. It is missing when the unit is absent, independently of whether an estimate is supplied.
  • PPSTRESC retains the estimate as text with its reported decimal places; it is missing when the estimate is absent, regardless of the unit.
  • PPSTRESN holds the estimate as a number; it is missing when the estimate is absent, regardless of the unit.
  • PPSTRESU retains the supplied analysis unit without conversion; it is missing when the unit is absent, regardless of the estimate.
  • PPSPEC is always PLASMA.
  • PPRFTDTC identifies the reference dose date and time supplied by the analysis software, or is missing when none is supplied.

Note: this step publishes the supplied estimates; it does not recalculate them from a concentration profile or change their units. An unsupported parameter name or an estimate that is not numeric stops publication.

Inputs

Under review
1 source file

input/nca_transfer.csv

Edit
6 rows
input/nca_transfer.csv
ProtocolSubjectAnalyteParameterEstimateUnitReferenceDose
PK201PK201-001ZX-201Cmax10.0ng/mL2026-03-02T08:00:00
PK201PK201-001ZX-201Tmax1.00h2026-03-02T08:00:00
PK201PK201-001ZX-201AUClast12.5h*ng/mL2026-03-02T08:00:00
PK201PK201-002ZX-201Tmax1.00h2026-03-02T08:00:00
PK201PK201-002ZX-201AUClast25.0h*ng/mL2026-03-02T08:00:00
PK201PK201-002ZX-201Cmax20.0ng/mL2026-03-02T08:00:00

Expected output

Under review
6 expected rows

expected/pp.csv

Edit
6 rows
expected/pp.csv
DOMAINSTUDYIDUSUBJIDPPSEQPPTESTCDPPTESTPPCATPPORRESPPORRESUPPSTRESCPPSTRESNPPSTRESUPPSPECPPRFTDTC
PPPK2011AUCLSTAUC to Last Nonzero ConcZX-20112.5h*ng/mL12.512.5h*ng/mLPLASMA2026-03-02T08:00:00
PPPK2012CMAXMax ConcZX-20110.0ng/mL10.010ng/mLPLASMA2026-03-02T08:00:00
PPPK2013TMAXTime of CMAX ObservationZX-2011.00h1.001hPLASMA2026-03-02T08:00:00
PPPK2011AUCLSTAUC to Last Nonzero ConcZX-20125.0h*ng/mL25.025h*ng/mLPLASMA2026-03-02T08:00:00
PPPK2012CMAXMax ConcZX-20120.0ng/mL20.020ng/mLPLASMA2026-03-02T08:00:00
PPPK2013TMAXTime of CMAX ObservationZX-2011.00h1.001hPLASMA2026-03-02T08:00:00
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 "PP".SDTM1
STUDYIDStudy IdentifierCharCollectedCopy value from NCA.Protocol.SDTM2
USUBJIDUnique Subject IdentifierCharCollectedCopy value from NCA.Subject.SDTM3
PPTESTCDPK Parameter Short NameCharCollectedRecode NCA.Parameter: "Cmax" → "CMAX", "Tmax" → "TMAX", "AUClast" → "AUCLST"; missing values stay missing; unlisted values are errors.SDTM4
PPTESTPK Parameter NameCharDerivedRecode PPTESTCD: "CMAX" → "Max Conc", "TMAX" → "Time of CMAX Observation", "AUCLST" → "AUC to Last Nonzero Conc"; missing values stay missing; unlisted values are errors.SDTM5
PPCATCategory for PK ParametersCharCollectedCopy value from NCA.Analyte.SDTM6
PPORRESResult or Finding in Original UnitsCharCollectedCopy value from NCA.Estimate.SDTM7
PPORRESUOriginal UnitsCharCollectedCopy value from NCA.Unit.SDTM8
PPSTRESCCharacter Result/Finding in Std FormatCharDerivedCopy value from PPORRES.SDTM9
PPSTRESNNumeric Result/Finding in Standard UnitsNumDerivedCopy value from PPORRES.SDTM10
PPSTRESUStandard UnitsCharDerivedCopy value from PPORRESU.SDTM11
PPSPECSpecimen Material TypeCharAssignedSet constant value "PLASMA".SDTM12
PPRFTDTCDate/Time of Reference PointCharISO 8601CollectedCopy value from NCA.ReferenceDose.SDTM13
PPSEQSequence NumberNumDerivedRow number within each group of NCA.Protocol, NCA.Subject, ordered by NCA.ReferenceDose then NCA.Analyte then NCA.Parameter.SDTM14
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-pp-pk-parameters/full.md

Edit
27 lines

Following CDISC SDTM standards, use the provided NCA_TRANSFER dataset to create a PP dataset with one record per supplied analysis parameter estimate.

The output dataset should contain the following columns in this order: DOMAIN, STUDYID, USUBJID, PPSEQ, PPTESTCD, PPTEST, PPCAT, PPORRES, PPORRESU, PPSTRESC, PPSTRESN, PPSTRESU, PPSPEC, PPRFTDTC

DOMAIN is "PP" and PPSPEC is "PLASMA". STUDYID is the supplied Protocol identifier and USUBJID is the supplied Subject identifier, without alteration. PPSEQ starts at 1 within each subject and study, increasing by reference dose date and time, then analyte, then standard parameter code, all ascending. For software parameters "Cmax", "Tmax" and "AUClast", PPTESTCD is "CMAX", "TMAX" and "AUCLST", respectively. PPTEST is "Max Conc" for "CMAX", "Time of CMAX Observation" for "TMAX" and "AUC to Last Nonzero Conc" for "AUCLST". PPCAT identifies the supplied analyte. PPORRES and PPSTRESC are the supplied estimate as text, preserving all reported decimal places, including trailing zeros. PPSTRESN is the numeric value of that estimate, without rounding or recalculation from concentration profiles. PPORRESU and PPSTRESU are the supplied analysis unit, without conversion or assignment of a unit from the parameter code. PPRFTDTC identifies the supplied reference dose date and time.

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

prompts/sdtm-pp-pk-parameters/conventions.md

Edit
16 lines

Following CDISC SDTM standards, use the provided NCA_TRANSFER dataset to create a PP dataset with one record per supplied analysis parameter estimate.

The output dataset should contain the following columns in this order: DOMAIN, STUDYID, USUBJID, PPSEQ, PPTESTCD, PPTEST, PPCAT, PPORRES, PPORRESU, PPSTRESC, PPSTRESN, PPSTRESU, PPSPEC, PPRFTDTC

DOMAIN is "PP" and PPSPEC is "PLASMA". For software parameters "Cmax", "Tmax" and "AUClast", PPTESTCD is "CMAX", "TMAX" and "AUCLST", respectively. PPTEST is "Max Conc" for "CMAX", "Time of CMAX Observation" for "TMAX" and "AUC to Last Nonzero Conc" for "AUCLST". PPORRES and PPSTRESC preserve all reported decimal places, including trailing zeros. PPSTRESN is not rounded.

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

prompts/sdtm-pp-pk-parameters/brief.md

Edit
9 lines

Following CDISC SDTM standards, use the provided NCA_TRANSFER dataset to create a PP dataset with one record per supplied analysis parameter estimate.

The output dataset should contain the following columns in this order: DOMAIN, STUDYID, USUBJID, PPSEQ, PPTESTCD, PPTEST, PPCAT, PPORRES, PPORRESU, PPSTRESC, PPSTRESN, PPSTRESU, PPSPEC, PPRFTDTC

Read the source datasets from /app/input and save the completed dataset as /app/output/pp.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-pp-pk-parameters/result.R

Edit
26 lines
source <- read.csv("/app/input/nca_transfer.csv", colClasses = "character", stringsAsFactors = FALSE, check.names = FALSE)code_map <- c(Cmax = "CMAX", Tmax = "TMAX", AUClast = "AUCLST")name_map <- c(CMAX = "Max Conc", TMAX = "Time of CMAX Observation", AUCLST = "AUC to Last Nonzero Conc")stopifnot(all(source$Parameter %in% names(code_map)))pp <- data.frame(  DOMAIN = "PP",  STUDYID = source$Protocol,  USUBJID = source$Subject,  PPSEQ = integer(nrow(source)),  PPTESTCD = unname(code_map[source$Parameter]),  PPTEST = unname(name_map[code_map[source$Parameter]]),  PPCAT = source$Analyte,  PPORRES = source$Estimate,  PPORRESU = source$Unit,  PPSTRESC = source$Estimate,  PPSTRESN = as.numeric(source$Estimate),  PPSTRESU = source$Unit,  PPSPEC = "PLASMA",  PPRFTDTC = format(as.POSIXct(source$ReferenceDose, format = "%Y-%m-%dT%H:%M:%S", tz = "UTC"), "%Y-%m-%dT%H:%M:%S", tz = "UTC"),  stringsAsFactors = FALSE)pp <- pp[order(pp$STUDYID, pp$USUBJID, pp$PPRFTDTC, pp$PPCAT, pp$PPTESTCD), ]group <- interaction(pp$STUDYID, pp$USUBJID, drop = TRUE)pp$PPSEQ <- as.integer(ave(seq_len(nrow(pp)), group, FUN = seq_along))stopifnot(nrow(pp) == nrow(source), !anyNA(pp))write.csv(pp, "/app/output/pp.csv", row.names = FALSE, na = "")

solutions/sdtm-pp-pk-parameters/result.py

Edit
80 lines
import csvfrom datetime import datetimefrom decimal import Decimalfrom pathlib import PathINPUT = Path("/app/input")OUTPUT = Path("/app/output")PARAMETERS = {    "Cmax": ("CMAX", "Max Conc"),    "Tmax": ("TMAX", "Time of CMAX Observation"),    "AUClast": ("AUCLST", "AUC to Last Nonzero Conc"),}COLUMNS = [    "DOMAIN",    "STUDYID",    "USUBJID",    "PPSEQ",    "PPTESTCD",    "PPTEST",    "PPCAT",    "PPORRES",    "PPORRESU",    "PPSTRESC",    "PPSTRESN",    "PPSTRESU",    "PPSPEC",    "PPRFTDTC",]def main():    records = []    with (INPUT / "nca_transfer.csv").open(newline="", encoding="utf-8-sig") as source:        for row in csv.DictReader(source):            code, name = PARAMETERS[row["Parameter"]]            estimate = row["Estimate"]            records.append(                {                    "DOMAIN": "PP",                    "STUDYID": row["Protocol"],                    "USUBJID": row["Subject"],                    "PPTESTCD": code,                    "PPTEST": name,                    "PPCAT": row["Analyte"],                    "PPORRES": estimate,                    "PPORRESU": row["Unit"],                    "PPSTRESC": estimate,                    "PPSTRESN": format(Decimal(estimate), "f"),                    "PPSTRESU": row["Unit"],                    "PPSPEC": "PLASMA",                    "PPRFTDTC": datetime.fromisoformat(row["ReferenceDose"]).strftime(                        "%Y-%m-%dT%H:%M:%S"                    ),                }            )    records.sort(        key=lambda row: (            row["STUDYID"],            row["USUBJID"],            row["PPRFTDTC"],            row["PPCAT"],            row["PPTESTCD"],        )    )    previous = None    sequence = 0    for row in records:        subject = (row["STUDYID"], row["USUBJID"])        sequence = sequence + 1 if subject == previous else 1        row["PPSEQ"] = sequence        previous = subject    OUTPUT.mkdir(exist_ok=True)    with (OUTPUT / "pp.csv").open("w", newline="", encoding="utf-8") as target:        writer = csv.DictWriter(target, fieldnames=COLUMNS)        writer.writeheader()        writer.writerows(records)if __name__ == "__main__":    main()

solutions/sdtm-pp-pk-parameters/result.sas

Edit
45 lines
data nca_transfer;  length Protocol $100 Subject $100 Analyte $100 Parameter $100 Estimate $100 Unit $100 ReferenceDose $30;  infile '/app/input/nca_transfer.csv' dsd dlm=',' firstobs=2;  input Protocol $ Subject $ Analyte $ Parameter $ Estimate $ Unit $ ReferenceDose $;run;data mapped;  length DOMAIN $2 STUDYID $100 USUBJID $100 PPTESTCD $8 PPTEST $40 PPCAT $100 PPORRES $100 PPORRESU $100 PPSTRESC $100 PPSTRESU $100 PPSPEC $10 PPRFTDTC $30;  set nca_transfer;  DOMAIN='PP';  STUDYID=Protocol;  USUBJID=Subject;  if Parameter='Cmax' then do;    PPTESTCD='CMAX';    PPTEST='Max Conc';  end;  else if Parameter='Tmax' then do;    PPTESTCD='TMAX';    PPTEST='Time of CMAX Observation';  end;  else if Parameter='AUClast' then do;    PPTESTCD='AUCLST';    PPTEST='AUC to Last Nonzero Conc';  end;  PPCAT=Analyte;  PPORRES=Estimate;  PPORRESU=Unit;  PPSTRESC=Estimate;  PPSTRESN=input(Estimate,best32.);  PPSTRESU=Unit;  PPSPEC='PLASMA';  PPRFTDTC=ReferenceDose;run;proc sort data=mapped;  by STUDYID USUBJID PPRFTDTC PPCAT PPTESTCD;run;data pp;  retain DOMAIN STUDYID USUBJID PPSEQ PPTESTCD PPTEST PPCAT PPORRES PPORRESU PPSTRESC PPSTRESN PPSTRESU PPSPEC PPRFTDTC;  set mapped;  by STUDYID USUBJID;  if first.USUBJID then PPSEQ=0;  PPSEQ+1;  keep DOMAIN STUDYID USUBJID PPSEQ PPTESTCD PPTEST PPCAT PPORRES PPORRESU PPSTRESC PPSTRESN PPSTRESU PPSPEC PPRFTDTC;run;proc export data=pp outfile='/app/output/pp.csv' dbms=csv replace;run;