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 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 toSEVERE. An event with no reported severity and no applicable correction leavesASEVempty.ASEVN: numeric rank ofASEV, from1(MILD) to4(LIFE-THREATENING). An event with noASEVvalue 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 review1 source fileinput/ae.csv
Edit6 rows| STUDYID | USUBJID | AESEQ | AESEV |
|---|---|---|---|
| CATH-01 | 1 | mild | |
| CATH-01 | 2 | moderate | |
| CATH-01 | 3 | LIFE-THREATENING | |
| CATH-01 | 1 | — | |
| CATH-01 | 2 | severe | |
| CATH-01 | 1 | — |
Expected output
Under review6 expected rowsexpected/adae.csv
Edit6 rows| STUDYID | USUBJID | AESEQ | ASEV | ASEVN |
|---|---|---|---|---|
| CATH-01 | 1 | MILD | 1 | |
| CATH-01 | 2 | SEVERE | 3 | |
| CATH-01 | 3 | LIFE-THREATENING | 4 | |
| CATH-01 | 1 | — | — | |
| CATH-01 | 2 | SEVERE | 3 | |
| CATH-01 | 1 | SEVERE | 3 |
Comments and assessment materials
| Dataset Name | Variable Name | Variable Label | Type | Codelist/Controlled Terms | Core | Computational Method | Origin |
|---|---|---|---|---|---|---|---|
| ADAE | STUDYID | Study Identifier | character | Copy value from AE.STUDYID. | Predecessor | ||
| ADAE | USUBJID | Unique Subject Identifier | character | Copy value from AE.USUBJID. | Predecessor | ||
| ADAE | AESEQ | Sequence Number | numeric | Copy value from AE.AESEQ. | Predecessor | ||
| ADAE | ASEV | Analysis Severity/Intensity | character | MILD, MODERATE, SEVERE, LIFE-THREATENING | If 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 | |
| ADAE | ASEVN | Analysis Severity/Intensity (N) | numeric | Recode ASEV: "MILD" → "1", "MODERATE" → "2", "SEVERE" → "3", "LIFE-THREATENING" → "4"; missing values stay missing; unlisted values are errors. | Derived |
| Variable | Permitted values |
|---|---|
| ASEV | MILD, MODERATE, SEVERE, LIFE-THREATENING |
| 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-adae-severity-override/full.md
Edit17 linesFollowing 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
Edit11 linesFollowing 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
Edit8 linesFollowing 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.
run.R
Edit4 lineslibrary(yamaa)adae <- yamaa_domain("spec.yaml")$outputadaerun.py
Edit4 linesimport yamaaadae = yamaa.yamaa_domain("spec.yaml").outputadaesolutions/adam-adae-severity-override/result.R
Edit36 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
Edit46 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
Edit23 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;
yamaa
Comments
Signed in with GitHub; saved in repository Discussions