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: derive the confirmation flag CONFIRMED for tumor response assessments.

Input: response assessments within a subject, each with a sequence number RSSEQ, a collection date RSDTC, and a standardized result RSSTRESC.

Variables:

  • CONFIRMED: Y when the analysis result AVALC is progressive disease (PD), which needs no confirmation, or when a partial (PR) or complete (CR) response is followed at least 28 days later by another partial or complete response; N when the current assessment has no result, or when the next response is too early, is not a response, or does not exist. Each assessment is compared with the next one in analysis date ADT order within a subject.

Note: assessments sharing a date are ordered by sequence number RSSEQ: the higher-numbered one is the next assessment for the lower-numbered one, zero days later, so it never confirms it.

Inputs

Under review
1 source file

input/rs.csv

Edit
14 rows
input/rs.csv
STUDYIDUSUBJIDRSSEQRSDTCRSSTRESC
PILOT712025-01-01PR
PILOT722025-02-12PR
PILOT712025-01-01PR
PILOT722025-02-12SD
PILOT712025-01-01PR
PILOT722025-01-15PR
PILOT712025-01-01PR
PILOT712025-01-01PD
PILOT722025-02-12NE
PILOT712025-04-01PR
PILOT722025-04-01PR
PILOT712025-01-01PR
PILOT722025-01-29CR
PILOT712025-05-06—

Expected output

Under review
14 expected rows

expected/adrs.csv

Edit
14 rows
expected/adrs.csv
STUDYIDUSUBJIDPARAMCDRSSEQADTAVALCCONFIRMED
PILOT7CONFRESP12025-01-01PRY
PILOT7CONFRESP22025-02-12PRN
PILOT7CONFRESP12025-01-01PRN
PILOT7CONFRESP22025-02-12SDN
PILOT7CONFRESP12025-01-01PRN
PILOT7CONFRESP22025-01-15PRN
PILOT7CONFRESP12025-01-01PRN
PILOT7CONFRESP12025-01-01PDY
PILOT7CONFRESP22025-02-12NEN
PILOT7CONFRESP12025-04-01PRN
PILOT7CONFRESP22025-04-01PRN
PILOT7CONFRESP12025-01-01PRY
PILOT7CONFRESP22025-01-29CRN
PILOT7CONFRESP12025-05-06—N
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 RS.STUDYID.Predecessor
ADRSUSUBJIDUnique Subject IdentifiercharacterCopy value from RS.USUBJID.Predecessor
ADRSPARAMCDParameter CodecharacterSet constant value "CONFRESP".Assigned
ADRSRSSEQSequence NumbernumericCopy value from RS.RSSEQ.Predecessor
ADRSADTAnalysis DatenumericISO 8601Copy value from RS.RSDTC.Predecessor
ADRSAVALCAnalysis Value (C)characterCopy value from RS.RSSTRESC.Predecessor
ADRSCONFIRMEDConfirmation FlagcharacterIf AVALC = 'PD' then "Y"; If AVALC IN ('PR', 'CR') AND NEXTRESP IN ('PR', 'CR') AND DAYS_TO_NEXT >= 28 then "Y"; otherwise "N".Derived
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-confirmed-response/full.md

Edit
21 lines

Following CDISC ADaM standards, use the provided RS dataset to create an ADRS dataset with one record per tumor response assessment.

The output dataset should contain the following columns in this order: STUDYID, USUBJID, PARAMCD, RSSEQ, ADT, AVALC, CONFIRMED

PARAMCD is "CONFRESP" on every record. ADT is the collection date and AVALC is the standardized result, which has no value when no result was collected. Each assessment is compared with the next assessment of the same subject in analysis date order. Assessments sharing a date are ordered by sequence number: the higher-numbered one is the next assessment for the lower-numbered one, zero days later, so it never confirms it. CONFIRMED is "Y" when AVALC is "PD", which needs no confirmation. CONFIRMED is "Y" when AVALC is "PR" or "CR" and the next assessment has a result of "PR" or "CR" at least 28 days later. CONFIRMED is "N" otherwise: when the assessment has no result, when the next assessment is less than 28 days later, when its result is neither "PR" nor "CR", or when there is no next assessment.

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

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

Edit
11 lines

Following CDISC ADaM standards, use the provided RS dataset to create an ADRS dataset with one record per tumor response assessment.

The output dataset should contain the following columns in this order: STUDYID, USUBJID, PARAMCD, RSSEQ, ADT, AVALC, CONFIRMED

PARAMCD is "CONFRESP" on every record. AVALC is "CR", "PR", or "PD", or has no value. CONFIRMED is "Y" or "N".

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

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

Edit
8 lines

Following CDISC ADaM standards, use the provided RS dataset to create an ADRS dataset with one record per tumor response assessment.

The output dataset should contain the following columns in this order: STUDYID, USUBJID, PARAMCD, RSSEQ, ADT, AVALC, CONFIRMED

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-confirmed-response/result.R

