From c2da379d2789696ce464e9be2c0788be5b161b23 Mon Sep 17 00:00:00 2001 From: alexfurmenkov Date: Mon, 18 May 2026 19:00:45 +0200 Subject: [PATCH 1/7] removed underscore logic from rules --- cdisc_rules_engine/models/rule.py | 30 ++++++------------- .../models/rule_validation_result.py | 2 +- scripts/script_utils.py | 14 +-------- tests/conftest.py | 24 +++++++-------- tests/resources/CoreIssue295/SEND4.json | 6 ++-- tests/resources/Rule-CG0027.json | 16 +++++----- 6 files changed, 34 insertions(+), 58 deletions(-) diff --git a/cdisc_rules_engine/models/rule.py b/cdisc_rules_engine/models/rule.py index 090af8d5a..944a4c4de 100644 --- a/cdisc_rules_engine/models/rule.py +++ b/cdisc_rules_engine/models/rule.py @@ -38,7 +38,6 @@ def __init__(self, record_params: dict): @classmethod def from_cdisc_metadata(cls, rule_metadata: dict) -> dict: if cls.is_cdisc_rule_metadata(rule_metadata): - rule_metadata = cls.spaces_to_underscores(rule_metadata) authorities = rule_metadata.get("Authorities", []) executable_rule = { "core_id": rule_metadata.get("Core", {}).get("Id"), @@ -52,12 +51,12 @@ def from_cdisc_metadata(cls, rule_metadata: dict) -> dict: "classes": rule_metadata.get("Scope", {}).get("Classes"), "domains": rule_metadata.get("Scope", {}).get("Domains"), "entities": rule_metadata.get("Scope", {}).get("Entities"), - "rule_type": rule_metadata.get("Rule_Type"), + "rule_type": rule_metadata.get("Rule Type"), "conditions": cls.parse_conditions(rule_metadata.get("Check")), "actions": cls.parse_actions(rule_metadata.get("Outcome")), - "use_case": rule_metadata.get("Scope", {}).get("Use_Case"), + "use_case": rule_metadata.get("Scope", {}).get("Use Case"), "data_structures": rule_metadata.get("Scope", {}).get( - "Data_Structures" + "Data Structures" ), "status": rule_metadata.get("Core", {}).get("Status", {}), } @@ -65,33 +64,22 @@ def from_cdisc_metadata(cls, rule_metadata: dict) -> dict: if "Operations" in rule_metadata: executable_rule["operations"] = rule_metadata.get("Operations") - if "Match_Datasets" in rule_metadata: + if "Match Datasets" in rule_metadata: executable_rule["datasets"] = cls.parse_datasets( - rule_metadata.get("Match_Datasets") + rule_metadata.get("Match Datasets") ) - if "Output_Variables" in rule_metadata.get("Outcome", {}): + if "Output Variables" in rule_metadata.get("Outcome", {}): executable_rule["output_variables"] = rule_metadata.get("Outcome", {})[ - "Output_Variables" + "Output Variables" ] - if "Grouping_Variables" in rule_metadata: + if "Grouping Variables" in rule_metadata: executable_rule["grouping_variables"] = rule_metadata.get( - "Grouping_Variables" + "Grouping Variables" ) return executable_rule else: return rule_metadata - @classmethod - def spaces_to_underscores(cls, obj): - if isinstance(obj, dict): - return { - key.replace(" ", "_"): cls.spaces_to_underscores(value) - for key, value in obj.items() - } - if isinstance(obj, list): - return [cls.spaces_to_underscores(item) for item in obj] - return obj - @classmethod def parse_standards(cls, authorities: List[dict]) -> List[dict]: standards = [] diff --git a/cdisc_rules_engine/models/rule_validation_result.py b/cdisc_rules_engine/models/rule_validation_result.py index 01c6ca856..04fa551bd 100644 --- a/cdisc_rules_engine/models/rule_validation_result.py +++ b/cdisc_rules_engine/models/rule_validation_result.py @@ -48,7 +48,7 @@ def _get_rule_ids(self, rule: Rule, org: str) -> str: return ", ".join( sorted( { - reference.get("Rule_Identifier", {}).get("Id") + reference.get("Rule Identifier", {}).get("Id") for authority in rule.get("authorities", []) for standard in authority.get("Standards", []) for reference in standard.get("References", []) diff --git a/scripts/script_utils.py b/scripts/script_utils.py index 99d01b2d0..f08fa5d9c 100644 --- a/scripts/script_utils.py +++ b/scripts/script_utils.py @@ -526,7 +526,7 @@ def load_and_parse_rule(rule_file): with open(rule_file, "r", encoding="utf-8") as file: if file_extension in [".yml", ".yaml"]: loaded_data = yaml.safe_load(file) - return Rule.from_cdisc_metadata(replace_yml_spaces(loaded_data)) + return Rule.from_cdisc_metadata(loaded_data) elif file_extension == ".json": return Rule.from_cdisc_metadata(json.load(file)) else: @@ -612,18 +612,6 @@ def get_max_dataset_size(dataset_paths: Iterable[str]): return max_dataset_size -def replace_yml_spaces(data): - if isinstance(data, dict): - return { - key.replace(" ", "_"): replace_yml_spaces(value) - for key, value in data.items() - } - elif isinstance(data, list): - return [replace_yml_spaces(item) for item in data] - else: - return data - - def library_metadata_not_found_message(standard, version, substandard=None): version_display = (version or "").replace("-", ".") sub_part = f" substandard {substandard}" if substandard else "" diff --git a/tests/conftest.py b/tests/conftest.py index c2f4c1d8f..b04b0ea3a 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -938,14 +938,14 @@ def mock_validation_results() -> list[RuleValidationResult]: "Standards": [ { "References": [ - {"Rule_Identifier": {"Id": "CDISCRuleID4"}}, - {"Rule_Identifier": {"Id": "CDISCRuleID3"}}, + {"Rule Identifier": {"Id": "CDISCRuleID4"}}, + {"Rule Identifier": {"Id": "CDISCRuleID3"}}, ] }, { "References": [ - {"Rule_Identifier": {"Id": "CDISCRuleID2"}}, - {"Rule_Identifier": {"Id": "CDISCRuleID1"}}, + {"Rule Identifier": {"Id": "CDISCRuleID2"}}, + {"Rule Identifier": {"Id": "CDISCRuleID1"}}, ] }, ], @@ -955,8 +955,8 @@ def mock_validation_results() -> list[RuleValidationResult]: "Standards": [ { "References": [ - {"Rule_Identifier": {"Id": "FDARuleID1"}}, - {"Rule_Identifier": {"Id": "FDARuleID2"}}, + {"Rule Identifier": {"Id": "FDARuleID1"}}, + {"Rule Identifier": {"Id": "FDARuleID2"}}, ] } ], @@ -998,14 +998,14 @@ def mock_validation_results() -> list[RuleValidationResult]: "Standards": [ { "References": [ - {"Rule_Identifier": {"Id": "CDISCRuleID4"}}, - {"Rule_Identifier": {"Id": "CDISCRuleID3"}}, + {"Rule Identifier": {"Id": "CDISCRuleID4"}}, + {"Rule Identifier": {"Id": "CDISCRuleID3"}}, ] }, { "References": [ - {"Rule_Identifier": {"Id": "CDISCRuleID2"}}, - {"Rule_Identifier": {"Id": "CDISCRuleID1"}}, + {"Rule Identifier": {"Id": "CDISCRuleID2"}}, + {"Rule Identifier": {"Id": "CDISCRuleID1"}}, ] }, ], @@ -1015,8 +1015,8 @@ def mock_validation_results() -> list[RuleValidationResult]: "Standards": [ { "References": [ - {"Rule_Identifier": {"Id": "FDARuleID1"}}, - {"Rule_Identifier": {"Id": "FDARuleID2"}}, + {"Rule Identifier": {"Id": "FDARuleID1"}}, + {"Rule Identifier": {"Id": "FDARuleID2"}}, ] } ], diff --git a/tests/resources/CoreIssue295/SEND4.json b/tests/resources/CoreIssue295/SEND4.json index 51a7d99d2..a0a465511 100644 --- a/tests/resources/CoreIssue295/SEND4.json +++ b/tests/resources/CoreIssue295/SEND4.json @@ -21,7 +21,7 @@ "Description": "Raise an error when the data type in the define.xml does not correspond to the data type in the dataset", "Outcome": { "Message": "Variable datatype in the define.xml does not correspond to the data type in the dataset", - "Output_Variables": [ + "Output Variables": [ "variable_name" ] }, @@ -45,7 +45,7 @@ "Cited_Guidance": "The define.xml specification includes seven distinct attributes to describe variable-level metadata: ..." } ], - "Rule_Identifier": { + "Rule Identifier": { "Id": "SEND4", "Version": "1" } @@ -67,5 +67,5 @@ ] } }, - "Rule_Type": "Variable Metadata Check against Define XML" + "Rule Type": "Variable Metadata Check against Define XML" } \ No newline at end of file diff --git a/tests/resources/Rule-CG0027.json b/tests/resources/Rule-CG0027.json index 5bedff2f4..9f4775985 100644 --- a/tests/resources/Rule-CG0027.json +++ b/tests/resources/Rule-CG0027.json @@ -20,7 +20,7 @@ "Description": "Trigger error when --SCAT is not null and --SCAT is equal to --CAT", "Outcome": { "Message": "--SCAT is equal to --CAT", - "Output_Variables": ["--CAT", "--SCAT"] + "Output Variables": ["--CAT", "--SCAT"] }, "Sensitivity": "Record", "Authorities": [ @@ -39,10 +39,10 @@ "Document": "Model v2.0", "Item": "--SCAT", "Section": "Interventions", - "Cited_Guidance": "A further grouping or classification of the category for the topic of the finding, event, or intervention. The category is in --CAT." + "Cited Guidance": "A further grouping or classification of the category for the topic of the finding, event, or intervention. The category is in --CAT." } ], - "Rule_Identifier": { + "Rule Identifier": { "Id": "CG0027", "Version": "1" } @@ -61,10 +61,10 @@ "Document": "Model v1.7", "Item": "--SCAT", "Section": "2.2.1", - "Cited_Guidance": "Used to define a further categorization of --CAT values." + "Cited Guidance": "Used to define a further categorization of --CAT values." } ], - "Rule_Identifier": { + "Rule Identifier": { "Id": "CG0027", "Version": "1" } @@ -83,10 +83,10 @@ "Document": "Model v1.4", "Item": "Table 2.2.1, --SCAT", "Section": "2.2.1", - "Cited_Guidance": "Used to define a further categorization of --CAT values." + "Cited Guidance": "Used to define a further categorization of --CAT values." } ], - "Rule_Identifier": { + "Rule Identifier": { "Id": "CG0027", "Version": "1" } @@ -104,5 +104,5 @@ "Include": ["ALL"] } }, - "Rule_Type": "Record Data" + "Rule Type": "Record Data" } From 075a44fcbeed66ef69ff8ad16a2d2003e1ea48ca Mon Sep 17 00:00:00 2001 From: alexfurmenkov Date: Tue, 19 May 2026 19:33:51 +0200 Subject: [PATCH 2/7] fix for tests --- .../models/rule_validation_result.py | 21 ++++++++++--------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/cdisc_rules_engine/models/rule_validation_result.py b/cdisc_rules_engine/models/rule_validation_result.py index 04fa551bd..087c173ee 100644 --- a/cdisc_rules_engine/models/rule_validation_result.py +++ b/cdisc_rules_engine/models/rule_validation_result.py @@ -45,17 +45,18 @@ def from_skipped_rule( return instance def _get_rule_ids(self, rule: Rule, org: str) -> str: - return ", ".join( - sorted( - { - reference.get("Rule Identifier", {}).get("Id") - for authority in rule.get("authorities", []) - for standard in authority.get("Standards", []) - for reference in standard.get("References", []) - if authority.get("Organization") == org - } - ) + ids = ( + ( + reference.get("Rule Identifier") + or reference.get("Rule_Identifier") + or {} + ).get("Id") + for authority in rule.get("authorities", []) + for standard in authority.get("Standards", []) + for reference in standard.get("References", []) + if authority.get("Organization") == org ) + return ", ".join(sorted(id_ for id_ in ids if id_ is not None)) def to_representation(self) -> dict: return { From 39484adde58b221213d7dc93b0ed38f4aea99818 Mon Sep 17 00:00:00 2001 From: alexfurmenkov Date: Wed, 20 May 2026 12:44:21 +0200 Subject: [PATCH 3/7] fix for tests --- cdisc_rules_engine/models/rule.py | 51 ++++++++++++++++++------------- 1 file changed, 30 insertions(+), 21 deletions(-) diff --git a/cdisc_rules_engine/models/rule.py b/cdisc_rules_engine/models/rule.py index 944a4c4de..7c3c89ee6 100644 --- a/cdisc_rules_engine/models/rule.py +++ b/cdisc_rules_engine/models/rule.py @@ -35,10 +35,21 @@ def __init__(self, record_params: dict): self.output_variables: dict = record_params.get("output_variables") self.grouping_variables: List[str] = record_params.get("grouping_variables", []) + @classmethod + def _get_key(cls, obj: dict, space_key: str, default=None): + """Get a value by key, supporting both space-format ('Rule Type') and + underscore-format ('Rule_Type') for backward compatibility with the + CDISC Library API which returns underscore keys.""" + if space_key in obj: + return obj[space_key] + return obj.get(space_key.replace(" ", "_"), default) + @classmethod def from_cdisc_metadata(cls, rule_metadata: dict) -> dict: if cls.is_cdisc_rule_metadata(rule_metadata): authorities = rule_metadata.get("Authorities", []) + scope = rule_metadata.get("Scope", {}) + outcome = rule_metadata.get("Outcome", {}) executable_rule = { "core_id": rule_metadata.get("Core", {}).get("Id"), "author": "CDISC", @@ -48,34 +59,32 @@ def from_cdisc_metadata(cls, rule_metadata: dict) -> dict: "description": rule_metadata.get("Description"), "authorities": authorities, "standards": cls.parse_standards(authorities), - "classes": rule_metadata.get("Scope", {}).get("Classes"), - "domains": rule_metadata.get("Scope", {}).get("Domains"), - "entities": rule_metadata.get("Scope", {}).get("Entities"), - "rule_type": rule_metadata.get("Rule Type"), + "classes": scope.get("Classes"), + "domains": scope.get("Domains"), + "entities": scope.get("Entities"), + "rule_type": cls._get_key(rule_metadata, "Rule Type"), "conditions": cls.parse_conditions(rule_metadata.get("Check")), - "actions": cls.parse_actions(rule_metadata.get("Outcome")), - "use_case": rule_metadata.get("Scope", {}).get("Use Case"), - "data_structures": rule_metadata.get("Scope", {}).get( - "Data Structures" - ), + "actions": cls.parse_actions(outcome), + "use_case": cls._get_key(scope, "Use Case"), + "data_structures": cls._get_key(scope, "Data Structures"), "status": rule_metadata.get("Core", {}).get("Status", {}), } if "Operations" in rule_metadata: executable_rule["operations"] = rule_metadata.get("Operations") - if "Match Datasets" in rule_metadata: - executable_rule["datasets"] = cls.parse_datasets( - rule_metadata.get("Match Datasets") - ) - if "Output Variables" in rule_metadata.get("Outcome", {}): - executable_rule["output_variables"] = rule_metadata.get("Outcome", {})[ - "Output Variables" - ] - if "Grouping Variables" in rule_metadata: - executable_rule["grouping_variables"] = rule_metadata.get( - "Grouping Variables" - ) + match_datasets = cls._get_key(rule_metadata, "Match Datasets") + if match_datasets is not None: + executable_rule["datasets"] = cls.parse_datasets(match_datasets) + + output_variables = cls._get_key(outcome, "Output Variables") + if output_variables is not None: + executable_rule["output_variables"] = output_variables + + grouping_variables = cls._get_key(rule_metadata, "Grouping Variables") + if grouping_variables is not None: + executable_rule["grouping_variables"] = grouping_variables + return executable_rule else: return rule_metadata From 9d6439cde697040f992399ea21853b6d3360be55 Mon Sep 17 00:00:00 2001 From: alexfurmenkov Date: Wed, 20 May 2026 13:25:34 +0200 Subject: [PATCH 4/7] fix duplicated rule ids --- .../models/rule_validation_result.py | 4 ++-- tests/resources/CoreIssue295/SEND4.json | 14 ++++---------- 2 files changed, 6 insertions(+), 12 deletions(-) diff --git a/cdisc_rules_engine/models/rule_validation_result.py b/cdisc_rules_engine/models/rule_validation_result.py index 087c173ee..f48a7bb3e 100644 --- a/cdisc_rules_engine/models/rule_validation_result.py +++ b/cdisc_rules_engine/models/rule_validation_result.py @@ -45,7 +45,7 @@ def from_skipped_rule( return instance def _get_rule_ids(self, rule: Rule, org: str) -> str: - ids = ( + ids = { ( reference.get("Rule Identifier") or reference.get("Rule_Identifier") @@ -55,7 +55,7 @@ def _get_rule_ids(self, rule: Rule, org: str) -> str: for standard in authority.get("Standards", []) for reference in standard.get("References", []) if authority.get("Organization") == org - ) + } return ", ".join(sorted(id_ for id_ in ids if id_ is not None)) def to_representation(self) -> dict: diff --git a/tests/resources/CoreIssue295/SEND4.json b/tests/resources/CoreIssue295/SEND4.json index a0a465511..a167c1c56 100644 --- a/tests/resources/CoreIssue295/SEND4.json +++ b/tests/resources/CoreIssue295/SEND4.json @@ -21,9 +21,7 @@ "Description": "Raise an error when the data type in the define.xml does not correspond to the data type in the dataset", "Outcome": { "Message": "Variable datatype in the define.xml does not correspond to the data type in the dataset", - "Output Variables": [ - "variable_name" - ] + "Output Variables": ["variable_name"] }, "Sensitivity": "Record", "Executability": "Fully Executable", @@ -57,15 +55,11 @@ ], "Scope": { "Classes": { - "Include": [ - "ALL" - ] + "Include": ["ALL"] }, "Domains": { - "Include": [ - "ALL" - ] + "Include": ["ALL"] } }, "Rule Type": "Variable Metadata Check against Define XML" -} \ No newline at end of file +} From d1a823b12d07c633aa17eef6a7aef430d27e91a4 Mon Sep 17 00:00:00 2001 From: Samuel Johnson Date: Wed, 27 May 2026 16:23:52 -0400 Subject: [PATCH 5/7] slight tweak --- cdisc_rules_engine/models/rule.py | 2 +- .../models/rule_validation_result.py | 24 +++++++++---------- 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/cdisc_rules_engine/models/rule.py b/cdisc_rules_engine/models/rule.py index 7c3c89ee6..ed7c478de 100644 --- a/cdisc_rules_engine/models/rule.py +++ b/cdisc_rules_engine/models/rule.py @@ -32,7 +32,7 @@ def __init__(self, record_params: dict): self.operations: List[dict] = record_params.get("operations") self.conditions: dict = record_params["conditions"] self.actions: dict = record_params["actions"] - self.output_variables: dict = record_params.get("output_variables") + self.output_variables: dict = record_params.get("output variables") self.grouping_variables: List[str] = record_params.get("grouping_variables", []) @classmethod diff --git a/cdisc_rules_engine/models/rule_validation_result.py b/cdisc_rules_engine/models/rule_validation_result.py index f48a7bb3e..707b72102 100644 --- a/cdisc_rules_engine/models/rule_validation_result.py +++ b/cdisc_rules_engine/models/rule_validation_result.py @@ -45,18 +45,18 @@ def from_skipped_rule( return instance def _get_rule_ids(self, rule: Rule, org: str) -> str: - ids = { - ( - reference.get("Rule Identifier") - or reference.get("Rule_Identifier") - or {} - ).get("Id") - for authority in rule.get("authorities", []) - for standard in authority.get("Standards", []) - for reference in standard.get("References", []) - if authority.get("Organization") == org - } - return ", ".join(sorted(id_ for id_ in ids if id_ is not None)) + return ", ".join( + sorted( + { + reference.get("Rule Identifier", {}).get("Id") + for authority in rule.get("authorities", []) + for standard in authority.get("Standards", []) + for reference in standard.get("References", []) + if authority.get("Organization") == org + } + - {None} + ) + ) def to_representation(self) -> dict: return { From 8815d3aab8a68d98e1dff7b18c37e2e5ab01ca4d Mon Sep 17 00:00:00 2001 From: Samuel Johnson Date: Wed, 27 May 2026 16:35:42 -0400 Subject: [PATCH 6/7] added underscore --- cdisc_rules_engine/models/rule_validation_result.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/cdisc_rules_engine/models/rule_validation_result.py b/cdisc_rules_engine/models/rule_validation_result.py index 707b72102..3a9175250 100644 --- a/cdisc_rules_engine/models/rule_validation_result.py +++ b/cdisc_rules_engine/models/rule_validation_result.py @@ -48,7 +48,11 @@ def _get_rule_ids(self, rule: Rule, org: str) -> str: return ", ".join( sorted( { - reference.get("Rule Identifier", {}).get("Id") + ( + reference.get("Rule Identifier") + or reference.get("Rule_Identifier") + or {} + ).get("Id") for authority in rule.get("authorities", []) for standard in authority.get("Standards", []) for reference in standard.get("References", []) From ac8543e859469fe0d19b349b6b58c1daeb57b8d3 Mon Sep 17 00:00:00 2001 From: Gerry Campion Date: Tue, 16 Jun 2026 13:44:53 -0400 Subject: [PATCH 7/7] additional underscore fixes --- cdisc_rules_engine/models/rule.py | 4 +- tests/resources/COREIssue329/rule-286.json | 8 +- tests/resources/CoreIssue164/rule.json | 232 +-- .../vlm-check-variable-length.json | 426 ++-- .../CoreIssue278/invalid_units_rule.json | 179 +- tests/resources/CoreIssue295/SEND4.json | 2 +- .../CoreIssue357/SENDIG_266_rule.json | 116 +- tests/resources/CoreIssue363/CG0022.json | 1825 ++++++++--------- tests/resources/CoreIssue427/rule.json | 52 +- .../CoreIssue576/Rule_underscores.json | 163 +- .../CoreIssue747/Rule_underscores.json | 16 +- tests/unit/test_rule.py | 2 +- 12 files changed, 1395 insertions(+), 1630 deletions(-) diff --git a/cdisc_rules_engine/models/rule.py b/cdisc_rules_engine/models/rule.py index ed7c478de..0a110335f 100644 --- a/cdisc_rules_engine/models/rule.py +++ b/cdisc_rules_engine/models/rule.py @@ -197,8 +197,8 @@ def parse_datasets(cls, match_key_data: List[dict]) -> List[dict]: ], "wildcard": data.get("Wildcard", "**"), } - if "Join_Type" in data: - join_data["join_type"] = data.get("Join_Type") + if "Join Type" in data: + join_data["join_type"] = data.get("Join Type") if "Child" in data: join_data["child"] = data.get("Child") datasets.append(join_data) diff --git a/tests/resources/COREIssue329/rule-286.json b/tests/resources/COREIssue329/rule-286.json index f000509c2..629340fbc 100644 --- a/tests/resources/COREIssue329/rule-286.json +++ b/tests/resources/COREIssue329/rule-286.json @@ -15,10 +15,10 @@ "Document": "IG v3.2", "Item": "Assumption 3", "Section": "7.4", - "Cited_Guidance": "Further information about the parameters is included below in Table 1. TSVAL may have controlled terminology depending on the value of TSPARMCD" + "Cited Guidance": "Further information about the parameters is included below in Table 1. TSVAL may have controlled terminology depending on the value of TSPARMCD" } ], - "Rule_Identifier": { + "Rule Identifier": { "Id": "CG0286", "Version": "1" } @@ -37,10 +37,10 @@ "Document": "IG v3.3", "Item": "Assumption 3", "Section": "7.4", - "Cited_Guidance": "Further information about the parameters is included Appendix C1, Trial Summary Codes. TSVAL may have controlled terminology depending on the value of TSPARMCD. Conditions for including parameters are included in Appendix C1, Trial Summary Codes." + "Cited Guidance": "Further information about the parameters is included Appendix C1, Trial Summary Codes. TSVAL may have controlled terminology depending on the value of TSPARMCD. Conditions for including parameters are included in Appendix C1, Trial Summary Codes." } ], - "Rule_Identifier": { + "Rule Identifier": { "Id": "CG0286", "Version": "1" } diff --git a/tests/resources/CoreIssue164/rule.json b/tests/resources/CoreIssue164/rule.json index 83e85a4b3..eb4d4228e 100644 --- a/tests/resources/CoreIssue164/rule.json +++ b/tests/resources/CoreIssue164/rule.json @@ -1,129 +1,123 @@ { - "Authorities": [ + "Authorities": [ + { + "Organization": "CDISC", + "Standards": [ { - "Organization": "CDISC", - "Standards": [ - { - "Name": "SENDIG", - "References": [ - { - "Citations": [ - { - "Document": "IG v3.0", - "Section": "4.4.4", - "Cited_Guidance": "All Study Day values are integers." - } - ], - "Origin": "SEND Conformance Rules", - "Version": "5.0", - "Rule_Identifier": { - "Id": "SEND72", - "Version": "1" - } - } - ], - "Version": "3.0" - }, - { - "Name": "SENDIG", - "References": [ - { - "Citations": [ - { - "Document": "IG v3.1", - "Section": "4.4.4", - "Cited_Guidance": "All Study Day values are integers." - } - ], - "Origin": "SEND Conformance Rules", - "Version": "5.0", - "Rule_Identifier": { - "Id": "SEND72", - "Version": "1" - } - } - ], - "Version": "3.1" - }, + "Name": "SENDIG", + "References": [ + { + "Citations": [ { - "Name": "SENDIG", - "References": [ - { - "Citations": [ - { - "Document": "IG v3.1", - "Section": "4.4.4", - "Cited_Guidance": "All Study Day values are integers." - } - ], - "Origin": "SEND Conformance Rules", - "Version": "5.0", - "Rule_Identifier": { - "Id": "SEND72", - "Version": "1" - } - } - ], - "Version": "3.1.1" - }, + "Document": "IG v3.0", + "Section": "4.4.4", + "Cited Guidance": "All Study Day values are integers." + } + ], + "Origin": "SEND Conformance Rules", + "Version": "5.0", + "Rule Identifier": { + "Id": "SEND72", + "Version": "1" + } + } + ], + "Version": "3.0" + }, + { + "Name": "SENDIG", + "References": [ + { + "Citations": [ { - "Name": "SENDIG-DART", - "References": [ - { - "Citations": [ - { - "Document": "IG v3.1", - "Section": "4.4.4", - "Cited_Guidance": "All Study Day values are integers." - } - ], - "Origin": "SEND Conformance Rules", - "Version": "5.0", - "Rule_Identifier": { - "Id": "SEND72", - "Version": "1" - } - } - ], - "Version": "1.1" + "Document": "IG v3.1", + "Section": "4.4.4", + "Cited Guidance": "All Study Day values are integers." } - ] - } - ], - "Check": { - "any": [ + ], + "Origin": "SEND Conformance Rules", + "Version": "5.0", + "Rule Identifier": { + "Id": "SEND72", + "Version": "1" + } + } + ], + "Version": "3.1" + }, + { + "Name": "SENDIG", + "References": [ { - "name": "--DY", - "operator": "not_matches_regex", - "value": "^-?[1-9]{1}\\d*$" + "Citations": [ + { + "Document": "IG v3.1", + "Section": "4.4.4", + "Cited Guidance": "All Study Day values are integers." + } + ], + "Origin": "SEND Conformance Rules", + "Version": "5.0", + "Rule Identifier": { + "Id": "SEND72", + "Version": "1" + } } - ] - }, - "Core": { - "Id": "CDISC.SENDIG.72", - "Status": "Draft", - "Version": "1" - }, - "Description": "--DY must be a non-zero integer", - "Executability": "Fully Executable", - "Outcome": { - "Message": "--DY is not a non-zero integer", - "Output_Variables": [ - "--DY" - ] - }, - "Scope": { - "Classes": { - "Include": [ - "ALL" - ] + ], + "Version": "3.1.1" }, - "Domains": { - "Include": [ - "ALL" - ] + { + "Name": "SENDIG-DART", + "References": [ + { + "Citations": [ + { + "Document": "IG v3.1", + "Section": "4.4.4", + "Cited Guidance": "All Study Day values are integers." + } + ], + "Origin": "SEND Conformance Rules", + "Version": "5.0", + "Rule Identifier": { + "Id": "SEND72", + "Version": "1" + } + } + ], + "Version": "1.1" } + ] + } + ], + "Check": { + "any": [ + { + "name": "--DY", + "operator": "not_matches_regex", + "value": "^-?[1-9]{1}\\d*$" + } + ] + }, + "Core": { + "Id": "CDISC.SENDIG.72", + "Status": "Draft", + "Version": "1" + }, + "Description": "--DY must be a non-zero integer", + "Executability": "Fully Executable", + "Outcome": { + "Message": "--DY is not a non-zero integer", + "Output Variables": ["--DY"] + }, + "Scope": { + "Classes": { + "Include": ["ALL"] }, - "Sensitivity": "Record", - "Rule_Type": "Record Data" -} \ No newline at end of file + "Domains": { + "Include": ["ALL"] + } + }, + "Sensitivity": "Record", + "Rule_Type": "Record Data" +} diff --git a/tests/resources/CoreIssue271/vlm-check-variable-length.json b/tests/resources/CoreIssue271/vlm-check-variable-length.json index 53a85ddd9..ef3040623 100644 --- a/tests/resources/CoreIssue271/vlm-check-variable-length.json +++ b/tests/resources/CoreIssue271/vlm-check-variable-length.json @@ -1,231 +1,227 @@ { - "Check": { - "all": [ + "Check": { + "all": [ + { + "name": "variable_value_length", + "operator": "greater_than", + "value": "define_vlm_length" + } + ] + }, + "Outcome": { + "Message": "Variable longer than define_vlm length", + "Output Variables": [ + "row_number", + "variable_name", + "variable_value", + "define_variable_name", + "define_vlm_name", + "define_vlm_length", + "variable_value_length" + ] + }, + "Authorities": [ + { + "Organization": "FDA", + "Standards": [ + { + "Name": "SDTMIG", + "Version": "3.1.2", + "References": [ { - "name": "variable_value_length", - "operator": "greater_than", - "value": "define_vlm_length" + "Origin": "FDA Validator Rules", + "Version": "1.6", + "Citations": [ + { + "Document": "FDA", + "Cited Guidance": "TCG 4.1.4.5" + } + ], + "Rule Identifier": { + "Id": "SD1228", + "Version": "1" + } } - ] - }, - "Outcome": { - "Message": "Variable longer than define_vlm length", - "Output_Variables": [ - "row_number", - "variable_name", - "variable_value", - "define_variable_name", - "define_vlm_name", - "define_vlm_length", - "variable_value_length" - ] - }, - "Authorities": [ + ] + }, { - "Organization": "FDA", - "Standards": [ - { - "Name": "SDTMIG", - "Version": "3.1.2", - "References": [ - { - "Origin": "FDA Validator Rules", - "Version": "1.6", - "Citations": [ - { - "Document": "FDA", - "Cited_Guidance": "TCG 4.1.4.5" - } - ], - "Rule_Identifier": { - "Id": "SD1228", - "Version": "1" - } - } - ] - }, - { - "Name": "SDTMIG", - "Version": "3.1.3", - "References": [ - { - "Origin": "FDA Validator Rules", - "Version": "1.6", - "Citations": [ - { - "Document": "FDA", - "Cited_Guidance": "TCG 4.1.4.5" - } - ], - "Rule_Identifier": { - "Id": "SD1228", - "Version": "1" - } - } - ] - }, + "Name": "SDTMIG", + "Version": "3.1.3", + "References": [ + { + "Origin": "FDA Validator Rules", + "Version": "1.6", + "Citations": [ { - "Name": "SDTMIG", - "Version": "3.2", - "References": [ - { - "Origin": "FDA Validator Rules", - "Version": "1.6", - "Citations": [ - { - "Document": "FDA", - "Cited_Guidance": "TCG 4.1.4.5" - } - ], - "Rule_Identifier": { - "Id": "SD1228", - "Version": "1" - } - } - ] - }, + "Document": "FDA", + "Cited Guidance": "TCG 4.1.4.5" + } + ], + "Rule Identifier": { + "Id": "SD1228", + "Version": "1" + } + } + ] + }, + { + "Name": "SDTMIG", + "Version": "3.2", + "References": [ + { + "Origin": "FDA Validator Rules", + "Version": "1.6", + "Citations": [ { - "Name": "SDTMIG", - "Version": "3.3", - "References": [ - { - "Origin": "FDA Validator Rules", - "Version": "1.6", - "Citations": [ - { - "Document": "FDA", - "Cited_Guidance": "TCG 4.1.4.5" - } - ], - "Rule_Identifier": { - "Id": "SD1228", - "Version": "1" - } - } - ] - }, + "Document": "FDA", + "Cited Guidance": "TCG 4.1.4.5" + } + ], + "Rule Identifier": { + "Id": "SD1228", + "Version": "1" + } + } + ] + }, + { + "Name": "SDTMIG", + "Version": "3.3", + "References": [ + { + "Origin": "FDA Validator Rules", + "Version": "1.6", + "Citations": [ { - "Name": "SENDIG", - "Version": "3.0", - "References": [ - { - "Origin": "FDA Validator Rules", - "Version": "1.6", - "Citations": [ - { - "Document": "FDA", - "Cited_Guidance": "TCG 4.1.4.5" - } - ], - "Rule_Identifier": { - "Id": "SD1228", - "Version": "1" - } - } - ] - }, + "Document": "FDA", + "Cited Guidance": "TCG 4.1.4.5" + } + ], + "Rule Identifier": { + "Id": "SD1228", + "Version": "1" + } + } + ] + }, + { + "Name": "SENDIG", + "Version": "3.0", + "References": [ + { + "Origin": "FDA Validator Rules", + "Version": "1.6", + "Citations": [ { - "Name": "SENDIG", - "Version": "3.1", - "References": [ - { - "Origin": "FDA Validator Rules", - "Version": "1.6", - "Citations": [ - { - "Document": "FDA", - "Cited_Guidance": "TCG 4.1.4.5" - } - ], - "Rule_Identifier": { - "Id": "SD1228", - "Version": "1" - } - } - ] - }, + "Document": "FDA", + "Cited Guidance": "TCG 4.1.4.5" + } + ], + "Rule Identifier": { + "Id": "SD1228", + "Version": "1" + } + } + ] + }, + { + "Name": "SENDIG", + "Version": "3.1", + "References": [ + { + "Origin": "FDA Validator Rules", + "Version": "1.6", + "Citations": [ { - "Name": "SENDIG", - "Version": "3.1.1", - "References": [ - { - "Origin": "FDA Validator Rules", - "Version": "1.6", - "Citations": [ - { - "Document": "FDA", - "Cited_Guidance": "TCG 4.1.4.5" - } - ], - "Rule_Identifier": { - "Id": "SD1228", - "Version": "1" - } - } - ] - }, + "Document": "FDA", + "Cited Guidance": "TCG 4.1.4.5" + } + ], + "Rule Identifier": { + "Id": "SD1228", + "Version": "1" + } + } + ] + }, + { + "Name": "SENDIG", + "Version": "3.1.1", + "References": [ + { + "Origin": "FDA Validator Rules", + "Version": "1.6", + "Citations": [ { - "Name": "SENDIG-AR", - "Version": "1.0", - "References": [ - { - "Origin": "FDA Validator Rules", - "Version": "1.6", - "Citations": [ - { - "Document": "FDA", - "Cited_Guidance": "TCG 4.1.4.5" - } - ], - "Rule_Identifier": { - "Id": "SD1228", - "Version": "1" - } - } - ] - }, + "Document": "FDA", + "Cited Guidance": "TCG 4.1.4.5" + } + ], + "Rule Identifier": { + "Id": "SD1228", + "Version": "1" + } + } + ] + }, + { + "Name": "SENDIG-AR", + "Version": "1.0", + "References": [ + { + "Origin": "FDA Validator Rules", + "Version": "1.6", + "Citations": [ { - "Name": "SENDIG-DART", - "Version": "1.1", - "References": [ - { - "Origin": "FDA Validator Rules", - "Version": "1.6", - "Citations": [ - { - "Document": "FDA", - "Cited_Guidance": "TCG 4.1.4.5" - } - ], - "Rule_Identifier": { - "Id": "SD1228", - "Version": "1" - } - } - ] + "Document": "FDA", + "Cited Guidance": "TCG 4.1.4.5" } - ] - } - ], - "Core": { - "Id": "FDA.SDTMIG.SD1228", - "Version": "1", - "Status": "Draft" - }, - "Description": "Variable values should be populated with terms found in the user-defined codelist associated with the variable in define.xml.", - "Sensitivity": "Record", - "Scope": { - "Classes": { - "Include": [ - "ALL" - ] + ], + "Rule Identifier": { + "Id": "SD1228", + "Version": "1" + } + } + ] }, - "Domains": { - "Include": [ - "ALL" - ] + { + "Name": "SENDIG-DART", + "Version": "1.1", + "References": [ + { + "Origin": "FDA Validator Rules", + "Version": "1.6", + "Citations": [ + { + "Document": "FDA", + "Cited Guidance": "TCG 4.1.4.5" + } + ], + "Rule Identifier": { + "Id": "SD1228", + "Version": "1" + } + } + ] } + ] + } + ], + "Core": { + "Id": "FDA.SDTMIG.SD1228", + "Version": "1", + "Status": "Draft" + }, + "Description": "Variable values should be populated with terms found in the user-defined codelist associated with the variable in define.xml.", + "Sensitivity": "Record", + "Scope": { + "Classes": { + "Include": ["ALL"] }, - "Executability": "Fully Executable", - "Rule_Type": "Value Check against Define XML VLM" + "Domains": { + "Include": ["ALL"] + } + }, + "Executability": "Fully Executable", + "Rule_Type": "Value Check against Define XML VLM" } diff --git a/tests/resources/CoreIssue278/invalid_units_rule.json b/tests/resources/CoreIssue278/invalid_units_rule.json index 3694964df..5dab5c042 100644 --- a/tests/resources/CoreIssue278/invalid_units_rule.json +++ b/tests/resources/CoreIssue278/invalid_units_rule.json @@ -1,97 +1,96 @@ { - "Check": { - "all": [ - { - "name": "PPTESTCD", - "operator": "ends_with", - "value": "W" - }, - { - "not": { - "all": [ - { - "name": "PPTESTCD", - "operator": "ends_with", - "value": "DW" - } - ] - } - }, - { - "any": [ + "Check": { + "all": [ + { + "name": "PPTESTCD", + "operator": "ends_with", + "value": "W" + }, + { + "not": { + "all": [ { - "all": [ - { - "name": "$pporesu_variable_codelist", - "operator": "equal_to", - "value": "C128684" - }, - { - "not": { - "all": [ - { - "name": "PPORRESU", - "operator": "ends_with", - "value": "/g" - } - ] - } - } - ] - }, - { - "all": [ - { - "name": "$pporesu_variable_codelist", - "operator": "equal_to", - "value": "C128683" - }, - { - "not": { - "all": [ - { - "name": "PPORRESU", - "operator": "ends_with", - "value": "/kg" - } - ] - } - } - ] + "name": "PPTESTCD", + "operator": "ends_with", + "value": "DW" } ] } - ] - }, - "Operations": [ + }, { - "id": "$pporesu_variable_codelist", - "name": "PPORRESU", - "domain": "PP", - "operator": "define_variable_codelist" + "any": [ + { + "all": [ + { + "name": "$pporesu_variable_codelist", + "operator": "equal_to", + "value": "C128684" + }, + { + "not": { + "all": [ + { + "name": "PPORRESU", + "operator": "ends_with", + "value": "/g" + } + ] + } + } + ] + }, + { + "all": [ + { + "name": "$pporesu_variable_codelist", + "operator": "equal_to", + "value": "C128683" + }, + { + "not": { + "all": [ + { + "name": "PPORRESU", + "operator": "ends_with", + "value": "/kg" + } + ] + } + } + ] + } + ] } - ], - "Core": { - "Id": "INVALID_UNITS_RULE", - "Version": "1", - "Status": "Draft" - }, - "Description": "Raise an error if blah blah blah", - "Outcome": { - "Message": "Raise an error if blah blah blah", - "Output_Variables": ["PPTESTCD", "PPORRESU", "$pporesu_variable_codelist"] - }, - "Sensitivity": "Record", - "Executability": "Fully Executable", - "Scope": { - "Classes": { - "Include": ["FINDINGS"] - }, - "Domains": { - "Include": ["PP"] - } - }, - - "Rule_Type": "Record check" - } - \ No newline at end of file + ] + }, + "Operations": [ + { + "id": "$pporesu_variable_codelist", + "name": "PPORRESU", + "domain": "PP", + "operator": "define_variable_codelist" + } + ], + "Core": { + "Id": "INVALID_UNITS_RULE", + "Version": "1", + "Status": "Draft" + }, + "Description": "Raise an error if blah blah blah", + "Outcome": { + "Message": "Raise an error if blah blah blah", + "Output Variables": ["PPTESTCD", "PPORRESU", "$pporesu_variable_codelist"] + }, + "Sensitivity": "Record", + "Executability": "Fully Executable", + "Scope": { + "Classes": { + "Include": ["FINDINGS"] + }, + "Domains": { + "Include": ["PP"] + } + }, + + "Rule_Type": "Record check" +} diff --git a/tests/resources/CoreIssue295/SEND4.json b/tests/resources/CoreIssue295/SEND4.json index a167c1c56..a644c4904 100644 --- a/tests/resources/CoreIssue295/SEND4.json +++ b/tests/resources/CoreIssue295/SEND4.json @@ -40,7 +40,7 @@ { "Document": "IG v3.1", "Section": "3.2.2", - "Cited_Guidance": "The define.xml specification includes seven distinct attributes to describe variable-level metadata: ..." + "Cited Guidance": "The define.xml specification includes seven distinct attributes to describe variable-level metadata: ..." } ], "Rule Identifier": { diff --git a/tests/resources/CoreIssue357/SENDIG_266_rule.json b/tests/resources/CoreIssue357/SENDIG_266_rule.json index 996f76f94..d65022d60 100644 --- a/tests/resources/CoreIssue357/SENDIG_266_rule.json +++ b/tests/resources/CoreIssue357/SENDIG_266_rule.json @@ -1,67 +1,63 @@ { - "Authority": { - "Organization": "CDISC" - }, - "Check": { - "all": [ - { - "name": "variable_name", - "operator": "is_not_contained_by", - "value": "$model_variables" - } - ] - }, - "Citations": [ + "Authority": { + "Organization": "CDISC" + }, + "Check": { + "all": [ { - "Document": "TODO", - "Section": "TODO", - "Cited_Guidance": "TODO" + "name": "variable_name", + "operator": "is_not_contained_by", + "value": "$model_variables" } - ], - "Core": { - "Id": "CDISC.SDTMIG.CG0013", - "Version": "1" - }, - "Description": "Trigger when variable cannot be found in the SDTM model (v.1.7 for SENDIG-3.1)", - "Operations": [ - { - "id": "$model_variables", - "operator": "get_column_order_from_library", - "name": "MODELVARIABLES" + ] + }, + "Citations": [ + { + "Document": "TODO", + "Section": "TODO", + "Cited Guidance": "TODO" + } + ], + "Core": { + "Id": "CDISC.SDTMIG.CG0013", + "Version": "1" + }, + "Description": "Trigger when variable cannot be found in the SDTM model (v.1.7 for SENDIG-3.1)", + "Operations": [ + { + "id": "$model_variables", + "operator": "get_column_order_from_library", + "name": "MODELVARIABLES" + } + ], + "Outcome": { + "Message": "Variable is not allowed in SDTM/SEND" + }, + "References": [ + { + "Origin": "SDTM and SENDIG Conformance Rules", + "Version": "2.0", + "Rule Identifier": { + "Id": "266", + "Version": "1" } - ], - "Outcome": { - "Message": "Variable is not allowed in SDTM/SEND" + } + ], + "Scopes": { + "Classes": { + "Include": ["All"] + }, + "Domains": { + "Include": ["All"] }, - "References": [ + "Standards": [ { - "Origin": "SDTM and SENDIG Conformance Rules", - "Version": "2.0", - "Rule_Identifier": { - "Id": "266", - "Version": "1" - } + "Name": "SDTMIG", + "Version": "3.4" } - ], - "Scopes": { - "Classes": { - "Include": [ - "All" - ] - }, - "Domains": { - "Include": [ - "All" - ] - }, - "Standards": [ - { - "Name": "SDTMIG", - "Version": "3.4" - } - ] - }, - "Sensitivity": "Record", - "Severity": "Error", - "Rule_Type": "Variable Metadata Check" - } \ No newline at end of file + ] + }, + "Sensitivity": "Record", + "Severity": "Error", + "Rule_Type": "Variable Metadata Check" +} diff --git a/tests/resources/CoreIssue363/CG0022.json b/tests/resources/CoreIssue363/CG0022.json index 0b419a3df..a57ce650f 100644 --- a/tests/resources/CoreIssue363/CG0022.json +++ b/tests/resources/CoreIssue363/CG0022.json @@ -1,1029 +1,826 @@ { - "rule": { - "Check": { - "all": [ - { - "name": "--LNKGRP", - "operator": "value_does_not_have_multiple_references", - "value": "$VALUE_COUNTS" - }, - { - "name": "--LNKGRP", - "operator": "non_empty" + "rule": { + "Check": { + "all": [ + { + "name": "--LNKGRP", + "operator": "value_does_not_have_multiple_references", + "value": "$VALUE_COUNTS" + }, + { + "name": "--LNKGRP", + "operator": "non_empty" + } + ] + }, + "Core": { + "Id": "CDISC.SDTMIG.CG0022", + "Version": "1", + "Status": "Draft" + }, + "Description": "Verify that when --LNKGRP is present in one domain it is also present in another domain.", + "Operations": [ + { + "id": "$VALUE_COUNTS", + "name": "--LNKGRP", + "operator": "variable_value_count" + } + ], + "Outcome": { + "Message": "--LNKGRP variable is not found in any of the other domains.", + "Output Variables": ["--LNKGRP"] + }, + "Sensitivity": "Dataset", + "Executability": "Fully Executable", + "Authorities": [ + { + "Organization": "CDISC", + "Standards": [ + { + "Name": "SDTMIG", + "Version": "3.4", + "References": [ + { + "Origin": "SDTM and SDTMIG Conformance Rules", + "Version": "2.0", + "Citations": [ + { + "Document": "SDTMIG v3.4", + "Item": "2.E.2", + "Section": "4.2.6", + "Cited Guidance": "--LNKGRP is a grouping identifier used to identify a group of records in one domain that is related to a record in another domain, often forming a many-to-one relationship." + } + ], + "Rule Identifier": { + "Id": "CG0022", + "Version": "1" } + } ] + }, + { + "Name": "SDTMIG", + "Version": "3.3", + "References": [ + { + "Origin": "SDTM and SDTMIG Conformance Rules", + "Version": "2.0", + "Citations": [ + { + "Document": "SDTMIG v3.3", + "Item": "2.E.2", + "Section": "4.2.6", + "Cited Guidance": "--LNKGRP is a grouping identifier used to identify a group of records in one domain that is related to a record in another domain, often forming a many-to-one relationship." + } + ], + "Rule Identifier": { + "Id": "CG0022", + "Version": "1" + } + } + ] + }, + { + "Name": "SDTMIG", + "Version": "3.2", + "References": [ + { + "Origin": "SDTM and SDTMIG Conformance Rules", + "Version": "2.0", + "Citations": [ + { + "Document": "SDTMIG v3.3", + "Item": "Specification", + "Section": "6.1.", + "Cited Guidance": "Identifier used to link related, grouped records across domains." + } + ], + "Rule Identifier": { + "Id": "CG0022", + "Version": "1" + } + } + ] + } + ] + } + ], + "Scope": { + "Classes": { + "Include": ["ALL"] + }, + "Domains": { + "Include": ["ALL"] + } + }, + "Rule_Type": "Record Data" + }, + "datasets": [ + { + "filename": "ae.xpt", + "label": "Adverse Events", + "domain": "AE", + "variables": [ + { + "name": "STUDYID", + "label": "Study Identifier", + "type": "Char", + "length": 12 }, - "Core": { - "Id": "CDISC.SDTMIG.CG0022", - "Version": "1", - "Status": "Draft" + { + "name": "DOMAIN", + "label": "Domain Abbreviation", + "type": "Char", + "length": 2 }, - "Description": "Verify that when --LNKGRP is present in one domain it is also present in another domain.", - "Operations": [ - { - "id": "$VALUE_COUNTS", - "name": "--LNKGRP", - "operator": "variable_value_count" - } - ], - "Outcome": { - "Message": "--LNKGRP variable is not found in any of the other domains.", - "Output_Variables": [ - "--LNKGRP" - ] + { + "name": "USUBJID", + "label": "Unique Subject Identifier", + "type": "Char", + "length": 8 }, - "Sensitivity": "Dataset", - "Executability": "Fully Executable", - "Authorities": [ - { - "Organization": "CDISC", - "Standards": [ - { - "Name": "SDTMIG", - "Version": "3.4", - "References": [ - { - "Origin": "SDTM and SDTMIG Conformance Rules", - "Version": "2.0", - "Citations": [ - { - "Document": "SDTMIG v3.4", - "Item": "2.E.2", - "Section": "4.2.6", - "Cited_Guidance": "--LNKGRP is a grouping identifier used to identify a group of records in one domain that is related to a record in another domain, often forming a many-to-one relationship." - } - ], - "Rule_Identifier": { - "Id": "CG0022", - "Version": "1" - } - } - ] - }, - { - "Name": "SDTMIG", - "Version": "3.3", - "References": [ - { - "Origin": "SDTM and SDTMIG Conformance Rules", - "Version": "2.0", - "Citations": [ - { - "Document": "SDTMIG v3.3", - "Item": "2.E.2", - "Section": "4.2.6", - "Cited_Guidance": "--LNKGRP is a grouping identifier used to identify a group of records in one domain that is related to a record in another domain, often forming a many-to-one relationship." - } - ], - "Rule_Identifier": { - "Id": "CG0022", - "Version": "1" - } - } - ] - }, - { - "Name": "SDTMIG", - "Version": "3.2", - "References": [ - { - "Origin": "SDTM and SDTMIG Conformance Rules", - "Version": "2.0", - "Citations": [ - { - "Document": "SDTMIG v3.3", - "Item": "Specification", - "Section": "6.1.", - "Cited_Guidance": "Identifier used to link related, grouped records across domains." - } - ], - "Rule_Identifier": { - "Id": "CG0022", - "Version": "1" - } - } - ] - } - ] - } + { + "name": "AESEQ", + "label": "Sequence Number", + "type": "Num", + "length": 8 + }, + { + "name": "AELNKID", + "label": "Link ID", + "type": "Char", + "length": 50 + }, + { + "name": "AETERM", + "label": "Reported Term for the Adverse Event", + "type": "Char", + "length": 200 + }, + { + "name": "AESEV", + "label": "Severity/Intensity", + "type": "Char", + "length": 8 + }, + { + "name": "AESER", + "label": "Serious Event", + "type": "Char", + "length": 1 + }, + { + "name": "AEACN", + "label": "Action Taken with Study Treatment", + "type": "Char", + "length": 16 + }, + { + "name": "AEREL", + "label": "Causality", + "type": "Char", + "length": 16 + }, + { + "name": "AEOUT", + "label": "Outcome of Adverse Event", + "type": "Char", + "length": 32 + }, + { + "name": "AESCAN", + "label": "Involves Cancer", + "type": "Char", + "length": 1 + }, + { + "name": "AESLIFE", + "label": "Is Life Threatening", + "type": "Char", + "length": 1 + }, + { + "name": "EPOCH", + "label": "Epoch", + "type": "Char", + "length": 9 + }, + { + "name": "AESTDTC", + "label": "Start Date/Time of Adverse Event", + "type": "Char", + "length": 10 + }, + { + "name": "AEENDTC", + "label": "End Date/Time of Adverse Event", + "type": "Char", + "length": 10 + }, + { + "name": "AESTDY", + "label": "Study Day of Start of Adverse Event", + "type": "Num", + "length": 8 + }, + { + "name": "AEENDY", + "label": "Study Day of End of Adverse Event", + "type": "Num", + "length": 8 + }, + { + "name": "AEENRTPT", + "label": "End Relative to Reference Time Point", + "type": "Char", + "length": 7 + }, + { + "name": "AEENTPT", + "label": "End Reference Time Point", + "type": "Char", + "length": 10 + } + ], + "records": { + "STUDYID": ["CDISCPILOT01", "CDISCPILOT01", "CDISCPILOT01"], + "DOMAIN": ["AE", "AE", "AE"], + "USUBJID": ["CDISC001", "CDISC001", "CDISC002"], + "AESEQ": [1, 2, 1], + "AELNKID": ["1", "2", "1"], + "AETERM": [ + "INJECTION SITE REACTION", + "FATIGUE", + "INJECTION SITE REACTION" ], - "Scope": { - "Classes": { - "Include": [ - "ALL" - ] - }, - "Domains": { - "Include": [ - "ALL" - ] - } + "AESEV": ["MODERATE", "MODERATE", "MILD"], + "AESER": ["N", "N", "N"], + "AEACN": ["DRUG WITHDRAWN", "DOSE NOT CHANGED", "DOSE NOT CHANGED"], + "AEREL": ["RELATED", "UNLIKELY RELATED", "POSSIBLY RELATED"], + "AEOUT": [ + "NOT RECOVERED/NOT RESOLVED", + "NOT RECOVERED/NOT RESOLVED", + "NOT RECOVERED/NOT RESOLVED" + ], + "AESCAN": ["N", "N", "N"], + "AESLIFE": ["N", "N", "N"], + "EPOCH": ["TREATMENT", "TREATMENT", "TREATMENT"], + "AESTDTC": ["2012-12-02", "2013-01-14", "2012-11-16"], + "AEENDTC": ["", "", ""], + "AESTDY": [3, 46, 2], + "AEENDY": [null, null, null], + "AEENRTPT": ["ONGOING", "ONGOING", "ONGOING"], + "AEENTPT": ["2013-05-20", "2013-05-20", "2013-01-14"] + } + }, + { + "filename": "fa.xpt", + "label": "Findings About Events or Interventions", + "domain": "FA", + "variables": [ + { + "name": "STUDYID", + "label": "Study Identifier", + "type": "Char", + "length": 12 + }, + { + "name": "DOMAIN", + "label": "Domain Abbreviation", + "type": "Char", + "length": 2 + }, + { + "name": "USUBJID", + "label": "Unique Subject Identifier", + "type": "Char", + "length": 8 + }, + { + "name": "FASEQ", + "label": "Sequence Number", + "type": "Num", + "length": 8 + }, + { + "name": "FALNKGRP", + "label": "Link Group ID", + "type": "Char", + "length": 200 + }, + { + "name": "FATESTCD", + "label": "Findings About Test Short Name", + "type": "Char", + "length": 5 + }, + { + "name": "FATEST", + "label": "Findings About Test Name", + "type": "Char", + "length": 20 + }, + { + "name": "FAOBJ", + "label": "Object of the Observation", + "type": "Char", + "length": 10 + }, + { + "name": "FACAT", + "label": "Category for Findings About", + "type": "Char", + "length": 23 + }, + { + "name": "FAORRES", + "label": "Result or Finding in Original Units", + "type": "Char", + "length": 8 + }, + { + "name": "FASTRESC", + "label": "Character Result/Finding in Std Format", + "type": "Char", + "length": 8 + }, + { + "name": "FALOC", + "label": "Location of the Finding About", + "type": "Char", + "length": 3 }, - "Rule_Type": "Record Data" + { + "name": "VISITNUM", + "label": "Visit Number", + "type": "Num", + "length": 8 + }, + { + "name": "EPOCH", + "label": "Epoch", + "type": "Char", + "length": 9 + }, + { + "name": "FADTC", + "label": "Date/Time of Collection", + "type": "Char", + "length": 10 + }, + { + "name": "FADY", + "label": "Study Day of Collection", + "type": "Num", + "length": 8 + } + ], + "records": { + "STUDYID": [ + "CDISCPILOT01", + "CDISCPILOT01", + "CDISCPILOT01", + "CDISCPILOT01", + "CDISCPILOT01", + "CDISCPILOT01", + "CDISCPILOT01", + "CDISCPILOT01", + "CDISCPILOT01", + "CDISCPILOT01", + "CDISCPILOT01", + "CDISCPILOT01" + ], + "DOMAIN": [ + "FA", + "FA", + "FA", + "FA", + "FA", + "FA", + "FA", + "FA", + "FA", + "FA", + "FA", + "FA" + ], + "USUBJID": [ + "CDISC001", + "CDISC001", + "CDISC001", + "CDISC001", + "CDISC001", + "CDISC001", + "CDISC002", + "CDISC002", + "CDISC002", + "CDISC002", + "CDISC002", + "CDISC002" + ], + "FASEQ": [1, 2, 3, 4, 5, 6, 1, 2, 3, 4, 5, 6], + "FALNKGRP": [ + "CDISC001 - 1", + "CDISC001 - 1", + "CDISC001 - 1", + "CDISC001 - 1", + "CDISC001 - 1", + "CDISC001 - 1", + "CDISC002 - 1", + "CDISC002 - 1", + "CDISC002 - 1", + "CDISC002 - 1", + "CDISC002 - 1", + "CDISC002 - 1" + ], + "FATESTCD": [ + "OCCUR", + "SEV", + "OCCUR", + "OCCUR", + "OCCUR", + "OCCUR", + "OCCUR", + "OCCUR", + "OCCUR", + "OCCUR", + "SEV", + "OCCUR" + ], + "FATEST": [ + "Occurrence Indicator", + "Severity/Intensity", + "Occurrence Indicator", + "Occurrence Indicator", + "Occurrence Indicator", + "Occurrence Indicator", + "Occurrence Indicator", + "Occurrence Indicator", + "Occurrence Indicator", + "Occurrence Indicator", + "Severity/Intensity", + "Occurrence Indicator" + ], + "FAOBJ": [ + "ERYTHEMA", + "ERYTHEMA", + "PAIN", + "INDURATION", + "PRURITIS", + "EDEMA", + "ERYTHEMA", + "PAIN", + "INDURATION", + "PRURITIS", + "PRURITIS", + "EDEMA" + ], + "FACAT": [ + "INJECTION SITE REACTION", + "INJECTION SITE REACTION", + "INJECTION SITE REACTION", + "INJECTION SITE REACTION", + "INJECTION SITE REACTION", + "INJECTION SITE REACTION", + "INJECTION SITE REACTION", + "INJECTION SITE REACTION", + "INJECTION SITE REACTION", + "INJECTION SITE REACTION", + "INJECTION SITE REACTION", + "INJECTION SITE REACTION" + ], + "FAORRES": [ + "Y", + "MODERATE", + "N", + "N", + "N", + "N", + "N", + "N", + "N", + "Y", + "MILD", + "N" + ], + "FASTRESC": [ + "Y", + "MODERATE", + "N", + "N", + "N", + "N", + "N", + "N", + "N", + "Y", + "MILD", + "N" + ], + "FALOC": [ + "ARM", + "ARM", + "ARM", + "ARM", + "ARM", + "ARM", + "ARM", + "ARM", + "ARM", + "ARM", + "ARM", + "ARM" + ], + "VISITNUM": [ + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null + ], + "EPOCH": [ + "TREATMENT", + "TREATMENT", + "TREATMENT", + "TREATMENT", + "TREATMENT", + "TREATMENT", + "TREATMENT", + "TREATMENT", + "TREATMENT", + "TREATMENT", + "TREATMENT", + "TREATMENT" + ], + "FADTC": [ + "2012-12-02", + "2012-12-02", + "2012-12-02", + "2012-12-02", + "2012-12-02", + "2012-12-02", + "2012-11-16", + "2012-11-16", + "2012-11-16", + "2012-11-16", + "2012-11-16", + "2012-11-16" + ], + "FADY": [3, 3, 3, 3, 3, 3, 2, 2, 2, 2, 2, 2] + } }, - "datasets": [ + { + "filename": "vs.xpt", + "label": "Vital Signs", + "domain": "VS", + "variables": [ { - "filename": "ae.xpt", - "label": "Adverse Events", - "domain": "AE", - "variables": [ - { - "name": "STUDYID", - "label": "Study Identifier", - "type": "Char", - "length": 12 - }, - { - "name": "DOMAIN", - "label": "Domain Abbreviation", - "type": "Char", - "length": 2 - }, - { - "name": "USUBJID", - "label": "Unique Subject Identifier", - "type": "Char", - "length": 8 - }, - { - "name": "AESEQ", - "label": "Sequence Number", - "type": "Num", - "length": 8 - }, - { - "name": "AELNKID", - "label": "Link ID", - "type": "Char", - "length": 50 - }, - { - "name": "AETERM", - "label": "Reported Term for the Adverse Event", - "type": "Char", - "length": 200 - }, - { - "name": "AESEV", - "label": "Severity/Intensity", - "type": "Char", - "length": 8 - }, - { - "name": "AESER", - "label": "Serious Event", - "type": "Char", - "length": 1 - }, - { - "name": "AEACN", - "label": "Action Taken with Study Treatment", - "type": "Char", - "length": 16 - }, - { - "name": "AEREL", - "label": "Causality", - "type": "Char", - "length": 16 - }, - { - "name": "AEOUT", - "label": "Outcome of Adverse Event", - "type": "Char", - "length": 32 - }, - { - "name": "AESCAN", - "label": "Involves Cancer", - "type": "Char", - "length": 1 - }, - { - "name": "AESLIFE", - "label": "Is Life Threatening", - "type": "Char", - "length": 1 - }, - { - "name": "EPOCH", - "label": "Epoch", - "type": "Char", - "length": 9 - }, - { - "name": "AESTDTC", - "label": "Start Date/Time of Adverse Event", - "type": "Char", - "length": 10 - }, - { - "name": "AEENDTC", - "label": "End Date/Time of Adverse Event", - "type": "Char", - "length": 10 - }, - { - "name": "AESTDY", - "label": "Study Day of Start of Adverse Event", - "type": "Num", - "length": 8 - }, - { - "name": "AEENDY", - "label": "Study Day of End of Adverse Event", - "type": "Num", - "length": 8 - }, - { - "name": "AEENRTPT", - "label": "End Relative to Reference Time Point", - "type": "Char", - "length": 7 - }, - { - "name": "AEENTPT", - "label": "End Reference Time Point", - "type": "Char", - "length": 10 - } - ], - "records": { - "STUDYID": [ - "CDISCPILOT01", - "CDISCPILOT01", - "CDISCPILOT01" - ], - "DOMAIN": [ - "AE", - "AE", - "AE" - ], - "USUBJID": [ - "CDISC001", - "CDISC001", - "CDISC002" - ], - "AESEQ": [ - 1, - 2, - 1 - ], - "AELNKID": [ - "1", - "2", - "1" - ], - "AETERM": [ - "INJECTION SITE REACTION", - "FATIGUE", - "INJECTION SITE REACTION" - ], - "AESEV": [ - "MODERATE", - "MODERATE", - "MILD" - ], - "AESER": [ - "N", - "N", - "N" - ], - "AEACN": [ - "DRUG WITHDRAWN", - "DOSE NOT CHANGED", - "DOSE NOT CHANGED" - ], - "AEREL": [ - "RELATED", - "UNLIKELY RELATED", - "POSSIBLY RELATED" - ], - "AEOUT": [ - "NOT RECOVERED/NOT RESOLVED", - "NOT RECOVERED/NOT RESOLVED", - "NOT RECOVERED/NOT RESOLVED" - ], - "AESCAN": [ - "N", - "N", - "N" - ], - "AESLIFE": [ - "N", - "N", - "N" - ], - "EPOCH": [ - "TREATMENT", - "TREATMENT", - "TREATMENT" - ], - "AESTDTC": [ - "2012-12-02", - "2013-01-14", - "2012-11-16" - ], - "AEENDTC": [ - "", - "", - "" - ], - "AESTDY": [ - 3, - 46, - 2 - ], - "AEENDY": [ - null, - null, - null - ], - "AEENRTPT": [ - "ONGOING", - "ONGOING", - "ONGOING" - ], - "AEENTPT": [ - "2013-05-20", - "2013-05-20", - "2013-01-14" - ] - } + "name": "STUDYID", + "label": "Study Identifier", + "type": "Char", + "length": 12 }, { - "filename": "fa.xpt", - "label": "Findings About Events or Interventions", - "domain": "FA", - "variables": [ - { - "name": "STUDYID", - "label": "Study Identifier", - "type": "Char", - "length": 12 - }, - { - "name": "DOMAIN", - "label": "Domain Abbreviation", - "type": "Char", - "length": 2 - }, - { - "name": "USUBJID", - "label": "Unique Subject Identifier", - "type": "Char", - "length": 8 - }, - { - "name": "FASEQ", - "label": "Sequence Number", - "type": "Num", - "length": 8 - }, - { - "name": "FALNKGRP", - "label": "Link Group ID", - "type": "Char", - "length": 200 - }, - { - "name": "FATESTCD", - "label": "Findings About Test Short Name", - "type": "Char", - "length": 5 - }, - { - "name": "FATEST", - "label": "Findings About Test Name", - "type": "Char", - "length": 20 - }, - { - "name": "FAOBJ", - "label": "Object of the Observation", - "type": "Char", - "length": 10 - }, - { - "name": "FACAT", - "label": "Category for Findings About", - "type": "Char", - "length": 23 - }, - { - "name": "FAORRES", - "label": "Result or Finding in Original Units", - "type": "Char", - "length": 8 - }, - { - "name": "FASTRESC", - "label": "Character Result/Finding in Std Format", - "type": "Char", - "length": 8 - }, - { - "name": "FALOC", - "label": "Location of the Finding About", - "type": "Char", - "length": 3 - }, - { - "name": "VISITNUM", - "label": "Visit Number", - "type": "Num", - "length": 8 - }, - { - "name": "EPOCH", - "label": "Epoch", - "type": "Char", - "length": 9 - }, - { - "name": "FADTC", - "label": "Date/Time of Collection", - "type": "Char", - "length": 10 - }, - { - "name": "FADY", - "label": "Study Day of Collection", - "type": "Num", - "length": 8 - } - ], - "records": { - "STUDYID": [ - "CDISCPILOT01", - "CDISCPILOT01", - "CDISCPILOT01", - "CDISCPILOT01", - "CDISCPILOT01", - "CDISCPILOT01", - "CDISCPILOT01", - "CDISCPILOT01", - "CDISCPILOT01", - "CDISCPILOT01", - "CDISCPILOT01", - "CDISCPILOT01" - ], - "DOMAIN": [ - "FA", - "FA", - "FA", - "FA", - "FA", - "FA", - "FA", - "FA", - "FA", - "FA", - "FA", - "FA" - ], - "USUBJID": [ - "CDISC001", - "CDISC001", - "CDISC001", - "CDISC001", - "CDISC001", - "CDISC001", - "CDISC002", - "CDISC002", - "CDISC002", - "CDISC002", - "CDISC002", - "CDISC002" - ], - "FASEQ": [ - 1, - 2, - 3, - 4, - 5, - 6, - 1, - 2, - 3, - 4, - 5, - 6 - ], - "FALNKGRP": [ - "CDISC001 - 1", - "CDISC001 - 1", - "CDISC001 - 1", - "CDISC001 - 1", - "CDISC001 - 1", - "CDISC001 - 1", - "CDISC002 - 1", - "CDISC002 - 1", - "CDISC002 - 1", - "CDISC002 - 1", - "CDISC002 - 1", - "CDISC002 - 1" - ], - "FATESTCD": [ - "OCCUR", - "SEV", - "OCCUR", - "OCCUR", - "OCCUR", - "OCCUR", - "OCCUR", - "OCCUR", - "OCCUR", - "OCCUR", - "SEV", - "OCCUR" - ], - "FATEST": [ - "Occurrence Indicator", - "Severity/Intensity", - "Occurrence Indicator", - "Occurrence Indicator", - "Occurrence Indicator", - "Occurrence Indicator", - "Occurrence Indicator", - "Occurrence Indicator", - "Occurrence Indicator", - "Occurrence Indicator", - "Severity/Intensity", - "Occurrence Indicator" - ], - "FAOBJ": [ - "ERYTHEMA", - "ERYTHEMA", - "PAIN", - "INDURATION", - "PRURITIS", - "EDEMA", - "ERYTHEMA", - "PAIN", - "INDURATION", - "PRURITIS", - "PRURITIS", - "EDEMA" - ], - "FACAT": [ - "INJECTION SITE REACTION", - "INJECTION SITE REACTION", - "INJECTION SITE REACTION", - "INJECTION SITE REACTION", - "INJECTION SITE REACTION", - "INJECTION SITE REACTION", - "INJECTION SITE REACTION", - "INJECTION SITE REACTION", - "INJECTION SITE REACTION", - "INJECTION SITE REACTION", - "INJECTION SITE REACTION", - "INJECTION SITE REACTION" - ], - "FAORRES": [ - "Y", - "MODERATE", - "N", - "N", - "N", - "N", - "N", - "N", - "N", - "Y", - "MILD", - "N" - ], - "FASTRESC": [ - "Y", - "MODERATE", - "N", - "N", - "N", - "N", - "N", - "N", - "N", - "Y", - "MILD", - "N" - ], - "FALOC": [ - "ARM", - "ARM", - "ARM", - "ARM", - "ARM", - "ARM", - "ARM", - "ARM", - "ARM", - "ARM", - "ARM", - "ARM" - ], - "VISITNUM": [ - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null - ], - "EPOCH": [ - "TREATMENT", - "TREATMENT", - "TREATMENT", - "TREATMENT", - "TREATMENT", - "TREATMENT", - "TREATMENT", - "TREATMENT", - "TREATMENT", - "TREATMENT", - "TREATMENT", - "TREATMENT" - ], - "FADTC": [ - "2012-12-02", - "2012-12-02", - "2012-12-02", - "2012-12-02", - "2012-12-02", - "2012-12-02", - "2012-11-16", - "2012-11-16", - "2012-11-16", - "2012-11-16", - "2012-11-16", - "2012-11-16" - ], - "FADY": [ - 3, - 3, - 3, - 3, - 3, - 3, - 2, - 2, - 2, - 2, - 2, - 2 - ] - } + "name": "DOMAIN", + "label": "Domain Abbreviation", + "type": "Char", + "length": 2 }, { - "filename": "vs.xpt", - "label": "Vital Signs", - "domain": "VS", - "variables": [ - { - "name": "STUDYID", - "label": "Study Identifier", - "type": "Char", - "length": 12 - }, - { - "name": "DOMAIN", - "label": "Domain Abbreviation", - "type": "Char", - "length": 2 - }, - { - "name": "USUBJID", - "label": "Unique Subject Identifier", - "type": "Char", - "length": 8 - }, - { - "name": "VSSEQ", - "label": "Sequence Number", - "type": "Num", - "length": 8 - }, - { - "name": "VSTESTCD", - "label": "Vital Signs Test Short Name", - "type": "Char", - "length": 6 - }, - { - "name": "VSTEST", - "label": "Vital Signs Test Name", - "type": "Char", - "length": 24 - }, - { - "name": "VSPOS", - "label": "Vital Signs Position of Subject", - "type": "Char", - "length": 8 - }, - { - "name": "VSORRES", - "label": "Result or Finding in Original Units", - "type": "Char", - "length": 8 - }, - { - "name": "VSORRESU", - "label": "Original Units", - "type": "Char", - "length": 9 - }, - { - "name": "VSSTRESC", - "label": "Character Result/Finding in Std Format", - "type": "Char", - "length": 200 - }, - { - "name": "VSSTRESN", - "label": "Numeric Result/Finding in Standard Units", - "type": "Num", - "length": 8 - }, - { - "name": "VSSTRESU", - "label": "Standard Units", - "type": "Char", - "length": 9 - }, - { - "name": "VSSTAT", - "label": "Completion Status", - "type": "Char", - "length": 8 - }, - { - "name": "VSLOC", - "label": "Location of Vital Signs Measurement", - "type": "Char", - "length": 11 - }, - { - "name": "VSLOBXFL", - "label": "Last Observation Before Exposure Flag", - "type": "Char", - "length": 1 - }, - { - "name": "VSREPNUM", - "label": "Repetition Number", - "type": "Num", - "length": 8 - }, - { - "name": "VISITNUM", - "label": "Visit Number", - "type": "Num", - "length": 8 - }, - { - "name": "VISIT", - "label": "Visit Name", - "type": "Char", - "length": 200 - }, - { - "name": "EPOCH", - "label": "Epoch", - "type": "Char", - "length": 9 - }, - { - "name": "VSDTC", - "label": "Date/Time of Measurements", - "type": "Char", - "length": 10 - }, - { - "name": "VSDY", - "label": "Study Day of Vital Signs", - "type": "Num", - "length": 8 - } - ], - "records": { - "STUDYID": [ - "CDISCPILOT01", - "CDISCPILOT01", - "CDISCPILOT01", - "CDISCPILOT01", - "CDISCPILOT01", - "CDISCPILOT01", - "CDISCPILOT01", - "CDISCPILOT01" - ], - "DOMAIN": [ - "VS", - "VS", - "VS", - "VS", - "VS", - "VS", - "VS", - "VS" - ], - "USUBJID": [ - "CDISC001", - "CDISC001", - "CDISC001", - "CDISC001", - "CDISC002", - "CDISC002", - "CDISC002", - "CDISC002" - ], - "VSSEQ": [ - 1, - 2, - 3, - 4, - 1, - 2, - 3, - 4 - ], - "VSTESTCD": [ - "DIABP", - "DIABP", - "DIABP", - "DIABP", - "DIABP", - "DIABP", - "DIABP", - "DIABP" - ], - "VSTEST": [ - "Diastolic Blood Pressure", - "Diastolic Blood Pressure", - "Diastolic Blood Pressure", - "Diastolic Blood Pressure", - "Diastolic Blood Pressure", - "Diastolic Blood Pressure", - "Diastolic Blood Pressure", - "Diastolic Blood Pressure" - ], - "VSPOS": [ - "STANDING", - "STANDING", - "STANDING", - "STANDING", - "STANDING", - "STANDING", - "STANDING", - "STANDING" - ], - "VSORRES": [ - "71", - "71", - "83", - "79", - "60", - "64", - "64", - "58" - ], - "VSORRESU": [ - "mmHg", - "mmHg", - "mmHg", - "mmHg", - "mmHg", - "mmHg", - "mmHg", - "mmHg" - ], - "VSSTRESC": [ - "71", - "71", - "83", - "79", - "60", - "64", - "64", - "58" - ], - "VSSTRESN": [ - 71, - 71, - 83, - 79, - 60, - 64, - 64, - 58 - ], - "VSSTRESU": [ - "mmHg", - "mmHg", - "mmHg", - "mmHg", - "mmHg", - "mmHg", - "mmHg", - "mmHg" - ], - "VSSTAT": [ - "", - "", - "", - "", - "", - "", - "", - "" - ], - "VSLOC": [ - "", - "", - "", - "", - "", - "", - "", - "" - ], - "VSLOBXFL": [ - "", - "", - "Y", - "", - "", - "", - "Y", - "" - ], - "VSREPNUM": [ - null, - null, - null, - null, - null, - null, - null, - null - ], - "VISITNUM": [ - 1, - 2, - 3, - 4, - 1, - 2, - 3, - 4 - ], - "VISIT": [ - "SCREENING 1", - "SCREENING 2", - "BASELINE", - "WEEK 2", - "SCREENING 1", - "SCREENING 2", - "BASELINE", - "WEEK 2" - ], - "EPOCH": [ - "SCREENING", - "SCREENING", - "SCREENING", - "TREATMENT", - "SCREENING", - "SCREENING", - "SCREENING", - "TREATMENT" - ], - "VSDTC": [ - "2012-11-23", - "2012-11-28", - "2012-11-30", - "2012-12-13", - "2012-10-30", - "2012-11-14", - "2012-11-15", - "2012-11-28" - ], - "VSDY": [ - -7, - -2, - 1, - 14, - -16, - -1, - 1, - 14 - ] - } + "name": "USUBJID", + "label": "Unique Subject Identifier", + "type": "Char", + "length": 8 + }, + { + "name": "VSSEQ", + "label": "Sequence Number", + "type": "Num", + "length": 8 + }, + { + "name": "VSTESTCD", + "label": "Vital Signs Test Short Name", + "type": "Char", + "length": 6 + }, + { + "name": "VSTEST", + "label": "Vital Signs Test Name", + "type": "Char", + "length": 24 + }, + { + "name": "VSPOS", + "label": "Vital Signs Position of Subject", + "type": "Char", + "length": 8 + }, + { + "name": "VSORRES", + "label": "Result or Finding in Original Units", + "type": "Char", + "length": 8 + }, + { + "name": "VSORRESU", + "label": "Original Units", + "type": "Char", + "length": 9 + }, + { + "name": "VSSTRESC", + "label": "Character Result/Finding in Std Format", + "type": "Char", + "length": 200 + }, + { + "name": "VSSTRESN", + "label": "Numeric Result/Finding in Standard Units", + "type": "Num", + "length": 8 + }, + { + "name": "VSSTRESU", + "label": "Standard Units", + "type": "Char", + "length": 9 + }, + { + "name": "VSSTAT", + "label": "Completion Status", + "type": "Char", + "length": 8 + }, + { + "name": "VSLOC", + "label": "Location of Vital Signs Measurement", + "type": "Char", + "length": 11 + }, + { + "name": "VSLOBXFL", + "label": "Last Observation Before Exposure Flag", + "type": "Char", + "length": 1 + }, + { + "name": "VSREPNUM", + "label": "Repetition Number", + "type": "Num", + "length": 8 + }, + { + "name": "VISITNUM", + "label": "Visit Number", + "type": "Num", + "length": 8 + }, + { + "name": "VISIT", + "label": "Visit Name", + "type": "Char", + "length": 200 + }, + { + "name": "EPOCH", + "label": "Epoch", + "type": "Char", + "length": 9 + }, + { + "name": "VSDTC", + "label": "Date/Time of Measurements", + "type": "Char", + "length": 10 + }, + { + "name": "VSDY", + "label": "Study Day of Vital Signs", + "type": "Num", + "length": 8 } - ] -} \ No newline at end of file + ], + "records": { + "STUDYID": [ + "CDISCPILOT01", + "CDISCPILOT01", + "CDISCPILOT01", + "CDISCPILOT01", + "CDISCPILOT01", + "CDISCPILOT01", + "CDISCPILOT01", + "CDISCPILOT01" + ], + "DOMAIN": ["VS", "VS", "VS", "VS", "VS", "VS", "VS", "VS"], + "USUBJID": [ + "CDISC001", + "CDISC001", + "CDISC001", + "CDISC001", + "CDISC002", + "CDISC002", + "CDISC002", + "CDISC002" + ], + "VSSEQ": [1, 2, 3, 4, 1, 2, 3, 4], + "VSTESTCD": [ + "DIABP", + "DIABP", + "DIABP", + "DIABP", + "DIABP", + "DIABP", + "DIABP", + "DIABP" + ], + "VSTEST": [ + "Diastolic Blood Pressure", + "Diastolic Blood Pressure", + "Diastolic Blood Pressure", + "Diastolic Blood Pressure", + "Diastolic Blood Pressure", + "Diastolic Blood Pressure", + "Diastolic Blood Pressure", + "Diastolic Blood Pressure" + ], + "VSPOS": [ + "STANDING", + "STANDING", + "STANDING", + "STANDING", + "STANDING", + "STANDING", + "STANDING", + "STANDING" + ], + "VSORRES": ["71", "71", "83", "79", "60", "64", "64", "58"], + "VSORRESU": [ + "mmHg", + "mmHg", + "mmHg", + "mmHg", + "mmHg", + "mmHg", + "mmHg", + "mmHg" + ], + "VSSTRESC": ["71", "71", "83", "79", "60", "64", "64", "58"], + "VSSTRESN": [71, 71, 83, 79, 60, 64, 64, 58], + "VSSTRESU": [ + "mmHg", + "mmHg", + "mmHg", + "mmHg", + "mmHg", + "mmHg", + "mmHg", + "mmHg" + ], + "VSSTAT": ["", "", "", "", "", "", "", ""], + "VSLOC": ["", "", "", "", "", "", "", ""], + "VSLOBXFL": ["", "", "Y", "", "", "", "Y", ""], + "VSREPNUM": [null, null, null, null, null, null, null, null], + "VISITNUM": [1, 2, 3, 4, 1, 2, 3, 4], + "VISIT": [ + "SCREENING 1", + "SCREENING 2", + "BASELINE", + "WEEK 2", + "SCREENING 1", + "SCREENING 2", + "BASELINE", + "WEEK 2" + ], + "EPOCH": [ + "SCREENING", + "SCREENING", + "SCREENING", + "TREATMENT", + "SCREENING", + "SCREENING", + "SCREENING", + "TREATMENT" + ], + "VSDTC": [ + "2012-11-23", + "2012-11-28", + "2012-11-30", + "2012-12-13", + "2012-10-30", + "2012-11-14", + "2012-11-15", + "2012-11-28" + ], + "VSDY": [-7, -2, 1, 14, -16, -1, 1, 14] + } + } + ] +} diff --git a/tests/resources/CoreIssue427/rule.json b/tests/resources/CoreIssue427/rule.json index 8474951c5..6a0deb510 100644 --- a/tests/resources/CoreIssue427/rule.json +++ b/tests/resources/CoreIssue427/rule.json @@ -13,10 +13,10 @@ "Citations": [ { "Document": "FDA", - "Cited_Guidance": "FDAB009" + "Cited Guidance": "FDAB009" } ], - "Rule_Identifier": { + "Rule Identifier": { "Id": "SD1033", "Version": "1" } @@ -33,10 +33,10 @@ "Citations": [ { "Document": "FDA", - "Cited_Guidance": "FDAB009" + "Cited Guidance": "FDAB009" } ], - "Rule_Identifier": { + "Rule Identifier": { "Id": "SD1033", "Version": "1" } @@ -53,10 +53,10 @@ "Citations": [ { "Document": "FDA", - "Cited_Guidance": "FDAB009" + "Cited Guidance": "FDAB009" } ], - "Rule_Identifier": { + "Rule Identifier": { "Id": "SD1033", "Version": "1" } @@ -73,10 +73,10 @@ "Citations": [ { "Document": "FDA", - "Cited_Guidance": "FDAB009" + "Cited Guidance": "FDAB009" } ], - "Rule_Identifier": { + "Rule Identifier": { "Id": "SD1033", "Version": "1" } @@ -93,10 +93,10 @@ "Citations": [ { "Document": "FDA", - "Cited_Guidance": "FDAB009" + "Cited Guidance": "FDAB009" } ], - "Rule_Identifier": { + "Rule Identifier": { "Id": "SD1033", "Version": "1" } @@ -113,10 +113,10 @@ "Citations": [ { "Document": "FDA", - "Cited_Guidance": "FDAB009" + "Cited Guidance": "FDAB009" } ], - "Rule_Identifier": { + "Rule Identifier": { "Id": "SD1033", "Version": "1" } @@ -133,10 +133,10 @@ "Citations": [ { "Document": "FDA", - "Cited_Guidance": "FDAB009" + "Cited Guidance": "FDAB009" } ], - "Rule_Identifier": { + "Rule Identifier": { "Id": "SD1033", "Version": "1" } @@ -153,10 +153,10 @@ "Citations": [ { "Document": "FDA", - "Cited_Guidance": "FDAB009" + "Cited Guidance": "FDAB009" } ], - "Rule_Identifier": { + "Rule Identifier": { "Id": "SD1033", "Version": "1" } @@ -173,10 +173,10 @@ "Citations": [ { "Document": "FDA", - "Cited_Guidance": "FDAB009" + "Cited Guidance": "FDAB009" } ], - "Rule_Identifier": { + "Rule Identifier": { "Id": "SD1033", "Version": "1" } @@ -194,25 +194,15 @@ "Description": "A value for Description of Planned Arm (ARM) must have a unique value for Planned Arm Code (ARMCD) with the domain.", "Outcome": { "Message": "Inconsistent value for ARM", - "Output_Variables": [ - "ARMCD", - "ARM" - ] + "Output Variables": ["ARMCD", "ARM"] }, "Sensitivity": "Record", "Scope": { "Classes": { - "Include": [ - "TRIAL DESIGN", - "SPECIAL PURPOSE" - ] + "Include": ["TRIAL DESIGN", "SPECIAL PURPOSE"] }, "Domains": { - "Include": [ - "TA", - "TV", - "DM" - ] + "Include": ["TA", "TV", "DM"] } }, "Executability": "Fully Executable", diff --git a/tests/resources/CoreIssue576/Rule_underscores.json b/tests/resources/CoreIssue576/Rule_underscores.json index 4a8bd5c7b..27b56912b 100644 --- a/tests/resources/CoreIssue576/Rule_underscores.json +++ b/tests/resources/CoreIssue576/Rule_underscores.json @@ -1,93 +1,86 @@ { - "Authorities": [ + "Authorities": [ + { + "Organization": "CDISC", + "Standards": [ { - "Organization": "CDISC", - "Standards": [ - { - "Name": "SDTMIG", - "References": [ - { - "Citations": [ - { - "Document": "IG v3.2", - "Section": "8.4", - "Cited_Guidance": "For objective data, the value in QEVAL will be null. For subjective data (when QORIG=”ASSIGNED”), the value in QEVAL should reflect the role of the person or institution assigning the value (e.g., SPONSOR or ADJUDICATION COMMITTEE)." - } - ], - "Origin": "SDTM and SDTMIG Conformance Rules", - "Version": "2.0", - "Rule_Identifier": { - "Id": "CG0202", - "Version": "2" - } - } - ], - "Version": "3.2" - }, + "Name": "SDTMIG", + "References": [ + { + "Citations": [ { - "Name": "SDTMIG", - "References": [ - { - "Citations": [ - { - "Document": "IG v3.3", - "Section": "8.4", - "Cited_Guidance": "For objective data, the value in QEVAL will be null. For subjective data (when QORIG=”ASSIGNED”), the value in QEVAL should reflect the role of the person or institution assigning the value (e.g., SPONSOR or ADJUDICATION COMMITTEE)." - } - ], - "Origin": "SDTM and SDTMIG Conformance Rules", - "Version": "2.0", - "Rule_Identifier": { - "Id": "CG0202", - "Version": "2" - } - } - ], - "Version": "3.3" + "Document": "IG v3.2", + "Section": "8.4", + "Cited Guidance": "For objective data, the value in QEVAL will be null. For subjective data (when QORIG=”ASSIGNED”), the value in QEVAL should reflect the role of the person or institution assigning the value (e.g., SPONSOR or ADJUDICATION COMMITTEE)." } - ] - } - ], - "Check": { - "all": [ - { - "name": "QORIG", - "operator": "equal_to_case_insensitive", - "value": "ASSIGNED", - "value_is_literal": true - }, - { - "name": "QEVAL", - "operator": "empty" + ], + "Origin": "SDTM and SDTMIG Conformance Rules", + "Version": "2.0", + "Rule Identifier": { + "Id": "CG0202", + "Version": "2" + } } - ] - }, - "Core": { - "Id": "CORE-000375", - "Status": "Published", - "Version": "1" - }, - "Description": "Raise an error when QORIG = ASSIGNED and QEVAL is not populated.", - "Executability": "Fully Executable", - "Outcome": { - "Message": "QORIG = ASSIGNED but QEVAL is not populated", - "Output_Variables": [ - "QORIG", - "QEVAL" - ] - }, - "Scope": { - "Classes": { - "Include": [ - "RELATIONSHIP" - ] + ], + "Version": "3.2" }, - "Domains": { - "Include": [ - "SUPP--" - ] + { + "Name": "SDTMIG", + "References": [ + { + "Citations": [ + { + "Document": "IG v3.3", + "Section": "8.4", + "Cited Guidance": "For objective data, the value in QEVAL will be null. For subjective data (when QORIG=”ASSIGNED”), the value in QEVAL should reflect the role of the person or institution assigning the value (e.g., SPONSOR or ADJUDICATION COMMITTEE)." + } + ], + "Origin": "SDTM and SDTMIG Conformance Rules", + "Version": "2.0", + "Rule Identifier": { + "Id": "CG0202", + "Version": "2" + } + } + ], + "Version": "3.3" } + ] + } + ], + "Check": { + "all": [ + { + "name": "QORIG", + "operator": "equal_to_case_insensitive", + "value": "ASSIGNED", + "value_is_literal": true + }, + { + "name": "QEVAL", + "operator": "empty" + } + ] + }, + "Core": { + "Id": "CORE-000375", + "Status": "Published", + "Version": "1" + }, + "Description": "Raise an error when QORIG = ASSIGNED and QEVAL is not populated.", + "Executability": "Fully Executable", + "Outcome": { + "Message": "QORIG = ASSIGNED but QEVAL is not populated", + "Output Variables": ["QORIG", "QEVAL"] + }, + "Scope": { + "Classes": { + "Include": ["RELATIONSHIP"] }, - "Sensitivity": "Record", - "Rule_Type": "Record Data" -} \ No newline at end of file + "Domains": { + "Include": ["SUPP--"] + } + }, + "Sensitivity": "Record", + "Rule_Type": "Record Data" +} diff --git a/tests/resources/CoreIssue747/Rule_underscores.json b/tests/resources/CoreIssue747/Rule_underscores.json index ccaab488b..ba2e745f3 100755 --- a/tests/resources/CoreIssue747/Rule_underscores.json +++ b/tests/resources/CoreIssue747/Rule_underscores.json @@ -11,17 +11,17 @@ { "Document": "IG v3.4", "Section": "Table 3.2.1", - "Cited_Guidance": "Note that the key variables shown in this table are examples only. A sponsor's actual key structure may be different." + "Cited Guidance": "Note that the key variables shown in this table are examples only. A sponsor's actual key structure may be different." }, { "Document": "IG v3.4", "Section": "3.2.1.1", - "Cited_Guidance": "Since the purpose of this column is to aid reviewers in understanding the structure of a dataset, sponsors should list all of the natural keys (see definition below) for the dataset. These keys should define uniqueness for records within a dataset, and may define a record sort order. The identified keys for each dataset should be consistent with the description of the dataset structure as described in the Define-XML document." + "Cited Guidance": "Since the purpose of this column is to aid reviewers in understanding the structure of a dataset, sponsors should list all of the natural keys (see definition below) for the dataset. These keys should define uniqueness for records within a dataset, and may define a record sort order. The identified keys for each dataset should be consistent with the description of the dataset structure as described in the Define-XML document." } ], "Origin": "SDTM and SDTMIG Conformance Rules", "Version": "2.0", - "Rule_Identifier": { + "Rule Identifier": { "Id": "CG0019", "Version": "1" } @@ -37,12 +37,12 @@ { "Document": "IG v3.2", "Section": "Table 3.2.1|3.2.1.1", - "Cited_Guidance": "Table 3.2.1[Note that the key variables shown in this table are examples only. A sponsor's actual key structure may be different.]|3.2.1.1[Since the purpose of this column is to aid reviewers in understanding the structure of a dataset, sponsors should list all of the natural keys (see definition below) for the dataset. These keys should define uniqueness for records within a dataset, and may define a record sort order.]" + "Cited Guidance": "Table 3.2.1[Note that the key variables shown in this table are examples only. A sponsor's actual key structure may be different.]|3.2.1.1[Since the purpose of this column is to aid reviewers in understanding the structure of a dataset, sponsors should list all of the natural keys (see definition below) for the dataset. These keys should define uniqueness for records within a dataset, and may define a record sort order.]" } ], "Origin": "SDTM and SDTMIG Conformance Rules", "Version": "2.0", - "Rule_Identifier": { + "Rule Identifier": { "Id": "CG0019", "Version": "1" } @@ -58,12 +58,12 @@ { "Document": "IG v3.3", "Section": "Table 3.2.1|3.2.1.1", - "Cited_Guidance": "Table 3.2.1[Note that the key variables shown in this table are examples only. A sponsor's actual key structure may be different.]||3.2.1.1[Since the purpose of this column is to aid reviewers in understanding the structure of a dataset, sponsors should list all of the natural keys (see definition below) for the dataset. These keys should define uniqueness for records within a dataset, and may define a record sort order.]" + "Cited Guidance": "Table 3.2.1[Note that the key variables shown in this table are examples only. A sponsor's actual key structure may be different.]||3.2.1.1[Since the purpose of this column is to aid reviewers in understanding the structure of a dataset, sponsors should list all of the natural keys (see definition below) for the dataset. These keys should define uniqueness for records within a dataset, and may define a record sort order.]" } ], "Origin": "SDTM and SDTMIG Conformance Rules", "Version": "2.0", - "Rule_Identifier": { + "Rule Identifier": { "Id": "CG0019", "Version": "1" } @@ -101,7 +101,7 @@ } }, "Sensitivity": "Record", - "Match_Datasets": [ + "Match Datasets": [ { "Keys": ["USUBJID"], "Name": "SUPP--" diff --git a/tests/unit/test_rule.py b/tests/unit/test_rule.py index 51244bcfc..6177b5607 100644 --- a/tests/unit/test_rule.py +++ b/tests/unit/test_rule.py @@ -100,7 +100,7 @@ def test_valid_parse_actions(): { "Name": "AA", "Keys": ["STUDYID", {"left": "USUBJID", "right": "RSUBJID"}], - "Join_Type": "left", + "Join Type": "left", } ], [