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: draftEditUnder review
What this benchmark means
README.md

Public entries: Python and R. Passing coverage requires an installed inventory.

Goal: carry the supplemental qualifier value onto each analysis laboratory row (QVAL, QVAL_NAMED).

Input: laboratory records carry a numeric sequence number; supplemental records carry the same sequence as eight-character, space-padded text. Two subjects may share a sequence number.

Variables:

  • QVAL is the qualifier value from the supplemental record whose study, subject, and padded sequence all match; empty when nothing matches.
  • QVAL_NAMED holds the same value from the same match, taken again once every laboratory row exists; empty when nothing matches.

Note: the padding must be exact: a zero-padded key does not match the space-padded form, and a supplemental record with no laboratory record changes nothing. Rows in both sequence ranges use the same match.

Inputs

Under review
2 source files

input/lb.csv

Edit
6 rows
input/lb.csv
STUDYIDUSUBJIDLBSEQ
YAMAA-017
YAMAA-01200
YAMAA-01259
YAMAA-01259
YAMAA-0142
YAMAA-01311

input/supplb.csv

Edit
7 rows
input/supplb.csv
STUDYIDUSUBJIDIDVARVALQVAL
YAMAA-01 7OTHER
YAMAA-01 200BOUND
YAMAA-01 259EP
YAMAA-01 999ORPHAN
YAMAA-01 259SHARED
YAMAA-0100000259ZEROPAD
YAMAA-01 42SINGLE

Expected output

Under review
6 expected rows

expected/adlb.csv

Edit
6 rows
expected/adlb.csv
STUDYIDUSUBJIDLBSEQQVALQVAL_NAMED
YAMAA-017OTHEROTHER
YAMAA-0142SINGLESINGLE
YAMAA-01200BOUNDBOUND
YAMAA-01259EPEP
YAMAA-01259SHAREDSHARED
YAMAA-01311——
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
ADLBUSUBJIDSubject IdentifiercharacterCopy value from LB.USUBJID.Predecessor
ADLBLBSEQSequence NumbernumericCopy value from LB.LBSEQ.Predecessor
ADLBQVALSupplemental ValuecharacterSet per constructed row; see the Row construction sheet.Derived
ADLBQVAL_NAMEDSupplemental Value by Named IntermediatecharacterTake QVAL from the SUPPLB record whose STUDYID equals LB.STUDYID, USUBJID equals LB.USUBJID and IDVARVAL equals LBSEQ padded on the left with spaces to at least 8 characters, and no match yields blank.Derived
TemplateInclude whenQVAL
low_sequenceLB.LBSEQ < 200Copy QVAL from the SUPPLB record whose STUDYID equals LB.STUDYID, USUBJID equals LB.USUBJID and IDVARVAL equals LBSEQ padded on the left with spaces to at least 8 characters, and no match yields blank
high_sequenceLB.LBSEQ >= 200Copy QVAL from the SUPPLB record whose STUDYID equals LB.STUDYID, USUBJID equals LB.USUBJID and IDVARVAL equals LBSEQ padded on the left with spaces to at least 8 characters, and no match yields blank
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-supplb-padded-key/full.md

Edit
17 lines

Following CDISC ADaM standards, use the provided LB and SUPPLB datasets to create an ADLB dataset with one record per laboratory record.

The output dataset should contain the following columns in this order: STUDYID, USUBJID, LBSEQ, QVAL, QVAL_NAMED

QVAL is the qualifier value of the SUPPLB record whose STUDYID and USUBJID match the laboratory record and whose IDVARVAL is the record's LBSEQ padded with spaces to eight characters. QVAL has no value when no SUPPLB record matches. QVAL_NAMED holds the same value from the same match and has no value when no SUPPLB record matches. The padding is exact: an IDVARVAL padded with zeros does not match. A SUPPLB record that matches no laboratory record changes nothing. Rows with an LBSEQ below 200 and rows with an LBSEQ of 200 or more use the same match.

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

prompts/adam-adlb-supplb-padded-key/conventions.md

Edit
10 lines

Following CDISC ADaM standards, use the provided LB and SUPPLB datasets to create an ADLB dataset with one record per laboratory record.

The output dataset should contain the following columns in this order: STUDYID, USUBJID, LBSEQ, QVAL, QVAL_NAMED

IDVARVAL is the record's LBSEQ padded with spaces to eight characters.

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

prompts/adam-adlb-supplb-padded-key/brief.md

