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: keep every blood pressure reading taken at a visit as its own
record, with VSSPID numbering the readings of one test at one visit.
Input: long-form Operational Data Model (ODM) rows, one row per collected item, with the collected entry in the value field. Each replicate of a blood pressure reading is one repeat of the vital-signs item group, numbered in the item-group repeat key; the visit rides in the study event.
Variables:
VSTESTCDis the test code of the collected item:SYSBPorDIABP.VSTESTis the test name of the collected item.VSSPIDis the item-group repeat key, the sponsor's identifier of the reading: it numbers the readings of one test at one visit.VSORRESis the reading written as text from its numeric value, so trailing zeros are dropped (a collected82.50reads82.5).VSORRESUismmHgfor every record.VSSTRESNis the numeric reading.VSSTRESCis the same value written as text, so it always agrees with the numeric result.VSSEQnumbers every record of a subject in one sequence, by visit, then test code (DIABPbeforeSYSBP), then the readings in the order they were taken.
Note: a reading that was not taken, whether its record is absent or its value is blank, gives no record, and the other readings keep their numbers. No visit mean is added: averaging the readings is an analysis step, made in the analysis dataset.
Inputs
Under review1 source fileinput/odm.csv
Edit23 rows| StudyOID | MetaDataVersionOID | SubjectKey | StudyEventOID | StudyEventRepeatKey | ItemGroupOID | ItemGroupRepeatKey | ItemOID | Value |
|---|---|---|---|---|---|---|---|---|
| YAMAA-01 | MDV.1 | YAMAA-01-001 | SE.VISIT1 | 1 | IG.VS | 1 | IT.VS.SYSBP | 120 |
| YAMAA-01 | MDV.1 | YAMAA-01-001 | SE.VISIT1 | 1 | IG.VS | 1 | IT.VS.DIABP | 80 |
| YAMAA-01 | MDV.1 | YAMAA-01-001 | SE.VISIT1 | 1 | IG.VS | 2 | IT.VS.SYSBP | 122 |
| YAMAA-01 | MDV.1 | YAMAA-01-001 | SE.VISIT1 | 1 | IG.VS | 2 | IT.VS.DIABP | 78 |
| YAMAA-01 | MDV.1 | YAMAA-01-001 | SE.VISIT1 | 1 | IG.VS | 3 | IT.VS.SYSBP | 118 |
| YAMAA-01 | MDV.1 | YAMAA-01-001 | SE.VISIT1 | 1 | IG.VS | 3 | IT.VS.DIABP | 82 |
| YAMAA-01 | MDV.1 | YAMAA-01-001 | SE.VISIT2 | 1 | IG.VS | 1 | IT.VS.SYSBP | 116 |
| YAMAA-01 | MDV.1 | YAMAA-01-001 | SE.VISIT2 | 1 | IG.VS | 1 | IT.VS.DIABP | 76 |
| YAMAA-01 | MDV.1 | YAMAA-01-001 | SE.VISIT2 | 1 | IG.VS | 2 | IT.VS.SYSBP | 114 |
| YAMAA-01 | MDV.1 | YAMAA-01-001 | SE.VISIT2 | 1 | IG.VS | 2 | IT.VS.DIABP | 78 |
| YAMAA-01 | MDV.1 | YAMAA-01-001 | SE.VISIT2 | 1 | IG.VS | 3 | IT.VS.SYSBP | 118 |
| YAMAA-01 | MDV.1 | YAMAA-01-001 | SE.VISIT2 | 1 | IG.VS | 3 | IT.VS.DIABP | 74 |
| YAMAA-01 | MDV.1 | YAMAA-01-002 | SE.VISIT1 | 1 | IG.VS | 1 | IT.VS.SYSBP | 130 |
| YAMAA-01 | MDV.1 | YAMAA-01-002 | SE.VISIT1 | 1 | IG.VS | 1 | IT.VS.DIABP | 86 |
| YAMAA-01 | MDV.1 | YAMAA-01-002 | SE.VISIT1 | 1 | IG.VS | 2 | IT.VS.SYSBP | 132 |
| YAMAA-01 | MDV.1 | YAMAA-01-002 | SE.VISIT1 | 1 | IG.VS | 2 | IT.VS.DIABP | 84 |
| YAMAA-01 | MDV.1 | YAMAA-01-002 | SE.VISIT1 | 1 | IG.VS | 3 | IT.VS.SYSBP | 128 |
| YAMAA-01 | MDV.1 | YAMAA-01-002 | SE.VISIT1 | 1 | IG.VS | 3 | IT.VS.DIABP | 88 |
| YAMAA-01 | MDV.1 | YAMAA-01-002 | SE.VISIT2 | 1 | IG.VS | 1 | IT.VS.SYSBP | 124 |
| YAMAA-01 | MDV.1 | YAMAA-01-002 | SE.VISIT2 | 1 | IG.VS | 1 | IT.VS.DIABP | 82 |
| YAMAA-01 | MDV.1 | YAMAA-01-002 | SE.VISIT2 | 1 | IG.VS | 2 | IT.VS.SYSBP | 126 |
| YAMAA-01 | MDV.1 | YAMAA-01-002 | SE.VISIT2 | 1 | IG.VS | 2 | IT.VS.DIABP | 80 |
| YAMAA-01 | MDV.1 | YAMAA-01-002 | SE.VISIT2 | 1 | IG.VS | 3 | IT.VS.DIABP | 84 |
Expected output
Under review23 expected rowsexpected/vs.csv
Edit23 rows| DOMAIN | STUDYID | USUBJID | VSSEQ | VSSPID | VISIT | VSTESTCD | VSTEST | VSORRES | VSORRESU | VSSTRESN | VSSTRESC |
|---|---|---|---|---|---|---|---|---|---|---|---|
| VS | YAMAA-01 | 1 | 1 | VISIT 1 | DIABP | Diastolic Blood Pressure | 80 | mmHg | 80 | 80 | |
| VS | YAMAA-01 | 2 | 2 | VISIT 1 | DIABP | Diastolic Blood Pressure | 78 | mmHg | 78 | 78 | |
| VS | YAMAA-01 | 3 | 3 | VISIT 1 | DIABP | Diastolic Blood Pressure | 82 | mmHg | 82 | 82 | |
| VS | YAMAA-01 | 4 | 1 | VISIT 1 | SYSBP | Systolic Blood Pressure | 120 | mmHg | 120 | 120 | |
| VS | YAMAA-01 | 5 | 2 | VISIT 1 | SYSBP | Systolic Blood Pressure | 122 | mmHg | 122 | 122 | |
| VS | YAMAA-01 | 6 | 3 | VISIT 1 | SYSBP | Systolic Blood Pressure | 118 | mmHg | 118 | 118 | |
| VS | YAMAA-01 | 7 | 1 | VISIT 2 | DIABP | Diastolic Blood Pressure | 76 | mmHg | 76 | 76 | |
| VS | YAMAA-01 | 8 | 2 | VISIT 2 | DIABP | Diastolic Blood Pressure | 78 | mmHg | 78 | 78 | |
| VS | YAMAA-01 | 9 | 3 | VISIT 2 | DIABP | Diastolic Blood Pressure | 74 | mmHg | 74 | 74 | |
| VS | YAMAA-01 | 10 | 1 | VISIT 2 | SYSBP | Systolic Blood Pressure | 116 | mmHg | 116 | 116 | |
| VS | YAMAA-01 | 11 | 2 | VISIT 2 | SYSBP | Systolic Blood Pressure | 114 | mmHg | 114 | 114 | |
| VS | YAMAA-01 | 12 | 3 | VISIT 2 | SYSBP | Systolic Blood Pressure | 118 | mmHg | 118 | 118 | |
| VS | YAMAA-01 | 1 | 1 | VISIT 1 | DIABP | Diastolic Blood Pressure | 86 | mmHg | 86 | 86 | |
| VS | YAMAA-01 | 2 | 2 | VISIT 1 | DIABP | Diastolic Blood Pressure | 84 | mmHg | 84 | 84 | |
| VS | YAMAA-01 | 3 | 3 | VISIT 1 | DIABP | Diastolic Blood Pressure | 88 | mmHg | 88 | 88 | |
| VS | YAMAA-01 | 4 | 1 | VISIT 1 | SYSBP | Systolic Blood Pressure | 130 | mmHg | 130 | 130 | |
| VS | YAMAA-01 | 5 | 2 | VISIT 1 | SYSBP | Systolic Blood Pressure | 132 | mmHg | 132 | 132 | |
| VS | YAMAA-01 | 6 | 3 | VISIT 1 | SYSBP | Systolic Blood Pressure | 128 | mmHg | 128 | 128 | |
| VS | YAMAA-01 | 7 | 1 | VISIT 2 | DIABP | Diastolic Blood Pressure | 82 | mmHg | 82 | 82 | |
| VS | YAMAA-01 | 8 | 2 | VISIT 2 | DIABP | Diastolic Blood Pressure | 80 | mmHg | 80 | 80 | |
| VS | YAMAA-01 | 9 | 3 | VISIT 2 | DIABP | Diastolic Blood Pressure | 84 | mmHg | 84 | 84 | |
| VS | YAMAA-01 | 10 | 1 | VISIT 2 | SYSBP | Systolic Blood Pressure | 124 | mmHg | 124 | 124 | |
| VS | YAMAA-01 | 11 | 2 | VISIT 2 | SYSBP | Systolic Blood Pressure | 126 | mmHg | 126 | 126 |
Human review and assessment
| Variable Name | Variable Label | Type | Length | Controlled Terms or Format | Origin | Core | Conversion Definition | Variable Type | Variable Order | Comments for Define |
|---|---|---|---|---|---|---|---|---|---|---|
| DOMAIN | Domain Abbreviation | Char | Assigned | Set constant value "VS". | SDTM | 1 | ||||
| STUDYID | Study Identifier | Char | Collected | Copy value from ODM.StudyOID. | SDTM | 2 | ||||
| USUBJID | Unique Subject Identifier | Char | Collected | Copy value from ODM.SubjectKey. | SDTM | 3 | ||||
| VISIT | Visit Name | Char | Collected | Recode ODM.StudyEventOID: "SE.VISIT1" → "VISIT 1", "SE.VISIT2" → "VISIT 2"; missing values stay missing; unlisted values are errors. | SDTM | 4 | ||||
| VSTESTCD | Vital Signs Test Short Name | Char | SYSBP, DIABP | Collected | Recode ODM.ItemOID: "IT.VS.SYSBP" → "SYSBP", "IT.VS.DIABP" → "DIABP"; missing values stay missing; unlisted values are errors. | SDTM | 5 | |||
| VSTEST | Vital Signs Test Name | Char | Collected | Recode ODM.ItemOID: "IT.VS.SYSBP" → "Systolic Blood Pressure", "IT.VS.DIABP" → "Diastolic Blood Pressure"; missing values stay missing; unlisted values are errors. | SDTM | 6 | ||||
| VSSPID | Sponsor-Defined Identifier | Char | Collected | Copy value from ODM.ItemGroupRepeatKey. | SDTM | 7 | ||||
| VSSTRESN | Numeric Result/Finding in Standard Units | Num | Collected | Copy value from ODM.Value. | SDTM | 8 | ||||
| VSSTRESC | Character Result/Finding in Std Format | Char | Derived | Copy value from VSSTRESN. | SDTM | 9 | ||||
| VSORRES | Result or Finding in Original Units | Char | Derived | Copy value from VSSTRESN. | SDTM | 10 | ||||
| VSORRESU | Original Units | Char | Assigned | Set constant value "mmHg". | SDTM | 11 | ||||
| VSSEQ | Sequence Number | Num | Derived | Row number within each group of STUDYID, USUBJID, ordered by ODM.StudyEventOID then ODM.ItemOID then ODM.ItemGroupRepeatKey. | SDTM | 12 |
| Variable | Permitted values |
|---|---|
| VSTESTCD | SYSBP, DIABP |
| 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/sdtm-vs-replicates/full.md
Edit25 linesFollowing CDISC SDTM standards, use the provided ODM dataset to create a VS dataset with one record per blood pressure reading.
The output dataset should contain the following columns in this order: DOMAIN, STUDYID, USUBJID, VSSEQ, VSSPID, VISIT, VSTESTCD, VSTEST, VSORRES, VSORRESU, VSSTRESN, VSSTRESC
DOMAIN is "VS". STUDYID is the ODM study OID and USUBJID is the ODM subject key, each as given. VISIT is the name of the visit the reading was collected at, "VISIT 1" or "VISIT 2". VSTESTCD is "SYSBP" or "DIABP" and VSTEST is "Systolic Blood Pressure" or "Diastolic Blood Pressure", the test code and name of the collected item. Each reading taken gives one record, and VSSPID is the reading's item-group repeat key, as text: it numbers the readings of one test at one visit. A reading that was not taken, whether its record is absent or its value is blank, gives no record, and the other readings keep their numbers. VSORRES is the reading written as text from its numeric value, so trailing zeros are dropped (a collected 82.50 reads 82.5). VSSTRESN is the numeric reading. VSSTRESC is the numeric result written as text, so it always agrees with VSSTRESN. VSORRESU is "mmHg" for every record. No record for the mean of the readings is added. VSSEQ numbers each subject's records from 1 by visit name, then by test code (DIABP before SYSBP), then the readings in replicate order.
Read the source datasets from /app/input and save the completed dataset as /app/output/vs.csv.
prompts/sdtm-vs-replicates/conventions.md
Edit14 linesFollowing CDISC SDTM standards, use the provided ODM dataset to create a VS dataset with one record per blood pressure reading.
The output dataset should contain the following columns in this order: DOMAIN, STUDYID, USUBJID, VSSEQ, VSSPID, VISIT, VSTESTCD, VSTEST, VSORRES, VSORRESU, VSSTRESN, VSSTRESC
DOMAIN is "VS". VISIT is "VISIT 1" or "VISIT 2". VSTESTCD is "SYSBP" or "DIABP" and VSTEST is "Systolic Blood Pressure" or "Diastolic Blood Pressure". VSORRES is the reading written as text from its numeric value, so trailing zeros are dropped (a collected 82.50 reads 82.5).
Read the source datasets from /app/input and save the completed dataset as /app/output/vs.csv.
prompts/sdtm-vs-replicates/brief.md
Edit9 linesFollowing CDISC SDTM standards, use the provided ODM dataset to create a VS dataset with one record per blood pressure reading.
The output dataset should contain the following columns in this order: DOMAIN, STUDYID, USUBJID, VSSEQ, VSSPID, VISIT, VSTESTCD, VSTEST, VSORRES, VSORRESU, VSSTRESN, VSSTRESC
Read the source datasets from /app/input and save the completed dataset as /app/output/vs.csv.
R
Edit3 lineslibrary(yamaa)yamaa_spec("spec.yaml")$run()$outputPython
Edit3 linesimport yamaayamaa.spec("spec.yaml").run().outputsolutions/sdtm-vs-replicates/result.R
Edit76 lines# Reference solution for the yamaa benchmark sdtm-vs-replicates (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(tidyr)fmt_text <- function(x) { if (is.na(x)) { return(NA_character_) } if (x == floor(x)) { formatC(x, format = "f", digits = 0) } else { format(x, scientific = FALSE, trim = TRUE, digits = 15) }}odm <- read_csv( "/app/input/odm.csv", col_types = cols(.default = col_character()))readings <- odm |> filter( ItemOID %in% c("IT.VS.SYSBP", "IT.VS.DIABP"), StudyEventOID %in% c("SE.VISIT1", "SE.VISIT2"), !is.na(Value) & Value != "" ) |> mutate( VISIT = case_when( StudyEventOID == "SE.VISIT1" ~ "VISIT 1", .default = "VISIT 2" ), VSTESTCD = case_when( ItemOID == "IT.VS.DIABP" ~ "DIABP", .default = "SYSBP" ), VSTEST = case_when( ItemOID == "IT.VS.DIABP" ~ "Diastolic Blood Pressure", .default = "Systolic Blood Pressure" ), VSREPNUM = suppressWarnings(as.integer(ItemGroupRepeatKey)), val = suppressWarnings(as.numeric(Value)), STUDYID = StudyOID, USUBJID = SubjectKey ) |> filter(!is.na(val), !is.na(VSREPNUM)) |> select(STUDYID, USUBJID, VISIT, VSTESTCD, VSTEST, VSREPNUM, val)vs <- readings |> transmute( DOMAIN = "VS", STUDYID, USUBJID, VISIT, VSTESTCD, VSTEST, VSREPNUM, VSSPID = as.character(VSREPNUM), VSORRES = vapply(val, fmt_text, character(1)), VSORRESU = "mmHg", VSSTRESN = val, VSSTRESC = VSORRES ) |> arrange(USUBJID, VISIT, VSTESTCD, VSREPNUM) |> group_by(USUBJID) |> mutate(VSSEQ = row_number()) |> ungroup() |> arrange(USUBJID, VSSEQ) |> select( DOMAIN, STUDYID, USUBJID, VSSEQ, VSSPID, VISIT, VSTESTCD, VSTEST, VSORRES, VSORRESU, VSSTRESN, VSSTRESC )dir.create("/app/output", showWarnings = FALSE)write_csv(vs, "/app/output/vs.csv", na = "")solutions/sdtm-vs-replicates/result.py
Edit97 lines# Reference solution for the yamaa benchmark sdtm-vs-replicates (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 csvimport refrom collections import OrderedDictINPUT = "/app/input"OUTPUT = "/app/output"TESTS = { "SYSBP": "Systolic Blood Pressure", "DIABP": "Diastolic Blood Pressure",}COLUMNS = [ "DOMAIN", "STUDYID", "USUBJID", "VSSEQ", "VSSPID", "VISIT", "VSTESTCD", "VSTEST", "VSORRES", "VSORRESU", "VSSTRESN", "VSSTRESC",]def fmt(value): """Write a number as text, dropping trailing zeros (82.50 -> 82.5).""" if value == int(value): return str(int(value)) return repr(value)def visit_name(event_oid): name = event_oid.split(".", 1)[1] if "." in event_oid else event_oid m = re.match(r"^(.*?)(\d+)$", name) if m: return m.group(1) + " " + m.group(2) return namedef main(): with open(INPUT + "/odm.csv", newline="") as f: rows = list(csv.DictReader(f)) studyid = rows[0]["StudyOID"] # readings[(subject, visit, testcd)] = [(repnum, value), ...] readings = OrderedDict() subjects = [] for row in rows: subject = row["SubjectKey"] if subject not in subjects: subjects.append(subject) if row["ItemGroupOID"] != "IG.VS": continue testcd = row["ItemOID"].rsplit(".", 1)[-1] if testcd not in TESTS: continue value = (row["Value"] or "").strip() if value == "": continue # reading not taken: no record key = (subject, visit_name(row["StudyEventOID"]), testcd) readings.setdefault(key, []).append( (int(row["ItemGroupRepeatKey"]), float(value)) ) out = [] for subject in subjects: records = [] keys = [k for k in readings if k[0] == subject] for key in sorted(keys, key=lambda k: (k[1], k[2])): _, visit, testcd = key for repnum, value in sorted(readings[key]): records.append({ "DOMAIN": "VS", "STUDYID": studyid, "USUBJID": subject, "VSSPID": str(repnum), "VISIT": visit, "VSTESTCD": testcd, "VSTEST": TESTS[testcd], "VSORRES": fmt(value), "VSORRESU": "mmHg", "VSSTRESN": fmt(value), "VSSTRESC": fmt(value), }) for i, rec in enumerate(records, start=1): rec["VSSEQ"] = str(i) out.append(rec) with open(OUTPUT + "/vs.csv", "w", newline="") as f: writer = csv.DictWriter(f, fieldnames=COLUMNS) writer.writeheader() writer.writerows(out)if __name__ == "__main__": main()solutions/sdtm-vs-replicates/result.sas
Edit23 lines/* opensas reference solution for the yamaa benchmark sdtm-vs-replicates. Reads the benchmark inputs and derives the requested output. Execute with the existing opensas runtime: opensas /app/output/result.sas. */data odm; length StudyOID MetaDataVersionOID SubjectKey StudyEventOID StudyEventRepeatKey ItemGroupOID ItemGroupRepeatKey ItemOID Value $1024; infile "/app/input/odm.csv" dsd dlm="," firstobs=2 truncover lrecl=32767; input StudyOID : $char1024. MetaDataVersionOID : $char1024. SubjectKey : $char1024. StudyEventOID : $char1024. StudyEventRepeatKey : $char1024. ItemGroupOID : $char1024. ItemGroupRepeatKey : $char1024. ItemOID : $char1024. Value : $char1024.;run;data readings; set odm; where ItemOID in ('IT.VS.SYSBP','IT.VS.DIABP') and not missing(Value); length STUDYID USUBJID VISIT VSTESTCD $1024;STUDYID=StudyOID; USUBJID=SubjectKey; VISIT=catx(' ','VISIT',scan(StudyEventOID,-1,'T')); if StudyEventOID='SE.VISIT1' then VISIT='VISIT 1'; if StudyEventOID='SE.VISIT2' then VISIT='VISIT 2'; VSTESTCD=scan(ItemOID,-1,'.'); VSREPNUM=input(ItemGroupRepeatKey,best32.); VSSTRESN=input(Value,best32.); run;data prepared; set readings; length DOMAIN $2 VSSPID VSTEST VSORRES VSORRESU VSSTRESC $1024; DOMAIN='VS'; VSSPID=strip(ItemGroupRepeatKey); VSTEST='Diastolic Blood Pressure'; if VSTESTCD='SYSBP' then VSTEST='Systolic Blood Pressure'; VSORRES=strip(put(VSSTRESN,best32.)); VSSTRESC=VSORRES; VSORRESU='mmHg'; run;proc sort data=prepared; by STUDYID USUBJID VISIT VSTESTCD VSREPNUM; run;data result; set prepared; by STUDYID USUBJID; retain VSSEQ; if first.USUBJID then VSSEQ=0; VSSEQ+1;run;proc sql; create table final as select DOMAIN, STUDYID, USUBJID, VSSEQ, VSSPID, VISIT, VSTESTCD, VSTEST, VSORRES, VSORRESU, VSSTRESN, VSSTRESC from result;quit;proc export data=final outfile="/app/output/vs.csv" dbms=csv replace; run;
yamaa