microsoft / microsoft/fhir-server
Chained search return an error about multiple resource type, even if only 1 is possible (patient.identifier)
- Dominant language
- TSQL
- Stars
- 1.4k
- Forks
- 592
- Avg merge
- 2d 7h
- Merged PRs (30d)
- 41
Description
**Describe the bug**
While playing around using this FHIR Server as a backend to a[ XDS Registry](https://github.com/oehf/xds-registry-to-fhir), is was observed that the handling of chained parameters seems cause a unexepcted behavior. Resource "DocumentReference" contain a search parameter "patient" which is already restricted by the spec to the Patient resource. When using a chained search here (e.g. "patient.identifier"), the MS FHIR Server complain about "multiple" possible resource types on this search paramter. Other FHIR Server like Hapi or Firely work as expected.
**FHIR Version?**
R4
**Version used**
Docker image from "mcr.microsoft.com/healthcareapis/r4-fhir-server" (4.0.128)
**Data provider?**
SQL Server
**To Reproduce**
Steps to reproduce the behavior:
1. Trigger a FHIR Query on DocumentReference resource with a chained search parameter, e.g. `/DocumentReference?patient.identifier=urn%3Aoid%3A2.999.1.2.3.4%7CIPF-1714920157063`
**Expected behavior**
SearchResponse is successful and return the expected results.
**Current workaround**
Use a chained search with explicit resource type definition, e.g. "patient:Patient.identifier" instead of "patient.identifier"
**Actual behavior**
Server response with a http 403 containing the following error message:
`
`
Contributor guide
Research direction
Reproduce the R4 request at /DocumentReference?patient.identifier=... and compare it with the documented workaround using patient:Patient.identifier. Trace the chained-search handling for the DocumentReference patient parameter; done means the untyped query succeeds and returns the expected results without the multiple-resource-types error.
Written by the indexing model from the issue text.
Assessment
- Domain
- api, backend
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100