Skip to content

Conversation

@steph-torres-nhs
Copy link
Contributor

Overview

Jira ticket: PRMP-975

Description

Adding pagination capability to Document Reference Search

Context

Checklist

Tasks for all changes:

  • 1. I have linked this PR to its Jira ticket.
  • 2. I have run git pre-commits. (WIP)
  • 3. I have added and/or updated relevant tests.
  • [ ] 4. I have updated relevant documentation.
  • 5. I have considered the cross-team impact (and have PR approval from both Core & Demographics if necessary).
  • 6. I have successfully deployed this change to a sandbox and witnessed unit and e2e tests passing:

modified_doc.document_scan_creation = "2023-05-15"

patched_service.s3_service.get_file_size.return_value = 8000000
# patched_service.s3_service.get_file_size.return_value = 8000000
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove?

Comment on lines 47 to 49
response = camelize_dict(document_reference_search_service.get_paginated_references_by_nhs_number(
nhs_number=nhs_number, limit=limit, next_page_token=next_page_token, filter=doc_status_filter
))
Copy link
Contributor

@NogaNHS NogaNHS Jan 13, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you break this down? a bit hard to read

response = camelize_dict(document_reference_search_service.get_paginated_references_by_nhs_number(
nhs_number=nhs_number, limit=limit, next_page_token=next_page_token, filter=doc_status_filter
))
else:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why are we doing this? Can't we use a default limit like review search?

def _get_table_name(self, common_name: MtlsCommonNames | None) -> str:
if not common_name or common_name not in MtlsCommonNames:
return table_list
return str(DynamoTables.LLOYD_GEORGE)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is StrEnum, why do you need to do this?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

changed how we get the table name

"operator": ConditionOperator.EQUAL.value,
"value": filter_value, }
)
return build_mixed_condition_expression(conditions)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

format

Comment on lines 272 to 274
"field": DocumentReferenceMetadataFields.DELETED.value,
"operator": ConditionOperator.NOT_EQUAL.value,
"value": True
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Isn't delete a timestamp?

for filter_key, filter_value in filter_values.items():
if filter_key == "custodian":
conditions.append(
{"field": DocumentReferenceMetadataFields.CURRENT_GP_ODS.value,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use Custodian

@github-actions
Copy link

Code security issues found

View full details here.

@sonarqubecloud
Copy link

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants