FHIR Chat · For non Java engineers · hapi

Stream: hapi

Topic: For non Java engineers


view this post on Zulip dsh (Nov 22 2019 at 03:23):

for someone not much familiar with Java universe and used to simple install instruction it seems getting the HAPI FHIR server up and running is pretty difficult

I tried mvn install and mvn jetty:run for hapi-fhir-jpaserver-example and I get these errors

javax.servlet.ServletException: fhirServlet@7cc91a5a==ca.uhn.fhir.jpa.demo.JpaServerDemo,jsp=null,order=1,inst=false,async=false
Caused by: org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type 'ca.uhn.fhir.jpa.provider.dstu3.TerminologyUploaderProviderDstu3' available

when I access the server on localhost:8080 i get this message

No context on this server matched or handled this request. Contexts known to this server are:

view this post on Zulip dsh (Nov 22 2019 at 03:26):

I understand HAPI is useful for exposing your existing data as FHIR Resources but is it also a good candidate for our use case (basically a green field project) where clinical data received in HL7v2 transformed to FHIR (using Mirth FHIRConnector) and then transformed/stored in our business specific models. We are thinking of storing a copy of the original FHIR resource in HAPI server for a possible future analysis .

If this is a good idea. Could some one please let me know which module of HAPI FHIR server do I need to get started with. As its all too overwhelming & frankly confusing.

view this post on Zulip Grahame Grieve (Nov 22 2019 at 05:38):

it sounds like the cli version would be a good start, and that requires no Java knowledge

view this post on Zulip Kevin Mayfield (Nov 22 2019 at 06:58):

I believe you are in the right area. Are you using this github project? https://github.com/hapifhir/hapi-fhir-jpaserver-starter
The links from the HAPI page take you to an unsupported version.

view this post on Zulip James Agnew (Nov 22 2019 at 11:05):

Oh man I need to update that... Website relaunch coming very soon.....

view this post on Zulip Jens Villadsen (Nov 22 2019 at 18:29):

this calls for docker ... ;)

view this post on Zulip dsh (Nov 22 2019 at 18:49):

this calls for docker ... ;)

Actually I was able to get hapi-fhir-jpaserver-starter running on docker on postgresql. Being a non-java guy what I don't know is

  1. how to secure this server
  2. and more importantly is it now ready for production use as an API backend.
  3. how to change the root path which is current set to i.e. how to change from this http://localhost:8080/hapi-fhir-jpaserver/ to http://localhost:8080/hapi or http://localhost:8080/

view this post on Zulip dsh (Nov 22 2019 at 18:50):

For securing this server, I can certainly put it behind AWS API gateway in a private subnet

view this post on Zulip dsh (Nov 23 2019 at 04:51):

@Lloyd McKenzie @Grahame Grieve If I have managed to run hapi-fhir-jpaserver-starter in docker setup can the same setup be used for production (obviously with some basic security) ?? Context: our is green field project i.e. we don't have any data yet, but want to store any data we receive in FHIR server for future analysis.

view this post on Zulip James Agnew (Nov 23 2019 at 10:06):

Lots of people are using HAPI FHIR JPA in production solutions successfully, so it's definitely suitable for that task.

Naturally though, the starter project doesn't have any security at all turned on. You will certainly want to add a security layer suitable for your application. HAPI FHIR's AuthorizationInterceptor may be helpful for this task

view this post on Zulip dsh (Nov 24 2019 at 03:08):

Lots of people are using HAPI FHIR JPA in production solutions successfully, so it's definitely suitable for that task.

Yes I understand and I am thankful to the contributors. I am seeking is guidance here as I don't know if hapi-fhir-jpaserver-starter with added security ofcourse is that considered production ready from the point of view storing/querying clinical data via API??

Are there any open source modules/tools that I can add on top of hapi-fhir-jpaserver-starter to achieve the Authn/Authz

view this post on Zulip James Agnew (Nov 24 2019 at 08:54):

Yes, if your question is whether you should be using hapi-fhir-jpaserver-starter, that is indeed the recommended way of using the JPA server.

In terms of how to add security, there are all kinds of answers to this and it will depend on what you are trying to achieve. You could use HAPI's AuthorizationInterceptor and hand-roll an authentication layer with it, you could leverage container security if you're deploying to a container, you could put an API Gateway such as Kong or Apigee or even Nginx in front of the server, etc.

view this post on Zulip dsh (Dec 29 2019 at 18:56):

Changing contextPath of hapi-fhir-jpaserver-starter in pom.xml from <contextPath>/hapi-fhir-jpaserver</contextPath> to <contextPath>/</contextPath> causes Tomcat admin page to be rendered

Could someone please let me know how I can run hapi-fhir-jpaserver-starter on root context?

view this post on Zulip dsh (Jan 05 2020 at 17:54):

How important is serverId e.g. serverId=home_r4 in the URL ? What's the purpose for it? Is serverId persisted in database or is it persisted in some directory on Jetty/Tomcat server?

I am running HAPI JPA on Docker in Fargate and I have NOT configured serverId and it default to serverId=home. My question is if my container dies and is recreated will I get a new serverId (Fargate does not have persistent volumes for docker) and does it mean data loss ??

view this post on Zulip dsh (Jan 05 2020 at 17:55):

@Grahame Grieve ^ @Lloyd McKenzie ^

view this post on Zulip James Agnew (Jan 05 2020 at 18:06):

Are you referring to the serverId in the testpage overlay? If so, it's just a static identifier.. the testpage overlay has no database component, it just talks to a server via the standard rest interface, so there is an identifier in the configuration file in case you have multiple servers.

view this post on Zulip dsh (Jan 05 2020 at 18:52):

@James Agnew I am referring to serverId in the URL http://hapi.fhir.org/resource?serverId=home_r4&pretty=true&resource=Composition

view this post on Zulip dsh (Jan 05 2020 at 18:53):

Changing contextPath of hapi-fhir-jpaserver-starter in pom.xml from <contextPath>/hapi-fhir-jpaserver</contextPath> to <contextPath>/</contextPath> causes Tomcat admin page to be rendered

Could someone please let me know how I can run hapi-fhir-jpaserver-starter on root context?

Also any help on this front will be highly appreciated

view this post on Zulip James Agnew (Jan 05 2020 at 19:04):

That serverId is only for the web UI, it has nothing to do with what context the server runs on.

I don't use Tomcat much, but this page seems to have pretty good instructions on how to deploy something to the root context: https://stackoverflow.com/questions/5328518/deploying-my-application-at-the-root-in-tomcat

view this post on Zulip dsh (Jan 07 2020 at 12:31):

Changing contextPath of hapi-fhir-jpaserver-starter in pom.xml from <contextPath>/hapi-fhir-jpaserver</contextPath> to <contextPath>/</contextPath> causes Tomcat admin page to be rendered

Could someone please let me know how I can run hapi-fhir-jpaserver-starter on root context?

Also any help on this front will be highly appreciated

@Grahame Grieve ^ any help on this please.

view this post on Zulip James Agnew (Jan 07 2020 at 19:48):

@Daya Sharma did you try the steps outlined on the page I linked to? You are talking about docker and fargate and tomcat and basically ignoring the replies I am giving you. I mean no offense here, but you are not going to get help this way.

view this post on Zulip Patrick Werner (Jan 07 2020 at 19:49):

take the war, rename it to ROOT.war, deploy, done.


Last updated: Apr 12 2022 at 19:14 UTC