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: build one record per skin compartment a subject has for the test code (IL13), carrying LBTESTCD, LBTEST, LBSPEC, LBLOC, LBORRES, LBORRESU, LBSTRESN, and LBSTAT.

Input: one row per subject carrying cohort, lesional result, non-lesional result, and unit.

Variables:

  • LBTESTCD is IL13 on every record.
  • LBTEST is Interleukin 13 on every record.
  • LBSPEC is SKIN on every record.
  • LBLOC is LESIONAL on the lesional record and NON-LESIONAL on the non-lesional record; the lesional record is built only when a cohort is recorded and is not NONAD, while every subject gets the non-lesional record.
  • LBORRES is the collected result as reported, taken from the lesional result on lesional records and from the non-lesional result on non-lesional records; blank when the expected sample was not analysed.
  • LBORRESU is the collected unit, taken on every record, including records whose result is blank.
  • LBSTRESN is the numeric form of the reported result; missing when the reported result is blank. A result that is not a number stops the run.
  • LBSTAT is NOT DONE when the reported result is blank; blank otherwise.

Note: a blank result with NOT DONE means the compartment exists but its sample was not analysed, while a missing lesional record means the subject has no lesional compartment.

Inputs

Under review
1 source file

input/bx_raw.csv

Edit
3 rows
input/bx_raw.csv
STUDYIDUSUBJIDCOHORTLESRESNLESRESRESU
CATHAD4.21.1pg/mL
CATHPSORIASIS—0.9pg/mL
CATHNONAD—0.8pg/mL

Expected output

Under review
5 expected rows

expected/lb.csv

Edit
5 rows
expected/lb.csv
DOMAINSTUDYIDUSUBJIDLBSEQLBTESTCDLBTESTLBSPECLBLOCLBORRESLBORRESULBSTRESNLBSTAT
LBCATH1IL13Interleukin 13SKINLESIONAL4.2pg/mL4.2—
LBCATH1IL13Interleukin 13SKINLESIONAL—pg/mL—NOT DONE
LBCATH2IL13Interleukin 13SKINNON-LESIONAL1.1pg/mL1.1—
LBCATH2IL13Interleukin 13SKINNON-LESIONAL0.9pg/mL0.9—
LBCATH1IL13Interleukin 13SKINNON-LESIONAL0.8pg/mL0.8—
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

Variable NameVariable LabelTypeLengthControlled Terms or FormatOriginCoreConversion DefinitionVariable TypeVariable OrderComments for Define
DOMAINDomain AbbreviationCharAssignedSet constant value "LB".SDTM1
STUDYIDStudy IdentifierCharCollectedCopy value from BX_RAW.STUDYID.SDTM2
USUBJIDUnique Subject IdentifierCharCollectedCopy value from BX_RAW.USUBJID.SDTM3
LBTESTCDLab Test or Examination Short NameCharAssignedSet constant value "IL13".SDTM4
LBTESTLab Test or Examination NameCharAssignedSet constant value "Interleukin 13".SDTM5
LBSPECSpecimen Material TypeCharAssignedSet constant value "SKIN".SDTM6
LBLOCLocation Used for MeasurementCharDerivedSet per constructed row; see the Row construction sheet.SDTM7
LBSEQSequence NumberNumDerivedRow number within each group of STUDYID, USUBJID, ordered by LBLOC then LBTESTCD.SDTM8
LBORRESResult or Finding in Original UnitsCharDerivedSet per constructed row; see the Row construction sheet.SDTM9
LBORRESUOriginal UnitsCharCollectedCopy value from BX_RAW.RESU.SDTM10
LBSTRESNNumeric Result/Finding in Standard UnitsNumDerivedCopy value from LBORRES.SDTM11
LBSTATCompletion StatusCharNOT DONEDerivedIf LBORRES IS NULL then "NOT DONE"; otherwise blank.SDTM12
TemplateInclude whenLBLOCLBORRES
lesionalBX_RAW.COHORT <> 'NONAD'Constant "LESIONAL"Copy BX_RAW.LESRES
non_lesionalConstant "NON-LESIONAL"Copy BX_RAW.NLESRES
VariablePermitted values
LBSTATNOT DONE
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/sdtm-lb-compartments/full.md

