|
1 | 1 | # Check Parameters |
2 | 2 |
|
3 | | -## Overview |
4 | | - |
5 | | -Check parameters are configuration elements that define how validation rules are applied within the CDISC rules engine. These parameters control the behavior, scope, and criteria for data validation checks across clinical trial datasets. Each parameter serves a specific purpose in customizing rule logic to ensure data integrity and compliance with CDISC standards. |
6 | | - |
7 | | -The rules engine uses these parameters to construct validation logic that can be applied to various datasets to identify data inconsistencies, missing values, invalid formats, and other quality issues. |
8 | | - |
9 | | -## Parameter Definitions |
10 | | - |
11 | | -### comparator |
12 | | -Specifies the column/variable name that provides the comparison values for validation rules. In the rules engine implementation, this parameter is processed through `replace_prefix()` and used to extract values for comparison operations. For example, in the `has_next_corresponding_record` operator, the comparator column's next row value is compared against the target column's current row value. |
13 | | - |
14 | | -```yaml |
15 | | -- name: "VSTESTCD" |
16 | | - operator: "has_next_corresponding_record" |
17 | | - target: "VSTESTCD" |
18 | | - comparator: "VSTESTCD" # Column providing comparison values |
19 | | - within: "USUBJID" |
20 | | - ordering: "VISITNUM" |
21 | | -``` |
22 | | -
|
23 | | -### context |
24 | | -
|
25 | | -### date_component |
26 | | -Specifies which component of a date/datetime variable should be validated. Available options include: |
27 | | -- year |
28 | | -- month |
29 | | -- day |
30 | | -- hour |
31 | | -- minute |
32 | | -- second |
33 | | -- microsecond |
34 | | -
|
35 | | -### name |
36 | | -Identifies the specific variable or field name that the validation rule targets. This parameter links the rule to the appropriate data element within the dataset. |
37 | | -
|
38 | | -### negative |
39 | | -Boolean parameter used with the `invalid_duration` operator to specify whether negative durations should be considered valid (True) or invalid (False). |
40 | | - |
41 | | -```yaml |
42 | | -- name: "BRTHDTC" |
43 | | - operator: "invalid_duration" |
44 | | - negative: False |
45 | | -``` |
46 | | - |
47 | | -In this example, the rule will flag any negative durations in the DURVAR variable as invalid. If `negative` were set to `true`, negative durations would be considered valid and not raise issues. |
48 | | - |
49 | | -### operator |
50 | | -Defines the specific validation operation to be performed. This parameter determines the type of check the engine will execute (e.g., equal_to, not_null, within_range, invalid_duration). |
51 | | - |
52 | | -### order |
53 | | -Specifies the sort order for validation results or data processing. Available options: |
54 | | -- asc (ascending) |
55 | | -- dsc (descending) |
56 | | - |
57 | | -This parameter helps organize validation outputs and can influence how rules are applied to ordered data. |
58 | | - |
59 | | -### ordering |
60 | | -Specifies the column name used to sort data before applying validation rules. In the rules engine, this parameter is processed through `replace_prefix()` and used in `sort_values()` operations to establish the correct sequence for row-by-row comparisons. Critical for operators that depend on data order, such as `has_next_corresponding_record`. |
61 | | - |
62 | | -Example usage: |
63 | | -```yaml |
64 | | -ordering: "VISITNUM" # Sort by visit number to ensure proper sequence |
65 | | -``` |
66 | | - |
67 | | -### separator |
68 | | -Specifies the delimiter character(s) used to split string values into parts for comparison. Used by operators that validate paired data formats to ensure both parts have equal precision or completeness. Default value is "/" (forward slash) if not specified. |
69 | | - |
70 | | -Example usage: |
71 | | -```yaml |
72 | | -- name: "--DTC" |
73 | | - operator: "split_parts_have_equal_length" |
74 | | - separator: "/" # Split by forward slash for date intervals |
75 | | -``` |
76 | | - |
77 | | -Used with operators: |
78 | | -- `split_parts_have_equal_length` - Validates that both parts of a split string have equal length |
79 | | -- `split_parts_have_unequal_length` - Validates that parts have different lengths (complement) |
80 | | - |
81 | | -### prefix |
82 | | -Specifies a string prefix that should be present at the beginning of a variable's value. Used for format validation and standardization checks. |
83 | | - |
84 | | -### suffix |
85 | | -Specifies a string suffix that should be present at the end of a variable's value. Complements prefix validation for comprehensive format checking. |
86 | | - |
87 | | -### regex |
88 | | -Specifies a regular expression pattern used to extract portions of string values before performing validation operations. |
89 | | - |
90 | | - |
91 | | -### target |
92 | | -Specifies the primary column/variable name that the validation rule evaluates. In the rules engine implementation, this parameter is processed through `replace_prefix()` and represents the column whose values are being validated. The target column typically contains the data being checked for compliance or consistency. The results of validation rules are typically reported for the target variable. |
93 | | - |
94 | | -### value |
95 | | -Contains the reference value or criteria against which the validation check is performed. The interpretation of this parameter depends on the `value_is_literal` setting. |
96 | | - |
97 | | -### value_is_literal |
98 | | -Boolean parameter that signifies whether the string in the value key should be treated as a literal string. When value_is_literal is false or not specified, the string in the value key will be interpreted as a variable name in the dataset. |
99 | | - |
100 | | -> IDVAR = "VISIT" as a value, not IDVAR = VISIT as a variable in the dataset |
101 | | - |
102 | | -```yaml |
103 | | -- "name": "IDVAR" |
104 | | - "operator": "equal_to" |
105 | | - "value": "VISIT" |
106 | | - "value_is_literal": true |
107 | | -``` |
108 | | - |
109 | | - |
110 | | -# Operation Parameters |
111 | | - |
112 | | -The rules engine uses operation parameters defined in the JSON schema to configure how operations execute. These parameters are specified by users in YAML operation definitions and work in conjunction with check parameters to provide comprehensive validation capabilities. |
113 | | - |
114 | | -### attribute_name |
115 | | -Specifies the metadata attribute name to extract from variable definitions. Used in operations like `define_variable_metadata` to retrieve specific metadata properties such as variable labels, core status, or other attributes. |
116 | | - |
117 | | -### case_sensitive |
118 | | -Boolean flag that controls whether string comparisons in operations should be case-sensitive. Default is `True`. If not explicitly specified, string comparisons will be case-sensitive. Used in external dictionary validation operations to allow flexible matching. |
119 | | - |
120 | | -Examples: |
121 | | - |
122 | | -Default behavior (case-sensitive): |
123 | | -```yaml |
124 | | -- operator: valid_external_dictionary_value |
125 | | - # case_sensitive is not specified, so it defaults to True |
126 | | - case_sensitive: false # Enable case-insensitive matching |
127 | | -``` |
128 | | - |
129 | | -### codelist |
130 | | -Specifies the name of a controlled terminology codelist for validation operations. Used with codelist-related operations to determine valid values. |
131 | | - |
132 | | -### codelist_code |
133 | | -Contains the specific code value within a codelist. Used in operations that need to reference particular codelist entries. |
134 | | - |
135 | | -### codelists |
136 | | -List of multiple codelist names for operations that work with multiple controlled terminology codelists simultaneously. |
137 | | - |
138 | | -### ct_attribute |
139 | | -Specifies the controlled terminology attribute to retrieve, such as "Term CCODE" or other CT-specific attributes. |
140 | | - |
141 | | -### ct_package_type |
142 | | -Single CT package type identifier. Valid values include: "ADAM", "CDASH", "COA", "DDF", "DEFINE-XML", "GLOSSARY", "MRCT", "PROTOCOL", "QRS", "QS-FT", "SDTM", "SEND", "TMF". |
143 | | - |
144 | | -### ct_package_types |
145 | | -List of CT package types to include in operations. References the `ct_package_type` enumeration. |
146 | | - |
147 | | -### ct_packages |
148 | | -List of multiple controlled terminology packages. Used when operations need to work across multiple CT packages. |
149 | | - |
150 | | -### ct_version |
151 | | -Specifies the version of controlled terminology to use in validation operations. |
152 | | - |
153 | | -### dictionary_term_type |
154 | | -Classification of external dictionary terms. Valid values include: "LLT", "PT", "HLT", "HLGT", "SOC". Used in MedDRA and other external dictionary operations. |
155 | | - |
156 | | -### domain |
157 | | -Specifies the domain or data structure context for the operation. References Dataset or DataStructure definitions. |
158 | | - |
159 | | -### external_dictionary_type |
160 | | -Type of external dictionary to use. Currently supports "meddra" for MedDRA validation operations. |
161 | | - |
162 | | -### filter |
163 | | -Dictionary containing filter criteria for conditional validation. When specified, operations work only on data subsets that meet the filter criteria. |
164 | | - |
165 | | -```yaml |
166 | | -filter: |
167 | | - AESEV: "SEVERE" # Only process severe adverse events |
168 | | - AEOUT: "FATAL" # Only process fatal outcomes |
169 | | -``` |
170 | | - |
171 | | -### filter_key |
172 | | -String parameter used for filtering operations. Works with filter-related functionality. |
173 | | - |
174 | | -### filter_value |
175 | | -String parameter that specifies the value to filter by. Used in conjunction with filter operations. |
176 | | - |
177 | | -### group |
178 | | -List of variable names used for grouping data before applying operations. Used to ensure operations are applied within appropriate data boundaries. |
179 | | - |
180 | | -### group_aliases |
181 | | -Alternative names for grouping variables that allow grouped results to be merged back to datasets using different column names. |
182 | | - |
183 | | -```yaml |
184 | | -group: |
185 | | - - USUBJID |
186 | | - - IDVARVAL |
187 | | -group_aliases: |
188 | | - - USUBJID |
189 | | - - GROUPID # Rename IDVARVAL to GROUPID for merging |
190 | | -``` |
191 | | - |
192 | | -### id |
193 | | -String identifier for the operation result. Used to reference operation outputs in subsequent rule logic. |
194 | | - |
195 | | -### key_name |
196 | | -Specifies the metadata attribute name for filtering operations. Valid values include: "definition", "examples", "label", "name", "notes", "ordinal", "role", "simpleDatatype", "variableCcode". |
197 | | - |
198 | | -### key_value |
199 | | -Works with `key_name` to specify the metadata value to filter by. Returns variables that match the specified key-value pair. |
200 | | - |
201 | | -```yaml |
202 | | -- operator: get_model_filtered_variables |
203 | | - key_name: "role" |
204 | | - key_value: "Timing" # Find variables with role = "Timing" |
205 | | -``` |
206 | | - |
207 | | -### level |
208 | | -Specifies the level of data to retrieve from controlled terminology operations. Valid values are "codelist" or "term" to determine whether to return codelist-level or term-level data. |
209 | | - |
210 | | -### map |
211 | | -List of mapping dictionaries for value transformations. Each dictionary contains input column names as properties and an `output` property specifying the result value. |
212 | | - |
213 | | -### name |
214 | | -Variable name that the operation targets. Used to specify which column or variable the operation should process. |
215 | | - |
216 | | -### operator |
217 | | -String that specifies the operation type to execute. Must match one of the defined operation types in the schema. |
218 | | - |
219 | | -### returntype |
220 | | -Expected return type for operation results. Valid values are "code" (for NCI codes) or "value" (for submission values) in controlled terminology operations. |
221 | | - |
222 | | -### term_code |
223 | | -Terminology code value used in controlled terminology operations for code-based lookups. |
224 | | - |
225 | | -### term_value |
226 | | -Terminology term value used in controlled terminology operations for value-based lookups. |
227 | | - |
228 | | -### version |
229 | | -Version parameter used in codelist operations that require version-specific processing or validation. |
230 | | - |
231 | | -### within |
232 | | -Specifies the column name used for grouping data before applying validation rules. In the rules engine implementation, this parameter is processed through `replace_prefix()` and used in `groupby()` operations to ensure validation logic is applied within appropriate data boundaries (e.g., by subject, by study). |
233 | | - |
234 | | -Example usage: |
235 | | -```yaml |
236 | | -within: "USUBJID" # Group by subject ID to keep validations within subject data |
237 | | -``` |
238 | | - |
239 | | -This parameter is essential for maintaining data integrity boundaries and preventing inappropriate cross-subject or cross-study comparisons. |
| 3 | +[](https://raw.githubusercontent.com/cdisc-org/cdisc-rules-engine/main/resources/schema/rule/check_parameter.md ":include") |
0 commit comments