FHIR Chat · Configuration of hapi-fhir-jpa-server running in Docker · hapi

Stream: hapi

Topic: Configuration of hapi-fhir-jpa-server running in Docker


view this post on Zulip Jorrit (Sep 11 2021 at 05:56):

Hi all, After about a year of experience with the FHIR REST-API I would now like to know more about the Operations (and hopefully not too much Development) side of HAPI FHIR. Yesterday I managed to get the hapi-fhir-jpa-server running in a local Docker container within a very short amount of time: great! Next step is that I want to do some partitioning-configuration on it. The documentation clearly definessome methods (https://hapifhir.io/hapi-fhir/docs/server_jpa_partitioning/enabling_in_hapi_fhir.html) but I still don’t get it. How can I call configuration methods of a hapi-fhir-jpa-server running in Docker? It could be that my problem is caused by my lack of recent Java knowledge. But maybe there is still someone out there that wants to help this newbie out.

view this post on Zulip Jens Villadsen (Sep 11 2021 at 08:31):

You will need to dig into some Java development if you need to use partitions on the jpa-starter project - and probably add some stuff around here: https://github.com/hapifhir/hapi-fhir-jpaserver-starter/blob/master/src/main/java/ca/uhn/fhir/jpa/starter/BaseJpaRestfulServer.java

view this post on Zulip Jorrit (Sep 12 2021 at 06:44):

Thanks @Jens Villadsen for the reply. I was hoping there was a way to edit the configuration post-compilation. I understand now that configuration has to be done in the source code. It would be great if I can call the configuration-methods from within the initialize()-function of the BaseJpaRestfulServer-class. So my next step will be to install a Java JDK and get my hands dirty. I always knew that that Java-class on university back in 1999 would come in handy someday ;-).

view this post on Zulip Richard Stanley (Sep 12 2021 at 11:11):

@Jorrit are you trying to get partitions working using docker or something more complex? It’s possible to get them working at least the basics.

view this post on Zulip Jorrit (Sep 12 2021 at 11:15):

@Richard Stanley I want to do a couple of configurations. First I’d like to enable partitioning to create a single instance multi tenant fhir server. Second I’d like to do some OAuth/SMART-configurations to connect the fhir server to an external OAuth-server.

view this post on Zulip Richard Stanley (Sep 12 2021 at 12:00):

Ok, for the first task, here's what has worked for me, in a docker-compose...

  fhir:
    container_name: hapi-fhir
    image: hapiproject/hapi:latest
    ports:
      - "8080:8080"
    restart: always
    depends_on:
      - redis
    environment:
      - hapi.fhir.partitioning.enabled=true
      - hapi.fhir.partitioning.allow_references_across_partitions=false
      - hapi.fhir.partitioning.partitioning_include_in_search_hashes=false

The hapi.fhir.partitioning.enabled=true is not clear in the default application.yaml, but it is still picked up as a config. Ignore the redis line. See also:
https://github.com/hapifhir/hapi-fhir-jpaserver-starter/issues/227#issuecomment-879253206
Hope that helps. I don't know how to do the second task.

view this post on Zulip Jens Villadsen (Sep 12 2021 at 12:20):

@Richard Stanley - from what I know (from https://github.com/hapifhir/hapi-fhir-jpaserver-starter/blob/15923edfd53980101ba73c517ea91e63fc3e47b1/src/main/java/ca/uhn/fhir/jpa/starter/FhirServerConfigCommon.java#L133) - setting hapi.fhir.partitioning.enabled=true does nothing. Setting eg. api.fhir.partitioning.allow_references_across_partitions=false enables partitioning.

view this post on Zulip Jens Villadsen (Sep 12 2021 at 12:23):

the point is that when you enable the details of partitioning - it automatically enables partitioning

view this post on Zulip Jorrit (Sep 13 2021 at 10:21):

Thanks @Richard Stanley and @Jens Villadsen. I'm happy that I only have to edit hapi-fhir-jpaserver-starter/src/main/resources/application.yaml to enable partitioning, instead of actually editing one or more Java-classes.


Last updated: Apr 12 2022 at 19:14 UTC