Set up Your InterSystems FHIR Server With One Command
Hi InterSystems Developers!
Recently I've updated the FHIR dev template so that it now publishes an IPM package fhir-server that makes the setup of InterSystems FHIR server a trivial manual or automatic or programmatic procedure one command long.
Please see below how you can benefit from it.

TLDR
USER>zpm "install fhir-server"
All the details below.
Setting up InterSystems FHIR Server without IPM
Of course you can setup InterSystems FHIR server without using IPM package manager. Here are the options:
1. You can setup a cloud FHIR server and have a trial for several days by following these instructions. This will be an InterSystems FHIR server in AWS cloud.
2. You can setup InterSystems FHIR server a running InterSystems IRIS for Health following these steps.
3. And also you can git clone the repository of this template and run in a cloned directory:
$ docker-compose up -d
to have InterSystems FHIR server up and running on your laptop.
What I suggest in the article is point 2 where you can skip all the manual steps and have the FHIR server up and running on a laptop IRIS either in docker or host OS.
Setting up FHIR server with IPM
DISCLAIMER!! The steps described below refer to a newly installed IRIS for Health instance or for usage with docker images. The package creates a new namespace and a new web application so it could possibly harm the setup you had set up before.
IPM stands for InterSystems Package manager, previously known as ZPM. Make sure you have IPM-client installed. You can check this if you run in IRIS terminal zpm command and see the following:
IRISAPP>zpm ============================================================================= || Welcome to the Package Manager Shell (ZPM). || || Enter q/quit to exit the shell. Enter ?/help to view available commands || ============================================================================= zpm:IRISAPP>
You will need IRIS for Health for that of versions 2022.x and newer.
How to run iris for health on your laptop?
Running on a host-operation
Download the latest IRIS for Health from InterSystems Evaluation site that fits your platform (Windows, Mac, Linux) and install it. Install ZPM. Here is a one-liner:
USER>zn "%SYS" d ##class(Security.SSLConfigs).Create("z") s r=##class(%Net.HttpRequest).%New(),r.Server="pm.community.intersystems.com",r.SSLConfiguration="z" d r.Get("/packages/zpm/latest/installer"),$system.OBJ.LoadStream(r.HttpResponse.Data,"c")Running a docker version
Call in your terminal to launch:
docker run --rm --name iris4h -d --publish 9091:1972 --publish 9092:52773 intersystemsdc/irishealth-community
Then start terminal:
docker exec -it iris4h iris session IRIS
Installing FHIR Server
Once having IRIS running either on host or just run in IRIS terminal:
USER>zpm "install fhir-server"
This will install FHIR server in FHIRSERVER namespace with parameters:
Set appKey = "/fhir/r4"Set strategyClass = "HS.FHIRServer.Storage.Json.InteractionsStrategy"set metadataPackages = $lb("hl7.fhir.r4.core@4.0.1")
Set metadataConfigKey = "HL7v40"FHIR REST API will be available at http://yourserver/fhir/r4.
It will also add some synthetic data.
How to understand that server is working?
To test on host version:
http://localhost:52773/fhir/r4/metadata
To test on docker version:
http://localhost:9092/fhir/r4/metadata
Also zpm installs the simple UI which is available at: yourserver/fhirUI/FHIRAppDemo.html
And you'll see something like this (with patient id=1 entered):

How it works?
In fact you can observe what is being installed with this ZPM module in the following module.xml scenario. As you can see it imports code, installs demo frontend application fhirUI, runs the post-install script, which calls the following method. The script in the method performs the FHIR server setup.
Installing FHIR server programmatically
You also can install it programmatically via the following command:
set sc=$zpm("install fhir-server")Happy FHIR coding!
Comments
Added a host setup and docker run examples