Skip to content

Conversation

@eesa456
Copy link
Contributor

@eesa456 eesa456 commented May 22, 2025

No description provided.

@github-actions
Copy link

🚀 PR environment successfully deployed.
Commit Hash: 8647237e16876f603e749c90ec1df7db072727d8
URL: https://nrl1114-ccb95e.api.record-locator.dev.national.nhs.uk/

@github-actions
Copy link

🚀 PR environment successfully deployed.
Commit Hash: 177301ce2c97dfecff277cf43b8f86a5760e82d3
URL: https://nrl1114-ccb95e.api.record-locator.dev.national.nhs.uk/

@sonarqubecloud
Copy link

@github-actions
Copy link

🚀 PR environment successfully deployed.
Commit Hash: 912abccf34c1452d7d409b673bcadc0ea6580ad4
URL: https://nrl1114-ccb95e.api.record-locator.dev.national.nhs.uk/

@eesa456 eesa456 added shamu-ignore Ignore this PR for the Merge Bot DO-NOT-MERGE DO NOT MERGE THIS PR labels Jun 5, 2025
Copy link
Contributor

@katebobyn-nhs katebobyn-nhs left a 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,
},
Copy link
Contributor

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:
Copy link
Contributor

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:
Copy link
Contributor

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))
Copy link
Contributor

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

DO-NOT-MERGE DO NOT MERGE THIS PR shamu-ignore Ignore this PR for the Merge Bot

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants