As a clinical trial statistician or programmer, challenge anything in this benchmark: describe a problem in Comments, or propose a fix with the Edit button on any source file.
- Task: Would a real study need this derivation, specified this way? Does it follow CDISC ADaM: variable names, controlled terms, record structure? Flag any rule that is ambiguous or that a sponsor would handle differently.
- Inputs: Do they look like data collected in a real trial, and do they include the situations you would expect to meet in one?
- Expected output: Would independent QC programming reproduce every value from these inputs and rules?
The other tabs beside Comments are background for assessment, not under review.
Summary
README.mdGoal: 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:
AVALCisYwhen the subject has at least one screening tumor identification record (TUTESTCDofTUMIDENT,VISITofSCREENING) whose result is target disease (TUSTRESCofTARGET); otherwiseN. A screening record with a blank result, or a result such asNON-TARGETorBENIGN ABNORMALITY, is not target disease, and neither are target records from later visits.AVALis1whenAVALCisYand0whenAVALCisN.
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 review2 source filesinput/adsl.csv
Edit6 rows| STUDYID | USUBJID |
|---|---|
| YAMAA-01 | |
| YAMAA-01 | |
| YAMAA-01 | |
| YAMAA-01 | |
| YAMAA-01 | |
| YAMAA-01 |
input/tu.csv
Edit11 rows| STUDYID | USUBJID | TUSEQ | TUTESTCD | VISIT | TUSTRESC |
|---|---|---|---|---|---|
| YAMAA-01 | 1 | TUMIDENT | SCREENING | TARGET | |
| YAMAA-01 | 2 | TUMIDENT | SCREENING | TARGET | |
| YAMAA-01 | 3 | TUMIDENT | WEEK 1 | TARGET | |
| YAMAA-01 | 4 | TUMIDENT | WEEK 9 | NON-TARGET | |
| YAMAA-01 | 1 | TUMIDENT | SCREENING | NON-TARGET | |
| YAMAA-01 | 2 | TUMIDENT | SCREENING | NON-TARGET | |
| YAMAA-01 | 1 | TUMIDENT | WEEK 1 | TARGET | |
| YAMAA-01 | 2 | TUMIDENT | WEEK 5 | TARGET | |
| YAMAA-01 | 1 | TUMIDENT | SCREENING | BENIGN ABNORMALITY | |
| YAMAA-01 | 1 | TUMIDENT | SCREENING | — | |
| YAMAA-01 | 1 | TUMIDENT | SCREENING | TARGET |
Expected output
Under review6 expected rowsexpected/adrs.csv
Edit6 rows| STUDYID | USUBJID | PARAMCD | PARAM | AVALC | AVAL |
|---|---|---|---|---|---|
| YAMAA-01 | MDIS | Measurable Disease at Baseline | Y | 1 | |
| YAMAA-01 | MDIS | Measurable Disease at Baseline | N | 0 | |
| YAMAA-01 | MDIS | Measurable Disease at Baseline | N | 0 | |
| YAMAA-01 | MDIS | Measurable Disease at Baseline | N | 0 | |
| YAMAA-01 | MDIS | Measurable Disease at Baseline | N | 0 | |
| YAMAA-01 | MDIS | Measurable Disease at Baseline | N | 0 |
Comments and assessment materials
| Dataset Name | Variable Name | Variable Label | Type | Codelist/Controlled Terms | Core | Computational Method | Origin |
|---|---|---|---|---|---|---|---|
| ADRS | STUDYID | Study Identifier | character | Copy value from ADSL.STUDYID. | Predecessor | ||
| ADRS | USUBJID | Unique Subject Identifier | character | Copy value from ADSL.USUBJID. | Predecessor | ||
| ADRS | PARAMCD | Parameter Code | character | Set constant value "MDIS". | Assigned | ||
| ADRS | PARAM | Parameter | character | Set constant value "Measurable Disease at Baseline". | Assigned | ||
| ADRS | AVALC | Analysis Value (C) | character | Y, N | "Y" when TUSTRESC IS NOT NULL, with TUSTRESC taken from the first TU record matching on the shared output keys, 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 | |
| ADRS | AVAL | Analysis Value | numeric | Recode AVALC: "Y" → "1", "N" → "0"; missing or unlisted values are errors. | Derived |
| Variable | Permitted values |
|---|---|
| AVALC | Y, N |
| Version | Date | Author | Description | Reviewer | Sign-off |
|---|---|---|---|---|---|
| 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-measurable-disease/full.md
Edit23 linesFollowing 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
Use PARAMCD "MDIS" and PARAM "Measurable Disease at Baseline".
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.
Every subject in the subject-level dataset gets one flag record, even with no screening tumor assessment, so such a subject is N and 0. A tumor record for a subject outside the subject-level dataset contributes to no flag and creates none.
Read the source datasets from /app/input and save the completed dataset as /app/output/adrs.csv.
prompts/adam-adrs-measurable-disease/conventions.md
Edit12 linesFollowing 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
Use PARAMCD "MDIS" and PARAM "Measurable Disease at Baseline".
AVALC is Y or N. AVAL is 1 when AVALC is Y and 0 when AVALC is 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
Edit8 linesFollowing 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.
run.R
Edit4 lineslibrary(yamaa)adrs <- yamaa_domain("spec.yaml")$outputadrsrun.py
Edit4 linesimport yamaaadrs = yamaa.yamaa_domain("spec.yaml").outputadrssolutions/adam-adrs-measurable-disease/result.R
Edit40 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
Edit40 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.from pathlib import Pathimport polars as pladsl = pl.read_csv("/app/input/adsl.csv", infer_schema=False)tu = pl.read_csv("/app/input/tu.csv", infer_schema=False).with_columns( pl.col("TUSEQ").cast(pl.Int64))# Target disease at screening: a screening tumor identification record# whose result is target. Later target records do not count.target_subjects = tu.filter( (pl.col("TUTESTCD") == "TUMIDENT") & (pl.col("VISIT") == "SCREENING") & (pl.col("TUSTRESC") == "TARGET")).select("USUBJID").unique()adrs = ( adsl.with_columns( PARAMCD=pl.lit("MDIS"), PARAM=pl.lit("Measurable Disease at Baseline"), AVALC=pl.when(pl.col("USUBJID").is_in(target_subjects["USUBJID"])) .then(pl.lit("Y")) .otherwise(pl.lit("N")), ) .with_columns( AVAL=pl.when(pl.col("AVALC") == "Y").then(1).otherwise(0).cast(pl.Int64) ) .select("STUDYID", "USUBJID", "PARAMCD", "PARAM", "AVALC", "AVAL") .sort("USUBJID"))Path("/app/output").mkdir(exist_ok=True)adrs.write_csv("/app/output/adrs.csv")solutions/adam-adrs-measurable-disease/result.sas
Edit30 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;
yamaa
Comments
Signed in with GitHub; saved in repository Discussions