Review ask

As a clinical trial statistician or programmer, challenge anything in this benchmark: describe a problem in Comments, or propose a fix with the Edit button on any source file.

  1. Task: Would a real study need this derivation, specified this way? Does it follow CDISC ADaM: variable names, controlled terms, record structure? Flag any rule that is ambiguous or that a sponsor would handle differently.
  2. Inputs: Do they look like data collected in a real trial, and do they include the situations you would expect to meet in one?
  3. Expected output: Would independent QC programming reproduce every value from these inputs and rules?

The other tabs beside Comments are background for assessment, not under review.

Summary

Lifecycle: finalizedEditUnder review
What this benchmark means
README.md

Goal: derive one body mass index (BMI) record for each collected weight record with a result, holding the index in AVAL.

Input: collected vital signs with height and weight records per subject and visit, plus each subject's baseline height.

Variables:

  • PARAMCD keeps each collected test code (HEIGHT, WEIGHT) and marks each new record BMI.
  • PARAM keeps each collected test name and labels each new record Body Mass Index (kg/m^2).
  • AVAL keeps each collected result. On a BMI record it is the collected weight in kilograms divided by the square of the baseline height in metres. It is empty when the baseline height is missing or zero. A weight record without a result gets no BMI record.

Note: a missing or zero baseline height leaves the BMI record in place with an empty value instead of dropping it; a weight record with no result is the only case that produces no BMI record.

Inputs

Under review
2 source files

input/adsl.csv

Edit
4 rows
input/adsl.csv
STUDYIDUSUBJIDHEIGHTBL
YAMAA-01147
YAMAA-01163
YAMAA-01—
YAMAA-010

input/vs.csv

Edit
14 rows
input/vs.csv
STUDYIDUSUBJIDVSSEQVSTESTCDVSTESTVSSTRESNVISIT
YAMAA-011HEIGHTHeight (cm)147SCREENING
YAMAA-012WEIGHTWeight (kg)54SCREENING
YAMAA-013WEIGHTWeight (kg)54.4BASELINE
YAMAA-014WEIGHTWeight (kg)53.1WEEK 2
YAMAA-015WEIGHTWeight (kg)—WEEK 4
YAMAA-011HEIGHTHeight (cm)163SCREENING
YAMAA-012WEIGHTWeight (kg)78.5SCREENING
YAMAA-013WEIGHTWeight (kg)80.3BASELINE
YAMAA-014WEIGHTWeight (kg)80.7WEEK 2
YAMAA-011WEIGHTWeight (kg)68SCREENING
YAMAA-012WEIGHTWeight (kg)68.5BASELINE
YAMAA-011HEIGHTHeight (cm)0SCREENING
YAMAA-012WEIGHTWeight (kg)70SCREENING
YAMAA-013WEIGHTWeight (kg)71.2BASELINE

Expected output

Under review
24 expected rows

expected/advs.csv

Edit
24 rows
expected/advs.csv
STUDYIDUSUBJIDAVISITPARAMCDPARAMAVAL
YAMAA-01SCREENINGHEIGHTHeight (cm)147
YAMAA-01SCREENINGWEIGHTWeight (kg)54
YAMAA-01BASELINEWEIGHTWeight (kg)54.4
YAMAA-01WEEK 2WEIGHTWeight (kg)53.1
YAMAA-01WEEK 4WEIGHTWeight (kg)—
YAMAA-01SCREENINGHEIGHTHeight (cm)163
YAMAA-01SCREENINGWEIGHTWeight (kg)78.5
YAMAA-01BASELINEWEIGHTWeight (kg)80.3
YAMAA-01WEEK 2WEIGHTWeight (kg)80.7
YAMAA-01SCREENINGWEIGHTWeight (kg)68
YAMAA-01BASELINEWEIGHTWeight (kg)68.5
YAMAA-01SCREENINGHEIGHTHeight (cm)0
YAMAA-01SCREENINGWEIGHTWeight (kg)70
YAMAA-01BASELINEWEIGHTWeight (kg)71.2
YAMAA-01SCREENINGBMIBody Mass Index (kg/m^2)24.989587671803417
YAMAA-01BASELINEBMIBody Mass Index (kg/m^2)25.17469572863159
YAMAA-01WEEK 2BMIBody Mass Index (kg/m^2)24.573094543940027
YAMAA-01SCREENINGBMIBody Mass Index (kg/m^2)29.545711167149687
YAMAA-01BASELINEBMIBody Mass Index (kg/m^2)30.22319244232
YAMAA-01WEEK 2BMIBody Mass Index (kg/m^2)30.37374383680229
YAMAA-01SCREENINGBMIBody Mass Index (kg/m^2)—
YAMAA-01BASELINEBMIBody Mass Index (kg/m^2)—
YAMAA-01SCREENINGBMIBody Mass Index (kg/m^2)—
YAMAA-01BASELINEBMIBody Mass Index (kg/m^2)—
Shaded columns are derived— = missing value

