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: 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:

  • DOSADJFL holds Y when any source holds a qualifying record: a filled EXADJ value, a filled ECADJ value, or a findings-about row with FATESTCD of OCCUR, FAOBJ of DOSE ADJUSTMENT, and FASTRESC of Y. A pre-specified (PRESP) or non-dose-adjustment finding does not qualify. It holds N when 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 review
4 source files

input/adsl.csv

Edit
10 rows
input/adsl.csv
STUDYIDUSUBJID
AB42
AB42
AB42
AB42
AB42
AB42
AB42
AB42
AB42
AB43

input/ec.csv

Edit
3 rows
input/ec.csv
STUDYIDUSUBJIDECADJ
AB42DOSE REDUCED
AB42—
AB42—

input/ex.csv

Edit
7 rows
input/ex.csv
STUDYIDUSUBJIDEXADJ
AB42DOSE REDUCED
AB42—
AB42—
AB42—
AB42DOSE REDUCED
AB42—
AB42DOSE REDUCED

input/fa.csv

Edit
4 rows
input/fa.csv
STUDYIDUSUBJIDFATESTCDFAOBJFASTRESC
AB42OCCURDOSE ADJUSTMENTY
AB42OCCURDOSE ADJUSTMENTN
AB42OCCUROTHER ASSESSMENTY
AB42PRESPDOSE ADJUSTMENTY

Expected output

Under review
10 expected rows

expected/adsl.csv

Edit
10 rows
expected/adsl.csv
STUDYIDUSUBJIDDOSADJFL
AB42Y
AB42N
AB42Y
AB42—
AB42Y
AB42N
AB42Y
AB42N
AB42N
AB43—
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
ADSLSTUDYIDStudy IdentifiercharacterCopy value from ADSL_RAW.STUDYID.Predecessor
ADSLUSUBJIDUnique Subject IdentifiercharacterCopy value from ADSL_RAW.USUBJID.Predecessor
ADSLDOSADJFLDose Adjustment FlagcharacterY, NIf 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
VariablePermitted values
DOSADJFLY, N
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-adsl-dose-adjustment/full.md

Edit
20 lines

Following 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

Edit
10 lines

Following 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

Edit
8 lines

Following 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.

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-adsl-dose-adjustment/result.R

Edit
63 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

Edit
72 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

Edit
38 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;