Review ask

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.

  1. 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.
  2. Inputs: Do they look like data collected in a real trial, and do they include the situations you would expect to meet in one?
  3. 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

Lifecycle: draftEditUnder review
What this benchmark means
README.md

Goal: 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:

  • 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 stays missing, and zero is a collected value that is carried like any other.

Inputs

Under review
1 source file

input/vs.csv

Edit
18 rows
input/vs.csv
USUBJIDPARAMCDAVISITNAVALCOL
SYSBP1118
SYSBP2—
SYSBP3—
SYSBP4142
DIABP1—
DIABP278
SYSBP1—
SYSBP20
SYSBP3—
SYSBP1132
SYSBP2—
SYSBP3128
SYSBP4—
SYSBP5—
SYSBP1121
DIABP1—
DIABP2—
DIABP3—

Expected output

Under review
18 expected rows

expected/advs.csv

Edit
18 rows
expected/advs.csv
USUBJIDPARAMCDAVISITNAVAL
SYSBP1118
SYSBP2118
SYSBP3118
SYSBP4142
DIABP1—
DIABP278
SYSBP1—
SYSBP20
SYSBP30
SYSBP1132
SYSBP2132
SYSBP3128
SYSBP4128
SYSBP5128
SYSBP1121
DIABP1—
DIABP2—
DIABP3—
Shaded columns are derived— = missing value

Comments and assessment materials

Comments

Signed in with GitHub; saved in repository Discussions

Mapping spec

Generated from the benchmark YAML; do not edit by hand

Dataset NameVariable NameVariable LabelTypeCodelist/Controlled TermsCoreComputational MethodOrigin
ADVSUSUBJIDUnique Subject IdentifiercharacterCopy value from VS.USUBJID.Predecessor
ADVSPARAMCDParameter CodecharacterCopy value from VS.PARAMCD.Predecessor
ADVSAVISITNAnalysis Visit NumbernumericCopy value from VS.AVISITN.Predecessor
ADVSAVALAnalysis ValuenumericLast observation carried forward from AVALCOL within each group of USUBJID, PARAMCD, ordered by AVISITN.Derived
VersionDateAuthorDescriptionReviewerSign-off
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-locf/full.md

Edit
15 lines

Following 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

Edit
9 lines

Following 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

Edit
9 lines

Following 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.

yamaa code

Runs the yamaa specification; its result must match the expected output

run.R

Edit
4 lines
library(yamaa)advs <- yamaa_domain("spec.yaml")$outputadvs

run.py

Edit
4 lines
import yamaaadvs = yamaa.yamaa_domain("spec.yaml").outputadvs

Solution without yamaa

Written from the full prompt and the inputs alone; CI checks it reproduces the expected output

solutions/adam-advs-locf/result.R

Edit
27 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

Edit
29 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

Edit
23 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;