It's easy to run your own copy of tx.fhir.org. Here's how:
Overview
- install the server. Get the install from http://www.healthintersections.com.au/FhirServer/ (choose FHIR Server). Platform specific notes:
- Windows: 64bit only supported. Server is fully functional
- Linux: Not supported at this time. intended to be available soon
- OSX: Not supported at this time. May be possible at some time
- Other platforms: no plans to support any other platforms at this time
- Once it's installed, you can run the server from the command line or as a windows service
- You provide particular parameters to the service to get it to run the same set up as tx.fhir.org (see Server Command Line parameters for general documentation)
- If you run the server as a windows service, put the parameters (documented below) in the Service Properties, in the Start parameter input.
- To run the server directly, start with the parameters -cmd exec, a nd the appropriate parameters as documented below - this tells the server to execute directly.
- In the absense of any parameters, the server will start and immediately stop without doing anything
- The parameters tell the server to run with the current configuration for tx.fhir.org. The configuration will be updated when the server starts
- warning: may take a few minutes to copy the 6-8 GB of data files the server loads at start up
- When running, the server consumes between 8 and 14GB of RAM (depends on how many versions of SNOMED CT you load, and how many you use)
Server Parameters
- the parameter -cfg https://storage.googleapis.com/tx-fhir-org - tells the server to run with the same configuration as tx.fhir.org. You must have this parameter
- (optional) -version NN - tells the server to run with just the version(s) specified. e.g. -version 3,4 - runs the terminology service for R3 and R4 (only /r3 and /r4). You can choose versions 2,3,4 and 5. The default value is "*" - all versions will run. Each version takes about a minute to load
- (optional) -realm NN - the realm(s) to load, where NN is a comma separated list of known realms. The default value is * - load all known realms. Principally, this tells the server which snomed variants to load, but some realms specify to load additional terminology packages. Known realms are:
- uv - this is always loaded, and doesn't need to be specified
- us - US variant of Snomed CT + US Core Package
- ca - CA variant of Snomed CT
- au - AU variant of Snomed CT
- old - a special realm code that causes old releases of Snomed CT Intl edition to be loaded
- (optional) -local NNN where NN is the name of a path - typically, this would be a network drive to maintain the downloaded files between invocations on a different system (e.g. for Docker). Defalt value is a local path - this works fine for repeated invocations on the same server.
In addition, a file web.ini can be used to configure the server parameters. This is a standard ini file with the format:
[web]
host= ; the server name to use for redirects (not usually important for terminology services)
http= ; the port to provide normal HTTP service one (defaults to 80)
https= ; the port to provide SSL on (defaults to not enabled)
http-stated= ; if running with reverse proxy, the http port the reverse proxy is listening on
https-stated= ; if running with reverse proxy, the https port the reverse proxy is listening on
cacertname= ; CA public key file name
certkey= ; private key filename
password= ; password for the private key
telnet=; password for the telnet interface (se logs live). Default: make up a random password
ReverseProxy note:
Runnin with a reverse proxy is fine. nginX is tested. todo: notes
Documentation for config.json
https://tx.fhir.org/config is a path that points to path/config.json. Config.json defines the content that tx.fhir.org load and runs. Here's the current format:
{
"uv" : {
"files" : {
"loinc-2.71.cache" : "loinc",
"rxnorm-20210208.db" : "rxnorm",
"ndc-20210923.db" : "ndc",
"unii-20210810.db" : "unii",
"sct_intl_20210731.cache" : "snomed!",
"ucum-essence-2.0.1.xml" : "ucum"
},
"packages" : {
"r5" : [ "hl7.terminology.r4", "fhir.tx.support.r4" ],
"r4" : [ "hl7.terminology.r4", "fhir.tx.support.r4" ],
"r3" : [ "hl7.terminology.r3", "fhir.tx.support.r3" ],
"r2" : [ "fhir.tx.support.r2" ]
]
},
"old" : {
"files" : {
"sct_intl_20200731.cache" : "snomed",
"sct_intl_20200131.cache" : "snomed",
"sct_intl_20190731.cache" : "snomed"
}
},
"us" : {
"files" : {
"sct_us_20210901.cache" : "snomed"
},
"packages" : {
"r4" : [ "hl7.fhir.us.core" ]
},
"au" : {
"files" : {
"sct_au_20210630.cache" : "snomed"
}
},
"ca" : {
"files" : {
"sct_ca_20210331.cache" : "snomed"
}
}
}
This fairly simple file specifies what terminology resources should be loaded. There are two kinds of resources: standard FHIR npm packages and the private files that the FHIR Server uses to load the big terminologies. These are prepared by the system administrators of tx.fhir.org and posted to this directory from where tx.fhir.org picks them up, along with any other clones running. One a file is downloaded, it's currency doesn't need to be checked - new releases will always have a new filename (note: the date on the file is the arbitrary but the custom is to use the underlying tx release date. If the privaate file needs to be regenerated (happens occasionally), then something like _a, _b, _c etc will be appended to the file name.