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: 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:
AETERMPCis 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, soNON-CARDIAC CHEST PAINgivesNon-Cardiac Chest Pain. A letter after any other character stays in lower case:INVESTIGATOR'S DECISIONgivesInvestigator's Decision,2ND DEGREE BURNgives2nd Degree BurnandPAIN,BACKgivesPain,back. A missing term givesNot Reported.AETERMPBis the same with its own list of separators, which replaces the standard one: the blank, slash, hyphen, open parenthesis, period, comma and open bracket. SoPAIN,BACKgivesPain,BackandRASH [LEFT ARM]givesRash [Left Arm], whereAETERMPCgivesRash [left Arm]. A missing term givesNot Reported.
Note: only the plain English letters A to Z change case; every other character is unchanged.
Inputs
Under review1 source fileinput/ae.csv
Edit8 rows| STUDYID | USUBJID | AESEQ | AETERM |
|---|---|---|---|
| YAMAA-01 | 1 | NOT RECOVERED/NOT RESOLVED | |
| YAMAA-01 | 2 | NON-CARDIAC CHEST PAIN | |
| YAMAA-01 | 3 | MILD (GRADE 1) | |
| YAMAA-01 | 1 | INVESTIGATOR'S DECISION | |
| YAMAA-01 | 2 | 2ND DEGREE BURN | |
| YAMAA-01 | 3 | PAIN,BACK | |
| YAMAA-01 | 1 | RASH [LEFT ARM] | |
| YAMAA-01 | 2 | — |
Expected output
Under review8 expected rowsexpected/adae.csv
Edit8 rows| STUDYID | USUBJID | AESEQ | AETERM | AETERMPC | AETERMPB |
|---|---|---|---|---|---|
| YAMAA-01 | 1 | NOT RECOVERED/NOT RESOLVED | Not Recovered/Not Resolved | Not Recovered/Not Resolved | |
| YAMAA-01 | 2 | NON-CARDIAC CHEST PAIN | Non-Cardiac Chest Pain | Non-Cardiac Chest Pain | |
| YAMAA-01 | 3 | MILD (GRADE 1) | Mild (Grade 1) | Mild (Grade 1) | |
| YAMAA-01 | 1 | INVESTIGATOR'S DECISION | Investigator's Decision | Investigator's Decision | |
| YAMAA-01 | 2 | 2ND DEGREE BURN | 2nd Degree Burn | 2nd Degree Burn | |
| YAMAA-01 | 3 | PAIN,BACK | Pain,back | Pain,Back | |
| YAMAA-01 | 1 | RASH [LEFT ARM] | Rash [left Arm] | Rash [Left Arm] | |
| YAMAA-01 | 2 | — | Not Reported | Not Reported |
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 | AETERM | Reported Term for the Adverse Event | character | Copy value from AE.AETERM. | Predecessor | ||
| ADAE | AETERMPC | Reported Term in Proper Case | character | Convert AETERM to proper case; a missing source → "Not Reported". | Derived | ||
| ADAE | AETERMPB | Proper Case Term, Comma and Bracket | character | Convert AETERM to proper case, starting a word after any of " /-(.,["; a missing source → "Not Reported". | Derived |
| 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-proper-case-terms/full.md
Edit24 linesFollowing 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
Edit13 linesFollowing 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
Edit8 linesFollowing 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.
R
Edit3 lineslibrary(yamaa)yamaa_spec("spec.yaml")$run()$outputPython
Edit3 linesimport yamaayamaa.spec("spec.yaml").run().outputsolutions/adam-adae-proper-case-terms/result.R
Edit40 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
Edit58 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
Edit47 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;
yamaa