Skip to content

fix: rules with a class scope now fire when no datasets of that class are present - #561

Draft
enrymather-Verisian wants to merge 2 commits into
mainfrom
enrico/fix/skipping-rule-when-domain-class-empty
Draft

fix: rules with a class scope now fire when no datasets of that class are present#561
enrymather-Verisian wants to merge 2 commits into
mainfrom
enrico/fix/skipping-rule-when-domain-class-empty

Conversation

@enrymather-Verisian

Copy link
Copy Markdown

Rules focusing on a specific domain class (e.g. TRIAL DESIGN for CORE-002056) were silently skipped when the submission contained no datasets belonging to that class. This happened because, if none of the datasets passed the within_rule_scope class filter, the rule never fired.
Fixed by detecting if every available dataset has been filtered out by the class filter and then running the rule once against any available dataset, so study-level checks can fire successfully.


# for a study-level rule that check for the presence of an entire class of datasets,
# when none of the required datasets exist, the rule still needs to execute
if not any_suitable_found and all_datasets:

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just add and extra "and is_study_sensitivity" to the end of this if statement and you're good <3

@YetiGonk
YetiGonk requested a review from rich-verisian July 21, 2026 11:26
@enrymather-Verisian
enrymather-Verisian marked this pull request as draft July 21, 2026 11:46
@enrymather-Verisian

Copy link
Copy Markdown
Author

Converted to draft - will keep for the future but for now we'll use a simpler, less restrictive approach, i.e. to just change rule scope to ALL, which makes rules like CORE-002056 work without engine changes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants