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
README.mdPublic 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:
PARAMCDkeeps each collected test code (HEIGHT,WEIGHT) and marks each new recordBMI.PARAMkeeps each collected test name and labels each new recordBody Mass Index (kg/m^2).AVALkeeps 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 review2 source filesinput/adsl.csv
Edit4 rows| STUDYID | USUBJID | HEIGHTBL |
|---|---|---|
| YAMAA-01 | 147 | |
| YAMAA-01 | 163 | |
| YAMAA-01 | — | |
| YAMAA-01 | 0 |
input/vs.csv
Edit14 rows| STUDYID | USUBJID | VSSEQ | VSTESTCD | VSTEST | VSSTRESN | VISIT |
|---|---|---|---|---|---|---|
| YAMAA-01 | 1 | HEIGHT | Height (cm) | 147 | SCREENING | |
| YAMAA-01 | 2 | WEIGHT | Weight (kg) | 54 | SCREENING | |
| YAMAA-01 | 3 | WEIGHT | Weight (kg) | 54.4 | BASELINE | |
| YAMAA-01 | 4 | WEIGHT | Weight (kg) | 53.1 | WEEK 2 | |
| YAMAA-01 | 5 | WEIGHT | Weight (kg) | — | WEEK 4 | |
| YAMAA-01 | 1 | HEIGHT | Height (cm) | 163 | SCREENING | |
| YAMAA-01 | 2 | WEIGHT | Weight (kg) | 78.5 | SCREENING | |
| YAMAA-01 | 3 | WEIGHT | Weight (kg) | 80.3 | BASELINE | |
| YAMAA-01 | 4 | WEIGHT | Weight (kg) | 80.7 | WEEK 2 | |
| YAMAA-01 | 1 | WEIGHT | Weight (kg) | 68 | SCREENING | |
| YAMAA-01 | 2 | WEIGHT | Weight (kg) | 68.5 | BASELINE | |
| YAMAA-01 | 1 | HEIGHT | Height (cm) | 0 | SCREENING | |
| YAMAA-01 | 2 | WEIGHT | Weight (kg) | 70 | SCREENING | |
| YAMAA-01 | 3 | WEIGHT | Weight (kg) | 71.2 | BASELINE |
Expected output
Under review24 expected rowsexpected/advs.csv
Edit24 rows| STUDYID | USUBJID | AVISIT | PARAMCD | PARAM | AVAL |
|---|---|---|---|---|---|
| YAMAA-01 | SCREENING | HEIGHT | Height (cm) | 147 | |
| YAMAA-01 | SCREENING | WEIGHT | Weight (kg) | 54 | |
| YAMAA-01 | BASELINE | WEIGHT | Weight (kg) | 54.4 | |
| YAMAA-01 | WEEK 2 | WEIGHT | Weight (kg) | 53.1 | |
| YAMAA-01 | WEEK 4 | WEIGHT | Weight (kg) | — | |
| YAMAA-01 | SCREENING | HEIGHT | Height (cm) | 163 | |
| YAMAA-01 | SCREENING | WEIGHT | Weight (kg) | 78.5 | |
| YAMAA-01 | BASELINE | WEIGHT | Weight (kg) | 80.3 | |
| YAMAA-01 | WEEK 2 | WEIGHT | Weight (kg) | 80.7 | |
| YAMAA-01 | SCREENING | WEIGHT | Weight (kg) | 68 | |
| YAMAA-01 | BASELINE | WEIGHT | Weight (kg) | 68.5 | |
| YAMAA-01 | SCREENING | HEIGHT | Height (cm) | 0 | |
| YAMAA-01 | SCREENING | WEIGHT | Weight (kg) | 70 | |
| YAMAA-01 | BASELINE | WEIGHT | Weight (kg) | 71.2 | |
| YAMAA-01 | SCREENING | BMI | Body Mass Index (kg/m^2) | 24.989587671803417 | |
| YAMAA-01 | BASELINE | BMI | Body Mass Index (kg/m^2) | 25.17469572863159 | |
| YAMAA-01 | WEEK 2 | BMI | Body Mass Index (kg/m^2) | 24.573094543940027 | |
| YAMAA-01 | SCREENING | BMI | Body Mass Index (kg/m^2) | 29.545711167149687 | |
| YAMAA-01 | BASELINE | BMI | Body Mass Index (kg/m^2) | 30.22319244232 | |
| YAMAA-01 | WEEK 2 | BMI | Body Mass Index (kg/m^2) | 30.37374383680229 | |
| YAMAA-01 | SCREENING | BMI | Body Mass Index (kg/m^2) | — | |
| YAMAA-01 | BASELINE | BMI | Body Mass Index (kg/m^2) | — | |
| YAMAA-01 | SCREENING | BMI | Body Mass Index (kg/m^2) | — | |
| YAMAA-01 | BASELINE | BMI | Body Mass Index (kg/m^2) | — |
Human review and assessment
| Dataset Name | Variable Name | Variable Label | Type | Codelist/Controlled Terms | Core | Computational Method | Origin |
|---|---|---|---|---|---|---|---|
| ADVS | STUDYID | Study Identifier | character | Copy value from VS.STUDYID. | Predecessor | ||
| ADVS | USUBJID | Unique Subject Identifier | character | Copy value from VS.USUBJID. | Predecessor | ||
| ADVS | AVISIT | Analysis Visit Name | character | Copy value from VS.VISIT. | Predecessor | ||
| ADVS | PARAMCD | Parameter Code | character | Set per constructed row; see the Row construction sheet. | Derived | ||
| ADVS | PARAM | Parameter | character | Set per constructed row; see the Row construction sheet. | Derived | ||
| ADVS | AVAL | Analysis Value | numeric | Set per constructed row; see the Row construction sheet. | Derived |
| Template | Include when | PARAMCD | PARAM | HEIGHTBL | AVAL |
|---|---|---|---|---|---|
| collected | Copy VS.VSTESTCD | Copy VS.VSTEST | Constant "None" | Copy VS.VSSTRESN | |
| derived_bmi | VS.VSTESTCD = 'WEIGHT' AND VS.VSSTRESN IS NOT NULL | Constant "BMI" | Constant "Body Mass Index (kg/m^2)" | Copy ADSL.HEIGHTBL | Compute VS.VSSTRESN / NULLIF(HEIGHTBL * HEIGHTBL / 10000, 0) |
| Version | Date | Author | Description | Reviewer | Sign-off |
|---|---|---|---|---|---|
| 1.7 | 2026-10-20 | yamaa docs build | Read 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.6 | 2026-10-17 | yamaa docs build | Describe collected date parts written as ISO 8601 date text and times of day counted in seconds since midnight | ||
| 1.5 | 2026-10-17 | yamaa docs build | Name 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.4 | 2026-10-15 | yamaa docs build | State datetime precision codes through the hour and minute, and complete only the time parts a collected datetime lacks | ||
| 1.3 | 2026-09-29 | yamaa docs build | Show study codelist names, external dictionaries, and ISO 8601 formats in variable rows; list the document's codelist values and metadata | ||
| 1.2 | 2026-09-29 | yamaa docs build | Classify ADaM copies from a declared input as Predecessor and recodes as Derived, and SDTM recodes of locally derived columns as Derived | ||
| 1.1 | 2026-09-29 | yamaa docs build | Resolve lookups into the donor record they select, and give every derivation shape a plain-language rule instead of its raw YAML | ||
| 1.0 | yamaa docs build | Initial generation from spec.yaml |
prompts/adam-advs-bmi/full.md
Edit18 linesFollowing 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
Edit11 linesFollowing 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
Edit8 linesFollowing 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.
R
Edit3 lineslibrary(yamaa)yamaa_spec("spec.yaml")$run()$outputPython
Edit3 linesimport yamaayamaa.spec("spec.yaml").run().outputsolutions/adam-advs-bmi/result.R
Edit45 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
Edit56 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
Edit32 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;
yamaa