CDISC Procedure Examples for CDISC ODM |
Overview |
This example, which includes only the required PROC CDISC statements for exporting, specifies the metadata attributes in the statements.
As an alternative, you can store metadata attributes for the required ODM, STUDY, GLOBALVARIABLES, and METADATAVERSION statements in separate SAS data sets that you reference with the DATA= argument. For an example, see Example: Exporting a CDISC ODM XML Document with Metadata Attributes in SAS Data Sets.
Program |
The following SAS program exports a SAS data set as a CDISC ODM XML document:
The LIBNAME statement assigns the libref RESULTS to the physical location of the input SAS data set.
The FILENAME statement assigns the fileref XMLOUT to the physical location of the output XML document (complete pathname, filename, and file extension) to be exported.
The SORT procedure specifies to sort the input SAS data set by the __SUBJECTKEY variable.
The PROC CDISC statement specifies the following:
CDISC ODM as the model.
Fileref XMLOUT, which references the physical location of the output XML document to be exported.
FORMATACTIVE=YES to convert CDISC ODM CodeList content in the XML document to SAS formats.
FORMATNOREPLACE=NO to replace existing SAS formats in the FORMAT catalog that have the same name as the converted formats.
The ODM statement specifies the required metadata attributes for exporting, such as the CDISC ODM version and file type.
The STUDY statement specifies the study identifier.
Options in the GLOBALVARIABLES statement specify general summary information about the study.
The METADATAVERSION statement specifies the required metadata version and version name.
The CLINICALDATA statement identifies the input SAS data set, which is RESULTS.AE. The input SAS data set contains the data content and KeySet members that are written to the XML document. In addition, the CLINICALDATA statement specifies optional metadata attributes.
libname results 'C:\myfiles\'; 1 filename xmlout 'C:\XML\AEfull.XML'; 2 proc sort data=results.AE; 3 by __subjectkey; run: proc cdisc model=odm 4 write=xmlout formatactive=yes formatnoreplace=no; odm odmversion="1.2" 5 fileoid="000-00-0000" filetype=SNAPSHOT description="Adverse events from the CTChicago file"; study studyoid="STUDY.StudyOID";6 globalvariables studyname="CDISC Connect-A-Thon Test Study III" 7 studydescription="This file contains test data for the CDISC Connect-A-Thon event scheduled for the DIA 38th annual meeting in Chicago." protocolname="CDISC-Protocol-00-000"; metadataversion metadataversionoid="v1.1.0" 8 name="Version 1.1.0"; clinicaldata data=results.AE 9 domain="AE" name="Adverse Events" comment="All adverse events in this trial" ; run; filename xmlout clear; libname results clear;
Output |
The following is an annotated excerpt of the output CDISC ODM XML document:
All of the metadata is contained by a single MetaDataVersion element.
A Protocol element that contains a StudyEventRef for each StudyEventDef is automatically generated.
A StudyEventDef element that contains a FormRef for each FormDef is automatically generated.
A FormDef element that contains an ItemGroupRef for each ItemGroupDef is automatically generated.
The SAS data set is represented as an ItemGroupDef.
Each variable in the SAS data set is represented as an ItemRef.
If a variable contains a reference to a user-defined SAS format, a CodeListRef is generated in the ItemDef for the variable.
A CodeList element is generated for each unique user-defined SAS format that is referenced.
A ClinicalData element is created for each ItemGroupDef that is referenced.
CDISC ODM XML Document Exported by PROC CDISC
<?xml version="1.0" encoding="windows-1252" ?> <!-- Clinical Data Interchange Standards Consortium (CDISC) Operational Data Model (ODM) for clinical data interchange You can learn more about CDISC standards efforts at http://www.cdisc.org/standards/index.html --> <ODM xmlns="http://www.cdisc.org/ns/odm/v1.2" xmlns:ds="http://www.w3.org/2000/09/xmldsig#" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.cdisc.org/ns/odm/v1.2 ODM1-2-0.xsd" ODMVersion="1.2" FileOID="000-00-0000" FileType="Snapshot" Description="Adverse events from the CTChicago file" AsOfDateTime="2009-02-27T14:20:31" CreationDateTime="2009-02-27T14:20:31" SourceSystem="SAS 9.2 PROC CDISC" SourceSystemVersion="9.02.02M0D01222009 3.00.65"> <Study OID="STUDY.StudyOID"> <!-- GlobalVariables is a REQUIRED section in ODM markup --> <GlobalVariables> <StudyName>CDISC Connect-A-Thon Test Study III</StudyName> <StudyDescription>This file contains test data for the CDISC Connect-A-Thon event scheduled for the DIA 38th annual meeting in Chicago.</StudyDescription> <ProtocolName>CDISC-Protocol-00-000</ProtocolName> </GlobalVariables> <BasicDefinitions /> <!-- Internal ODM markup required metadata --> <MetaDataVersion OID="v1.1.0" Name="Version 1.1.0"> 1 <Protocol> 2 <StudyEventRef StudyEventOID="SE.VISIT1" OrderNumber="1" Mandatory="Yes" /> </Protocol> <StudyEventDef OID="SE.VISIT1" Name="Study Event Definition" Repeating="Yes" Type="Common"> 3 <FormRef FormOID="FORM.AE" OrderNumber="1" Mandatory="No" /> </StudyEventDef> <FormDef OID="FORM.AE" Name="Form Definition" Repeating="Yes"> 4 <ItemGroupRef ItemGroupOID="IG.AE" Mandatory="No" /> </FormDef> <!-- Columns defined in the table --> <ItemGroupDef OID="IG.AE" Repeating="Yes" 5 SASDatasetName="AE" Name="Adverse Events" Domain="AE" Comment="All adverse events in this trial"> <ItemRef ItemOID="ID.TAREA" OrderNumber="1" Mandatory="No" /> 6 <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" /> . . . </ItemGroupDef>
<!-- Column attributes as defined in the table --> <ItemDef OID="ID.TAREA" Name="TAREA" SASFieldName="TAREA" DataType="text" Length="4"> <CodeListRef CodeListOID="CL.$TAREAF" /> 7 </ItemDef> <ItemDef OID="ID.PNO" Name="PNO" SASFieldName="PNO" DataType="text" Length="15" /> <ItemDef OID="ID.SCTRY" Name="SCTRY" SASFieldName="SCTRY" DataType="text" Length="4"> <CodeListRef CodeListOID="CL.$SCTRYF" /> </ItemDef> <ItemDef OID="ID.F_STATUS" Name="F_STATUS" SASFieldName="F_STATUS" DataType="text" Length="1"> <CodeListRef CodeListOID="CL.$F_STATU" /> </ItemDef> <ItemDef OID="ID.LINE_NO" Name="LINE_NO" SASFieldName="LINE_NO" DataType="integer" Length="2" /> . . . <ItemDef OID="ID.AECONTRT" Name="AECONTRT" SASFieldName="AECONTRT" DataType="text" Length="1"> <CodeListRef CodeListOID="CL.$AECONTR" /> </ItemDef> <!-- Translation to ODM markup for any PROC FORMAT style user defined or SAS internal formatting specifications applied to columns in the table --> <CodeList OID="CL.$TAREAF" SASFormatName="$TAREAF" Name="$TAREAF" DataType="text"> 8 <CodeListItem CodedValue='ONC'> <Decode> <TranslatedText>Oncology</TranslatedText> </Decode> </CodeListItem> </CodeList> . . . <CodeList OID="CL.$AECONTR" SASFormatName="$AECONTR" Name="$AECONTR" DataType="text"> <CodeListItem CodedValue='0'> <Decode> <TranslatedText>None</TranslatedText> </Decode> </CodeListItem> <CodeListItem CodedValue='1'> <Decode> <TranslatedText>Medication required</TranslatedText> </Decode> </CodeListItem> <CodeListItem CodedValue='2'> <Decode> <TranslatedText>Hospitalization required or prolonged</TranslatedText> </Decode> </CodeListItem> <CodeListItem CodedValue='3'> <Decode> <TranslatedText>Other</TranslatedText> </Decode> </CodeListItem> </CodeList> </MetaDataVersion> </Study> <!-- Administrative metadata --> <AdminData />
<!--
Actual data content begins here
This section represents each data record in the table
-->
<ClinicalData StudyOID="STUDY.StudyOID" MetaDataVersionOID="v1.1.0"> 9
<SubjectData SubjectKey="001">
<StudyEventData StudyEventOID="SE.VISIT1" StudyEventRepeatKey="1">
<FormData FormOID="FORM.AE" FormRepeatKey="1">
<ItemGroupData ItemGroupOID="IG.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="6" />
<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="6" />
<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>
<ItemGroupData ItemGroupOID="IG.AE" ItemGroupRepeatKey="2">
<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="2" />
<ItemData ItemOID="ID.AETERM" Value="CONGESTION" />
<ItemData ItemOID="ID.AESTMON" Value="6" />
<ItemData ItemOID="ID.AESTDAY" Value="11" />
<ItemData ItemOID="ID.AESTYR" Value="1999" />
<ItemData ItemOID="ID.AESTDT" Value="1999-06-11" />
<ItemData ItemOID="ID.AEENMON" IsNull="Yes" />
<ItemData ItemOID="ID.AEENDAY" IsNull="Yes" />
<ItemData ItemOID="ID.AEENYR" IsNull="Yes" />
<ItemData ItemOID="ID.AEENDT" IsNull="Yes" />
<ItemData ItemOID="ID.AESEV" Value="1" />
<ItemData ItemOID="ID.AEREL" Value="0" />
<ItemData ItemOID="ID.AEOUT" Value="2" />
<ItemData ItemOID="ID.AEACTTRT" Value="0" />
<ItemData ItemOID="ID.AECONTRT" Value="1" />
</ItemGroupData>
</FormData>
</StudyEventData>
</SubjectData>
</ClinicalData>
</ODM>
Copyright © 2009 by SAS Institute Inc., Cary, NC, USA. All rights reserved.