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: draftEditUnder review
What this benchmark means
README.md

Public entries: Python and R. Passing coverage requires an installed inventory.

Goal: identify the single governing intercurrent event in each subject's completed event history for an Analysis Data Model (ADaM) occurrence dataset.

Input: subject identifiers and collected intercurrent event records with event sequence, type and complete event date.

Variables:

  • ASEQ, ADECOD1 and ASTDT identify the source sequence, type and date.
  • ICEPRIO is 1 for ICE04 and ICE05, 2 for ICE01, 3 for ICE02 and 4 for ICE03: death or kidney replacement, prohibited medication, start of other protocol-prohibited therapy, and treatment discontinuation, respectively.
  • ICERANK numbers each subject's events from 1 by increasing priority, then earliest date, then lowest source sequence.
  • GOVFL is Y on position 1 and empty elsewhere; SUPERFL is Y on every other event and empty on position 1.
  • GOVTYPE, GOVDT and GOVSEQ are the governing type, date and source sequence on every event of the subject.

Note: priority outranks chronology across event types. Equal priority uses the earliest date, then lowest sequence. A subject without events has no record. This is a completed-history summary; it does not choose the event applicable at an earlier efficacy assessment.

Inputs

Under review
2 source files

input/adsl.csv

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

input/ice_raw.csv

Edit
10 rows
input/ice_raw.csv
STUDYIDUSUBJIDICESEQICETYPEICEDTC
YAMAA-011ICE022025-01-12
YAMAA-011ICE022025-01-03
YAMAA-012ICE012025-01-09
YAMAA-013ICE042025-01-28
YAMAA-011ICE012025-01-14
YAMAA-012ICE012025-01-07
YAMAA-013ICE022025-01-02
YAMAA-011ICE052025-01-20
YAMAA-012ICE042025-01-20
YAMAA-013ICE032025-01-01

Expected output

Under review
10 expected rows

expected/adice.csv

Edit
10 rows
expected/adice.csv
STUDYIDUSUBJIDASEQADECOD1ASTDTICEPRIOICERANKGOVFLSUPERFLGOVTYPEGOVDTGOVSEQ
YAMAA-011ICE022025-01-1231Y—ICE022025-01-121
YAMAA-011ICE022025-01-0333—YICE042025-01-283
YAMAA-012ICE012025-01-0922—YICE042025-01-283
YAMAA-013ICE042025-01-2811Y—ICE042025-01-283
YAMAA-011ICE012025-01-1422—YICE012025-01-072
YAMAA-012ICE012025-01-0721Y—ICE012025-01-072
YAMAA-013ICE022025-01-0233—YICE012025-01-072
YAMAA-011ICE052025-01-2011Y—ICE052025-01-201
YAMAA-012ICE042025-01-2012—YICE052025-01-201
YAMAA-013ICE032025-01-0143—YICE052025-01-201
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
ADICESTUDYIDStudy IdentifiercharacterCopy value from ICE_RAW.STUDYID.Predecessor
ADICEUSUBJIDUnique Subject IdentifiercharacterCopy value from ICE_RAW.USUBJID.Predecessor
ADICEASEQAnalysis Sequence NumbernumericCopy value from ICE_RAW.ICESEQ.Predecessor
ADICEADECOD1Analysis Dictionary Derived TermcharacterCopy value from ICE_RAW.ICETYPE.Predecessor
ADICEASTDTAnalysis Start DatenumericISO 8601Copy value from ICE_RAW.ICEDTC.Predecessor
ADICEICEPRIOIntercurrent Event Type PrioritynumericRecode ADECOD1: "ICE04" → "1", "ICE05" → "1", "ICE01" → "2", "ICE02" → "3", "ICE03" → "4"; missing values stay missing; unlisted values are errors.Derived
ADICEICERANKIntercurrent Event Priority PositionnumericRow number using window ICE_ORDER.Derived
ADICEGOVFLGoverning Intercurrent Event Flagcharacter"Y" when ICERANK = 1; blank otherwise.Derived
ADICESUPERFLSuperseded Intercurrent Event Flagcharacter"Y" when ICERANK > 1; blank otherwise.Derived
ADICEGOVTYPEGoverning Intercurrent Event TypecharacterTake ICETYPE from the first ICE_RAW record matching on STUDYID and USUBJID, ordered by ICE_RAW.PRIORITY then ICE_RAW.ICEDTC then ICE_RAW.ICESEQ, and a row with no match is an error.Derived
ADICEGOVDTGoverning Intercurrent Event DatenumericISO 8601Take ICEDTC from the first ICE_RAW record matching on STUDYID and USUBJID, ordered by ICE_RAW.PRIORITY then ICE_RAW.ICEDTC then ICE_RAW.ICESEQ, and a row with no match is an error.Derived
ADICEGOVSEQGoverning Intercurrent Event SequencenumericTake ICESEQ from the first ICE_RAW record matching on STUDYID and USUBJID, ordered by ICE_RAW.PRIORITY then ICE_RAW.ICEDTC then ICE_RAW.ICESEQ, and a row with no match is an error.Derived
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-adice-governing-event/full.md

