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: carry each investigator-scored overall response assessment into the analysis dataset as one record under the OVR (Overall Response by Investigator) parameter, adding the completed date (ADT), the study day (ADY), the response rank (AVAL), and the per-date flag (ANL01FL).

Input: one record per collected response assessment carrying the test code RSTESTCD, the evaluator RSEVAL, the assessment date RSDTC, and the result RSSTRESC, plus the treatment start TRTSDT from the subject-level dataset. Only assessments the investigator (INVESTIGATOR) scored as overall response (OVRLRESP) leave a record; a target-lesion assessment (TRGRESP) and an independent assessor (INDEPENDENT ASSESSOR) assessment leave none.

Variables:

  • RSSEQ numbers the assessment within the subject; PARAMCD and PARAM carry the fixed parameter code and description.
  • RSDTC carries the collected assessment date as it was recorded.
  • ADT is the completed analysis date. A fully collected date is used as it stands; a year and month without a day complete to the first of the month, and a year alone to 1 January. An assessment with no readable date stops the run.
  • ADY is the study day of the assessment, counting the treatment start as day one.
  • AVALC is the collected 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).
  • AVAL ranks the response from best to worst as 1 (CR), 2 (PR), 3 (SD), 4 (NON-CR/NON-PD), 5 (PD), or 6 (NE).
  • ANL01FL is Y for one record at each assessment date: the worst (largest AVAL) response that day, with the lowest RSSEQ breaking ties when a day carries the same worst response twice. It is empty otherwise.

Note: a completed date counts exactly as a collected one in every comparison that follows, so grouping by date and measuring from the treatment start never depend on how much of the date was collected. An assessment dated exactly on the treatment start lands on study day one.

Inputs

Under review
2 source files

input/adsl.csv

Edit
8 rows
input/adsl.csv
STUDYIDUSUBJIDTRTSDT
YAMAA-012025-01-06
YAMAA-012025-01-13
YAMAA-012025-01-20
YAMAA-012025-01-27
YAMAA-012025-02-03
YAMAA-012025-01-01
YAMAA-012025-01-06
YAMAA-012025-01-13

input/rs.csv

Edit
18 rows
input/rs.csv
STUDYIDUSUBJIDRSSEQRSTESTCDRSEVALRSDTCRSSTRESC
YAMAA-011OVRLRESPINVESTIGATOR2025-02-03PR
YAMAA-012OVRLRESPINVESTIGATOR2025-03-17CR
YAMAA-013OVRLRESPINVESTIGATOR2025-04-28PD
YAMAA-011OVRLRESPINVESTIGATOR2025-02-10SD
YAMAA-012OVRLRESPINVESTIGATOR2025-02-10PD
YAMAA-013OVRLRESPINVESTIGATOR2025-03-24NE
YAMAA-011OVRLRESPINVESTIGATOR2025-03NON-CR/NON-PD
YAMAA-011OVRLRESPINVESTIGATOR2025-02-17SD
YAMAA-012OVRLRESPINVESTIGATOR2025-02-17SD
YAMAA-011TRGRESPINVESTIGATOR2025-05-05PR
YAMAA-012OVRLRESPINDEPENDENT ASSESSOR2025-05-05PR
YAMAA-013OVRLRESPINVESTIGATOR2025-05-05CR
YAMAA-011OVRLRESPINVESTIGATOR2025PR
YAMAA-011OVRLRESPINVESTIGATOR2025-01-06CR
YAMAA-011OVRLRESPINVESTIGATOR2025-02-10SD
YAMAA-012OVRLRESPINVESTIGATOR2025-02-10PD
YAMAA-013OVRLRESPINVESTIGATOR2025-02-10NE
YAMAA-014OVRLRESPINVESTIGATOR2025-02-10NE

Expected output

Under review
16 expected rows

expected/adrs.csv

