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: carry each collected vital signs record through and add one body surface area (BSA) record for each weight result, at the weight's visit, from the subject's height.
Input: collected vital signs with height records coded
HEIGHT and weight records coded WEIGHT; height is collected
once per subject, in centimeters, and weight at each visit, in
kilograms.
Variables:
AVALkeeps each collected result. On a body surface area record it is the Mosteller value: the square root of the subject's height in centimeters times the visit's weight in kilograms, divided by 3600. No record is added for a weight with no result, or when the subject has no height result. A weight or height of zero or less is not a valid result, so its body surface area is missing: it adds no record either.
Note: every weight of a subject uses the same height, whatever
visit collected it, so a visit without a height still gets a body
surface area. A subject with more than one height result stops the
run rather than choosing one. Body surface area is a parameter of
its own, so the data carries no DTYPE: that variable marks a
record added within a collected parameter.
Inputs
Under review1 source fileinput/advs.csv
Edit18 rows| STUDYID | USUBJID | PARAMCD | PARAM | AVAL | VISIT |
|---|---|---|---|---|---|
| YAMAA-01 | HEIGHT | Height (cm) | 170.5 | BASELINE | |
| YAMAA-01 | WEIGHT | Weight (kg) | 75.2 | BASELINE | |
| YAMAA-01 | WEIGHT | Weight (kg) | 76.0 | WEEK 2 | |
| YAMAA-01 | WEIGHT | Weight (kg) | 74.8 | WEEK 4 | |
| YAMAA-01 | HEIGHT | Height (cm) | 165.0 | SCREENING | |
| YAMAA-01 | WEIGHT | Weight (kg) | 60.5 | BASELINE | |
| YAMAA-01 | WEIGHT | Weight (kg) | 61.2 | WEEK 2 | |
| YAMAA-01 | WEIGHT | Weight (kg) | 80.0 | BASELINE | |
| YAMAA-01 | HEIGHT | Height (cm) | 180.0 | BASELINE | |
| YAMAA-01 | WEIGHT | Weight (kg) | — | BASELINE | |
| YAMAA-01 | WEIGHT | Weight (kg) | 82.0 | WEEK 4 | |
| YAMAA-01 | HEIGHT | Height (cm) | 172.0 | BASELINE | |
| YAMAA-01 | HEIGHT | Height (cm) | 175.0 | BASELINE | |
| YAMAA-01 | WEIGHT | Weight (kg) | 0.0 | BASELINE | |
| YAMAA-01 | HEIGHT | Height (cm) | — | BASELINE | |
| YAMAA-01 | WEIGHT | Weight (kg) | 70.0 | BASELINE | |
| YAMAA-01 | HEIGHT | Height (cm) | 0.0 | BASELINE | |
| YAMAA-01 | WEIGHT | Weight (kg) | 68.0 | BASELINE |
Expected output
Under review24 expected rowsexpected/advs.csv
Edit24 rows| STUDYID | USUBJID | PARAMCD | PARAM | AVAL | VISIT |
|---|---|---|---|---|---|
| YAMAA-01 | HEIGHT | Height (cm) | 170.5 | BASELINE | |
| YAMAA-01 | WEIGHT | Weight (kg) | 75.2 | BASELINE | |
| YAMAA-01 | WEIGHT | Weight (kg) | 76 | WEEK 2 | |
| YAMAA-01 | WEIGHT | Weight (kg) | 74.8 | WEEK 4 | |
| YAMAA-01 | HEIGHT | Height (cm) | 165 | SCREENING | |
| YAMAA-01 | WEIGHT | Weight (kg) | 60.5 | BASELINE | |
| YAMAA-01 | WEIGHT | Weight (kg) | 61.2 | WEEK 2 | |
| YAMAA-01 | WEIGHT | Weight (kg) | 80 | BASELINE | |
| YAMAA-01 | HEIGHT | Height (cm) | 180 | BASELINE | |
| YAMAA-01 | WEIGHT | Weight (kg) | — | BASELINE | |
| YAMAA-01 | WEIGHT | Weight (kg) | 82 | WEEK 4 | |
| YAMAA-01 | HEIGHT | Height (cm) | 172 | BASELINE | |
| YAMAA-01 | HEIGHT | Height (cm) | 175 | BASELINE | |
| YAMAA-01 | WEIGHT | Weight (kg) | 0 | BASELINE | |
| YAMAA-01 | HEIGHT | Height (cm) | — | BASELINE | |
| YAMAA-01 | WEIGHT | Weight (kg) | 70 | BASELINE | |
| YAMAA-01 | HEIGHT | Height (cm) | 0 | BASELINE | |
| YAMAA-01 | WEIGHT | Weight (kg) | 68 | BASELINE | |
| YAMAA-01 | BSA | Body Surface Area (m^2) | 1.887208402788509 | BASELINE | |
| YAMAA-01 | BSA | Body Surface Area (m^2) | 1.89722018870885 | WEEK 2 | |
| YAMAA-01 | BSA | Body Surface Area (m^2) | 1.882182539264221 | WEEK 4 | |
| YAMAA-01 | BSA | Body Surface Area (m^2) | 1.6652076947536205 | BASELINE | |
| YAMAA-01 | BSA | Body Surface Area (m^2) | 1.6748134224444227 | WEEK 2 | |
| YAMAA-01 | BSA | Body Surface Area (m^2) | 2.0248456731316584 | WEEK 4 |
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 ADVS_RAW.STUDYID. | Predecessor | ||
| ADVS | USUBJID | Unique Subject Identifier | character | Copy value from ADVS_RAW.USUBJID. | 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 | ||
| ADVS | VISIT | Visit Name | character | Copy value from ADVS_RAW.VISIT. | Predecessor |
| Template | Include when | PARAMCD | PARAM | HEIGHT_VAL | AVAL |
|---|---|---|---|---|---|
| collected | Copy ADVS_RAW.PARAMCD | Copy ADVS_RAW.PARAM | Constant "None" | Copy ADVS_RAW.AVAL | |
| derived_bsa | ADVS_RAW.PARAMCD = 'WEIGHT' AND ADVS_RAW.AVAL > 0 AND HEIGHT_VAL IS NOT NULL | Constant "BSA" | Constant "Body Surface Area (m^2)" | Copy AVAL from the ADVS_RAW record matching on STUDYID and USUBJID, where ADVS_RAW.PARAMCD = 'HEIGHT' AND ADVS_RAW.AVAL > 0, and no match yields blank | Compute SQRT(ADVS_RAW.AVAL * HEIGHT_VAL / 3600) |
| Version | Date | Author | Description | Reviewer | Sign-off |
|---|---|---|---|---|---|
| 1.8 | 2026-11-19 | yamaa docs build | State open and closed range endpoints, including bounds of zero | ||
| 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-bsa/full.md
Edit20 linesFollowing 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
The output holds every collected record and adds one body surface area record for each weight result, coded "WEIGHT", at the weight's visit. Height, coded "HEIGHT", is collected once per subject, so every weight of a subject uses the subject's height result, whatever visit collected it. 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 for a weight with no result, or when the subject has no height result. A weight or height of zero or less is not a valid result, so no body surface area record is added for it either.
Read the source datasets from /app/input and save the completed dataset as /app/output/advs.csv.
prompts/adam-advs-bsa/conventions.md
Edit13 linesFollowing 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
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. Height is collected once per subject.
Read the source datasets from /app/input and save the completed dataset as /app/output/advs.csv.
prompts/adam-advs-bsa/brief.md
Edit8 linesFollowing 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
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-bsa/result.R
Edit42 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)# Height is collected once per subject, so each subject has one height# result, whatever visit collected it; zero or less is not a valid result.heights <- raw |> filter(PARAMCD %in% "HEIGHT", !is.na(AVAL), AVAL > 0) |> select(STUDYID, USUBJID, HEIGHT_VAL = AVAL)stopifnot(!anyDuplicated(heights[c("STUDYID", "USUBJID")]))# One body surface area record for each weight result above zero, at the# weight's visit, when the subject has a height result.bsa <- raw |> filter(PARAMCD %in% "WEIGHT", !is.na(AVAL), AVAL > 0) |> inner_join(heights, by = c("STUDYID", "USUBJID")) |> transmute( STUDYID, USUBJID, PARAMCD = "BSA", PARAM = "Body Surface Area (m^2)", AVAL = sqrt(AVAL * HEIGHT_VAL / 3600), VISIT )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
Edit71 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 weight result(PARAMCD "WEIGHT"), at the weight's visit. Height (PARAMCD "HEIGHT") iscollected once per subject, so every weight uses the subject's heightresult, whatever visit collected it. BSA uses the Mosteller formula,sqrt(height in cm * weight in kg / 3600), and is not rounded. A weight withno result, or a subject with no height result, gets no BSA record. A weightor height of zero or less is not a valid result, so it gets none either."""import csvimport mathimport osINPUT_PATH = "/app/input/advs.csv"OUTPUT_PATH = "/app/output/advs.csv"COLUMNS = ["STUDYID", "USUBJID", "PARAMCD", "PARAM", "AVAL", "VISIT"]def main(): with open(INPUT_PATH, newline="") as f: collected = list(csv.DictReader(f)) # The subject's one valid height result; zero or less is not valid. heights = {} for row in collected: aval = (row.get("AVAL") or "").strip() if row["PARAMCD"] == "HEIGHT" and aval and float(aval) > 0: key = (row["STUDYID"], row["USUBJID"]) if key in heights: raise ValueError(f"more than one height result for {key}") heights[key] = float(aval) out_rows = [{c: row.get(c, "") for c in COLUMNS} for row in collected] for row in collected: aval = (row.get("AVAL") or "").strip() key = (row["STUDYID"], row["USUBJID"]) if row["PARAMCD"] != "WEIGHT" or not aval or key not in heights: continue if float(aval) <= 0: continue bsa = math.sqrt(float(aval) * heights[key] / 3600.0) out_rows.append( { "STUDYID": row["STUDYID"], "USUBJID": row["USUBJID"], "PARAMCD": "BSA", "PARAM": "Body Surface Area (m^2)", "AVAL": repr(bsa), "VISIT": row["VISIT"], } ) 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
Edit23 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;/* Height is collected once per subject, so every weight result joins the subject's one height result, whatever visit collected it. A weight or height of zero or less is not a valid result and gets no BSA. */proc sql; create table computed as select b.STUDYID,b.USUBJID,'BSA' as PARAMCD,'Body Surface Area (m^2)' as PARAM,sqrt(b.AVAL*a.AVAL/3600) as AVAL,b.VISIT from advs as a inner join advs as b on a.STUDYID=b.STUDYID and a.USUBJID=b.USUBJID where a.PARAMCD='HEIGHT' and b.PARAMCD='WEIGHT' and a.AVAL > 0 and b.AVAL > 0;quit;data result; set advs computed; run;proc sql; create table final as select STUDYID, USUBJID, PARAMCD, PARAM, AVAL, VISIT from result;quit;proc export data=final outfile="/app/output/advs.csv" dbms=csv replace; run;
yamaa