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: reviewedEditUnder review
What this benchmark means
README.md

Public entries: Python and R. Passing coverage requires an installed inventory.

Goal: carry each subject's country in COUNTRY and give its region in REGION1.

Input: demographics (DM) rows carrying the country of the investigational site (COUNTRY) as the upper-case three-letter ISO 3166 code SDTM collects, including countries outside the regions listed below.

Variables:

  • COUNTRY is the country from demographics, as collected; every subject has one.
  • REGION1 is the study's region for that country: USA and CAN give North America; DEU, ESP, FRA and GBR give Europe; and any other country gives Rest of World.

Note: a country outside the listed regions never stops the run; it falls in Rest of World, so every subject has a region.

Inputs

Under review
1 source file

input/dm.csv

Edit
9 rows
input/dm.csv
STUDYIDUSUBJIDCOUNTRY
YAMAA-01USA
YAMAA-01CAN
YAMAA-01DEU
YAMAA-01FRA
YAMAA-01USA
YAMAA-01GBR
YAMAA-01JPN
YAMAA-01ESP
YAMAA-01BRA

Expected output

Under review
9 expected rows

expected/adsl.csv

Edit
9 rows
expected/adsl.csv
STUDYIDUSUBJIDCOUNTRYREGION1
YAMAA-01USANorth America
YAMAA-01CANNorth America
YAMAA-01DEUEurope
YAMAA-01FRAEurope
YAMAA-01USANorth America
YAMAA-01GBREurope
YAMAA-01JPNRest of World
YAMAA-01ESPEurope
YAMAA-01BRARest of World
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
ADSLSTUDYIDStudy IdentifiercharacterCopy value from DM.STUDYID.Predecessor
ADSLUSUBJIDUnique Subject IdentifiercharacterCopy value from DM.USUBJID.Predecessor
ADSLCOUNTRYCountrycharacterCopy value from DM.COUNTRY.Predecessor
ADSLREGION1Geographic Region 1characterNorth America, Europe, Rest of WorldRecode COUNTRY: "USA" → "North America", "CAN" → "North America", "DEU" → "Europe", "ESP" → "Europe", "FRA" → "Europe", "GBR" → "Europe"; missing values stay missing; unlisted values → "Rest of World".Derived
VariablePermitted values
REGION1North America, Europe, Rest of World
VersionDateAuthorDescriptionReviewerSign-off
1.82026-11-19yamaa docs buildState open and closed range endpoints, including bounds of zero
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-adsl-country-region/full.md

Edit
12 lines

Following 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 country in DM, as collected. REGION1 is "North America" when COUNTRY is "USA" or "CAN", "Europe" when COUNTRY is "DEU", "ESP", "FRA", or "GBR", 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/conventions.md

Edit
11 lines

Following 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

REGION1 is "North America" for "USA" or "CAN", "Europe" for "DEU", "ESP", "FRA", or "GBR", 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

Edit
8 lines

Following 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.

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-adsl-country-region/result.R

Edit
26 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)dm <- read_csv(  "/app/input/dm.csv",  col_types = cols(.default = col_character()))adsl <- dm |>  mutate(    REGION1 = case_when(      COUNTRY %in% c("USA", "CAN") ~ "North America",      COUNTRY %in% c("DEU", "ESP", "FRA", "GBR") ~ "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

Edit
53 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 country in DM, as collected. REGION1 is "North America"for USA/CAN, "Europe" for DEU/ESP/FRA/GBR, and "Rest of World" for anyother country."""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 in ("DEU", "ESP", "FRA", "GBR"):        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:        country = record["COUNTRY"]        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

Edit
22 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;  if COUNTRY in ('USA','CAN') then REGION1='North America';  else if COUNTRY in ('DEU','ESP','FRA','GBR') 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;