939 rule blocked corerules 9609 codelist terms operation does not retrieve correct terms #1462
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: