Skip to content

[PRMP-1408] DocumentReference history endpoint functionality#1144

Open
kamenbachvarov-nhs wants to merge 25 commits intomainfrom
PRMP-1408
Open

[PRMP-1408] DocumentReference history endpoint functionality#1144
kamenbachvarov-nhs wants to merge 25 commits intomainfrom
PRMP-1408

Conversation

@kamenbachvarov-nhs
Copy link
Contributor

@kamenbachvarov-nhs kamenbachvarov-nhs commented Mar 2, 2026

Overview

Jira ticket: PRMP-1408

Description

  • /DocumentReference/{id}/_history endpoint logic (handler + (fhir) service separation)
  • adapted authoriser to accept "_" (underscore) in endpoint paths
  • adapted the core lambda layer to include the new lambda deployment
  • feature flagged behind versionHistory flag
  • adjusted the doc_ref_pattern in authoriser service to include the new endpoint

Checklist

Tasks for all changes:

Additional tasks for UI changes (delete if not applicable):

  • 1. I have added evidence (to this PR) e.g. screenshots/gifs of all visual changes.

happy path
image

wrong id
image

user is not custodian
image

version history feature flag not enabled
image

lillie-dae
lillie-dae previously approved these changes Mar 2, 2026
entries = []

for doc_ref in items:
self.check_if_doc_ref_belongs_to_patient(doc_ref, nhs_number)
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 checking this here? what is the risk?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

moved this check as nhs filter - created it to cover for a scenario where user enters correct s3filekey but its reference is for a different patient

table_name=self.lg_table,
search_key="S3FileKey",
search_condition=s3_file_key,
index_name="S3FileKeyIndex",
Copy link
Contributor

Choose a reason for hiding this comment

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

Can you add a filter to check the nhs number here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

added

Comment on lines +57 to +58
doc_ref["LastUpdated"] = int(doc_ref["LastUpdated"])
doc_ref["FileSize"] = int(doc_ref["FileSize"])
Copy link
Contributor

Choose a reason for hiding this comment

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

is it not an int already?

Copy link
Contributor Author

@kamenbachvarov-nhs kamenbachvarov-nhs Mar 11, 2026

Choose a reason for hiding this comment

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

used to give me a model error, does not do that after refactoring so removed this casting

they are decimals

@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.

4 participants