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: give every pharmacokinetic (PK) parameter record of a two-period
crossover the analysis period (APERIOD), actual treatment (TRTA) and
actual dose (DOSEA, unit DOSEU) of the dose its profile follows.
Input: PK parameters (PP), one record per subject, analyte (PPCAT),
parameter and profile, with the date and time of the profile's reference
dose (PPRFTDTC); and exposure (EX), one record per dose with its start
date and time, treatment, dose, unit and epoch (TREATMENT 1 or
TREATMENT 2).
Variables:
PARCAT1,PARAMCD,PARAMandPPRFTDTCcarry the analyte, the parameter and the reference date and time from PP.APERIODis the number in the epoch of the subject's dose that starts exactly at the parameter's reference date and time.TRTA,DOSEAandDOSEUare that dose's treatment, dose and unit, as recorded.AVALandAVALUare the parameter's standard result and unit.
Note: the full date and time must agree, so a dose earlier or later on
the same day, the subject's most recent earlier dose and another subject's
dose at that time are not the parameter's dose. A parameter with no such
dose keeps its record with all four values empty. Two doses of one subject
with one start, or a dose in an epoch other than TREATMENT followed by a
number, stops the run.
Inputs
Under review2 source filesinput/ex.csv
Edit4 rows| STUDYID | DOMAIN | USUBJID | EXSEQ | EXTRT | EXDOSE | EXDOSU | EXDOSFRM | EXROUTE | EPOCH | EXSTDTC | EXENDTC |
|---|---|---|---|---|---|---|---|---|---|---|---|
| YAMAA-01 | EX | 1 | DRUG X TABLET | 50 | mg | TABLET | ORAL | TREATMENT 1 | 2026-03-02T08:00 | 2026-03-02T08:00 | |
| YAMAA-01 | EX | 2 | DRUG X SOLUTION | 25 | mg | SOLUTION | ORAL | TREATMENT 2 | 2026-03-09T08:00 | 2026-03-09T08:00 | |
| YAMAA-01 | EX | 1 | DRUG X SOLUTION | 25 | mg | SOLUTION | ORAL | TREATMENT 1 | 2026-03-02T08:30 | 2026-03-02T08:30 | |
| YAMAA-01 | EX | 2 | DRUG X TABLET | 50 | mg | TABLET | ORAL | TREATMENT 2 | 2026-03-09T08:30 | 2026-03-09T08:30 |
input/pp.csv
Edit18 rows| STUDYID | DOMAIN | USUBJID | PPSEQ | PPTESTCD | PPTEST | PPCAT | PPSTRESN | PPSTRESU | PPSPEC | PPRFTDTC |
|---|---|---|---|---|---|---|---|---|---|---|
| YAMAA-01 | PP | 1 | CMAX | Max Conc | DRUG X | 412 | ng/mL | PLASMA | 2026-03-02T08:00 | |
| YAMAA-01 | PP | 2 | AUCLST | AUC to Last Nonzero Conc | DRUG X | 3180 | h*ng/mL | PLASMA | 2026-03-02T08:00 | |
| YAMAA-01 | PP | 3 | CMAX | Max Conc | M1 | 61.5 | ng/mL | PLASMA | 2026-03-02T08:00 | |
| YAMAA-01 | PP | 4 | AUCLST | AUC to Last Nonzero Conc | M1 | 874 | h*ng/mL | PLASMA | 2026-03-02T08:00 | |
| YAMAA-01 | PP | 5 | CMAX | Max Conc | DRUG X | 238 | ng/mL | PLASMA | 2026-03-09T08:00 | |
| YAMAA-01 | PP | 6 | AUCLST | AUC to Last Nonzero Conc | DRUG X | 1655 | h*ng/mL | PLASMA | 2026-03-09T08:00 | |
| YAMAA-01 | PP | 7 | CMAX | Max Conc | M1 | 33.8 | ng/mL | PLASMA | 2026-03-09T08:00 | |
| YAMAA-01 | PP | 8 | AUCLST | AUC to Last Nonzero Conc | M1 | 469 | h*ng/mL | PLASMA | 2026-03-09T08:00 | |
| YAMAA-01 | PP | 9 | CMAX | Max Conc | DRUG X | 405 | ng/mL | PLASMA | 2026-03-16T08:00 | |
| YAMAA-01 | PP | 10 | AUCLST | AUC to Last Nonzero Conc | DRUG X | 3020 | h*ng/mL | PLASMA | 2026-03-16T08:00 | |
| YAMAA-01 | PP | 1 | CMAX | Max Conc | DRUG X | 251 | ng/mL | PLASMA | 2026-03-02T08:30 | |
| YAMAA-01 | PP | 2 | AUCLST | AUC to Last Nonzero Conc | DRUG X | 1702 | h*ng/mL | PLASMA | 2026-03-02T08:30 | |
| YAMAA-01 | PP | 3 | CMAX | Max Conc | M1 | 36.1 | ng/mL | PLASMA | 2026-03-02T08:30 | |
| YAMAA-01 | PP | 4 | AUCLST | AUC to Last Nonzero Conc | M1 | 492 | h*ng/mL | PLASMA | 2026-03-02T08:30 | |
| YAMAA-01 | PP | 5 | CMAX | Max Conc | DRUG X | 398 | ng/mL | PLASMA | 2026-03-09T08:30 | |
| YAMAA-01 | PP | 6 | AUCLST | AUC to Last Nonzero Conc | DRUG X | 3095 | h*ng/mL | PLASMA | 2026-03-09T08:30 | |
| YAMAA-01 | PP | 7 | CMAX | Max Conc | M1 | 58.9 | ng/mL | PLASMA | 2026-03-09T08:00 | |
| YAMAA-01 | PP | 8 | AUCLST | AUC to Last Nonzero Conc | M1 | 851 | h*ng/mL | PLASMA | 2026-03-09T08:00 |
Expected output
Under review18 expected rowsexpected/adpp.csv
Edit18 rows| STUDYID | USUBJID | PARCAT1 | PARAMCD | PARAM | PPRFTDTC | APERIOD | TRTA | DOSEA | DOSEU | AVAL | AVALU |
|---|---|---|---|---|---|---|---|---|---|---|---|
| YAMAA-01 | DRUG X | CMAX | Max Conc | 2026-03-02T08:00 | 1 | DRUG X TABLET | 50 | mg | 412 | ng/mL | |
| YAMAA-01 | DRUG X | AUCLST | AUC to Last Nonzero Conc | 2026-03-02T08:00 | 1 | DRUG X TABLET | 50 | mg | 3180 | h*ng/mL | |
| YAMAA-01 | M1 | CMAX | Max Conc | 2026-03-02T08:00 | 1 | DRUG X TABLET | 50 | mg | 61.5 | ng/mL | |
| YAMAA-01 | M1 | AUCLST | AUC to Last Nonzero Conc | 2026-03-02T08:00 | 1 | DRUG X TABLET | 50 | mg | 874 | h*ng/mL | |
| YAMAA-01 | DRUG X | CMAX | Max Conc | 2026-03-09T08:00 | 2 | DRUG X SOLUTION | 25 | mg | 238 | ng/mL | |
| YAMAA-01 | DRUG X | AUCLST | AUC to Last Nonzero Conc | 2026-03-09T08:00 | 2 | DRUG X SOLUTION | 25 | mg | 1655 | h*ng/mL | |
| YAMAA-01 | M1 | CMAX | Max Conc | 2026-03-09T08:00 | 2 | DRUG X SOLUTION | 25 | mg | 33.8 | ng/mL | |
| YAMAA-01 | M1 | AUCLST | AUC to Last Nonzero Conc | 2026-03-09T08:00 | 2 | DRUG X SOLUTION | 25 | mg | 469 | h*ng/mL | |
| YAMAA-01 | DRUG X | CMAX | Max Conc | 2026-03-16T08:00 | — | — | — | — | 405 | ng/mL | |
| YAMAA-01 | DRUG X | AUCLST | AUC to Last Nonzero Conc | 2026-03-16T08:00 | — | — | — | — | 3020 | h*ng/mL | |
| YAMAA-01 | DRUG X | CMAX | Max Conc | 2026-03-02T08:30 | 1 | DRUG X SOLUTION | 25 | mg | 251 | ng/mL | |
| YAMAA-01 | DRUG X | AUCLST | AUC to Last Nonzero Conc | 2026-03-02T08:30 | 1 | DRUG X SOLUTION | 25 | mg | 1702 | h*ng/mL | |
| YAMAA-01 | M1 | CMAX | Max Conc | 2026-03-02T08:30 | 1 | DRUG X SOLUTION | 25 | mg | 36.1 | ng/mL | |
| YAMAA-01 | M1 | AUCLST | AUC to Last Nonzero Conc | 2026-03-02T08:30 | 1 | DRUG X SOLUTION | 25 | mg | 492 | h*ng/mL | |
| YAMAA-01 | DRUG X | CMAX | Max Conc | 2026-03-09T08:30 | 2 | DRUG X TABLET | 50 | mg | 398 | ng/mL | |
| YAMAA-01 | DRUG X | AUCLST | AUC to Last Nonzero Conc | 2026-03-09T08:30 | 2 | DRUG X TABLET | 50 | mg | 3095 | h*ng/mL | |
| YAMAA-01 | M1 | CMAX | Max Conc | 2026-03-09T08:00 | — | — | — | — | 58.9 | ng/mL | |
| YAMAA-01 | M1 | AUCLST | AUC to Last Nonzero Conc | 2026-03-09T08:00 | — | — | — | — | 851 | h*ng/mL |
Human review and assessment
| Dataset Name | Variable Name | Variable Label | Type | Codelist/Controlled Terms | Core | Computational Method | Origin |
|---|---|---|---|---|---|---|---|
| ADPP | STUDYID | Study Identifier | character | Copy value from PP.STUDYID. | Predecessor | ||
| ADPP | USUBJID | Unique Subject Identifier | character | Copy value from PP.USUBJID. | Predecessor | ||
| ADPP | PARCAT1 | Parameter Category 1 | character | Copy value from PP.PPCAT. | Predecessor | ||
| ADPP | PARAMCD | Parameter Code | character | Copy value from PP.PPTESTCD. | Predecessor | ||
| ADPP | PARAM | Parameter | character | Copy value from PP.PPTEST. | Predecessor | ||
| ADPP | PPRFTDTC | Date/Time of Reference Point | character | Copy value from PP.PPRFTDTC. | Predecessor | ||
| ADPP | APERIOD | Period | numeric | Take PERIODNO from the EX record whose STUDYID equals PP.STUDYID, USUBJID equals PP.USUBJID and EXSTDTC equals PP.PPRFTDTC, where PERIODNO is derived as {'type': 'int', 'derivation': {'str_extract': {'source': 'EPOCH', 'pattern': '^TREATMENT ([0-9]+)$', 'group': 1}}}, and no match yields blank. | Derived | ||
| ADPP | TRTA | Actual Treatment | character | Take EXTRT from the EX record whose STUDYID equals PP.STUDYID, USUBJID equals PP.USUBJID and EXSTDTC equals PP.PPRFTDTC, and no match yields blank. | Derived | ||
| ADPP | DOSEA | Actual Treatment Dose | numeric | Take EXDOSE from the EX record whose STUDYID equals PP.STUDYID, USUBJID equals PP.USUBJID and EXSTDTC equals PP.PPRFTDTC, and no match yields blank. | Derived | ||
| ADPP | DOSEU | Treatment Dose Units | character | Take EXDOSU from the EX record whose STUDYID equals PP.STUDYID, USUBJID equals PP.USUBJID and EXSTDTC equals PP.PPRFTDTC, and no match yields blank. | Derived | ||
| ADPP | AVAL | Analysis Value | numeric | Copy value from PP.PPSTRESN. | Predecessor | ||
| ADPP | AVALU | Analysis Value Unit | character | Copy value from PP.PPSTRESU. | Predecessor |
| 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-adpp-period-treatment/full.md
Edit20 linesFollowing CDISC ADaM standards, use the provided EX and PP datasets to create an ADPP dataset with one record per subject, analyte, parameter and reference date and time.
The output dataset should contain the following columns in this order: STUDYID, USUBJID, PARCAT1, PARAMCD, PARAM, PPRFTDTC, APERIOD, TRTA, DOSEA, DOSEU, AVAL, AVALU
The parameter's dose is the subject's dose in EX that starts exactly at the parameter's reference date and time. APERIOD is the number in that dose's epoch, 1 for "TREATMENT 1" and 2 for "TREATMENT 2". TRTA, DOSEA and DOSEU are that dose's treatment, dose and unit, as recorded. The full date and time must agree: a dose earlier or later on the same day is not the parameter's dose, and neither is the subject's most recent earlier dose or another subject's dose at the same time. A parameter with no such dose keeps its record, and APERIOD, TRTA, DOSEA and DOSEU have no value on it.
Read the source datasets from /app/input and save the completed dataset as /app/output/adpp.csv.
prompts/adam-adpp-period-treatment/conventions.md
Edit12 linesFollowing CDISC ADaM standards, use the provided EX and PP datasets to create an ADPP dataset with one record per subject, analyte, parameter and reference date and time.
The output dataset should contain the following columns in this order: STUDYID, USUBJID, PARCAT1, PARAMCD, PARAM, PPRFTDTC, APERIOD, TRTA, DOSEA, DOSEU, AVAL, AVALU
APERIOD is 1 for "TREATMENT 1" and 2 for "TREATMENT 2".
Read the source datasets from /app/input and save the completed dataset as /app/output/adpp.csv.
prompts/adam-adpp-period-treatment/brief.md
Edit10 linesFollowing CDISC ADaM standards, use the provided EX and PP datasets to create an ADPP dataset with one record per subject, analyte, parameter and reference date and time.
The output dataset should contain the following columns in this order: STUDYID, USUBJID, PARCAT1, PARAMCD, PARAM, PPRFTDTC, APERIOD, TRTA, DOSEA, DOSEU, AVAL, AVALU
Read the source datasets from /app/input and save the completed dataset as /app/output/adpp.csv.
R
Edit3 lineslibrary(yamaa)yamaa_spec("spec.yaml")$run()$outputPython
Edit3 linesimport yamaayamaa.spec("spec.yaml").run().outputsolutions/adam-adpp-period-treatment/result.R
Edit41 lines# Reference solution for the yamaa benchmark adam-adpp-period-treatment (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)pp <- read_csv( "/app/input/pp.csv", col_types = cols(PPSTRESN = col_double(), .default = col_character()))ex <- read_csv( "/app/input/ex.csv", col_types = cols(EXDOSE = col_double(), .default = col_character()))# The subject's dose that starts exactly at the reference date and time;# TREATMENT 1 is period 1, TREATMENT 2 period 2.doses <- ex |> transmute( USUBJID, PPRFTDTC = EXSTDTC, APERIOD = as.integer(sub("^TREATMENT ", "", EPOCH)), TRTA = EXTRT, DOSEA = EXDOSE, DOSEU = EXDOSU )adpp <- pp |> left_join(doses, by = c("USUBJID", "PPRFTDTC")) |> transmute( STUDYID, USUBJID, PARCAT1 = PPCAT, PARAMCD = PPTESTCD, PARAM = PPTEST, PPRFTDTC, APERIOD, TRTA, DOSEA, DOSEU, AVAL = PPSTRESN, AVALU = PPSTRESU )dir.create("/app/output", showWarnings = FALSE)write_csv(adpp, "/app/output/adpp.csv", na = "")solutions/adam-adpp-period-treatment/result.py
Edit66 lines# Reference solution for the yamaa benchmark adam-adpp-period-treatment (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 csvimport osimport reINPUT_DIR = "/app/input"OUTPUT_DIR = "/app/output"OUT_FIELDS = [ "STUDYID", "USUBJID", "PARCAT1", "PARAMCD", "PARAM", "PPRFTDTC", "APERIOD", "TRTA", "DOSEA", "DOSEU", "AVAL", "AVALU",]def main(): with open(os.path.join(INPUT_DIR, "ex.csv"), newline="") as f: ex_rows = list(csv.DictReader(f)) with open(os.path.join(INPUT_DIR, "pp.csv"), newline="") as f: pp_rows = list(csv.DictReader(f)) # Index each subject's doses by their exact start date and time. doses = {} for ex in ex_rows: key = (ex["STUDYID"], ex["USUBJID"], ex["EXSTDTC"]) doses[key] = ex out_rows = [] for pp in pp_rows: ex = doses.get((pp["STUDYID"], pp["USUBJID"], pp["PPRFTDTC"])) if ex is not None: match = re.search(r"\d+", ex["EPOCH"]) aperiod = match.group(0) if match else "" trta = ex["EXTRT"] dosea = ex["EXDOSE"] doseu = ex["EXDOSU"] else: aperiod = trta = dosea = doseu = "" out_rows.append({ "STUDYID": pp["STUDYID"], "USUBJID": pp["USUBJID"], "PARCAT1": pp["PPCAT"], "PARAMCD": pp["PPTESTCD"], "PARAM": pp["PPTEST"], "PPRFTDTC": pp["PPRFTDTC"], "APERIOD": aperiod, "TRTA": trta, "DOSEA": dosea, "DOSEU": doseu, "AVAL": pp["PPSTRESN"], "AVALU": pp["PPSTRESU"], }) os.makedirs(OUTPUT_DIR, exist_ok=True) with open(os.path.join(OUTPUT_DIR, "adpp.csv"), "w", newline="") as f: writer = csv.DictWriter(f, fieldnames=OUT_FIELDS) writer.writeheader() writer.writerows(out_rows)if __name__ == "__main__": main()solutions/adam-adpp-period-treatment/result.sas
Edit33 lines/* opensas reference solution for the yamaa benchmark adam-adpp-period-treatment. Reads the benchmark inputs and derives the requested output. Execute with the existing opensas runtime: opensas /app/output/result.sas. */data pp; length STUDYID DOMAIN USUBJID PPTESTCD PPTEST PPCAT PPSTRESU PPSPEC PPRFTDTC $1024; infile "/app/input/pp.csv" dsd dlm="," firstobs=2 truncover lrecl=32767; input STUDYID : $char1024. DOMAIN : $char1024. USUBJID : $char1024. PPSEQ PPTESTCD : $char1024. PPTEST : $char1024. PPCAT : $char1024. PPSTRESN PPSTRESU : $char1024. PPSPEC : $char1024. PPRFTDTC : $char1024.; ORDER=_n_;run;data ex; length STUDYID DOMAIN USUBJID EXTRT EXDOSU EXDOSFRM EXROUTE EPOCH EXSTDTC EXENDTC $1024; infile "/app/input/ex.csv" dsd dlm="," firstobs=2 truncover lrecl=32767; input STUDYID : $char1024. DOMAIN : $char1024. USUBJID : $char1024. EXSEQ EXTRT : $char1024. EXDOSE EXDOSU : $char1024. EXDOSFRM : $char1024. EXROUTE : $char1024. EPOCH : $char1024. EXSTDTC : $char1024. EXENDTC : $char1024.;run;/* The subject's dose that starts exactly at the reference date and time; TREATMENT 1 is period 1, TREATMENT 2 period 2. */proc sql; create table final as select p.STUDYID, p.USUBJID, p.PPCAT as PARCAT1, p.PPTESTCD as PARAMCD, p.PPTEST as PARAM, p.PPRFTDTC, input(scan(e.EPOCH, 2, ' '), best.) as APERIOD, e.EXTRT as TRTA, e.EXDOSE as DOSEA, e.EXDOSU as DOSEU, p.PPSTRESN as AVAL, p.PPSTRESU as AVALU from pp as p left join ex as e on p.USUBJID=e.USUBJID and p.PPRFTDTC=e.EXSTDTC order by p.ORDER;quit;proc export data=final outfile="/app/output/adpp.csv" dbms=csv replace; run;
yamaa