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: submit the laboratory results (LBTESTCD, LBTEST, LBORRES)
with a data-definition document that describes the results the site tests
apart from all the others.
Input: spec.yaml reads the laboratory results, one row per test per
subject, and project.yaml submits the dataset with the study's annotated
case report form.
Variables:
LBTESTCDandLBTESTare the test's code and name.LBORRESis the result as reported, in the reporting laboratory's units.
Note: the site tests the pregnancy (HCG) and urine pH (PH) samples
and records them on page 14 of the case report form; the central laboratory
reports every other test. The document describes LBORRES once for the tests
other than those two, as transmitted by the central laboratory, and once for
the two, as collected by the investigator. The two descriptions select no
common row.
Inputs
Under review1 source fileinput/lab.csv
Edit4 rows| STUDYID | USUBJID | LBTESTCD | LBTEST | LBORRES |
|---|---|---|---|---|
| LAB02 | ALT | Alanine Aminotransferase | 24 | |
| LAB02 | CREAT | Creatinine | 0.9 | |
| LAB02 | HCG | Choriogonadotropin Beta | NEGATIVE | |
| LAB02 | PH | pH | 6.0 |
Expected output
Under review4 expected rowsexpected/define.xml
EditDefine-XMLDefine-XML 2.1.11: LAB02
Example study testing most samples at a central laboratory; LAB-02; SDTMIG 3.4
| Dataset | Description | Class | Structure | Purpose | Keys | Documentation | Location |
|---|---|---|---|---|---|---|---|
| LB | Laboratory Test Results | FINDINGS | One record per lab test per subject | Tabulation | STUDYID, USUBJID, LBTESTCD | lb.csv |
LB
| Variable | Label / Description | Type | Role | Length or Display Format | Controlled Terms or ISO Format | Origin / Source / Method / Comment |
|---|---|---|---|---|---|---|
| DOMAIN | Domain Abbreviation | text | Identifier | 2 | Assigned; Sponsor | |
| STUDYID | Study Identifier | text | Identifier | 5 | Protocol; Sponsor | |
| USUBJID | Unique Subject Identifier | text | Identifier | 9 | Assigned; Sponsor | |
| LBTESTCD | Lab Test or Examination Short Name | text | Topic | 5 | Protocol; Sponsor | |
| LBTEST | Lab Test or Examination Name | text | Synonym Qualifier | 24 | Protocol; Sponsor | |
| LBORRES | Result or Finding in Original Units | text | Result Qualifier | 8 | Collected; Vendor Collected; Investigator; Annotated Case Report Form (acrf.pdf); pages 14 |
| Where Condition | Variable | Label / Description | Type | Role | Length or Display Format | Controlled Terms or ISO Format | Origin / Source / Method / Comment |
|---|---|---|---|---|---|---|---|
| LBTESTCD not in HCG, PH | LBORRES | Central Laboratory Result | text | Result Qualifier | 8 | Collected; Vendor | |
| LBTESTCD in HCG, PH | LBORRES | Site Laboratory Result | text | Result Qualifier | 8 | Collected; Investigator; Annotated Case Report Form (acrf.pdf); pages 14 |
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="LAB02.sdtm.Define-XML_2.1" CreationDateTime="2026-09-11T00:00:00" SourceSystem="yamaa" SourceSystemVersion="1.0" def:Context="Other">
<Study OID="STDY.LAB02">
<GlobalVariables>
<StudyName>LAB02</StudyName>
<StudyDescription>Example study testing most samples at a central laboratory</StudyDescription>
<ProtocolName>LAB-02</ProtocolName>
</GlobalVariables>
<MetaDataVersion OID="MDV.LAB02.sdtm" Name="LAB02 sdtm metadata" def:DefineVersion="2.1.11">
<def:Standards>
<def:Standard OID="STD.SDTMIG" Name="SDTMIG" Type="IG" Version="3.4" Status="Final"/>
</def:Standards>
<def:AnnotatedCRF>
<def:DocumentRef leafID="LF.acrf"/>
</def:AnnotatedCRF>
<def:ValueListDef OID="VL.LB.LBORRES">
<ItemRef ItemOID="IT.LB.LBORRES.CENTRAL" OrderNumber="1" Mandatory="No" Role="Result Qualifier">
<def:WhereClauseRef WhereClauseOID="WC.LB.LBORRES.CENTRAL"/>
</ItemRef>
<ItemRef ItemOID="IT.LB.LBORRES.SITE" OrderNumber="2" Mandatory="No" Role="Result Qualifier">
<def:WhereClauseRef WhereClauseOID="WC.LB.LBORRES.SITE"/>
</ItemRef>
</def:ValueListDef>
<def:WhereClauseDef OID="WC.LB.LBORRES.CENTRAL">
<RangeCheck Comparator="NOTIN" SoftHard="Soft" def:ItemOID="IT.LB.LBTESTCD">
<CheckValue>HCG</CheckValue>
<CheckValue>PH</CheckValue>
</RangeCheck>
</def:WhereClauseDef>
<def:WhereClauseDef OID="WC.LB.LBORRES.SITE">
<RangeCheck Comparator="IN" SoftHard="Soft" def:ItemOID="IT.LB.LBTESTCD">
<CheckValue>HCG</CheckValue>
<CheckValue>PH</CheckValue>
</RangeCheck>
</def:WhereClauseDef>
<ItemGroupDef OID="IG.LB" Name="LB" Domain="LB" Purpose="Tabulation" SASDatasetName="LB" Repeating="Yes" IsReferenceData="No" def:Structure="One record per lab test per subject" def:ArchiveLocationID="LF.LB" def:StandardOID="STD.SDTMIG">
<Description>
<TranslatedText xml:lang="en">Laboratory Test Results</TranslatedText>
</Description>
<ItemRef ItemOID="IT.LB.DOMAIN" OrderNumber="1" Mandatory="Yes" Role="Identifier"/>
<ItemRef ItemOID="IT.LB.STUDYID" OrderNumber="2" Mandatory="Yes" KeySequence="1" Role="Identifier"/>
<ItemRef ItemOID="IT.LB.USUBJID" OrderNumber="3" Mandatory="Yes" KeySequence="2" Role="Identifier"/>
<ItemRef ItemOID="IT.LB.LBTESTCD" OrderNumber="4" Mandatory="Yes" KeySequence="3" Role="Topic"/>
<ItemRef ItemOID="IT.LB.LBTEST" OrderNumber="5" Mandatory="Yes" Role="Synonym Qualifier"/>
<ItemRef ItemOID="IT.LB.LBORRES" OrderNumber="6" Mandatory="No" Role="Result Qualifier"/>
<def:Class Name="FINDINGS"/>
<def:leaf ID="LF.LB" xlink:href="lb.csv">
<def:title>lb.csv</def:title>
</def:leaf>
</ItemGroupDef>
<ItemDef OID="IT.LB.DOMAIN" Name="DOMAIN" DataType="text" Length="2" SASFieldName="DOMAIN">
<Description>
<TranslatedText xml:lang="en">Domain Abbreviation</TranslatedText>
</Description>
<def:Origin Type="Assigned" Source="Sponsor"/>
</ItemDef>
<ItemDef OID="IT.LB.STUDYID" Name="STUDYID" DataType="text" Length="5" SASFieldName="STUDYID">
<Description>
<TranslatedText xml:lang="en">Study Identifier</TranslatedText>
</Description>
<def:Origin Type="Protocol" Source="Sponsor"/>
</ItemDef>
<ItemDef OID="IT.LB.USUBJID" Name="USUBJID" DataType="text" Length="9" SASFieldName="USUBJID">
<Description>
<TranslatedText xml:lang="en">Unique Subject Identifier</TranslatedText>
</Description>
<def:Origin Type="Assigned" Source="Sponsor"/>
</ItemDef>
<ItemDef OID="IT.LB.LBTESTCD" Name="LBTESTCD" DataType="text" Length="5" SASFieldName="LBTESTCD">
<Description>
<TranslatedText xml:lang="en">Lab Test or Examination Short Name</TranslatedText>
</Description>
<def:Origin Type="Protocol" Source="Sponsor"/>
</ItemDef>
<ItemDef OID="IT.LB.LBTEST" Name="LBTEST" DataType="text" Length="24" SASFieldName="LBTEST">
<Description>
<TranslatedText xml:lang="en">Lab Test or Examination Name</TranslatedText>
</Description>
<def:Origin Type="Protocol" Source="Sponsor"/>
</ItemDef>
<ItemDef OID="IT.LB.LBORRES" Name="LBORRES" DataType="text" Length="8" SASFieldName="LBORRES">
<Description>
<TranslatedText xml:lang="en">Result or Finding in Original Units</TranslatedText>
</Description>
<def:Origin Type="Collected" Source="Vendor"/>
<def:Origin Type="Collected" Source="Investigator">
<def:DocumentRef leafID="LF.acrf">
<def:PDFPageRef PageRefs="14" Type="PhysicalRef"/>
</def:DocumentRef>
</def:Origin>
<def:ValueListRef ValueListOID="VL.LB.LBORRES"/>
</ItemDef>
<ItemDef OID="IT.LB.LBORRES.CENTRAL" Name="LBORRES" DataType="text" Length="8" SASFieldName="LBORRES">
<Description>
<TranslatedText xml:lang="en">Central Laboratory Result</TranslatedText>
</Description>
<def:Origin Type="Collected" Source="Vendor"/>
</ItemDef>
<ItemDef OID="IT.LB.LBORRES.SITE" Name="LBORRES" DataType="text" Length="8" SASFieldName="LBORRES">
<Description>
<TranslatedText xml:lang="en">Site Laboratory Result</TranslatedText>
</Description>
<def:Origin Type="Collected" Source="Investigator">
<def:DocumentRef leafID="LF.acrf">
<def:PDFPageRef PageRefs="14" Type="PhysicalRef"/>
</def:DocumentRef>
</def:Origin>
</ItemDef>
<def:leaf ID="LF.acrf" xlink:href="acrf.pdf">
<def:title>Annotated Case Report Form</def:title>
</def:leaf>
</MetaDataVersion>
</Study>
</ODM>
expected/lb.csv
Edit4 rows| DOMAIN | STUDYID | USUBJID | LBTESTCD | LBTEST | LBORRES |
|---|---|---|---|---|---|
| LB | LAB02 | ALT | Alanine Aminotransferase | 24 | |
| LB | LAB02 | CREAT | Creatinine | 0.9 | |
| LB | LAB02 | HCG | Choriogonadotropin Beta | NEGATIVE | |
| LB | LAB02 | PH | pH | 6.0 |
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 | Assigned | Req | Set constant value "LB". | SDTM | 1 | ||
| STUDYID | Study Identifier | Char | 5 | Protocol | Req | Copy value from LAB.STUDYID. | SDTM | 2 | ||
| USUBJID | Unique Subject Identifier | Char | 9 | Assigned | Req | Copy value from LAB.USUBJID. | SDTM | 3 | ||
| LBTESTCD | Lab Test or Examination Short Name | Char | 5 | Protocol | Req | Copy value from LAB.LBTESTCD. | SDTM | 4 | ||
| LBTEST | Lab Test or Examination Name | Char | 24 | Protocol | Req | Copy value from LAB.LBTEST. | SDTM | 5 | ||
| LBORRES | Result or Finding in Original Units | Char | 8 | Collected, Collected | Exp | Copy value from LAB.LBORRES. | SDTM | 6 |
| 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