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: reviewedEditUnder review
What this benchmark means
README.md

Goal: derive AVALC and AVAL flagging whether each subject had measurable disease at baseline.

Input: one record per subject from the subject-level analysis dataset (ADSL), plus tumor identification (TU) records carrying the tumor test code (TUTESTCD), the visit (VISIT), the standardized result (TUSTRESC), and a sequence number (TUSEQ).

Variables:

  • AVALC is Y when the subject has at least one screening tumor identification record (TUTESTCD of TUMIDENT, VISIT of SCREENING) whose result is target disease (TUSTRESC of TARGET); otherwise N. A screening record with a blank result, or a result such as NON-TARGET or BENIGN ABNORMALITY, is not target disease, and neither are target records from later visits.
  • AVAL is 1 when AVALC is Y and 0 when AVALC is N.

Note: every subject in the subject-level dataset gets one flag record, even with no screening tumor assessment, so such a subject is N / 0. A tumor record for a subject outside the subject-level dataset contributes to no flag and creates none.

Inputs

Under review
2 source files

input/adsl.csv

Edit
6 rows
input/adsl.csv
STUDYIDUSUBJID
YAMAA-01
YAMAA-01
YAMAA-01
YAMAA-01
YAMAA-01
YAMAA-01

input/tu.csv

Edit
11 rows
input/tu.csv
STUDYIDUSUBJIDTUSEQTUTESTCDVISITTUSTRESC
YAMAA-011TUMIDENTSCREENINGTARGET
YAMAA-012TUMIDENTSCREENINGTARGET
YAMAA-013TUMIDENTWEEK 1TARGET
YAMAA-014TUMIDENTWEEK 9NON-TARGET
YAMAA-011TUMIDENTSCREENINGNON-TARGET
YAMAA-012TUMIDENTSCREENINGNON-TARGET
YAMAA-011TUMIDENTWEEK 1TARGET
YAMAA-012TUMIDENTWEEK 5TARGET
YAMAA-011TUMIDENTSCREENINGBENIGN ABNORMALITY
YAMAA-011TUMIDENTSCREENING—
YAMAA-011TUMIDENTSCREENINGTARGET

Expected output

Under review
6 expected rows

expected/adrs.csv

Edit
6 rows
expected/adrs.csv
STUDYIDUSUBJIDPARAMCDPARAMAVALCAVAL
YAMAA-01MDISMeasurable Disease at BaselineY1
YAMAA-01MDISMeasurable Disease at BaselineN0
YAMAA-01MDISMeasurable Disease at BaselineN0
YAMAA-01MDISMeasurable Disease at BaselineN0
YAMAA-01MDISMeasurable Disease at BaselineN0
YAMAA-01MDISMeasurable Disease at BaselineN0
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
ADRSSTUDYIDStudy IdentifiercharacterCopy value from ADSL.STUDYID.Predecessor
ADRSUSUBJIDUnique Subject IdentifiercharacterCopy value from ADSL.USUBJID.Predecessor
ADRSPARAMCDParameter CodecharacterSet constant value "MDIS".Assigned
ADRSPARAMParametercharacterSet constant value "Measurable Disease at Baseline".Assigned
ADRSAVALCAnalysis Value (C)characterY, N"Y" when TUSTRESC IS NOT NULL, with TUSTRESC taken from the first TU record matching on the shared output keys, where TU.TUTESTCD = 'TUMIDENT' AND TU.VISIT = 'SCREENING' AND TU.TUSTRESC = 'TARGET', ordered by TU.TUSEQ, and no match yields blank; "N" otherwise; "N" when the condition is unknown.Derived
ADRSAVALAnalysis ValuenumericRecode AVALC: "Y" → "1", "N" → "0"; missing or unlisted values are errors.Derived
VariablePermitted values
AVALCY, N
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-adrs-measurable-disease/full.md

Edit
23 lines

Following CDISC ADaM standards, use the provided ADSL and TU datasets to create an ADRS dataset with one record per subject.

The output dataset should contain the following columns in this order: STUDYID, USUBJID, PARAMCD, PARAM, AVALC, AVAL

Use PARAMCD "MDIS" and PARAM "Measurable Disease at Baseline".

AVALC is Y when the subject has at least one screening tumor identification record (TUTESTCD of TUMIDENT, VISIT of SCREENING) whose result is target disease (TUSTRESC of TARGET); otherwise N. A screening record with a blank result, or a result such as NON-TARGET or BENIGN ABNORMALITY, is not target disease, and neither are target records from later visits. AVAL is 1 when AVALC is Y and 0 when AVALC is N.

Every subject in the subject-level dataset gets one flag record, even with no screening tumor assessment, so such a subject is N and 0. A tumor record for a subject outside the subject-level dataset contributes to no flag and creates none.

Read the source datasets from /app/input and save the completed dataset as /app/output/adrs.csv.

prompts/adam-adrs-measurable-disease/conventions.md

Edit
12 lines

Following CDISC ADaM standards, use the provided ADSL and TU datasets to create an ADRS dataset with one record per subject.

