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: derive the parameter name (PARAM) and the analysis visit
(AVISIT) of each laboratory result from their codes.
Input: laboratory results with the study and subject identifiers, the test code, the numeric result and the visit number.
Variables:
PARAMCDis the parameter code, the collected test code.PARAMis the name the study's parameter terminology gives the code, such asAlanine Aminotransferase (U/L)forALT.AVISITNis the analysis visit number, the collected visit number.AVISITis the name the study's visit terminology gives the visit number, such asWeek 2for2; a visit number the terminology does not list is an unscheduled visit,Unscheduled.AVALis the numeric result.
Note: each name is stated once, beside its code in the study's terminology, and every dataset that names a parameter or a visit reads it from there, so no dataset can spell a name differently.
Inputs
Under review1 source fileinput/lb.csv
Edit5 rows| STUDYID | USUBJID | LBSEQ | LBTESTCD | LBSTRESN | VISITNUM |
|---|---|---|---|---|---|
| YAMAA-01 | 1 | ALT | 22 | 1 | |
| YAMAA-01 | 2 | AST | 30 | 1 | |
| YAMAA-01 | 3 | ALT | 41 | 2 | |
| YAMAA-01 | 1 | AST | 25 | 1 | |
| YAMAA-01 | 2 | AST | 27.5 | 99 |
Expected output
Under review5 expected rowsexpected/adlb.csv
Edit5 rows| STUDYID | USUBJID | PARAMCD | PARAM | AVISITN | AVISIT | AVAL |
|---|---|---|---|---|---|---|
| YAMAA-01 | ALT | Alanine Aminotransferase (U/L) | 1 | Baseline | 22 | |
| YAMAA-01 | AST | Aspartate Aminotransferase (U/L) | 1 | Baseline | 30 | |
| YAMAA-01 | ALT | Alanine Aminotransferase (U/L) | 2 | Week 2 | 41 | |
| YAMAA-01 | AST | Aspartate Aminotransferase (U/L) | 1 | Baseline | 25 | |
| YAMAA-01 | AST | Aspartate Aminotransferase (U/L) | 99 | Unscheduled | 27.5 |
Human review and assessment
| Dataset Name | Variable Name | Variable Label | Type | Codelist/Controlled Terms | Core | Computational Method | Origin |
|---|---|---|---|---|---|---|---|
| ADLB | STUDYID | Study Identifier | character | Copy value from LB.STUDYID. | Predecessor | ||
| ADLB | USUBJID | Unique Subject Identifier | character | Copy value from LB.USUBJID. | Predecessor | ||
| ADLB | PARAMCD | Parameter Code | character | Copy value from LB.LBTESTCD. | Predecessor | ||
| ADLB | PARAM | Parameter | character | Decode PARAMCD through codelist PARAMCD; missing values stay missing; unlisted values are errors. | Derived | ||
| ADLB | AVISITN | Analysis Visit (N) | numeric | Copy value from LB.VISITNUM. | Predecessor | ||
| ADLB | AVISIT | Analysis Visit | character | Decode AVISITN through codelist AVISITN; missing values stay missing; unlisted values → "Unscheduled". | Derived | ||
| ADLB | AVAL | Analysis Value | numeric | Copy value from LB.LBSTRESN. | Predecessor |
| Codelist ID | Name | Value | Decode | Codelist NCI alias | Value NCI alias | Extensible | Extended value | SAS format | Dictionary | Version |
|---|---|---|---|---|---|---|---|---|---|---|
| PARAMCD | Parameter Code | ALT | Alanine Aminotransferase (U/L) | No | $PARAMCD | |||||
| PARAMCD | Parameter Code | AST | Aspartate Aminotransferase (U/L) | No | $PARAMCD | |||||
| AVISITN | Analysis Visit | 1 | Baseline | No | ||||||
| AVISITN | Analysis Visit | 2 | Week 2 | No |
| 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-adlb-parameter-names/full.md
Edit14 linesFollowing CDISC ADaM standards, use the provided LB dataset to create an ADLB dataset with one record per subject per parameter per visit.
The output dataset should contain the following columns in this order: STUDYID, USUBJID, PARAMCD, PARAM, AVISITN, AVISIT, AVAL
PARAMCD is the laboratory test code. PARAM is 'Alanine Aminotransferase (U/L)' for ALT and 'Aspartate Aminotransferase (U/L)' for AST. AVISITN is the visit number. AVISIT is 'Baseline' for visit 1, 'Week 2' for visit 2 and 'Unscheduled' for any other visit. AVAL is the numeric standard result, not rounded.
Read the source datasets from /app/input and save the completed dataset as /app/output/adlb.csv.
prompts/adam-adlb-parameter-names/conventions.md
Edit13 linesFollowing CDISC ADaM standards, use the provided LB dataset to create an ADLB dataset with one record per subject per parameter per visit.
The output dataset should contain the following columns in this order: STUDYID, USUBJID, PARAMCD, PARAM, AVISITN, AVISIT, AVAL
PARAM is 'Alanine Aminotransferase (U/L)' for ALT and 'Aspartate Aminotransferase (U/L)' for AST. AVISIT is 'Baseline' for visit 1, 'Week 2' for visit 2 and 'Unscheduled' for any other visit. AVAL is not rounded.
Read the source datasets from /app/input and save the completed dataset as /app/output/adlb.csv.
prompts/adam-adlb-parameter-names/brief.md
Edit8 linesFollowing CDISC ADaM standards, use the provided LB dataset to create an ADLB dataset with one record per subject per parameter per visit.
The output dataset should contain the following columns in this order: STUDYID, USUBJID, PARAMCD, PARAM, AVISITN, AVISIT, AVAL
Read the source datasets from /app/input and save the completed dataset as /app/output/adlb.csv.
R
Edit3 lineslibrary(yamaa)yamaa_project("project.yaml")$spec("ADLB")$run()$outputPython
Edit3 linesimport yamaayamaa.project("project.yaml").spec("ADLB").run().outputsolutions/adam-adlb-parameter-names/result.R
Edit35 lines# Reference solution for the yamaa benchmark adam-adlb-parameter-names (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)lb <- read_csv( "/app/input/lb.csv", col_types = cols(.default = col_character()))param <- c( ALT = "Alanine Aminotransferase (U/L)", AST = "Aspartate Aminotransferase (U/L)")adlb <- lb |> transmute( STUDYID, USUBJID, PARAMCD = LBTESTCD, PARAM = unname(param[LBTESTCD]), AVISITN = as.integer(VISITNUM), AVISIT = case_when( AVISITN == 1 ~ "Baseline", AVISITN == 2 ~ "Week 2", .default = "Unscheduled" ), AVAL = as.numeric(LBSTRESN) )dir.create("/app/output", showWarnings = FALSE)write_csv(adlb, "/app/output/adlb.csv", na = "")solutions/adam-adlb-parameter-names/result.py
Edit31 lines# Reference solution for the yamaa benchmark adam-adlb-parameter-names (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 pllb = pl.read_csv("/app/input/lb.csv", infer_schema=False)param = { "ALT": "Alanine Aminotransferase (U/L)", "AST": "Aspartate Aminotransferase (U/L)",}visit = {"1": "Baseline", "2": "Week 2"}adlb = lb.select( pl.col("STUDYID"), pl.col("USUBJID"), pl.col("LBTESTCD").alias("PARAMCD"), pl.col("LBTESTCD").replace_strict(param).alias("PARAM"), pl.col("VISITNUM").cast(pl.Int64).alias("AVISITN"), pl.col("VISITNUM") .replace_strict(visit, default="Unscheduled") .alias("AVISIT"), pl.col("LBSTRESN").cast(pl.Float64).alias("AVAL"),)Path("/app/output").mkdir(exist_ok=True)adlb.write_csv("/app/output/adlb.csv")solutions/adam-adlb-parameter-names/result.sas
Edit29 lines/* opensas reference solution for the yamaa benchmark adam-adlb-parameter-names. Reads the benchmark inputs and derives the requested output. Execute with the existing opensas runtime: opensas /app/output/result.sas. */data lb; length STUDYID USUBJID LBTESTCD $1024; infile "/app/input/lb.csv" dsd dlm="," firstobs=2 truncover lrecl=32767; input STUDYID : $char1024. USUBJID : $char1024. LBSEQ LBTESTCD : $char1024. LBSTRESN VISITNUM;run;data result; set lb; length PARAMCD $8 PARAM $40 AVISIT $20; PARAMCD = LBTESTCD; if LBTESTCD = 'ALT' then PARAM = 'Alanine Aminotransferase (U/L)'; else if LBTESTCD = 'AST' then PARAM = 'Aspartate Aminotransferase (U/L)'; AVISITN = VISITNUM; if AVISITN = 1 then AVISIT = 'Baseline'; else if AVISITN = 2 then AVISIT = 'Week 2'; else AVISIT = 'Unscheduled'; AVAL = LBSTRESN;run;proc sql; create table final as select STUDYID, USUBJID, PARAMCD, PARAM, AVISITN, AVISIT, AVAL from result;quit;proc export data=final outfile="/app/output/adlb.csv" dbms=csv replace; run;
yamaa