Fix: [AEA-6446] - Bug fix single patient return not loading prescription findings#1975
Merged
connoravo-nhs merged 13 commits intomainfrom Mar 31, 2026
Merged
Fix: [AEA-6446] - Bug fix single patient return not loading prescription findings#1975connoravo-nhs merged 13 commits intomainfrom
connoravo-nhs merged 13 commits intomainfrom
Conversation
Signed-off-by: Connor Avery <214469360+connoravo-nhs@users.noreply.github.com>
Signed-off-by: Connor Avery <214469360+connoravo-nhs@users.noreply.github.com>
Contributor
|
This PR is linked to a ticket in an NHS Digital JIRA Project. Here's a handy link to the ticket: AEA-6446 |
Contributor
There was a problem hiding this comment.
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
searchTypeis 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.getRelevantSearchParameterscan’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>
Signed-off-by: Connor Avery <214469360+connoravo-nhs@users.noreply.github.com>
…HSDigital/eps-prescription-tracker-ui into AEA-6327-fix-single-patient-return
Signed-off-by: Connor Avery <214469360+connoravo-nhs@users.noreply.github.com>
jonathanwelch1-nhs
previously approved these changes
Mar 30, 2026
auto-merge was automatically disabled
March 30, 2026 11:22
Pull Request is not mergeable
Signed-off-by: Connor Avery <214469360+connoravo-nhs@users.noreply.github.com>
Signed-off-by: Connor Avery <214469360+connoravo-nhs@users.noreply.github.com>
…HSDigital/eps-prescription-tracker-ui into AEA-6327-fix-single-patient-return
|
jonathanwelch1-nhs
approved these changes
Mar 31, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



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