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: Preserve the collected cell type result and report its standardized form in the morphology domain.
Input: Cell type findings and collection dates from a morphology form.
Variables:
MOSEQidentifies a finding within a subject.MOTESTCDandMOTESTidentify the cell type assessment.MOORRESretains the collected result.MOSTRESCreports NORMAL or ABNORMAL.MODTCretains the collection date.
Note: project.yaml declares SDTMIG 3.3. The data-definition document
records that guide and points to the SAS Transport version 5 dataset.
Inputs
Under review1 source fileinput/morphology.csv
Edit2 rows| STUDYID | USUBJID | SEQ | RESULT | DATE |
|---|---|---|---|---|
| CATH | 1 | normal | 2025-01-08 | |
| CATH | 1 | abnormal | 2025-01-09 |
Expected output
Under review2 expected rowsexpected/define.xml
EditDefine-XMLDefine-XML 2.1.11: CATH
Morphology; CATH-01; SDTMIG 3.3
| Dataset | Description | Class | Structure | Purpose | Keys | Documentation | Location |
|---|---|---|---|---|---|---|---|
| MO | Morphology | FINDINGS | One record per subject per test | Tabulation | STUDYID, USUBJID, MOSEQ | mo.xpt |
MO
| 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 | 4 | Protocol; Sponsor | |
| USUBJID | Unique Subject Identifier | text | Identifier | 7 | Assigned; Sponsor | |
| MOSEQ | Sequence Number | integer | Identifier | 8 | Assigned; Sponsor | |
| MOTESTCD | Morphology Test Short Name | text | Topic | 8 | Assigned; Sponsor | |
| MOTEST | Morphology Test Name | text | Synonym Qualifier | 9 | Assigned; Sponsor | |
| MOORRES | Result or Finding in Original Units | text | Result Qualifier | 8 | Collected; Investigator; Annotated Case Report Form (acrf.pdf); pages 1 | |
| MOSTRESC | Character Result/Finding in Std Format | text | Result Qualifier | 8 | Derived; Sponsor Standardize the collected cell type result. | |
| MODTC | Date/Time of Collection | date | Timing | ISO 8601 | 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="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>Morphology</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.3" Status="Final"/>
</def:Standards>
<def:AnnotatedCRF>
<def:DocumentRef leafID="LF.acrf"/>
</def:AnnotatedCRF>
<ItemGroupDef OID="IG.MO" Name="MO" Domain="MO" Purpose="Tabulation" SASDatasetName="MO" Repeating="Yes" IsReferenceData="No" def:Structure="One record per subject per test" def:ArchiveLocationID="LF.MO" def:StandardOID="STD.SDTMIG">
<Description>
<TranslatedText xml:lang="en">Morphology</TranslatedText>
</Description>
<ItemRef ItemOID="IT.MO.DOMAIN" OrderNumber="1" Mandatory="Yes" Role="Identifier"/>
<ItemRef ItemOID="IT.MO.STUDYID" OrderNumber="2" Mandatory="Yes" KeySequence="1" Role="Identifier"/>
<ItemRef ItemOID="IT.MO.USUBJID" OrderNumber="3" Mandatory="Yes" KeySequence="2" Role="Identifier"/>
<ItemRef ItemOID="IT.MO.MOSEQ" OrderNumber="4" Mandatory="Yes" KeySequence="3" Role="Identifier"/>
<ItemRef ItemOID="IT.MO.MOTESTCD" OrderNumber="5" Mandatory="Yes" Role="Topic"/>
<ItemRef ItemOID="IT.MO.MOTEST" OrderNumber="6" Mandatory="Yes" Role="Synonym Qualifier"/>
<ItemRef ItemOID="IT.MO.MOORRES" OrderNumber="7" Mandatory="No" Role="Result Qualifier"/>
<ItemRef ItemOID="IT.MO.MOSTRESC" OrderNumber="8" Mandatory="No" Role="Result Qualifier" MethodOID="MT.MO.MOSTRESC"/>
<ItemRef ItemOID="IT.MO.MODTC" OrderNumber="9" Mandatory="No" Role="Timing"/>
<def:Class Name="FINDINGS"/>
<def:leaf ID="LF.MO" xlink:href="mo.xpt">
<def:title>mo.xpt</def:title>
</def:leaf>
</ItemGroupDef>
<ItemDef OID="IT.MO.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.MO.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.MO.USUBJID" Name="USUBJID" DataType="text" Length="7" SASFieldName="USUBJID">
<Description>
<TranslatedText xml:lang="en">Unique Subject Identifier</TranslatedText>
</Description>
<def:Origin Type="Assigned" Source="Sponsor"/>
</ItemDef>
<ItemDef OID="IT.MO.MOSEQ" Name="MOSEQ" DataType="integer" Length="8" SASFieldName="MOSEQ">
<Description>
<TranslatedText xml:lang="en">Sequence Number</TranslatedText>
</Description>
<def:Origin Type="Assigned" Source="Sponsor"/>
</ItemDef>
<ItemDef OID="IT.MO.MOTESTCD" Name="MOTESTCD" DataType="text" Length="8" SASFieldName="MOTESTCD">
<Description>
<TranslatedText xml:lang="en">Morphology Test Short Name</TranslatedText>
</Description>
<def:Origin Type="Assigned" Source="Sponsor"/>
</ItemDef>
<ItemDef OID="IT.MO.MOTEST" Name="MOTEST" DataType="text" Length="9" SASFieldName="MOTEST">
<Description>
<TranslatedText xml:lang="en">Morphology Test Name</TranslatedText>
</Description>
<def:Origin Type="Assigned" Source="Sponsor"/>
</ItemDef>
<ItemDef OID="IT.MO.MOORRES" Name="MOORRES" DataType="text" Length="8" SASFieldName="MOORRES">
<Description>
<TranslatedText xml:lang="en">Result or Finding in Original Units</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.MO.MOSTRESC" Name="MOSTRESC" DataType="text" Length="8" SASFieldName="MOSTRESC">
<Description>
<TranslatedText xml:lang="en">Character Result/Finding in Std Format</TranslatedText>
</Description>
<def:Origin Type="Derived" Source="Sponsor"/>
</ItemDef>
<ItemDef OID="IT.MO.MODTC" Name="MODTC" DataType="date" SASFieldName="MODTC">
<Description>
<TranslatedText xml:lang="en">Date/Time of Collection</TranslatedText>
</Description>
<def:Origin Type="Collected" Source="Investigator">
<def:DocumentRef leafID="LF.acrf">
<def:PDFPageRef PageRefs="1" Type="PhysicalRef"/>
</def:DocumentRef>
</def:Origin>
</ItemDef>
<MethodDef OID="MT.MO.MOSTRESC" Name="MO.MOSTRESC" Type="Computation">
<Description>
<TranslatedText xml:lang="en">Standardize the collected cell type result.</TranslatedText>
</Description>
</MethodDef>
<def:leaf ID="LF.acrf" xlink:href="acrf.pdf">
<def:title>Annotated Case Report Form</def:title>
</def:leaf>
</MetaDataVersion>
</Study>
</ODM>
expected/mo.csv
Edit2 rows| DOMAIN | STUDYID | USUBJID | MOSEQ | MOTESTCD | MOTEST | MOORRES | MOSTRESC | MODTC |
|---|---|---|---|---|---|---|---|---|
| MO | CATH | 1 | CELLTYPE | Cell Type | normal | NORMAL | 2025-01-08 | |
| MO | CATH | 1 | CELLTYPE | Cell Type | abnormal | ABNORMAL | 2025-01-09 |
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 | 80 | Assigned | Req | Set constant value "MO". | SDTM | 1 | ||
| STUDYID | Study Identifier | Char | 80 | Protocol | Req | Copy value from MORPH.STUDYID. | SDTM | 2 | ||
| USUBJID | Unique Subject Identifier | Char | 80 | Assigned | Req | Copy value from MORPH.USUBJID. | SDTM | 3 | ||
| MOSEQ | Sequence Number | Num | 8 | Assigned | Req | Copy value from MORPH.SEQ. | SDTM | 4 | ||
| MOTESTCD | Morphology Test Short Name | Char | 80 | Assigned | Req | Set constant value "CELLTYPE". | SDTM | 5 | ||
| MOTEST | Morphology Test Name | Char | 80 | Assigned | Req | Set constant value "Cell Type". | SDTM | 6 | ||
| MOORRES | Result or Finding in Original Units | Char | 80 | Collected | Exp | Copy value from MORPH.RESULT. | SDTM | 7 | ||
| MOSTRESC | Character Result/Finding in Std Format | Char | 80 | Derived | Exp | Standardize the collected cell type result. | SDTM | 8 | ||
| MODTC | Date/Time of Collection | Char | ISO 8601 | Collected | Exp | Copy value from MORPH.DATE. | SDTM | 9 |
| 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-mo-sdtmig33/full.md
Edit14 linesFollowing CDISC SDTM standards, use the provided MORPHOLOGY dataset to create an MO dataset with one record per cell type finding per subject.
The output dataset should contain the following columns in this order: DOMAIN, STUDYID, USUBJID, MOSEQ, MOTESTCD, MOTEST, MOORRES, MOSTRESC, MODTC
Use SDTMIG 3.3. DOMAIN is "MO". MOSEQ is the finding identifier supplied by SEQ within each subject. MOTESTCD is "CELLTYPE" and MOTEST is "Cell Type". MOORRES is the collected RESULT, and MODTC is the collection DATE. MOSTRESC is "NORMAL" for a RESULT of "normal" and "ABNORMAL" for a RESULT of "abnormal".
Read the source datasets from /app/input and save the completed dataset as /app/output/mo.csv.
prompts/sdtm-mo-sdtmig33/conventions.md
Edit11 linesFollowing CDISC SDTM standards, use the provided MORPHOLOGY dataset to create an MO dataset with one record per cell type finding per subject.
The output dataset should contain the following columns in this order: DOMAIN, STUDYID, USUBJID, MOSEQ, MOTESTCD, MOTEST, MOORRES, MOSTRESC, MODTC
Use SDTMIG 3.3. DOMAIN is "MO". MOTESTCD is "CELLTYPE" and MOTEST is "Cell Type".
Read the source datasets from /app/input and save the completed dataset as /app/output/mo.csv.
prompts/sdtm-mo-sdtmig33/brief.md
Edit8 linesFollowing CDISC SDTM standards, use the provided MORPHOLOGY dataset to create an MO dataset with one record per cell type finding per subject.
The output dataset should contain the following columns in this order: DOMAIN, STUDYID, USUBJID, MOSEQ, MOTESTCD, MOTEST, MOORRES, MOSTRESC, MODTC
Read the source datasets from /app/input and save the completed dataset as /app/output/mo.csv.
R
Edit3 lineslibrary(yamaa)yamaa_project("project.yaml")$spec("MO")$run()$outputPython
Edit3 linesimport yamaayamaa.project("project.yaml").spec("MO").run().outputsolutions/sdtm-mo-sdtmig33/result.R
Edit21 linessource_data <- read.csv("/app/input/morphology.csv", stringsAsFactors = FALSE, colClasses = "character", check.names = FALSE)required <- c("STUDYID", "USUBJID", "SEQ", "RESULT", "DATE")stopifnot(all(required %in% names(source_data)))standard_result <- rep(NA_character_, nrow(source_data))standard_result[which(source_data$RESULT == "normal")] <- "NORMAL"standard_result[which(source_data$RESULT == "abnormal")] <- "ABNORMAL"mo <- data.frame( DOMAIN = rep("MO", nrow(source_data)), STUDYID = source_data$STUDYID, USUBJID = source_data$USUBJID, MOSEQ = as.integer(source_data$SEQ), MOTESTCD = rep("CELLTYPE", nrow(source_data)), MOTEST = rep("Cell Type", nrow(source_data)), MOORRES = source_data$RESULT, MOSTRESC = standard_result, MODTC = source_data$DATE, stringsAsFactors = FALSE)dir.create("/app/output", showWarnings = FALSE)write.csv(mo, "/app/output/mo.csv", row.names = FALSE, na = "")solutions/sdtm-mo-sdtmig33/result.py
Edit43 linesfrom pathlib import Pathimport pandas as pdINPUT_PATH = Path("/app/input/morphology.csv")OUTPUT_PATH = Path("/app/output/mo.csv")COLUMNS = [ "DOMAIN", "STUDYID", "USUBJID", "MOSEQ", "MOTESTCD", "MOTEST", "MOORRES", "MOSTRESC", "MODTC",]def main(): source = pd.read_csv(INPUT_PATH, dtype=str, keep_default_na=False) standard_results = {"normal": "NORMAL", "abnormal": "ABNORMAL"} mo = pd.DataFrame( { "DOMAIN": "MO", "STUDYID": source["STUDYID"], "USUBJID": source["USUBJID"], "MOSEQ": source["SEQ"], "MOTESTCD": "CELLTYPE", "MOTEST": "Cell Type", "MOORRES": source["RESULT"], "MOSTRESC": source["RESULT"].map(standard_results), "MODTC": source["DATE"], }, columns=COLUMNS, ) OUTPUT_PATH.parent.mkdir(parents=True, exist_ok=True) mo.to_csv(OUTPUT_PATH, index=False)if __name__ == "__main__": main()solutions/sdtm-mo-sdtmig33/result.sas
Edit20 linesproc import datafile='/app/input/morphology.csv' out=morphology dbms=csv replace; guessingrows=max;run;data mo; length DOMAIN $2 STUDYID $200 USUBJID $200 MOSEQ 8 MOTESTCD $8 MOTEST $40 MOORRES $200 MOSTRESC $8 MODTC $10; set morphology; DOMAIN = 'MO'; MOSEQ = SEQ; MOTESTCD = 'CELLTYPE'; MOTEST = 'Cell Type'; MOORRES = RESULT; if RESULT = 'normal' then MOSTRESC = 'NORMAL'; else if RESULT = 'abnormal' then MOSTRESC = 'ABNORMAL'; MODTC = put(DATE, yymmdd10.); keep DOMAIN STUDYID USUBJID MOSEQ MOTESTCD MOTEST MOORRES MOSTRESC MODTC;run;proc export data=mo outfile='/app/output/mo.csv' dbms=csv replace;run;
yamaa