Review ask

As a clinical trial statistician or programmer, challenge anything in this benchmark: describe a problem in Comments, or propose a fix with the Edit button on any source file.

  1. Task: Would a real study need this derivation, specified this way? Does it follow CDISC ADaM: variable names, controlled terms, record structure? Flag any rule that is ambiguous or that a sponsor would handle differently.
  2. Inputs: Do they look like data collected in a real trial, and do they include the situations you would expect to meet in one?
  3. Expected output: Would independent QC programming reproduce every value from these inputs and rules?

The other tabs beside Comments are background for assessment, not under review.

Summary

Lifecycle: reviewedEditUnder review
What this benchmark means
README.md

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

Comments and assessment materials

Comments

Signed in with GitHub; saved in repository 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.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
22 lines

Following CDISC ADaM standards, use the provided OE and ADSL datasets to create an ADOE dataset with one row per collected ophthalmic 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: 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 has no value.

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. A measurement collected without a value is kept with its value empty.

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 OE and ADSL datasets to create an ADOE dataset with one row per collected ophthalmic measurement.

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

AFEYE is Study Eye, Both Eyes, or 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 OE and ADSL datasets to create an ADOE dataset with one row per collected ophthalmic 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

Runs the yamaa specification; its result must match the expected output

run.R

Edit
4 lines
library(yamaa)adoe <- yamaa_domain("spec.yaml")$outputadoe

run.py

Edit
4 lines
import yamaaadoe = yamaa.yamaa_domain("spec.yaml").outputadoe

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
44 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.from pathlib import Pathimport polars as pladsl = pl.read_csv("/app/input/adsl.csv", infer_schema=False)oe = pl.read_csv("/app/input/oe.csv", infer_schema=False).with_columns(    pl.col("OESEQ").cast(pl.Int64),    pl.col("OESTRESN").cast(pl.Float64),)# 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.base = oe.join(    adsl.select("USUBJID", "STUDYEYE"), on="USUBJID", how="left")study_missing = pl.col("STUDYEYE").is_null() | (pl.col("STUDYEYE") == "")collected_missing = pl.col("OELAT").is_null() | (pl.col("OELAT") == "")afeye = (    pl.when(study_missing | collected_missing)    .then(None)    .when(pl.col("OELAT") == "BILATERAL")    .then(pl.lit("Both Eyes"))    .when(pl.col("STUDYEYE") == "BILATERAL")    .then(pl.lit("Study Eye"))    .when(pl.col("OELAT") == pl.col("STUDYEYE"))    .then(pl.lit("Study Eye"))    .otherwise(pl.lit("Fellow Eye")))adoe = (    base.with_columns(PARAMCD=pl.col("OETESTCD"), AVAL=pl.col("OESTRESN"), AFEYE=afeye)    .select("STUDYID", "USUBJID", "OESEQ", "PARAMCD", "OELAT", "AVAL", "AFEYE")    .sort(["USUBJID", "OESEQ"]))Path("/app/output").mkdir(exist_ok=True)adoe.write_csv("/app/output/adoe.csv")

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;