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
README.mdPublic 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:
DOSECUMis 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.NCYCLESis 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.RDIis 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 review2 source filesinput/ex.csv
Edit12 rows| STUDYID | USUBJID | EXTRT | EXSEQ | EXDOSE |
|---|---|---|---|---|
| YAMAA-01 | Pembrolizumab | 1 | 200 | |
| YAMAA-01 | Pembrolizumab | 2 | — | |
| YAMAA-01 | Pembrolizumab | 3 | 200 | |
| YAMAA-01 | Pemetrexed | 4 | 500 | |
| YAMAA-01 | Pemetrexed | 5 | 450 | |
| YAMAA-01 | Pemetrexed | 6 | 500 | |
| YAMAA-01 | Saline placebo | 1 | 0 | |
| YAMAA-01 | Saline placebo | 2 | 0 | |
| YAMAA-01 | Saline placebo | 3 | 0 | |
| YAMAA-01 | Nivolumab | 1 | 240 | |
| YAMAA-01 | Nivolumab | 1 | 240 | |
| YAMAA-01 | Daratumumab | 1 | 900 |
input/subject_treatment.csv
Edit6 rows| STUDYID | USUBJID | EXTRT | EXDOSU | PLANDOSE | PLANCYC |
|---|---|---|---|---|---|
| YAMAA-01 | Pembrolizumab | mg | 200 | 3 | |
| YAMAA-01 | Pemetrexed | mg/m2 | 500 | 3 | |
| YAMAA-01 | Saline placebo | mg | 0 | 3 | |
| YAMAA-01 | Nivolumab | mg | 240 | 2 | |
| YAMAA-01 | Trastuzumab | mg | 600 | 1 | |
| YAMAA-01 | Daratumumab | mg | 1800 | 1 |
Expected output
Under review6 expected rowsexpected/adex.csv
Edit6 rows| STUDYID | USUBJID | EXTRT | EXDOSU | DOSECUM | NCYCLES | RDI |
|---|---|---|---|---|---|---|
| YAMAA-01 | Pembrolizumab | mg | 400 | 3 | 66.66666666666667 | |
| YAMAA-01 | Pemetrexed | mg/m2 | 1450 | 3 | 96.66666666666667 | |
| YAMAA-01 | Saline placebo | mg | 0 | 3 | — | |
| YAMAA-01 | Nivolumab | mg | 480 | 2 | 100 | |
| YAMAA-01 | Trastuzumab | mg | — | — | — | |
| YAMAA-01 | Daratumumab | mg | 900 | 1 | 50 |
Human review and assessment
| Dataset Name | Variable Name | Variable Label | Type | Codelist/Controlled Terms | Core | Computational Method | Origin |
|---|---|---|---|---|---|---|---|
| ADEX | STUDYID | Study Identifier | character | Copy value from TRT.STUDYID. | Predecessor | ||
| ADEX | USUBJID | Unique Subject Identifier | character | Copy value from TRT.USUBJID. | Predecessor | ||
| ADEX | EXTRT | Name of Treatment | character | Copy value from TRT.EXTRT. | Predecessor | ||
| ADEX | EXDOSU | Dose Units | character | Copy value from TRT.EXDOSU. | Predecessor | ||
| ADEX | DOSECUM | Cumulative Dose | numeric | Aggregate SUM(EX.EXDOSE) over records matching on the shared output keys. | Derived | ||
| ADEX | NCYCLES | Number of Treatment Cycles | numeric | Aggregate COUNT(EX.EXSEQ) over records matching on the shared output keys. | Derived | ||
| ADEX | RDI | Relative Dose Intensity | numeric | Compute 100 * DOSECUM / NULLIF(PLANDOSE * PLANCYC, 0). | Derived |
| Version | Date | Author | Description | Reviewer | Sign-off |
|---|---|---|---|---|---|
| 1.7 | 2026-10-20 | yamaa docs build | Read 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.6 | 2026-10-17 | yamaa docs build | Describe collected date parts written as ISO 8601 date text and times of day counted in seconds since midnight | ||
| 1.5 | 2026-10-17 | yamaa docs build | Name 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.4 | 2026-10-15 | yamaa docs build | State datetime precision codes through the hour and minute, and complete only the time parts a collected datetime lacks | ||
| 1.3 | 2026-09-29 | yamaa docs build | Show study codelist names, external dictionaries, and ISO 8601 formats in variable rows; list the document's codelist values and metadata | ||
| 1.2 | 2026-09-29 | yamaa docs build | Classify ADaM copies from a declared input as Predecessor and recodes as Derived, and SDTM recodes of locally derived columns as Derived | ||
| 1.1 | 2026-09-29 | yamaa docs build | Resolve lookups into the donor record they select, and give every derivation shape a plain-language rule instead of its raw YAML | ||
| 1.0 | yamaa docs build | Initial generation from spec.yaml |
prompts/adam-adex-cumulative-dose/full.md
Edit23 linesFollowing 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
Edit11 linesFollowing 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
Edit9 linesFollowing 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.
R
Edit3 lineslibrary(yamaa)yamaa_spec("spec.yaml")$run()$outputPython
Edit3 linesimport yamaayamaa.spec("spec.yaml").run().outputsolutions/adam-adex-cumulative-dose/result.R
Edit47 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
Edit75 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
Edit22 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;
yamaa