The output dataset should contain the following columns in this order: STUDYID, USUBJID, PARAMCD, PARAM, AVALC, AVAL

Use PARAMCD "MDIS" and PARAM "Measurable Disease at Baseline".

AVALC is Y or N. AVAL is 1 when AVALC is Y and 0 when AVALC is N.

Read the source datasets from /app/input and save the completed dataset as /app/output/adrs.csv.

prompts/adam-adrs-measurable-disease/brief.md

Edit
8 lines

Following CDISC ADaM standards, use the provided ADSL and TU datasets to create an ADRS dataset with one record per subject.

The output dataset should contain the following columns in this order: STUDYID, USUBJID, PARAMCD, PARAM, AVALC, AVAL

Read the source datasets from /app/input and save the completed dataset as /app/output/adrs.csv.

yamaa code

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

run.R

Edit
4 lines
library(yamaa)adrs <- yamaa_domain("spec.yaml")$outputadrs

run.py

Edit
4 lines
import yamaaadrs = yamaa.yamaa_domain("spec.yaml").outputadrs

Solution without yamaa

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

solutions/adam-adrs-measurable-disease/result.R

Edit
40 lines
# Reference solution for the yamaa benchmark adam-adrs-measurable-disease (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)adsl <- read_csv(  "/app/input/adsl.csv",  col_types = cols(.default = col_character()))tu <- read_csv(  "/app/input/tu.csv",  col_types = cols(TUSEQ = col_integer(), .default = col_character()))# Target disease at screening: a screening tumor identification record# whose result is target. Later target records do not count.target_subjects <- tu |>  filter(    TUTESTCD %in% "TUMIDENT",    VISIT %in% "SCREENING",    TUSTRESC %in% "TARGET"  ) |>  distinct(USUBJID)adrs <- adsl |>  mutate(    PARAMCD = "MDIS",    PARAM = "Measurable Disease at Baseline",    AVALC = if_else(USUBJID %in% target_subjects$USUBJID, "Y", "N"),    AVAL = if_else(AVALC == "Y", 1L, 0L)  ) |>  select(STUDYID, USUBJID, PARAMCD, PARAM, AVALC, AVAL) |>  arrange(USUBJID)dir.create("/app/output", showWarnings = FALSE)write_csv(adrs, "/app/output/adrs.csv", na = "")

solutions/adam-adrs-measurable-disease/result.py

Edit
40 lines
# Reference solution for the yamaa benchmark adam-adrs-measurable-disease (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 pladsl = pl.read_csv("/app/input/adsl.csv", infer_schema=False)tu = pl.read_csv("/app/input/tu.csv", infer_schema=False).with_columns(    pl.col("TUSEQ").cast(pl.Int64))# Target disease at screening: a screening tumor identification record# whose result is target. Later target records do not count.target_subjects = tu.filter(    (pl.col("TUTESTCD") == "TUMIDENT")    & (pl.col("VISIT") == "SCREENING")    & (pl.col("TUSTRESC") == "TARGET")).select("USUBJID").unique()adrs = (    adsl.with_columns(        PARAMCD=pl.lit("MDIS"),        PARAM=pl.lit("Measurable Disease at Baseline"),        AVALC=pl.when(pl.col("USUBJID").is_in(target_subjects["USUBJID"]))        .then(pl.lit("Y"))        .otherwise(pl.lit("N")),    )    .with_columns(        AVAL=pl.when(pl.col("AVALC") == "Y").then(1).otherwise(0).cast(pl.Int64)    )    .select("STUDYID", "USUBJID", "PARAMCD", "PARAM", "AVALC", "AVAL")    .sort("USUBJID"))Path("/app/output").mkdir(exist_ok=True)adrs.write_csv("/app/output/adrs.csv")

solutions/adam-adrs-measurable-disease/result.sas

Edit
30 lines
/* opensas reference solution for the yamaa benchmark adam-adrs-measurable-disease.   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.;run;data tu;  length STUDYID USUBJID TUTESTCD VISIT TUSTRESC $1024;  infile "/app/input/tu.csv" dsd dlm="," firstobs=2 truncover lrecl=32767;  input STUDYID : $char1024. USUBJID : $char1024. TUSEQ TUTESTCD : $char1024. VISIT : $char1024. TUSTRESC : $char1024.;run;proc sql;  create table counts as select STUDYID,USUBJID,count(*) as matches from tu where TUTESTCD='TUMIDENT' and VISIT='SCREENING' and TUSTRESC='TARGET' group by STUDYID,USUBJID;  create table joined as select a.*,b.matches from adsl as a left join counts as b on a.STUDYID=b.STUDYID and a.USUBJID=b.USUBJID;quit;data result;  length PARAMCD $8 PARAM $40 AVALC $1;  set joined; PARAMCD='MDIS'; PARAM='Measurable Disease at Baseline';  AVALC='N'; AVAL=0; if matches>0 then do; AVALC='Y'; AVAL=1; end;run;proc sql;  create table final as select STUDYID, USUBJID, PARAMCD, PARAM, AVALC, AVAL from result;quit;proc export data=final outfile="/app/output/adrs.csv" dbms=csv replace; run;