Fix: [AEA-6305] - Fix validator to properly validate cpt api style fhir messages#476
Merged
MatthewPopat-NHS merged 5 commits intomainfrom Mar 19, 2026
Merged
Conversation
Contributor
|
This PR is linked to a ticket in an NHS Digital JIRA Project. Here's a handy link to the ticket: AEA-6305 |
There was a problem hiding this comment.
Pull request overview
Updates the validator’s handling of Bundle.type=searchset payloads so CPT API-style SearchSet responses validate correctly, and refreshes the golden test fixture accordingly.
Changes:
- Adjusts SearchSet handling to validate each
Bundle.entry.resourceinstead of only validating nested Bundles. - Tweaks parse error fallback messaging when exceptions have
"null"in their message. - Updates
searchSet.jsonexpected OperationOutcome output to match the new validation behavior.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
src/main/java/software/nhs/fhirvalidator/controller/ValidateController.java |
Changes which resources are selected/validated for SearchSet Bundles and adjusts exception-to-OperationOutcome messaging. |
src/test/resources/results/searchSet.json |
Updates the expected validation result fixture for the SearchSet test case. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| log.error(e.toString()); | ||
| return OperationOutcomeUtils | ||
| .createOperationOutcome(e.getMessage() != null ? e.getMessage() : "Invalid JSON", null); | ||
| .createOperationOutcome((e.getMessage() != null && !e.getMessage().contains("null")) ? e.getMessage() : "Invalid JSON", null); |
Contributor
Author
There was a problem hiding this comment.
I've tweaked the condition, but this suggestion was needlessly verbose/messy.
src/main/java/software/nhs/fhirvalidator/controller/ValidateController.java
Show resolved
Hide resolved
MatthewPopat-NHS
previously approved these changes
Mar 19, 2026
…s-FHIR-validator-lambda into feat/AEA-6305_validate_cpt
|
MatthewPopat-NHS
approved these changes
Mar 19, 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
Fixes validator logic to enable it to properly validate cpt api style fhir messages