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: summarize exposure for each planned subject-treatment, carrying EXTRT (treatment name) and EXDOSU (dose units) through and adding DOSECUM (cumulative dose), NCYCLES (cycle count), and RDI (relative dose intensity).

Input: planned treatments with dose units and planned totals, plus exposure records holding administered doses.

Variables:

  • DOSECUM is the total administered dose across the subject's exposure records for the treatment. A record with no collected dose adds nothing; a planned treatment with no exposure records has an empty total.
  • NCYCLES is the number of exposure records for the treatment. Every record counts, even one with a zero or missing dose. A planned treatment with no exposure records has an empty count.
  • RDI is cumulative dose as a percentage of the planned total dose across its cycles. It is empty when the planned total is zero or when there is no cumulative dose to compare.

Note: an administered zero dose adds nothing to the total but its record still counts, so a treatment given only as zero doses has a zero total alongside a nonzero count. A duplicated exposure record counts once per entry, so its dose enters the total twice.

Inputs

Under review
2 source files

input/ex.csv

Edit
12 rows
input/ex.csv
STUDYIDUSUBJIDEXTRTEXSEQEXDOSE
YAMAA-01Pembrolizumab1200
YAMAA-01Pembrolizumab2—
YAMAA-01Pembrolizumab3200
YAMAA-01Pemetrexed4500
YAMAA-01Pemetrexed5450
YAMAA-01Pemetrexed6500
YAMAA-01Saline placebo10
YAMAA-01Saline placebo20
YAMAA-01Saline placebo30
YAMAA-01Nivolumab1240
YAMAA-01Nivolumab1240
YAMAA-01Daratumumab1900

input/subject_treatment.csv

Edit
6 rows
input/subject_treatment.csv
STUDYIDUSUBJIDEXTRTEXDOSUPLANDOSEPLANCYC
YAMAA-01Pembrolizumabmg2003
YAMAA-01Pemetrexedmg/m25003
YAMAA-01Saline placebomg03
YAMAA-01Nivolumabmg2402
YAMAA-01Trastuzumabmg6001
YAMAA-01Daratumumabmg18001

Expected output

Under review
6 expected rows

expected/adex.csv

Edit
6 rows
expected/adex.csv
STUDYIDUSUBJIDEXTRTEXDOSUDOSECUMNCYCLESRDI
YAMAA-01Pembrolizumabmg400366.66666666666667
YAMAA-01Pemetrexedmg/m21450396.66666666666667
YAMAA-01Saline placebomg03—
YAMAA-01Nivolumabmg4802100
YAMAA-01Trastuzumabmg———
YAMAA-01Daratumumabmg900150
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
ADEXSTUDYIDStudy IdentifiercharacterCopy value from TRT.STUDYID.Predecessor
ADEXUSUBJIDUnique Subject IdentifiercharacterCopy value from TRT.USUBJID.Predecessor
ADEXEXTRTName of TreatmentcharacterCopy value from TRT.EXTRT.Predecessor
ADEXEXDOSUDose UnitscharacterCopy value from TRT.EXDOSU.Predecessor
ADEXDOSECUMCumulative DosenumericAggregate SUM(EX.EXDOSE) over records matching on the shared output keys.Derived
ADEXNCYCLESNumber of Treatment CyclesnumericAggregate COUNT(EX.EXSEQ) over records matching on the shared output keys.Derived
ADEXRDIRelative Dose IntensitynumericCompute 100 * DOSECUM / NULLIF(PLANDOSE * PLANCYC, 0).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-adex-cumulative-dose/full.md

Edit
23 lines

Following CDISC ADaM standards, use the provided EX and SUBJECT_TREATMENT datasets to create an ADEX dataset with one record per subject per treatment.

The output dataset should contain the following columns in this order: STUDYID, USUBJID, EXTRT, EXDOSU, DOSECUM, NCYCLES, RDI

DOSECUM is the total administered dose across the subject's exposure records for the treatment. A record with no collected dose adds nothing to the total. A duplicated exposure record counts once per entry, so its dose enters the total twice. DOSECUM has no value when the treatment has no exposure records. A treatment whose exposure records all hold a zero dose has a DOSECUM of 0. NCYCLES is the number of the subject's exposure records for the treatment. Every exposure record counts toward NCYCLES, even one with a zero or missing dose. NCYCLES has no value when the treatment has no exposure records. RDI is the cumulative dose as a percentage of the planned total dose, which is the planned dose per cycle multiplied by the planned number of cycles. RDI has no value when the planned total dose is zero or when DOSECUM has no value. RDI is not rounded.

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

prompts/adam-adex-cumulative-dose/conventions.md

Edit
11 lines

Following CDISC ADaM standards, use the provided EX and SUBJECT_TREATMENT datasets to create an ADEX dataset with one record per subject per treatment.

The output dataset should contain the following columns in this order: STUDYID, USUBJID, EXTRT, EXDOSU, DOSECUM, NCYCLES, RDI

RDI is not rounded.

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

prompts/adam-adex-cumulative-dose/brief.md

Edit
9 lines

Following CDISC ADaM standards, use the provided EX and SUBJECT_TREATMENT datasets to create an ADEX dataset with one record per subject per treatment.

The output dataset should contain the following columns in this order: STUDYID, USUBJID, EXTRT, EXDOSU, DOSECUM, NCYCLES, RDI

Read the source datasets from /app/input and save the completed dataset as /app/output/adex.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-adex-cumulative-dose/result.R

