FHIR Chat · support for custom search parameter logic · hapi

Stream: hapi

Topic: support for custom search parameter logic


view this post on Zulip Sean McIlvenna (Aug 14 2020 at 15:58):

I know it's possible to create custom search parameters... but can you define custom search logic in a JPA server for the custom search parameter, beyond just specifying xpath or FHIR path expressions? For example, I'd like to implement an algorithm for searching within a radius of latitude and longitude...

view this post on Zulip Jens Villadsen (Aug 14 2020 at 16:02):

To address the lat,lon, search: https://hapifhir.io/hapi-fhir/docs/server_jpa/search.html

view this post on Zulip Jens Villadsen (Aug 14 2020 at 16:03):

Have you had a look at "near" implementation?

view this post on Zulip Jens Villadsen (Aug 14 2020 at 16:03):

That sounds related

view this post on Zulip Sean McIlvenna (Aug 14 2020 at 16:04):

well, there are other examples of custom logic I'm interested in implementing

view this post on Zulip Sean McIlvenna (Aug 14 2020 at 16:04):

not just lat/long

view this post on Zulip Sean McIlvenna (Aug 14 2020 at 16:05):

that was just an example

view this post on Zulip Sean McIlvenna (Aug 14 2020 at 16:05):

the root of my question remains: can I implement custom search logic in a JPA server, or am I limited to FHIR path and XPATH expressions?

view this post on Zulip Jens Villadsen (Aug 14 2020 at 16:30):

You want to search beyond the model? With FHIR path you can traverse the entire model and expressing so i cant see the limitation

view this post on Zulip Jens Villadsen (Aug 14 2020 at 16:41):

But yes - you can make your own logic

view this post on Zulip Sean McIlvenna (Aug 14 2020 at 16:41):

FHIRPath is pretty good, but has it's own limitations

view this post on Zulip Sean McIlvenna (Aug 14 2020 at 16:42):

do you know how to go about creating my own search logic?

view this post on Zulip Jens Villadsen (Aug 15 2020 at 09:02):

Have a look at eg. https://hapifhir.io/hapi-fhir/apidocs/hapi-fhir-jpaserver-base/src-html/ca/uhn/fhir/jpa/rp/r4/PatientResourceProvider.html - here you have access to both the parsing of the parameters from the client and access to the underlying DAO, which means you can inject your own logic here as you please


Last updated: Apr 12 2022 at 19:14 UTC