hapifhir / hapi-fhir

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

Search by logical references does not work for AuditEvent entity parameter #4723

Open mimccu opened 1 year ago

mimccu commented 1 year ago

Describe the bug A logical reference search using the entity parameter does not find an existing AuditEvent record under the HAPI base R4 sandbox. None of the search approaches documented in the steps to reproduce find the existing record. Are logical reference searches supported? Does the referenced entity have to exist in the system?

To Reproduce Steps to reproduce the behavior:

  1. The resource which is being searched can be retrieved with a FHIR read: http://hapi.fhir.org/baseR4/AuditEvent/9102168. Or, find the resource among others in a Bundle: http://hapi.fhir.org/baseR4/AuditEvent?_format=xml&_sort=-date&_count=100
  2. The following search attempts do not find the record above:
  3. Search on value only: http://hapi.fhir.org/baseR4/AuditEvent?entity:identifier=ABCDEF
  4. Search on code system and value: http://hapi.fhir.org/baseR4/AuditEvent?entity:identifier=http://terminology.hl7.org/CodeSystem/v2-0203%7CABCDEF
  5. Search on code system and code: http://hapi.fhir.org/baseR4/AuditEvent?entity:identifier=http://terminology.hl7.org/CodeSystem/v2-0203%7CSNO

Expected behavior The logical reference search will find the record. Any of the token search approaches documented by http://hl7.org/fhir/R4/search.html#token should work. Also, see search by reference: http://hl7.org/fhir/R4/search.html#reference

Environment (please complete the following information):

mimccu commented 1 year ago

As per https://chat.fhir.org/#narrow/stream/179167-hapi/topic/searching.20for.20subject.3Aidentifier/near/286159954, an :identifier modifier search is not implemented under HAPI. However, there are some JIRA defect tickets that indicate it should be working under R4 -- see https://github.com/hapifhir/hapi-fhir/issues/1001. Is this type of search intended to work or not? Also, I filed a new HAPI defect (https://github.com/hapifhir/hapi-fhir/issues/4723) before seeing this chat thread.