Review ask

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

Lifecycle: reviewedEditUnder review
What this benchmark means
README.md

Public entries: Python and R. Passing coverage requires an installed inventory.

Goal: write one best overall response record for each subject, carrying the randomization date (RANDDT) through and adding the response (AVALC), its rank (AVAL), and its supporting date (ADT).

Input: subject-level records with randomization date (RANDDT), plus a prepared response selection in which the record with BORSEQ equal to 1 holds the subject's winning category (BORCAT) and date (ADT).

Variables:

  • AVALC is the best overall response: complete response (CR), partial response (PR), stable disease (SD), neither complete response nor progressive disease (NON-CR/NON-PD), progressive disease (PD), or not evaluable (NE); empty when the subject has no record with BORSEQ equal to 1.
  • AVAL ranks that response as 1 (complete response), 2 (partial response), 3 (stable disease), 4 (neither complete response nor progressive disease), 5 (progressive disease), or 6 (not evaluable); empty when AVALC is empty.
  • ADT is the analysis date supporting the response, taken from that record's date; empty whenever AVALC is.

Note: every subject in the subject-level records gets one record, so a subject with no record with BORSEQ equal to 1 keeps its randomization date with response, rank, and date all empty. The supporting date is never before the randomization date; it may fall exactly on it.

Inputs

Under review
2 source files

input/adrs_selection.csv

Edit
12 rows
input/adrs_selection.csv
STUDYIDUSUBJIDASEQADTRANDDYAVALCBORCATBORPRIBORSEQ
YAMAA-0112025-02-1742PRPR22
YAMAA-0122025-04-0791CRCR11
YAMAA-0112025-02-1028SDNE63
YAMAA-0122025-04-1491SDSD31
YAMAA-0132025-05-12119SDSD32
YAMAA-0112025-02-1021SDNE62
YAMAA-0122025-03-0342PDPD51
YAMAA-0112025-02-2428SDNE61
YAMAA-0122025-04-0770NENE62
YAMAA-0112025-03-3149NON-CR/NON-PDNON-CR/NON-PD41
YAMAA-0112025-03-2435PRPR21
YAMAA-0112025-02-241CRCR11

input/adsl.csv

Edit
8 rows
input/adsl.csv
STUDYIDUSUBJIDRANDDT
YAMAA-012025-01-06
YAMAA-012025-01-13
YAMAA-012025-01-20
YAMAA-012025-01-27
YAMAA-012025-02-03
YAMAA-012025-02-10
YAMAA-012025-02-17
YAMAA-012025-02-24

Expected output

Under review
8 expected rows

expected/adrs.csv

Edit
8 rows
expected/adrs.csv
STUDYIDUSUBJIDPARAMCDPARAMRANDDTAVALCAVALADT
YAMAA-01BORBest Overall Response by Investigator2025-01-06CR12025-04-07
YAMAA-01BORBest Overall Response by Investigator2025-01-13SD32025-04-14
YAMAA-01BORBest Overall Response by Investigator2025-01-20PD52025-03-03
YAMAA-01BORBest Overall Response by Investigator2025-01-27NE62025-02-24
YAMAA-01BORBest Overall Response by Investigator2025-02-03———
YAMAA-01BORBest Overall Response by Investigator2025-02-10NON-CR/NON-PD42025-03-31
YAMAA-01BORBest Overall Response by Investigator2025-02-17PR22025-03-24
YAMAA-01BORBest Overall Response by Investigator2025-02-24CR12025-02-24
Shaded columns are derived— = missing value

Human review and assessment

Your review