Edit
16 rows
expected/adrs.csv
STUDYIDUSUBJIDRSSEQPARAMCDPARAMRSDTCADTADYAVALCAVALANL01FL
YAMAA-011OVROverall Response by Investigator2025-02-032025-02-0329PR2Y
YAMAA-012OVROverall Response by Investigator2025-03-172025-03-1771CR1Y
YAMAA-013OVROverall Response by Investigator2025-04-282025-04-28113PD5Y
YAMAA-011OVROverall Response by Investigator2025-02-102025-02-1029SD3—
YAMAA-012OVROverall Response by Investigator2025-02-102025-02-1029PD5Y
YAMAA-013OVROverall Response by Investigator2025-03-242025-03-2471NE6Y
YAMAA-011OVROverall Response by Investigator2025-032025-03-0141NON-CR/NON-PD4Y
YAMAA-011OVROverall Response by Investigator2025-02-172025-02-1722SD3Y
YAMAA-012OVROverall Response by Investigator2025-02-172025-02-1722SD3—
YAMAA-013OVROverall Response by Investigator2025-05-052025-05-0592CR1Y
YAMAA-011OVROverall Response by Investigator20252025-01-011PR2Y
YAMAA-011OVROverall Response by Investigator2025-01-062025-01-061CR1Y
YAMAA-011OVROverall Response by Investigator2025-02-102025-02-1029SD3—
YAMAA-012OVROverall Response by Investigator2025-02-102025-02-1029PD5—
YAMAA-013OVROverall Response by Investigator2025-02-102025-02-1029NE6Y
YAMAA-014OVROverall Response by Investigator2025-02-102025-02-1029NE6—
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
ADRSRSSEQSequence NumbernumericCopy value from RS.RSSEQ.Predecessor
ADRSPARAMCDParameter CodecharacterSet constant value "OVR".Assigned
ADRSPARAMParametercharacterSet constant value "Overall Response by Investigator".Assigned
ADRSRSDTCDate/Time of AssessmentcharacterCopy value from RS.RSDTC.Predecessor
ADRSADTAnalysis DatenumericISO 8601Impute incomplete date from RSDTC, defaulting month=1, day=1; invalid text is an error.Derived
ADRSAVALCAnalysis Value (C)characterCR, PR, SD, NON-CR/NON-PD, PD, NECopy value from RS.RSSTRESC.Predecessor
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
ADRSADYAnalysis Relative DaynumericCDISC study day of ADT against TRTSDT as day 1; there is no day zero.Derived
ADRSANL01FLAnalysis Record Flag 01characterY"Y" when WORSTORD = 1; blank otherwise.Derived
VariablePermitted values
AVALCCR, PR, SD, NON-CR/NON-PD, PD, NE
ANL01FLY
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-response-records/full.md

Edit
42 lines

Following CDISC ADaM standards, use the provided ADSL and RS datasets to create an ADRS dataset with one record per investigator-scored overall response assessment.

The output dataset should contain the following columns in this order: STUDYID, USUBJID, RSSEQ, PARAMCD, PARAM, RSDTC, ADT, ADY, AVALC, AVAL, ANL01FL

  • A record appears only for an assessment the investigator scored as overall response, with RSTESTCD "OVRLRESP" and RSEVAL "INVESTIGATOR".
  • A target-lesion assessment (RSTESTCD "TRGRESP") and an assessment scored by an independent assessor (RSEVAL "INDEPENDENT ASSESSOR") leave no record.
  • RSSEQ is the sequence number of the assessment within the subject.
  • PARAMCD is "OVR" and PARAM is "Overall Response by Investigator" on every record.
  • RSDTC holds the assessment date exactly as collected, even when only a year or a year and a month were collected.
  • ADT is the completed analysis date: a fully collected date is used as it stands, a year and month without a day complete to the first of the month, and a year alone completes to 1 January.
  • A completed date counts exactly as a collected one in every comparison, so the study day and the per-date flag never depend on how much of the date was collected.
  • ADY is the study day of the assessment, counting the treatment start as day one, so an assessment dated exactly on the treatment start lands on study day one.
  • AVALC is the collected response, one of "CR", "PR", "SD", "NON-CR/NON-PD", "PD", or "NE".
  • The codes stand for complete response ("CR"), partial response ("PR"), stable disease ("SD"), neither complete response nor progressive disease ("NON-CR/NON-PD"), progressive disease ("PD"), and not evaluable ("NE").
  • AVAL ranks the response from best to worst: 1 for "CR", 2 for "PR", 3 for "SD", 4 for "NON-CR/NON-PD", 5 for "PD", and 6 for "NE".
  • ANL01FL is "Y" for one record at each assessment date (ADT): the record carrying the worst response that day, the largest AVAL, with the lowest RSSEQ breaking ties when a day carries the same worst response twice.
  • ANL01FL has no value on every other record.

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

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

Edit
19 lines

Following CDISC ADaM standards, use the provided ADSL and RS datasets to create an ADRS dataset with one record per investigator-scored overall response assessment.

The output dataset should contain the following columns in this order: STUDYID, USUBJID, RSSEQ, PARAMCD, PARAM, RSDTC, ADT, ADY, AVALC, AVAL, ANL01FL

