Skip to content

Updating the error message during conditional reference #5007

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 9 commits into
base: main
Choose a base branch
from

Conversation

v-rachitsh
Copy link
Contributor

Description

The PR updates the error message of conditional references when multiple resources are found. Instead of stating "does not resolve to a resource," the message will now indicate that the reference resolved to multiple resources.

Related issues

Addresses issue #77964.

Testing

These changes were tested on the OSS FHIR server, and we received the expected error output.

FHIR Team Checklist

  • Update the title of the PR to be succinct and less than 65 characters
  • Add a milestone to the PR for the sprint that it is merged (i.e. add S47)
  • Tag the PR with the type of update: Bug, Build, Dependencies, Enhancement, New-Feature or Documentation
  • Tag the PR with Open source, Azure API for FHIR (CosmosDB or common code) or Azure Healthcare APIs (SQL or common code) to specify where this change is intended to be released.
  • Tag the PR with Schema Version backward compatible or Schema Version backward incompatible or Schema Version unchanged if this adds or updates Sql script which is/is not backward compatible with the code.
  • When changing or adding behavior, if your code modifies the system design or changes design assumptions, please create and include an ADR.
  • CI is green before merge Build Status
  • Review squash-merge requirements

Semver Change (docs)

Patch|Skip|Feature|Breaking (reason)

@v-rachitsh v-rachitsh added this to the CY25Q2/2Wk04 milestone May 22, 2025
@v-rachitsh v-rachitsh requested a review from a team as a code owner May 22, 2025 21:13
@v-rachitsh v-rachitsh added Bug Bug bug bug. Azure API for FHIR Label denotes that the issue or PR is relevant to the Azure API for FHIR Azure Healthcare APIs Label denotes that the issue or PR is relevant to the FHIR service in the Azure Healthcare APIs labels May 22, 2025
@@ -74,6 +74,10 @@ public async Task ResolveReferencesAsync(Resource resource, IDictionary<string,
{
Copy link
Contributor

Choose a reason for hiding this comment

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

This check needs to be changed to be where results equal 0 instead of not equal to 1, otherwise the new else if won't be reached.

@@ -74,6 +74,10 @@ public async Task ResolveReferencesAsync(Resource resource, IDictionary<string,
{
throw new RequestNotValidException(string.Format(Core.Resources.InvalidConditionalReference, reference.Reference));
}
else if (results.Count > 1)
Copy link
Contributor

Choose a reason for hiding this comment

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

The count needs to be the matched results, so this needs the same filter as the if statement above it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Azure API for FHIR Label denotes that the issue or PR is relevant to the Azure API for FHIR Azure Healthcare APIs Label denotes that the issue or PR is relevant to the FHIR service in the Azure Healthcare APIs Bug Bug bug bug.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants