diff --git a/cdisc_rules_engine/services/cache/cache_populator_service.py b/cdisc_rules_engine/services/cache/cache_populator_service.py index 5f993e144..c3854daac 100644 --- a/cdisc_rules_engine/services/cache/cache_populator_service.py +++ b/cdisc_rules_engine/services/cache/cache_populator_service.py @@ -111,7 +111,7 @@ async def save_rules_locally(self): rules_directory, rules_by_core_id = self.process_rules_lists( rules_directory, rules_by_core_id, rules_lists ) - + rules_directory.pop("tig/1-0", None) with open( os.path.join(self.cache_path, DefaultFilePaths.RULES_CACHE_FILE.value), "wb" ) as f: @@ -168,7 +168,6 @@ def process_rules_lists(self, rules_directory, rules_by_core_id, rules_lists): rules_directory[sub_key] = [] if core_id not in rules_directory[sub_key]: rules_directory[sub_key].append(core_id) - rules_by_core_id[core_id] = rule return rules_directory, rules_by_core_id diff --git a/core.py b/core.py index 69dea14ff..55ec341e7 100644 --- a/core.py +++ b/core.py @@ -585,7 +585,6 @@ def list_rule_sets(ctx: click.Context, cache_path: str, custom: bool): rules_file = DefaultFilePaths.RULES_DICTIONARY.value with open(os.path.join(cache_path, rules_file), "rb") as f: rules_data = pickle.load(f) - rule_sets = {} for key in rules_data.keys(): if "/" in key: @@ -593,18 +592,16 @@ def list_rule_sets(ctx: click.Context, cache_path: str, custom: bool): standard = parts[0] version = parts[1] substandard = parts[2] if len(parts) > 2 else None - if substandard: - version_key = f"{version}/{substandard}" - else: - version_key = version if standard not in rule_sets: rule_sets[standard] = set() - rule_sets[standard].add(version_key) - + rule_sets[standard].add((version, substandard)) for standard in sorted(rule_sets.keys()): - versions = sorted(rule_sets[standard]) - for version in versions: - print(f"{standard}, {version}") + versions = sorted(rule_sets[standard], key=lambda x: (x[0], x[1] or "")) + for version, substandard in versions: + if substandard: + print(f"{standard}, {version}, {substandard}") + else: + print(f"{standard}, {version}") @click.command() diff --git a/resources/cache/rules.pkl b/resources/cache/rules.pkl index c687822fc..b651f937c 100644 Binary files a/resources/cache/rules.pkl and b/resources/cache/rules.pkl differ diff --git a/resources/cache/rules_dictionary.pkl b/resources/cache/rules_dictionary.pkl index 048fa6b27..bf13316d4 100644 Binary files a/resources/cache/rules_dictionary.pkl and b/resources/cache/rules_dictionary.pkl differ diff --git a/resources/cache/standards_details.pkl b/resources/cache/standards_details.pkl index 8f0070307..5de21951e 100644 Binary files a/resources/cache/standards_details.pkl and b/resources/cache/standards_details.pkl differ diff --git a/resources/schema/Organization_CDISC.json b/resources/schema/Organization_CDISC.json index 58d16565b..db1041921 100644 --- a/resources/schema/Organization_CDISC.json +++ b/resources/schema/Organization_CDISC.json @@ -276,6 +276,7 @@ "enum": ["SDTM", "SEND", "ADaM", "CDASH"] } }, + "required": ["Name", "Version", "Substandard"], "type": "object" }, {