Review ask

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.

  1. 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.
  2. Inputs: Do they look like data collected in a real trial, and do they include the situations you would expect to meet in one?
  3. 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

Lifecycle: draftEditUnder review
What this benchmark means
README.md

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

Comments and assessment materials

Comments

Signed in with GitHub; saved in repository 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; a missing source → blank.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.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
17 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 analysis severity in upper case: MILD, MODERATE, SEVERE, or LIFE-THREATENING. Approved corrections reassign two events to SEVERE: the event of subject CATH-01-001 with AESEQ 2, and the event of subject CATH-01-003 with AESEQ 1, which had no reported severity. An event with no reported severity and no applicable correction has no ASEV value. ASEVN is the numeric rank of ASEV: 1 for MILD through 4 for LIFE-THREATENING. An event with no ASEV value has no rank. ASEVN reflects the corrected ASEV.

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
11 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 analysis severity in upper case, or has no value. ASEVN is the numeric rank of ASEV: 1 for MILD through 4 for LIFE-THREATENING.

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

Runs the yamaa specification; its result must match the expected output

run.R

Edit
4 lines
library(yamaa)adae <- yamaa_domain("spec.yaml")$outputadae

run.py

Edit
4 lines
import yamaaadae = yamaa.yamaa_domain("spec.yaml").outputadae

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
46 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.from pathlib import Pathimport polars as plae = pl.read_csv("/app/input/ae.csv", infer_schema=False).with_columns(    pl.col("AESEQ").cast(pl.Int64))asev = pl.col("AESEV").str.to_uppercase()# Approved corrections reassign two events to SEVERE, including one whose# severity was unreported.asev = (    pl.when(        ((pl.col("USUBJID") == "CATH-01-001") & (pl.col("AESEQ") == 2))        | ((pl.col("USUBJID") == "CATH-01-003") & (pl.col("AESEQ") == 1))    )    .then(pl.lit("SEVERE"))    .otherwise(asev))asevn = (    pl.when(pl.col("ASEV") == "MILD")    .then(1)    .when(pl.col("ASEV") == "MODERATE")    .then(2)    .when(pl.col("ASEV") == "SEVERE")    .then(3)    .when(pl.col("ASEV") == "LIFE-THREATENING")    .then(4)    .otherwise(None)    .cast(pl.Int64))adae = (    ae.with_columns(ASEV=asev)    .with_columns(ASEVN=asevn)    .select("STUDYID", "USUBJID", "AESEQ", "ASEV", "ASEVN"))Path("/app/output").mkdir(exist_ok=True)adae.write_csv("/app/output/adae.csv")

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;