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: derive AVALC and AVAL flagging whether each subject had measurable disease at baseline.

Input: one record per subject from the subject-level analysis dataset (ADSL), plus tumor identification (TU) records carrying the tumor test code (TUTESTCD), the visit (VISIT), the standardized result (TUSTRESC), and a sequence number (TUSEQ).

Variables:

  • AVALC is Y when the subject has at least one screening tumor identification record (TUTESTCD of TUMIDENT, VISIT of SCREENING) whose result is target disease (TUSTRESC of TARGET); otherwise N. A screening record with a blank result, or a result such as NON-TARGET or BENIGN ABNORMALITY, is not target disease, and neither are target records from later visits.
  • AVAL is 1 when AVALC is Y and 0 when AVALC is N.

Note: every subject in the subject-level dataset gets one flag record, even with no screening tumor assessment, so such a subject is N / 0. A tumor record for a subject outside the subject-level dataset contributes to no flag and creates none.

Inputs

Under review
2 source files

input/adsl.csv

Edit
6 rows
input/adsl.csv
STUDYIDUSUBJID
YAMAA-01
YAMAA-01
YAMAA-01
YAMAA-01
YAMAA-01
YAMAA-01

input/tu.csv

Edit
11 rows
input/tu.csv
STUDYIDUSUBJIDTUSEQTUTESTCDVISITTUSTRESC
YAMAA-011TUMIDENTSCREENINGTARGET
YAMAA-012TUMIDENTSCREENINGTARGET
YAMAA-013TUMIDENTWEEK 1TARGET
YAMAA-014TUMIDENTWEEK 9NON-TARGET
YAMAA-011TUMIDENTSCREENINGNON-TARGET
YAMAA-012TUMIDENTSCREENINGNON-TARGET
YAMAA-011TUMIDENTWEEK 1TARGET
YAMAA-012TUMIDENTWEEK 5TARGET
YAMAA-011TUMIDENTSCREENINGBENIGN ABNORMALITY
YAMAA-011TUMIDENTSCREENING—
YAMAA-011TUMIDENTSCREENINGTARGET

Expected output

Under review
6 expected rows

expected/adrs.csv

Edit
6 rows
expected/adrs.csv
STUDYIDUSUBJIDPARAMCDPARAMAVALCAVAL
YAMAA-01MDISMeasurable Disease at BaselineY1
YAMAA-01MDISMeasurable Disease at BaselineN0
YAMAA-01MDISMeasurable Disease at BaselineN0
YAMAA-01MDISMeasurable Disease at BaselineN0
YAMAA-01MDISMeasurable Disease at BaselineN0
YAMAA-01MDISMeasurable Disease at BaselineN0
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
ADRSSTUDYIDStudy IdentifiercharacterCopy value from ADSL.STUDYID.Predecessor
ADRSUSUBJIDUnique Subject IdentifiercharacterCopy value from ADSL.USUBJID.Predecessor
ADRSPARAMCDParameter CodecharacterSet constant value "MDIS".Assigned
ADRSPARAMParametercharacterSet constant value "Measurable Disease at Baseline".Assigned
ADRSAVALCAnalysis Value (C)characterY, N"Y" when TUSTRESC IS NOT NULL, with TUSTRESC taken from the first TU record matching on STUDYID and USUBJID, where TU.TUTESTCD = 'TUMIDENT' AND TU.VISIT = 'SCREENING' AND TU.TUSTRESC = 'TARGET', ordered by TU.TUSEQ, and no match yields blank; "N" otherwise; "N" when the condition is unknown.Derived
ADRSAVALAnalysis ValuenumericRecode AVALC: "Y" → "1", "N" → "0"; missing values stay missing; unlisted values are errors.Derived
VariablePermitted values
AVALCY, N
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-adrs-measurable-disease/full.md

Edit
22 lines

Following CDISC ADaM standards, use the provided ADSL and TU datasets to create an ADRS dataset with one record per subject.

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

  • PARAMCD is "MDIS" and PARAM is "Measurable Disease at Baseline" on every record.
  • AVALC is "Y" when the subject has at least one tumor identification record with TUTESTCD "TUMIDENT" at VISIT "SCREENING" whose TUSTRESC is "TARGET", and "N" otherwise.
  • A screening record with a blank result, or with a result such as "NON-TARGET" or "BENIGN ABNORMALITY", is not target disease, and a "TARGET" result at a later visit does not count.
  • AVAL is 1 when AVALC is "Y" and 0 when AVALC is "N".
  • Every subject in ADSL has one record, even a subject with no screening tumor assessment, whose AVALC is "N" and AVAL is 0.
  • A tumor record for a subject who is not in ADSL contributes to no flag and creates no record.

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

prompts/adam-adrs-measurable-disease/conventions.md

Edit
13 lines

