%cst_createdsfromtemplate( _cstStandard=CDISC-DEFINE-XML, _cstStandardVersion=2.0.0, _cstType=studymetadata, _cstSubType=study, _cstOutputDS=work.source_study );
sample study library directory/cdisc-definexml-2.0.0–1.7/programs
data work.studymetadata; studyname="CDISC01"; studydescription="CDISC Test Study"; protocolname="CDISC01"; studyversion="MDV.CDISC01.SDTMIG.3.1.2.SDTM.1.2"; run;
%define_createsrcmetafromsaslib( _cstTrgStandard=&_cstTrgStandard, _cstTrgStandardVersion=&_cstTrgStandardVersion, _cstLang=en, _cstUseRefLib=Y, _cstKeepAllCodeLists=N ); %define_createsrcmetafromsaslib( _cstSASDataLib=srcdata, _cstStudyMetadata=work.studymetadata, _cstTrgStandard=&_cstTrgStandard, _cstTrgStandardVersion=&_cstTrgStandardVersion, _cstTrgStudyDS=trgmeta.source_study, _cstTrgTableDS=trgmeta.source_tables, _cstTrgColumnDS=trgmeta.source_columns, _cstTrgCodeListDS=trgmeta.source_codelists, _cstTrgValueDS=trgmeta.source_values, _cstTrgDocumentDS=trgmeta.source_documents, _cstTrgAnalysisResultDS=trgmeta.source_analysisresults, _cstLang=en, _cstUseRefLib=Y, _cstRefTableDS=refmeta.reference_tables, _cstRefColumnDS=refmeta.reference_columns, _cstClassTableDS=refmeta.class_tables, _cstClassColumnDS=refmeta.class_columns, _cstKeepAllCodeLists=Y, _cstFormatCatalogs=cstfmt.formats ncifmt.cterms, _cstNCICTerms=ncifmt.cterms );
aliases
|
itemrefwhereclauserefs
|
codelistitems
|
itemvaluelistrefs
|
codelists
|
mdvleaf
|
definedocument
|
mdvleaftitles
|
documentrefs
|
metadataversion
|
enumerateditems
|
methoddefs
|
externalcodelists
|
pdfpagerefs
|
formalexpressions
|
study
|
itemdefs
|
translatedtext
|
itemgroupdefs
|
valuelistitemrefs
|
itemgroupitemrefs
|
valuelists
|
itemgroupleaf
|
whereclausedefs
|
itemgroupleaftitles
|
whereclauserangechecks
|
itemorigin
|
whereclauserangecheckvalues
|
analysisdataset
|
analysisresultdisplays
|
analysisdatasets
|
analysisresults
|
analysisdocumentation
|
analysisvariables
|
analysisprogrammingcode
|
analysiswhereclauserefs
|
sample study library directory/cdisc-definexml-2.0.0–1.7/programs
%define_createsrcmetafromdefine( _cstTrgStandard=&_cstTrgStandard, _cstTrgStandardVersion=&_cstTrgStandardVersion, _cstLang=en, _cstUseRefLib=Y ); %define_createsrcmetafromdefine( _cstDefineDataLib=srcdata, _cstTrgStandard=&_cstTrgStandard, _cstTrgStandardVersion=&_cstTrgStandardVersion, _cstTrgMetaLibrary=trgmeta, _cstTrgStudyDS=trgmeta.source_study, _cstTrgTableDS=trgmeta.source_tables, _cstTrgColumnDS=trgmeta.source_columns, _cstTrgCodeListDS=trgmeta.source_codelists, _cstTrgValueDS=trgmeta.source_values, _cstTrgDocumentDS=trgmeta.source_documents, _cstTrgAnalysisResultDS=trgmeta.source_analysisresults, _cstLang=en, _cstUseRefLib=Y, _cstRefTableDS=refmeta.reference_tables, _cstRefColumnDS=refmeta.reference_columns, _cstClassTableDS=refmeta.class_tables, _cstClassColumnDS=refmeta.class_columns, _cstReturn=_cst_rc, _cstReturnMsg=_cst_rcmsg );
sample study library directory/cdisc-definexml-2.0.0–1.7/programs
%**********************************************************************************; %* Define libnames for input *; %**********************************************************************************; %* Original CRT-DDS v1 source metadata for SDTM 3.1.2 in CST 1.7; libname crtdds "&studyRootPath/sascstdemodata/metadata"; %**********************************************************************************; %* Define libnames for output *; %**********************************************************************************; %* Migrated Define-XML v2 source metadata; libname defv2 "&studyOutputPath/derivedstudymetadata_crtdds/%lowcase(&_cstTrgStandard)- &_cstTrgStandardVersion"; %**********************************************************************************; %* Define formats *; %**********************************************************************************; *********************************************************************; * Set CDISC NCI Controlled Terminology version for this process. *; *********************************************************************; %cst_getstandardsubtypes(_cstStandard=CDISC-TERMINOLOGY,_cstOutputDS=work._cstStdSubTypes); data _null_; set work._cstStdSubTypes (where=(standardversion="&_cstTrgStandard" and isstandarddefault='Y')); * User can override CT version of interest by specifying a different where clause: *; * Example: (where=(standardversion="&_cstTrgStandard" and standardsubtypeversion='201104'))*; call symputx('_cstCTPath',path); call symputx('_cstCTMemname',memname); run; proc datasets lib=work nolist; delete _cstStdSubTypes; quit; run; %* SDTM Study formats in CST 1.7; libname studyfmt "&studyRootPath/sascstdemodata/terminology/formats"; %* CDISC-NCI Terminology to be used in CST 1.7; libname ncisdtm "&_cstCTPath"; %* Formats to be used for SDTM; options fmtsearch = (studyfmt.formats ncisdtm.&_cstCTMemname);
%**********************************************************************************; %* Create some formats for mapping *; %**********************************************************************************; proc format; value $_cststd /* Maps from CRT-DDS values to required Define-XML v2 values */ "CDISC SDTM"="SDTM-IG" "CDISC SEND"="SEND-IG" "CDISC ADAM"="ADAM-IG" ; value $_cstdom /* Map to ItemGroup/@Domain attribute */ "QSCG" = "QS" "QSCS" = "QS" "QSMM" = "QS" ; value $_cstdomd /* Map to ItemGroup/Alias[@Context='DomainDescription']/@Name attribute */ "QSCG" = "Questionnaires" "QSCS" = "Questionnaires" "QSMM" = "Questionnaires" ; value $_cstcls /* Maps from CRT-DDS values to required Define-XML v2 values */ "SPECIAL PURPOSE DOMAINS" = "SPECIAL PURPOSE" "SPECIAL PURPOSE DATASETS" = "SPECIAL PURPOSE" "FINDINGS ABOUT" = "FINDINGS" "ADSL" = "SUBJECT LEVEL ANALYSIS DATASET" "ADAE" = "ADAM OTHER" "BDS" = "BASIC DATA STRUCTURE" ; value $_cstvlm /* For SDTM maps to variables that are being described by Value Level Metadata */ "EG.EGTESTCD" = "EGORRES" "IE.IETESTCD" = "IEORRES" "TI.IETESTCD" = "IECAT" "LB.LBTESTCD" = "LBORRES" "PE.PETESTCD" = "PEORRES" "SC.SCTESTCD" = "SCORRES" "VS.VSTESTCD" = "VSORRES" "SUPPAE.QNAM" = "QVAL" ; run;
%**********************************************************************************; %* Define the studyversion macro variable. *; %* This will become the MetaDataVersion/@OID attribute *; %* In CRT-DDS this was the source_study.definedocumentname column *; %* Also define the SASRef macro variable to use for the SASRef column in the *; %* source_xxx data sets. *; %**********************************************************************************; proc sql noprint; select definedocumentname, SASRef into :studyversion, :SASRef from crtdds.source_study; quit; %**********************************************************************************; %* Migrate source tables *; %**********************************************************************************; %cstutilmigratecrtdds2define(_cstSrcLib=crtdds, _cstSrcDS=source_study, _cstTrgDS=defv2.source_study, _cstStudyVersion=&studyversion, _cstStandard=&_cstTrgStandard, _cstCheckValues=Y); %cstutilmigratecrtdds2define(_cstSrcLib=crtdds, _cstSrcDS=source_tables, _cstTrgDS=defv2.source_tables, _cstStudyVersion=&studyversion, _cstStandard=&_cstTrgStandard, _cstCheckValues=Y); %cstutilmigratecrtdds2define(_cstSrcLib=crtdds, _cstSrcDS=source_columns, _cstTrgDS=defv2.source_columns, _cstStudyVersion=&studyversion, _cstStandard=&_cstTrgStandard, _cstCheckValues=Y); %cstutilmigratecrtdds2define(_cstSrcLib=crtdds, _cstSrcDS=source_values, _cstTrgDS=defv2.source_values, _cstStudyVersion=&studyversion, _cstStandard=&_cstTrgStandard, _cstCheckValues=Y); %cstutilmigratecrtdds2define(_cstSrcLib=crtdds, _cstSrcDS=source_documents, _cstTrgDS=defv2.source_documents, _cstStudyVersion=&studyversion, _cstStandard=&_cstTrgStandard, _cstCheckValues=Y);
%**********************************************************************************; %* Create source_codelists *; %**********************************************************************************; %* Get formats ; %cstutilgetncimetadata( _cstFormatCatalogs=, _cstNCICTerms=ncisdtm.cterms, _cstLang=en, _cstStudyVersion=&studyversion, _cstStandard=&_cstTrgStandard, _cstStandardVersion=&_cstTrgStandardVersion, _cstFmtDS=work._cstformats, _cstSASRef=&SASRef, _cstReturn=_cst_rc, _cstReturnMsg=_cst_rcmsg ); %* Create a data set with all applicable formats. ; data work.cl_column_value(keep=xmlcodelist); set defv2.source_columns defv2.source_values; xmlcodelist=upcase(xmlcodelist); if xmlcodelist ne ''; run; proc sort data=work.cl_column_value nodupkey; by xmlcodelist; run; %* Only keep applicable formats. ; proc sql; create table defv2.source_codelists as select nci.* from work._cstformats nci, work.cl_column_value cv where (upcase(compress(nci.codelist, '$')) = upcase(compress(cv.xmlcodelist, '$'))) ; quit;
%**********************************************************************************; %* Updates for External Controlled Terminology *; %**********************************************************************************; proc sql; insert into defv2.source_codelists (sasref, codelist, codelistname, codelistdatatype, dictionary, version, studyversion, standard, standardversion) values ("&SASRef", "CL.AEDICT", "Adverse Event Dictionary", "text", "MEDDRA", "8.0", "&studyversion", "&_cstTrgStandard", "&_cstTrgStandardVersion") values ("&SASRef", "CL.DRUGDCT", "Drug Dictionary", "text", "WHODRUG", "200204", "&studyversion", "&_cstTrgStandard", "&_cstTrgStandardVersion") ; quit; data defv2.source_columns; set defv2.source_columns; if table="AE" and column in ("AEDECOD" "AEBODSYS") then xmlcodelist="CL.AEDICT"; if table="CM" and column in ("CMDECOD" "CMCLAS" "CMCLASCD") then xmlcodelist="CL.DRUGDCT"; run;