Edit
23 lines

Following CDISC ADaM standards, use the provided ADSL and ICE_RAW datasets to create an ADICE dataset with one record per intercurrent event.

The output dataset should contain the following columns in this order: STUDYID, USUBJID, ASEQ, ADECOD1, ASTDT, ICEPRIO, ICERANK, GOVFL, SUPERFL, GOVTYPE, GOVDT, GOVSEQ

ASEQ, ADECOD1, and ASTDT give the event's source sequence, type, and complete date. ICEPRIO is 1 for ICE04 and ICE05 (death or kidney replacement), 2 for ICE01 (prohibited medication), 3 for ICE02 (start of other protocol-prohibited therapy), and 4 for ICE03 (treatment discontinuation). ICERANK numbers each subject's events from 1 by increasing priority, then earliest date, then lowest source sequence; priority outranks chronology across event types. GOVFL is Y on position 1 and has no value elsewhere. SUPERFL is Y on every other event and has no value on position 1. GOVTYPE, GOVDT, and GOVSEQ are the governing event's type, date, and source sequence, on every event of the subject. A subject without events has no record. The governing event is chosen over the subject's completed event history; it is not the event applicable at an earlier efficacy assessment.

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

prompts/adam-adice-governing-event/conventions.md

Edit
16 lines

Following CDISC ADaM standards, use the provided ADSL and ICE_RAW datasets to create an ADICE dataset with one record per intercurrent event.

The output dataset should contain the following columns in this order: STUDYID, USUBJID, ASEQ, ADECOD1, ASTDT, ICEPRIO, ICERANK, GOVFL, SUPERFL, GOVTYPE, GOVDT, GOVSEQ

ICEPRIO is 1 for ICE04 and ICE05 (death or kidney replacement), 2 for ICE01 (prohibited medication), 3 for ICE02 (start of other protocol-prohibited therapy), and 4 for ICE03 (treatment discontinuation). ICERANK numbers each subject's events from 1 by increasing priority, then earliest date, then lowest source sequence; priority outranks chronology across event types. GOVFL is Y or has no value. SUPERFL is Y or has no value.

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

prompts/adam-adice-governing-event/brief.md

Edit
9 lines

Following CDISC ADaM standards, use the provided ADSL and ICE_RAW datasets to create an ADICE dataset with one record per intercurrent event.

The output dataset should contain the following columns in this order: STUDYID, USUBJID, ASEQ, ADECOD1, ASTDT, ICEPRIO, ICERANK, GOVFL, SUPERFL, GOVTYPE, GOVDT, GOVSEQ

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

Edit
23 lines
events <- read.csv("/app/input/ice_raw.csv", stringsAsFactors = FALSE)priority <- c(ICE04 = 1L, ICE05 = 1L, ICE01 = 2L, ICE02 = 3L, ICE03 = 4L)events$ICEPRIO <- unname(priority[events$ICETYPE])events <- events[order(events$STUDYID, events$USUBJID,                       events$ICEPRIO, events$ICEDTC, events$ICESEQ), ]groups <- split(events, interaction(events$STUDYID, events$USUBJID,                                   drop = TRUE))result <- do.call(rbind, lapply(groups, function(group) {  group$ICERANK <- seq_len(nrow(group))  group$GOVFL <- ifelse(group$ICERANK == 1L, "Y", NA_character_)  group$SUPERFL <- ifelse(group$ICERANK > 1L, "Y", NA_character_)  group$GOVTYPE <- group$ICETYPE[1]  group$GOVDT <- group$ICEDTC[1]  group$GOVSEQ <- group$ICESEQ[1]  group}))names(result)[names(result) == "ICESEQ"] <- "ASEQ"names(result)[names(result) == "ICETYPE"] <- "ADECOD1"names(result)[names(result) == "ICEDTC"] <- "ASTDT"columns <- c("STUDYID", "USUBJID", "ASEQ", "ADECOD1", "ASTDT", "ICEPRIO",             "ICERANK", "GOVFL", "SUPERFL", "GOVTYPE", "GOVDT", "GOVSEQ")result <- result[order(result$STUDYID, result$USUBJID, result$ASEQ), columns]write.csv(result, "/app/output/adice.csv", row.names = FALSE, na = "")

