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: build the supplemental demographics qualifiers QNAM, QLABEL and QVAL for each subject's additional races and other-race text, and describe each qualifier's values separately in the data-definition document.

Input: one collected record per subject with up to two races and the free text a site entered for a race not on the list.

Variables:

  • RDOMAIN is DM, the domain the qualifiers belong to.
  • IDVAR and IDVARVAL are missing: a demographics qualifier belongs to the subject rather than to one record.
  • QNAM is RACE1 or RACE2 for the first and second reported race, and RACEOTH for the other-race text.
  • QLABEL is the qualifier's label: Race 1, Race 2 or Race, Other.
  • QVAL is the reported value: a race from the race codelist for RACE1 and RACE2, and the text exactly as entered for RACEOTH.
  • QORIG is Collected, since every value comes from the form.
  • QEVAL is missing: no one evaluated the values.

Note: a subject has a qualifier record only for a race or text actually reported. The data-definition document describes QVAL once for the two race qualifiers, drawn from the race codelist and collected on page 2 of the annotated form, and once for the other-race text, collected on page 3. Each description gives the longest value of its own records, so the other-race text is shorter than the variable.

Inputs

Under review
1 source file

input/dm_raw.csv

Edit
3 rows
input/dm_raw.csv
STUDYIDUSUBJIDRACE1RACE2RACEOTH
CATHWHITEASIAN—
CATH——Samoan
CATHBLACK OR AFRICAN AMERICANWHITE—

Expected output

Under review
5 expected rows

expected/define.xml

Edit
Define-XML

Define-XML 2.1.11: CATH

Example study carrying supplemental demographic qualifiers; CATH-01; SDTMIG 3.4; CDISC/NCI 2023-12-15

Datasets
DatasetDescriptionClassStructurePurposeKeysDocumentationLocation
SUPPDMSupplemental Qualifiers for DMRELATIONSHIPOne record per supplemental qualifier per subjectTabulationSTUDYID, USUBJID, QNAMsuppdm.json

SUPPDM

