global standards library directory/standards/cdisc-odm-1.3.0-1.7/macros
<?xml version="1.0" encoding="ISO-8859-1"?> <ODM xmlns="http://www.cdisc.org/ns/odm/v1.3" FileOID="Study1234" ODMVersion="1.3" FileType="Snapshot" CreationDateTime="2004-07-28T12:34:13-06:00" SourceSystem="ss00" AsOfDateTime="2004-07-29T12:34:13-06:00" Granularity="SingleSite" Description="Study to determine existence of ischemic stroke" Archival="Yes" PriorFileOID="Study-4321" Originator="SAS Institute" SourceSystemVersion="Version 0.0.0" Id="DSSignature123"> <Study OID="1234" <GlobalVariables> <StudyName>1234</StudyName> <StudyDescription>1234 Data Definition</StudyDescription> <ProtocolName>1234</ProtocolName> </GlobalVariables> <MeasurementUnit OID="MeasurementUnits.OID.MMHG" Name="MMHG" <Symbol> <TranslatedText xml:lang="en">mmHG</TranslatedText> <TranslatedText xml:lang="fr-CA">mmHG</TranslatedText> </Symbol> </MeasurementUnit> <MeasurementUnit OID="MeasurementUnits.OID.YRS" Name="YEARS"> <Symbol> <TranslatedText xml:lang="de">Jahren</TranslatedText> <TranslatedText xml:lang="en">Years of age</TranslatedText> <TranslatedText xml:lang="fr-CA">Ans</TranslatedText> </Symbol> </BasicDefinitions> <MetaDataVersion MetaDataVersion OID="CDISC.SDTM.3.1.0" Name="Study 1234, Data Definitions" Description="Study 1234, Data Definitions"> <Include StudyOID="1234" MetaDataVersionOID="MDV000"> </Include> <Protocol> <Description>
/referencexml
as odm.map. The odm.map file is required to process
the cubeXML file. If it does not exist, then the %ODM_READ macro attempts
to create one using the ODM reference metadata.
<?xml version="1.0" encoding="windows-1252"?> <SXLEMAP name="ODM130" version="1.2"> <TABLE name="ItemDefs"> <TABLE-PATH syntax="XPath">/LIBRARY/ItemDefs</TABLE-PATH> <TABLE-DESCRIPTION>Item metadata</TABLE-DESCRIPTION> <COLUMN name="OID"> <PATH syntax="Xpath">/LIBRARY/ItemDefs/OID</PATH> <TYPE>character</TYPE> <DATATYPE>character</DATATYPE> <DESCRIPTION>Unique identifier for this item</DESCRIPTION> <LENGTH>64</LENGTH> </COLUMN> <COLUMN name="Name"> <PATH syntax="Xpath">/LIBRARY/ItemDefs/Name</PATH> <TYPE>character</TYPE> <DATATYPE>character</DATATYPE> <DESCRIPTION>Item (variable) name</DESCRIPTION> <LENGTH>128</LENGTH> </COLUMN> <COLUMN name="DataType"> <PATH syntax="Xpath">/LIBRARY/ItemDefs/DataType</PATH> <TYPE>character</TYPE> <DATATYPE>character</DATATYPE> <DESCRIPTION>Item (variable) data type (text, integer, float)</DESCRIPTION> <LENGTH>18</LENGTH> </COLUMN> <COLUMN name="Length"> <PATH syntax="Xpath">/LIBRARY/ItemDefs/Length</PATH> <TYPE>numeric</TYPE> <DATATYPE>numeric</DATATYPE> <DESCRIPTION>Item (variable) length</DESCRIPTION> <LENGTH>8</LENGTH> </COLUMN>
sample study library directory/cdisc-odm-1.3.0–1.7/programs
&studyRootPath=&_cstSRoot/cdisc-odm-&_cstStandardVersion.-&_cstVersion
&studyOutputPath=&_cstSRoot/cdisc-odm-&_cstStandardVersion.-&_cstVersion
Metadata Type
|
SAS LIBNAME or Fileref
to Use
|
Reference Type
|
Path
|
Name of File
|
---|---|---|---|---|
Input
|
||||
externalxml
|
odmxml
|
fileref
|
&studyRootPath/sourcexml
|
odm_sample.xml
|
referencexml
|
odmmap
|
fileref
|
&studyRootPath/referencexml
|
odm.map
|
Output
|
||||
sourcedata
|
srcdata
|
libref
|
&studyOutputPath/derived/data
|
*.*
|
sourcemetadata
|
srcmeta
|
libref
|
&studyOutputPath/derived/metadata
|
source_tables.sas7bdat
|
sourcemetadata
|
srcmeta
|
libref
|
&studyOutputPath/derived/metadata
|
source_columns.sas7bdat
|
targetdata
|
trgdata
|
libref
|
&studyOutputPath/derived/formats
|
|
results
|
results
|
libref
|
&studyOutputPath/results
|
read_results.sas7bdat
|
<ItemGroupDef OID="ItemGroupDefs.OID.AE" Repeating="Yes" SASDatasetName="AE" Name="Adverse Events" Domain="AE" Comment="Some adverse events from this trial"> <ItemRef ItemOID="ID.TAREA" OrderNumber="1" Mandatory="No" /> <ItemRef ItemOID="ID.PNO" OrderNumber="2" Mandatory="No" /> <ItemRef ItemOID="ID.SCTRY" OrderNumber="3" Mandatory="No" /> <ItemRef ItemOID="ID.F_STATUS" OrderNumber="4" Mandatory="No" /> <ItemRef ItemOID="ID.LINE_NO" OrderNumber="5" Mandatory="No" /> <ItemRef ItemOID="ID.AETERM" OrderNumber="6" Mandatory="No" /> <ItemRef ItemOID="ID.AESTMON" OrderNumber="7" Mandatory="No" /> <ItemRef ItemOID="ID.AESTDAY" OrderNumber="8" Mandatory="No" /> <ItemRef ItemOID="ID.AESTYR" OrderNumber="9" Mandatory="No" /> <ItemRef ItemOID="ID.AESTDT" OrderNumber="10" Mandatory="No" /> <ItemRef ItemOID="ID.AEENMON" OrderNumber="11" Mandatory="No" /> <ItemRef ItemOID="ID.AEENDAY" OrderNumber="12" Mandatory="No" /> <ItemRef ItemOID="ID.AEENYR" OrderNumber="13" Mandatory="No" /> <ItemRef ItemOID="ID.AEENDT" OrderNumber="14" Mandatory="No" /> <ItemRef ItemOID="ID.AESEV" OrderNumber="15" Mandatory="No" /> <ItemRef ItemOID="ID.AEREL" OrderNumber="16" Mandatory="No" /> <ItemRef ItemOID="ID.AEOUT" OrderNumber="17" Mandatory="No" /> <ItemRef ItemOID="ID.AEACTTRT" OrderNumber="18" Mandatory="No" /> <ItemRef ItemOID="ID.AECONTRT" OrderNumber="19" Mandatory="No" /> </ItemGroupDef> ... <ItemDef OID="ID.AESTDT" SASFieldName="AESTDT" Name="Derived Start Date" DataType="date"/> <ItemDef OID="ID.AEENMON" SASFieldName="AEENMON" Name="Stop Month - Enter Two Digits 01-12" DataType="integer" Length="2" /> <ItemDef OID="ID.AEENDAY" SASFieldName="AEENDAY" Name="Stop Day - Enter Two Digits 01-31" DataType="integer" Length="2" /> <ItemDef OID="ID.AEENYR" SASFieldName="AEENYR" Name="Stop Year - Enter Four Digit Year" DataType="integer" Length="4" /> <ItemDef OID="ID.AEENDT" SASFieldName="AEENDT" Name="Derived Stop Date" DataType="date"/> <ItemDef OID="ID.AESEV" SASFieldName="AESEV" Name="Severity” DataType="text" Length="1"> <CodeListRef CodeListOID="CL.$AESEV" /> </ItemDef> <ItemDef OID="ID.AEREL" SASFieldName="AEREL" Name="Relationship to study drug" DataType="text" Length="1"> <CodeListRef CodeListOID="CL.$AEREL" /> </ItemDef>
<ClinicalData StudyOID="Study.OID" MetaDataVersionOID="MetaDataVersion.OID.1"> <SubjectData SubjectKey="S001P011" TransactionType="Insert"> <StudyEventData StudyEventOID="StudyEventDefs.OID.6.AdverseEvent" StudyEventRepeatKey="1"> <FormData FormOID="FormDefs.OID.AE" FormRepeatKey="1"> <ItemGroupData ItemGroupOID="ItemGroupDefs.OID.AE" ItemGroupRepeatKey="1"> <ItemData ItemOID="ID.TAREA" Value="ONC" /> <ItemData ItemOID="ID.PNO" Value="143-02" /> <ItemData ItemOID="ID.SCTRY" Value="USA" /> <ItemData ItemOID="ID.F_STATUS" Value="V" /> <ItemData ItemOID="ID.LINE_NO" Value="1" /> <ItemData ItemOID="ID.AETERM" Value="HEADACHE" /> <ItemData ItemOID="ID.AESTMON" Value="06" /> <ItemData ItemOID="ID.AESTDAY" Value="10" /> <ItemData ItemOID="ID.AESTYR" Value="1999" /> <ItemData ItemOID="ID.AESTDT" Value="1999-06-10" /> <ItemData ItemOID="ID.AEENMON" Value="06" /> <ItemData ItemOID="ID.AEENDAY" Value="14" /> <ItemData ItemOID="ID.AEENYR" Value="1999" /> <ItemData ItemOID="ID.AEENDT" Value="1999-06-14" /> <ItemData ItemOID="ID.AESEV" Value="1" /> <ItemData ItemOID="ID.AEREL" Value="0" /> <ItemData ItemOID="ID.AEOUT" Value="1" /> <ItemData ItemOID="ID.AEACTTRT" Value="0" /> <ItemData ItemOID="ID.AECONTRT" Value="1" /> </ItemGroupData>
%macro odm_extractdomaindata( _cstSourceMetadata=, _cstSourceData=, _cstIsReferenceData=No, _cstSelectAttribute=Name, _cstSelectAttributeValue=, _cstLang=en, _cstMaxLabelLength=256, _cstAttachFormats=Yes, _cstODMMinimumKeyset=No, _cstOutputLibrary=, _cstOutputDS= );
sample study library directory/cdisc-odm-1.3.0-1.7/programs/extract_domaindata_all.sas
sample study library directory/cdisc-odm-1.3.0-1.7/programs/extract_domaindata.sas
sample study library directory/cdisc-odm-1.3.1-1.7/programs/extract_domaindata_all.sas
sample study library directory/cdisc-odm-1.3.1-1.7/programs/extract_domaindata.sas
filename incCode CATALOG "work._cstCode.domains.source" lrecl=255; data _null_; set srcdata.itemgroupdefs(keep=OID Name IsReferenceData SASDatasetName Domain); file incCode; length macrocall $400 _cstOutputName $100; _cstOutputName=SASDatasetName; * If we have to use the Name, Only use letters and digits; if missing(_cstOutputName) then _cstOutputName=cats(compress(Name, 'adk')); * If first character a digit, prepend an underscore; if anydigit(_cstOutputName)=1 then _cstOutputName=cats('_', _cstOutputName); * Cut long names; if length(_cstOutputName) > 32 then _cstOutputName=substr(_cstOutputName, 1, 32); macrocall=cats('%odm_extractdomaindata(_cstSelectAttribute=OID', ', _cstSelectAttributeValue=', OID, ', _cstIsReferenceData=', IsReferenceData, ', _cstMaxLabelLength=256', ', _cstAttachFormats=Yes', ', _cstODMMinimumKeyset=No', ', _cstLang=en', ', _cstOutputDS=', _cstOutputName, ');'); put macrocall; run; %include incCode; filename incCode clear;
global standards library directory/standards/cdisc-ct-1.0-1.7/macros
referencexml/odm.map
).
An odm.map file is required to process the cubeXML file. If it does
not exist, the %CT_READ macro attempts to create one using the CDISC
controlled terminology reference metadata.
<?xml version="1.0" encoding="UTF-8"?> <SXLEMAP name="CT100" version="1.2"> <TABLE name="CodeLists"> <TABLE-PATH syntax="XPath">/LIBRARY/CodeLists</TABLE-PATH> <TABLE-DESCRIPTION>Codelist metadata</TABLE-DESCRIPTION> <COLUMN name="OID"> <PATH syntax="Xpath">/LIBRARY/CodeLists/OID</PATH> <TYPE>character</TYPE> <DATATYPE>character</DATATYPE> <DESCRIPTION>Unique identifier for this codelist</DESCRIPTION> <LENGTH>128</LENGTH> </COLUMN> <COLUMN name="Name"> <PATH syntax="Xpath">/LIBRARY/CodeLists/Name</PATH> <TYPE>character</TYPE> <DATATYPE>character</DATATYPE> <DESCRIPTION>CodeList name</DESCRIPTION> <LENGTH>128</LENGTH> </COLUMN> <COLUMN name="DataType"> <PATH syntax="Xpath">/LIBRARY/CodeLists/DataType</PATH> <TYPE>character</TYPE> <DATATYPE>character</DATATYPE> <DESCRIPTION>CodeList item value data type (integer | float | text | string)</DESCRIPTION> <LENGTH>7</LENGTH> </COLUMN> <COLUMN name="SASFormatName"> <PATH syntax="Xpath">/LIBRARY/CodeLists/SASFormatName</PATH> <TYPE>character</TYPE> <DATATYPE>character</DATATYPE> <DESCRIPTION>SAS format name</DESCRIPTION> <LENGTH>8</LENGTH> </COLUMN> <COLUMN name="ExtCodeID"> <PATH syntax="Xpath">/LIBRARY/CodeLists/ExtCodeID</PATH> <TYPE>character</TYPE> <DATATYPE>character</DATATYPE> <DESCRIPTION>Unique numeric code randomly generated by NCI Thesaurus (NCIt)</DESCRIPTION> <LENGTH>64</LENGTH> </COLUMN> <COLUMN name="CodeListExtensible"> <PATH syntax="Xpath">/LIBRARY/CodeLists/CodeListExtensible</PATH> <TYPE>character</TYPE> <DATATYPE>character</DATATYPE> <DESCRIPTION>Defines if controlled terms may be added to the codelist (Yes | No)</DESCRIPTION> <LENGTH>3</LENGTH> </COLUMN> <COLUMN name="CDISCSubmissionValue"> <PATH syntax="Xpath">/LIBRARY/CodeLists/CDISCSubmissionValue</PATH> <TYPE>character</TYPE> <DATATYPE>character</DATATYPE> <DESCRIPTION>Specific value expected for submissions</DESCRIPTION> <LENGTH>512</LENGTH> </COLUMN>
sample study library directory/cdisc-ct-1.0-1.7/programs
&studyRootPath=sample study library directory/cdisc-ct-1.0-1.7
&studyOutputPath=sample study library directory/cdisc-ct-1.0-1.7
Metadata Type
|
SAS LIBNAME or Fileref
to Use
|
Reference Type
|
Path
|
Name of File
|
---|---|---|---|---|
Input
|
||||
externalxml
|
crtxml
|
fileref
|
&studyRootPath/sourcexml/sdtm/201212
|
sdtm_terminology.xml
|
referencexml
|
ctmap
|
fileref
|
&studyRootPath/referencexml
|
ct-1.0.0.map
|
Output
|
||||
sourcedata
|
srcdata
|
libref
|
&studyOutputPath/data/sdtm/201212
|
*.*
|
results
|
results
|
libref
|
&studyOutputPath/results
|
read_results_sdtm_2012.sas7bdat
|
%macro ct_createformats( _cstLang=en, /* Language tag in TranslatedText to use */ _cstCreateCatalog=1, /* Create format catalog */ _cstKillCatFirst=0, /* Empty catalog first */ _cstUseExpression=, /* Expression to create the SAS format name */ _cstAppendChar=F, /* Letter to append in case SAS format name ends with digit */ _cstDeleteEmptyColumns=1, /* Delete columns in output data set that are completely missing */ _cstTrimCharacterData=1 /* Truncate character data in output data set to the minimum value needed. */ );
'm/^(?=.{1,32}$)([\$a-zA-Z_][a-zA-Z0-9_]*[a-zA-Z_])$/'
sample study library directory/cdisc-ct-1.0-1.7/programs/create_ctformats.sas
sample study library directory/cdisc-ct-1.0-1.7/programs/create_ctformats_qs.sas
global standards library directory/standards/cdisc-crtdds-1.0-1.7/macros
.
<ODM xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:def="http://www.cdisc.org/ns/def/v1.0" xmlns="http://www.cdisc.org/ns/odm/v1.2" FileOID="1" CreationDateTime="2011-07-13T17:15:43-04:00" AsOfDateTime="2011-07-13T17:12:42" Description="define1" FileType="Snapshot" Id="define1" ODMVersion="1.0"> <Study OID="1"> <GlobalVariables> <StudyName>study1</StudyName> <StudyDescription>first study</StudyDescription> <ProtocolName>Protocol abc</ProtocolName> </GlobalVariables> <MetaDataVersion OID="1" Name="CDISC-SDTM 3.1.2" Description="CDISC-SDTM 3.1.2" def:DefineVersion="1.0.0" def:StandardName="CDISC SDTM" def:StandardVersion="3.1.2"> <ItemGroupDef OID="AE1" Name="AE" Repeating="Yes" IsReferenceData="No" SASDatasetName="AE" Domain="AE" Purpose="Tabulation" def:Label="Adverse Events" def:Class="Events" def:Structure="One record per adverse event per subject" def:DomainKeys="STUDYID USUBJID AEDECOD AESTDTC" def:ArchiveLocationID="AE1"> <ItemRef ItemOID="COL1" Mandatory="Yes" OrderNumber="1" KeySequence="1" Role="Identifier"/> <ItemRef ItemOID="COL2" Mandatory="Yes" OrderNumber="2" Role="Identifier"/> <ItemRef ItemOID="COL3" Mandatory="Yes" OrderNumber="3" KeySequence="2" Role="Identifier"/> <ItemRef ItemOID="COL4" Mandatory="Yes" OrderNumber="4" Role="Identifier"/> <ItemRef ItemOID="COL5" Mandatory="No" OrderNumber="5" Role="Identifier"/> <ItemRef ItemOID="COL6" Mandatory="No" OrderNumber="6" Role="Identifier"/> <ItemRef ItemOID="COL7" Mandatory="No" OrderNumber="7" Role="Identifier"/>
referencexml/define.map
).
The define.map file is required to process the cubeXML file. If it
does not exist, the crtdds_read attempts to create one using the CRT-DDS
reference metadata.
<?xml version="1.0" encoding="windows-1252"?> <SXLEMAP version="1.2"> <TABLE name="AnnotatedCRFs"> <TABLE-PATH syntax="XPath">/LIBRARY/AnnotatedCRFs</TABLE-PATH> <TABLE-DESCRIPTION>Annotated CRF metadata</TABLE-DESCRIPTION> <COLUMN name="DocumentRef"> <PATH syntax="Xpath">/LIBRARY/AnnotatedCRFs/DocumentRef</PATH> <TYPE>character</TYPE> <DATATYPE>character</DATATYPE> <DESCRIPTION>The referenced Annotated CRF document</DESCRIPTION> <LENGTH>2000</LENGTH> </COLUMN> <COLUMN name="leafID"> <PATH syntax="Xpath">/LIBRARY/AnnotatedCRFs/leafID</PATH> <TYPE>character</TYPE> <DATATYPE>character</DATATYPE> <DESCRIPTION>The unique ID of the referenced Annotated CRF</DESCRIPTION> <LENGTH>128</LENGTH> </COLUMN> <COLUMN name="FK_MetaDataVersion"> <PATH syntax="Xpath">/LIBRARY/AnnotatedCRFs/FK_MetaDataVersion</PATH> <TYPE>character</TYPE> <DATATYPE>character</DATATYPE> <DESCRIPTION>Foreign key: MetaDataVersion.OID</DESCRIPTION> <LENGTH>128</LENGTH> </COLUMN> </TABLE>
sample study library directory/cdisc-crtdds-1.0–1.7/programs
&studyRootPath=&_cstSRoot/cdisc-crtdds-1.0-&_cstVersion
&studyOutputPath=&_cstSRoot/cdisc-crtdds-1.0-&_cstVersion
Metadata Type
|
SAS LIBNAME or Fileref
to Use
|
Reference Type
|
Path
|
Name of File
|
---|---|---|---|---|
Input
|
||||
externalxml
|
crtxml
|
fileref
|
&studyRootPath/sourcexml
|
define.xml
|
referencexml
|
crtmap
|
fileref
|
&studyRootPath/referencexml
|
define.map
|
Output
|
||||
sourcedata
|
srcdata
|
libref
|
&studyOutputPath/deriveddata
|
*.*
|
sourcemetadata
|
srcmeta
|
libref
|
&studyOutputPath/derivedmetadata
|
source_tables.sas7bdat
|
sourcemetadata
|
srcmeta
|
libref
|
&studyOutputPath/derivedmetadata
|
source_columns.sas7bdat
|
sourcemetadata
|
srcmeta
|
libref
|
&studyOutputPath/derivedmetadata
|
source_study.sas7bdat
|
results
|
results
|
libref
|
&studyOutputPath/results
|
read_results.sas7bdat
|
&studyOutputPath/derivedmetadata
).