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: derive the confirmation flag CONFIRMED for tumor
response assessments.
Input: response assessments within a subject, each with a
sequence number RSSEQ, a collection date RSDTC, and a
standardized result RSSTRESC.
Variables:
CONFIRMED:Ywhen the analysis resultAVALCis progressive disease (PD), which needs no confirmation, or when a partial (PR) or complete (CR) response is followed at least 28 days later by another partial or complete response;Nwhen the current assessment has no result, or when the next response is too early, is not a response, or does not exist. Each assessment is compared with the next one in analysis dateADTorder within a subject.
Note: assessments sharing a date are ordered by sequence
number RSSEQ: the higher-numbered one is the next assessment for
the lower-numbered one, zero days later, so it never confirms it.
Inputs
Under review1 source fileinput/rs.csv
Edit14 rows| STUDYID | USUBJID | RSSEQ | RSDTC | RSSTRESC |
|---|---|---|---|---|
| PILOT7 | 1 | 2025-01-01 | PR | |
| PILOT7 | 2 | 2025-02-12 | PR | |
| PILOT7 | 1 | 2025-01-01 | PR | |
| PILOT7 | 2 | 2025-02-12 | SD | |
| PILOT7 | 1 | 2025-01-01 | PR | |
| PILOT7 | 2 | 2025-01-15 | PR | |
| PILOT7 | 1 | 2025-01-01 | PR | |
| PILOT7 | 1 | 2025-01-01 | PD | |
| PILOT7 | 2 | 2025-02-12 | NE | |
| PILOT7 | 1 | 2025-04-01 | PR | |
| PILOT7 | 2 | 2025-04-01 | PR | |
| PILOT7 | 1 | 2025-01-01 | PR | |
| PILOT7 | 2 | 2025-01-29 | CR | |
| PILOT7 | 1 | 2025-05-06 | — |
Expected output
Under review14 expected rowsexpected/adrs.csv
Edit14 rows| STUDYID | USUBJID | PARAMCD | RSSEQ | ADT | AVALC | CONFIRMED |
|---|---|---|---|---|---|---|
| PILOT7 | CONFRESP | 1 | 2025-01-01 | PR | Y | |
| PILOT7 | CONFRESP | 2 | 2025-02-12 | PR | N | |
| PILOT7 | CONFRESP | 1 | 2025-01-01 | PR | N | |
| PILOT7 | CONFRESP | 2 | 2025-02-12 | SD | N | |
| PILOT7 | CONFRESP | 1 | 2025-01-01 | PR | N | |
| PILOT7 | CONFRESP | 2 | 2025-01-15 | PR | N | |
| PILOT7 | CONFRESP | 1 | 2025-01-01 | PR | N | |
| PILOT7 | CONFRESP | 1 | 2025-01-01 | PD | Y | |
| PILOT7 | CONFRESP | 2 | 2025-02-12 | NE | N | |
| PILOT7 | CONFRESP | 1 | 2025-04-01 | PR | N | |
| PILOT7 | CONFRESP | 2 | 2025-04-01 | PR | N | |
| PILOT7 | CONFRESP | 1 | 2025-01-01 | PR | Y | |
| PILOT7 | CONFRESP | 2 | 2025-01-29 | CR | N | |
| PILOT7 | CONFRESP | 1 | 2025-05-06 | — | N |
Human review and assessment
| Dataset Name | Variable Name | Variable Label | Type | Codelist/Controlled Terms | Core | Computational Method | Origin |
|---|---|---|---|---|---|---|---|
| ADRS | STUDYID | Study Identifier | character | Copy value from RS.STUDYID. | Predecessor | ||
| ADRS | USUBJID | Unique Subject Identifier | character | Copy value from RS.USUBJID. | Predecessor | ||
| ADRS | PARAMCD | Parameter Code | character | Set constant value "CONFRESP". | Assigned | ||
| ADRS | RSSEQ | Sequence Number | numeric | Copy value from RS.RSSEQ. | Predecessor | ||
| ADRS | ADT | Analysis Date | numeric | ISO 8601 | Copy value from RS.RSDTC. | Predecessor | |
| ADRS | AVALC | Analysis Value (C) | character | Copy value from RS.RSSTRESC. | Predecessor | ||
| ADRS | CONFIRMED | Confirmation Flag | character | If AVALC = 'PD' then "Y"; If AVALC IN ('PR', 'CR') AND NEXTRESP IN ('PR', 'CR') AND DAYS_TO_NEXT >= 28 then "Y"; otherwise "N". | 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-adrs-confirmed-response/full.md
Edit21 linesFollowing CDISC ADaM standards, use the provided RS dataset to create an ADRS dataset with one record per tumor response assessment.
The output dataset should contain the following columns in this order: STUDYID, USUBJID, PARAMCD, RSSEQ, ADT, AVALC, CONFIRMED
PARAMCD is "CONFRESP" on every record. ADT is the collection date and AVALC is the standardized result, which has no value when no result was collected. Each assessment is compared with the next assessment of the same subject in analysis date order. Assessments sharing a date are ordered by sequence number: the higher-numbered one is the next assessment for the lower-numbered one, zero days later, so it never confirms it. CONFIRMED is "Y" when AVALC is "PD", which needs no confirmation. CONFIRMED is "Y" when AVALC is "PR" or "CR" and the next assessment has a result of "PR" or "CR" at least 28 days later. CONFIRMED is "N" otherwise: when the assessment has no result, when the next assessment is less than 28 days later, when its result is neither "PR" nor "CR", or when there is no next assessment.
Read the source datasets from /app/input and save the completed dataset as /app/output/adrs.csv.
prompts/adam-adrs-confirmed-response/conventions.md
Edit11 linesFollowing CDISC ADaM standards, use the provided RS dataset to create an ADRS dataset with one record per tumor response assessment.
The output dataset should contain the following columns in this order: STUDYID, USUBJID, PARAMCD, RSSEQ, ADT, AVALC, CONFIRMED
PARAMCD is "CONFRESP" on every record. AVALC is "CR", "PR", or "PD", or has no value. CONFIRMED is "Y" or "N".
Read the source datasets from /app/input and save the completed dataset as /app/output/adrs.csv.
prompts/adam-adrs-confirmed-response/brief.md
Edit8 linesFollowing CDISC ADaM standards, use the provided RS dataset to create an ADRS dataset with one record per tumor response assessment.
The output dataset should contain the following columns in this order: STUDYID, USUBJID, PARAMCD, RSSEQ, ADT, AVALC, CONFIRMED
Read the source datasets from /app/input and save the completed dataset as /app/output/adrs.csv.
R
Edit3 lineslibrary(yamaa)yamaa_spec("spec.yaml")$run()$outputPython
Edit3 linesimport yamaayamaa.spec("spec.yaml").run().outputsolutions/adam-adrs-confirmed-response/result.R
Edit43 lines# Reference solution for the yamaa benchmark adam-adrs-confirmed-response (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)rs <- read_csv( "/app/input/rs.csv", col_types = cols( RSSEQ = col_integer(), RSDTC = col_date(), .default = col_character() ))# Each assessment is compared with the next one in analysis date order;# assessments sharing a date are ordered by sequence number, so the# higher-numbered one is zero days later and never confirms the lower.ordered <- rs |> mutate(PARAMCD = "CONFRESP", ADT = RSDTC, AVALC = RSSTRESC) |> arrange(STUDYID, USUBJID, ADT, RSSEQ) |> group_by(STUDYID, USUBJID) |> mutate( NEXT_AVALC = lead(AVALC), NEXT_ADT = lead(ADT), DAYS = as.integer(NEXT_ADT - ADT), CONFIRMED = case_when( AVALC %in% "PD" ~ "Y", AVALC %in% c("PR", "CR") & NEXT_AVALC %in% c("PR", "CR") & !is.na(DAYS) & DAYS >= 28L ~ "Y", .default = "N" ) ) |> ungroup() |> select(STUDYID, USUBJID, PARAMCD, RSSEQ, ADT, AVALC, CONFIRMED) |> arrange(USUBJID, ADT, RSSEQ)dir.create("/app/output", showWarnings = FALSE)write_csv(ordered, "/app/output/adrs.csv", na = "")solutions/adam-adrs-confirmed-response/result.py
Edit81 lines# Reference solution for the yamaa benchmark adam-adrs-confirmed-response (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 datetime import dateINPUT_DIR = "/app/input"OUTPUT_DIR = "/app/output"def parse_date(text): if text is None or text.strip() == "": return None return date.fromisoformat(text.strip())def main(): with open(INPUT_DIR + "/rs.csv", newline="") as fh: rows = list(csv.DictReader(fh)) records = [] for row in rows: records.append( { "studyid": row["STUDYID"], "usubjid": row["USUBJID"], "rsseq": int(row["RSSEQ"]), "adt": row["RSDTC"].strip() if row["RSDTC"] else "", "date": parse_date(row["RSDTC"]), "avalc": row["RSSTRESC"].strip() if row["RSSTRESC"] else "", } ) by_subject = {} for rec in records: by_subject.setdefault(rec["usubjid"], []).append(rec) for subject_records in by_subject.values(): subject_records.sort(key=lambda r: (r["date"], r["rsseq"])) for i, rec in enumerate(subject_records): nxt = subject_records[i + 1] if i + 1 < len(subject_records) else None if rec["avalc"] == "PD": rec["confirmed"] = "Y" elif rec["avalc"] in ("PR", "CR"): if ( nxt is not None and nxt["avalc"] in ("PR", "CR") and (nxt["date"] - rec["date"]).days >= 28 ): rec["confirmed"] = "Y" else: rec["confirmed"] = "N" else: rec["confirmed"] = "N" out_rows = [] for rec in records: out_rows.append( { "STUDYID": rec["studyid"], "USUBJID": rec["usubjid"], "PARAMCD": "CONFRESP", "RSSEQ": rec["rsseq"], "ADT": rec["adt"], "AVALC": rec["avalc"], "CONFIRMED": rec["confirmed"], } ) fieldnames = ["STUDYID", "USUBJID", "PARAMCD", "RSSEQ", "ADT", "AVALC", "CONFIRMED"] with open(OUTPUT_DIR + "/adrs.csv", "w", newline="") as fh: writer = csv.DictWriter(fh, fieldnames=fieldnames) writer.writeheader() writer.writerows(out_rows)if __name__ == "__main__": main()solutions/adam-adrs-confirmed-response/result.sas
Edit26 lines/* opensas reference solution for the yamaa benchmark adam-adrs-confirmed-response. Reads the benchmark inputs and derives the requested output. Execute with the existing opensas runtime: opensas /app/output/result.sas. */data rs; length STUDYID USUBJID RSDTC RSSTRESC $1024; infile "/app/input/rs.csv" dsd dlm="," firstobs=2 truncover lrecl=32767; input STUDYID : $char1024. USUBJID : $char1024. RSSEQ RSDTC : $char1024. RSSTRESC : $char1024.;run;proc sort data=rs out=ordered; by STUDYID USUBJID descending RSDTC descending RSSEQ; run;data result; length PARAMCD $16 ADT $10 AVALC $1024 CONFIRMED $1 nextresult $1024 nextdate $10; retain nextresult nextdate; set ordered; by STUDYID USUBJID; if first.USUBJID then do; nextresult=''; nextdate=''; end; PARAMCD='CONFRESP'; ADT=RSDTC; AVALC=RSSTRESC; CONFIRMED='N'; if AVALC='PD' then CONFIRMED='Y'; else if AVALC in ('PR','CR') and nextresult in ('PR','CR') and not missing(ADT) and not missing(nextdate) and input(nextdate,yymmdd10.)-input(ADT,yymmdd10.)>=28 then CONFIRMED='Y'; nextresult=AVALC; nextdate=ADT;run;proc sql; create table final as select STUDYID, USUBJID, PARAMCD, RSSEQ, ADT, AVALC, CONFIRMED from result;quit;proc export data=final outfile="/app/output/adrs.csv" dbms=csv replace; run;
yamaa