SUPPDM variables
VariableLabel / DescriptionTypeLength or Display FormatControlled Terms or ISO FormatOrigin / Source / Method / Comment
STUDYIDStudy Identifiertext4Protocol; Sponsor
RDOMAINRelated Domain Abbreviationtext2Assigned; Sponsor
USUBJIDUnique Subject Identifiertext8Assigned; Sponsor
IDVARIdentifying Variabletext1Assigned; Sponsor
IDVARVALIdentifying Variable Valuetext1Assigned; Sponsor
QNAMQualifier Variable Nametext7Assigned; Sponsor
QLABELQualifier Variable Labeltext11Assigned; Sponsor
QVALData Valuetext25Collected; Investigator; Annotated Case Report Form (acrf.pdf); pages 2
QORIGOrigintext9Assigned; Sponsor
QEVALEvaluatortext1Assigned; Sponsor
SUPPDM.QVAL value-level metadata
Where ConditionVariableLabel / DescriptionTypeLength or Display FormatControlled Terms or ISO FormatOrigin / Source / Method / Comment
QNAM in RACE1, RACE2QVALRacetext25Race (CL.RACE) AMERICAN INDIAN OR ALASKA NATIVE ASIAN BLACK OR AFRICAN AMERICAN NATIVE HAWAIIAN OR OTHER PACIFIC ISLANDER WHITECollected; Investigator; Annotated Case Report Form (acrf.pdf); pages 2
QNAM = RACEOTHQVALRace, Othertext6Collected; Investigator; Annotated Case Report Form (acrf.pdf); pages 3
Original source
<?xml version="1.0" encoding="UTF-8"?>
<ODM xmlns="http://www.cdisc.org/ns/odm/v1.3" xmlns:def="http://www.cdisc.org/ns/def/v2.1" xmlns:xlink="http://www.w3.org/1999/xlink" ODMVersion="1.3.2" FileType="Snapshot" FileOID="CATH.sdtm.Define-XML_2.1" CreationDateTime="2026-09-11T00:00:00" SourceSystem="yamaa" SourceSystemVersion="1.0" def:Context="Submission">
  <Study OID="STDY.CATH">
    <GlobalVariables>
      <StudyName>CATH</StudyName>
      <StudyDescription>Example study carrying supplemental demographic qualifiers</StudyDescription>
      <ProtocolName>CATH-01</ProtocolName>
    </GlobalVariables>
    <MetaDataVersion OID="MDV.CATH.sdtm" Name="CATH sdtm metadata" def:DefineVersion="2.1.11">
      <def:Standards>
        <def:Standard OID="STD.SDTMIG" Name="SDTMIG" Type="IG" Version="3.4" Status="Final"/>
        <def:Standard OID="STD.CT_SDTM" Name="CDISC/NCI" Type="CT" PublishingSet="SDTM" Version="2023-12-15" Status="Final"/>
      </def:Standards>
      <def:AnnotatedCRF>
        <def:DocumentRef leafID="LF.acrf"/>
      </def:AnnotatedCRF>
      <def:ValueListDef OID="VL.SUPPDM.QVAL">
        <ItemRef ItemOID="IT.SUPPDM.QVAL.RACE" OrderNumber="1" Mandatory="Yes">
          <def:WhereClauseRef WhereClauseOID="WC.SUPPDM.QVAL.RACE"/>
        </ItemRef>
        <ItemRef ItemOID="IT.SUPPDM.QVAL.RACEOTH" OrderNumber="2" Mandatory="Yes">
          <def:WhereClauseRef WhereClauseOID="WC.SUPPDM.QVAL.RACEOTH"/>
        </ItemRef>
      </def:ValueListDef>
      <def:WhereClauseDef OID="WC.SUPPDM.QVAL.RACE">
        <RangeCheck Comparator="IN" SoftHard="Soft" def:ItemOID="IT.SUPPDM.QNAM">
          <CheckValue>RACE1</CheckValue>
          <CheckValue>RACE2</CheckValue>
        </RangeCheck>
      </def:WhereClauseDef>
      <def:WhereClauseDef OID="WC.SUPPDM.QVAL.RACEOTH">
        <RangeCheck Comparator="EQ" SoftHard="Soft" def:ItemOID="IT.SUPPDM.QNAM">
          <CheckValue>RACEOTH</CheckValue>
        </RangeCheck>
      </def:WhereClauseDef>
      <ItemGroupDef OID="IG.SUPPDM" Name="SUPPDM" Domain="DM" Purpose="Tabulation" SASDatasetName="SUPPDM" Repeating="Yes" IsReferenceData="No" def:Structure="One record per supplemental qualifier per subject" def:ArchiveLocationID="LF.SUPPDM" def:StandardOID="STD.SDTMIG">
        <Description>
          <TranslatedText xml:lang="en">Supplemental Qualifiers for DM</TranslatedText>
        </Description>
        <ItemRef ItemOID="IT.SUPPDM.STUDYID" OrderNumber="1" Mandatory="Yes" KeySequence="1"/>
        <ItemRef ItemOID="IT.SUPPDM.RDOMAIN" OrderNumber="2" Mandatory="Yes"/>
        <ItemRef ItemOID="IT.SUPPDM.USUBJID" OrderNumber="3" Mandatory="Yes" KeySequence="2"/>
        <ItemRef ItemOID="IT.SUPPDM.IDVAR" OrderNumber="4" Mandatory="No" def:HasNoData="Yes"/>
        <ItemRef ItemOID="IT.SUPPDM.IDVARVAL" OrderNumber="5" Mandatory="No" def:HasNoData="Yes"/>
        <ItemRef ItemOID="IT.SUPPDM.QNAM" OrderNumber="6" Mandatory="Yes" KeySequence="3"/>
        <ItemRef ItemOID="IT.SUPPDM.QLABEL" OrderNumber="7" Mandatory="Yes"/>
        <ItemRef ItemOID="IT.SUPPDM.QVAL" OrderNumber="8" Mandatory="Yes"/>
        <ItemRef ItemOID="IT.SUPPDM.QORIG" OrderNumber="9" Mandatory="Yes"/>
        <ItemRef ItemOID="IT.SUPPDM.QEVAL" OrderNumber="10" Mandatory="No" def:HasNoData="Yes"/>
        <def:Class Name="RELATIONSHIP"/>
        <def:leaf ID="LF.SUPPDM" xlink:href="suppdm.json">
          <def:title>suppdm.json</def:title>
        </def:leaf>
      </ItemGroupDef>
      <ItemDef OID="IT.SUPPDM.STUDYID" Name="STUDYID" DataType="text" Length="4" SASFieldName="STUDYID">
        <Description>
          <TranslatedText xml:lang="en">Study Identifier</TranslatedText>
        </Description>
        <def:Origin Type="Protocol" Source="Sponsor"/>
      </ItemDef>
      <ItemDef OID="IT.SUPPDM.RDOMAIN" Name="RDOMAIN" DataType="text" Length="2" SASFieldName="RDOMAIN">
        <Description>
          <TranslatedText xml:lang="en">Related Domain Abbreviation</TranslatedText>
        </Description>
        <def:Origin Type="Assigned" Source="Sponsor"/>
      </ItemDef>
      <ItemDef OID="IT.SUPPDM.USUBJID" Name="USUBJID" DataType="text" Length="8" SASFieldName="USUBJID">
        <Description>
          <TranslatedText xml:lang="en">Unique Subject Identifier</TranslatedText>
        </Description>
        <def:Origin Type="Assigned" Source="Sponsor"/>
      </ItemDef>
      <ItemDef OID="IT.SUPPDM.IDVAR" Name="IDVAR" DataType="text" Length="1" SASFieldName="IDVAR">
        <Description>
          <TranslatedText xml:lang="en">Identifying Variable</TranslatedText>
        </Description>
        <def:Origin Type="Assigned" Source="Sponsor"/>
      </ItemDef>
      <ItemDef OID="IT.SUPPDM.IDVARVAL" Name="IDVARVAL" DataType="text" Length="1" SASFieldName="IDVARVAL">
        <Description>
          <TranslatedText xml:lang="en">Identifying Variable Value</TranslatedText>
        </Description>
        <def:Origin Type="Assigned" Source="Sponsor"/>
      </ItemDef>
      <ItemDef OID="IT.SUPPDM.QNAM" Name="QNAM" DataType="text" Length="7" SASFieldName="QNAM">
        <Description>
          <TranslatedText xml:lang="en">Qualifier Variable Name</TranslatedText>
        </Description>
        <def:Origin Type="Assigned" Source="Sponsor"/>
      </ItemDef>
      <ItemDef OID="IT.SUPPDM.QLABEL" Name="QLABEL" DataType="text" Length="11" SASFieldName="QLABEL">
        <Description>
          <TranslatedText xml:lang="en">Qualifier Variable Label</TranslatedText>
        </Description>
        <def:Origin Type="Assigned" Source="Sponsor"/>
      </ItemDef>
      <ItemDef OID="IT.SUPPDM.QVAL" Name="QVAL" DataType="text" Length="25" SASFieldName="QVAL">
        <Description>
          <TranslatedText xml:lang="en">Data Value</TranslatedText>
        </Description>
        <def:Origin Type="Collected" Source="Investigator">
          <def:DocumentRef leafID="LF.acrf">
            <def:PDFPageRef PageRefs="2" Type="PhysicalRef"/>
          </def:DocumentRef>
        </def:Origin>
        <def:ValueListRef ValueListOID="VL.SUPPDM.QVAL"/>
      </ItemDef>
      <ItemDef OID="IT.SUPPDM.QVAL.RACE" Name="QVAL" DataType="text" Length="25" SASFieldName="QVAL">
        <Description>
          <TranslatedText xml:lang="en">Race</TranslatedText>
        </Description>
        <CodeListRef CodeListOID="CL.RACE"/>
        <def:Origin Type="Collected" Source="Investigator">
          <def:DocumentRef leafID="LF.acrf">
            <def:PDFPageRef PageRefs="2" Type="PhysicalRef"/>
          </def:DocumentRef>
        </def:Origin>
      </ItemDef>
      <ItemDef OID="IT.SUPPDM.QVAL.RACEOTH" Name="QVAL" DataType="text" Length="6" SASFieldName="QVAL">
        <Description>
          <TranslatedText xml:lang="en">Race, Other</TranslatedText>
        </Description>
        <def:Origin Type="Collected" Source="Investigator">
          <def:DocumentRef leafID="LF.acrf">
            <def:PDFPageRef PageRefs="3" Type="PhysicalRef"/>
          </def:DocumentRef>
        </def:Origin>
      </ItemDef>
      <ItemDef OID="IT.SUPPDM.QORIG" Name="QORIG" DataType="text" Length="9" SASFieldName="QORIG">
        <Description>
          <TranslatedText xml:lang="en">Origin</TranslatedText>
        </Description>
        <def:Origin Type="Assigned" Source="Sponsor"/>
      </ItemDef>
      <ItemDef OID="IT.SUPPDM.QEVAL" Name="QEVAL" DataType="text" Length="1" SASFieldName="QEVAL">
        <Description>
          <TranslatedText xml:lang="en">Evaluator</TranslatedText>
        </Description>
        <def:Origin Type="Assigned" Source="Sponsor"/>
      </ItemDef>
      <CodeList OID="CL.RACE" Name="Race" DataType="text" def:StandardOID="STD.CT_SDTM">
        <EnumeratedItem CodedValue="AMERICAN INDIAN OR ALASKA NATIVE">
          <Alias Context="nci:ExtCodeID" Name="C41259"/>
        </EnumeratedItem>
        <EnumeratedItem CodedValue="ASIAN">
          <Alias Context="nci:ExtCodeID" Name="C41260"/>
        </EnumeratedItem>
        <EnumeratedItem CodedValue="BLACK OR AFRICAN AMERICAN">
          <Alias Context="nci:ExtCodeID" Name="C16352"/>
        </EnumeratedItem>
        <EnumeratedItem CodedValue="NATIVE HAWAIIAN OR OTHER PACIFIC ISLANDER">
          <Alias Context="nci:ExtCodeID" Name="C41219"/>
        </EnumeratedItem>
        <EnumeratedItem CodedValue="WHITE">
          <Alias Context="nci:ExtCodeID" Name="C41261"/>
        </EnumeratedItem>
        <Alias Context="nci:ExtCodeID" Name="C74457"/>
      </CodeList>
      <def:leaf ID="LF.acrf" xlink:href="acrf.pdf">
        <def:title>Annotated Case Report Form</def:title>
      </def:leaf>
    </MetaDataVersion>
  </Study>
