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: carry the site (SITEID), read the site from the subject
identifier as a check (SITEIDP), and build the display reference
(SUBJREF) for each subject.
Input: demographics with the study identifier, the unique subject identifier, the collected subject number, and the collected site, which every subject has.
Variables:
SITEIDis the site collected in demographics, as it stands.SITEIDPis the site code read from the middle of the unique subject identifier when it has the formYAMAA-<site>-<four digits>; empty when the identifier has any other shape. It never replacesSITEID.SUBJREFcombinesSITEIDand the collected subject number with a colon.
Note: keeping the site read from the identifier beside the collected one shows a subject whose identifier names another site, and which identifiers do not have the expected shape.
Inputs
Under review1 source fileinput/dm.csv
Edit8 rows| STUDYID | USUBJID | SUBJID | SITEID |
|---|---|---|---|
| YAMAA-01 | 0001 | UCSD | |
| YAMAA-01 | 0002 | UCSD | |
| YAMAA-01 | 0003 | UCSD | |
| YAMAA-01 | 0004 | UCSD | |
| YAMAA-01 | 0005 | UCLA | |
| YAMAA-01 | 0006 | UCSD | |
| YAMAA-01 | 0007 | UCSD | |
| YAMAA-01 | 0008 | UCSD |
Expected output
Under review8 expected rowsexpected/adsl.csv
Edit8 rows| STUDYID | USUBJID | SUBJID | SITEID | SITEIDP | SUBJREF |
|---|---|---|---|---|---|
| YAMAA-01 | 0001 | UCSD | UCSD | UCSD:0001 | |
| YAMAA-01 | 0002 | UCSD | UCSD | UCSD:0002 | |
| YAMAA-01 | 0003 | UCSD | UCLA | UCSD:0003 | |
| YAMAA-01 | 0004 | UCSD | — | UCSD:0004 | |
| YAMAA-01 | 0005 | UCLA | — | UCLA:0005 | |
| YAMAA-01 | 0006 | UCSD | — | UCSD:0006 | |
| YAMAA-01 | 0007 | UCSD | — | UCSD:0007 | |
| YAMAA-01 | 0008 | UCSD | UCSD | UCSD:0008 |
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 | SUBJID | Subject Identifier for the Study | character | Copy value from DM.SUBJID. | Predecessor | ||
| ADSL | SITEID | Study Site Identifier | character | Copy value from DM.SITEID. | Predecessor | ||
| ADSL | SITEIDP | Parsed Study Site Identifier | character | Extract capture group 1 matching ^YAMAA-([^-]+)-[0-9]{4}$ from USUBJID; no match → blank. | Derived | ||
| ADSL | SUBJREF | Subject Display Reference | character | Fill the template "{SITEID}:{SUBJID}". | Derived |
| Version | Date | Author | Description | Reviewer | Sign-off |
|---|---|---|---|---|---|
| 1.8 | 2026-11-19 | yamaa docs build | State open and closed range endpoints, including bounds of zero | ||
| 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-site-parse/full.md
Edit15 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, SUBJID, SITEID, SITEIDP, SUBJREF
SITEID is the collected site in DM, as it stands. SITEIDP is the site code in the middle of the unique subject identifier when the identifier has three hyphen-separated parts, the last of exactly four digits, and has no value when the identifier has any other shape; it never replaces SITEID. SUBJREF combines SITEID and the collected subject number with a colon.
Read the source datasets from /app/input and save the completed dataset as /app/output/adsl.csv.
prompts/adam-adsl-site-parse/conventions.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, SUBJID, SITEID, SITEIDP, SUBJREF
SITEID is the collected site in DM. SITEIDP is the site code in the middle of the unique subject identifier, or has no value, and never replaces SITEID. SUBJREF combines SITEID and the collected subject number with a colon.
Read the source datasets from /app/input and save the completed dataset as /app/output/adsl.csv.
prompts/adam-adsl-site-parse/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, SUBJID, SITEID, SITEIDP, SUBJREF
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-site-parse/result.R
Edit28 lines# Reference solution for the yamaa benchmark adam-adsl-site-parse (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( # The middle segment when the identifier holds two dashes with # exactly four digits after the last one. # It is a check beside the collected site and never replaces it. SITEIDP = str_match(USUBJID, "^[^-]+-([^-]+)-[0-9]{4}$")[, 2], SUBJREF = paste0(SITEID, ":", SUBJID) ) |> select(STUDYID, USUBJID, SUBJID, SITEID, SITEIDP, SUBJREF) |> arrange(USUBJID)dir.create("/app/output", showWarnings = FALSE)write_csv(adsl, "/app/output/adsl.csv", na = "")solutions/adam-adsl-site-parse/result.py
Edit58 lines# Reference solution for the yamaa benchmark adam-adsl-site-parse (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 ADSL from DM: carry the site and check it in the subject identifier.One record per subject. SITEID is the collected site. SITEIDP is themiddle part of the unique subject identifier when it has threehyphen-separated parts and the last part is exactly four digits; otherwiseit is blank. SUBJREF joins SITEID and the collected subject number with acolon."""import csvimport osINPUT_DIR = "/app/input"OUTPUT_DIR = "/app/output"def parse_site(usubjid): parts = usubjid.split("-") if len(parts) == 3 and len(parts[2]) == 4 and parts[2].isdigit(): return parts[1] return ""def main(): with open(os.path.join(INPUT_DIR, "dm.csv"), newline="") as f: dm = list(csv.DictReader(f)) rows = [] for rec in dm: siteid = rec["SITEID"] subjid = rec["SUBJID"] rows.append( { "STUDYID": rec["STUDYID"], "USUBJID": rec["USUBJID"], "SUBJID": subjid, "SITEID": siteid, "SITEIDP": parse_site(rec["USUBJID"]), "SUBJREF": siteid + ":" + subjid, } ) os.makedirs(OUTPUT_DIR, exist_ok=True) fieldnames = ["STUDYID", "USUBJID", "SUBJID", "SITEID", "SITEIDP", "SUBJREF"] with open(os.path.join(OUTPUT_DIR, "adsl.csv"), "w", newline="") as f: writer = csv.DictWriter(f, fieldnames=fieldnames) writer.writeheader() writer.writerows(rows)if __name__ == "__main__": main()solutions/adam-adsl-site-parse/result.sas
Edit21 lines/* opensas reference solution for the yamaa benchmark adam-adsl-site-parse. 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 SUBJID SITEID $1024; infile "/app/input/dm.csv" dsd dlm="," firstobs=2 truncover lrecl=32767; input STUDYID : $char1024. USUBJID : $char1024. SUBJID : $char1024. SITEID : $char1024.;run;data result; length SITEIDP SUBJREF $1024; set dm; if prxmatch('/^[^-]+-([^-]+)-[0-9]{4}$/',strip(USUBJID)) then SITEIDP=scan(USUBJID,2,'-'); SUBJREF=catx(':',SITEID,SUBJID);run;proc sql; create table final as select STUDYID, USUBJID, SUBJID, SITEID, SITEIDP, SUBJREF from result;quit;proc export data=final outfile="/app/output/adsl.csv" dbms=csv replace; run;
yamaa