Skip to content

Fix: [AEA-6446] - Bug fix single patient return not loading prescription findings#1975

Merged
connoravo-nhs merged 13 commits intomainfrom
AEA-6327-fix-single-patient-return
Mar 31, 2026
Merged

Fix: [AEA-6446] - Bug fix single patient return not loading prescription findings#1975
connoravo-nhs merged 13 commits intomainfrom
AEA-6327-fix-single-patient-return

Conversation

@connoravo-nhs
Copy link
Copy Markdown
Contributor

Summary

  • Routine Change

Details

Fix the bug where a single patient returned on basic details search was being incorrectly redirected to search by prescription ID page, because it didn't have the searchType handled correctly.

Signed-off-by: Connor Avery <214469360+connoravo-nhs@users.noreply.github.com>
Signed-off-by: Connor Avery <214469360+connoravo-nhs@users.noreply.github.com>
Copilot AI review requested due to automatic review settings March 27, 2026 16:49
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Mar 27, 2026

This PR is linked to a ticket in an NHS Digital JIRA Project. Here's a handy link to the ticket:

AEA-6446

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Fixes a navigation bug in the CPT UI where a single patient result from a basic-details search could lead to an incorrect redirect (preventing prescription findings from loading) by ensuring the subsequent prescription list lookup uses the correct searchType.

Changes:

  • Ensure searchType is set to "nhs" when basic-details search returns exactly one patient and the flow pivots to an NHS-number-based prescription lookup.
  • Add additional logging when NavigationProvider.getRelevantSearchParameters can’t return parameters for the requested search type.
  • Update the unit test expectation for the single-result basic-details search flow.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.

File Description
packages/cpt-ui/src/pages/PrescriptionListPage.tsx Minor condition formatting for the basic-details redirect guard.
packages/cpt-ui/src/pages/BasicDetailsSearchResultsPage.tsx Sets searchType: "nhs" when exactly one patient is returned.
packages/cpt-ui/src/context/NavigationProvider.tsx Adds an info log when relevant search parameters aren’t available.
packages/cpt-ui/__tests__/BasicDetailsSearchResultsPage.test.tsx Updates expectation to include searchType: "nhs" for the single-result flow.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Signed-off-by: Connor Avery <214469360+connoravo-nhs@users.noreply.github.com>
@connoravo-nhs connoravo-nhs changed the title Fix: [AEA-6327] - Bug fix single patient return not loading prescription findings Fix: [AEA-6446] - Bug fix single patient return not loading prescription findings Mar 27, 2026
connoravo-nhs and others added 3 commits March 30, 2026 12:10
Signed-off-by: Connor Avery <214469360+connoravo-nhs@users.noreply.github.com>
…HSDigital/eps-prescription-tracker-ui into AEA-6327-fix-single-patient-return
@connoravo-nhs connoravo-nhs enabled auto-merge (squash) March 30, 2026 11:13
Signed-off-by: Connor Avery <214469360+connoravo-nhs@users.noreply.github.com>
auto-merge was automatically disabled March 30, 2026 11:22

Pull Request is not mergeable

@connoravo-nhs connoravo-nhs enabled auto-merge (squash) March 30, 2026 11:22
Signed-off-by: Connor Avery <214469360+connoravo-nhs@users.noreply.github.com>
connoravo-nhs and others added 3 commits March 31, 2026 09:32
Signed-off-by: Connor Avery <214469360+connoravo-nhs@users.noreply.github.com>
…HSDigital/eps-prescription-tracker-ui into AEA-6327-fix-single-patient-return
@sonarqubecloud
Copy link
Copy Markdown

@connoravo-nhs connoravo-nhs merged commit 539c690 into main Mar 31, 2026
20 checks passed
@connoravo-nhs connoravo-nhs deleted the AEA-6327-fix-single-patient-return branch March 31, 2026 10:16
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.

3 participants