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

Composite/unique SearchParameters indexes deleted resources and causes other SearchParameter's find them as well #1724

Open tuomoa opened 4 years ago

tuomoa commented 4 years ago

Hello @jamesagnew,

Describe the bug Normally when custom SearchParameter resource is created, for example with base Patient and with code test which has expression Patient.birthDate this will find only resources that are not deleted. However if we create a composite unique index which refers to that SearchParameter, the query Patient?test=... will start to return also deleted resources (it won't return the full content of the resource, but will find them). This seems rather odd.

I'm not sure if this is a bug, but I also noticed that the unique index contains values for the deleted resources as well. Is this by design or is this a bug as well? It seems like a bug to me.

To Reproduce See unit test scenarios in #1723

Expected behavior SearchParameter should not behave differently when it's part of composite SearchParameter. And SearchParameters shouldn't find deleted resources. And unique indices shouldn't index the deleted resources?

Environment (please complete the following information):

tuomoa commented 4 years ago

@jamesagnew any chance you might have time to take a look at this?

tuomoa commented 3 years ago

@jamesagnew any insight on this problem?

tuomoa commented 3 years ago

@jamesagnew any chance you could provide some information regarding this?

ruoat commented 3 years ago

@jamesagnew we would like to know if this is a bug or a feature?

ruoat commented 3 years ago

@jamesagnew I know you are very busy person but could you give some insight on this so we could better plan what we should do about this.