Following CDISC ADaM standards, use the provided ADSL and TU datasets to create an ADRS dataset with one record per subject.

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

  • PARAMCD is "MDIS" and PARAM is "Measurable Disease at Baseline" on every record.
  • AVALC is "Y" or "N".
  • AVAL is 1 for "Y" and 0 for "N".

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

prompts/adam-adrs-measurable-disease/brief.md

Edit
8 lines

Following CDISC ADaM standards, use the provided ADSL and TU datasets to create an ADRS dataset with one record per subject.

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

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

Edit
40 lines
# Reference solution for the yamaa benchmark adam-adrs-measurable-disease (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)adsl <- read_csv(  "/app/input/adsl.csv",  col_types = cols(.default = col_character()))tu <- read_csv(  "/app/input/tu.csv",  col_types = cols(TUSEQ = col_integer(), .default = col_character()))# Target disease at screening: a screening tumor identification record# whose result is target. Later target records do not count.target_subjects <- tu |>  filter(    TUTESTCD %in% "TUMIDENT",    VISIT %in% "SCREENING",    TUSTRESC %in% "TARGET"  ) |>  distinct(USUBJID)adrs <- adsl |>  mutate(    PARAMCD = "MDIS",    PARAM = "Measurable Disease at Baseline",    AVALC = if_else(USUBJID %in% target_subjects$USUBJID, "Y", "N"),    AVAL = if_else(AVALC == "Y", 1L, 0L)  ) |>  select(STUDYID, USUBJID, PARAMCD, PARAM, AVALC, AVAL) |>  arrange(USUBJID)dir.create("/app/output", showWarnings = FALSE)write_csv(adrs, "/app/output/adrs.csv", na = "")

solutions/adam-adrs-measurable-disease/result.py

Edit
58 lines
# Reference solution for the yamaa benchmark adam-adrs-measurable-disease (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 csvINPUT_DIR = "/app/input"OUTPUT_DIR = "/app/output"def read_csv(path):    with open(path, newline="", encoding="utf-8") as handle:        return list(csv.DictReader(handle))def main():    adsl = read_csv(f"{INPUT_DIR}/adsl.csv")    tu = read_csv(f"{INPUT_DIR}/tu.csv")    target_subjects = set()    for row in tu:        if (            row.get("TUTESTCD") == "TUMIDENT"            and row.get("VISIT") == "SCREENING"            and (row.get("TUSTRESC") or "").strip() == "TARGET"        ):            target_subjects.add((row.get("STUDYID"), row.get("USUBJID")))    out_rows = []    for subject in adsl:        key = (subject.get("STUDYID"), subject.get("USUBJID"))        avalc = "Y" if key in target_subjects else "N"        out_rows.append(            {                "STUDYID": subject.get("STUDYID"),                "USUBJID": subject.get("USUBJID"),                "PARAMCD": "MDIS",                "PARAM": "Measurable Disease at Baseline",                "AVALC": avalc,                "AVAL": 1 if avalc == "Y" else 0,            }        )    with open(        f"{OUTPUT_DIR}/adrs.csv", "w", newline="", encoding="utf-8"    ) as handle:        writer = csv.DictWriter(            handle,            fieldnames=["STUDYID", "USUBJID", "PARAMCD", "PARAM", "AVALC", "AVAL"],        )        writer.writeheader()        writer.writerows(out_rows)if __name__ == "__main__":    main()

solutions/adam-adrs-measurable-disease/result.sas

Edit
30 lines
/* opensas reference solution for the yamaa benchmark adam-adrs-measurable-disease.   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 $1024;  infile "/app/input/adsl.csv" dsd dlm="," firstobs=2 truncover lrecl=32767;  input STUDYID : $char1024. USUBJID : $char1024.;run;data tu;  length STUDYID USUBJID TUTESTCD VISIT TUSTRESC $1024;  infile "/app/input/tu.csv" dsd dlm="," firstobs=2 truncover lrecl=32767;  input STUDYID : $char1024. USUBJID : $char1024. TUSEQ TUTESTCD : $char1024. VISIT : $char1024. TUSTRESC : $char1024.;run;proc sql;  create table counts as select STUDYID,USUBJID,count(*) as matches from tu where TUTESTCD='TUMIDENT' and VISIT='SCREENING' and TUSTRESC='TARGET' group by STUDYID,USUBJID;  create table joined as select a.*,b.matches from adsl as a left join counts as b on a.STUDYID=b.STUDYID and a.USUBJID=b.USUBJID;quit;data result;  length PARAMCD $8 PARAM $40 AVALC $1;  set joined; PARAMCD='MDIS'; PARAM='Measurable Disease at Baseline';  AVALC='N'; AVAL=0; if matches>0 then do; AVALC='Y'; AVAL=1; end;run;proc sql;  create table final as select STUDYID, USUBJID, PARAMCD, PARAM, AVALC, AVAL from result;quit;proc export data=final outfile="/app/output/adrs.csv" dbms=csv replace; run;