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: finalizedEditUnder review
What this benchmark means
README.md

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

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

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

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.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/adam-advs-bmi/full.md

Edit
18 lines

Following CDISC ADaM standards, use the provided ADSL and VS 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 ("HEIGHT" and "WEIGHT") and marks each BMI record "BMI". PARAM keeps each collected test name and labels each BMI record "Body Mass Index (kg/m^2)". AVAL keeps each collected result. A BMI record is added for each collected weight record with a result, and a weight record without a result gets no BMI record. On a BMI record, AVAL is the collected weight in kilograms divided by the square of the subject's baseline height in metres. AVAL has no value on a BMI record when the subject's baseline height is missing or zero, and the BMI record stays in place. AVAL on a BMI record is not rounded.

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

prompts/adam-advs-bmi/conventions.md

Edit
11 lines

Following CDISC ADaM standards, use the provided ADSL and VS 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 is "BMI" and PARAM is "Body Mass Index (kg/m^2)" on each BMI record. AVAL on a BMI record 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
8 lines

Following CDISC ADaM standards, use the provided ADSL and VS 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

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/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
56 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.import csvINPUT_DIR = "/app/input"OUTPUT_DIR = "/app/output"# Baseline height (cm) per subject from ADSL.baseline_height_cm = {}with open(f"{INPUT_DIR}/adsl.csv", newline="") as f:    for row in csv.DictReader(f):        h = (row.get("HEIGHTBL") or "").strip()        baseline_height_cm[row["USUBJID"]] = float(h) if h else Nonerows = []with open(f"{INPUT_DIR}/vs.csv", newline="") as f:    for rec in csv.DictReader(f):        result = (rec.get("VSSTRESN") or "").strip()        rows.append(            {                "STUDYID": rec["STUDYID"],                "USUBJID": rec["USUBJID"],                "AVISIT": rec["VISIT"],                "PARAMCD": rec["VSTESTCD"],                "PARAM": rec["VSTEST"],                "AVAL": result,            }        )        # A BMI record follows each collected weight record with a result.        if rec["VSTESTCD"] == "WEIGHT" and result:            height_cm = baseline_height_cm.get(rec["USUBJID"])            if height_cm is None or height_cm == 0:                bmi = ""            else:                height_m = height_cm / 100.0                bmi = repr(float(result) / (height_m * height_m))            rows.append(                {                    "STUDYID": rec["STUDYID"],                    "USUBJID": rec["USUBJID"],                    "AVISIT": rec["VISIT"],                    "PARAMCD": "BMI",                    "PARAM": "Body Mass Index (kg/m^2)",                    "AVAL": bmi,                }            )columns = ["STUDYID", "USUBJID", "AVISIT", "PARAMCD", "PARAM", "AVAL"]with open(f"{OUTPUT_DIR}/advs.csv", "w", newline="") as f:    writer = csv.DictWriter(f, fieldnames=columns)    writer.writeheader()    writer.writerows(rows)

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;