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

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

Goal: carry each collected vital signs record through and add one body surface area (BSA) record for each subject and visit that has both a height and a weight result.

Input: collected vital signs with height records coded HEIGHT and weight records coded WEIGHT; height is collected in centimeters and weight in kilograms.

Variables:

  • AVAL keeps each collected result. On a body surface area record it is the Mosteller value: the square root of height in centimeters times weight in kilograms, divided by 3600. No record is added when the visit's height or weight is absent or has no result.
  • DTYPE is CALCULATION on a body surface area record and blank on a collected record.

Inputs

Under review
1 source file

input/advs.csv

Edit
13 rows
input/advs.csv
STUDYIDUSUBJIDPARAMCDPARAMAVALVISIT
YAMAA-01HEIGHTHeight (cm)170.5BASELINE
YAMAA-01WEIGHTWeight (kg)75.2BASELINE
YAMAA-01WEIGHTWeight (kg)76.0WEEK 2
YAMAA-01HEIGHTHeight (cm)165.0BASELINE
YAMAA-01WEIGHTWeight (kg)60.5BASELINE
YAMAA-01WEIGHTWeight (kg)80.0BASELINE
YAMAA-01HEIGHTHeight (cm)180.0BASELINE
YAMAA-01WEIGHTWeight (kg)—BASELINE
YAMAA-01HEIGHTHeight (cm)180.0WEEK 4
YAMAA-01WEIGHTWeight (kg)82.0WEEK 4
YAMAA-01HEIGHTHeight (cm)172.0BASELINE
YAMAA-01HEIGHTHeight (cm)175.0BASELINE
YAMAA-01WEIGHTWeight (kg)0.0BASELINE

Expected output

Under review
17 expected rows

expected/advs.csv

Edit
17 rows
expected/advs.csv
STUDYIDUSUBJIDPARAMCDPARAMAVALVISITDTYPE
YAMAA-01HEIGHTHeight (cm)170.5BASELINE—
YAMAA-01WEIGHTWeight (kg)75.2BASELINE—
YAMAA-01WEIGHTWeight (kg)76WEEK 2—
YAMAA-01HEIGHTHeight (cm)165BASELINE—
YAMAA-01WEIGHTWeight (kg)60.5BASELINE—
YAMAA-01WEIGHTWeight (kg)80BASELINE—
YAMAA-01HEIGHTHeight (cm)180BASELINE—
YAMAA-01WEIGHTWeight (kg)—BASELINE—
YAMAA-01HEIGHTHeight (cm)180WEEK 4—
YAMAA-01WEIGHTWeight (kg)82WEEK 4—
YAMAA-01HEIGHTHeight (cm)172BASELINE—
YAMAA-01HEIGHTHeight (cm)175BASELINE—
YAMAA-01WEIGHTWeight (kg)0BASELINE—
YAMAA-01BSABody Surface Area (m^2)1.887208402788509BASELINECALCULATION
YAMAA-01BSABody Surface Area (m^2)1.6652076947536205BASELINECALCULATION
YAMAA-01BSABody Surface Area (m^2)2.0248456731316584WEEK 4CALCULATION
YAMAA-01BSABody Surface Area (m^2)0BASELINECALCULATION
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 ADVS_RAW.STUDYID.Predecessor
ADVSUSUBJIDUnique Subject IdentifiercharacterCopy value from ADVS_RAW.USUBJID.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
ADVSVISITVisit NamecharacterCopy value from ADVS_RAW.VISIT.Predecessor
ADVSDTYPEDerivation TypecharacterSet per constructed row; see the Row construction sheet.Derived
TemplateInclude whenPARAMCDPARAMHEIGHT_VALWEIGHT_VALAVALDTYPE
collectedCopy ADVS_RAW.PARAMCDCopy ADVS_RAW.PARAMConstant "None"Constant "None"Copy ADVS_RAW.AVALConstant "None"
derived_bsaHEIGHT_VAL IS NOT NULL AND WEIGHT_VAL IS NOT NULLConstant "BSA"Constant "Body Surface Area (m^2)"Aggregate ONLY(ADVS_RAW.AVAL) over records matching on the shared output keys, where ADVS_RAW.PARAMCD = 'HEIGHT'Aggregate ONLY(ADVS_RAW.AVAL) over records matching on the shared output keys, where ADVS_RAW.PARAMCD = 'WEIGHT'Compute SQRT(WEIGHT_VAL * HEIGHT_VAL / 3600)Constant "CALCULATION"
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-bsa/full.md

Edit
19 lines

Following CDISC ADaM standards, use the provided ADVS dataset 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, PARAMCD, PARAM, AVAL, VISIT, DTYPE

The output holds every collected record and adds one body surface area record for each subject and visit that has both a height result, coded "HEIGHT", and a weight result, coded "WEIGHT". On a body surface area record, PARAMCD is "BSA" and PARAM is "Body Surface Area (m^2)". On a body surface area record, AVAL is the Mosteller value: the square root of (height in centimeters times weight in kilograms divided by 3600), and AVAL is not rounded. No body surface area record is added when the visit's height or weight is absent or has no result. DTYPE is "CALCULATION" on a body surface area record and has no value on a collected record.

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

prompts/adam-advs-bsa/conventions.md

Edit
13 lines

Following CDISC ADaM standards, use the provided ADVS dataset 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, PARAMCD, PARAM, AVAL, VISIT, DTYPE

On a body surface area record, PARAMCD is "BSA" and PARAM is "Body Surface Area (m^2)". On a body surface area record, AVAL is the Mosteller value, and AVAL is not rounded. DTYPE is "CALCULATION" or has no value.

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

prompts/adam-advs-bsa/brief.md

Edit
8 lines

