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: derive ASEV (analysis severity) and ASEVN (its numeric rank) for each adverse event (AE) in the Analysis Data Model (ADaM) adverse event analysis dataset (ADAE), applying an approved severity correction.

Input: collected AE records carrying the study, subject, and event sequence identifiers and the reported severity AESEV.

Variables:

  • ASEV: analysis severity in upper case (MILD, MODERATE, SEVERE, LIFE-THREATENING); an approved correction reassigns any event it covers to SEVERE. An event with no reported severity and no applicable correction leaves ASEV empty.
  • ASEVN: numeric rank of ASEV, from 1 (MILD) to 4 (LIFE-THREATENING). An event with no ASEV value has no rank.

Note: ASEVN reflects the corrected ASEV, so a corrected event carries both the corrected severity and its matching rank. A correction also applies to an event with no reported severity, supplying the value rather than leaving it empty.

Inputs

Under review
1 source file

input/ae.csv

Edit
6 rows
input/ae.csv
STUDYIDUSUBJIDAESEQAESEV
CATH-011mild
CATH-012moderate
CATH-013LIFE-THREATENING
CATH-011—
CATH-012severe
CATH-011—

Expected output

Under review
6 expected rows

expected/adae.csv

Edit
6 rows
expected/adae.csv
STUDYIDUSUBJIDAESEQASEVASEVN
CATH-011MILD1
CATH-012SEVERE3
CATH-013LIFE-THREATENING4
CATH-011——
CATH-012SEVERE3
CATH-011SEVERE3
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
ADAESTUDYIDStudy IdentifiercharacterCopy value from AE.STUDYID.Predecessor
ADAEUSUBJIDUnique Subject IdentifiercharacterCopy value from AE.USUBJID.Predecessor
ADAEAESEQSequence NumbernumericCopy value from AE.AESEQ.Predecessor
ADAEASEVAnalysis Severity/IntensitycharacterMILD, MODERATE, SEVERE, LIFE-THREATENINGIf USUBJID = 'CATH-01-001' AND AESEQ = 2 then "SEVERE"; If USUBJID = 'CATH-01-003' AND AESEQ = 1 then "SEVERE"; otherwise convert AE.AESEV to upper case.Derived
ADAEASEVNAnalysis Severity/Intensity (N)numericRecode ASEV: "MILD" → "1", "MODERATE" → "2", "SEVERE" → "3", "LIFE-THREATENING" → "4"; missing values stay missing; unlisted values are errors.Derived
VariablePermitted values
ASEVMILD, MODERATE, SEVERE, LIFE-THREATENING
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-adae-severity-override/full.md

Edit
19 lines

Following CDISC ADaM standards, use the provided AE dataset to create an ADAE dataset with one record per adverse event.

The output dataset should contain the following columns in this order: STUDYID, USUBJID, AESEQ, ASEV, ASEVN

ASEV is the reported severity in upper case: "MILD", "MODERATE", "SEVERE", or "LIFE-THREATENING". An approved severity correction reassigns the event of subject CATH-01-001 with AESEQ 2 to "SEVERE", and the event of subject CATH-01-003 with AESEQ 1 to "SEVERE". A correction also applies to an event with no reported severity, so that event's ASEV is "SEVERE". ASEV has no value when an event has no reported severity and no correction applies to it. ASEVN is the numeric rank of ASEV: 1 for "MILD", 2 for "MODERATE", 3 for "SEVERE", and 4 for "LIFE-THREATENING". ASEVN reflects the corrected ASEV, so a corrected event carries both the corrected severity and its matching rank. ASEVN has no value when ASEV has no value.

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

prompts/adam-adae-severity-override/conventions.md

Edit
13 lines

Following CDISC ADaM standards, use the provided AE dataset to create an ADAE dataset with one record per adverse event.

The output dataset should contain the following columns in this order: STUDYID, USUBJID, AESEQ, ASEV, ASEVN

ASEV is "MILD", "MODERATE", "SEVERE", or "LIFE-THREATENING", or has no value. ASEVN is the numeric rank of ASEV: 1 for "MILD", 2 for "MODERATE", 3 for "SEVERE", and 4 for "LIFE-THREATENING". ASEVN has no value when ASEV has no value.

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

prompts/adam-adae-severity-override/brief.md

Edit
8 lines

