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: one record per subject flagging any reported dose
adjustment (DOSADJFL).
Input: subject list plus exposure (EX) records carrying the
reason for a dose adjustment (EXADJ), exposure as collected
(EC) records carrying the same reason (ECADJ), and
findings-about (FA) records carrying a test code (FATESTCD),
the object of the finding (FAOBJ), and its result
(FASTRESC).
Variables:
DOSADJFLholdsYwhen any source holds a qualifying record: a filledEXADJvalue, a filledECADJvalue, or a findings-about row withFATESTCDofOCCUR,FAOBJofDOSE ADJUSTMENT, andFASTRESCofY. A pre-specified (PRESP) or non-dose-adjustment finding does not qualify. It holdsNwhen the subject has at least one record in any of the three sources but no qualifying record. It stays empty when the subject is absent from all three sources.
Note: a record belongs to a subject only when both the study and subject identifiers match, and a source record for a subject not in the subject list adds no record.
Inputs
Under review4 source filesinput/adsl.csv
Edit10 rows| STUDYID | USUBJID |
|---|---|
| AB42 | |
| AB42 | |
| AB42 | |
| AB42 | |
| AB42 | |
| AB42 | |
| AB42 | |
| AB42 | |
| AB42 | |
| AB43 |
input/ec.csv
Edit3 rows| STUDYID | USUBJID | ECADJ |
|---|---|---|
| AB42 | DOSE REDUCED | |
| AB42 | — | |
| AB42 | — |
input/ex.csv
Edit7 rows| STUDYID | USUBJID | EXADJ |
|---|---|---|
| AB42 | DOSE REDUCED | |
| AB42 | — | |
| AB42 | — | |
| AB42 | — | |
| AB42 | DOSE REDUCED | |
| AB42 | — | |
| AB42 | DOSE REDUCED |
input/fa.csv
Edit4 rows| STUDYID | USUBJID | FATESTCD | FAOBJ | FASTRESC |
|---|---|---|---|---|
| AB42 | OCCUR | DOSE ADJUSTMENT | Y | |
| AB42 | OCCUR | DOSE ADJUSTMENT | N | |
| AB42 | OCCUR | OTHER ASSESSMENT | Y | |
| AB42 | PRESP | DOSE ADJUSTMENT | Y |
Expected output
Under review10 expected rowsexpected/adsl.csv
Edit10 rows| STUDYID | USUBJID | DOSADJFL |
|---|---|---|
| AB42 | Y | |
| AB42 | N | |
| AB42 | Y | |
| AB42 | — | |
| AB42 | Y | |
| AB42 | N | |
| AB42 | Y | |
| AB42 | N | |
| AB42 | N | |
| AB43 | — |
Human review and assessment
| Dataset Name | Variable Name | Variable Label | Type | Codelist/Controlled Terms | Core | Computational Method | Origin |
|---|---|---|---|---|---|---|---|
| ADSL | STUDYID | Study Identifier | character | Copy value from ADSL_RAW.STUDYID. | Predecessor | ||
| ADSL | USUBJID | Unique Subject Identifier | character | Copy value from ADSL_RAW.USUBJID. | Predecessor | ||
| ADSL | DOSADJFL | Dose Adjustment Flag | character | Y, N | If EX_ADJ_CNT > 0 OR EC_ADJ_CNT > 0 OR FA_ADJ_CNT > 0 then "Y"; If EX_ANY_CNT > 0 OR EC_ANY_CNT > 0 OR FA_ANY_CNT > 0 then "N"; otherwise blank. | Derived |
| Variable | Permitted values |
|---|---|
| DOSADJFL | Y, N |
| 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-adsl-dose-adjustment/full.md
Edit20 linesFollowing CDISC ADaM standards, use the provided ADSL, EC, EX, and FA datasets to create an ADSL dataset with one record per subject.
The output dataset should contain the following columns in this order: STUDYID, USUBJID, DOSADJFL
DOSADJFL is "Y" when EX, EC or FA holds a qualifying record for the subject: an EX record with EXADJ filled, an EC record with ECADJ filled, or an FA record with FATESTCD "OCCUR", FAOBJ "DOSE ADJUSTMENT" and FASTRESC "Y". An FA record with a test code other than "OCCUR", such as "PRESP", or with an object other than "DOSE ADJUSTMENT" does not qualify. DOSADJFL is "N" when the subject has at least one record in EX, EC or FA but no qualifying record. DOSADJFL has no value when the subject has no record in EX, EC or FA. A source record belongs to a subject only when both its STUDYID and its USUBJID match the subject's, and a source record for a subject who is not in the subject list adds no record.
Read the source datasets from /app/input and save the completed dataset as /app/output/adsl.csv.
prompts/adam-adsl-dose-adjustment/conventions.md
Edit10 linesFollowing CDISC ADaM standards, use the provided ADSL, EC, EX, and FA datasets to create an ADSL dataset with one record per subject.
The output dataset should contain the following columns in this order: STUDYID, USUBJID, DOSADJFL
DOSADJFL is "Y", "N" or has no value.
Read the source datasets from /app/input and save the completed dataset as /app/output/adsl.csv.
prompts/adam-adsl-dose-adjustment/brief.md
Edit8 linesFollowing CDISC ADaM standards, use the provided ADSL, EC, EX, and FA datasets to create an ADSL dataset with one record per subject.
The output dataset should contain the following columns in this order: STUDYID, USUBJID, DOSADJFL
Read the source datasets from /app/input and save the completed dataset as /app/output/adsl.csv.
R
Edit3 lineslibrary(yamaa)yamaa_spec("spec.yaml")$run()$outputPython
Edit3 linesimport yamaayamaa.spec("spec.yaml").run().outputsolutions/adam-adsl-dose-adjustment/result.R
Edit63 lines# Reference solution for the yamaa benchmark adam-adsl-dose-adjustment (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)library(stringr)base <- read_csv( "/app/input/adsl.csv", col_types = cols(.default = col_character()))ex <- read_csv( "/app/input/ex.csv", col_types = cols(.default = col_character()))ec <- read_csv( "/app/input/ec.csv", col_types = cols(.default = col_character()))fa <- read_csv( "/app/input/fa.csv", col_types = cols(.default = col_character()))# A record reports an adjustment with a filled value; findings-about rows# qualify only for dose adjustment occurrences with a Y result.ex_adj <- ex |> filter(!is.na(EXADJ), str_trim(EXADJ) != "") |> distinct(STUDYID, USUBJID) |> mutate(.ex_adj = TRUE)ec_adj <- ec |> filter(!is.na(ECADJ), str_trim(ECADJ) != "") |> distinct(STUDYID, USUBJID) |> mutate(.ec_adj = TRUE)fa_adj <- fa |> filter(FATESTCD %in% "OCCUR", FAOBJ %in% "DOSE ADJUSTMENT", FASTRESC %in% "Y") |> distinct(STUDYID, USUBJID) |> mutate(.fa_adj = TRUE)ex_any <- ex |> distinct(STUDYID, USUBJID) |> mutate(.ex_any = TRUE)ec_any <- ec |> distinct(STUDYID, USUBJID) |> mutate(.ec_any = TRUE)fa_any <- fa |> distinct(STUDYID, USUBJID) |> mutate(.fa_any = TRUE)adsl <- base |> left_join(ex_adj, by = c("STUDYID", "USUBJID")) |> left_join(ec_adj, by = c("STUDYID", "USUBJID")) |> left_join(fa_adj, by = c("STUDYID", "USUBJID")) |> left_join(ex_any, by = c("STUDYID", "USUBJID")) |> left_join(ec_any, by = c("STUDYID", "USUBJID")) |> left_join(fa_any, by = c("STUDYID", "USUBJID")) |> mutate( DOSADJFL = case_when( .ex_adj %in% TRUE | .ec_adj %in% TRUE | .fa_adj %in% TRUE ~ "Y", .ex_any %in% TRUE | .ec_any %in% TRUE | .fa_any %in% TRUE ~ "N" ) ) |> select(STUDYID, USUBJID, DOSADJFL)dir.create("/app/output", showWarnings = FALSE)write_csv(adsl, "/app/output/adsl.csv", na = "")solutions/adam-adsl-dose-adjustment/result.py
Edit72 lines# Reference solution for the yamaa benchmark adam-adsl-dose-adjustment (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 osINPUT_DIR = "/app/input"OUTPUT_DIR = "/app/output"def read_csv(name): path = os.path.join(INPUT_DIR, name) with open(path, newline="", encoding="utf-8") as f: return list(csv.DictReader(f))def filled(value): return value is not None and value.strip() != ""def main(): subjects = read_csv("adsl.csv") ex = read_csv("ex.csv") ec = read_csv("ec.csv") fa = read_csv("fa.csv") has_record = set() qualifying = set() for row in ex: key = (row["STUDYID"], row["USUBJID"]) has_record.add(key) if filled(row.get("EXADJ")): qualifying.add(key) for row in ec: key = (row["STUDYID"], row["USUBJID"]) has_record.add(key) if filled(row.get("ECADJ")): qualifying.add(key) for row in fa: key = (row["STUDYID"], row["USUBJID"]) has_record.add(key) if ( row.get("FATESTCD") == "OCCUR" and row.get("FAOBJ") == "DOSE ADJUSTMENT" and row.get("FASTRESC") == "Y" ): qualifying.add(key) os.makedirs(OUTPUT_DIR, exist_ok=True) out_path = os.path.join(OUTPUT_DIR, "adsl.csv") with open(out_path, "w", newline="", encoding="utf-8") as f: writer = csv.writer(f) writer.writerow(["STUDYID", "USUBJID", "DOSADJFL"]) for subj in subjects: key = (subj["STUDYID"], subj["USUBJID"]) if key in qualifying: flag = "Y" elif key in has_record: flag = "N" else: flag = "" writer.writerow([subj["STUDYID"], subj["USUBJID"], flag])if __name__ == "__main__": main()solutions/adam-adsl-dose-adjustment/result.sas
Edit38 lines/* opensas reference solution for the yamaa benchmark adam-adsl-dose-adjustment. 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 $1024; infile "/app/input/adsl.csv" dsd dlm="," firstobs=2 truncover lrecl=32767; input STUDYID : $char1024. USUBJID : $char1024.;run;data ec; length STUDYID USUBJID ECADJ $1024; infile "/app/input/ec.csv" dsd dlm="," firstobs=2 truncover lrecl=32767; input STUDYID : $char1024. USUBJID : $char1024. ECADJ : $char1024.;run;data ex; length STUDYID USUBJID EXADJ $1024; infile "/app/input/ex.csv" dsd dlm="," firstobs=2 truncover lrecl=32767; input STUDYID : $char1024. USUBJID : $char1024. EXADJ : $char1024.;run;data fa; length STUDYID USUBJID FATESTCD FAOBJ FASTRESC $1024; infile "/app/input/fa.csv" dsd dlm="," firstobs=2 truncover lrecl=32767; input STUDYID : $char1024. USUBJID : $char1024. FATESTCD : $char1024. FAOBJ : $char1024. FASTRESC : $char1024.;run;proc sql; create table evidence as select STUDYID,USUBJID,case when not missing(EXADJ) then 1 else 0 end as adjusted from ex union all select STUDYID,USUBJID,case when not missing(ECADJ) then 1 else 0 end from ec union all select STUDYID,USUBJID,case when FATESTCD='OCCUR' and FAOBJ='DOSE ADJUSTMENT' and FASTRESC='Y' then 1 else 0 end from fa; create table flags as select STUDYID,USUBJID,max(adjusted) as adjusted,count(*) as records from evidence group by STUDYID,USUBJID; create table result as select a.*, case when b.adjusted=1 then 'Y' when b.records>0 then 'N' else '' end as DOSADJFL from adsl as a left join flags as b on a.STUDYID=b.STUDYID and a.USUBJID=b.USUBJID;quit;proc export data=result(keep=STUDYID USUBJID DOSADJFL) outfile="/app/output/adsl.csv" dbms=csv replace; run;
yamaa