Building a Validation Process

Overview

Building a SAS Clinical Standards Toolkit validation process is similar to building any SAS Clinical Standards Toolkit process. The differences are the validation process inputs and outputs, as defined in the SASReferences data set, can differ, a standard-specific validate macro is called, and process output can include an optional Metrics data set.
This table shows the standard-specific validation macros for all SAS Clinical Standards Toolkit standards that support validation.
Standard-Specific Validation Macros for Standards Supporting Validation
Standard and Version
Validation Macro
CDISC-ADAM 2.1
adam_validate
CDISC-CRTDDS 1.0
crtdds_validate
CDISC-CT 1.0.0
ct_validate
CDISC-ODM (all)
odm_validate
CDISC-SDTM (all)
sdtm_validate
CST-FRAMEWORK 1.2
cstvalidate
The remainder of this section uses SDTM 3.1.3 as an example.

SASReferences Customizations

A SAS Clinical Standards Toolkit validation process requires that you specify a reference standard with which the source data and metadata can be compared. The following display shows the three records, specific to the standard and standardversion of interest, that should be included in the SASReferences data set:
Defining the Reference Standard in the SASReferences Data Set
Three records should be included in the SASReferences data set.
The empty path field signals that the path and memname information should be derived from the StandardSASReferences data set associated with the standard and standardversion. Including the referencecontrol and referencemetadata records is unique to validation process in the SAS Clinical Standards Toolkit.
The SAS Clinical Standards Toolkit validation can include references to these files:
  1. A validation-specific properties file.
    Defining the Validation-Specific Properties File in the SASReferences Data Set
    Validation-specific properties file
    The Validation.Properties file sets process global macro variables specific to validation, such as metrics. For a complete discussion of these properties, see Validation.Properties. For information about the derived global macro variables, see Global Macro Variables. The Validation.Properties file is a required file to support the SAS Clinical Standards Toolkit validation.
    Validation properties do not need to be separately referenced in SASReferences.
  2. The output location of any process-generated Metrics data set.
    Defining the Metrics Output Location in the SASReferences Data Set
    Definition of the output location
    The Metrics data set provides a summary of the validation process, including error counts, processing time, and denominators for specific checks. For a complete discussion of validation metrics, see Validation Metrics and Validation Results and Metrics. For information about the global macro variables that govern metrics output, see Global Macro Variables. The Metrics data set is typically output to the same location as the validation Results data set. This location is common to all SAS Clinical Standards Toolkit processes.
  3. The location of any libraries containing controlled terminology, format catalogs, and coding dictionary data sets.
    Defining the Location of Controlled Terminology in the SASReferences Data Set
    Defining the location of controlled terminology in the SASReferences data set
    The type=fmtsearch records enable you to specify multiple format catalogs (for example, company-wide, compound, group-level, and study-level). Order in the format search path is set by the order field. The type=referencecterm record enables you to specify one or more lookup data sets (such as dictionary lookups like LOINC and MedDRA). These lookup data sets do not need to conform to a specific structure, and they do not need to be in a structure that can be read into a SAS format. Customized code (typically in the Validation Master codelogic field) is required to join domain data with each associated lookup data set.
  4. The location of the run-time Validation Control data set.
    Defining the Run-Time Validation Control Location in the SASReferences Data Set
    Defining the run-time Validation Control location in the SASReferences data set
The Validation Control data set is required and discussed in the following section.

Validation Control: Specification of Run-Time Checks

