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

Public 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:

  • VSTESTCD is the test code of the collected item: SYSBP or DIABP.
  • VSTEST is the test name of the collected item.
  • VSSPID is the item-group repeat key, the sponsor's identifier of the reading: it numbers the readings of one test at one visit.
  • VSORRES is the reading written as text from its numeric value, so trailing zeros are dropped (a collected 82.50 reads 82.5).
  • VSORRESU is mmHg for every record.
  • VSSTRESN is the numeric reading.
  • VSSTRESC is the same value written as text, so it always agrees with the numeric result.
  • VSSEQ numbers every record of a subject in one sequence, by visit, then test code (DIABP before SYSBP), 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 review
1 source file

input/odm.csv

Edit
23 rows
input/odm.csv
StudyOIDMetaDataVersionOIDSubjectKeyStudyEventOIDStudyEventRepeatKeyItemGroupOIDItemGroupRepeatKeyItemOIDValue
YAMAA-01MDV.1YAMAA-01-001SE.VISIT11IG.VS1IT.VS.SYSBP120
YAMAA-01MDV.1YAMAA-01-001SE.VISIT11IG.VS1IT.VS.DIABP80
YAMAA-01MDV.1YAMAA-01-001SE.VISIT11IG.VS2IT.VS.SYSBP122
YAMAA-01MDV.1YAMAA-01-001SE.VISIT11IG.VS2IT.VS.DIABP78
YAMAA-01MDV.1YAMAA-01-001SE.VISIT11IG.VS3IT.VS.SYSBP118
YAMAA-01MDV.1YAMAA-01-001SE.VISIT11IG.VS3IT.VS.DIABP82
YAMAA-01MDV.1YAMAA-01-001SE.VISIT21IG.VS1IT.VS.SYSBP116
YAMAA-01MDV.1YAMAA-01-001SE.VISIT21IG.VS1IT.VS.DIABP76
YAMAA-01MDV.1YAMAA-01-001SE.VISIT21IG.VS2IT.VS.SYSBP114
YAMAA-01MDV.1YAMAA-01-001SE.VISIT21IG.VS2IT.VS.DIABP78
YAMAA-01MDV.1YAMAA-01-001SE.VISIT21IG.VS3IT.VS.SYSBP118
YAMAA-01MDV.1YAMAA-01-001SE.VISIT21IG.VS3IT.VS.DIABP74
YAMAA-01MDV.1YAMAA-01-002SE.VISIT11IG.VS1IT.VS.SYSBP130
YAMAA-01MDV.1YAMAA-01-002SE.VISIT11IG.VS1IT.VS.DIABP86
YAMAA-01MDV.1YAMAA-01-002SE.VISIT11IG.VS2IT.VS.SYSBP132
YAMAA-01MDV.1YAMAA-01-002SE.VISIT11IG.VS2IT.VS.DIABP84
YAMAA-01MDV.1YAMAA-01-002SE.VISIT11IG.VS3IT.VS.SYSBP128
YAMAA-01MDV.1YAMAA-01-002SE.VISIT11IG.VS3IT.VS.DIABP88
YAMAA-01MDV.1YAMAA-01-002SE.VISIT21IG.VS1IT.VS.SYSBP124
YAMAA-01MDV.1YAMAA-01-002SE.VISIT21IG.VS1IT.VS.DIABP82
YAMAA-01MDV.1YAMAA-01-002SE.VISIT21IG.VS2IT.VS.SYSBP126
YAMAA-01MDV.1YAMAA-01-002SE.VISIT21IG.VS2IT.VS.DIABP80
YAMAA-01MDV.1YAMAA-01-002SE.VISIT21IG.VS3IT.VS.DIABP84

Expected output

Under review
23 expected rows

expected/vs.csv

