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: retain the reported result in AVALC, produce numeric AVAL, and identify substituted results with DTYPE.

Input: Study Data Tabulation Model (SDTM) laboratory results for human immunodeficiency virus ribonucleic acid (HIV RNA), reported as text in copies/mL, including inequalities and missing results.

Variables:

  • PARAMCD identifies the laboratory test, carried from LBTESTCD.
  • AVALC retains the reported text; blank when no result was reported.
  • AVAL follows the study's one-unit policy: subtract 1 from a strict < limit and add 1 to a strict > limit. Inclusive <= and >= limits use the boundary itself. An ordinary number or = result retains its numeric value; a missing result stays missing, distinct from zero.
  • AVALU carries the standard unit, copies/mL.
  • DTYPE is IMPUTATION for an inequality result; blank otherwise.

Note: the one-unit offset is an authored study convention. It does not claim to recover the unmeasured result. Only nonnegative decimal numbers, optionally preceded by <, >, <=, >=, or =, are accepted; other reported text stops the run.

Inputs

Under review
1 source file

input/lb.csv

Edit
11 rows
input/lb.csv
STUDYIDUSUBJIDLBSEQLBTESTCDLBSTRESCLBSTRESU
LIMIT011HIVRNA12000copies/mL
LIMIT012HIVRNA<50copies/mL
LIMIT013HIVRNA>8000copies/mL
LIMIT014HIVRNA<=50copies/mL
LIMIT015HIVRNA>=8000copies/mL
LIMIT016HIVRNA=50copies/mL
LIMIT017HIVRNA—copies/mL
LIMIT018HIVRNA0copies/mL
LIMIT019HIVRNA<1copies/mL
LIMIT0110HIVRNA>0copies/mL
LIMIT0111HIVRNA2.5copies/mL

Expected output

Under review
11 expected rows

expected/adlb.csv

Edit
11 rows
expected/adlb.csv
STUDYIDUSUBJIDLBSEQPARAMCDAVALCAVALAVALUDTYPE
LIMIT011HIVRNA1200012000copies/mL—
LIMIT012HIVRNA<5049copies/mLIMPUTATION
LIMIT013HIVRNA>80008001copies/mLIMPUTATION
LIMIT014HIVRNA<=5050copies/mLIMPUTATION
LIMIT015HIVRNA>=80008000copies/mLIMPUTATION
LIMIT016HIVRNA=5050copies/mL—
LIMIT017HIVRNA——copies/mL—
LIMIT018HIVRNA00copies/mL—
LIMIT019HIVRNA<10copies/mLIMPUTATION
LIMIT0110HIVRNA>01copies/mLIMPUTATION
LIMIT0111HIVRNA2.52.5copies/mL—
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
ADLBLBSEQLaboratory Sequence NumbernumericCopy value from LB.LBSEQ.Predecessor
ADLBPARAMCDParameter CodecharacterCopy value from LB.LBTESTCD.Predecessor
ADLBAVALCAnalysis Value (C)characterCopy value from LB.LBSTRESC.Predecessor
ADLBAVALAnalysis ValuenumericIf AVALC LIKE '<%' AND AVALC NOT LIKE '<=%' then compute LIMITVAL - 1; If AVALC LIKE '>%' AND AVALC NOT LIKE '>=%' then compute LIMITVAL + 1; otherwise "LIMITVAL".Derived
ADLBAVALUAnalysis Value UnitcharacterCopy value from LB.LBSTRESU.Predecessor
ADLBDTYPEDerivation TypecharacterIf AVALC LIKE '<%' OR AVALC LIKE '>%' then "IMPUTATION"; otherwise blank.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-limit-imputation/full.md

Edit
20 lines

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

The output dataset should contain the following columns in this order: STUDYID, USUBJID, LBSEQ, PARAMCD, AVALC, AVAL, AVALU, DTYPE

PARAMCD is the laboratory test code from LBTESTCD. AVALC is the reported result text from LBSTRESC, and has no value when no result was reported. AVAL is the numeric value of the reported result under the study's one-unit policy: one less than the limit for a result reported with a strict "<", one more than the limit for a result reported with a strict ">", and the limit itself for a result reported with "<=" or ">=". An ordinary number, or a result reported with "=", keeps its numeric value, and a missing result has no AVAL, which is distinct from zero. AVALU is the standard unit from LBSTRESU, copies/mL. DTYPE is "IMPUTATION" when the reported result is an inequality, reported with "<", ">", "<=", or ">=", and has no value otherwise.

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

prompts/adam-adlb-limit-imputation/conventions.md

Edit
10 lines

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

The output dataset should contain the following columns in this order: STUDYID, USUBJID, LBSEQ, PARAMCD, AVALC, AVAL, AVALU, DTYPE

DTYPE is "IMPUTATION" or has no value.

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

prompts/adam-adlb-limit-imputation/brief.md

Edit
8 lines

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

The output dataset should contain the following columns in this order: STUDYID, USUBJID, LBSEQ, PARAMCD, AVALC, AVAL, AVALU, DTYPE

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-limit-imputation/result.R