Edit
25 lines

Following CDISC SDTM standards, use the provided BX_RAW dataset to create an LB dataset with one record per skin compartment per subject.

The output dataset should contain the following columns in this order: DOMAIN, STUDYID, USUBJID, LBSEQ, LBTESTCD, LBTEST, LBSPEC, LBLOC, LBORRES, LBORRESU, LBSTRESN, LBSTAT

DOMAIN is "LB" on every record. LBTESTCD is "IL13" and LBTEST is "Interleukin 13" on every record. LBSPEC is "SKIN" on every record. Every subject has a non-lesional record, and a subject has a lesional record as well when a cohort is recorded for the subject and the cohort is not "NONAD". LBLOC is "LESIONAL" on the lesional record and "NON-LESIONAL" on the non-lesional record. LBORRES is the subject's lesional result on the lesional record and the subject's non-lesional result on the non-lesional record, as reported; it has no value when the compartment's sample was not analysed. LBORRESU is the collected unit on every record, including a record whose result has no value. LBSTRESN is the numeric form of the reported result, and has no value when the reported result has no value. LBSTAT is "NOT DONE" when the reported result has no value, and has no value otherwise. LBSEQ numbers a subject's records from 1, the lesional record before the non-lesional record.

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

prompts/sdtm-lb-compartments/conventions.md

Edit
14 lines

Following CDISC SDTM standards, use the provided BX_RAW dataset to create an LB dataset with one record per skin compartment per subject.

The output dataset should contain the following columns in this order: DOMAIN, STUDYID, USUBJID, LBSEQ, LBTESTCD, LBTEST, LBSPEC, LBLOC, LBORRES, LBORRESU, LBSTRESN, LBSTAT

DOMAIN is "LB" on every record. LBTESTCD is "IL13" and LBTEST is "Interleukin 13" on every record. LBSPEC is "SKIN" on every record. LBLOC is "LESIONAL" or "NON-LESIONAL". LBSTAT is "NOT DONE" or has no value.

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

prompts/sdtm-lb-compartments/brief.md

Edit
9 lines

Following CDISC SDTM standards, use the provided BX_RAW dataset to create an LB dataset with one record per skin compartment per subject.

The output dataset should contain the following columns in this order: DOMAIN, STUDYID, USUBJID, LBSEQ, LBTESTCD, LBTEST, LBSPEC, LBLOC, LBORRES, LBORRESU, LBSTRESN, LBSTAT

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

Edit
50 lines
# Reference solution for the yamaa benchmark sdtm-lb-compartments (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(purrr)bx <- read_csv(  "/app/input/bx_raw.csv",  col_types = cols(.default = col_character()))make_records <- function(study, subj, cohort, les, nles, unit) {  locs <- list()  if (!is.na(cohort) && cohort != "" && cohort != "NONAD") {    locs <- append(locs, list(list(loc = "LESIONAL", res = les)))  }  locs <- append(locs, list(list(loc = "NON-LESIONAL", res = nles)))  imap(locs, function(entry, i) {    res <- entry$res    if (is.na(res) || res == "") res <- NA_character_    num <- suppressWarnings(as.numeric(res))    tibble(      DOMAIN = "LB",      STUDYID = study,      USUBJID = subj,      LBSEQ = as.integer(i),      LBTESTCD = "IL13",      LBTEST = "Interleukin 13",      LBSPEC = "SKIN",      LBLOC = entry$loc,      LBORRES = res,      LBORRESU = unit,      LBSTRESN = num,      LBSTAT = if_else(is.na(res), "NOT DONE", NA_character_)    )  }) |> bind_rows()}lb <- pmap_dfr(  list(bx$STUDYID, bx$USUBJID, bx$COHORT, bx$LESRES, bx$NLESRES, bx$RESU),  make_records) |>  arrange(STUDYID, USUBJID, LBSEQ)dir.create("/app/output", showWarnings = FALSE)write_csv(lb, "/app/output/lb.csv", na = "")

solutions/sdtm-lb-compartments/result.py

