Module ODM V1.3.0 (Runtime)

This is the CDISC-ODM 1.3.0 runtime macro library.

Since: V1.2s

Macro Summary
external

%odm_extractdomaindata(_cstSourceMetadata=, _cstSourceData=, _cstIsReferenceData=No, _cstSelectAttribute=Name, _cstSelectAttributeValue=, _cstLang=en, _cstMaxLabelLength=256, _cstAttachFormats=Yes, _cstODMMinimumKeyset=No, _cstOutputLibrary=, _cstOutputDS=);
          Extract SAS data set from CDISC-ODM ...
external

%odm_getStatic(_cstName=, _cstVar=);
          Returns constant values that are used by other macros. ...
external

%odm_read(_cstBuildSrcMetadata=Y, _cstBuildFmtCat=Y, _cstFmtLib=, _cstReplaceFmtCat=Y, _cstFmtCatPrefix=, _cstFmtCatLang=, _cstFmtCatLangOption=English);
          Reads a CDISC-ODM V1.3.0 XML file into the SAS representation of ODM 1.3.0. ...
external

%odm_validate(_cstCallingPgm=Unspecified);
          Validates CDISC ODM model files. ...
external

%odm_write(_cstCreateDisplayStyleSheet=0, _cstOutputEncoding=UTF-8, _cstHeaderComment=, _cstResultsOverrideDS=, _cstLogLevel=info);
          Writes an ODM 1.3.0 XML file. ...
external

%odm_xmlvalidate(_cstLogLevel=info, _cstResultsOverrideDS=, _cstCallingPgm=Unspecified);
          Validates an XML file against the ODM V1.3.0 XML W3C schema. ...

Macro Detail

%odm_extractdomaindata(_cstSourceMetadata=, _cstSourceData=, _cstIsReferenceData=No, _cstSelectAttribute=Name, _cstSelectAttributeValue=, _cstLang=en, _cstMaxLabelLength=256, _cstAttachFormats=Yes, _cstODMMinimumKeyset=No, _cstOutputLibrary=, _cstOutputDS=);

[ Exposure: external ]
Extract SAS data set from CDISC-ODM

The goal of this module is to extract clinical data from ODM XML to
subsequently serve as source data for transformations that derive SDTM domain
data sets. This code module builds a table shell (0 observations)
from ODM metadata (FormDef, ItemGroupDef and ItemDef) and populates (with each
call) a single data set from the ClinicalData or ReferenceData sections of an
ODM file.

Assumptions:
(1) the original source ODM XML file contained sufficient metadata + content
for extractable clinical and reference data
(2) a full SAS representation of the ODM file is available (e.g. odm_read has
been run against the XML file)

Limitations:
(1) Scope is currently limited to single XML file processing (i.e., use of
PriorFileOID to reference another file is not permitted)
(2) A full MetaDataVersion section must be provided
(3) This implementation will not support reference to multiple
MetaDataVersions within the to-be-extracted file(s)
(4) ODM.FileType should equal Snapshot, thereby supporting only
TransactionType values of "Insert".
(5) Any annotations, audit records and signatures associated with the
extracted data are not processed
(6) Excludes any custom extensions to the XML file.
(7) MeasurementUnit information associated with specific columns and values
is currently ignored

The macro sets the _cst_rc and _cst_rcmsg global macro variables to indicate
that there were issues (_cst_rc ne 0).

Expected Macro Variables:
_cstDebug - Turns debugging on or off for the session
_cstResultFlag - Results: Problem detected?
_cstResultSeq - Results: Unique invocation of check
_cstResultsDS - Results data set
_cstSASRefs - Run-time SASReferences data set derived in process setup
_cstSeqCnt - Results: Sequence number within _cstResultSeq
_cst_rc - Task error status
_cst_rcmsg - Message associated with _cst_rc
studyRootPath - Root path of the Study Library
Parameters:
_cstSourceMetadata - - optional - The SAS libref for the SAS ODM
        metadata representation. If not specified, code will look first for
        type=sourcedata from SASReferences. If this is not provided,
        data set(s) source will be assumed to be WORK.
_cstSourceData - - optional - The SAS libref for the SAS ODM
        representation (data). If not specified, code will look first for
        type=sourcedata from SASReferences. If this is not provided,
        data set(s) source will be assumed to be WORK.
_cstIsReferenceData - - optional - Is extracted data ReferenceData?
        If not provided, No is assumed.
        Values: Yes | No
        Default: No
_cstSelectAttribute - - optional - ItemGroup Attribute that identifies
        ItemGroup to be extracted.
        If not provided, Name is assumed.
        Values: OID | Name | SASDatasetName | Domain
        Default: Name
_cstSelectAttributeValue - - required - Value of _cstSelectAttribute that
        identifies ItemGroup to be extracted.
        This value is case sensitive.
_cstLang - - optional - Language tag to use for any associated
        TranslatedText.
        Default: en
_cstMaxLabelLength - - optional - Maximum value of labels to be created.
        If not provided, 256 is assumed.
        Default: 256
_cstAttachFormats - - optional - Attach formats to data?
        If not provided, Yes is assumed.
        Values: Yes | No
        Default: Yes
_cstODMMinimumKeyset - - optional - Limit the creation of data set keys?
        If not provided, No is assumed.
        Values: Yes | No
        Default: No
_cstOutputLibrary - - optional - SAS libref where extracted data set(s)
        are to be written. If not specified, code will look first for
        type=targetdata from SASReferences. If this is not provided,
        data set(s) will be written to WORK.
_cstOutputDS - - requyired - Name of the extracted data set. If this is
        an invalid SAS data set name, an error will be generated.
File: odm_extractdomaindata.sas
First available in version: 1.5

%odm_getStatic(_cstName=, _cstVar=);

[ Exposure: external ]
Returns constant values that are used by other macros.

Parameters:
_cstName - The name of the value to retrieve.
        Values: ODM_SASREF_TYPE_REFXML|ODM_SASREF_TYPE_EXTXML|
        ODM_SASREF_SUBTYPE_XML|ODM_SASREF_SUBTYPE_STYLESHEET|
        ODM_JAVA_PARAMSCLASS|ODM_JAVA_IMPORTCLASS|
        ODM_JAVA_EXPORTCLASS|ODM_JAVA_PICKLIST
_cstVar - The macro variable to populate with the value.
File: odm_getstatic.sas
First available in version: 1.3

%odm_read(_cstBuildSrcMetadata=Y, _cstBuildFmtCat=Y, _cstFmtLib=, _cstReplaceFmtCat=Y, _cstFmtCatPrefix=, _cstFmtCatLang=, _cstFmtCatLangOption=English);

[ Exposure: external ]
Reads a CDISC-ODM V1.3.0 XML file into the SAS representation of ODM 1.3.0.

This macro uses the SAS representation of a CDISC-ODM XML file as the source
and converts it into SAS data sets. The inputs and outputs are specified in a
SASReferences file.

Expected Macro Variables:
_cstDebug - Turns debugging on or off for the session
_cstResultFlag - Results: Problem detected?
_cstResultSeq - Results: Unique invocation of check
_cstResultsDS - Results data set
_cstSASRefs - Run-time SASReferences data set derived in process setup
_cstSeqCnt - Results: Sequence number within _cstResultSeq
_cst_rc - Task error status
_cst_rcmsg - Message associated with _cst_rc
studyRootPath - Root path of the Study Library
Parameters:
_cstBuildSrcMetadata - - optional - Create the source metadata files
        (for example, source_tables and source_columns).
        Values: Y
        Default: Y
_cstBuildFmtCat - - optional - Build the format catalog (or catalogs)
        that represents language-specific codelist TranslatedText.
        Values: Y
        Default: Y
_cstFmtLib - - optional - The location where catalog (or catalogs) is
        written. If not specified, the value is first derived from
        SASReferences, and then from WORK.
_cstReplaceFmtCat - - optional - Replace an existing format catalog by
        the same name in _cstFmtLib.
        Values: Y
        Default: Y
_cstFmtCatPrefix - - optional - The prefix for catalog names. If not
        specified, the default is <standard mnemonic>FmtCat (such as
        ODMFmtCat). This default produces an English format catalog
        named ODMFmtCat_en.
_cstFmtCatLang - - optional - Create a format catalog ONLY for the
        specified language. Example: _cstFmtCatLang=en.
        If no records exist for the specified language, an empty catalog
        is created.
_cstFmtCatLangOption - - optional - If no language tag is provided in the
        XML, the action to take with these records.
        Ignore: Records are ignored but reported in the SAS log.
        English: Records are added to the English catalog.
        Use_cstFmtCatLang: Records are added to the language catalog that
        is specified in the _cstFmtCatLang parameter.
        Values: Ignore | English | Use_cstFmtCatLang
        Default: English
File: odm_read.sas
First available in version: 1.3

%odm_validate(_cstCallingPgm=Unspecified);

[ Exposure: external ]
Validates CDISC ODM model files.

This macro iterates through the validation checks to be run and writes
validation results to the process Results and (optionally) to Metrics data
sets. These results are persisted to any permanent location based on
type=results records in SASReferences. Process cleanup is based on the
_cstDebug global macro variable.

Required File Inputs:
run-time (type=control,subtype=validation in sasreferences) check data set

Expected Macro Variables:
_cstCheckSortOrder - Specifies the order in which validation checks are
        to be run
_cstColumnMetadata - Data set containing column-level metadata
        supporting validation
_cstDebug - Turns debugging on or off for the session
_cstGRoot - Root path of the Toolkit Global Library
_cstMetrics - Toggle to enable or disable metrics reporting
_cstMetricsCntNumBadChecks - Validation metrics: validation checks not
        run
_cstMetricsCntNumChecks - Validation metrics: distinct validation check
        invocations