Following CDISC ADaM standards, use the provided AE dataset to create an ADAE dataset with one record per adverse event.

The output dataset should contain the following columns in this order: STUDYID, USUBJID, AESEQ, ASEV, ASEVN

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

Edit
36 lines
# Reference solution for the yamaa benchmark adam-adae-severity-override (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)ae <- read_csv(  "/app/input/ae.csv",  col_types = cols(AESEQ = col_integer(), .default = col_character()))adae <- ae |>  mutate(    ASEV = toupper(AESEV),    # Approved corrections reassign two events to SEVERE, including one    # whose severity was unreported.    ASEV = if_else(      (USUBJID == "CATH-01-001" & AESEQ == 2L) |        (USUBJID == "CATH-01-003" & AESEQ == 1L),      "SEVERE",      ASEV    ),    ASEVN = case_when(      ASEV == "MILD" ~ 1L,      ASEV == "MODERATE" ~ 2L,      ASEV == "SEVERE" ~ 3L,      ASEV == "LIFE-THREATENING" ~ 4L    )  ) |>  select(STUDYID, USUBJID, AESEQ, ASEV, ASEVN)dir.create("/app/output", showWarnings = FALSE)write_csv(adae, "/app/output/adae.csv", na = "")

solutions/adam-adae-severity-override/result.py

Edit
69 lines
# Reference solution for the yamaa benchmark adam-adae-severity-override (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."""Build ADAE from AE with approved severity corrections.Reads /app/input/ae.csv and writes /app/output/adae.csv with columnsSTUDYID, USUBJID, AESEQ, ASEV, ASEVN."""import csvimport osINPUT_DIR = "/app/input"OUTPUT_DIR = "/app/output"# Approved severity corrections, keyed by (USUBJID, AESEQ).CORRECTIONS = {    ("CATH-01-001", 2): "SEVERE",    ("CATH-01-003", 1): "SEVERE",}RANKS = {    "MILD": 1,    "MODERATE": 2,    "SEVERE": 3,    "LIFE-THREATENING": 4,}def main():    with open(os.path.join(INPUT_DIR, "ae.csv"), newline="") as f:        rows = list(csv.DictReader(f))    out_rows = []    for row in rows:        aeseq = int(row["AESEQ"])        key = (row["USUBJID"], aeseq)        reported = (row["AESEV"] or "").strip()        if key in CORRECTIONS:            asev = CORRECTIONS[key]        elif reported:            asev = reported.upper()        else:            asev = ""        asevn = RANKS[asev] if asev else ""        out_rows.append(            {                "STUDYID": row["STUDYID"],                "USUBJID": row["USUBJID"],                "AESEQ": row["AESEQ"],                "ASEV": asev,                "ASEVN": asevn,            }        )    os.makedirs(OUTPUT_DIR, exist_ok=True)    with open(os.path.join(OUTPUT_DIR, "adae.csv"), "w", newline="") as f:        writer = csv.DictWriter(            f, fieldnames=["STUDYID", "USUBJID", "AESEQ", "ASEV", "ASEVN"]        )        writer.writeheader()        writer.writerows(out_rows)if __name__ == "__main__":    main()

solutions/adam-adae-severity-override/result.sas

Edit
23 lines
/* opensas reference solution for the yamaa benchmark adam-adae-severity-override.   Reads the benchmark inputs and derives the requested output.   Execute with the existing opensas runtime: opensas /app/output/result.sas. */data ae;  length STUDYID USUBJID AESEV $1024;  infile "/app/input/ae.csv" dsd dlm="," firstobs=2 truncover lrecl=32767;  input STUDYID : $char1024. USUBJID : $char1024. AESEQ AESEV : $char1024.;run;data graded;  length ASEV $20;  set ae; ASEV=AESEV;  ASEV=upcase(AESEV);  if (USUBJID='CATH-01-001' and AESEQ=2) or (USUBJID='CATH-01-003' and AESEQ=1) then ASEV='SEVERE';  select(ASEV); when('MILD') ASEVN=1; when('MODERATE') ASEVN=2; when('SEVERE') ASEVN=3; when('LIFE-THREATENING') ASEVN=4; otherwise ASEVN=.; end;run;data result; set graded; run;proc sql;  create table final as select STUDYID, USUBJID, AESEQ, ASEV, ASEVN from result;quit;proc export data=final outfile="/app/output/adae.csv" dbms=csv replace; run;