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 row per collected ophthalmic examination (OE) measurement, adding AFEYE.

Input: ophthalmic measurements carrying sequence number (OESEQ), test code (PARAMCD), laterality (OELAT), and numeric result (AVAL), together with the subject's assigned eye from the subject-level analysis dataset (ADSL). A measurement collected without a value is kept with its value empty.

Variables:

  • AFEYE is the eye's role in the study: Study Eye when the measured eye matches the subject's assigned eye, Both Eyes for a bilateral measurement when the subject has an assigned eye, and Fellow Eye for the opposite eye. Either eye counts as the study eye when both eyes are assigned and the collected laterality is present. When the assigned eye or the collected laterality is missing, AFEYE stays empty.

Note: the assigned eye belongs to the subject, so the same eye is the study eye at every visit; only the collected laterality moves a record between roles.

Inputs

Under review
2 source files

input/adsl.csv

Edit
4 rows
input/adsl.csv
STUDYIDUSUBJIDSTUDYEYE
YAMAA-01LEFT
YAMAA-01RIGHT
YAMAA-01BILATERAL
YAMAA-01LEFT

input/oe.csv

Edit
10 rows
input/oe.csv
STUDYIDUSUBJIDOESEQOETESTCDOELATOESTRESN
YAMAA-011IOPLEFT18
YAMAA-012IOPRIGHT24
YAMAA-011IOPLEFT16
YAMAA-012IOPRIGHT15
YAMAA-011IOPLEFT21
YAMAA-012IOPRIGHT20
YAMAA-013IOPBILATERAL—
YAMAA-011IOPLEFT19
YAMAA-012IOPBILATERAL—
YAMAA-011IOP—22

Expected output

Under review
10 expected rows

expected/adoe.csv

Edit
10 rows
expected/adoe.csv
STUDYIDUSUBJIDOESEQPARAMCDOELATAVALAFEYE
YAMAA-011IOPLEFT18Study Eye
YAMAA-012IOPRIGHT24Fellow Eye
YAMAA-011IOPLEFT16Fellow Eye
YAMAA-012IOPRIGHT15Study Eye
YAMAA-011IOPLEFT21Study Eye
YAMAA-012IOPRIGHT20Study Eye
YAMAA-013IOPBILATERAL—Both Eyes
YAMAA-011IOPLEFT19—
YAMAA-012IOPBILATERAL——
YAMAA-011IOP—22—
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
ADOESTUDYIDStudy IdentifiercharacterCopy value from OE.STUDYID.Predecessor
ADOEUSUBJIDUnique Subject IdentifiercharacterCopy value from OE.USUBJID.Predecessor
ADOEOESEQSequence NumbernumericCopy value from OE.OESEQ.Predecessor
ADOEPARAMCDParameter CodecharacterCopy value from OE.OETESTCD.Predecessor
ADOEOELATLateralitycharacterLEFT, RIGHT, BILATERALCopy value from OE.OELAT.Predecessor
ADOEAVALAnalysis ValuenumericCopy value from OE.OESTRESN.Predecessor
ADOEAFEYEAnalysis EyecharacterStudy Eye, Fellow Eye, Both EyesIf OELAT = 'BILATERAL' AND STUDYEYE IS NOT NULL then "Both Eyes"; If STUDYEYE = 'BILATERAL' AND OELAT IS NOT NULL then "Study Eye"; If OELAT = STUDYEYE then "Study Eye"; If STUDYEYE IS NOT NULL AND OELAT IS NOT NULL then "Fellow Eye"; otherwise blank.Derived
VariablePermitted values
OELATLEFT, RIGHT, BILATERAL
AFEYEStudy Eye, Fellow Eye, Both Eyes
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-adoe-study-eye/full.md

Edit
23 lines

Following CDISC ADaM standards, use the provided ADSL and OE datasets to create an ADOE dataset with one record per collected ophthalmic examination measurement.

The output dataset should contain the following columns in this order: STUDYID, USUBJID, OESEQ, PARAMCD, OELAT, AVAL, AFEYE

AFEYE is the eye's role in the study, from the collected laterality and the subject's assigned eye in ADSL. AFEYE is "Both Eyes" for a bilateral measurement when the subject has an assigned eye. AFEYE is "Study Eye" when the measured eye matches the subject's assigned eye. When the subject's assigned eye is both eyes, a measurement of either eye is "Study Eye" whenever the collected laterality is present. AFEYE is "Fellow Eye" when the measured eye is the opposite eye to the subject's assigned eye. AFEYE has no value when the subject has no assigned eye or the collected laterality is missing. The output holds every collected OE measurement, and a measurement collected without a value is kept with AVAL having no value. The assigned eye belongs to the subject, so the same eye is the study eye at every visit, and only the collected laterality moves a record between roles.

Read the source datasets from /app/input and save the completed dataset as /app/output/adoe.csv.

prompts/adam-adoe-study-eye/conventions.md

Edit
11 lines

Following CDISC ADaM standards, use the provided ADSL and OE datasets to create an ADOE dataset with one record per collected ophthalmic examination measurement.

The output dataset should contain the following columns in this order: STUDYID, USUBJID, OESEQ, PARAMCD, OELAT, AVAL, AFEYE

AFEYE is "Both Eyes", "Study Eye", "Fellow Eye", or has no value.

Read the source datasets from /app/input and save the completed dataset as /app/output/adoe.csv.

prompts/adam-adoe-study-eye/brief.md

Edit
9 lines

Following CDISC ADaM standards, use the provided ADSL and OE datasets to create an ADOE dataset with one record per collected ophthalmic examination measurement.