_cstMetricsDS - Data set used to accumulate metrics for a validation
        process
_cstMetricsNumBadChecks - Validation metrics: calculate validation
        checks not run
_cstMetricsNumChecks - Validation metrics: calculate distinct validation
        check invocations
_cstMetricsNumContent - Validation metrics: calculate number of content
        problems detected
_cstMetricsNumErrors - Validation metrics: calculate number of errors
        detected
_cstMetricsNumNotes - Validation metrics: calculate number of notes
        detected
_cstMetricsNumRecs - Validation metrics: calculate number of records
        evaluated
_cstMetricsNumStructural - Validation metrics: calculate number of
        structural problems detected
_cstMetricsNumSubj - Validation metrics: calculate number of subjects
        evaluated
_cstMetricsNumWarnings - Validation metrics: calculate number of
        warnings detected
_cstMetricsTimer - Validation metrics: include estimate the elapsed time
        to perform each action
_cstResultFlag - Results: Problem detected?
_cstResultSeq - Results: Unique invocation of check
_cstResultsDS - Results data set
_cstSASRefs - Run-time SASReferences data set derived in process setup
_cstSeqCnt - Results: Sequence number within _cstResultSeq
_cstSrcData - Results: Source entity being evaluated
_cstTableMetadata - Data set containing table-level metadata supporting
        validation
_cst_MsgID - Results: Result or validation check ID
_cst_MsgParm1 - Messages: Parameter 1
_cst_MsgParm2 - Messages: Parameter 2
_cst_rc - Task error status
_cst_rcmsg - Message associated with _cst_rc
studyRootPath - Root path of the Study Library
Parameters:
_cstCallingPgm - - optional - The name of the driver module calling
        this macro.
File: odm_validate.sas
First available in version: 1.4

%odm_write(_cstCreateDisplayStyleSheet=0, _cstOutputEncoding=UTF-8, _cstHeaderComment=, _cstResultsOverrideDS=, _cstLogLevel=info);

[ Exposure: external ]
Writes an ODM 1.3.0 XML file.

This macro uses the SAS representation of an ODM XML file as source data and
converts it to the required XML structure. The inputs and outputs are
specified via in a SASReferences file.

Expected Macro Variables:
_cstDebug - Turns debugging on or off for the session
_cstResultFlag - Results: Problem detected?
_cstResultSeq - Results: Unique invocation of check
_cstResultsDS - Results data set
_cstSASRefs - Run-time SASReferences data set derived in process setup
_cstSeqCnt - Results: Sequence number within _cstResultSeq
_cst_rc - Task error status
_cst_rcmsg - Message associated with _cst_rc
Parameters:
_cstCreateDisplayStyleSheet - - optional - Create a style sheet in the
        same directory as the output XML file.
        1: This macro looks in SASReferences for a record with a type or
        subtype of referencexml/stylesheet and uses that record.
        0: This macro does not create the XSL, even if a record is
        specified in SASReferences.
        Values: 0|1
        Default: 0
_cstOutputEncoding - - optional - The XML encoding to use for the ODM
        file that is created.
        Default: UTF-8
_cstHeaderComment - - optional - A short comment that is added to the top
        of the ODM XML file that is produced. If no comment is provided, a
        default is used.
_cstResultsOverrideDS - - optional - The (libname.)member that refers to
        a Results data set to create. If omitted, the Results data set that
        is specified by &_cstResultsDS is used.
_cstLogLevel - - required - The level of error reporting.
        Values: info|warning|error|fatal error
        Default: info
File: odm_write.sas
First available in version: 1.4

%odm_xmlvalidate(_cstLogLevel=info, _cstResultsOverrideDS=, _cstCallingPgm=Unspecified);

[ Exposure: external ]
Validates an XML file against the ODM V1.3.0 XML W3C schema.

General use of this macro is in combination with another macro (such as
odm_write or odm_read). If this macro is run independently, conditional code
is included that optionally writes metadata to the Results data set and
optionally checks the validity of the SASReferences data set.

Expected Macro Variables:
_cstDebug - Turns debugging on or off for the session
_cstGRoot - Root path of the Toolkit Global Library
_cstResultFlag - Results: Problem detected?
_cstResultSeq - Results: Unique invocation of check
_cstResultsDS - Results data set
_cstSASRefs - Run-time SASReferences data set derived in process setup
_cstSeqCnt - Results: Sequence number within _cstResultSeq
_cst_rc - Task error status
_cst_rcmsg - Message associated with _cst_rc
studyRootPath - Root path of the Study Library
Parameters:
_cstLogLevel - - required - The level of error reporting.
        Values: info|warning|error|fatal error
        Default: info
_cstResultsOverrideDS - - optional - The (libname.)member that refers to
        a Results data set to create. If omitted, the Results data set that
        is specified by &_cstResultsDS is used.
_cstCallingPgm - - optional - The name of the driver module calling
        this macro.
File: odm_xmlvalidate.sas
First available in version: 1.4