-
Notifications
You must be signed in to change notification settings - Fork 536
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
base: main
Are you sure you want to change the base?
Conversation
…nts to Multiple Records
…personal/v-shnarang/bug77964
…personal/v-shnarang/bug77964
@@ -74,6 +74,10 @@ public async Task ResolveReferencesAsync(Resource resource, IDictionary<string, | |||
{ |
There was a problem hiding this comment.
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) |
There was a problem hiding this comment.
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.
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
Semver Change (docs)
Patch|Skip|Feature|Breaking (reason)