</ODM>

expected/suppdm.csv

Edit
5 rows
expected/suppdm.csv
STUDYIDRDOMAINUSUBJIDIDVARIDVARVALQNAMQLABELQVALQORIGQEVAL
CATHDM——RACE1Race 1WHITECollected—
CATHDM——RACE1Race 1BLACK OR AFRICAN AMERICANCollected—
CATHDM——RACE2Race 2ASIANCollected—
CATHDM——RACE2Race 2WHITECollected—
CATHDM——RACEOTHRace, OtherSamoanCollected—

expected/suppdm.json

Edit
{
  "datasetJSONCreationDateTime": "2026-09-11T00:00:00",
  "datasetJSONVersion": "1.1.0",
  "fileOID": "CATH.sdtm.Define-XML_2.1.SUPPDM",
  "sourceSystem": {"name": "yamaa", "version": "1.0"},
  "studyOID": "STDY.CATH",
  "metaDataVersionOID": "MDV.CATH.sdtm",
  "metaDataRef": "define.xml",
  "itemGroupOID": "IG.SUPPDM",
  "records": 5,
  "name": "SUPPDM",
  "label": "Supplemental Qualifiers for DM",
  "columns": [
    {"itemOID": "IT.SUPPDM.STUDYID", "name": "STUDYID", "label": "Study Identifier", "dataType": "string", "length": 4, "keySequence": 1},
    {"itemOID": "IT.SUPPDM.RDOMAIN", "name": "RDOMAIN", "label": "Related Domain Abbreviation", "dataType": "string", "length": 2},
    {"itemOID": "IT.SUPPDM.USUBJID", "name": "USUBJID", "label": "Unique Subject Identifier", "dataType": "string", "length": 8, "keySequence": 2},
    {"itemOID": "IT.SUPPDM.IDVAR", "name": "IDVAR", "label": "Identifying Variable", "dataType": "string", "length": 1},
    {"itemOID": "IT.SUPPDM.IDVARVAL", "name": "IDVARVAL", "label": "Identifying Variable Value", "dataType": "string", "length": 1},
    {"itemOID": "IT.SUPPDM.QNAM", "name": "QNAM", "label": "Qualifier Variable Name", "dataType": "string", "length": 7, "keySequence": 3},
    {"itemOID": "IT.SUPPDM.QLABEL", "name": "QLABEL", "label": "Qualifier Variable Label", "dataType": "string", "length": 11},
    {"itemOID": "IT.SUPPDM.QVAL", "name": "QVAL", "label": "Data Value", "dataType": "string", "length": 25},
    {"itemOID": "IT.SUPPDM.QORIG", "name": "QORIG", "label": "Origin", "dataType": "string", "length": 9},
    {"itemOID": "IT.SUPPDM.QEVAL", "name": "QEVAL", "label": "Evaluator", "dataType": "string", "length": 1}
  ],
  "rows": [
    ["CATH", "DM", "CATH-001", null, null, "RACE1", "Race 1", "WHITE", "Collected", null],
    ["CATH", "DM", "CATH-003", null, null, "RACE1", "Race 1", "BLACK OR AFRICAN AMERICAN", "Collected", null],
    ["CATH", "DM", "CATH-001", null, null, "RACE2", "Race 2", "ASIAN", "Collected", null],
    ["CATH", "DM", "CATH-003", null, null, "RACE2", "Race 2", "WHITE", "Collected", null],
    ["CATH", "DM", "CATH-002", null, null, "RACEOTH", "Race, Other", "Samoan", "Collected", null]
  ]
}
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
STUDYIDStudy IdentifierChar20ProtocolReqCopy value from DM_RAW.STUDYID.SUPP1
RDOMAINRelated Domain AbbreviationChar2AssignedReqSet constant value "DM".SUPP2
USUBJIDUnique Subject IdentifierChar30AssignedReqCopy value from DM_RAW.USUBJID.SUPP3
IDVARIdentifying VariableChar8AssignedExpSet constant value "None".SUPP4
IDVARVALIdentifying Variable ValueChar40AssignedExpSet constant value "None".SUPP5
QNAMQualifier Variable NameChar8AssignedReqSet per constructed row; see the Row construction sheet.SUPP6
QLABELQualifier Variable LabelChar40AssignedReqSet per constructed row; see the Row construction sheet.SUPP7
QVALData ValueChar200CollectedReqSet per constructed row; see the Row construction sheet.SUPP8
QORIGOriginChar20AssignedReqSet constant value "Collected".SUPP9
QEVALEvaluatorChar40AssignedExpSet constant value "None".SUPP10
TemplateInclude whenQNAMQLABELQVAL
race1DM_RAW.RACE1 IS NOT NULLConstant "RACE1"Constant "Race 1"Copy DM_RAW.RACE1
race2DM_RAW.RACE2 IS NOT NULLConstant "RACE2"Constant "Race 2"Copy DM_RAW.RACE2
raceothDM_RAW.RACEOTH IS NOT NULLConstant "RACEOTH"Constant "Race, Other"Copy DM_RAW.RACEOTH
Codelist IDNameValueDecodeCodelist NCI aliasValue NCI aliasExtensibleExtended valueSAS formatDictionaryVersion
RACERaceAMERICAN INDIAN OR ALASKA NATIVEC74457C41259Yes
RACERaceASIANC74457C41260Yes
RACERaceBLACK OR AFRICAN AMERICANC74457C16352Yes
RACERaceNATIVE HAWAIIAN OR OTHER PACIFIC ISLANDERC74457C41219Yes
RACERaceWHITEC74457C41261Yes
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-suppdm-metadata/full.md

Edit
14 lines

Following CDISC SDTM standards, use the provided DM_RAW dataset to create a SUPPDM dataset with one record per subject per supplemental qualifier.

The output dataset should contain the following columns in this order: STUDYID, RDOMAIN, USUBJID, IDVAR, IDVARVAL, QNAM, QLABEL, QVAL, QORIG, QEVAL

A subject has one record for each reported value of RACE1, RACE2 and RACEOTH, and none for a value that was not reported. QNAM is the source column's name, QLABEL is 'Race 1', 'Race 2' or 'Race, Other' respectively, and QVAL is the value exactly as entered. RDOMAIN is 'DM' and QORIG is 'Collected'; IDVAR, IDVARVAL and QEVAL have no value.

Read the source datasets from /app/input and save the completed dataset as /app/output/suppdm.csv.

prompts/sdtm-suppdm-metadata/conventions.md

Edit
12 lines

Following CDISC SDTM standards, use the provided DM_RAW dataset to create a SUPPDM dataset with one record per subject per supplemental qualifier.

The output dataset should contain the following columns in this order: STUDYID, RDOMAIN, USUBJID, IDVAR, IDVARVAL, QNAM, QLABEL, QVAL, QORIG, QEVAL

QNAM is RACE1, RACE2 or RACEOTH, and QLABEL is 'Race 1', 'Race 2' or 'Race, Other' respectively. RDOMAIN is 'DM' and QORIG is 'Collected'; IDVAR, IDVARVAL and QEVAL have no value.

