microsoft / microsoft/fhir-server
Unhelpful Error Message If Conditional Reference Points to Multiple Records.
Nobody has claimed this yet.
- Dominant language
- TSQL
- Stars
- 1.4k
- Forks
- 592
- Avg merge
- 2d 7h
- Merged PRs (30d)
- 41
Description
Describe the bug
If you have a conditional reference that returns multiple results, then the error message indicates that the reference does not resolve to a resource.
FHIR Version?
All
Data provider?
All
To Reproduce
Steps to reproduce the behavior:
- Create, for instance, duplicate organizations with the same identifier.
- Attempt to create, for instance, an encounter object referencing that organization through a conditional reference.
- Receive error message.
Expected behavior
Receive a message indicating that the conditional reference was ambiguous.
b'{"resourceType":"OperationOutcome","id":"a1f74190-04f6-4369-83b6-0141a32b440d","issue":[{"severity":"error","code":"invalid","diagnostics":"Given conditional reference \'Organization?identifier=https://github.com/synthetichealth/synthea|3bd5eda0-16da-3ba5-8500-4dfd6ae118b8\' resolved to multiple resources."}]}'
Actual behavior
Receive a message indicating that the conditional reference does not resolve to a resource.
b'{"resourceType":"OperationOutcome","id":"a1f74190-04f6-4369-83b6-0141a32b440d","issue":[{"severity":"error","code":"invalid","diagnostics":"Given conditional reference \'Organization?identifier=https://github.com/synthetichealth/synthea|3bd5eda0-16da-3ba5-8500-4dfd6ae118b8\' does not resolve to a resource."}]}'
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the conditional-reference case described in the issue: create duplicate Organizations with the same identifier, then reference one from an Encounter. Trace the code that builds the OperationOutcome and verify that ambiguous matches produce the expected multiple-resources message rather than the unresolved-reference message.
Written by the indexing model from the issue text.
Assessment
- Domain
- api, backend-api-design
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 45/100