You can include the
annotated Case Report Form (CRF) metadata and value-level metadata
about the domains that you collected during a study. To do this, you
edit the SAS data sets that were generated by the CDISC-SOURCE to
CRT-DDS transformation to include the metadata. Then, you run the
%CRTDDS_WRITE macro to generate the CRT-DDS define.xml file.
Here is example code
that includes annotated CRF metadata:
*Lookup OID for the SDTM 3.1.2 standard in MetaDataVersion;
proc sql noprint;
select OID into :mdv from _svWork.MetaDataVersion
where name="CDISC-SDTM 3.1.2";
quit;
*Add records for Annotated CRF;
proc sql;
insert into _svWork.AnnotatedCRFs
set DocumentRef = "BlankCRF",
leafID= "AnnotatedCRF",
FK_MetaDataVersion = "&mdv";
insert into _svWork.MDVLeaf
set ID= "AnnotatedCRF",
href = "./blankcrf.pdf",
FK_MetaDataVersion = "&mdv";
insert into _svWork.MDVLeafTitles
set title= "Blank Annotated CRF",
FK_MDVLeaf = "AnnotatedCRF";
quit;
*reassign srcdata to location of _svWork data sets;
data _null_; path=pathname('_svwork'); rc=libname('srcdata');
rc=libname('srcdata',path);
run;
*create new define.xml file using updated SAS CRT-DDS data sets;
%crtdds_write(_cstCreateDisplayStyleSheet=1);
Here is example code
that includes the value-level metadata in the SC domain. The code
includes two values:
height without shoes
and
weight
without shoes
.
*Lookup OID for the SDTM 3.1.2 standard in MetaDataVersion;
proc sql noprint;
select OID into :mdv from _svWork.MetaDataVersion
where name="CDISC-SDTM 3.1.2";
quit;
*Lookup OID for the SCTEST column in ItemDefs;
proc sql noprint;
select OID into :srccol from _svWork.ItemDefs
where name='SCTEST';
quit;
*add record for a new valuelist SCTESTVALS;
proc sql ;
insert into _svWork.ValueLists
set OID= "SCTESTVALS",
FK_MetaDataVersion = "&mdv";
*add record associating the value list SCTESTVALS to the OID for SCTEST ItemDefs record;
insert into _svWork.ItemValueListRefs
set ValueListOID= "SCTESTVALS",
FK_ItemDefs = "&srccol";
*add records to the ItemDefs data set for each value in the SCTESTVAL value list;
insert into _svWork.ItemDefs
set OID= "VAL001",
Name = "SCTEST",
DataType = "text",
Length = 3,
SASFieldName = "SCTEST",
comment = "Height taken barefoot",
label="Height in inches",
FK_MetaDataVersion = "&mdv"
set OID= "VAL002",
Name = "SCTEST",
DataType = "text",
Length = 4,
SASFieldName = "SCTEST",
comment = "Weight without shoes",
label="Weight in pounds",
FK_MetaDataVersion = "&mdv";
*add records associating the value list SCTESTVALS to rows in the ItemDefs data set;
insert into _svWork.ValueListItemRefs
set ItemOID= "VAL001",
OrderNumber=1,
Mandatory="Yes",
KeySequence=1,
FK_ValueLists = "SCTESTVALS"
set ItemOID= "VAL002",
OrderNumber=2,
Mandatory="Yes",
KeySequence=2,
FK_ValueLists = "SCTESTVALS";
quit;
*reassign srcdata to location of _svWork data sets;
data _null_; path=pathname('_svwork'); rc=libname('srcdata');
rc=libname('srcdata',path);
run;
*create new define.xml file using updated SAS CRT-DDS data sets;
%crtdds_write(_cstCreateDisplayStyleSheet=1);
For the example code,
the define.xml file created contains the value-level metadata for
Height
and
Weight
for
the SCTEST column in the SC domain.
Note: If you are viewing an electronic
version of this document, you can cut and paste the example code.