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: carry each investigator-scored overall response assessment
into the analysis dataset as one record under the OVR (Overall
Response by Investigator) parameter, adding the completed date
(ADT), the study day (ADY), the response rank (AVAL), and the
per-date flag (ANL01FL).
Input: one record per collected response assessment carrying the
test code RSTESTCD, the evaluator RSEVAL, the assessment date
RSDTC, and the result RSSTRESC, plus the treatment start TRTSDT
from the subject-level dataset. Only assessments the investigator
(INVESTIGATOR) scored as overall response (OVRLRESP) leave a
record; a target-lesion assessment (TRGRESP) and an independent
assessor (INDEPENDENT ASSESSOR) assessment leave none.
Variables:
RSSEQnumbers the assessment within the subject;PARAMCDandPARAMcarry the fixed parameter code and description.RSDTCcarries the collected assessment date as it was recorded.ADTis the completed analysis date. A fully collected date is used as it stands; a year and month without a day complete to the first of the month, and a year alone to 1 January. An assessment with no readable date stops the run.ADYis the study day of the assessment, counting the treatment start as day one.AVALCis the collected response: complete response (CR), partial response (PR), stable disease (SD), neither complete response nor progressive disease (NON-CR/NON-PD), progressive disease (PD), or not evaluable (NE).AVALranks the response from best to worst as1(CR),2(PR),3(SD),4(NON-CR/NON-PD),5(PD), or6(NE).ANL01FLisYfor one record at each assessment date: the worst (largestAVAL) response that day, with the lowestRSSEQbreaking ties when a day carries the same worst response twice. It is empty otherwise.
Note: a completed date counts exactly as a collected one in every comparison that follows, so grouping by date and measuring from the treatment start never depend on how much of the date was collected. An assessment dated exactly on the treatment start lands on study day one.
Inputs
Under review2 source filesinput/adsl.csv
Edit8 rows| STUDYID | USUBJID | TRTSDT |
|---|---|---|
| YAMAA-01 | 2025-01-06 | |
| YAMAA-01 | 2025-01-13 | |
| YAMAA-01 | 2025-01-20 | |
| YAMAA-01 | 2025-01-27 | |
| YAMAA-01 | 2025-02-03 | |
| YAMAA-01 | 2025-01-01 | |
| YAMAA-01 | 2025-01-06 | |
| YAMAA-01 | 2025-01-13 |
input/rs.csv
Edit18 rows| STUDYID | USUBJID | RSSEQ | RSTESTCD | RSEVAL | RSDTC | RSSTRESC |
|---|---|---|---|---|---|---|
| YAMAA-01 | 1 | OVRLRESP | INVESTIGATOR | 2025-02-03 | PR | |
| YAMAA-01 | 2 | OVRLRESP | INVESTIGATOR | 2025-03-17 | CR | |
| YAMAA-01 | 3 | OVRLRESP | INVESTIGATOR | 2025-04-28 | PD | |
| YAMAA-01 | 1 | OVRLRESP | INVESTIGATOR | 2025-02-10 | SD | |
| YAMAA-01 | 2 | OVRLRESP | INVESTIGATOR | 2025-02-10 | PD | |
| YAMAA-01 | 3 | OVRLRESP | INVESTIGATOR | 2025-03-24 | NE | |
| YAMAA-01 | 1 | OVRLRESP | INVESTIGATOR | 2025-03 | NON-CR/NON-PD | |
| YAMAA-01 | 1 | OVRLRESP | INVESTIGATOR | 2025-02-17 | SD | |
| YAMAA-01 | 2 | OVRLRESP | INVESTIGATOR | 2025-02-17 | SD | |
| YAMAA-01 | 1 | TRGRESP | INVESTIGATOR | 2025-05-05 | PR | |
| YAMAA-01 | 2 | OVRLRESP | INDEPENDENT ASSESSOR | 2025-05-05 | PR | |
| YAMAA-01 | 3 | OVRLRESP | INVESTIGATOR | 2025-05-05 | CR | |
| YAMAA-01 | 1 | OVRLRESP | INVESTIGATOR | 2025 | PR | |
| YAMAA-01 | 1 | OVRLRESP | INVESTIGATOR | 2025-01-06 | CR | |
| YAMAA-01 | 1 | OVRLRESP | INVESTIGATOR | 2025-02-10 | SD | |
| YAMAA-01 | 2 | OVRLRESP | INVESTIGATOR | 2025-02-10 | PD | |
| YAMAA-01 | 3 | OVRLRESP | INVESTIGATOR | 2025-02-10 | NE | |
| YAMAA-01 | 4 | OVRLRESP | INVESTIGATOR | 2025-02-10 | NE |
Expected output
Under review16 expected rowsexpected/adrs.csv
Edit16 rows| STUDYID | USUBJID | RSSEQ | PARAMCD | PARAM | RSDTC | ADT | ADY | AVALC | AVAL | ANL01FL |
|---|---|---|---|---|---|---|---|---|---|---|
| YAMAA-01 | 1 | OVR | Overall Response by Investigator | 2025-02-03 | 2025-02-03 | 29 | PR | 2 | Y | |
| YAMAA-01 | 2 | OVR | Overall Response by Investigator | 2025-03-17 | 2025-03-17 | 71 | CR | 1 | Y | |
| YAMAA-01 | 3 | OVR | Overall Response by Investigator | 2025-04-28 | 2025-04-28 | 113 | PD | 5 | Y | |
| YAMAA-01 | 1 | OVR | Overall Response by Investigator | 2025-02-10 | 2025-02-10 | 29 | SD | 3 | — | |
| YAMAA-01 | 2 | OVR | Overall Response by Investigator | 2025-02-10 | 2025-02-10 | 29 | PD | 5 | Y | |
| YAMAA-01 | 3 | OVR | Overall Response by Investigator | 2025-03-24 | 2025-03-24 | 71 | NE | 6 | Y | |
| YAMAA-01 | 1 | OVR | Overall Response by Investigator | 2025-03 | 2025-03-01 | 41 | NON-CR/NON-PD | 4 | Y | |
| YAMAA-01 | 1 | OVR | Overall Response by Investigator | 2025-02-17 | 2025-02-17 | 22 | SD | 3 | Y | |
| YAMAA-01 | 2 | OVR | Overall Response by Investigator | 2025-02-17 | 2025-02-17 | 22 | SD | 3 | — | |
| YAMAA-01 | 3 | OVR | Overall Response by Investigator | 2025-05-05 | 2025-05-05 | 92 | CR | 1 | Y | |
| YAMAA-01 | 1 | OVR | Overall Response by Investigator | 2025 | 2025-01-01 | 1 | PR | 2 | Y | |
| YAMAA-01 | 1 | OVR | Overall Response by Investigator | 2025-01-06 | 2025-01-06 | 1 | CR | 1 | Y | |
| YAMAA-01 | 1 | OVR | Overall Response by Investigator | 2025-02-10 | 2025-02-10 | 29 | SD | 3 | — | |
| YAMAA-01 | 2 | OVR | Overall Response by Investigator | 2025-02-10 | 2025-02-10 | 29 | PD | 5 | — | |
| YAMAA-01 | 3 | OVR | Overall Response by Investigator | 2025-02-10 | 2025-02-10 | 29 | NE | 6 | Y | |
| YAMAA-01 | 4 | OVR | Overall Response by Investigator | 2025-02-10 | 2025-02-10 | 29 | NE | 6 | — |
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 | RSSEQ | Sequence Number | numeric | Copy value from RS.RSSEQ. | Predecessor | ||
| ADRS | PARAMCD | Parameter Code | character | Set constant value "OVR". | Assigned | ||
| ADRS | PARAM | Parameter | character | Set constant value "Overall Response by Investigator". | Assigned | ||
| ADRS | RSDTC | Date/Time of Assessment | character | Copy value from RS.RSDTC. | Predecessor | ||
| ADRS | ADT | Analysis Date | numeric | ISO 8601 | Impute incomplete date from RSDTC, defaulting month=1, day=1; invalid text is an error. | Derived | |
| ADRS | AVALC | Analysis Value (C) | character | CR, PR, SD, NON-CR/NON-PD, PD, NE | Copy value from RS.RSSTRESC. | Predecessor | |
| ADRS | AVAL | Analysis Value | numeric | Recode AVALC: "CR" → "1", "PR" → "2", "SD" → "3", "NON-CR/NON-PD" → "4", "PD" → "5", "NE" → "6"; missing values stay missing; unlisted values are errors. | Derived | ||
| ADRS | ADY | Analysis Relative Day | numeric | CDISC study day of ADT against TRTSDT as day 1; there is no day zero. | Derived | ||
| ADRS | ANL01FL | Analysis Record Flag 01 | character | Y | "Y" when WORSTORD = 1; blank otherwise. | Derived |
| Variable | Permitted values |
|---|---|
| AVALC | CR, PR, SD, NON-CR/NON-PD, PD, NE |
| ANL01FL | Y |
| 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-response-records/full.md
Edit42 linesFollowing CDISC ADaM standards, use the provided ADSL and RS datasets to create an ADRS dataset with one record per investigator-scored overall response assessment.
The output dataset should contain the following columns in this order: STUDYID, USUBJID, RSSEQ, PARAMCD, PARAM, RSDTC, ADT, ADY, AVALC, AVAL, ANL01FL
- A record appears only for an assessment the investigator scored as overall response, with RSTESTCD "OVRLRESP" and RSEVAL "INVESTIGATOR".
- A target-lesion assessment (RSTESTCD "TRGRESP") and an assessment scored by an independent assessor (RSEVAL "INDEPENDENT ASSESSOR") leave no record.
- RSSEQ is the sequence number of the assessment within the subject.
- PARAMCD is "OVR" and PARAM is "Overall Response by Investigator" on every record.
- RSDTC holds the assessment date exactly as collected, even when only a year or a year and a month were collected.
- ADT is the completed analysis date: a fully collected date is used as it stands, a year and month without a day complete to the first of the month, and a year alone completes to 1 January.
- A completed date counts exactly as a collected one in every comparison, so the study day and the per-date flag never depend on how much of the date was collected.
- ADY is the study day of the assessment, counting the treatment start as day one, so an assessment dated exactly on the treatment start lands on study day one.
- AVALC is the collected response, one of "CR", "PR", "SD", "NON-CR/NON-PD", "PD", or "NE".
- The codes stand for complete response ("CR"), partial response ("PR"), stable disease ("SD"), neither complete response nor progressive disease ("NON-CR/NON-PD"), progressive disease ("PD"), and not evaluable ("NE").
- AVAL ranks the response from best to worst: 1 for "CR", 2 for "PR", 3 for "SD", 4 for "NON-CR/NON-PD", 5 for "PD", and 6 for "NE".
- ANL01FL is "Y" for one record at each assessment date (ADT): the record carrying the worst response that day, the largest AVAL, with the lowest RSSEQ breaking ties when a day carries the same worst response twice.
- ANL01FL has no value on every other record.
Read the source datasets from /app/input and save the completed dataset as /app/output/adrs.csv.
prompts/adam-adrs-response-records/conventions.md
Edit19 linesFollowing CDISC ADaM standards, use the provided ADSL and RS datasets to create an ADRS dataset with one record per investigator-scored overall response assessment.
The output dataset should contain the following columns in this order: STUDYID, USUBJID, RSSEQ, PARAMCD, PARAM, RSDTC, ADT, ADY, AVALC, AVAL, ANL01FL
PARAMCD is "OVR" and PARAM is "Overall Response by Investigator" on every record. ADY is the study day of the assessment, counting the treatment start as day one. AVALC is "CR", "PR", "SD", "NON-CR/NON-PD", "PD", or "NE". The codes stand for complete response ("CR"), partial response ("PR"), stable disease ("SD"), neither complete response nor progressive disease ("NON-CR/NON-PD"), progressive disease ("PD"), and not evaluable ("NE"). AVAL ranks the response from best to worst: 1 for "CR", 2 for "PR", 3 for "SD", 4 for "NON-CR/NON-PD", 5 for "PD", and 6 for "NE". ANL01FL is "Y" or has no value.
Read the source datasets from /app/input and save the completed dataset as /app/output/adrs.csv.
prompts/adam-adrs-response-records/brief.md
Edit9 linesFollowing CDISC ADaM standards, use the provided ADSL and RS datasets to create an ADRS dataset with one record per investigator-scored overall response assessment.
The output dataset should contain the following columns in this order: STUDYID, USUBJID, RSSEQ, PARAMCD, PARAM, RSDTC, ADT, ADY, AVALC, AVAL, ANL01FL
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-response-records/result.R
Edit71 lines# Reference solution for the yamaa benchmark adam-adrs-response-records (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(lubridate)library(readr)library(stringr)adsl <- read_csv( "/app/input/adsl.csv", col_types = cols(TRTSDT = col_date(), .default = col_character()))rs <- read_csv( "/app/input/rs.csv", col_types = cols(RSSEQ = col_integer(), .default = col_character()))# Only investigator overall response assessments leave a record.base <- rs |> filter(RSTESTCD %in% "OVRLRESP", RSEVAL %in% "INVESTIGATOR") |> left_join(select(adsl, USUBJID, TRTSDT), by = "USUBJID") |> mutate( PARAMCD = "OVR", PARAM = "Overall Response by Investigator", RSDTC = RSDTC, ADT = case_when( str_detect(RSDTC, "^[0-9]{4}-[0-9]{2}-[0-9]{2}$") ~ suppressWarnings(ymd(RSDTC, quiet = TRUE)), str_detect(RSDTC, "^[0-9]{4}-[0-9]{2}$") ~ suppressWarnings(ymd(paste0(RSDTC, "-01"), quiet = TRUE)), str_detect(RSDTC, "^[0-9]{4}$") ~ suppressWarnings(ymd(paste0(RSDTC, "-01-01"), quiet = TRUE)), .default = as.Date(NA) ), ADY = case_when( is.na(ADT) | is.na(TRTSDT) ~ NA_integer_, ADT >= TRTSDT ~ as.integer(ADT - TRTSDT) + 1L, .default = as.integer(ADT - TRTSDT) ), AVALC = RSSTRESC, AVAL = case_when( AVALC == "CR" ~ 1L, AVALC == "PR" ~ 2L, AVALC == "SD" ~ 3L, AVALC == "NON-CR/NON-PD" ~ 4L, AVALC == "PD" ~ 5L, AVALC == "NE" ~ 6L ) )# One flagged record at each assessment date: the worst response that day,# with the lowest sequence number breaking ties.flagged <- base |> group_by(STUDYID, USUBJID, ADT) |> arrange(desc(AVAL), RSSEQ, .by_group = TRUE) |> mutate( rank = row_number(), ANL01FL = if_else(rank == 1L, "Y", NA_character_) ) |> ungroup() |> select(-rank)adrs <- flagged |> select( STUDYID, USUBJID, RSSEQ, PARAMCD, PARAM, RSDTC, ADT, ADY, AVALC, AVAL, ANL01FL ) |> arrange(USUBJID, ADT, RSSEQ)dir.create("/app/output", showWarnings = FALSE)write_csv(adrs, "/app/output/adrs.csv", na = "")solutions/adam-adrs-response-records/result.py
Edit95 lines# Reference solution for the yamaa benchmark adam-adrs-response-records (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."""Create ADRS (one record per investigator-scored overall responseassessment) from ADSL and RS, following CDISC ADaM standards."""import csvfrom datetime import dateINPUT_DIR = "/app/input"OUTPUT_DIR = "/app/output"AVAL_MAP = { "CR": 1, "PR": 2, "SD": 3, "NON-CR/NON-PD": 4, "PD": 5, "NE": 6,}def complete_date(rsdtc): """Complete a possibly partial ISO date: a year and month without a day complete to the first of the month; a year alone completes to 1 January.""" parts = rsdtc.split("-") year = int(parts[0]) month = int(parts[1]) if len(parts) > 1 else 1 day = int(parts[2]) if len(parts) > 2 else 1 return date(year, month, day)def parse_full_date(text): year, month, day = (int(p) for p in text.split("-")) return date(year, month, day)def main(): with open(f"{INPUT_DIR}/adsl.csv", newline="") as f: adsl = {row["USUBJID"]: row for row in csv.DictReader(f)} with open(f"{INPUT_DIR}/rs.csv", newline="") as f: rs_rows = list(csv.DictReader(f)) records = [] for row in rs_rows: if row["RSTESTCD"] != "OVRLRESP" or row["RSEVAL"] != "INVESTIGATOR": continue trtsdt = parse_full_date(adsl[row["USUBJID"]]["TRTSDT"]) adt = complete_date(row["RSDTC"]) ady = (adt - trtsdt).days + 1 avalc = row["RSSTRESC"] records.append( { "STUDYID": row["STUDYID"], "USUBJID": row["USUBJID"], "RSSEQ": row["RSSEQ"], "PARAMCD": "OVR", "PARAM": "Overall Response by Investigator", "RSDTC": row["RSDTC"], "ADT": adt.isoformat(), "ADY": ady, "AVALC": avalc, "AVAL": AVAL_MAP[avalc], "ANL01FL": "", } ) # ANL01FL: one record per subject per assessment date (ADT) -- the # record carrying the worst response that day (largest AVAL), with # the lowest RSSEQ breaking ties. groups = {} for rec in records: key = (rec["USUBJID"], rec["ADT"]) groups.setdefault(key, []).append(rec) for group in groups.values(): flagged = min(group, key=lambda r: (-r["AVAL"], int(r["RSSEQ"]))) flagged["ANL01FL"] = "Y" fieldnames = [ "STUDYID", "USUBJID", "RSSEQ", "PARAMCD", "PARAM", "RSDTC", "ADT", "ADY", "AVALC", "AVAL", "ANL01FL", ] with open(f"{OUTPUT_DIR}/adrs.csv", "w", newline="") as f: writer = csv.DictWriter(f, fieldnames=fieldnames) writer.writeheader() writer.writerows(records)if __name__ == "__main__": main()solutions/adam-adrs-response-records/result.sas
Edit35 lines/* opensas reference solution for the yamaa benchmark adam-adrs-response-records. Reads the benchmark inputs and derives the requested output. Execute with the existing opensas runtime: opensas /app/output/result.sas. */data adsl; length STUDYID USUBJID TRTSDT $1024; infile "/app/input/adsl.csv" dsd dlm="," firstobs=2 truncover lrecl=32767; input STUDYID : $char1024. USUBJID : $char1024. TRTSDT : $char1024.;run;data rs; length STUDYID USUBJID RSTESTCD RSEVAL RSDTC RSSTRESC $1024; infile "/app/input/rs.csv" dsd dlm="," firstobs=2 truncover lrecl=32767; input STUDYID : $char1024. USUBJID : $char1024. RSSEQ RSTESTCD : $char1024. RSEVAL : $char1024. RSDTC : $char1024. RSSTRESC : $char1024.;run;proc sql; create table joined as select a.*,b.TRTSDT from rs as a left join adsl as b on a.STUDYID=b.STUDYID and a.USUBJID=b.USUBJID where a.RSTESTCD='OVRLRESP' and a.RSEVAL='INVESTIGATOR'; quit;data assessments; length PARAMCD $8 PARAM $40 ADT $10 AVALC $16; set joined; PARAMCD='OVR'; PARAM='Overall Response by Investigator'; ADT=RSDTC; if lengthn(RSDTC)=7 then ADT=cats(RSDTC,'-01'); if lengthn(RSDTC)=4 then ADT=cats(RSDTC,'-01-01'); if not missing(ADT) and not missing(TRTSDT) then do; ADY=input(ADT,yymmdd10.)-input(TRTSDT,yymmdd10.); if ADY>=0 then ADY=ADY+1; end; AVALC=RSSTRESC; select(AVALC); when('CR') AVAL=1; when('PR') AVAL=2; when('SD') AVAL=3; when('NON-CR/NON-PD') AVAL=4; when('PD') AVAL=5; when('NE') AVAL=6; otherwise AVAL=.; end;run;proc sort data=assessments; by STUDYID USUBJID ADT descending AVAL RSSEQ; run;data result; length ANL01FL $1; set assessments; by STUDYID USUBJID ADT; if first.ADT then ANL01FL='Y'; run;proc sql; create table final as select STUDYID, USUBJID, RSSEQ, PARAMCD, PARAM, RSDTC, ADT, ADY, AVALC, AVAL, ANL01FL from result;quit;proc export data=final outfile="/app/output/adrs.csv" dbms=csv replace; run;
yamaa