Read the source datasets from /app/input and save the completed dataset as /app/output/suppdm.csv.

prompts/sdtm-suppdm-metadata/brief.md

Edit
8 lines

Following CDISC SDTM standards, use the provided DM_RAW dataset to create a SUPPDM dataset with one record per subject per supplemental qualifier.

The output dataset should contain the following columns in this order: STUDYID, RDOMAIN, USUBJID, IDVAR, IDVARVAL, QNAM, QLABEL, QVAL, QORIG, QEVAL

Read the source datasets from /app/input and save the completed dataset as /app/output/suppdm.csv.

yamaa code

Public calls generated from benchmark.yaml; results must match the expected output

R

Edit
3 lines
library(yamaa)yamaa_project("project.yaml")$spec("SUPPDM")$run()$output

Python

Edit
3 lines
import yamaayamaa.project("project.yaml").spec("SUPPDM").run().output

Solution without yamaa

Written from the full prompt and the inputs alone; CI checks it reproduces the expected output

solutions/sdtm-suppdm-metadata/result.R

Edit
34 lines
# Reference solution for the yamaa benchmark sdtm-suppdm-metadata (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_raw <- read_csv(  "/app/input/dm_raw.csv",  col_types = cols(.default = col_character()))labels <- c(RACE1 = "Race 1", RACE2 = "Race 2", RACEOTH = "Race, Other")suppdm <- bind_rows(lapply(names(labels), function(qnam) {  dm_raw |>    filter(!is.na(.data[[qnam]])) |>    transmute(      STUDYID,      RDOMAIN = "DM",      USUBJID,      IDVAR = NA_character_,      IDVARVAL = NA_character_,      QNAM = qnam,      QLABEL = labels[[qnam]],      QVAL = .data[[qnam]],      QORIG = "Collected",      QEVAL = NA_character_    )}))dir.create("/app/output", showWarnings = FALSE)write_csv(suppdm, "/app/output/suppdm.csv", na = "")

solutions/sdtm-suppdm-metadata/result.py

Edit
32 lines
# Reference solution for the yamaa benchmark sdtm-suppdm-metadata (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.from pathlib import Pathimport polars as pldm_raw = pl.read_csv("/app/input/dm_raw.csv", infer_schema=False)labels = {"RACE1": "Race 1", "RACE2": "Race 2", "RACEOTH": "Race, Other"}missing = pl.lit(None, dtype=pl.String)suppdm = pl.concat(    dm_raw.filter(pl.col(qnam).is_not_null()).select(        pl.col("STUDYID"),        pl.lit("DM").alias("RDOMAIN"),        pl.col("USUBJID"),        missing.alias("IDVAR"),        missing.alias("IDVARVAL"),        pl.lit(qnam).alias("QNAM"),        pl.lit(label).alias("QLABEL"),        pl.col(qnam).alias("QVAL"),        pl.lit("Collected").alias("QORIG"),        missing.alias("QEVAL"),    )    for qnam, label in labels.items())Path("/app/output").mkdir(exist_ok=True)suppdm.write_csv("/app/output/suppdm.csv")

solutions/sdtm-suppdm-metadata/result.sas

Edit
32 lines
/* opensas reference solution for the yamaa benchmark sdtm-suppdm-metadata.   Reads the benchmark inputs and derives the requested output.   Execute with the existing opensas runtime: opensas /app/output/result.sas. */data dm_raw;  length STUDYID USUBJID RACE1 RACE2 RACEOTH $1024;  infile "/app/input/dm_raw.csv" dsd dlm="," firstobs=2 truncover lrecl=32767;  input STUDYID : $char1024. USUBJID : $char1024. RACE1 : $char1024.    RACE2 : $char1024. RACEOTH : $char1024.;run;data result;  set dm_raw;  length RDOMAIN $2 IDVAR $8 IDVARVAL $40 QNAM $8 QLABEL $40 QVAL $200 QORIG $20    QEVAL $40;  RDOMAIN = 'DM';  QORIG = 'Collected';  if RACE1 ne '' then do;    QNAM = 'RACE1'; QLABEL = 'Race 1'; QVAL = RACE1; output;  end;  if RACE2 ne '' then do;    QNAM = 'RACE2'; QLABEL = 'Race 2'; QVAL = RACE2; output;  end;  if RACEOTH ne '' then do;    QNAM = 'RACEOTH'; QLABEL = 'Race, Other'; QVAL = RACEOTH; output;  end;run;proc sql;  create table final as select STUDYID, RDOMAIN, USUBJID, IDVAR, IDVARVAL, QNAM,    QLABEL, QVAL, QORIG, QEVAL from result;quit;proc export data=final outfile="/app/output/suppdm.csv" dbms=csv replace; run;