solutions/adam-adice-governing-event/result.py

Edit
83 lines
# Reference solution for the yamaa benchmark adam-adice-governing-event (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_PATH = "/app/output/adice.csv"PRIORITY = {    "ICE04": 1,    "ICE05": 1,    "ICE01": 2,    "ICE02": 3,    "ICE03": 4,}COLUMNS = [    "STUDYID",    "USUBJID",    "ASEQ",    "ADECOD1",    "ASTDT",    "ICEPRIO",    "ICERANK",    "GOVFL",    "SUPERFL",    "GOVTYPE",    "GOVDT",    "GOVSEQ",]def main():    with open(f"{INPUT_DIR}/adsl.csv", newline="") as f:        adsl = list(csv.DictReader(f))    subjects = {(r["STUDYID"], r["USUBJID"]) for r in adsl}    with open(f"{INPUT_DIR}/ice_raw.csv", newline="") as f:        ice = list(csv.DictReader(f))    events = {}    order = []    for row in ice:        key = (row["STUDYID"], row["USUBJID"])        if key not in subjects:            continue        event = {            "STUDYID": row["STUDYID"],            "USUBJID": row["USUBJID"],            "ASEQ": int(row["ICESEQ"]),            "ADECOD1": row["ICETYPE"],            "ASTDT": row["ICEDTC"],            "ICEPRIO": PRIORITY[row["ICETYPE"]],        }        events.setdefault(key, []).append(event)        order.append(event)    for key, subject_events in events.items():        ranked = sorted(            subject_events,            key=lambda e: (e["ICEPRIO"], e["ASTDT"], e["ASEQ"]),        )        governing = ranked[0]        for position, event in enumerate(ranked, start=1):            event["ICERANK"] = position            event["GOVFL"] = "Y" if position == 1 else ""            event["SUPERFL"] = "" if position == 1 else "Y"            event["GOVTYPE"] = governing["ADECOD1"]            event["GOVDT"] = governing["ASTDT"]            event["GOVSEQ"] = governing["ASEQ"]    with open(OUTPUT_PATH, "w", newline="") as f:        writer = csv.DictWriter(f, fieldnames=COLUMNS)        writer.writeheader()        for event in order:            writer.writerow({c: event[c] for c in COLUMNS})if __name__ == "__main__":    main()

solutions/adam-adice-governing-event/result.sas

Edit
37 lines
/* opensas reference: select priority before date and source sequence. */data events;  length STUDYID USUBJID $80 ADECOD1 $8 date_text $10;  infile "/app/input/ice_raw.csv" dsd dlm="," firstobs=2 truncover;  input STUDYID : $80. USUBJID : $80. ASEQ ADECOD1 : $8.        date_text : $10.;  ASTDT=input(date_text,yymmdd10.);  if ADECOD1 in ('ICE04','ICE05') then ICEPRIO=1;  else if ADECOD1='ICE01' then ICEPRIO=2;  else if ADECOD1='ICE02' then ICEPRIO=3;  else if ADECOD1='ICE03' then ICEPRIO=4;run;proc sort data=events;  by STUDYID USUBJID ICEPRIO ASTDT ASEQ;run;data ranked;  length GOVFL SUPERFL $1 GOVTYPE $8;  set events;  by STUDYID USUBJID;  retain ICERANK GOVTYPE GOVDT GOVSEQ;  if first.USUBJID then do;    ICERANK=0; GOVTYPE=ADECOD1; GOVDT=ASTDT; GOVSEQ=ASEQ;  end;  ICERANK+1;  if ICERANK=1 then GOVFL='Y';  else SUPERFL='Y';  format ASTDT GOVDT yymmdd10.;run;proc sql;  create table result as select STUDYID, USUBJID, ASEQ, ADECOD1,    put(ASTDT,yymmdd10.) as ASTDT,    ICEPRIO, ICERANK, GOVFL, SUPERFL, GOVTYPE,    put(GOVDT,yymmdd10.) as GOVDT, GOVSEQ  from ranked order by STUDYID, USUBJID, ASEQ;quit;proc export data=result outfile="/app/output/adice.csv" dbms=csv replace;run;