Rule Description: The rule checks for presence of TRTxxAN and non presence of TRTxxA in ADSL
Describe the problem
How to handle the subscripts on the variable names metadata, which xx ranges from 01-99. If the numerical variable is present e.g TRT01AN then TRT01A must also be present.
Describe the solution
Solution was discussed at weekly meet, where variables would be extracted and compared to/matched to a regular expression to confirm presence. This would use the exisiting reg_match operator to compare against general pattern e.g 'value: ^TRT[0-9]{2}AN*' . This part currently exists.
However the solution proposes a new operation using regex via a find and replace operation using regex capture buffers to extract the xx value from the primary variable and use this to create the shorten name (minus the "n") of the second variable. This will then be used to define the second predicate in the rule logic.
Proposed rule logicyaml
Check:
all:
name: variable_name # e.g. TRT11AN
operator: matches_regex # test 1 exist clause
value: ^TRT[0-9]{2}AN*$
Links to related JIRA Tickets
Rule Information
Describe the problem How to handle the subscripts on the variable names metadata, which xx ranges from 01-99. If the numerical variable is present e.g TRT01AN then TRT01A must also be present.
Describe the solution Solution was discussed at weekly meet, where variables would be extracted and compared to/matched to a regular expression to confirm presence. This would use the exisiting reg_match operator to compare against general pattern e.g 'value: ^TRT[0-9]{2}AN*' . This part currently exists.
However the solution proposes a new operation using regex via a find and replace operation using regex capture buffers to extract the xx value from the primary variable and use this to create the shorten name (minus the "n") of the second variable. This will then be used to define the second predicate in the rule logic.
Proposed rule logic
yaml
Check: all:
new test clause using the new operation
Screenshots If applicable, add screenshots to help explain your problem and solution.