Skip to content

TIG use case harmonization#1725

Open
SFJohnson24 wants to merge 9 commits intomainfrom
tig
Open

TIG use case harmonization#1725
SFJohnson24 wants to merge 9 commits intomainfrom
tig

Conversation

@SFJohnson24
Copy link
Copy Markdown
Collaborator

@SFJohnson24 SFJohnson24 commented May 6, 2026

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:

  • Added a new USE_CASE_DOMAINS mapping in cdisc_rules_engine/constants/use_cases.py that defines which domains are allowed for each use case and substandard, laying the groundwork for robust and extensible validation logic.
  • Refactored rule_applies_to_use_case in cdisc_rules_engine/utilities/rule_processor.py to 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.
  • Updated is_suitable_for_validation and its callers to pass the new required parameters (standard_substandard, dataset_metadata, and custom_domain_use_case) for accurate rule applicability checks. [1] [2] [3] [4]

CLI and documentation updates:

  • Clarified CLI help text and documentation in README.md and core.py to specify that --use-case is required for custom domains in TIG validation, and improved error handling for missing required arguments. [1] [2] [3]

Testing improvements:

  • Expanded and updated unit tests in tests/unit/test_utilities/test_rule_processor.py to 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.

@SFJohnson24 SFJohnson24 self-assigned this May 6, 2026
@SFJohnson24 SFJohnson24 requested a review from gerrycampion May 6, 2026 19:32
@SFJohnson24 SFJohnson24 requested review from RamilCDISC and gerrycampion and removed request for gerrycampion May 6, 2026 19:32
Comment thread core.py
cache_path: str = os.path.join(os.path.dirname(__file__), cache)

if standard == "tig":
if not substandard or not use_case:
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

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.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

use_case is not required--- only substandard--I will adjust readme

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")
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

should this use sdtm_utilities.is_custom_domain?

  1. 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
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

sentence is cut-off

Comment thread core.py Outdated
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."
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

sentence doesn't make sense

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.

Rollback TIG use case senarios functionality introduced in v0.15.0

3 participants