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: 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:
PARAMCDidentifies the laboratory test, carried fromLBTESTCD.AVALCretains the reported text; blank when no result was reported.AVALfollows 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.AVALUcarries the standard unit, copies/mL.DTYPEisIMPUTATIONfor 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 review1 source fileinput/lb.csv
Edit11 rows| STUDYID | USUBJID | LBSEQ | LBTESTCD | LBSTRESC | LBSTRESU |
|---|---|---|---|---|---|
| LIMIT01 | 1 | HIVRNA | 12000 | copies/mL | |
| LIMIT01 | 2 | HIVRNA | <50 | copies/mL | |
| LIMIT01 | 3 | HIVRNA | >8000 | copies/mL | |
| LIMIT01 | 4 | HIVRNA | <=50 | copies/mL | |
| LIMIT01 | 5 | HIVRNA | >=8000 | copies/mL | |
| LIMIT01 | 6 | HIVRNA | =50 | copies/mL | |
| LIMIT01 | 7 | HIVRNA | — | copies/mL | |
| LIMIT01 | 8 | HIVRNA | 0 | copies/mL | |
| LIMIT01 | 9 | HIVRNA | <1 | copies/mL | |
| LIMIT01 | 10 | HIVRNA | >0 | copies/mL | |
| LIMIT01 | 11 | HIVRNA | 2.5 | copies/mL |
Expected output
Under review11 expected rowsexpected/adlb.csv
Edit11 rows| STUDYID | USUBJID | LBSEQ | PARAMCD | AVALC | AVAL | AVALU | DTYPE |
|---|---|---|---|---|---|---|---|
| LIMIT01 | 1 | HIVRNA | 12000 | 12000 | copies/mL | — | |
| LIMIT01 | 2 | HIVRNA | <50 | 49 | copies/mL | IMPUTATION | |
| LIMIT01 | 3 | HIVRNA | >8000 | 8001 | copies/mL | IMPUTATION | |
| LIMIT01 | 4 | HIVRNA | <=50 | 50 | copies/mL | IMPUTATION | |
| LIMIT01 | 5 | HIVRNA | >=8000 | 8000 | copies/mL | IMPUTATION | |
| LIMIT01 | 6 | HIVRNA | =50 | 50 | copies/mL | — | |
| LIMIT01 | 7 | HIVRNA | — | — | copies/mL | — | |
| LIMIT01 | 8 | HIVRNA | 0 | 0 | copies/mL | — | |
| LIMIT01 | 9 | HIVRNA | <1 | 0 | copies/mL | IMPUTATION | |
| LIMIT01 | 10 | HIVRNA | >0 | 1 | copies/mL | IMPUTATION | |
| LIMIT01 | 11 | HIVRNA | 2.5 | 2.5 | copies/mL | — |
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 | LBSEQ | Laboratory Sequence Number | numeric | Copy value from LB.LBSEQ. | Predecessor | ||
| ADLB | PARAMCD | Parameter Code | character | Copy value from LB.LBTESTCD. | Predecessor | ||
| ADLB | AVALC | Analysis Value (C) | character | Copy value from LB.LBSTRESC. | Predecessor | ||
| ADLB | AVAL | Analysis Value | numeric | If AVALC LIKE '<%' AND AVALC NOT LIKE '<=%' then compute LIMITVAL - 1; If AVALC LIKE '>%' AND AVALC NOT LIKE '>=%' then compute LIMITVAL + 1; otherwise "LIMITVAL". | Derived | ||
| ADLB | AVALU | Analysis Value Unit | character | Copy value from LB.LBSTRESU. | Predecessor | ||
| ADLB | DTYPE | Derivation Type | character | If AVALC LIKE '<%' OR AVALC LIKE '>%' then "IMPUTATION"; otherwise blank. | Derived |
| 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-limit-imputation/full.md
Edit20 linesFollowing 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
Edit10 linesFollowing 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
Edit8 linesFollowing 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.
R
Edit3 lineslibrary(yamaa)yamaa_spec("spec.yaml")$run()$outputPython
Edit3 linesimport yamaayamaa.spec("spec.yaml").run().outputsolutions/adam-adlb-limit-imputation/result.R
Edit52 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
Edit58 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
Edit37 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;
yamaa