Command line Parameters for the server - HealthIntersections/fhirserver GitHub Wiki

Command Parameters

The server always runs with parameters (running without parameters only happens in windows service mode). The key parameter is -cmd {parameter} which tells the server what to do. The -cmd parameter has a following command-mode parameter that identifies what the server should do:

  • console or exec: Run the server directly, not as a windows service (on platforms other than windows, this is the default command)
  • install: install as a system service (-name and -title options apply, see below). note that this is usually done by the installer, and so is not necessary
  • start: start the service (same as starting through the service manager) (-name option applies, see below)
  • stop: stop the server (same as stopping through the service manager) (-name option applies, see below)
  • remove: remove the service from the system (-name option applies, see below)
  • mount: create the base tables in the database for the nominated endpoint
  • unmount: remove the tables from the database for the nominated endpoint
  • remount - combination of both unmount + mount
  • tests: run the test cases (see below)
  • load: populate data into the database after mounting (needs -packages parameter too)

The server accepts a few additional parameters on the command line:

  • -fake-console: OSX only - use a fake console when running (this is a work around for an OSX limitation in Lazarus)
  • -cfg: see immediately below
  • '''-name {name}''': for '''-install''': specify the name of the server to install (defaults to 'FHIRServer')
  • '''-title {title}''': for '''-install''': specify the displayed title of the server to install (defaults to 'FHIR Server')
  • '''-endpoint {code}''': for '''-mount''' / '''-unmount''' / '''-remount''' / '''-load''' : specify the end point of the endpoint to perform database operations (on the database for the endpoint)
  • '''-packages {list}''': for '''-mount''' / '''-remount''' / '''-load''' : specify a set of packages to load into the database. A list of packages, separated by commas, with no spaces. Packages are identified by either {npm-id} or {mpn-id}#{version}

Configuration

The server configuration is entirely defined by two configuration files:

  • Local Configuration
  • Application Configuration

This is set up so that the server can run in zero config mode - e.g. on docker, or with a remote zero configuration

Local

The local configuration file is an ini file with two sections: [config] and [web]

[config]
config=file - source of system configuration (optional)
zero=url - get configuration from some remote location (optional)
local=directory to use locally in zero config (optional - defaults to ?)
version=* or comma list of 2,3,4,5 - which endpoints to load (zero mode) 
log=file to write log to (optional - defaults to ?)
telnet-pword=password to connect by telnet (optional - default is ?)
email=address - place to send notifications (optional - no notifications)
user=name of user 

[web]
host=dns name of the server (optional - defaults to 'localhost')
http=port to run http server on (optional - defaults to 80)
https=port to run https server on (optional, needs cert details if provided)
rproxy-http=port reverse proxy is running on (optional)
rproxy-https=port reverse proxy is running SSL on (optional)
rproxy-cert-header=header reverse proxy passes ? on - see nginx config (optional)
rproxy-ssl-value=header reverse proxy passes ? on - see nginx config (optional)
certname=filename of ssl certificate (optional)
cacertname=filename of ssl root certificate if base cert doesn't contain the chain (optional)
certkey=passphrase for the cert file (optional)
password=? don't know (optional)
log-folder=folder to log full http request details in (optional, debugging only)

System

The system configuration controls the functionality of the server. The file is edited through the FHIR Console (management tab) or created by the server based on the zero configuration.

The default configuration file is fhirserver.cfg in same directory as the server (if not specified in the local configuration).

Zero Config (remote configuration)

Alternatively, you can nominate a zero config url in your local configuration. The zero URL is a url starting with either '''http:''', '''https:''', or '''file:''' that refers to an remote configuration, and the server will download the configuration from the given location.

When using remote configuration like this, there are three additional parameters that control the remote configuration:

  • '''-local {folder}''': The folder to store downloaded resources (typically 10GB or so). Default is a folder on the local system drive, but a local network drive can be specified here if the server runs e..g on a docker.
  • '''-realm {codes}''': A comma separated list of realms to load content for. Default is all realms ('''*''')
  • '''-version {versions}''': A comma separated list of version end-points to support .e.g /r3 /r4 etc. Default is all versions ('''*''')

Known Zero Configurations:

Running Test Cases

(todo)

  • '''-tests''': Run the server test cases. Needs additional parameters for the 3 test content directories, see below, and also optionally '''-gui''' to run the tests using the interactive GUI mode
  • testinsight :