Edit
8 lines

Following CDISC ADaM standards, use the provided LB and SUPPLB datasets to create an ADLB dataset with one record per laboratory record.

The output dataset should contain the following columns in this order: STUDYID, USUBJID, LBSEQ, QVAL, QVAL_NAMED

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-supplb-padded-key/result.R

Edit
35 lines
# Reference solution for the yamaa benchmark adam-adlb-supplb-padded-key (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)library(stringr)lb <- read_csv(  "/app/input/lb.csv",  col_types = cols(LBSEQ = col_integer(), .default = col_character()))supp <- read_csv(  "/app/input/supplb.csv",  col_types = cols(.default = col_character()),  trim_ws = FALSE)# The qualifier value whose IDVARVAL is the laboratory sequence number as# eight characters, right-aligned and space-padded. Zero-padded keys do# not match; a supplemental record with no laboratory record adds no row.adlb <- lb |>  mutate(PADDED_KEY = str_pad(as.character(LBSEQ), width = 8, side = "left", pad = " ")) |>  left_join(    supp |> select(STUDYID, USUBJID, IDVARVAL, QVAL),    by = c("STUDYID", "USUBJID", "PADDED_KEY" = "IDVARVAL")  ) |>  mutate(QVAL_NAMED = QVAL) |>  arrange(LBSEQ, USUBJID) |>  select(STUDYID, USUBJID, LBSEQ, QVAL, QVAL_NAMED)dir.create("/app/output", showWarnings = FALSE)write_csv(adlb, "/app/output/adlb.csv", na = "")

solutions/adam-adlb-supplb-padded-key/result.py

Edit
50 lines
# Reference solution for the yamaa benchmark adam-adlb-supplb-padded-key (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 csvINPUT_DIR = "/app/input"OUTPUT_DIR = "/app/output"def main():    with open(f"{INPUT_DIR}/lb.csv", newline="") as f:        lb_rows = list(csv.DictReader(f))    with open(f"{INPUT_DIR}/supplb.csv", newline="") as f:        supp_rows = list(csv.DictReader(f))    # Index SUPPLB by (STUDYID, USUBJID, IDVARVAL) exactly as collected:    # IDVARVAL must equal the LBSEQ padded with spaces to eight characters.    supp = {}    for row in supp_rows:        key = (row["STUDYID"], row["USUBJID"], row["IDVARVAL"])        supp[key] = row["QVAL"]    out_rows = []    for row in lb_rows:        padded = row["LBSEQ"].rjust(8)        key = (row["STUDYID"], row["USUBJID"], padded)        qval = supp.get(key, "")        out_rows.append(            {                "STUDYID": row["STUDYID"],                "USUBJID": row["USUBJID"],                "LBSEQ": row["LBSEQ"],                "QVAL": qval,                "QVAL_NAMED": qval,            }        )    with open(f"{OUTPUT_DIR}/adlb.csv", "w", newline="") as f:        writer = csv.DictWriter(            f, fieldnames=["STUDYID", "USUBJID", "LBSEQ", "QVAL", "QVAL_NAMED"]        )        writer.writeheader()        writer.writerows(out_rows)if __name__ == "__main__":    main()

solutions/adam-adlb-supplb-padded-key/result.sas

Edit
23 lines
/* opensas reference solution for the yamaa benchmark adam-adlb-supplb-padded-key.   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 $1024;  infile "/app/input/lb.csv" dsd dlm="," firstobs=2 truncover lrecl=32767;  input STUDYID : $char1024. USUBJID : $char1024. LBSEQ;run;data supplb;  length STUDYID USUBJID IDVARVAL QVAL $1024;  infile "/app/input/supplb.csv" dsd dlm="," firstobs=2 truncover lrecl=32767;  input STUDYID : $char1024. USUBJID : $char1024. IDVARVAL : $char1024. QVAL : $char1024.;run;data lb_key; set lb; length PARENTKEY $8; PARENTKEY=put(LBSEQ,8.); run;proc sql;  create table result as  select a.*,b.QVAL,b.QVAL as QVAL_NAMED from lb_key as a left join supplb as b on a.STUDYID=b.STUDYID and a.USUBJID=b.USUBJID and a.PARENTKEY=b.IDVARVAL;quit;proc export data=result(keep=STUDYID USUBJID LBSEQ QVAL QVAL_NAMED) outfile="/app/output/adlb.csv" dbms=csv replace; run;