Each SAS Clinical Standards Toolkit validation process requires you to specify the validation checks to be run. This is accomplished by cloning, subsetting, or building a set of validation checks based on the Validation Master data set. (See Validation Check Metadata: Validation Master.) The SAS Clinical Standards Toolkit assumes that each Validation Control data set is structurally equivalent to the Validation Master data set.
A sample CDISC SDTM 3.1.3 Validation Control data set is deployed to this directory:
sample study library directory/cdisc-sdtm-3.1.3–1.7/sascstdemodata/control
By default, the Validation Control data set name is validation_control.sas7bdat.
As a required input to a validation process, the Validation Control data set must be referenced in the run-time SASReferences file. (See Defining the Run-Time Validation Control Location in the SASReferences Data Set.)
The &studyRootPath value is assumed to have been set to sample study library directory/cdisc-sdtm-3.1.3/sascstdemodata.
The Validation Master data set (illustrated in Defining the Reference Standard in the SASReferences Data Set and in this display) serves as the source for Validation Control content. Note that in this display, the path and memname information have been derived from the StandardSASReferences data set and points to the global standards library.
Defining Validation Control Data Set Location
Defining the Validation Control data set in the run-time SASReferences file
The following table provides examples of how to create a Validation Control data set from the Validation Master data set. The sample code is written assuming that the code will be submitted in a context where libraries have been allocated and the format search and autocall paths have been set.
Sample Code to Create Validation Control Data Set
Check Subset
Sample Code
All checks provided with the SAS Clinical Standards Toolkit.
data control.validation_control;
set refcntl.validation_master;
run;
Structural checks (metadata-only checks that do not require access to the domain data).
data control.validation_control;
set refcntl.validation_master (where=(upcase(checktype)="METADATA"));run;
Content checks (checks that require access to the domain data).
data control.validation_control;
set refcntl.validation_master (where=(upcase(checktype) ne "METADATA"));
run;
Checks with a production status.
data control.validation_control;
set refcntl.validation_master (where=(checkstatus>0));
run;
Sampling of checks, one for each check macro.
proc sort data=refcntl.validation_master out=work.control;
by codesource checkid;
run;
data work.control;
set work.control;
by codesource;
if first.codesource;
run;
proc sort data=work.control out=control.validation_control (label="Check sampler");
by checkid;
run;
Checks new to CDISC SDTM 3.1.3.
data control.validation_control;
set refcntl.validation_master (where=(standardVersion = "3.1.3"));
run;
All codelist-related checks (checks that use the %CSTCHECK_NOTINCODELIST macro).
data control.validation_control;
set refcntl.validation_master (where=(upcase(checksource)="CSTCHECK_NOTINCODELIST"));
run;
Generally, the SAS Clinical Standards Toolkit processes validation checks in the order in which they appear in the Validation Control data set. Each validation process honors the default validation property _cstCheckSortOrder. If this property is not set, then the data set order is assumed. As a part of the Validation Control derivation, checks can be sorted in any user-defined order. Or, _cstCheckSortOrder can be set to sort the Validation Control data set at run time by any fields in that data set.
Tip
Best Practice Recommendation: You might find the prioritization of checks to be helpful in identifying problems early in the process, or for using as prerequisites for checks that follow.

Setting Properties for the Validation Process

Across all standards, the set of properties that are available for a validation process is extensive. (For more information about the full set of validation properties, see Global Macro Variables.) However, only a few properties are modified on a regular basis. These include:
  • _cstSASRefsLoc, If you want to point to another location for the SASReferences file.
  • _cstSASRefsName, which points to another SASReferences filename.
  • _cstSASRefs, which points to a specific libref.sasreferences file to use. (This file is typically in Work.)
  • _cstSubjectColumns, which provides a space-delimited list of the columns that identify a subject.
  • _cstReallocateSASRefs, which reallocates SAS librefs and filerefs in the same SAS session, which is important when changing studies or standards.
  • _cstFMTLibraries, which modifies the format search path built from SASReferences. This change is most often used to add a reference to a Work format catalog.
  • _cstCheckSortOrder, which provides a set of Validation Control columns to re-sort the check processing order.
  • _cstMetrics, set to 1 to enable metrics calculations and reporting.
  • _cstDebug, which turns on or off debugging for the session.
  • _cstDebugOptions, which alters the SAS options when debugging.
These changes should be made before the process setup begins (as changes to the properties file), or after the process setup ends (as a series of %let statements in the code stream).
Tip
Best Practice Recommendation: Centralizing property changes in properties files, rather than distributing them in code segments, offers advantages for debugging and documenting processes. Properties are translated to global macro variables by calls to the %CST_SETSTANDARDPROPERTIES or %CST_SETPROPERTIES framework utility macros during process setup. They are reported in the SAS log, and are generally documented in the process SASReferences file.