In order to read an
ODM XML file, a specialized macro named odm_read is available in the
ODM 1.3.0 standards macro folder. This folder is located here:
<global standards library directory>/standards/cdisc-odm-1.3.0-1.4/
macros
This macro is referenced
from the create_sasodm_fromxml.sas driver program (described more
fully below).
File references and
other metadata that are required by the macro are set as global macro
variable values. Currently, these global macro variable values are
set through the framework initialization properties and the CDISC
ODM 1.3.0 initialization properties. Throughout the processing of
the odm_read macro, the Results data set contains all framework and
ODM 1.3.0 specific messages generated during run time.
Based on file references
defined in the SASReferences data set, the odm_read macro accesses
the ODM XML file.
Here is a partial listing
of a sample ODM XML file:
<?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>
After the odm_read macro
confirms that the ODM XML file exists, a call is made to the SAS DATA
step component JavaObj. JavaObj processing converts the ODM XML file
into the cubeXML file through transformations using XSL files and
processes. The cubeXML file is created in the Work library. The name
of the cubeXML file is _cub
nnnn.xml, where
nnnn is a
randomly generated number. The cubeXML file is accessed using the
SAS XML LIBNAME engine and XMLMAP processing. A default XMLMAP file
is stored in the sample ODM 1.3.0 study folder hierarchy under
/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.
Here is a partial listing
of the odm.map file.
<?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>
When the cubeXML is
processed, each of the 66 data sets (such as ItemDefs) that are included
in the SAS representation of the CDISC ODM model is derived.
A number of input parameters
can be specified in the call to the odm_read macro. These parameters
offer the options of building source metadata files and SAS format
catalogs for codelist translated text. These parameters are itemized
in this table.
ODM_read Macro Parameters
|
|
|
Create the source metadata
files (for example, source_tables and source_columns) as a part of
the Read operation. Default=Y (yes), otherwise leave blank. Optional.
|
|
Build format catalog(s),
representing language-specific codelist TranslatedText, as a part
of the Read operation. Default=Y (yes), otherwise leave blank. Optional.
|
|
Where catalog(s) are
to be written. Optional. If not specified, default first to value
derived from SASReferences, then Work.
|
|
Should an existing format
catalog by that name in _cstFmtLib be replaced? Optional. Values:
N | Y Default behavior: Y (overwrite existing catalog)
|
|
Use this prefix for
catalog names. Optional. If not specified, default is <standard
mnemonic>FmtCat (such as ODMFmtCat). This default will produce
an English format catalog name of ODMFmtCat_en.
|
|
If specified, create
a format catalog ONLY for the specified language. Optional. Example:
_cstFmtCatLang=en. If no records exist for the specified language,
an empty catalog is created.
|
|
If no language tag is
provided in the XML, what action should be taken with these records?
Optional. Values: Ignore | English | Use_cstFmtCatLang. If Ignore,
records are ignored (but reported in the SAS log). If English, records
are added to the English catalog (default). If Use_cstFmtCatLang,
records are added to the language catalog specified in the _cstFmtCatLang
parameter.
|
By default, if a null-parameter
%odm_read() macro call is made, source metadata files and SAS format
catalogs for each language found in the clitemdecodetranslatedtext
data set are created after the SAS data sets representing the ODM
XML metadata and data content are derived. The target location of
the derived metadata files is defined in the SASReferences data set.
The target location of any derived SAS format catalogs is the SAS
Work library unless defined in the SASReferences data set.