Following CDISC ADaM standards, use the provided ADVS dataset 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, PARAMCD, PARAM, AVAL, VISIT, DTYPE

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-bsa/result.R

Edit
44 lines
# Reference solution for the yamaa benchmark adam-advs-bsa (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)raw <- read_csv(  "/app/input/advs.csv",  col_types = cols(AVAL = col_double(), .default = col_character()))# Every collected record stays in place.collected <- raw |>  transmute(STUDYID, USUBJID, PARAMCD, PARAM, AVAL, VISIT, DTYPE = NA_character_)# The visit's height and weight results; a zero result still counts.heights <- raw |>  filter(PARAMCD %in% "HEIGHT", !is.na(AVAL)) |>  group_by(STUDYID, USUBJID, VISIT) |>  summarise(HEIGHT_VAL = first(AVAL), .groups = "drop")weights <- raw |>  filter(PARAMCD %in% "WEIGHT", !is.na(AVAL)) |>  group_by(STUDYID, USUBJID, VISIT) |>  summarise(WEIGHT_VAL = first(AVAL), .groups = "drop")# One body surface area record for each visit with both results.bsa <- heights |>  inner_join(weights, by = c("STUDYID", "USUBJID", "VISIT")) |>  transmute(    STUDYID, USUBJID,    PARAMCD = "BSA", PARAM = "Body Surface Area (m^2)",    AVAL = sqrt(HEIGHT_VAL * WEIGHT_VAL / 3600),    VISIT, DTYPE = "CALCULATION"  )advs <- bind_rows(collected, bsa) |>  arrange(USUBJID, VISIT, PARAMCD)dir.create("/app/output", showWarnings = FALSE)write_csv(advs, "/app/output/advs.csv", na = "")

solutions/adam-advs-bsa/result.py

Edit
79 lines
# Reference solution for the yamaa benchmark adam-advs-bsa (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."""Create an ADVS dataset with derived body surface area records.Reads the collected ADVS dataset from /app/input, keeps every collectedrecord, and adds one body surface area (BSA) record for each subject andvisit that has both a height result (PARAMCD "HEIGHT") and a weightresult (PARAMCD "WEIGHT") with a value. BSA uses the Mosteller formula,sqrt(height in cm * weight in kg / 3600), and is not rounded. A BSArecord carries DTYPE "CALCULATION"; collected records have no DTYPE."""import csvimport mathimport osINPUT_PATH = "/app/input/advs.csv"OUTPUT_PATH = "/app/output/advs.csv"COLUMNS = ["STUDYID", "USUBJID", "PARAMCD", "PARAM", "AVAL", "VISIT", "DTYPE"]def main():    with open(INPUT_PATH, newline="") as f:        collected = list(csv.DictReader(f))    # Index height and weight results by study, subject and visit.    heights = {}    weights = {}    for row in collected:        aval = (row.get("AVAL") or "").strip()        if not aval:            continue        key = (row["STUDYID"], row["USUBJID"], row["VISIT"])        if row["PARAMCD"] == "HEIGHT":            heights[key] = float(aval)        elif row["PARAMCD"] == "WEIGHT":            weights[key] = float(aval)    # Position of the last collected record of each subject and visit,    # so a derived BSA record follows its source records.    last_index = {}    for i, row in enumerate(collected):        key = (row["STUDYID"], row["USUBJID"], row["VISIT"])        last_index[key] = i    out_rows = []    for i, row in enumerate(collected):        out = {c: row.get(c, "") for c in COLUMNS}        out["DTYPE"] = ""        out_rows.append(out)        key = (row["STUDYID"], row["USUBJID"], row["VISIT"])        if last_index[key] == i and key in heights and key in weights:            bsa = math.sqrt(heights[key] * weights[key] / 3600.0)            out_rows.append(                {                    "STUDYID": key[0],                    "USUBJID": key[1],                    "PARAMCD": "BSA",                    "PARAM": "Body Surface Area (m^2)",                    "AVAL": repr(bsa),                    "VISIT": key[2],                    "DTYPE": "CALCULATION",                }            )    os.makedirs(os.path.dirname(OUTPUT_PATH), exist_ok=True)    with open(OUTPUT_PATH, "w", newline="") as f:        writer = csv.DictWriter(f, fieldnames=COLUMNS)        writer.writeheader()        writer.writerows(out_rows)if __name__ == "__main__":    main()

solutions/adam-advs-bsa/result.sas

Edit
21 lines
/* opensas reference solution for the yamaa benchmark adam-advs-bsa.   Reads the benchmark inputs and derives the requested output.   Execute with the existing opensas runtime: opensas /app/output/result.sas. */data advs;  length STUDYID USUBJID PARAMCD PARAM VISIT $1024;  infile "/app/input/advs.csv" dsd dlm="," firstobs=2 truncover lrecl=32767;  input STUDYID : $char1024. USUBJID : $char1024. PARAMCD : $char1024. PARAM : $char1024. AVAL VISIT : $char1024.;run;proc sql;  create table computed as select a.STUDYID,a.USUBJID,'BSA' as PARAMCD,'Body Surface Area (m^2)' as PARAM,sqrt(a.AVAL*b.AVAL/3600) as AVAL,a.VISIT,'CALCULATION' as DTYPE from advs as a inner join advs as b on a.STUDYID=b.STUDYID and a.USUBJID=b.USUBJID and a.VISIT=b.VISIT  where a.PARAMCD='HEIGHT' and b.PARAMCD='WEIGHT' and not missing(a.AVAL) and not missing(b.AVAL);quit;data collected; length DTYPE $11; set advs; run;data result; set collected computed; run;proc sql;  create table final as select STUDYID, USUBJID, PARAMCD, PARAM, AVAL, VISIT, DTYPE from result;quit;proc export data=final outfile="/app/output/advs.csv" dbms=csv replace; run;