Edit
52 lines
# Reference solution for the yamaa benchmark adam-adlb-limit-imputation (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(    LBSEQ = col_integer(),    .default = col_character()  ),  na = "")# The numeric boundary of the reported result: the decimal number after an# optional "<", ">", "<=", ">=" or "=" prefix. It has no value when no# result was reported.based <- lb |>  mutate(    PARAMCD = LBTESTCD,    AVALC = LBSTRESC,    AVALU = LBSTRESU,    LIMITVAL = as.numeric(sub("^[<>=]+", "", AVALC))  )# Only a strict inequality receives the one-unit offset; an inclusive# limit, an ordinary number and an "=" result keep the number itself.adlb <- based |>  mutate(    AVAL = case_when(      !is.na(AVALC) & startsWith(AVALC, "<") & !startsWith(AVALC, "<=") ~        LIMITVAL - 1,      !is.na(AVALC) & startsWith(AVALC, ">") & !startsWith(AVALC, ">=") ~        LIMITVAL + 1,      .default = LIMITVAL    ),    DTYPE = if_else(      !is.na(AVALC) & (startsWith(AVALC, "<") | startsWith(AVALC, ">")),      "IMPUTATION",      NA_character_    )  ) |>  select(    STUDYID, USUBJID, LBSEQ, PARAMCD, AVALC, AVAL, AVALU, DTYPE  )dir.create("/app/output", showWarnings = FALSE)write_csv(adlb, "/app/output/adlb.csv", na = "")

solutions/adam-adlb-limit-imputation/result.py

Edit
58 lines
# Reference solution for the yamaa benchmark adam-adlb-limit-imputation (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 csvdef fmt(value):    if value == int(value):        return str(int(value))    return repr(value)def derive(text):    """Return (AVAL text, DTYPE text) for a reported result string."""    if text is None or text.strip() == "":        return "", ""    t = text.strip()    for prefix, kind in (("<=", "le"), (">=", "ge"), ("<", "lt"), (">", "gt"), ("=", "eq")):        if t.startswith(prefix):            limit = float(t[len(prefix):])            if kind == "lt":                return fmt(limit - 1), "IMPUTATION"            if kind == "gt":                return fmt(limit + 1), "IMPUTATION"            if kind in ("le", "ge"):                return fmt(limit), "IMPUTATION"            return fmt(limit), ""    return fmt(float(t)), ""def main():    with open("/app/input/lb.csv", newline="") as f:        rows = list(csv.DictReader(f))    out = []    for r in rows:        aval, dtype = derive(r["LBSTRESC"])        out.append({            "STUDYID": r["STUDYID"],            "USUBJID": r["USUBJID"],            "LBSEQ": r["LBSEQ"],            "PARAMCD": r["LBTESTCD"],            "AVALC": r["LBSTRESC"],            "AVAL": aval,            "AVALU": r["LBSTRESU"],            "DTYPE": dtype,        })    fields = ["STUDYID", "USUBJID", "LBSEQ", "PARAMCD", "AVALC", "AVAL", "AVALU", "DTYPE"]    with open("/app/output/adlb.csv", "w", newline="") as f:        w = csv.DictWriter(f, fieldnames=fields)        w.writeheader()        w.writerows(out)if __name__ == "__main__":    main()

solutions/adam-adlb-limit-imputation/result.sas

Edit
37 lines
/* opensas reference solution for the yamaa benchmark adam-adlb-limit-imputation.   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 LBSTRESC LBSTRESU $1024;  infile "/app/input/lb.csv" dsd dlm="," firstobs=2 truncover lrecl=32767;  input STUDYID : $char1024. USUBJID : $char1024. LBSEQ LBTESTCD : $char1024. LBSTRESC : $char1024. LBSTRESU : $char1024.;run;data result;  length DTYPE $1024;  set lb;  PARAMCD = LBTESTCD;  AVALC = LBSTRESC;  AVALU = LBSTRESU;  /* The numeric boundary: the number after any inequality or "=" prefix. */  NUMTXT = AVALC;  if substr(NUMTXT, 1, 2) in ('<=', '>=') then NUMTXT = substr(NUMTXT, 3);  else if substr(NUMTXT, 1, 1) in ('<', '>', '=') then NUMTXT = substr(NUMTXT, 2);  if NUMTXT ne '' then LIMITVAL = input(NUMTXT, best32.);  else LIMITVAL = .;  /* Only a strict inequality receives the one-unit offset. */  if missing(AVALC) then AVAL = .;  else if substr(AVALC, 1, 2) in ('<=', '>=') then AVAL = LIMITVAL;  else if substr(AVALC, 1, 1) = '<' then AVAL = LIMITVAL - 1;  else if substr(AVALC, 1, 1) = '>' then AVAL = LIMITVAL + 1;  else AVAL = LIMITVAL;  if substr(AVALC, 1, 1) in ('<', '>') then DTYPE = 'IMPUTATION';  else DTYPE = '';  drop NUMTXT LIMITVAL;run;proc sql;  create table final as select STUDYID, USUBJID, LBSEQ, PARAMCD, AVALC, AVAL, AVALU, DTYPE from result;quit;proc export data=final outfile="/app/output/adlb.csv" dbms=csv replace; run;