Stream: implementers
Topic: Custom SearchParameter/ Resource Reindexing
Marian Hummel (Jul 30 2020 at 14:47):
Hello everyone, me and my team had a Fhir seminar with Simone Heckmann recently and she told us about this chat! I am currently facing a problem that I could not solve since over a week, maby some of you had similar problems and could point me in a direction.
We have our own fhir r4 server and i create two custom search parameters for the Resource Task via the Generic Client after starting our application. In console I get the following message "Marking all resources of type Task for reindexing - Got job ID[1]".
So far so good.In case there are already resources in the database, they have to be re-indexed (even if it might take a while).
However, only the job is created but not executed. According to my research, following class is responsible for this
https://hapifhir.io/hapi-fhir/apidocs/hapi-fhir-jpaserver-base/ca/uhn/fhir/jpa/search/reindex/ResourceReindexingSvcImpl.html
Since I could not directly use the existing functionality of this class, I created my own version of it.
Using the start() and forceReindexingPass() methods everything works as desired. However, the workaround is too cumbersome, so new problems arise.
What am I missing?
Lloyd McKenzie (Jul 30 2020 at 17:42):
It might be best to raise this on #hapi
Jens Villadsen (Jul 31 2020 at 08:09):
@Marian Hummel you could expose a custom operation on your systemProvider where you have access to the ResourceReindexingSvc from where you can call forceReindexingPass
Marian Hummel (Jul 31 2020 at 09:34):
@Lloyd McKenzie thanks, i have not seen this channel. can I/you move it?
Marian Hummel (Jul 31 2020 at 09:35):
@Jens Villadsen Ah great, your idea now seems obvious, but i have not thought of it. However, I'm not quite sure how I should proceed further with
https://www.hl7.org/fhir/operationdefinition.html or
https://www.hl7.org/fhir/capabilitystatement.html
Jens Villadsen (Jul 31 2020 at 09:39):
If you are running on R4, then you are hitting https://github.com/jamesagnew/hapi-fhir/blob/master/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/provider/r4/JpaSystemProviderR4.java which extends https://github.com/jamesagnew/hapi-fhir/blob/master/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/provider/BaseJpaSystemProviderDstu2Plus.java meaning that you can find inspiration in making your custom systemProvider operation by looking at https://github.com/jamesagnew/hapi-fhir/blob/3098affccb6ac051605ec61ea87c41725bd42ec1/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/provider/BaseJpaSystemProviderDstu2Plus.java#L35
Marian Hummel (Jul 31 2020 at 09:57):
@Jens Villadsen thank you Jens, now i will have some stuff to read :)
Lloyd McKenzie (Jul 31 2020 at 13:44):
@Marian Hummel Moving posts between streams isn't possible - but you can raise them on a different stream (when asked to do so - we generally don't like the same question being asked in multiple streams at the same time).
Last updated: Apr 12 2022 at 19:14 UTC