Comments and assessment materials

Comments

Signed in with GitHub; saved in repository Discussions

Mapping spec

Generated from the benchmark YAML; do not edit by hand

Dataset NameVariable NameVariable LabelTypeCodelist/Controlled TermsCoreComputational MethodOrigin
ADVSSTUDYIDStudy IdentifiercharacterCopy value from VS.STUDYID.Predecessor
ADVSUSUBJIDUnique Subject IdentifiercharacterCopy value from VS.USUBJID.Predecessor
ADVSAVISITAnalysis Visit NamecharacterCopy value from VS.VISIT.Predecessor
ADVSPARAMCDParameter CodecharacterSet per constructed row; see the Row construction sheet.Derived
ADVSPARAMParametercharacterSet per constructed row; see the Row construction sheet.Derived
ADVSAVALAnalysis ValuenumericSet per constructed row; see the Row construction sheet.Derived
TemplateInclude whenPARAMCDPARAMHEIGHTBLAVAL
collectedCopy VS.VSTESTCDCopy VS.VSTESTConstant "None"Copy VS.VSSTRESN
derived_bmiVS.VSTESTCD = 'WEIGHT' AND VS.VSSTRESN IS NOT NULLConstant "BMI"Constant "Body Mass Index (kg/m^2)"Copy ADSL.HEIGHTBLCompute VS.VSSTRESN / NULLIF(HEIGHTBL * HEIGHTBL / 10000, 0)
VersionDateAuthorDescriptionReviewerSign-off
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/adam-advs-bmi/full.md

Edit
19 lines

Following CDISC ADaM standards, use the provided VS and ADSL datasets to create an ADVS dataset with one record per subject per visit per parameter.

The output dataset should contain the following columns in this order: STUDYID, USUBJID, AVISIT, PARAMCD, PARAM, AVAL

PARAMCD keeps each collected test code and marks each new record "BMI"; PARAM keeps each collected test name and labels each new record "Body Mass Index (kg/m^2)".

AVAL keeps each collected result. On a BMI record it is the collected weight in kilograms divided by the square of the subject's baseline height in metres, not rounded. It has no value when the baseline height is missing or zero; the BMI record stays in place with no value. A weight record with no result gets no BMI record.

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

prompts/adam-advs-bmi/conventions.md

Edit
15 lines

Following CDISC ADaM standards, use the provided VS and ADSL datasets to create an ADVS dataset with one record per subject per visit per parameter.

The output dataset should contain the following columns in this order: STUDYID, USUBJID, AVISIT, PARAMCD, PARAM, AVAL

PARAMCD keeps each collected test code and marks each new record "BMI"; PARAM keeps each collected test name and labels each new record "Body Mass Index (kg/m^2)".

On a BMI record AVAL is not rounded.

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

prompts/adam-advs-bmi/brief.md

Edit
9 lines

Following CDISC ADaM standards, use the provided VS and ADSL datasets to create an ADVS dataset with one record per subject per visit per parameter.

The output dataset should contain the following columns in this order: STUDYID, USUBJID, AVISIT, PARAMCD, PARAM, AVAL

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

yamaa code

Runs the yamaa specification; its result must match the expected output

run.R

Edit
4 lines
library(yamaa)advs <- yamaa_domain("spec.yaml")$outputadvs

run.py

Edit
4 lines
import yamaaadvs = yamaa.yamaa_domain("spec.yaml").outputadvs

Solution without yamaa

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

solutions/adam-advs-bmi/result.R

Edit
45 lines
# Reference solution for the yamaa benchmark adam-advs-bmi (R track).## Written from the benchmark's full prompt and its inputs alone, as an agent# would write it. Harbor's oracle agent runs it to check that the prompt can# be solved and that the grader scores a correct answer 1.library(dplyr, warn.conflicts = FALSE)library(readr)vs <- read_csv(  "/app/input/vs.csv",  col_types = cols(VSSTRESN = col_double(), .default = col_character()))adsl <- read_csv(  "/app/input/adsl.csv",  col_types = cols(HEIGHTBL = col_double(), .default = col_character()))# Every collected result stays in place.collected <- vs |>  select(STUDYID, USUBJID, AVISIT = VISIT, PARAMCD = VSTESTCD, PARAM = VSTEST, AVAL = VSSTRESN)# One BMI record for each weight with a result, using the subject's# baseline height in metres. Without a usable height the record stays# with no value.weights <- vs |>  filter(VSTESTCD %in% "WEIGHT", !is.na(VSSTRESN)) |>  left_join(adsl |> select(USUBJID, HEIGHTBL), by = "USUBJID") |>  mutate(    BMI = if_else(      !is.na(HEIGHTBL) & HEIGHTBL != 0,      VSSTRESN / ((HEIGHTBL / 100) ^ 2),      NA_real_    )  ) |>  transmute(    STUDYID, USUBJID, AVISIT = VISIT,    PARAMCD = "BMI", PARAM = "Body Mass Index (kg/m^2)", AVAL = BMI  )advs <- bind_rows(collected, weights) |>  arrange(USUBJID, AVISIT, PARAMCD)dir.create("/app/output", showWarnings = FALSE)write_csv(advs, "/app/output/advs.csv", na = "")