Edit
23 rows
expected/vs.csv
DOMAINSTUDYIDUSUBJIDVSSEQVSSPIDVISITVSTESTCDVSTESTVSORRESVSORRESUVSSTRESNVSSTRESC
VSYAMAA-0111VISIT 1DIABPDiastolic Blood Pressure80mmHg8080
VSYAMAA-0122VISIT 1DIABPDiastolic Blood Pressure78mmHg7878
VSYAMAA-0133VISIT 1DIABPDiastolic Blood Pressure82mmHg8282
VSYAMAA-0141VISIT 1SYSBPSystolic Blood Pressure120mmHg120120
VSYAMAA-0152VISIT 1SYSBPSystolic Blood Pressure122mmHg122122
VSYAMAA-0163VISIT 1SYSBPSystolic Blood Pressure118mmHg118118
VSYAMAA-0171VISIT 2DIABPDiastolic Blood Pressure76mmHg7676
VSYAMAA-0182VISIT 2DIABPDiastolic Blood Pressure78mmHg7878
VSYAMAA-0193VISIT 2DIABPDiastolic Blood Pressure74mmHg7474
VSYAMAA-01101VISIT 2SYSBPSystolic Blood Pressure116mmHg116116
VSYAMAA-01112VISIT 2SYSBPSystolic Blood Pressure114mmHg114114
VSYAMAA-01123VISIT 2SYSBPSystolic Blood Pressure118mmHg118118
VSYAMAA-0111VISIT 1DIABPDiastolic Blood Pressure86mmHg8686
VSYAMAA-0122VISIT 1DIABPDiastolic Blood Pressure84mmHg8484
VSYAMAA-0133VISIT 1DIABPDiastolic Blood Pressure88mmHg8888
VSYAMAA-0141VISIT 1SYSBPSystolic Blood Pressure130mmHg130130
VSYAMAA-0152VISIT 1SYSBPSystolic Blood Pressure132mmHg132132
VSYAMAA-0163VISIT 1SYSBPSystolic Blood Pressure128mmHg128128
VSYAMAA-0171VISIT 2DIABPDiastolic Blood Pressure82mmHg8282
VSYAMAA-0182VISIT 2DIABPDiastolic Blood Pressure80mmHg8080
VSYAMAA-0193VISIT 2DIABPDiastolic Blood Pressure84mmHg8484
VSYAMAA-01101VISIT 2SYSBPSystolic Blood Pressure124mmHg124124
VSYAMAA-01112VISIT 2SYSBPSystolic Blood Pressure126mmHg126126
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

Variable NameVariable LabelTypeLengthControlled Terms or FormatOriginCoreConversion DefinitionVariable TypeVariable OrderComments for Define
DOMAINDomain AbbreviationCharAssignedSet constant value "VS".SDTM1
STUDYIDStudy IdentifierCharCollectedCopy value from ODM.StudyOID.SDTM2
USUBJIDUnique Subject IdentifierCharCollectedCopy value from ODM.SubjectKey.SDTM3
VISITVisit NameCharCollectedRecode ODM.StudyEventOID: "SE.VISIT1" → "VISIT 1", "SE.VISIT2" → "VISIT 2"; missing values stay missing; unlisted values are errors.SDTM4
VSTESTCDVital Signs Test Short NameCharSYSBP, DIABPCollectedRecode ODM.ItemOID: "IT.VS.SYSBP" → "SYSBP", "IT.VS.DIABP" → "DIABP"; missing values stay missing; unlisted values are errors.SDTM5
VSTESTVital Signs Test NameCharCollectedRecode ODM.ItemOID: "IT.VS.SYSBP" → "Systolic Blood Pressure", "IT.VS.DIABP" → "Diastolic Blood Pressure"; missing values stay missing; unlisted values are errors.SDTM6
VSSPIDSponsor-Defined IdentifierCharCollectedCopy value from ODM.ItemGroupRepeatKey.SDTM7
VSSTRESNNumeric Result/Finding in Standard UnitsNumCollectedCopy value from ODM.Value.SDTM8
VSSTRESCCharacter Result/Finding in Std FormatCharDerivedCopy value from VSSTRESN.SDTM9
VSORRESResult or Finding in Original UnitsCharDerivedCopy value from VSSTRESN.SDTM10
VSORRESUOriginal UnitsCharAssignedSet constant value "mmHg".SDTM11
VSSEQSequence NumberNumDerivedRow number within each group of STUDYID, USUBJID, ordered by ODM.StudyEventOID then ODM.ItemOID then ODM.ItemGroupRepeatKey.SDTM12
VariablePermitted values
VSTESTCDSYSBP, DIABP
VersionDateAuthorDescriptionReviewerSign-off
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/sdtm-vs-replicates/full.md

Edit
25 lines

Following 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

Edit
14 lines

Following 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

Edit
9 lines

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

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/sdtm-vs-replicates/result.R

Edit
76 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

Edit
97 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

Edit
23 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;