Edit
47 lines
# Reference solution for the yamaa benchmark adam-adex-cumulative-dose (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)ex <- read_csv(  "/app/input/ex.csv",  col_types = cols(EXSEQ = col_integer(), .default = col_character()))trt <- read_csv(  "/app/input/subject_treatment.csv",  col_types = cols(    PLANDOSE = col_double(), PLANCYC = col_integer(), .default = col_character()  ))# Every exposure record counts, even one with a zero or missing dose; a# missing dose adds nothing. A duplicated record counts once per entry.doses <- ex |>  mutate(EXDOSE_NUM = suppressWarnings(as.numeric(EXDOSE))) |>  group_by(USUBJID, EXTRT) |>  summarise(    DOSECUM = sum(EXDOSE_NUM, na.rm = TRUE),    NCYCLES = n(),    .groups = "drop"  )adex <- trt |>  left_join(doses, by = c("USUBJID", "EXTRT")) |>  mutate(    PLANTOT = PLANDOSE * PLANCYC,    # Not rounded; no value when the planned total is zero or when there is    # no cumulative dose to compare.    RDI = case_when(      is.na(DOSECUM) ~ NA_real_,      is.na(PLANTOT) | PLANTOT == 0 ~ NA_real_,      .default = DOSECUM / PLANTOT * 100    )  ) |>  select(STUDYID, USUBJID, EXTRT, EXDOSU, DOSECUM, NCYCLES, RDI)dir.create("/app/output", showWarnings = FALSE)write_csv(adex, "/app/output/adex.csv", na = "")

solutions/adam-adex-cumulative-dose/result.py

Edit
75 lines
# Reference solution for the yamaa benchmark adam-adex-cumulative-dose (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 ADEX: one record per subject per treatment, with cumulativedose, number of cycles, and relative dose intensity."""import csvfrom collections import defaultdictfrom pathlib import PathINPUT = Path("/app/input")OUTPUT = Path("/app/output")COLUMNS = ["STUDYID", "USUBJID", "EXTRT", "EXDOSU", "DOSECUM", "NCYCLES", "RDI"]def fmt(value):    """Write a number without a trailing .0 when it is whole."""    if value is None:        return ""    if value == int(value):        return str(int(value))    return repr(value)def main():    with open(INPUT / "subject_treatment.csv", newline="") as f:        treatments = list(csv.DictReader(f))    with open(INPUT / "ex.csv", newline="") as f:        exposure = list(csv.DictReader(f))    doses = defaultdict(list)    for row in exposure:        key = (row["STUDYID"], row["USUBJID"], row["EXTRT"])        doses[key].append(row["EXDOSE"])    out_rows = []    for trt in treatments:        key = (trt["STUDYID"], trt["USUBJID"], trt["EXTRT"])        records = doses.get(key)        if records:            ncycles = len(records)            dosecum = sum(float(d) for d in records if d.strip() != "")        else:            ncycles = None            dosecum = None        planned_total = float(trt["PLANDOSE"]) * float(trt["PLANCYC"])        if dosecum is None or planned_total == 0:            rdi = None        else:            rdi = dosecum / planned_total * 100        out_rows.append(            {                "STUDYID": trt["STUDYID"],                "USUBJID": trt["USUBJID"],                "EXTRT": trt["EXTRT"],                "EXDOSU": trt["EXDOSU"],                "DOSECUM": fmt(dosecum),                "NCYCLES": "" if ncycles is None else str(ncycles),                "RDI": fmt(rdi),            }        )    OUTPUT.mkdir(parents=True, exist_ok=True)    with open(OUTPUT / "adex.csv", "w", newline="") as f:        writer = csv.DictWriter(f, fieldnames=COLUMNS)        writer.writeheader()        writer.writerows(out_rows)if __name__ == "__main__":    main()

solutions/adam-adex-cumulative-dose/result.sas

Edit
22 lines
/* opensas reference solution for the yamaa benchmark adam-adex-cumulative-dose.   Reads the benchmark inputs and derives the requested output.   Execute with the existing opensas runtime: opensas /app/output/result.sas. */data ex;  length STUDYID USUBJID EXTRT $1024;  infile "/app/input/ex.csv" dsd dlm="," firstobs=2 truncover lrecl=32767;  input STUDYID : $char1024. USUBJID : $char1024. EXTRT : $char1024. EXSEQ EXDOSE;run;data subject_treatment;  length STUDYID USUBJID EXTRT EXDOSU $1024;  infile "/app/input/subject_treatment.csv" dsd dlm="," firstobs=2 truncover lrecl=32767;  input STUDYID : $char1024. USUBJID : $char1024. EXTRT : $char1024. EXDOSU : $char1024. PLANDOSE PLANCYC;run;proc sql;  create table totals as select STUDYID,USUBJID,EXTRT,sum(EXDOSE) as DOSECUM,count(*) as NCYCLES from ex group by STUDYID,USUBJID,EXTRT;  create table result as select a.*,b.DOSECUM,b.NCYCLES,case when a.PLANDOSE*a.PLANCYC ne 0 then 100*b.DOSECUM/(a.PLANDOSE*a.PLANCYC) else . end as RDI from subject_treatment as a left join totals as b on a.STUDYID=b.STUDYID and a.USUBJID=b.USUBJID and a.EXTRT=b.EXTRT;quit;proc export data=result(keep=STUDYID USUBJID EXTRT EXDOSU DOSECUM NCYCLES RDI) outfile="/app/output/adex.csv" dbms=csv replace; run;