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: add one mean arterial pressure (MAP) record, holding the result
in AVAL and CALCULATION in DTYPE, for each subject and visit that has
both a systolic (SYSBP) and a diastolic (DIABP) blood pressure result;
every collected record stays in the data.
Input: vital-signs records carrying a collected result (AVAL) for
systolic (SYSBP) and diastolic (DIABP) blood pressure, one record per
subject, visit, and parameter.
Variables:
AVAL: the collected result, or two-thirds of the diastolic pressure plus one-third of the systolic pressure on the added record. No record is added when either contributor is absent from the visit or its result is missing.DTYPE:CALCULATIONon the added record and blank on collected records.
Note: a subject and visit with more than one SYSBP or DIABP record
stops the run rather than choosing one, and so does an input that already
carries a MAP record.
Inputs
Under review1 source fileinput/advs.csv
Edit9 rows| STUDYID | USUBJID | PARAMCD | PARAM | AVAL | VISIT |
|---|---|---|---|---|---|
| YAMAA-01 | SYSBP | Systolic Blood Pressure (mmHg) | 121 | BASELINE | |
| YAMAA-01 | DIABP | Diastolic Blood Pressure (mmHg) | 81 | BASELINE | |
| YAMAA-01 | SYSBP | Systolic Blood Pressure (mmHg) | 118 | WEEK 2 | |
| YAMAA-01 | DIABP | Diastolic Blood Pressure (mmHg) | 78 | WEEK 2 | |
| YAMAA-01 | SYSBP | Systolic Blood Pressure (mmHg) | 90 | BASELINE | |
| YAMAA-01 | DIABP | Diastolic Blood Pressure (mmHg) | 60 | BASELINE | |
| YAMAA-01 | SYSBP | Systolic Blood Pressure (mmHg) | 110 | BASELINE | |
| YAMAA-01 | SYSBP | Systolic Blood Pressure (mmHg) | 125 | BASELINE | |
| YAMAA-01 | DIABP | Diastolic Blood Pressure (mmHg) | — | BASELINE |
Expected output
Under review12 expected rowsexpected/advs.csv
Edit12 rows| STUDYID | USUBJID | PARAMCD | PARAM | AVAL | VISIT | DTYPE |
|---|---|---|---|---|---|---|
| YAMAA-01 | SYSBP | Systolic Blood Pressure (mmHg) | 121 | BASELINE | — | |
| YAMAA-01 | DIABP | Diastolic Blood Pressure (mmHg) | 81 | BASELINE | — | |
| YAMAA-01 | SYSBP | Systolic Blood Pressure (mmHg) | 118 | WEEK 2 | — | |
| YAMAA-01 | DIABP | Diastolic Blood Pressure (mmHg) | 78 | WEEK 2 | — | |
| YAMAA-01 | SYSBP | Systolic Blood Pressure (mmHg) | 90 | BASELINE | — | |
| YAMAA-01 | DIABP | Diastolic Blood Pressure (mmHg) | 60 | BASELINE | — | |
| YAMAA-01 | SYSBP | Systolic Blood Pressure (mmHg) | 110 | BASELINE | — | |
| YAMAA-01 | SYSBP | Systolic Blood Pressure (mmHg) | 125 | BASELINE | — | |
| YAMAA-01 | DIABP | Diastolic Blood Pressure (mmHg) | — | BASELINE | — | |
| YAMAA-01 | MAP | Mean Arterial Pressure (mmHg) | 94.33333333333333 | BASELINE | CALCULATION | |
| YAMAA-01 | MAP | Mean Arterial Pressure (mmHg) | 91.33333333333333 | WEEK 2 | CALCULATION | |
| YAMAA-01 | MAP | Mean Arterial Pressure (mmHg) | 70 | BASELINE | CALCULATION |
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 | ||
| ADVS | DTYPE | Derivation Type | character | Set per constructed row; see the Row construction sheet. | Derived |
| Template | Include when | PARAMCD | PARAM | SYSBP_VAL | DIABP_VAL | AVAL | DTYPE |
|---|---|---|---|---|---|---|---|
| collected | Copy ADVS_RAW.PARAMCD | Copy ADVS_RAW.PARAM | Constant "None" | Constant "None" | Copy ADVS_RAW.AVAL | Constant "None" | |
| derived_map | SYSBP_VAL IS NOT NULL AND DIABP_VAL IS NOT NULL | Constant "MAP" | Constant "Mean Arterial Pressure (mmHg)" | Aggregate ONLY(ADVS_RAW.AVAL) over records matching on the shared output keys, where ADVS_RAW.PARAMCD = 'SYSBP' | Aggregate ONLY(ADVS_RAW.AVAL) over records matching on the shared output keys, where ADVS_RAW.PARAMCD = 'DIABP' | Compute (2 * DIABP_VAL + SYSBP_VAL) / 3 | Constant "CALCULATION" |
| 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-map/full.md
Edit16 linesFollowing CDISC ADaM standards, use the provided ADVS dataset to create an ADVS dataset with one record per subject, visit, and parameter.
The output dataset should contain the following columns in this order: STUDYID, USUBJID, PARAMCD, PARAM, AVAL, VISIT, DTYPE
An added record with PARAMCD "MAP" and PARAM "Mean Arterial Pressure (mmHg)" is created for each subject and visit that has both a systolic (SYSBP) and a diastolic (DIABP) blood pressure result. On the added record, AVAL is two-thirds of the diastolic pressure plus one-third of the systolic pressure. AVAL on the added record is not rounded. No record is added when either contributor is absent from the visit or its result is missing. DTYPE is "CALCULATION" on the added record and has no value on collected records.
Read the source datasets from /app/input and save the completed dataset as /app/output/advs.csv.
prompts/adam-advs-map/conventions.md
Edit12 linesFollowing CDISC ADaM standards, use the provided ADVS dataset to create an ADVS dataset with one record per subject, visit, and parameter.
The output dataset should contain the following columns in this order: STUDYID, USUBJID, PARAMCD, PARAM, AVAL, VISIT, DTYPE
PARAMCD is "MAP" and PARAM is "Mean Arterial Pressure (mmHg)" on the added record. AVAL on the added record 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-map/brief.md
Edit8 linesFollowing CDISC ADaM standards, use the provided ADVS dataset to create an ADVS dataset with one record per subject, visit, and 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.
R
Edit3 lineslibrary(yamaa)yamaa_spec("spec.yaml")$run()$outputPython
Edit3 linesimport yamaayamaa.spec("spec.yaml").run().outputsolutions/adam-advs-map/result.R
Edit45 lines# Reference solution for the yamaa benchmark adam-advs-map (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 systolic and diastolic results.sysbp <- raw |> filter(PARAMCD %in% "SYSBP", !is.na(AVAL)) |> group_by(STUDYID, USUBJID, VISIT) |> summarise(SYSBP_VAL = first(AVAL), .groups = "drop")diabp <- raw |> filter(PARAMCD %in% "DIABP", !is.na(AVAL)) |> group_by(STUDYID, USUBJID, VISIT) |> summarise(DIABP_VAL = first(AVAL), .groups = "drop")# One mean arterial pressure record for each visit with both results,# counting the diastolic pressure twice.map_records <- sysbp |> inner_join(diabp, by = c("STUDYID", "USUBJID", "VISIT")) |> transmute( STUDYID, USUBJID, PARAMCD = "MAP", PARAM = "Mean Arterial Pressure (mmHg)", AVAL = (SYSBP_VAL + 2 * DIABP_VAL) / 3, VISIT, DTYPE = "CALCULATION" )advs <- bind_rows(collected, map_records) |> arrange(USUBJID, VISIT, PARAMCD)dir.create("/app/output", showWarnings = FALSE)write_csv(advs, "/app/output/advs.csv", na = "")solutions/adam-advs-map/result.py
Edit65 lines# Reference solution for the yamaa benchmark adam-advs-map (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 csvfrom collections import OrderedDictINPUT_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: rows = list(csv.DictReader(f)) # Group collected records by (subject, visit), preserving input order. groups = OrderedDict() for row in rows: key = (row["USUBJID"], row["VISIT"]) groups.setdefault(key, []).append(row) out_rows = [] for (usubjid, visit), group in groups.items(): for row in group: out_rows.append({ "STUDYID": row["STUDYID"], "USUBJID": row["USUBJID"], "PARAMCD": row["PARAMCD"], "PARAM": row["PARAM"], "AVAL": row["AVAL"], "VISIT": row["VISIT"], "DTYPE": "", }) values = {} for row in group: if row["PARAMCD"] in ("SYSBP", "DIABP"): aval = row["AVAL"] if aval is not None and aval.strip() != "": values[row["PARAMCD"]] = float(aval) if "SYSBP" in values and "DIABP" in values: map_aval = (2.0 / 3.0) * values["DIABP"] + (1.0 / 3.0) * values["SYSBP"] out_rows.append({ "STUDYID": group[0]["STUDYID"], "USUBJID": usubjid, "PARAMCD": "MAP", "PARAM": "Mean Arterial Pressure (mmHg)", "AVAL": repr(map_aval), "VISIT": visit, "DTYPE": "CALCULATION", }) 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-map/result.sas
Edit21 lines/* opensas reference solution for the yamaa benchmark adam-advs-map. 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,'MAP' as PARAMCD,'Mean Arterial Pressure (mmHg)' as PARAM,(a.AVAL+2*b.AVAL)/3 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='SYSBP' and b.PARAMCD='DIABP' 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;
yamaa