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

Goal: derive body mass index (BMI) two ways - once as an inline expression and once via a routine the project supplies (BMI_FN) - and show both columns carry the same value on every record.

Input: subject-level records carrying height in centimetres (HEIGHTCM) and weight in kilograms (WEIGHTKG); both are carried through unchanged.

Variables:

  • BMI holds body mass index: WEIGHTKG divided by the square of height in metres (HEIGHTCM divided by 100). It is empty when HEIGHTCM is missing or zero, or when WEIGHTKG is missing.
  • BMI_FN carries the same index as calculated by the project routine from HEIGHTCM and WEIGHTKG; empty when height or weight is missing.

Note: both columns agree on every record: a zero weight gives a zero index, and a missing height or weight leaves both empty.

Inputs

Under review
1 source file

input/adsl.csv

Edit
7 rows
input/adsl.csv
STUDYIDUSUBJIDHEIGHTCMWEIGHTKG
YAMAA-0118081
YAMAA-0116064
YAMAA-0115045
YAMAA-01—70
YAMAA-01175—
YAMAA-01——
YAMAA-012000

Expected output

Under review
7 expected rows

expected/adsl.csv

Edit
7 rows
expected/adsl.csv
STUDYIDUSUBJIDHEIGHTCMWEIGHTKGBMIBMI_FN
YAMAA-01180812525
YAMAA-011606424.99999999999999624.999999999999996
YAMAA-01150452020
YAMAA-01—70——
YAMAA-01175———
YAMAA-01————
YAMAA-01200000
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
ADSLSTUDYIDStudy IdentifiercharacterCopy value from SOURCE.STUDYID.Predecessor
ADSLUSUBJIDUnique Subject IdentifiercharacterCopy value from SOURCE.USUBJID.Predecessor
ADSLHEIGHTCMHeight (cm)numericCopy value from SOURCE.HEIGHTCM.Predecessor
ADSLWEIGHTKGWeight (kg)numericCopy value from SOURCE.WEIGHTKG.Predecessor
ADSLBMIBody Mass Index (kg/m2)numericCompute WEIGHTKG / POWER(NULLIF(HEIGHTCM, 0) / 100, 2).Derived
ADSLBMI_FNBody Mass Index via Project Routine (kg/m2)numericCall project function bmi with weight_kg = WEIGHTKG, height_cm = HEIGHTCM and cm_per_m = 100.Derived
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-adsl-bmi/full.md

Edit
14 lines

Following CDISC ADaM standards, use the provided SOURCE dataset to create an ADSL dataset with one record per subject.

The output dataset should contain the following columns in this order: STUDYID, USUBJID, HEIGHTCM, WEIGHTKG, BMI, BMI_FN

BMI holds body mass index from weight in kilograms and height in centimetres, with height converted from centimetres to metres, and is not rounded. It has no value when height is missing or zero, or when weight is missing; a zero weight gives a zero index. BMI_FN repeats BMI.

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

prompts/adam-adsl-bmi/conventions.md

Edit
10 lines

Following CDISC ADaM standards, use the provided SOURCE dataset to create an ADSL dataset with one record per subject.

The output dataset should contain the following columns in this order: STUDYID, USUBJID, HEIGHTCM, WEIGHTKG, BMI, BMI_FN

BMI is not rounded.

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

prompts/adam-adsl-bmi/brief.md

Edit
8 lines

Following CDISC ADaM standards, use the provided SOURCE dataset to create an ADSL dataset with one record per subject.

The output dataset should contain the following columns in this order: STUDYID, USUBJID, HEIGHTCM, WEIGHTKG, BMI, BMI_FN

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

yamaa code

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

run.R

Edit
4 lines
library(yamaa)adsl <- yamaa_domain("spec.yaml", environment = "r/environment.yaml")$outputadsl

run.py

Edit
4 lines
import yamaaadsl = yamaa.domain("spec.yaml", environment="python/environment.yaml").outputadsl

Solution without yamaa

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

solutions/adam-adsl-bmi/result.R

Edit
31 lines
# Reference solution for the yamaa benchmark adam-adsl-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)src <- read_csv(  "/app/input/adsl.csv",  col_types = cols(    HEIGHTCM = col_double(),    WEIGHTKG = col_double(),    .default = col_character()  ))adsl <- src |>  mutate(    BMI = if_else(      is.na(HEIGHTCM) | HEIGHTCM == 0 | is.na(WEIGHTKG),      NA_real_,      WEIGHTKG / ((HEIGHTCM / 100)^2)    ),    BMI_FN = BMI  ) |>  select(STUDYID, USUBJID, HEIGHTCM, WEIGHTKG, BMI, BMI_FN)dir.create("/app/output", showWarnings = FALSE)write_csv(adsl, "/app/output/adsl.csv", na = "")

solutions/adam-adsl-bmi/result.py

Edit
26 lines
# Reference solution for the yamaa benchmark adam-adsl-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 plsrc = pl.read_csv("/app/input/adsl.csv", infer_schema=False)height = pl.col("HEIGHTCM").cast(pl.Float64, strict=False)weight = pl.col("WEIGHTKG").cast(pl.Float64, strict=False)bmi = (    pl.when(height.is_null() | (height == 0) | weight.is_null())    .then(None)    .otherwise(weight / ((height / 100).pow(2))))adsl = src.with_columns(BMI=bmi, BMI_FN=bmi).select(    "STUDYID", "USUBJID", "HEIGHTCM", "WEIGHTKG", "BMI", "BMI_FN")Path("/app/output").mkdir(exist_ok=True)adsl.write_csv("/app/output/adsl.csv")

solutions/adam-adsl-bmi/result.sas

Edit
20 lines
/* opensas reference solution for the yamaa benchmark adam-adsl-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. HEIGHTCM WEIGHTKG;run;data result;  set adsl;  if not missing(HEIGHTCM) and HEIGHTCM ne 0 and not missing(WEIGHTKG) then BMI=WEIGHTKG/(HEIGHTCM/100)**2;  BMI_FN=BMI;run;proc sql;  create table final as select STUDYID, USUBJID, HEIGHTCM, WEIGHTKG, BMI, BMI_FN from result;quit;proc export data=final outfile="/app/output/adsl.csv" dbms=csv replace; run;