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
README.mdPublic 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 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 |
Human review and assessment
| 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. | 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.7 | 2026-10-20 | yamaa docs build | Read 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.6 | 2026-10-17 | yamaa docs build | Describe collected date parts written as ISO 8601 date text and times of day counted in seconds since midnight | ||
| 1.5 | 2026-10-17 | yamaa docs build | Name 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.4 | 2026-10-15 | yamaa docs build | State datetime precision codes through the hour and minute, and complete only the time parts a collected datetime lacks | ||
| 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
Edit19 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 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
Edit13 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 "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
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.
R
Edit3 lineslibrary(yamaa)yamaa_spec("spec.yaml")$run()$outputPython
Edit3 linesimport yamaayamaa.spec("spec.yaml").run().outputsolutions/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
Edit69 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
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