hapifhir / hapi-fhir

🔥 HAPI FHIR - Java API for HL7 FHIR Clients and Servers
http://hapifhir.io
Apache License 2.0
2.02k stars 1.32k forks source link

Search by logical references does not work when referenced resource does not exist #2866

Open lytvynenko-dmitriy opened 3 years ago

lytvynenko-dmitriy commented 3 years ago

Describe the bug Search by logical references does not work when referenced resource does not exist

To Reproduce Steps to reproduce the behavior:

  1. Upload RelatedPerson POST http://localhost:12443/fhir-server/R4/RelatedPerson { "resourceType": "RelatedPerson", "patient": { "type": "Patient", "identifier": { "system":"https://www.test.com/fhir/CodeSystems/id-simple", "value": "123" } }, "name": [ { "family": "du Marché", "_family": { "extension": [ { "url": "http://hl7.org/fhir/StructureDefinition/humanname-own-prefix", "valueString": "VV" } ] }, "given": [ "Bénédicte" ] } ] }

  2. Execute Search GET http://localhost:12443/fhir-server/R4/RelatedPerson?patient:identifier=https://www.test.com/fhir/CodeSystems/id-simple|123

Expected behavior RelatedPerson resource is found.

Environment (please complete the following information):

HAPI FHIR Version: 5.0.1 OS: Win10 Browser Chrome Java 11

kherock commented 3 years ago

We're also seeing this in HAPI FHIR 5.4 for AuditEvents. The resources we reference are on a separate server and aren't resolvable locally, though I'd expect HAPI to be able to inspect the raw reference for a matching identifier before giving up.