Edit
90 lines
# Reference solution for the yamaa benchmark sdtm-lb-compartments (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."""Build the SDTM LB dataset (Interleukin 13, skin compartments) from BX_RAW.One record per skin compartment per subject: every subject gets anon-lesional record, and a subject also gets a lesional record when acohort is recorded for the subject and the cohort is not "NONAD".Within a subject the lesional record is sequenced before thenon-lesional record."""import csvINPUT_CSV = "/app/input/bx_raw.csv"OUTPUT_CSV = "/app/output/lb.csv"COLUMNS = [    "DOMAIN",    "STUDYID",    "USUBJID",    "LBSEQ",    "LBTESTCD",    "LBTEST",    "LBSPEC",    "LBLOC",    "LBORRES",    "LBORRESU",    "LBSTRESN",    "LBSTAT",]def make_record(subject, seq, location, result, unit):    """Assemble one LB record for a single compartment."""    result = (result or "").strip()    if result:        numeric = float(result)        status = ""    else:        numeric = ""        status = "NOT DONE"    return {        "DOMAIN": "LB",        "STUDYID": subject["STUDYID"],        "USUBJID": subject["USUBJID"],        "LBSEQ": seq,        "LBTESTCD": "IL13",        "LBTEST": "Interleukin 13",        "LBSPEC": "SKIN",        "LBLOC": location,        "LBORRES": result,        "LBORRESU": unit,        "LBSTRESN": numeric,        "LBSTAT": status,    }def main():    with open(INPUT_CSV, newline="") as handle:        subjects = list(csv.DictReader(handle))    records = []    for subject in subjects:        unit = (subject.get("RESU") or "").strip()        cohort = (subject.get("COHORT") or "").strip()        seq = 0        # Lesional record first, when a cohort is recorded and is not NONAD.        if cohort and cohort != "NONAD":            seq += 1            records.append(                make_record(subject, seq, "LESIONAL", subject.get("LESRES"), unit)            )        # Every subject has a non-lesional record.        seq += 1        records.append(            make_record(subject, seq, "NON-LESIONAL", subject.get("NLESRES"), unit)        )    with open(OUTPUT_CSV, "w", newline="") as handle:        writer = csv.DictWriter(handle, fieldnames=COLUMNS)        writer.writeheader()        writer.writerows(records)if __name__ == "__main__":    main()

solutions/sdtm-lb-compartments/result.sas

Edit
23 lines
/* opensas reference solution for the yamaa benchmark sdtm-lb-compartments.   Reads the benchmark inputs and derives the requested output.   Execute with the existing opensas runtime: opensas /app/output/result.sas. */data bx_raw;  length STUDYID USUBJID COHORT LESRES NLESRES RESU $1024;  infile "/app/input/bx_raw.csv" dsd dlm="," firstobs=2 truncover lrecl=32767;  input STUDYID : $char1024. USUBJID : $char1024. COHORT : $char1024. LESRES : $char1024. NLESRES : $char1024. RESU : $char1024.;run;data prepared; set bx_raw; length DOMAIN $2 LBTESTCD LBTEST LBSPEC LBLOC LBORRES LBORRESU LBSTAT $1024; DOMAIN='LB'; LBTESTCD='IL13'; LBTEST='Interleukin 13'; LBSPEC='SKIN'; LBORRESU=RESU;if not missing(COHORT) and COHORT ne 'NONAD' then do; LBLOC='LESIONAL'; LBORRES=LESRES; LBSTRESN=input(LESRES,?? best32.); LBSTAT=''; if missing(LESRES) then LBSTAT='NOT DONE'; LOCORD=1; output; end;LBLOC='NON-LESIONAL'; LBORRES=NLESRES; LBSTRESN=input(NLESRES,?? best32.); LBSTAT=''; if missing(NLESRES) then LBSTAT='NOT DONE'; LOCORD=2; output; run;proc sort data=prepared; by STUDYID USUBJID LOCORD; run;data result; set prepared; by STUDYID USUBJID; retain LBSEQ;  if first.USUBJID then LBSEQ=0;  LBSEQ+1;run;proc sql;  create table final as select DOMAIN, STUDYID, USUBJID, LBSEQ, LBTESTCD, LBTEST, LBSPEC, LBLOC, LBORRES, LBORRESU, LBSTRESN, LBSTAT from result;quit;proc export data=final outfile="/app/output/lb.csv" dbms=csv replace; run;