A class that creates the indicator in SQL form which evaluates whether any of the target columns match the specified definition codes under the conditions defined by the filter columns and lookup values. The matching will only be applied to those target columns that are in the same order as the filter columns and satisfy the conditions in lookup values, ensuring that the indicator is TRUE if at least one such target column satisfies the matching criteria.

MatchAnyWhere(
  rule_engine,
  indicator_name,
  target_columns,
  definition_codes,
  filter_columns,
  lookup_values,
  regex_prefix_search = FALSE
)

Arguments

rule_engine

Object of class RuleEngine.The rule engine containing the dataset where the indicators will be applied.

indicator_name

Character. A string representing the name of the indicator, assigned to the `name` property.

target_columns

List of characters. Column names where the values from `definition_codes` will be searched. Searches will only be performed in the corresponding column of `target_columns` if the condition is met in the column of the same index in `filter_columns`.

definition_codes

List of characters. A set of codes used to define the matching criteria applied to `target_columns`.

filter_columns

List of characters. Column names that define the conditions under which the `lookup_values` must hold. These conditions are evaluated in order and are directly linked to the columns of `target_columns`.

lookup_values

List of characters.A list of values used to define logical conditions that must be satisfied in the order of `filter_columns`.

Logical. Logical value indicating whether to use regex-based prefix searches (`TRUE`) or exact matches (`FALSE`).

Value

Returns an instance of MatchAnyWhere with a generated SQL rule.

Examples