FHIR Chat · HAPI Server: get resources in server/interceptor · implementers

Stream: implementers

Topic: HAPI Server: get resources in server/interceptor


view this post on Zulip Stefanie Ververs (May 09 2018 at 08:57):

Hi,
I'm implementing a custom authorization interceptor for the hapi jpa server and need to get/load a resource there. I did not find anything about reading/getting resources "inside" the server in the documentation; maybe it's something quite obvious - but can anybody help me out? :) Thx!

view this post on Zulip Lloyd McKenzie (May 09 2018 at 09:22):

@James Agnew ?

view this post on Zulip Łukasz Dywicki (May 09 2018 at 11:09):

@Stefanie Ververs I may not be James, but I can try to answer your question as I'm wearing same shoes.

If you build your own interceptor you can still inject resource providers into it. Not sure how you assembly your runtime image, but most likely you have some kind of injection mechanism. If you rely on Spring then you can safely use all resource providers as they are not intercepted by default. Interception layer is built on top of them using custom http processing logic.
This means that you can make search operations by passing SearchMap instances to resource providers from your interceptor and, I believe, its gonna be just fine.

view this post on Zulip Stefanie Ververs (May 11 2018 at 10:52):

@Łukasz Dywicki Thanks a lot - I had to figure out a bit how to use the providers and the search parameters, but in the end I managed to get the required resources!

view this post on Zulip Łukasz Dywicki (May 11 2018 at 11:57):

@Stefanie Ververs I'm glad it worked :-)


Last updated: Apr 12 2022 at 19:14 UTC