Closed projkov closed 8 months ago
Describe the bug Search parameter "name" should check suffixes and prefixes in the HumanName, according to the specification. But it does not.
A server defined search that may match any of the string fields in the HumanName, including family, give, prefix, suffix, suffix, and/or text
Severity Minor
Steps to reproduce the behavior:
{ "resourceType": "Patient", "name": [ { "use": "usual", "given": [ "Test" ], "family": "Patient", "prefix": [ "Ms." ] } ], }
GET /fhir/Patient?name=Ms
Expected behavior You get this patient resource in the response.
Versions:
version: '2311' channel: edge commit: abd904d19 zen-fhir-version: 0.6.30-1 timestamp: '2023-11-18T02:53:00Z' message: Deprecated Endpoint
Additional context I made a request with an explanation. Looks like the main problem is: that Aidbox doesn't check the string in the suffix and in the prefix
GET /fhir/Patient?name=Ms&_explain=analyze
query: - >- SELECT "patient".* FROM "patient" WHERE aidbox_text_search(knife_extract_text("patient".resource, $JSON$[["name","family"],["name","given"],["name","middle"],["name","text"]]$JSON$)) ilike unaccent(?) LIMIT ? OFFSET ? - '% Ms%' - 100 - 0 plan: >- Limit (cost=0.00..53.47 rows=2 width=1950) (actual time=0.217..0.672 rows=2 loops=1) -> Seq Scan on patient (cost=0.00..53.47 rows=2 width=1950) (actual time=0.215..0.669 rows=2 loops=1) Filter: (immutable_wrap_ws(immutable_unaccent(immutable_array_to_string(knife_extract_text(resource, '[["name", "family"], ["name", "given"], ["name", "middle"], ["name", "text"]]'::jsonb), ' '::text))) ~~* unaccent('% Ms%'::text)) Rows Removed by Filter: 50 Planning Time: 1.480 ms Execution Time: 0.842 ms
Hello @projkov, a fix is already in edge channel. Please let us know if something is wrong!
edge
Describe the bug Search parameter "name" should check suffixes and prefixes in the HumanName, according to the specification. But it does not.
Severity Minor
Steps to reproduce the behavior:
Expected behavior You get this patient resource in the response.
Versions:
Additional context I made a request with an explanation. Looks like the main problem is: that Aidbox doesn't check the string in the suffix and in the prefix