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: report each analysis value (AVAL) against the analysis normal range lower limit (ANRLO), adding R2ANRLO.

Input: laboratory (LB) records carrying the analysis value (AVAL) and the analysis normal range lower limit (ANRLO) for each test.

Variables:

  • R2ANRLO: the result as a multiple of the lower limit of the normal range; blank when the result or the lower limit was not collected, or the lower limit was recorded as zero.

Note: every number is reported to four places, so a result that needs fewer still shows them and a ratio that needs more is rounded exactly once, as it is written, with an exact half going away from zero (one thirty-second is reported as 0.0313). Nothing is rounded before the report: the ratio keeps every digit it was calculated with, and a number that was never collected is reported as absent rather than as four zeroes.

Inputs

Under review
1 source file

input/lb.csv

Edit
8 rows
input/lb.csv
STUDYIDUSUBJIDPARAMCDAVALANRLO
YAMAA-01ALT4432
YAMAA-01ALT73.532
YAMAA-01ALT11032
YAMAA-01ALT132
YAMAA-01ALT58—
YAMAA-01ALT580
YAMAA-01ALT—32
YAMAA-01AST2832

Expected output

Under review
8 expected rows

expected/adlb.csv

Edit
8 rows
expected/adlb.csv
STUDYIDUSUBJIDPARAMCDAVALANRLOR2ANRLO
YAMAA-01ALT44.000032.00001.3750
YAMAA-01ALT73.500032.00002.2969
YAMAA-01ALT110.000032.00003.4375
YAMAA-01ALT1.000032.00000.0313
YAMAA-01ALT58.0000——
YAMAA-01ALT58.00000.0000—
YAMAA-01ALT—32.0000—
YAMAA-01AST28.000032.00000.8750
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
ADLBSTUDYIDStudy IdentifiercharacterCopy value from LB.STUDYID.Predecessor
ADLBUSUBJIDUnique Subject IdentifiercharacterCopy value from LB.USUBJID.Predecessor
ADLBPARAMCDParameter CodecharacterCopy value from LB.PARAMCD.Predecessor
ADLBAVALAnalysis ValuenumericCopy value from LB.AVAL.Predecessor
ADLBANRLOAnalysis Normal Range Lower LimitnumericCopy value from LB.ANRLO.Predecessor
ADLBR2ANRLORatio to Lower Limit of NormalnumericCompute AVAL / NULLIF(ANRLO, 0).Derived
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-adlb-reported-precision/full.md

Edit
18 lines

Following CDISC ADaM standards, use the provided LB dataset to create an ADLB dataset with one record per subject per parameter.

The output dataset should contain the following columns in this order: STUDYID, USUBJID, PARAMCD, AVAL, ANRLO, R2ANRLO

R2ANRLO is the analysis value as a multiple of the analysis normal range lower limit: AVAL divided by ANRLO. R2ANRLO has no value when AVAL or ANRLO has no value, or when ANRLO is zero. Every number is reported to four decimal places, so a value that needs fewer places still shows them. A value that needs more than four places is rounded exactly once, as it is reported, with an exact half going away from zero: one thirty-second is reported as 0.0313. Nothing is rounded before the report: the ratio keeps every digit it was calculated with. A number that was never collected is reported as absent rather than as four zeroes.

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

prompts/adam-adlb-reported-precision/conventions.md

Edit
15 lines

Following CDISC ADaM standards, use the provided LB dataset to create an ADLB dataset with one record per subject per parameter.

The output dataset should contain the following columns in this order: STUDYID, USUBJID, PARAMCD, AVAL, ANRLO, R2ANRLO

Every number is reported to four decimal places, so a value that needs fewer places still shows them. A value that needs more than four places is rounded exactly once, as it is reported, with an exact half going away from zero: one thirty-second is reported as 0.0313. Nothing is rounded before the report. A number that was never collected is reported as absent rather than as four zeroes.

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

prompts/adam-adlb-reported-precision/brief.md

Edit
8 lines

Following CDISC ADaM standards, use the provided LB dataset to create an ADLB dataset with one record per subject per parameter.

The output dataset should contain the following columns in this order: STUDYID, USUBJID, PARAMCD, AVAL, ANRLO, R2ANRLO

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

Edit
34 lines
# Reference solution for the yamaa benchmark adam-adlb-reported-precision (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(    AVAL = col_double(),    ANRLO = col_double(),    .default = col_character()  ))# The result as a multiple of the lower limit, rounded once to four places# with an exact half away from zero.adlb <- lb |>  mutate(    ratio = AVAL / ANRLO,    R2ANRLO = case_when(      is.na(AVAL) | is.na(ANRLO) | ANRLO == 0 ~ NA_real_,      ratio >= 0 ~ floor(ratio * 10000 + 0.5) / 10000,      .default = ceiling(ratio * 10000 - 0.5) / 10000    )  ) |>  arrange(USUBJID) |>  select(STUDYID, USUBJID, PARAMCD, AVAL, ANRLO, R2ANRLO)dir.create("/app/output", showWarnings = FALSE)write_csv(adlb, "/app/output/adlb.csv", na = "")

solutions/adam-adlb-reported-precision/result.py

Edit
63 lines
# Reference solution for the yamaa benchmark adam-adlb-reported-precision (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 csvfrom decimal import Decimal, ROUND_HALF_UP, getcontextgetcontext().prec = 50FOUR_PLACES = Decimal("0.0001")def parse_number(text):    text = (text or "").strip()    if text == "":        return None    return Decimal(text)def report(value):    """Format a Decimal to exactly four decimal places, rounding an exact    half away from zero. A missing value is reported as absent."""    if value is None:        return ""    return str(value.quantize(FOUR_PLACES, rounding=ROUND_HALF_UP))def main():    with open("/app/input/lb.csv", newline="") as f:        rows = list(csv.DictReader(f))    out_rows = []    for row in rows:        aval = parse_number(row["AVAL"])        anrlo = parse_number(row["ANRLO"])        if aval is None or anrlo is None or anrlo == 0:            ratio = None        else:            # Nothing is rounded before the report: the ratio keeps every            # digit it was calculated with and is rounded once, in report().            ratio = aval / anrlo        out_rows.append(            {                "STUDYID": row["STUDYID"],                "USUBJID": row["USUBJID"],                "PARAMCD": row["PARAMCD"],                "AVAL": report(aval),                "ANRLO": report(anrlo),                "R2ANRLO": report(ratio),            }        )    fieldnames = ["STUDYID", "USUBJID", "PARAMCD", "AVAL", "ANRLO", "R2ANRLO"]    with open("/app/output/adlb.csv", "w", newline="") as f:        writer = csv.DictWriter(f, fieldnames=fieldnames)        writer.writeheader()        writer.writerows(out_rows)if __name__ == "__main__":    main()

solutions/adam-adlb-reported-precision/result.sas

Edit
16 lines
/* opensas reference solution for the yamaa benchmark adam-adlb-reported-precision.   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 PARAMCD $1024;  infile "/app/input/lb.csv" dsd dlm="," firstobs=2 truncover lrecl=32767;  input STUDYID : $char1024. USUBJID : $char1024. PARAMCD : $char1024. AVAL ANRLO;run;data result;  set lb;  if not missing(AVAL) and not missing(ANRLO) and ANRLO ne 0 then R2ANRLO=round(AVAL/ANRLO,0.0001);run;proc export data=result(keep=STUDYID USUBJID PARAMCD AVAL ANRLO R2ANRLO) outfile="/app/output/adlb.csv" dbms=csv replace; run;