Edit
43 lines
# Reference solution for the yamaa benchmark adam-adrs-confirmed-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)rs <- read_csv(  "/app/input/rs.csv",  col_types = cols(    RSSEQ = col_integer(),    RSDTC = col_date(),    .default = col_character()  ))# Each assessment is compared with the next one in analysis date order;# assessments sharing a date are ordered by sequence number, so the# higher-numbered one is zero days later and never confirms the lower.ordered <- rs |>  mutate(PARAMCD = "CONFRESP", ADT = RSDTC, AVALC = RSSTRESC) |>  arrange(STUDYID, USUBJID, ADT, RSSEQ) |>  group_by(STUDYID, USUBJID) |>  mutate(    NEXT_AVALC = lead(AVALC),    NEXT_ADT = lead(ADT),    DAYS = as.integer(NEXT_ADT - ADT),    CONFIRMED = case_when(      AVALC %in% "PD" ~ "Y",      AVALC %in% c("PR", "CR") &        NEXT_AVALC %in% c("PR", "CR") &        !is.na(DAYS) & DAYS >= 28L ~ "Y",      .default = "N"    )  ) |>  ungroup() |>  select(STUDYID, USUBJID, PARAMCD, RSSEQ, ADT, AVALC, CONFIRMED) |>  arrange(USUBJID, ADT, RSSEQ)dir.create("/app/output", showWarnings = FALSE)write_csv(ordered, "/app/output/adrs.csv", na = "")

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

Edit
81 lines
# Reference solution for the yamaa benchmark adam-adrs-confirmed-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 csvfrom datetime import dateINPUT_DIR = "/app/input"OUTPUT_DIR = "/app/output"def parse_date(text):    if text is None or text.strip() == "":        return None    return date.fromisoformat(text.strip())def main():    with open(INPUT_DIR + "/rs.csv", newline="") as fh:        rows = list(csv.DictReader(fh))    records = []    for row in rows:        records.append(            {                "studyid": row["STUDYID"],                "usubjid": row["USUBJID"],                "rsseq": int(row["RSSEQ"]),                "adt": row["RSDTC"].strip() if row["RSDTC"] else "",                "date": parse_date(row["RSDTC"]),                "avalc": row["RSSTRESC"].strip() if row["RSSTRESC"] else "",            }        )    by_subject = {}    for rec in records:        by_subject.setdefault(rec["usubjid"], []).append(rec)    for subject_records in by_subject.values():        subject_records.sort(key=lambda r: (r["date"], r["rsseq"]))        for i, rec in enumerate(subject_records):            nxt = subject_records[i + 1] if i + 1 < len(subject_records) else None            if rec["avalc"] == "PD":                rec["confirmed"] = "Y"            elif rec["avalc"] in ("PR", "CR"):                if (                    nxt is not None                    and nxt["avalc"] in ("PR", "CR")                    and (nxt["date"] - rec["date"]).days >= 28                ):                    rec["confirmed"] = "Y"                else:                    rec["confirmed"] = "N"            else:                rec["confirmed"] = "N"    out_rows = []    for rec in records:        out_rows.append(            {                "STUDYID": rec["studyid"],                "USUBJID": rec["usubjid"],                "PARAMCD": "CONFRESP",                "RSSEQ": rec["rsseq"],                "ADT": rec["adt"],                "AVALC": rec["avalc"],                "CONFIRMED": rec["confirmed"],            }        )    fieldnames = ["STUDYID", "USUBJID", "PARAMCD", "RSSEQ", "ADT", "AVALC", "CONFIRMED"]    with open(OUTPUT_DIR + "/adrs.csv", "w", newline="") as fh:        writer = csv.DictWriter(fh, fieldnames=fieldnames)        writer.writeheader()        writer.writerows(out_rows)if __name__ == "__main__":    main()

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

Edit
26 lines
/* opensas reference solution for the yamaa benchmark adam-adrs-confirmed-response.   Reads the benchmark inputs and derives the requested output.   Execute with the existing opensas runtime: opensas /app/output/result.sas. */data rs;  length STUDYID USUBJID RSDTC RSSTRESC $1024;  infile "/app/input/rs.csv" dsd dlm="," firstobs=2 truncover lrecl=32767;  input STUDYID : $char1024. USUBJID : $char1024. RSSEQ RSDTC : $char1024. RSSTRESC : $char1024.;run;proc sort data=rs out=ordered; by STUDYID USUBJID descending RSDTC descending RSSEQ; run;data result;  length PARAMCD $16 ADT $10 AVALC $1024 CONFIRMED $1 nextresult $1024 nextdate $10;  retain nextresult nextdate;  set ordered; by STUDYID USUBJID;  if first.USUBJID then do; nextresult=''; nextdate=''; end;  PARAMCD='CONFRESP'; ADT=RSDTC; AVALC=RSSTRESC; CONFIRMED='N';  if AVALC='PD' then CONFIRMED='Y';  else if AVALC in ('PR','CR') and nextresult in ('PR','CR') and not missing(ADT) and not missing(nextdate) and input(nextdate,yymmdd10.)-input(ADT,yymmdd10.)>=28 then CONFIRMED='Y';  nextresult=AVALC; nextdate=ADT;run;proc sql;  create table final as select STUDYID, USUBJID, PARAMCD, RSSEQ, ADT, AVALC, CONFIRMED from result;quit;proc export data=final outfile="/app/output/adrs.csv" dbms=csv replace; run;