TIG use case harmonization#1725
Open
SFJohnson24 wants to merge 9 commits intomainfrom
Open
Conversation
RamilCDISC
requested changes
May 7, 2026
| cache_path: str = os.path.join(os.path.dirname(__file__), cache) | ||
|
|
||
| if standard == "tig": | ||
| if not substandard or not use_case: |
Collaborator
There was a problem hiding this comment.
The readme says that the use case must be given for TIG custom standard. We can keep this check then here and update the error message. Right now the missing use case is only checked deep in the rule execution which can give users unhandled exceptions.
Collaborator
Author
There was a problem hiding this comment.
use_case is not required--- only substandard--I will adjust readme
gerrycampion
requested changes
May 8, 2026
| use_cases = [uc.strip() for uc in use_cases.split(",")] | ||
| return use_case in use_cases | ||
|
|
||
| is_custom_domain = domain_to_check[0].upper() in ("X", "Y", "Z") |
Collaborator
There was a problem hiding this comment.
should this use sdtm_utilities.is_custom_domain?
- Determine the 2-character domain code. a. To eliminate the risk of using a name that CDISC later determines to have a different meaning, domain codes beginning with the letters X, Y, and Z have been reserved for the creation of custom domains. Any letter or number may be used in the second position. The use of codes beginning with X, Y, or Z is optional, and not required for custom domains.
| NONCLIN = "NONCLIN" | ||
| ANALYSIS = "ANALYSIS" | ||
|
|
||
| # NOTE: this may need to be expanded after the pilot re: custom domains, other applicable domains, etc. The |
| type=click.Choice(["INDH", "PROD", "NONCLIN", "ANALYSIS"], case_sensitive=True), | ||
| help=( | ||
| "CDISC TIG Use Case for scoping a TIG Validation." | ||
| "CDISC TIG Use Case for scoping a TIG Custom Domains." |
Collaborator
There was a problem hiding this comment.
sentence doesn't make sense
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request introduces significant improvements to how TIG validation handles use cases and domain applicability, especially for custom domains. The main changes restores the centralized mapping of allowed domains per use case and substandard that was previously implemented.
Enhancements to use case and domain validation logic:
USE_CASE_DOMAINSmapping incdisc_rules_engine/constants/use_cases.pythat defines which domains are allowed for each use case and substandard, laying the groundwork for robust and extensible validation logic.rule_applies_to_use_caseincdisc_rules_engine/utilities/rule_processor.pyto use the new mapping for determining if a rule applies to a dataset's domain and use case, with special handling for custom domains (XYZ-prefixed) and supplementary datasets. This logic now raises a clear error if a custom domain is used without specifying a use case.is_suitable_for_validationand its callers to pass the new required parameters (standard_substandard,dataset_metadata, andcustom_domain_use_case) for accurate rule applicability checks. [1] [2] [3] [4]CLI and documentation updates:
README.mdandcore.pyto specify that--use-caseis required for custom domains in TIG validation, and improved error handling for missing required arguments. [1] [2] [3]Testing improvements:
tests/unit/test_utilities/test_rule_processor.pyto cover a wide range of scenarios, including standard domains, custom domains, supplementary datasets, and error handling for missing use cases.These changes together make TIG validation more robust, transparent, and easier to maintain, especially as support for custom domains expands.