FHIR Chat · Search by partial words? · hapi

Stream: hapi

Topic: Search by partial words?


view this post on Zulip Paul Lynch (Jul 12 2019 at 22:51):

Is there any support in the HAPI FHIR server for searching by partial words? With data set we get results for Observation?_content=smoker but not for Observation?_content=smoke. Ideally I would like to start getting results with _content=s.

view this post on Zulip David Hay (Jul 12 2019 at 23:03):

Depends on the server:

Just like string parameters using the :text modifier, these parameters SHOULD support a sophisticated search functionality of the type offered by typical text indexing services. The value of the parameter is a text-based search, which may involve searching multiple words with thesaurus and proximity considerations, and logical operations such as AND, OR etc.

view this post on Zulip Paul Lynch (Jul 15 2019 at 15:25):

Since I am not writing a server I really wish that SHOULD were a MUST. :-) It is hard to write a general-use client when server support varies so much. But, I was really was asking in particular about the HAPI server.

view this post on Zulip René Spronk (Jul 16 2019 at 11:46):

We're (the FHIR standard) trying to make things easy for a client, and move the complexity to the server. For a generic client that connects to many servers, the complexity currently lies with the client. The various differences in support reminds me of the 'webbrowser specific code' that has/had to be developed. We may need a server-side profile which the community, the creators of clients, should demand the servers sign up to. According to the FHIR spec they don't have to do so, but they could volunteer to sign up to it - it would give generic clients just more certainty that a certain set of functionality will be present.

view this post on Zulip Grahame Grieve (Jul 16 2019 at 12:40):

well, we've tried several times to get impetus around this, but failed. Still, feel free to have another try

view this post on Zulip James Agnew (Jul 17 2019 at 14:36):

As far as HAPI is concerned- The partial word support thing is tough. We use Lucene to power _content, and lucene is very capable given the right configuration. It could do partial searches, fuzzy/phonetic searches, right and nickname searches even, but it needs to be set up with appropriate indexing.. and that indexing takes up lots of space if you want your searches to be very flexible.

I've tried to come up with sensible defaults in HAPI for how Lucene indexes, but one thing that is annoying about Hibernate Search (which is how we currently use Lucene)- it is really hard to change the way it indexes without recompiling your code. So it's hard for a hapi user to change it.

Probably what we need to do is to switch over to using elasticsearch instead, which is much easier to configure without having to move the earth. This work is planned, although not yet scheduled.

view this post on Zulip Xiaocheng Luan (Jul 19 2019 at 14:29):

@James Agnew Does HAPI support the _filter parameter for advanced search? I tried a few examples but can't get it to work so far.

view this post on Zulip nicola (RIO/SS) (Jul 19 2019 at 14:31):

In aidbox we introduced _ilike search parameter - https://docs.aidbox.app/api/search#_ilike-search-non-fhir. Probably you can port it :)

view this post on Zulip Paul Lynch (Jul 19 2019 at 15:17):

@nicola Does your full text "_content" search do partial words?

view this post on Zulip James Agnew (Jul 19 2019 at 18:52):

@Xiaocheng Luan - There is an open PR for implementing _filter but it's not yet merged (it is a messy merge and I keep having other priorities come up.. :( )

view this post on Zulip nicola (RIO/SS) (Jul 19 2019 at 19:09):

@Paul Lynch no _content uses postgresql fulltext search, _ilike does this

view this post on Zulip nicola (RIO/SS) (Jul 19 2019 at 19:10):

but this is non-standart FHIR search param

view this post on Zulip Xiaocheng Luan (Jul 19 2019 at 19:13):

Xiaocheng Luan - There is an open PR for implementing _filter but it's not yet merged (it is a messy merge and I keep having other priorities come up.. :( )

Thanks, understand, looking forward to it!


Last updated: Apr 12 2022 at 19:14 UTC