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 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:
AFEYEis the eye's role in the study:Study Eyewhen the measured eye matches the subject's assigned eye,Both Eyesfor a bilateral measurement when the subject has an assigned eye, andFellow Eyefor 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,AFEYEstays 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 review2 source filesinput/adsl.csv
Edit4 rows| STUDYID | USUBJID | STUDYEYE |
|---|---|---|
| YAMAA-01 | LEFT | |
| YAMAA-01 | RIGHT | |
| YAMAA-01 | BILATERAL | |
| YAMAA-01 | LEFT |
input/oe.csv
Edit10 rows| STUDYID | USUBJID | OESEQ | OETESTCD | OELAT | OESTRESN |
|---|---|---|---|---|---|
| YAMAA-01 | 1 | IOP | LEFT | 18 | |
| YAMAA-01 | 2 | IOP | RIGHT | 24 | |
| YAMAA-01 | 1 | IOP | LEFT | 16 | |
| YAMAA-01 | 2 | IOP | RIGHT | 15 | |
| YAMAA-01 | 1 | IOP | LEFT | 21 | |
| YAMAA-01 | 2 | IOP | RIGHT | 20 | |
| YAMAA-01 | 3 | IOP | BILATERAL | — | |
| YAMAA-01 | 1 | IOP | LEFT | 19 | |
| YAMAA-01 | 2 | IOP | BILATERAL | — | |
| YAMAA-01 | 1 | IOP | — | 22 |
Expected output
Under review10 expected rowsexpected/adoe.csv
Edit10 rows| STUDYID | USUBJID | OESEQ | PARAMCD | OELAT | AVAL | AFEYE |
|---|---|---|---|---|---|---|
| YAMAA-01 | 1 | IOP | LEFT | 18 | Study Eye | |
| YAMAA-01 | 2 | IOP | RIGHT | 24 | Fellow Eye | |
| YAMAA-01 | 1 | IOP | LEFT | 16 | Fellow Eye | |
| YAMAA-01 | 2 | IOP | RIGHT | 15 | Study Eye | |
| YAMAA-01 | 1 | IOP | LEFT | 21 | Study Eye | |
| YAMAA-01 | 2 | IOP | RIGHT | 20 | Study Eye | |
| YAMAA-01 | 3 | IOP | BILATERAL | — | Both Eyes | |
| YAMAA-01 | 1 | IOP | LEFT | 19 | — | |
| YAMAA-01 | 2 | IOP | BILATERAL | — | — | |
| YAMAA-01 | 1 | IOP | — | 22 | — |
Human review and assessment
| Dataset Name | Variable Name | Variable Label | Type | Codelist/Controlled Terms | Core | Computational Method | Origin |
|---|---|---|---|---|---|---|---|
| ADOE | STUDYID | Study Identifier | character | Copy value from OE.STUDYID. | Predecessor | ||
| ADOE | USUBJID | Unique Subject Identifier | character | Copy value from OE.USUBJID. | Predecessor | ||
| ADOE | OESEQ | Sequence Number | numeric | Copy value from OE.OESEQ. | Predecessor | ||
| ADOE | PARAMCD | Parameter Code | character | Copy value from OE.OETESTCD. | Predecessor | ||
| ADOE | OELAT | Laterality | character | LEFT, RIGHT, BILATERAL | Copy value from OE.OELAT. | Predecessor | |
| ADOE | AVAL | Analysis Value | numeric | Copy value from OE.OESTRESN. | Predecessor | ||
| ADOE | AFEYE | Analysis Eye | character | Study Eye, Fellow Eye, Both Eyes | If 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 |
| Variable | Permitted values |
|---|---|
| OELAT | LEFT, RIGHT, BILATERAL |
| AFEYE | Study Eye, Fellow Eye, Both Eyes |
| 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-adoe-study-eye/full.md
Edit23 linesFollowing 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
Edit11 linesFollowing 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
Edit9 linesFollowing 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.
R
Edit3 lineslibrary(yamaa)yamaa_spec("spec.yaml")$run()$outputPython
Edit3 linesimport yamaayamaa.spec("spec.yaml").run().outputsolutions/adam-adoe-study-eye/result.R
Edit43 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
Edit84 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
Edit25 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;
yamaa