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.
- 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.
- Inputs: Do they look like data collected in a real trial, and do they include the situations you would expect to meet in one?
- 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
README.mdGoal: fill each missing vital signs result with the last value
observed before it (last observation carried forward), in AVAL.
Input: one planned vital signs assessment per subject, parameter, and analysis visit, holding either a collected value or a gap.
Variables:
AVISITNidentifies the planned analysis visit.AVALis the collected value when there is one; otherwise it is the value from the closest earlier visit, in visit-number order, that has one, for the same subject and parameter. A gap before the first collected value stays missing, and zero is a collected value that is carried like any other.
Inputs
Under review1 source fileinput/vs.csv
Edit18 rows| USUBJID | PARAMCD | AVISITN | AVALCOL |
|---|---|---|---|
| SYSBP | 1 | 118 | |
| SYSBP | 2 | — | |
| SYSBP | 3 | — | |
| SYSBP | 4 | 142 | |
| DIABP | 1 | — | |
| DIABP | 2 | 78 | |
| SYSBP | 1 | — | |
| SYSBP | 2 | 0 | |
| SYSBP | 3 | — | |
| SYSBP | 1 | 132 | |
| SYSBP | 2 | — | |
| SYSBP | 3 | 128 | |
| SYSBP | 4 | — | |
| SYSBP | 5 | — | |
| SYSBP | 1 | 121 | |
| DIABP | 1 | — | |
| DIABP | 2 | — | |
| DIABP | 3 | — |
Expected output
Under review18 expected rowsexpected/advs.csv
Edit18 rows| USUBJID | PARAMCD | AVISITN | AVAL |
|---|---|---|---|
| SYSBP | 1 | 118 | |
| SYSBP | 2 | 118 | |
| SYSBP | 3 | 118 | |
| SYSBP | 4 | 142 | |
| DIABP | 1 | — | |
| DIABP | 2 | 78 | |
| SYSBP | 1 | — | |
| SYSBP | 2 | 0 | |
| SYSBP | 3 | 0 | |
| SYSBP | 1 | 132 | |
| SYSBP | 2 | 132 | |
| SYSBP | 3 | 128 | |
| SYSBP | 4 | 128 | |
| SYSBP | 5 | 128 | |
| SYSBP | 1 | 121 | |
| DIABP | 1 | — | |
| DIABP | 2 | — | |
| DIABP | 3 | — |
Comments and assessment materials
| Dataset Name | Variable Name | Variable Label | Type | Codelist/Controlled Terms | Core | Computational Method | Origin |
|---|---|---|---|---|---|---|---|
| ADVS | USUBJID | Unique Subject Identifier | character | Copy value from VS.USUBJID. | Predecessor | ||
| ADVS | PARAMCD | Parameter Code | character | Copy value from VS.PARAMCD. | Predecessor | ||
| ADVS | AVISITN | Analysis Visit Number | numeric | Copy value from VS.AVISITN. | Predecessor | ||
| ADVS | AVAL | Analysis Value | numeric | Last observation carried forward from AVALCOL within each group of USUBJID, PARAMCD, ordered by AVISITN. | Derived |
| Version | Date | Author | Description | Reviewer | Sign-off |
|---|---|---|---|---|---|
| 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-locf/full.md
Edit15 linesFollowing CDISC ADaM standards, use the provided VS dataset to create an ADVS dataset with one record per subject per parameter per planned visit.
The output dataset should contain the following columns in this order: USUBJID, PARAMCD, AVISITN, AVAL
AVISITN identifies the planned analysis visit. AVAL is the collected value when there is one; otherwise it is the value from the closest earlier visit, in visit-number order, that has one, for the same subject and parameter. A gap before the first collected value has no value, and zero is a collected value that is carried like any other.
Read the source datasets from /app/input and save the completed dataset as /app/output/advs.csv.
prompts/adam-advs-locf/conventions.md
Edit9 linesFollowing CDISC ADaM standards, use the provided VS dataset to create an ADVS dataset with one record per subject per parameter per planned visit.
The output dataset should contain the following columns in this order: USUBJID, PARAMCD, AVISITN, AVAL
Read the source datasets from /app/input and save the completed dataset as /app/output/advs.csv.
prompts/adam-advs-locf/brief.md
Edit9 linesFollowing CDISC ADaM standards, use the provided VS dataset to create an ADVS dataset with one record per subject per parameter per planned visit.
The output dataset should contain the following columns in this order: USUBJID, PARAMCD, AVISITN, AVAL
Read the source datasets from /app/input and save the completed dataset as /app/output/advs.csv.
run.R
Edit4 lineslibrary(yamaa)advs <- yamaa_domain("spec.yaml")$outputadvsrun.py
Edit4 linesimport yamaaadvs = yamaa.yamaa_domain("spec.yaml").outputadvssolutions/adam-advs-locf/result.R
Edit27 lines# Reference solution for the yamaa benchmark adam-advs-locf (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)library(tidyr)vs <- read_csv( "/app/input/vs.csv", col_types = cols(AVISITN = col_integer(), AVALCOL = col_double(), .default = col_character()))# The collected value, otherwise the closest earlier visit with one, in# visit-number order; a gap before the first stays missing.advs <- vs |> arrange(USUBJID, PARAMCD, AVISITN) |> group_by(USUBJID, PARAMCD) |> fill(AVALCOL, .direction = "down") |> mutate(AVAL = AVALCOL) |> ungroup() |> select(USUBJID, PARAMCD, AVISITN, AVAL)dir.create("/app/output", showWarnings = FALSE)write_csv(advs, "/app/output/advs.csv", na = "")solutions/adam-advs-locf/result.py
Edit29 lines# Reference solution for the yamaa benchmark adam-advs-locf (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 plvs = pl.read_csv("/app/input/vs.csv", infer_schema=False).with_columns( pl.col("AVISITN").cast(pl.Int64, strict=False), pl.col("AVALCOL").cast(pl.Float64, strict=False),)# The collected value, otherwise the closest earlier visit with one, in# visit-number order; a gap before the first stays missing.advs = ( vs.sort(["USUBJID", "PARAMCD", "AVISITN"]) .with_columns( AVAL=pl.col("AVALCOL") .fill_null(strategy="forward") .over(["USUBJID", "PARAMCD"]) ) .select("USUBJID", "PARAMCD", "AVISITN", "AVAL"))Path("/app/output").mkdir(parents=True, exist_ok=True)advs.write_csv("/app/output/advs.csv")solutions/adam-advs-locf/result.sas
Edit23 lines/* opensas reference solution for the yamaa benchmark adam-advs-locf. Reads the benchmark inputs and derives the requested output. Execute with the existing opensas runtime: opensas /app/output/result.sas. */data vs; length USUBJID PARAMCD $1024; infile "/app/input/vs.csv" dsd dlm="," firstobs=2 truncover lrecl=32767; input USUBJID : $char1024. PARAMCD : $char1024. AVISITN AVALCOL;run;proc sort data=vs out=ordered; by USUBJID PARAMCD AVISITN; run;data result; set ordered; by USUBJID PARAMCD; retain carried; if first.PARAMCD then carried=.; if not missing(AVALCOL) then carried=AVALCOL; AVAL=carried;run;proc sql; create table final as select USUBJID, PARAMCD, AVISITN, AVAL from result;quit;proc export data=final outfile="/app/output/advs.csv" dbms=csv replace; run;
yamaa
Comments
Signed in with GitHub; saved in repository Discussions