The output dataset should contain the following columns in this order: STUDYID, USUBJID, OESEQ, PARAMCD, OELAT, AVAL, AFEYE

Read the source datasets from /app/input and save the completed dataset as /app/output/adoe.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-adoe-study-eye/result.R

Edit
43 lines
# Reference solution for the yamaa benchmark adam-adoe-study-eye (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)adsl <- read_csv(  "/app/input/adsl.csv",  col_types = cols(.default = col_character()))oe <- read_csv(  "/app/input/oe.csv",  col_types = cols(    OESEQ = col_integer(),    OESTRESN = col_double(),    .default = col_character()  ))# The assigned eye belongs to the subject, so the join is by subject; a# subject without an assigned eye keeps its measurements with no role.adoe <- oe |>  left_join(select(adsl, USUBJID, STUDYEYE), by = "USUBJID") |>  mutate(    PARAMCD = OETESTCD,    AVAL = OESTRESN,    AFEYE = case_when(      is.na(STUDYEYE) | STUDYEYE == "" ~ NA_character_,      is.na(OELAT) | OELAT == "" ~ NA_character_,      OELAT == "BILATERAL" ~ "Both Eyes",      STUDYEYE == "BILATERAL" ~ "Study Eye",      OELAT == STUDYEYE ~ "Study Eye",      .default = "Fellow Eye"    )  ) |>  select(STUDYID, USUBJID, OESEQ, PARAMCD, OELAT, AVAL, AFEYE) |>  arrange(USUBJID, OESEQ)dir.create("/app/output", showWarnings = FALSE)write_csv(adoe, "/app/output/adoe.csv", na = "")

solutions/adam-adoe-study-eye/result.py

Edit
84 lines
# Reference solution for the yamaa benchmark adam-adoe-study-eye (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 ADOE from ADSL and OE.One record per collected ophthalmic examination measurement. AFEYE givesthe eye's role in the study, derived from the collected laterality(OELAT) and the subject's assigned eye (STUDYEYE in ADSL):- "Both Eyes" for a bilateral measurement when the subject has an  assigned eye.- "Study Eye" when the measured eye matches the assigned eye; when the  assigned eye is both eyes, a measurement of either eye is "Study Eye"  whenever the collected laterality is present.- "Fellow Eye" when the measured eye is the opposite eye to the  assigned eye.- No value when the subject has no assigned eye or the collected  laterality is missing.A measurement collected without a value is kept with AVAL missing."""import csvimport osINPUT_DIR = "/app/input"OUTPUT_DIR = "/app/output"def read_csv(path):    with open(path, newline="", encoding="utf-8") as handle:        return list(csv.DictReader(handle))def afeye(study_eye, oelat):    if not study_eye or not oelat:        return ""    if oelat == "BILATERAL":        return "Both Eyes"    if study_eye == "BILATERAL":        return "Study Eye"    if oelat == study_eye:        return "Study Eye"    return "Fellow Eye"def main():    adsl = read_csv(os.path.join(INPUT_DIR, "adsl.csv"))    oe = read_csv(os.path.join(INPUT_DIR, "oe.csv"))    study_eye_by_subject = {        (row["STUDYID"], row["USUBJID"]): row["STUDYEYE"] for row in adsl    }    columns = ["STUDYID", "USUBJID", "OESEQ", "PARAMCD", "OELAT", "AVAL", "AFEYE"]    records = []    for row in oe:        key = (row["STUDYID"], row["USUBJID"])        records.append(            {                "STUDYID": row["STUDYID"],                "USUBJID": row["USUBJID"],                "OESEQ": row["OESEQ"],                "PARAMCD": row["OETESTCD"],                "OELAT": row["OELAT"],                "AVAL": row["OESTRESN"],                "AFEYE": afeye(study_eye_by_subject.get(key, ""), row["OELAT"]),            }        )    os.makedirs(OUTPUT_DIR, exist_ok=True)    with open(        os.path.join(OUTPUT_DIR, "adoe.csv"), "w", newline="", encoding="utf-8"    ) as handle:        writer = csv.DictWriter(handle, fieldnames=columns)        writer.writeheader()        writer.writerows(records)if __name__ == "__main__":    main()

solutions/adam-adoe-study-eye/result.sas

Edit
25 lines
/* opensas reference solution for the yamaa benchmark adam-adoe-study-eye.   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 STUDYEYE $1024;  infile "/app/input/adsl.csv" dsd dlm="," firstobs=2 truncover lrecl=32767;  input STUDYID : $char1024. USUBJID : $char1024. STUDYEYE : $char1024.;run;data oe;  length STUDYID USUBJID OETESTCD OELAT $1024;  infile "/app/input/oe.csv" dsd dlm="," firstobs=2 truncover lrecl=32767;  input STUDYID : $char1024. USUBJID : $char1024. OESEQ OETESTCD : $char1024. OELAT : $char1024. OESTRESN;run;proc sql;  create table result as  select a.*,a.OETESTCD as PARAMCD,a.OESTRESN as AVAL,case when missing(a.OELAT) or missing(b.STUDYEYE) then '' when a.OELAT='BILATERAL' then 'Both Eyes' when b.STUDYEYE='BILATERAL' or a.OELAT=b.STUDYEYE then 'Study Eye' else 'Fellow Eye' end as AFEYE from oe as a left join adsl as b on a.STUDYID=b.STUDYID and a.USUBJID=b.USUBJID;quit;proc sql;  create table final as select STUDYID, USUBJID, OESEQ, PARAMCD, OELAT, AVAL, AFEYE from result;quit;proc export data=final outfile="/app/output/adoe.csv" dbms=csv replace; run;