PARAMCD is "OVR" and PARAM is "Overall Response by Investigator" on every record. ADY is the study day of the assessment, counting the treatment start as day one. AVALC is "CR", "PR", "SD", "NON-CR/NON-PD", "PD", or "NE". The codes stand for complete response ("CR"), partial response ("PR"), stable disease ("SD"), neither complete response nor progressive disease ("NON-CR/NON-PD"), progressive disease ("PD"), and not evaluable ("NE"). AVAL ranks the response from best to worst: 1 for "CR", 2 for "PR", 3 for "SD", 4 for "NON-CR/NON-PD", 5 for "PD", and 6 for "NE". ANL01FL is "Y" or has no value.

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

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

Edit
9 lines

Following CDISC ADaM standards, use the provided ADSL and RS datasets to create an ADRS dataset with one record per investigator-scored overall response assessment.

The output dataset should contain the following columns in this order: STUDYID, USUBJID, RSSEQ, PARAMCD, PARAM, RSDTC, ADT, ADY, AVALC, AVAL, ANL01FL

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

Edit
71 lines
# Reference solution for the yamaa benchmark adam-adrs-response-records (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(lubridate)library(readr)library(stringr)adsl <- read_csv(  "/app/input/adsl.csv",  col_types = cols(TRTSDT = col_date(), .default = col_character()))rs <- read_csv(  "/app/input/rs.csv",  col_types = cols(RSSEQ = col_integer(), .default = col_character()))# Only investigator overall response assessments leave a record.base <- rs |>  filter(RSTESTCD %in% "OVRLRESP", RSEVAL %in% "INVESTIGATOR") |>  left_join(select(adsl, USUBJID, TRTSDT), by = "USUBJID") |>  mutate(    PARAMCD = "OVR",    PARAM = "Overall Response by Investigator",    RSDTC = RSDTC,    ADT = case_when(      str_detect(RSDTC, "^[0-9]{4}-[0-9]{2}-[0-9]{2}$") ~ suppressWarnings(ymd(RSDTC, quiet = TRUE)),      str_detect(RSDTC, "^[0-9]{4}-[0-9]{2}$") ~ suppressWarnings(ymd(paste0(RSDTC, "-01"), quiet = TRUE)),      str_detect(RSDTC, "^[0-9]{4}$") ~ suppressWarnings(ymd(paste0(RSDTC, "-01-01"), quiet = TRUE)),      .default = as.Date(NA)    ),    ADY = case_when(      is.na(ADT) | is.na(TRTSDT) ~ NA_integer_,      ADT >= TRTSDT ~ as.integer(ADT - TRTSDT) + 1L,      .default = as.integer(ADT - TRTSDT)    ),    AVALC = RSSTRESC,    AVAL = case_when(      AVALC == "CR" ~ 1L,      AVALC == "PR" ~ 2L,      AVALC == "SD" ~ 3L,      AVALC == "NON-CR/NON-PD" ~ 4L,      AVALC == "PD" ~ 5L,      AVALC == "NE" ~ 6L    )  )# One flagged record at each assessment date: the worst response that day,# with the lowest sequence number breaking ties.flagged <- base |>  group_by(STUDYID, USUBJID, ADT) |>  arrange(desc(AVAL), RSSEQ, .by_group = TRUE) |>  mutate(    rank = row_number(),    ANL01FL = if_else(rank == 1L, "Y", NA_character_)  ) |>  ungroup() |>  select(-rank)adrs <- flagged |>  select(    STUDYID, USUBJID, RSSEQ, PARAMCD, PARAM, RSDTC, ADT, ADY,    AVALC, AVAL, ANL01FL  ) |>  arrange(USUBJID, ADT, RSSEQ)dir.create("/app/output", showWarnings = FALSE)write_csv(adrs, "/app/output/adrs.csv", na = "")

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

