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: write each reported adverse event term in proper case, as the SAS PROPCASE function writes it: once with its standard word separators (AETERMPC) and once with a list that replaces the tab with a comma and an open bracket (AETERMPB).

Input: collected adverse event (AE) records carrying the reported term (AETERM), recorded in capitals.

Variables:

  • AETERMPC is the reported term with every letter in lower case, then the first character and each character that follows a word separator in upper case. The separators are the blank, slash, hyphen, open parenthesis, period and tab, so NON-CARDIAC CHEST PAIN gives Non-Cardiac Chest Pain. A letter after any other character stays in lower case: INVESTIGATOR'S DECISION gives Investigator's Decision, 2ND DEGREE BURN gives 2nd Degree Burn and PAIN,BACK gives Pain,back. A missing term gives Not Reported.
  • AETERMPB is the same with its own list of separators, which replaces the standard one: the blank, slash, hyphen, open parenthesis, period, comma and open bracket. So PAIN,BACK gives Pain,Back and RASH [LEFT ARM] gives Rash [Left Arm], where AETERMPC gives Rash [left Arm]. A missing term gives Not Reported.

Note: only the plain English letters A to Z change case; every other character is unchanged.

Inputs

Under review
1 source file

input/ae.csv

Edit
8 rows
input/ae.csv
STUDYIDUSUBJIDAESEQAETERM
YAMAA-011NOT RECOVERED/NOT RESOLVED
YAMAA-012NON-CARDIAC CHEST PAIN
YAMAA-013MILD (GRADE 1)
YAMAA-011INVESTIGATOR'S DECISION
YAMAA-0122ND DEGREE BURN
YAMAA-013PAIN,BACK
YAMAA-011RASH [LEFT ARM]
YAMAA-012—

Expected output

Under review
8 expected rows

expected/adae.csv

Edit
8 rows
expected/adae.csv
STUDYIDUSUBJIDAESEQAETERMAETERMPCAETERMPB
YAMAA-011NOT RECOVERED/NOT RESOLVEDNot Recovered/Not ResolvedNot Recovered/Not Resolved
YAMAA-012NON-CARDIAC CHEST PAINNon-Cardiac Chest PainNon-Cardiac Chest Pain
YAMAA-013MILD (GRADE 1)Mild (Grade 1)Mild (Grade 1)
YAMAA-011INVESTIGATOR'S DECISIONInvestigator's DecisionInvestigator's Decision
YAMAA-0122ND DEGREE BURN2nd Degree Burn2nd Degree Burn
YAMAA-013PAIN,BACKPain,backPain,Back
YAMAA-011RASH [LEFT ARM]Rash [left Arm]Rash [Left Arm]
YAMAA-012—Not ReportedNot Reported
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
ADAEAETERMReported Term for the Adverse EventcharacterCopy value from AE.AETERM.Predecessor
ADAEAETERMPCReported Term in Proper CasecharacterConvert AETERM to proper case; a missing source → "Not Reported".Derived
ADAEAETERMPBProper Case Term, Comma and BracketcharacterConvert AETERM to proper case, starting a word after any of " /-(.,["; a missing source → "Not Reported".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-adae-proper-case-terms/full.md

Edit
24 lines

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

The output dataset should contain the following columns in this order: STUDYID, USUBJID, AESEQ, AETERM, AETERMPC, AETERMPB

AETERMPC and AETERMPB hold the reported term AETERM in proper case: every letter is in lower case except the first character and each character directly after one of the variable's word separators, which are in upper case. A letter after any other character stays in lower case.

  • AETERMPC's separators are the blank, slash, hyphen, open parenthesis, period and tab, so a letter after an apostrophe, a digit, a comma or an open bracket stays in lower case.
  • AETERMPB's own list replaces that one: the blank, slash, hyphen, open parenthesis, period, comma and open bracket. A letter after a comma or an open bracket is therefore in upper case there, and the tab is not one of its separators.

Only the plain English letters A to Z change case; every other character is unchanged. AETERMPC and AETERMPB are "Not Reported" when AETERM has no value.

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

prompts/adam-adae-proper-case-terms/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 record in AE.

The output dataset should contain the following columns in this order: STUDYID, USUBJID, AESEQ, AETERM, AETERMPC, AETERMPB

AETERMPC and AETERMPB hold the reported term AETERM in proper case, or are "Not Reported". AETERMPC's word separators are the blank, slash, hyphen, open parenthesis, period and tab; AETERMPB's are the blank, slash, hyphen, open parenthesis, period, comma and open bracket.

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

prompts/adam-adae-proper-case-terms/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 record in AE.

The output dataset should contain the following columns in this order: STUDYID, USUBJID, AESEQ, AETERM, AETERMPC, AETERMPB

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-proper-case-terms/result.R

Edit
40 lines
# Reference solution for the yamaa benchmark adam-adae-proper-case-terms (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.ae <- read.csv(  "/app/input/ae.csv",  colClasses = "character",  na.strings = "")# The first character, and each character that directly follows one of the# delimiters, in upper case; every other letter in lower case. A term with no# value is "Not Reported".propcase <- function(terms, delimiters) {  separators <- strsplit(delimiters, "")[[1]]  vapply(terms, function(term) {    if (is.na(term)) {      return("Not Reported")    }    characters <- strsplit(term, "")[[1]]    previous <- c("", head(characters, -1))    raise <- seq_along(characters) == 1 | previous %in% separators    paste(ifelse(raise, toupper(characters), tolower(characters)), collapse = "")  }, character(1), USE.NAMES = FALSE)}adae <- data.frame(  STUDYID = ae$STUDYID,  USUBJID = ae$USUBJID,  AESEQ = as.integer(ae$AESEQ),  AETERM = ae$AETERM,  # SAS PROPCASE's default delimiters, then the ones that replace them.  AETERMPC = propcase(ae$AETERM, " /-(.\t"),  AETERMPB = propcase(ae$AETERM, " /-(.,["))dir.create("/app/output", showWarnings = FALSE)write.csv(adae, "/app/output/adae.csv", row.names = FALSE, na = "")

solutions/adam-adae-proper-case-terms/result.py

Edit
58 lines
# Reference solution for the yamaa benchmark adam-adae-proper-case-terms (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 = "/app/input/ae.csv"OUTPUT = "/app/output/adae.csv"COLUMNS = ["STUDYID", "USUBJID", "AESEQ", "AETERM", "AETERMPC", "AETERMPB"]# SAS PROPCASE's default delimiters, and the ones that replace them for# AETERMPB.DEFAULT = " /-(.\t"COMMA_AND_BRACKET = " /-(.,["def propcase(text, delimiters):    """The first character, and each character that directly follows one of    the delimiters, in upper case; every other letter in lower case."""    return "".join(        character.upper()        if index == 0 or text[index - 1] in delimiters        else character.lower()        for index, character in enumerate(text)    )def main():    with open(INPUT, newline="", encoding="utf-8") as handle:        rows = list(csv.DictReader(handle))    out_rows = []    for row in rows:        term = row.get("AETERM") or ""        out_rows.append(            {                "STUDYID": row["STUDYID"],                "USUBJID": row["USUBJID"],                "AESEQ": row["AESEQ"],                "AETERM": term,                "AETERMPC": propcase(term, DEFAULT) if term else "Not Reported",                "AETERMPB": (                    propcase(term, COMMA_AND_BRACKET) if term else "Not Reported"                ),            }        )    with open(OUTPUT, "w", newline="", encoding="utf-8") as handle:        writer = csv.DictWriter(handle, fieldnames=COLUMNS)        writer.writeheader()        writer.writerows(out_rows)if __name__ == "__main__":    main()

solutions/adam-adae-proper-case-terms/result.sas

Edit
47 lines
/* opensas reference solution for the yamaa benchmark adam-adae-proper-case-terms.   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 AETERM $1024;  infile "/app/input/ae.csv" dsd dlm="," firstobs=2 truncover lrecl=32767;  input STUDYID : $char1024. USUBJID : $char1024. AESEQ AETERM : $char1024.;run;/* Proper case as PROPCASE writes it: the first character, and each one that   directly follows a delimiter, in upper case, and every other letter in   lower case. Each term is rebuilt one character at a time, a blank   included. AETERMPC takes the default delimiters, the tab among them, and   AETERMPB the ones that replace them. The previous character is compared   with each delimiter: INDEX finds no blank excerpt in this release. */data result;  length AETERMPC AETERMPB $1024 CH PREV PC PB $1;  set ae;  if missing(AETERM) then do;    AETERMPC = "Not Reported";    AETERMPB = "Not Reported";  end;  else do;    do I = 1 to lengthn(AETERM);      CH = substr(AETERM, I, 1);      if I = 1 then do;        AETERMPC = upcase(CH);        AETERMPB = upcase(CH);      end;      else do;        PREV = substr(AETERM, I - 1, 1);        if PREV in (" ", "/", "-", "(", ".", '09'x) then PC = upcase(CH);        else PC = lowcase(CH);        if PREV in (" ", "/", "-", "(", ".", ",", "[") then PB = upcase(CH);        else PB = lowcase(CH);        AETERMPC = substr(AETERMPC, 1, I - 1) || PC;        AETERMPB = substr(AETERMPB, 1, I - 1) || PB;      end;    end;  end;run;proc sql;  create table final as select STUDYID, USUBJID, AESEQ, AETERM, AETERMPC, AETERMPB from result;quit;proc export data=final outfile="/app/output/adae.csv" dbms=csv replace; run;