solutions/adam-advs-bmi/result.py

Edit
58 lines
# Reference solution for the yamaa benchmark adam-advs-bmi (Python track).## Written from the benchmark's full prompt and its inputs alone, as an agent# would write it. Harbor's oracle agent runs it to check that the prompt can# be solved and that the grader scores a correct answer 1.from pathlib import Pathimport polars as plvs = pl.read_csv("/app/input/vs.csv", infer_schema=False).with_columns(    pl.col("VSSTRESN").cast(pl.Float64, strict=False))adsl = pl.read_csv("/app/input/adsl.csv", infer_schema=False).with_columns(    pl.col("HEIGHTBL").cast(pl.Float64, strict=False))# Every collected result stays in place.collected = vs.select(    "STUDYID",    "USUBJID",    AVISIT="VISIT",    PARAMCD="VSTESTCD",    PARAM="VSTEST",    AVAL="VSSTRESN",)# One BMI record for each weight with a result, using the subject's# baseline height in metres. Without a usable height the record stays# with no value.weights = (    vs.filter(        (pl.col("VSTESTCD") == "WEIGHT") & pl.col("VSSTRESN").is_not_null()    )    .join(adsl.select("USUBJID", "HEIGHTBL"), on="USUBJID", how="left")    .with_columns(        BMI=pl.when(            pl.col("HEIGHTBL").is_not_null() & (pl.col("HEIGHTBL") != 0)        )        .then(pl.col("VSSTRESN") / ((pl.col("HEIGHTBL") / 100) ** 2))        .otherwise(None)    )    .select(        "STUDYID",        "USUBJID",        AVISIT="VISIT",        PARAMCD=pl.lit("BMI"),        PARAM=pl.lit("Body Mass Index (kg/m^2)"),        AVAL="BMI",    ))advs = pl.concat([collected, weights], how="diagonal").sort(    ["USUBJID", "AVISIT", "PARAMCD"])Path("/app/output").mkdir(parents=True, exist_ok=True)advs.write_csv("/app/output/advs.csv")

solutions/adam-advs-bmi/result.sas

Edit
32 lines
/* opensas reference solution for the yamaa benchmark adam-advs-bmi.   Reads the benchmark inputs and derives the requested output.   Execute with the existing opensas runtime: opensas /app/output/result.sas. */data adsl;  length STUDYID USUBJID $1024;  infile "/app/input/adsl.csv" dsd dlm="," firstobs=2 truncover lrecl=32767;  input STUDYID : $char1024. USUBJID : $char1024. HEIGHTBL;run;data vs;  length STUDYID USUBJID VSTESTCD VSTEST VISIT $1024;  infile "/app/input/vs.csv" dsd dlm="," firstobs=2 truncover lrecl=32767;  input STUDYID : $char1024. USUBJID : $char1024. VSSEQ VSTESTCD : $char1024. VSTEST : $char1024. VSSTRESN VISIT : $char1024.;run;proc sql; create table joined as select a.*,b.HEIGHTBL from vs as a left join adsl as b on a.STUDYID=b.STUDYID and a.USUBJID=b.USUBJID; quit;data result;  length AVISIT $1024 PARAMCD $16 PARAM $1024;  set joined;  AVISIT=VISIT; PARAMCD=VSTESTCD; PARAM=VSTEST; AVAL=VSSTRESN; output;  if VSTESTCD='WEIGHT' and not missing(VSSTRESN) then do;    PARAMCD='BMI'; PARAM='Body Mass Index (kg/m^2)'; AVAL=.;    if not missing(HEIGHTBL) and HEIGHTBL ne 0 then AVAL=VSSTRESN/(HEIGHTBL/100)**2;    output;  end;run;proc sql;  create table final as select STUDYID, USUBJID, AVISIT, PARAMCD, PARAM, AVAL from result;quit;proc export data=final outfile="/app/output/advs.csv" dbms=csv replace; run;