Edit
95 lines
# Reference solution for the yamaa benchmark adam-adrs-response-records (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."""Create ADRS (one record per investigator-scored overall responseassessment) from ADSL and RS, following CDISC ADaM standards."""import csvfrom datetime import dateINPUT_DIR = "/app/input"OUTPUT_DIR = "/app/output"AVAL_MAP = {    "CR": 1,    "PR": 2,    "SD": 3,    "NON-CR/NON-PD": 4,    "PD": 5,    "NE": 6,}def complete_date(rsdtc):    """Complete a possibly partial ISO date: a year and month without a    day complete to the first of the month; a year alone completes to    1 January."""    parts = rsdtc.split("-")    year = int(parts[0])    month = int(parts[1]) if len(parts) > 1 else 1    day = int(parts[2]) if len(parts) > 2 else 1    return date(year, month, day)def parse_full_date(text):    year, month, day = (int(p) for p in text.split("-"))    return date(year, month, day)def main():    with open(f"{INPUT_DIR}/adsl.csv", newline="") as f:        adsl = {row["USUBJID"]: row for row in csv.DictReader(f)}    with open(f"{INPUT_DIR}/rs.csv", newline="") as f:        rs_rows = list(csv.DictReader(f))    records = []    for row in rs_rows:        if row["RSTESTCD"] != "OVRLRESP" or row["RSEVAL"] != "INVESTIGATOR":            continue        trtsdt = parse_full_date(adsl[row["USUBJID"]]["TRTSDT"])        adt = complete_date(row["RSDTC"])        ady = (adt - trtsdt).days + 1        avalc = row["RSSTRESC"]        records.append(            {                "STUDYID": row["STUDYID"],                "USUBJID": row["USUBJID"],                "RSSEQ": row["RSSEQ"],                "PARAMCD": "OVR",                "PARAM": "Overall Response by Investigator",                "RSDTC": row["RSDTC"],                "ADT": adt.isoformat(),                "ADY": ady,                "AVALC": avalc,                "AVAL": AVAL_MAP[avalc],                "ANL01FL": "",            }        )    # ANL01FL: one record per subject per assessment date (ADT) -- the    # record carrying the worst response that day (largest AVAL), with    # the lowest RSSEQ breaking ties.    groups = {}    for rec in records:        key = (rec["USUBJID"], rec["ADT"])        groups.setdefault(key, []).append(rec)    for group in groups.values():        flagged = min(group, key=lambda r: (-r["AVAL"], int(r["RSSEQ"])))        flagged["ANL01FL"] = "Y"    fieldnames = [        "STUDYID", "USUBJID", "RSSEQ", "PARAMCD", "PARAM", "RSDTC",        "ADT", "ADY", "AVALC", "AVAL", "ANL01FL",    ]    with open(f"{OUTPUT_DIR}/adrs.csv", "w", newline="") as f:        writer = csv.DictWriter(f, fieldnames=fieldnames)        writer.writeheader()        writer.writerows(records)if __name__ == "__main__":    main()

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

Edit
35 lines
/* opensas reference solution for the yamaa benchmark adam-adrs-response-records.   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 TRTSDT $1024;  infile "/app/input/adsl.csv" dsd dlm="," firstobs=2 truncover lrecl=32767;  input STUDYID : $char1024. USUBJID : $char1024. TRTSDT : $char1024.;run;data rs;  length STUDYID USUBJID RSTESTCD RSEVAL RSDTC RSSTRESC $1024;  infile "/app/input/rs.csv" dsd dlm="," firstobs=2 truncover lrecl=32767;  input STUDYID : $char1024. USUBJID : $char1024. RSSEQ RSTESTCD : $char1024. RSEVAL : $char1024. RSDTC : $char1024. RSSTRESC : $char1024.;run;proc sql; create table joined as select a.*,b.TRTSDT from rs as a left join adsl as b on a.STUDYID=b.STUDYID and a.USUBJID=b.USUBJID where a.RSTESTCD='OVRLRESP' and a.RSEVAL='INVESTIGATOR'; quit;data assessments;  length PARAMCD $8 PARAM $40 ADT $10 AVALC $16;  set joined; PARAMCD='OVR'; PARAM='Overall Response by Investigator';  ADT=RSDTC;  if lengthn(RSDTC)=7 then ADT=cats(RSDTC,'-01');  if lengthn(RSDTC)=4 then ADT=cats(RSDTC,'-01-01');  if not missing(ADT) and not missing(TRTSDT) then do;    ADY=input(ADT,yymmdd10.)-input(TRTSDT,yymmdd10.); if ADY>=0 then ADY=ADY+1;  end;  AVALC=RSSTRESC; 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;run;proc sort data=assessments; by STUDYID USUBJID ADT descending AVAL RSSEQ; run;data result; length ANL01FL $1; set assessments; by STUDYID USUBJID ADT; if first.ADT then ANL01FL='Y'; run;proc sql;  create table final as select STUDYID, USUBJID, RSSEQ, PARAMCD, PARAM, RSDTC, ADT, ADY, AVALC, AVAL, ANL01FL from result;quit;proc export data=final outfile="/app/output/adrs.csv" dbms=csv replace; run;