FHIR for Developers: Part 6

Jaideep Pahwa
Nerd For Tech
Published in
4 min readJun 12, 2022

Setting up HAPI FHIR server

In the previous parts of the FHIR of the developers series, we have looked in what are the FHIR servers. We have also checked out what are different types of FHIR servers available to us. To summarize, FHIR servers are key tools for the interoperability of health data. FHIR being the enabler provides the different functionality for developing applications using FHIR. Different types of FHIR servers are Open Source FHIR Server and Proprietary servers.

Open FHIR is a free-to-use solution and implementation of the FHIR servers. These solutions will provide you with basic features over which you can develop your own custom solutions. HAPI FHIR server is the most famous among the open-source FHIR servers which are available. Further in this article, we will look deeper into HAPI FHIR Server and how you can set up your own HAPI FHIR server on your machine.

HAPI FHIR Server

HAPI FHIR Server is an open Source Fhir Server. HAPI FHIR is a complete implementation of the HL7 FHIR standard for healthcare interoperability in Java. HAPI is an open community developing software licensed under the business-friendly Apache Software License 2.0. HAPI FHIR is a product of Smile CDR. HAPI FHIR server provides will provide you with most of the features that you may get in any of the Proprietary FHIR Servers and being an open-source server means that you can freely use HAPI FHIR Server. This makes the HAPI FHIR server one of the better options for your own FHIR implementation.

Setting up HAPI FHIR Server

Setting up our own FHIR Server is a simple process if you follow the given steps. There are a couple of ways we can set up our own FHIR Server :

Using Docker:

This is one of the simpler ways you can set up your own FHIR Server.

  1. Before moving forward the main requirement for setting the HAPI FHIR server using the docker, the first step is to install Docker Desktop/ Docker on your machine. Steps for installing Docker can be checked here.
  2. After you have installed Docker, you will need to clone the code for the HAPI FHIR server from the HAPI FHIR git repo.
  3. After cloning the HAPI FHIR repo, navigate to the HAPI FHIR folder in your local. Run the following command:

docker compose up

This will download all the dependencies that Hapi FHIR Server may require to run, without cluttering your system with unnecessary things like JAVA and MySQL DB. FYI this may take a while to completely build, so grab a cup of coffee or you can check out my other articles :) until then.

After the docker image is downloaded and is running success full your logs. may look like following

It logs look something like the above and the image is running properly (you can check this on the docker desktop) means your HAPI FHIR Server is up and running and can be accessed at http://localhost:8080/.

Congratulations !!!

Running HAPI FHIR Server as JAVA APP

If you face some issues in installing Docker on your machine, there is still another way to install HAPI FHIR Server on your machine.

  1. Before moving forward with these steps you would need to install JAVA 11 or greater on your machine.
  2. You also need to install maven on your machine.
  3. Once you have installed the prerequisites, You will need to build the project using the following command:

mvn clean install

4. After Build is successful you can run you server using

mvn jetty:run

This will run your own FHIR server and you will get similar logs as above and you can access the server at http://localhost:8080/.

Public HAPI FHIR Server

We have seen a couple of ways that we using which we can install the HAPI FHIR server. But if you are still not able to start your own FHIR server, TOUGH LUCK !!! but you don't need to worry you can still your hands on the FHIR server.

HAPI FHIR server does provide a public FHIR server where you can try your hands on. You can access public the FHIR server from here. Before accessing the Public FHIR Server you may want to take care of a few things.

  1. This is a public FHIR Server so you should not store production FHIR data on this server.
  2. This is a public FHIR Server so data will be wiped regularly, no guarantees for data consistency.

Summary

In this article, we have looked into different ways of setting up your own HAPI FHIR server and Public FHIR Server. This will enable you to perform operations on the FHIR server and learn FHIR along with FHIR for Developers series.

If you loved my work please like and share this article( it’s free :)). Also, do follow me for more articles like these.

Also, check out my other articles:

5 Minutes Tech

3 stories

FHIR for Developers

9 stories

Self Help

2 stories

General Tech

2 stories

--

--

Jaideep Pahwa
Nerd For Tech

Software Engineer at Walmart | Tech Enthusiast | Avid Learner