This page documents the use of the fhir-settings.json
file to configure aspects of the FHIR Java Tools.
Settings File Location
By default, this file is located in the following path:
- Windows:
C:\Users\<username>\.fhir\fhir-settings.json
- Unix/Linux/Mac:
/~/.fhir/fhir-settings.json
Individual CLI tools, such as the Validator or the IG-Publisher can also specify the location of alternative settings files using the -fhir-settings
command line option. See here for the Validator CLI and here for the IG-Publisher CLI
An example settings file can be seen below:
{ "npmPath": "/Users/user/.nvm/versions/node/v17.4.0/bin", "rubyPath": "/Users/user/.gem/ruby/3.1.0/bin:/Users/user/.gem/ruby/3.1.0/bin:/opt/homebrew/opt/ruby/bin:/Users/user/.nvm/versions/node/v17.4.0/bin:/opt/homebrew/bin:/opt/homebrew/sbin", "fhirTestCasesPath": "/Users/user/work/test-cases", "diffToolPath": "opendiff", "tempPath": "/Users/user/temp", "packageManagement" : { "servers": [ { "url" : "http://mypackageserver:4873", "serverType" : "npm", } ] } }
The specific properties in this file depend on the individual environment and user goals. Some of these settings are normally set by environment variables used by tool installers as well as manually set environment variables (e.g. system path). Occasionally these environmental variables are not set correctly, and cannot be used by the tool. In these cases the file fhir-settings.json
file can provide a definitive setting.
Properties
The following properties can be set in the fhir-settings.json file.
npmPath
The location of the npm executable so that sushi can be run. You can generally get this directory from the system path in your shell of choice
rubyPath
The location of the ruby+gem executables so that Jekyll can be run. This typically requires more than one path. You can generally get the directories from the system path in your shell of choice
fhirTestCasesPath
Your local copy of the https://github.com/FHIR/fhir-test-cases repository. Only needed if you are running the tests locally, and want to change the tests and run them before committing new/changed tests.
diffToolPath
The source of the visual comparison application used to compare failing comparison tests. if no compare tool is specified, no visual comparison will be shown
tempPath
The location to use for temporary files. If nothing is specified, the system default temporary directory will be used.
OSX Note: the system default directory misbehaves in some ways that are not presently clear, so setting this is recommended in OSX
packageManagement
Configuration for using additional servers to provide FHIR packages. By default FHIR Java Tools use several public servers to provide FHIR packages. Users wishing to use other servers, including privately accessible servers, can add entries into the packageManagement servers list:
{ "packageManagement" : { "servers": [ { "url" : "http://mypackageserver:4873", "serverType" : "npm" } ] } }
Basic Server PropertiesÂ
url
The base url of the server, including any necessary port settings.
serverType
The package server type. Can be one of fhir
or npm
. If this is not set, it will be fhir
by default. Because of slight differences between FHIR package servers and NPM package servers, the FHIR Java Tools need to know the package server type in order to properly communicate with it.
Basic Authentication Properties
A server can be configured to use basic username/password authentication with the following properties:
"servers": [ { "url" : "http://mypackageserver:4873", "serverType" : "npm", "authenticationType" : "basic", "username" : "myuser", "password" : "mypassword" } ]
Token Authentication Properties
A server can be configured to use token authentication with the following properties.
"servers": [ { "url" : "http://mypackageserver:4873", "serverType" : "npm", "authenticationType" : "token", "token" : "generatedtokenforauthentication" } ]
Other Properties
The following properties are also available to configure the expected behaviour of package management.
ignoreDefaultServers
If this property is set to true
, the FHIR Java Tools will ignore the default public package servers and only attempt to resolve packages using the servers configured in the packageManagement servers
property. If not set, this property will be false
by default.
"packageManagement" : { "ignoreDefaultServers" : true }