Skip to content

Fix: [AEA-6305] - Fix validator to properly validate cpt api style fhir messages#476

Merged
MatthewPopat-NHS merged 5 commits intomainfrom
feat/AEA-6305_validate_cpt
Mar 19, 2026
Merged

Fix: [AEA-6305] - Fix validator to properly validate cpt api style fhir messages#476
MatthewPopat-NHS merged 5 commits intomainfrom
feat/AEA-6305_validate_cpt

Conversation

@Orkastrated
Copy link
Contributor

Summary

  • Routine Change

Details

Fixes validator logic to enable it to properly validate cpt api style fhir messages

@github-actions
Copy link
Contributor

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

AEA-6305

Copy link

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

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.resource instead of only validating nested Bundles.
  • Tweaks parse error fallback messaging when exceptions have "null" in their message.
  • Updates searchSet.json expected 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);
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I've tweaked the condition, but this suggestion was needlessly verbose/messy.

@MatthewPopat-NHS MatthewPopat-NHS enabled auto-merge (squash) March 19, 2026 09:38
@sonarqubecloud
Copy link

@MatthewPopat-NHS MatthewPopat-NHS merged commit 82a87e1 into main Mar 19, 2026
16 checks passed
@MatthewPopat-NHS MatthewPopat-NHS deleted the feat/AEA-6305_validate_cpt branch March 19, 2026 13:26
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