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: give each subject a normalized country in COUNTRY
and its region in REGION1.
Input: demographics (DM) rows carrying the collected country
(COUNTRY) as reported, in mixed case or empty, including a country
outside the three listed below.
Variables:
COUNTRYis the collected country from demographics in upper case; a subject with no collected country isUNKNOWN. Every collected country passes through: there is no allowed-countries check, so the run never stops on a new country.REGION1is the region for that country:USAandCANgiveNorth America,DEUgivesEurope, and any other country (includingUNKNOWN) givesRest of World.
Note: case differences never split a country (usa and USA
are one), and the fallback values mean every subject has both a
country and a region.
Inputs
Under review1 source fileinput/dm.csv
Edit9 rows| STUDYID | USUBJID | COUNTRY |
|---|---|---|
| YAMAA-01 | usa | |
| YAMAA-01 | CAN | |
| YAMAA-01 | deu | |
| YAMAA-01 | — | |
| YAMAA-01 | UsA | |
| YAMAA-01 | cAn | |
| YAMAA-01 | unknown | |
| YAMAA-01 | — | |
| YAMAA-01 | fra |
Expected output
Under review9 expected rowsexpected/adsl.csv
Edit9 rows| STUDYID | USUBJID | COUNTRY | REGION1 |
|---|---|---|---|
| YAMAA-01 | USA | North America | |
| YAMAA-01 | CAN | North America | |
| YAMAA-01 | DEU | Europe | |
| YAMAA-01 | UNKNOWN | Rest of World | |
| YAMAA-01 | USA | North America | |
| YAMAA-01 | CAN | North America | |
| YAMAA-01 | UNKNOWN | Rest of World | |
| YAMAA-01 | UNKNOWN | Rest of World | |
| YAMAA-01 | FRA | Rest of World |
Human review and assessment
| Dataset Name | Variable Name | Variable Label | Type | Codelist/Controlled Terms | Core | Computational Method | Origin |
|---|---|---|---|---|---|---|---|
| ADSL | STUDYID | Study Identifier | character | Copy value from DM.STUDYID. | Predecessor | ||
| ADSL | USUBJID | Unique Subject Identifier | character | Copy value from DM.USUBJID. | Predecessor | ||
| ADSL | COUNTRY | Country | character | Convert DM.COUNTRY to upper case; a missing source → "UNKNOWN". | Derived | ||
| ADSL | REGION1 | Geographic Region 1 | character | North America, Europe, Rest of World | Recode COUNTRY: "USA" → "North America", "CAN" → "North America", "DEU" → "Europe"; missing or unlisted values → "Rest of World". | Derived |
| Variable | Permitted values |
|---|---|
| REGION1 | North America, Europe, Rest of World |
| 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-adsl-country-region/full.md
Edit13 linesFollowing CDISC ADaM standards, use the provided DM dataset to create an ADSL dataset with one record per subject.
The output dataset should contain the following columns in this order: STUDYID, USUBJID, COUNTRY, REGION1
COUNTRY is the collected country in upper case, and "UNKNOWN" when no country was collected. REGION1 is "North America" when COUNTRY is "USA" or "CAN", "Europe" when COUNTRY is "DEU", and "Rest of World" for any other country, including "UNKNOWN".
Read the source datasets from /app/input and save the completed dataset as /app/output/adsl.csv.
prompts/adam-adsl-country-region/conventions.md
Edit12 linesFollowing CDISC ADaM standards, use the provided DM dataset to create an ADSL dataset with one record per subject.
The output dataset should contain the following columns in this order: STUDYID, USUBJID, COUNTRY, REGION1
COUNTRY is the collected country in upper case, or "UNKNOWN". REGION1 is "North America" for "USA" or "CAN", "Europe" for "DEU", and "Rest of World" for any other country.
Read the source datasets from /app/input and save the completed dataset as /app/output/adsl.csv.
prompts/adam-adsl-country-region/brief.md
Edit8 linesFollowing CDISC ADaM standards, use the provided DM dataset to create an ADSL dataset with one record per subject.
The output dataset should contain the following columns in this order: STUDYID, USUBJID, COUNTRY, REGION1
Read the source datasets from /app/input and save the completed dataset as /app/output/adsl.csv.
R
Edit3 lineslibrary(yamaa)yamaa_spec("spec.yaml")$run()$outputPython
Edit3 linesimport yamaayamaa.spec("spec.yaml").run().outputsolutions/adam-adsl-country-region/result.R
Edit29 lines# Reference solution for the yamaa benchmark adam-adsl-country-region (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)library(stringr)dm <- read_csv( "/app/input/dm.csv", col_types = cols(.default = col_character()))adsl <- dm |> mutate( COUNTRY = str_trim(coalesce(COUNTRY, "")), COUNTRY = if_else(COUNTRY == "", "UNKNOWN", str_to_upper(COUNTRY)), REGION1 = case_when( COUNTRY %in% c("USA", "CAN") ~ "North America", COUNTRY == "DEU" ~ "Europe", .default = "Rest of World" ) ) |> select(STUDYID, USUBJID, COUNTRY, REGION1)dir.create("/app/output", showWarnings = FALSE)write_csv(adsl, "/app/output/adsl.csv", na = "")solutions/adam-adsl-country-region/result.py
Edit54 lines# Reference solution for the yamaa benchmark adam-adsl-country-region (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."""Create ADSL from DM: one record per subject with COUNTRY and REGION1.COUNTRY is the collected country in upper case, or "UNKNOWN" when nocountry was collected. REGION1 is "North America" for USA/CAN, "Europe"for DEU, and "Rest of World" for any other country, including "UNKNOWN"."""import csvINPUT_CSV = "/app/input/dm.csv"OUTPUT_CSV = "/app/output/adsl.csv"OUTPUT_COLUMNS = ["STUDYID", "USUBJID", "COUNTRY", "REGION1"]def region_for(country): if country in ("USA", "CAN"): return "North America" if country == "DEU": return "Europe" return "Rest of World"def main(): with open(INPUT_CSV, newline="", encoding="utf-8") as f: dm = list(csv.DictReader(f)) rows = [] for record in dm: collected = (record.get("COUNTRY") or "").strip() country = collected.upper() if collected else "UNKNOWN" rows.append( { "STUDYID": record["STUDYID"], "USUBJID": record["USUBJID"], "COUNTRY": country, "REGION1": region_for(country), } ) with open(OUTPUT_CSV, "w", newline="", encoding="utf-8") as f: writer = csv.DictWriter(f, fieldnames=OUTPUT_COLUMNS) writer.writeheader() writer.writerows(rows)if __name__ == "__main__": main()solutions/adam-adsl-country-region/result.sas
Edit24 lines/* opensas reference solution for the yamaa benchmark adam-adsl-country-region. Reads the benchmark inputs and derives the requested output. Execute with the existing opensas runtime: opensas /app/output/result.sas. */data dm; length STUDYID USUBJID COUNTRY $1024; infile "/app/input/dm.csv" dsd dlm="," firstobs=2 truncover lrecl=32767; input STUDYID : $char1024. USUBJID : $char1024. COUNTRY : $char1024.;run;data result; length REGION1 $20; set dm; COUNTRY=upcase(COUNTRY); if missing(COUNTRY) then COUNTRY='UNKNOWN'; if COUNTRY in ('USA','CAN') then REGION1='North America'; else if COUNTRY='DEU' then REGION1='Europe'; else REGION1='Rest of World';run;proc sql; create table final as select STUDYID, USUBJID, COUNTRY, REGION1 from result;quit;proc export data=final outfile="/app/output/adsl.csv" dbms=csv replace; run;
yamaa