939 rule blocked corerules 9609 codelist terms operation does not retrieve correct terms#1462
Merged
SFJohnson24 merged 3 commits intomainfrom Dec 3, 2025
Conversation
SFJohnson24
approved these changes
Dec 3, 2025
Collaborator
SFJohnson24
left a comment
There was a problem hiding this comment.
This PR passes high level review. It correctly resolves the issue described in the ticket with collisions in the submission lookup due to values not being unique. The PR allows the associated DDF rule to be executed, see attached:
CORE-Report-2025-12-03T15-26-33.xlsx with the correct term attached from the operator.
It also preserves extensible functionality -- DDF00210 was tested (negative attached)
CORE-Report-2025-12-03T15-50-04.xlsx
The PR replaces the submission_lookup dictionary lookup with a direct list comprehension of codelist-level submission values. It preserves the operator functionality elegantly, just changing how data is stored and retreived.
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 refactors how codelist and term metadata are structured and accessed throughout the codebase, moving from a legacy "submission_lookup" dictionary format to a more standardized "codelists" list of dictionaries. This change impacts data loading, metadata extraction, attribute querying, and related tests, leading to more consistent and maintainable handling of controlled terminology data.
Refactoring metadata structure and access:
submission_lookupdictionaries with a list of codelist dictionaries under thecodelistskey throughout the codebase, including in metadata containers, service responses, and tests. [1] [2] [3] [4]build_ct_listsandbuild_ct_terms(inlibrary_metadata_container.py) to iterate over the newcodelistsstructure, extracting codes and terms directly from dictionary entries. [1] [2]Refactoring attribute extraction and lookup logic:
get_codelist_attributes.pyto use JSONPath queries on the newcodelistsstructure, removing multiple legacy helper methods for extracting codes and terms.codelist_extensible.pyandcodelist_terms.pyto search and match within thecodelistslist, improving robustness and reducing reliance on indirect mappings. [1] [2] [3]Test and documentation updates: