hapi-fhir
hapi-fhir copied to clipboard
Error when using chained parameters in conditional references
Describe the bug
We are attempting to use chained parameters in match URLs within a FHIR resource (e.g., PractitionerRole?practitioner.identifier=myValue
), but HAPI FHIR is returning an error indicating that the query part of the conditional reference is not valid.
To Reproduce Steps to reproduce the behavior:
- Create a FHIR resource, such as a Communication, that includes a reference with a chained parameter for conditional matching.
- Use a reference in the format
PractitionerRole?practitioner.identifier=myValue
. - POST the resource to the HAPI FHIR server.
- Observe the error returned by the server.
Minimal Example
This is a minimal Communication
resource that demonstrates the issue:
{
"resourceType": "Communication",
"status": "completed",
"sender": { "reference": "PractitionerRole?practitioner.identifier=myValue" }
}
Expected behavior
We expected the server to correctly process the chained parameter in the match URL, resolving the reference as PractitionerRole
where the associated practitioner.identifier
matches the given value (myValue
).
Error Response
The server returns the following error:
Error
Line: 4, Col: 78
The query part of the conditional reference is not a valid query string (PractitionerRole?practitioner.identifier=myValue)
Environment (please complete the following information):
- HAPI FHIR Version 7.0.2
- OS: Microsoft Windows 10
- Browser: Not applicable
Additional context We are trying to use chained parameters to reference resources based on identifiers, which should be valid according to FHIR chaining rules. The issue may be related to how the query part of the reference is parsed and validated.