3 questions and your comments · View benchmark 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 "BOR".Assigned
ADRSPARAMParametercharacterSet constant value "Best Overall Response by Investigator".Assigned
ADRSRANDDTRandomization DatenumericISO 8601Copy value from ADSL.RANDDT.Predecessor
ADRSAVALCAnalysis Value (C)characterCR, PR, SD, NON-CR/NON-PD, PD, NETake BORCAT from the ADRSSEL record matching on STUDYID and USUBJID, where ADRSSEL.BORSEQ = 1, and no match yields blank.Derived
ADRSAVALAnalysis ValuenumericRecode AVALC: "CR" → "1", "PR" → "2", "SD" → "3", "NON-CR/NON-PD" → "4", "PD" → "5", "NE" → "6"; missing values stay missing; unlisted values are errors.Derived
ADRSADTAnalysis DatenumericISO 8601Take ADT from the ADRSSEL record matching on STUDYID and USUBJID, where ADRSSEL.BORSEQ = 1, and no match yields blank.Derived
VariablePermitted values
AVALCCR, PR, SD, NON-CR/NON-PD, PD, NE
VersionDateAuthorDescriptionReviewerSign-off
1.72026-10-20yamaa docs buildRead 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.62026-10-17yamaa docs buildDescribe collected date parts written as ISO 8601 date text and times of day counted in seconds since midnight
1.52026-10-17yamaa docs buildName 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.42026-10-15yamaa docs buildState datetime precision codes through the hour and minute, and complete only the time parts a collected datetime lacks
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-best-response/full.md

Edit
28 lines

Following CDISC ADaM standards, use the provided ADRS_SELECTION and ADSL 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, RANDDT, AVALC, AVAL, ADT

  • PARAMCD is "BOR" and PARAM is "Best Overall Response by Investigator" on every record.
  • Every subject in ADSL has a record, even when the subject has no ADRS_SELECTION record with BORSEQ 1.
  • AVALC is the category in BORCAT on the subject's ADRS_SELECTION record with BORSEQ 1: "CR" for complete response, "PR" for partial response, "SD" for stable disease, "NON-CR/NON-PD" for neither complete response nor progressive disease, "PD" for progressive disease, and "NE" for not evaluable.
  • AVALC has no value when the subject has no ADRS_SELECTION record with BORSEQ 1.
  • AVAL is 1 when AVALC is "CR", 2 when AVALC is "PR", 3 when AVALC is "SD", 4 when AVALC is "NON-CR/NON-PD", 5 when AVALC is "PD", and 6 when AVALC is "NE".
  • AVAL has no value when AVALC has no value.
  • ADT is the analysis date supporting the response, taken from the date of the subject's ADRS_SELECTION record with BORSEQ 1.
  • ADT has no value whenever AVALC has no value.
  • ADT is never before RANDDT, and it may fall exactly on RANDDT.

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

prompts/adam-adrs-best-response/conventions.md

Edit
17 lines

Following CDISC ADaM standards, use the provided ADRS_SELECTION and ADSL 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, RANDDT, AVALC, AVAL, ADT

  • PARAMCD is "BOR" and PARAM is "Best Overall Response by Investigator" on every record.
  • AVALC is "CR" for complete response, "PR" for partial response, "SD" for stable disease, "NON-CR/NON-PD" for neither complete response nor progressive disease, "PD" for progressive disease, or "NE" for not evaluable, or has no value.
  • AVAL is 1 for "CR", 2 for "PR", 3 for "SD", 4 for "NON-CR/NON-PD", 5 for "PD", and 6 for "NE", or has no value.

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

prompts/adam-adrs-best-response/brief.md

Edit
8 lines

Following CDISC ADaM standards, use the provided ADRS_SELECTION and ADSL 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, RANDDT, AVALC, AVAL, ADT

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

yamaa code

Public calls generated from benchmark.yaml; results must match the expected output

R

Edit
3 lines
library(yamaa)yamaa_spec("spec.yaml")$run()$output

Python

Edit
3 lines
import yamaayamaa.spec("spec.yaml").run().output

Solution without yamaa

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

solutions/adam-adrs-best-response/result.R

Edit
51 lines
# Reference solution for the yamaa benchmark adam-adrs-best-response (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(RANDDT = col_date(), .default = col_character()))selection <- read_csv(  "/app/input/adrs_selection.csv",  col_types = cols(    ASEQ = col_integer(),    ADT = col_date(),    RANDDY = col_integer(),    BORPRI = col_integer(),    BORSEQ = col_integer(),    .default = col_character()  ))# The best overall response is the selection record numbered 1.best <- selection |>  filter(BORSEQ == 1L) |>  select(USUBJID, BORCAT, BESTDT = ADT)adrs <- adsl |>  left_join(best, by = "USUBJID") |>  mutate(    PARAMCD = "BOR",    PARAM = "Best Overall Response by Investigator",    AVALC = BORCAT,    AVAL = case_when(      AVALC == "CR" ~ 1L,      AVALC == "PR" ~ 2L,      AVALC == "SD" ~ 3L,      AVALC == "NON-CR/NON-PD" ~ 4L,      AVALC == "PD" ~ 5L,      AVALC == "NE" ~ 6L    ),    ADT = BESTDT  ) |>  select(STUDYID, USUBJID, PARAMCD, PARAM, RANDDT, AVALC, AVAL, ADT) |>  arrange(USUBJID)dir.create("/app/output", showWarnings = FALSE)write_csv(adrs, "/app/output/adrs.csv", na = "")

solutions/adam-adrs-best-response/result.py

Edit
53 lines
# Reference solution for the yamaa benchmark adam-adrs-best-response (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 csvAVAL_BY_AVALC = {    "CR": "1",    "PR": "2",    "SD": "3",    "NON-CR/NON-PD": "4",    "PD": "5",    "NE": "6",}with open("/app/input/adsl.csv", newline="") as f:    adsl = list(csv.DictReader(f))with open("/app/input/adrs_selection.csv", newline="") as f:    selection = list(csv.DictReader(f))best = {}for row in selection:    if row["BORSEQ"] == "1":        best[row["USUBJID"]] = rowout = []for subj in adsl:    usubjid = subj["USUBJID"]    sel = best.get(usubjid)    avalc = sel["BORCAT"] if sel else ""    aval = AVAL_BY_AVALC[avalc] if avalc else ""    adt = sel["ADT"] if sel else ""    out.append(        {            "STUDYID": subj["STUDYID"],            "USUBJID": usubjid,            "PARAMCD": "BOR",            "PARAM": "Best Overall Response by Investigator",            "RANDDT": subj["RANDDT"],            "AVALC": avalc,            "AVAL": aval,            "ADT": adt,        }    )fields = ["STUDYID", "USUBJID", "PARAMCD", "PARAM", "RANDDT", "AVALC", "AVAL", "ADT"]with open("/app/output/adrs.csv", "w", newline="") as f:    writer = csv.DictWriter(f, fieldnames=fields)    writer.writeheader()    writer.writerows(out)

solutions/adam-adrs-best-response/result.sas

Edit
28 lines
/* opensas reference solution for the yamaa benchmark adam-adrs-best-response.   Reads the benchmark inputs and derives the requested output.   Execute with the existing opensas runtime: opensas /app/output/result.sas. */data adrs_selection;  length STUDYID USUBJID ADT RANDDY AVALC BORCAT BORPRI $1024;  infile "/app/input/adrs_selection.csv" dsd dlm="," firstobs=2 truncover lrecl=32767;  input STUDYID : $char1024. USUBJID : $char1024. ASEQ ADT : $char1024. RANDDY : $char1024. AVALC : $char1024. BORCAT : $char1024. BORPRI : $char1024. BORSEQ;run;data adsl;  length STUDYID USUBJID RANDDT $1024;  infile "/app/input/adsl.csv" dsd dlm="," firstobs=2 truncover lrecl=32767;  input STUDYID : $char1024. USUBJID : $char1024. RANDDT : $char1024.;run;proc sql; create table joined as select a.*,b.BORCAT as AVALC,b.ADT from adsl as a left join adrs_selection as b on a.STUDYID=b.STUDYID and a.USUBJID=b.USUBJID and b.BORSEQ=1; quit;data result;  length PARAMCD $8 PARAM $40;  set joined; PARAMCD='BOR'; PARAM='Best Overall Response by Investigator';  select(AVALC); when('CR') AVAL=1; when('PR') AVAL=2; when('SD') AVAL=3; when('NON-CR/NON-PD') AVAL=4; when('PD') AVAL=5; when('NE') AVAL=6; otherwise AVAL=.; end;  if missing(AVALC) then ADT='';run;proc sql;  create table final as select STUDYID, USUBJID, PARAMCD, PARAM, RANDDT, AVALC, AVAL, ADT from result;quit;proc export data=final outfile="/app/output/adrs.csv" dbms=csv replace; run;