How to specify the String search distance in the url

Hi,
How can I search in String fields approximately (fuzzy search) by specifying the distance ?

For example :

**/Patient/name=Mou~2**

=> Here I’m not only searching (in the Patient resource) all the patients whose the field “name” contains the string “Mou” but, whose the name is near the “Mou” string by “2” letters (this is the distance) like : Mourad, Mouni, …

My question is : How do the Fhir specification do the same search ?

I found this :


https://www.hl7.org/fhir/search.html

=>

 **/Patient/name:contains=Mou**

But, we can’t specify the distance !
I suggest to use the “~” character to specify the distance but, it doesn’t exist in the Fhir standard !

How can I specify the distance ?

Thank you

There’s no standard search criteria that does this. You’d have to define a custom one - and convince the servers you want to search to support it.

1 Like

Thank you for replaying @lloyd !
Maybe that will help someone : I will use “~” to specify the distance, like :

/Patient/name:ap=Mou~2

You can use whatever syntax you like, but you’ll have to define a custom SearchParameter and get systems to support it.

1 Like