-
Notifications
You must be signed in to change notification settings - Fork 4
NRL-1114 for nicip types allow multiple categories #907
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: feature/imaging
Are you sure you want to change the base?
NRL-1114 for nicip types allow multiple categories #907
Conversation
|
🚀 PR environment successfully deployed. |
|
🚀 PR environment successfully deployed. |
|
|
🚀 PR environment successfully deployed. |
katebobyn-nhs
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Following discussion in dev-cop, putting a pin in this since it's unclear whether this will be needed for the POC. Confirmed this works, there are some open questions about whether it's the best approach for the use case but these cannot really be answered until the use case is better defined -- we are unsure if XCA team will be reorganising the type and category codes so that modality, laterality and body site are searchable via context filters (thus the NICIP codes would not be needed and we can keep the 1-to-may category:type mapping).
| PointerTypes.MRI_AXILLA_BOTH.value: { | ||
| Categories.DIAGNOSTIC_PROCEDURE.value, | ||
| Categories.DIAGNOSTIC_STUDIES_REPORT.value, | ||
| }, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Open question: is it better to use sets for everything, even those types that map to only one category? Advantage: consistency, simplifies logic as we can use set union without having to check for type. Disadvantage: This branch diverges further from the main branch, and changes can't be ported over as easily.
Can be picked up later if this work proceeds.
| ): | ||
| """Build DynamoDB filter expressions for pointer_types and categories.""" | ||
| filter_expressions = [] | ||
| if pointer_types: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For clarity, this will ALWAYS be true, as if the searcher does not specify a a pointer type filter in their search, pointer_types is populated by the list of pointers for which they have permissions. If they have no pointer types permitted, they never get to this point, as it is caught by the decorator and 403 is returned.
| filter_expressions = _build_filter_expressions( | ||
| pointer_types, all_categories, expression_names, expression_values | ||
| ) | ||
| elif categories and not pointer_types: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Similar to the above comment, pointer_types will always be populated (whether by a chosen filter or by the searcher's list of permitted pointers) so this will never get reached.
| ) | ||
| elif pointer_types and not categories: | ||
| # Get all categories for these pointer_types | ||
| all_categories = list(_get_categories_for_pointer_types(pointer_types)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Open question: Is there value to looking up all possible categories and adding filters for them, if type(s) already specified?



No description provided.