microsoft / microsoft/fhir-server

Unhelpful Error Message If Conditional Reference Points to Multiple Records.

Open
#1,436 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Bug Up for grabs
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:

  1. Create, for instance, duplicate organizations with the same identifier.
  2. Attempt to create, for instance, an encounter object referencing that organization through a conditional reference.
  3. 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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.