As a clinical trial statistician or programmer, answer two short questions in Your review: the task and the inputs and outputs. Agreeing with both approves this benchmark; disagreeing with either 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: write the demographics dataset of sdtm-dm-metadata as a
Dataset-JSON 1.1 file in the standard's newline-delimited representation,
dm.ndjson, beside the data-definition document that points at it.
Input: the sdtm-dm-metadata specification, project and input, with the
project's sdtm section setting transport: dataset_ndjson in place of
transport: dataset_json.
Variables: as sdtm-dm-metadata declares them; the dataset's rows, its
column metadata and its entry in the data-definition document are unchanged.
USUBJIDjoins the study, site, and subject identifiers with hyphens; an identifier longer than 30 characters stops the run rather than being shortened.SITEIDis the collected site identifier.AGEis the collected age in whole years, between 0 and 120; missing when not collected.AGEUis fixed toYEARS, since age is collected in whole years.SEXis the collected sex, one ofF,M, orU.COUNTRYis the collected three-letter country code.
Note: the first line of dm.ndjson is the metadata object of
sdtm-dm-metadata's dm.json without its rows, written on one line, and
each later line is one row, written exactly as dm.json writes it. A
receiver reads the file one JSON text at a time; the content is the same
dataset, and the document's leaf names dm.ndjson.
Inputs
Under review1 source fileinput/dm_raw.csv
Edit3 rows| STUDYID | SUBJID | SITEID | AGE | SEX | COUNTRY |
|---|---|---|---|---|---|
| CATH | 0001 | UCSD | 34 | F | USA |
| CATH | 0002 | UCSD | 67 | M | USA |
| CATH | 0003 | MCGILL | 52 | F | CAN |
Expected output
Under review3 expected rowsexpected/define.xml
EditDefine-XMLDefine-XML 2.1.11: STUDY01
Example study demonstrating the Define-XML metadata contract; STUDY-01; SDTMIG 3.4; CDISC/NCI 2023-12-15
| Dataset | Description | Class | Structure | Purpose | Keys | Documentation | Location |
|---|---|---|---|---|---|---|---|
| DM | Demographics | SPECIAL PURPOSE | One record per subject | Tabulation | STUDYID, USUBJID | Demographics are described in section 2.1 of the reviewer's guide. Study Data Reviewer's Guide (csdrg.pdf) | dm.ndjson |
DM
| Variable | Label / Description | Type | Role | Length or Display Format | Controlled Terms or ISO Format | Origin / Source / Method / Comment |
|---|---|---|---|---|---|---|
| DOMAIN | Domain Abbreviation | text | Identifier | 2 | Domain Abbreviation (DM) (CL.DOMAIN) DM = Demographics | Assigned; Sponsor |
| STUDYID | Study Identifier | text | Identifier | 4 | Protocol; Sponsor | |
| USUBJID | Unique Subject Identifier | text | Identifier | 16 | Derived; Sponsor Study identifier, site identifier, and subject identifier joined by hyphens. | |
| SUBJID | Subject Identifier for the Study | text | Topic | 4 | Collected; Investigator; Annotated Case Report Form (acrf.pdf); pages 1 | |
| SITEID | Study Site Identifier | text | Record Qualifier | 6 | Collected; Investigator; Annotated Case Report Form (acrf.pdf); pages 1 | |
| AGE | Age | integer | Record Qualifier | 3 | Collected; Investigator; Annotated Case Report Form (acrf.pdf); pages 1 | |
| AGEU | Age Units | text | Variable Qualifier | 5 | Age Unit (CL.AGEU) YEARS | Assigned; Sponsor Defaulted to YEARS because age is collected in whole years. |
| SEX | Sex | text | Record Qualifier | 1 | Sex (CL.SEX) F = Female M = Male U = Unknown | Collected; Investigator; Annotated Case Report Form (acrf.pdf); pages 1 |
| COUNTRY | Country | text | Record Qualifier | 3 | Country Codes (CL.COUNTRY) ISO 3166 2020 | Collected; Investigator; Annotated Case Report Form (acrf.pdf); pages 1 |
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="www.example.org/STUDY01/1/Define-XML_2.1" CreationDateTime="2026-09-11T00:00:00" Originator="Example Sponsor" SourceSystem="yamaa" SourceSystemVersion="1.0" def:Context="Submission">
<Study OID="STDY.STUDY01">
<GlobalVariables>
<StudyName>STUDY01</StudyName>
<StudyDescription>Example study demonstrating the Define-XML metadata contract</StudyDescription>
<ProtocolName>STUDY-01</ProtocolName>
</GlobalVariables>
<MetaDataVersion OID="MDV.STUDY01.1" Name="Study STUDY01, Data Definitions" Description="Tabulation data definitions for STUDY01" 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:SupplementalDoc>
<def:DocumentRef leafID="LF.csdrg"/>
</def:SupplementalDoc>
<ItemGroupDef OID="IG.DM" Name="DM" Domain="DM" Purpose="Tabulation" SASDatasetName="DM" Repeating="No" IsReferenceData="No" def:Structure="One record per subject" def:ArchiveLocationID="LF.DM" def:StandardOID="STD.SDTMIG" def:CommentOID="COM.DM">
<Description>
<TranslatedText xml:lang="en">Demographics</TranslatedText>
</Description>
<ItemRef ItemOID="IT.DM.DOMAIN" OrderNumber="1" Mandatory="Yes" Role="Identifier"/>
<ItemRef ItemOID="IT.DM.STUDYID" OrderNumber="2" Mandatory="Yes" KeySequence="1" Role="Identifier"/>
<ItemRef ItemOID="IT.DM.USUBJID" OrderNumber="3" Mandatory="Yes" KeySequence="2" Role="Identifier" MethodOID="MT.DM.USUBJID"/>
<ItemRef ItemOID="IT.DM.SUBJID" OrderNumber="4" Mandatory="Yes" Role="Topic"/>
<ItemRef ItemOID="IT.DM.SITEID" OrderNumber="5" Mandatory="Yes" Role="Record Qualifier"/>
<ItemRef ItemOID="IT.DM.AGE" OrderNumber="6" Mandatory="No" Role="Record Qualifier"/>
<ItemRef ItemOID="IT.DM.AGEU" OrderNumber="7" Mandatory="No" Role="Variable Qualifier"/>
<ItemRef ItemOID="IT.DM.SEX" OrderNumber="8" Mandatory="Yes" Role="Record Qualifier"/>
<ItemRef ItemOID="IT.DM.COUNTRY" OrderNumber="9" Mandatory="Yes" Role="Record Qualifier"/>
<def:Class Name="SPECIAL PURPOSE"/>
<def:leaf ID="LF.DM" xlink:href="dm.ndjson">
<def:title>dm.ndjson</def:title>
</def:leaf>
</ItemGroupDef>
<ItemDef OID="IT.DM.DOMAIN" Name="DOMAIN" DataType="text" Length="2" SASFieldName="DOMAIN">
<Description>
<TranslatedText xml:lang="en">Domain Abbreviation</TranslatedText>
</Description>
<CodeListRef CodeListOID="CL.DOMAIN"/>
<def:Origin Type="Assigned" Source="Sponsor"/>
</ItemDef>
<ItemDef OID="IT.DM.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.DM.USUBJID" Name="USUBJID" DataType="text" Length="16" SASFieldName="USUBJID">
<Description>
<TranslatedText xml:lang="en">Unique Subject Identifier</TranslatedText>
</Description>
<def:Origin Type="Derived" Source="Sponsor"/>
</ItemDef>
<ItemDef OID="IT.DM.SUBJID" Name="SUBJID" DataType="text" Length="4" SASFieldName="SUBJID">
<Description>
<TranslatedText xml:lang="en">Subject Identifier for the Study</TranslatedText>
</Description>
<def:Origin Type="Collected" Source="Investigator">
<def:DocumentRef leafID="LF.acrf">
<def:PDFPageRef PageRefs="1" Type="PhysicalRef"/>
</def:DocumentRef>
</def:Origin>
</ItemDef>
<ItemDef OID="IT.DM.SITEID" Name="SITEID" DataType="text" Length="6" SASFieldName="SITEID">
<Description>
<TranslatedText xml:lang="en">Study Site Identifier</TranslatedText>
</Description>
<def:Origin Type="Collected" Source="Investigator">
<def:DocumentRef leafID="LF.acrf">
<def:PDFPageRef PageRefs="1" Type="PhysicalRef"/>
</def:DocumentRef>
</def:Origin>
</ItemDef>
<ItemDef OID="IT.DM.AGE" Name="AGE" DataType="integer" Length="3" SASFieldName="AGE">
<Description>
<TranslatedText xml:lang="en">Age</TranslatedText>
</Description>
<def:Origin Type="Collected" Source="Investigator">
<def:DocumentRef leafID="LF.acrf">
<def:PDFPageRef PageRefs="1" Type="PhysicalRef"/>
</def:DocumentRef>
</def:Origin>
</ItemDef>
<ItemDef OID="IT.DM.AGEU" Name="AGEU" DataType="text" Length="5" SASFieldName="AGEU" def:CommentOID="COM.DM.AGEU">
<Description>
<TranslatedText xml:lang="en">Age Units</TranslatedText>
</Description>
<CodeListRef CodeListOID="CL.AGEU"/>
<def:Origin Type="Assigned" Source="Sponsor"/>
</ItemDef>
<ItemDef OID="IT.DM.SEX" Name="SEX" DataType="text" Length="1" SASFieldName="SEX">
<Description>
<TranslatedText xml:lang="en">Sex</TranslatedText>
</Description>
<CodeListRef CodeListOID="CL.SEX"/>
<def:Origin Type="Collected" Source="Investigator">
<def:DocumentRef leafID="LF.acrf">
<def:PDFPageRef PageRefs="1" Type="PhysicalRef"/>
</def:DocumentRef>
</def:Origin>
</ItemDef>
<ItemDef OID="IT.DM.COUNTRY" Name="COUNTRY" DataType="text" Length="3" SASFieldName="COUNTRY">
<Description>
<TranslatedText xml:lang="en">Country</TranslatedText>
</Description>
<CodeListRef CodeListOID="CL.COUNTRY"/>
<def:Origin Type="Collected" Source="Investigator">
<def:DocumentRef leafID="LF.acrf">
<def:PDFPageRef PageRefs="1" Type="PhysicalRef"/>
</def:DocumentRef>
</def:Origin>
</ItemDef>
<CodeList OID="CL.DOMAIN" Name="Domain Abbreviation (DM)" DataType="text" def:StandardOID="STD.CT_SDTM" SASFormatName="$DMDOMAI">
<CodeListItem CodedValue="DM">
<Decode>
<TranslatedText xml:lang="en">Demographics</TranslatedText>
</Decode>
<Alias Context="nci:ExtCodeID" Name="C49572"/>
</CodeListItem>
<Alias Context="nci:ExtCodeID" Name="C66734"/>
</CodeList>
<CodeList OID="CL.AGEU" Name="Age Unit" DataType="text" def:StandardOID="STD.CT_SDTM">
<EnumeratedItem CodedValue="YEARS">
<Alias Context="nci:ExtCodeID" Name="C29848"/>
</EnumeratedItem>
<Alias Context="nci:ExtCodeID" Name="C66781"/>
</CodeList>
<CodeList OID="CL.SEX" Name="Sex" DataType="text" def:StandardOID="STD.CT_SDTM" SASFormatName="$SEX">
<CodeListItem CodedValue="F">
<Decode>
<TranslatedText xml:lang="en">Female</TranslatedText>
</Decode>
<Alias Context="nci:ExtCodeID" Name="C16576"/>
</CodeListItem>
<CodeListItem CodedValue="M">
<Decode>
<TranslatedText xml:lang="en">Male</TranslatedText>
</Decode>
<Alias Context="nci:ExtCodeID" Name="C20197"/>
</CodeListItem>
<CodeListItem CodedValue="U">
<Decode>
<TranslatedText xml:lang="en">Unknown</TranslatedText>
</Decode>
<Alias Context="nci:ExtCodeID" Name="C17998"/>
</CodeListItem>
<Alias Context="nci:ExtCodeID" Name="C66731"/>
</CodeList>
<CodeList OID="CL.COUNTRY" Name="Country Codes" DataType="text" def:StandardOID="STD.CT_SDTM">
<ExternalCodeList Dictionary="ISO 3166" Version="2020" href="https://www.iso.org/iso-3166-country-codes.html"/>
</CodeList>
<MethodDef OID="MT.DM.USUBJID" Name="DM.USUBJID" Type="Computation">
<Description>
<TranslatedText xml:lang="en">Study identifier, site identifier, and subject identifier joined by hyphens.</TranslatedText>
</Description>
</MethodDef>
<def:CommentDef OID="COM.DM">
<Description>
<TranslatedText xml:lang="en">Demographics are described in section 2.1 of the reviewer's guide.</TranslatedText>
</Description>
<def:DocumentRef leafID="LF.csdrg"/>
</def:CommentDef>
<def:CommentDef OID="COM.DM.AGEU">
<Description>
<TranslatedText xml:lang="en">Defaulted to YEARS because age is collected in whole years.</TranslatedText>
</Description>
</def:CommentDef>
<def:leaf ID="LF.acrf" xlink:href="acrf.pdf">
<def:title>Annotated Case Report Form</def:title>
</def:leaf>
<def:leaf ID="LF.csdrg" xlink:href="csdrg.pdf">
<def:title>Study Data Reviewer's Guide</def:title>
</def:leaf>
</MetaDataVersion>
</Study>
</ODM>
expected/dm.csv
Edit3 rows| DOMAIN | STUDYID | USUBJID | SUBJID | SITEID | AGE | AGEU | SEX | COUNTRY |
|---|---|---|---|---|---|---|---|---|
| DM | CATH | 0001 | UCSD | 34 | YEARS | F | USA | |
| DM | CATH | 0002 | UCSD | 67 | YEARS | M | USA | |
| DM | CATH | 0003 | MCGILL | 52 | YEARS | F | CAN |
expected/dm.ndjson
Edit{"datasetJSONCreationDateTime": "2026-09-11T00:00:00", "datasetJSONVersion": "1.1.0", "fileOID": "www.example.org/STUDY01/1/Define-XML_2.1.DM", "originator": "Example Sponsor", "sourceSystem": {"name": "yamaa", "version": "1.0"}, "studyOID": "STDY.STUDY01", "metaDataVersionOID": "MDV.STUDY01.1", "metaDataRef": "define.xml", "itemGroupOID": "IG.DM", "records": 3, "name": "DM", "label": "Demographics", "columns": [{"itemOID": "IT.DM.DOMAIN", "name": "DOMAIN", "label": "Domain Abbreviation", "dataType": "string", "length": 2}, {"itemOID": "IT.DM.STUDYID", "name": "STUDYID", "label": "Study Identifier", "dataType": "string", "length": 4, "keySequence": 1}, {"itemOID": "IT.DM.USUBJID", "name": "USUBJID", "label": "Unique Subject Identifier", "dataType": "string", "length": 16, "keySequence": 2}, {"itemOID": "IT.DM.SUBJID", "name": "SUBJID", "label": "Subject Identifier for the Study", "dataType": "string", "length": 4}, {"itemOID": "IT.DM.SITEID", "name": "SITEID", "label": "Study Site Identifier", "dataType": "string", "length": 6}, {"itemOID": "IT.DM.AGE", "name": "AGE", "label": "Age", "dataType": "integer", "length": 3}, {"itemOID": "IT.DM.AGEU", "name": "AGEU", "label": "Age Units", "dataType": "string", "length": 5}, {"itemOID": "IT.DM.SEX", "name": "SEX", "label": "Sex", "dataType": "string", "length": 1}, {"itemOID": "IT.DM.COUNTRY", "name": "COUNTRY", "label": "Country", "dataType": "string", "length": 3}]}
["DM", "CATH", "CATH-UCSD-0001", "0001", "UCSD", 34, "YEARS", "F", "USA"]
["DM", "CATH", "CATH-UCSD-0002", "0002", "UCSD", 67, "YEARS", "M", "USA"]
["DM", "CATH", "CATH-MCGILL-0003", "0003", "MCGILL", 52, "YEARS", "F", "CAN"]
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 | 2 | Domain Abbreviation (DM) | Assigned | Req | Set constant value "DM". | SDTM | 1 | |
| STUDYID | Study Identifier | Char | 20 | Protocol | Req | Copy value from DM_RAW.STUDYID. | SDTM | 2 | ||
| USUBJID | Unique Subject Identifier | Char | Derived | Req | Study identifier, site identifier, and subject identifier joined by hyphens. | SDTM | 3 | |||
| SUBJID | Subject Identifier for the Study | Char | 10 | Collected | Req | Copy value from DM_RAW.SUBJID. | SDTM | 4 | ||
| SITEID | Study Site Identifier | Char | 10 | Collected | Req | Copy value from DM_RAW.SITEID. | SDTM | 5 | ||
| AGE | Age | Num | 3 | Collected | Exp | Copy value from DM_RAW.AGE. | SDTM | 6 | ||
| AGEU | Age Units | Char | 5 | Age Unit | Assigned | Exp | Set constant value "YEARS". | SDTM | 7 | Defaulted to YEARS because age is collected in whole years. |
| SEX | Sex | Char | 1 | Sex | Collected | Req | Copy value from DM_RAW.SEX. | SDTM | 8 | |
| COUNTRY | Country | Char | 3 | Country Codes (ISO 3166, version 2020) | Collected | Req | Copy value from DM_RAW.COUNTRY. | SDTM | 9 |
| Codelist ID | Name | Value | Decode | Codelist NCI alias | Value NCI alias | Extensible | Extended value | SAS format | Dictionary | Version |
|---|---|---|---|---|---|---|---|---|---|---|
| DOMAIN | Domain Abbreviation (DM) | DM | Demographics | C66734 | C49572 | No | $DMDOMAI | |||
| AGEU | Age Unit | YEARS | C66781 | C29848 | No | |||||
| SEX | Sex | F | Female | C66731 | C16576 | No | $SEX | |||
| SEX | Sex | M | Male | C66731 | C20197 | No | $SEX | |||
| SEX | Sex | U | Unknown | C66731 | C17998 | No | $SEX | |||
| COUNTRY | Country Codes | No | ISO 3166 | 2020 |
| 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 |
yamaa