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: carry each administered combination component with its
dose, unit, administration interval, and adjustment reason, adding
EXSEQ, EXTRT, EXDOSE, EXDOSU, EXSTDTC, EXENDTC, and
EXADJ.
Input: collected exposure records with one row per administered component, carrying treatment, dose, unit, administration interval, and adjustment reason.
Variables:
EXSEQis the order of the administration within the subject, numbered by start date and then, on the same date, by treatment name.EXDOSUis the dose unit as collected; milligrams (mg), milligrams per square metre (mg/m2), and area under the curve (AUC) remain distinct.EXADJis the adjustment reason as collected (for exampleDOSE INTERRUPTED); blank when none was reported.
Note: a saline placebo component is administered, so it keeps its
EXDOSE of 0; a zero dose is not an uncollected dose.
Inputs
Under review1 source fileinput/ex_raw.csv
Edit9 rows| STUDYID | USUBJID | EXTRT | EXDOSE | EXDOSU | EXSTDTC | EXENDTC | EXADJ |
|---|---|---|---|---|---|---|---|
| PILOT7 | Pembrolizumab | 200 | mg | 2025-01-02 | 2025-01-02 | — | |
| PILOT7 | Pemetrexed | 500 | mg/m2 | 2025-01-02 | 2025-01-02 | — | |
| PILOT7 | Carboplatin | 5 | AUC | 2025-01-02 | 2025-01-02 | — | |
| PILOT7 | Pembrolizumab | 200 | mg | 2025-01-23 | 2025-01-23 | DOSE INTERRUPTED | |
| PILOT7 | Pemetrexed | 500 | mg/m2 | 2025-01-23 | 2025-01-23 | — | |
| PILOT7 | Carboplatin | 5 | AUC | 2025-01-23 | 2025-01-23 | — | |
| PILOT7 | Saline placebo | 0 | mg | 2025-01-02 | 2025-01-02 | — | |
| PILOT7 | Pemetrexed | 500 | mg/m2 | 2025-01-02 | 2025-01-02 | — | |
| PILOT7 | Cisplatin | 75 | mg/m2 | 2025-01-02 | 2025-01-02 | — |
Expected output
Under review9 expected rowsexpected/ex.csv
Edit9 rows| DOMAIN | STUDYID | USUBJID | EXSEQ | EXTRT | EXDOSE | EXDOSU | EXSTDTC | EXENDTC | EXADJ |
|---|---|---|---|---|---|---|---|---|---|
| EX | PILOT7 | 2 | Pembrolizumab | 200 | mg | 2025-01-02 | 2025-01-02 | — | |
| EX | PILOT7 | 3 | Pemetrexed | 500 | mg/m2 | 2025-01-02 | 2025-01-02 | — | |
| EX | PILOT7 | 1 | Carboplatin | 5 | AUC | 2025-01-02 | 2025-01-02 | — | |
| EX | PILOT7 | 5 | Pembrolizumab | 200 | mg | 2025-01-23 | 2025-01-23 | DOSE INTERRUPTED | |
| EX | PILOT7 | 6 | Pemetrexed | 500 | mg/m2 | 2025-01-23 | 2025-01-23 | — | |
| EX | PILOT7 | 4 | Carboplatin | 5 | AUC | 2025-01-23 | 2025-01-23 | — | |
| EX | PILOT7 | 3 | Saline placebo | 0 | mg | 2025-01-02 | 2025-01-02 | — | |
| EX | PILOT7 | 2 | Pemetrexed | 500 | mg/m2 | 2025-01-02 | 2025-01-02 | — | |
| EX | PILOT7 | 1 | Cisplatin | 75 | mg/m2 | 2025-01-02 | 2025-01-02 | — |
Human review and assessment
| Variable Name | Variable Label | Type | Length | Controlled Terms or Format | Origin | Core | Conversion Definition | Variable Type | Variable Order | Comments for Define |
|---|---|---|---|---|---|---|---|---|---|---|
| DOMAIN | Domain Abbreviation | Char | Assigned | Set constant value "EX". | SDTM | 1 | ||||
| STUDYID | Study Identifier | Char | Collected | Copy value from EX_RAW.STUDYID. | SDTM | 2 | ||||
| USUBJID | Unique Subject Identifier | Char | Collected | Copy value from EX_RAW.USUBJID. | SDTM | 3 | ||||
| EXSEQ | Sequence Number | Num | Derived | Row number within each group of STUDYID, USUBJID, ordered by EX_RAW.EXSTDTC then EX_RAW.EXTRT. | SDTM | 4 | ||||
| EXTRT | Name of Treatment | Char | Collected | Copy value from EX_RAW.EXTRT. | SDTM | 5 | ||||
| EXDOSE | Dose | Num | Collected | Copy value from EX_RAW.EXDOSE. | SDTM | 6 | ||||
| EXDOSU | Dose Units | Char | Collected | Copy value from EX_RAW.EXDOSU. | SDTM | 7 | ||||
| EXSTDTC | Start Date/Time of Treatment | Char | ISO 8601 | Collected | Copy value from EX_RAW.EXSTDTC. | SDTM | 8 | |||
| EXENDTC | End Date/Time of Treatment | Char | ISO 8601 | Collected | Copy value from EX_RAW.EXENDTC. | SDTM | 9 | |||
| EXADJ | Reason for Dose Adjustment | Char | Collected | Copy value from EX_RAW.EXADJ. | SDTM | 10 |
| 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/sdtm-ex-combination/full.md
Edit16 linesFollowing CDISC SDTM standards, use the provided EX_RAW dataset to create an EX dataset with one record per administered combination component.
The output dataset should contain the following columns in this order: DOMAIN, STUDYID, USUBJID, EXSEQ, EXTRT, EXDOSE, EXDOSU, EXSTDTC, EXENDTC, EXADJ
DOMAIN is "EX". EXSEQ numbers each subject's administrations from 1, by start date, and on the same start date by treatment name. EXDOSU is the dose unit as collected, and "mg", "mg/m2", and "AUC" remain distinct. EXADJ is the adjustment reason as collected, for example "DOSE INTERRUPTED", and has no value when no reason was reported. An administered component with a dose of 0, such as a saline placebo, keeps 0 as its EXDOSE: a zero dose is not an uncollected dose.
Read the source datasets from /app/input and save the completed dataset as /app/output/ex.csv.
prompts/sdtm-ex-combination/conventions.md
Edit10 linesFollowing CDISC SDTM standards, use the provided EX_RAW dataset to create an EX dataset with one record per administered combination component.
The output dataset should contain the following columns in this order: DOMAIN, STUDYID, USUBJID, EXSEQ, EXTRT, EXDOSE, EXDOSU, EXSTDTC, EXENDTC, EXADJ
DOMAIN is "EX".
Read the source datasets from /app/input and save the completed dataset as /app/output/ex.csv.
prompts/sdtm-ex-combination/brief.md
Edit8 linesFollowing CDISC SDTM standards, use the provided EX_RAW dataset to create an EX dataset with one record per administered combination component.
The output dataset should contain the following columns in this order: DOMAIN, STUDYID, USUBJID, EXSEQ, EXTRT, EXDOSE, EXDOSU, EXSTDTC, EXENDTC, EXADJ
Read the source datasets from /app/input and save the completed dataset as /app/output/ex.csv.
R
Edit3 lineslibrary(yamaa)yamaa_spec("spec.yaml")$run()$outputPython
Edit3 linesimport yamaayamaa.spec("spec.yaml").run().outputsolutions/sdtm-ex-combination/result.R
Edit32 lines# Reference solution for the yamaa benchmark sdtm-ex-combination (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_raw <- read_csv( "/app/input/ex_raw.csv", col_types = cols(.default = col_character()))ex <- ex_raw |> mutate( DOMAIN = "EX", EXDOSE = suppressWarnings(as.numeric(EXDOSE)), EXSTDTC_DATE = suppressWarnings(as.Date(EXSTDTC)), EXADJ = na_if(EXADJ, "") ) |> arrange(STUDYID, USUBJID, EXSTDTC_DATE, EXTRT) |> group_by(STUDYID, USUBJID) |> mutate(EXSEQ = row_number()) |> ungroup() |> select( DOMAIN, STUDYID, USUBJID, EXSEQ, EXTRT, EXDOSE, EXDOSU, EXSTDTC, EXENDTC, EXADJ )dir.create("/app/output", showWarnings = FALSE)write_csv(ex, "/app/output/ex.csv", na = "")solutions/sdtm-ex-combination/result.py
Edit73 lines# Reference solution for the yamaa benchmark sdtm-ex-combination (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."""Build the SDTM EX dataset from EX_RAW.One record per administered combination component. EXSEQ numbers eachsubject's administrations from 1, ordered by start date and, on the samestart date, by treatment name."""import csvfrom collections import defaultdictINPUT_PATH = "/app/input/ex_raw.csv"OUTPUT_PATH = "/app/output/ex.csv"COLUMNS = [ "DOMAIN", "STUDYID", "USUBJID", "EXSEQ", "EXTRT", "EXDOSE", "EXDOSU", "EXSTDTC", "EXENDTC", "EXADJ",]def main(): with open(INPUT_PATH, newline="", encoding="utf-8") as f: raw_rows = list(csv.DictReader(f)) by_subject = defaultdict(list) for row in raw_rows: by_subject[row["USUBJID"]].append(row) out_rows = [] for usubjid in sorted(by_subject): rows = sorted( by_subject[usubjid], key=lambda r: (r["EXSTDTC"] or "", r["EXTRT"] or ""), ) for seq, row in enumerate(rows, start=1): out_rows.append( { "DOMAIN": "EX", "STUDYID": row["STUDYID"], "USUBJID": row["USUBJID"], "EXSEQ": seq, "EXTRT": row["EXTRT"], # A dose of 0 is an administered dose, not missing; # keep the collected value exactly as reported. "EXDOSE": row["EXDOSE"], "EXDOSU": row["EXDOSU"], "EXSTDTC": row["EXSTDTC"], "EXENDTC": row["EXENDTC"], "EXADJ": row["EXADJ"] or "", } ) with open(OUTPUT_PATH, "w", newline="", encoding="utf-8") as f: writer = csv.DictWriter(f, fieldnames=COLUMNS) writer.writeheader() writer.writerows(out_rows)if __name__ == "__main__": main()solutions/sdtm-ex-combination/result.sas
Edit21 lines/* opensas reference solution for the yamaa benchmark sdtm-ex-combination. Reads the benchmark inputs and derives the requested output. Execute with the existing opensas runtime: opensas /app/output/result.sas. */data ex_raw; length STUDYID USUBJID EXTRT EXDOSU EXSTDTC EXENDTC EXADJ $1024; infile "/app/input/ex_raw.csv" dsd dlm="," firstobs=2 truncover lrecl=32767; input STUDYID : $char1024. USUBJID : $char1024. EXTRT : $char1024. EXDOSE EXDOSU : $char1024. EXSTDTC : $char1024. EXENDTC : $char1024. EXADJ : $char1024.;run;data prepared; set ex_raw; length DOMAIN $2; DOMAIN='EX'; run;proc sort data=prepared; by STUDYID USUBJID EXSTDTC EXTRT; run;data result; set prepared; by STUDYID USUBJID; retain EXSEQ; if first.USUBJID then EXSEQ=0; EXSEQ+1;run;proc sql; create table final as select DOMAIN, STUDYID, USUBJID, EXSEQ, EXTRT, EXDOSE, EXDOSU, EXSTDTC, EXENDTC, EXADJ from result;quit;proc export data=final outfile="/app/output/ex.csv" dbms=csv replace; run;
yamaa