Stream: hapi
Topic: support for custom search parameter logic
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...
Jens Villadsen (Aug 14 2020 at 16:02):
To address the lat,lon, search: https://hapifhir.io/hapi-fhir/docs/server_jpa/search.html
Jens Villadsen (Aug 14 2020 at 16:03):
Have you had a look at "near" implementation?
Jens Villadsen (Aug 14 2020 at 16:03):
That sounds related
Sean McIlvenna (Aug 14 2020 at 16:04):
well, there are other examples of custom logic I'm interested in implementing
Sean McIlvenna (Aug 14 2020 at 16:04):
not just lat/long
Sean McIlvenna (Aug 14 2020 at 16:05):
that was just an example
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?
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
Jens Villadsen (Aug 14 2020 at 16:41):
But yes - you can make your own logic
Sean McIlvenna (Aug 14 2020 at 16:41):
FHIRPath is pretty good, but has it's own limitations
Sean McIlvenna (Aug 14 2020 at 16:42):
do you know how to go about creating my own search logic?
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