fhirbase-plv8
fhirbase-plv8 copied to clipboard
Seaching by token parameter with optional types in underlying data returns wrong results
On beta5: Using Patient.deceased search param, which should allow to search on patient.deceased[x](patient.deceasedBoolean, patient.deceasedDateTime) This may be the same issue as https://github.com/fhirbase/fhirbase-plv8/issues/67
-- test for multi type search param - e.g. patient.deceased[x] (patient.deceasedBoolean, patient.deceasedDateTime)
SELECT fhir_create_resource('{"allowId": true, "resource": {"id":"id1","deceasedBoolean":true,"resourceType":"Patient"}}');
SELECT fhir_create_resource('{"allowId": true, "resource": {"id":"id2","deceasedBoolean":"true","resourceType":"Patient"}}'); -- can be ignored
SELECT fhir_create_resource('{"allowId": true, "resource": {"id":"id3","deceasedBoolean":false,"resourceType":"Patient"}}');
SELECT fhir_create_resource('{"allowId": true, "resource": {"id":"id4","deceasedBoolean":"false","resourceType":"Patient"}}'); -- can be ignored
SELECT fhir_create_resource('{"allowId": true, "resource": {"id":"id5","deceasedDateTime":"1972-10-11","resourceType":"Patient"}}');
SELECT fhir_create_resource('{"allowId": true, "resource": {"id":"id6","resourceType":"Patient"}}');
SELECT fhir_search('{"resourceType": "Patient", "queryString": "deceased=true"}'); -- ok, id1, id2, id5 correct
SELECT fhir_search('{"resourceType": "Patient", "queryString": "deceased=true"}'); -- ok, id1, id2, id5 correct
SELECT fhir_search('{"resourceType": "Patient", "queryString": "deceased=false"}'); -- nok, got everything except id5, expected id3, id4 and id5
SELECT fhir_search('{"resourceType": "Patient", "queryString": "deceased:missing=true"}'); -- nok, got id3, id5, id6 where exepcted only id6
SELECT fhir_search('{"resourceType": "Patient", "queryString": "deceased:missing=false"}'); -- nok, got all back
@Andrzej-Pietrzak are you sure that query deceased=false
should match against id5
? I think you mean deceased=false
should match id3
, id4
and id6
.
please note this issue is still not fixed
After having read the documentation I was thinking it should, quoting: "deceased token This patient has been marked as deceased, or as a death date entered Patient.deceased[x]" On the other hand - after checking with two other servers it seems that it doesn't do that anywhere.
The thing is - is it possible to find all dead patients (assuming inconsistent data) without merge'ing two result sets ?
What's the status on this issue ?
Possibly fixed? See here.