This server provides a set of server-side services that are useful for the FHIR Community. The set of are two kinds of services:
- (Coming) R4/R6 interconverter
- tx.fhir.org server
- SHL Server - SHL/VHL support services
- TX Registry - Terminology System Registry as described by the terminology ecosystem specification(as running at http://tx.fhir.org/tx-reg)
- Package server - NPM-style FHIR package registry with search, versioning, and downloads, consistent with the FHIR NPM Specification (as running at http://packages2.fhir.org/packages)
- XIG server - Comprehensive FHIR IG analytics with resource breakdowns by version, authority, and realm (as running at http://packages2.fhir.org/packages)
- Publisher - FHIR publishing services (coming)
- VCL - Parse VCL expressions into FHIR ValueSet resources for http://fhir.org/vcl
- (Coming) Token services
Note: In production, this server always runs behind an nginx reverse proxy, so there's no in-build support for SSL, rate limiting etc.
There are 4 executable programs:
- the server (
node server) - the test cases (
npm test) - the terminology importer (
node --max-old-space-size=8192 tx/importers/tx-import XXX) - see Doco - the test cases generater (
node tx/tests/testcases-generator.js)
The server separates code from runtime data. All databases, caches, logs, and downloaded files are stored in a single data directory. The location is determined by:
- The
FHIRSMITH_DATA_DIRenvironment variable (if set) - Otherwise, defaults to
./datarelative to the working directory
The data directory contains (depending on which modules are in use):
config.json— server and module configurationlogs/— server and nginx log filesterminology-cache/— downloaded terminology packages and FHIR packagespackages/— package server databasexig/— XIG databaseshl/— SHL databases and certificatesregistry/— registry crawler datapublisher/— publisher database and build workspacetoken/— token database
During development with a cloned repository, the data directory defaults to [root]/data
(the test cases require this setup). When deployed via Docker or npm, the data directory
is provided by the host — see Deployment below.
- Node.js 16+
- NPM or Yarn
- Java 17+ (for FHIR validator, also for the test cases)
These instructions are for Development. For deployment, see below.
# Clone the repository
git clone https://github.com/HealthIntersections/FHIRsmith
cd FHIRsmith
# Install dependencies
npm install
# Create required directories
mkdir -p data data/logs
# Copy example configuration
cp config.example.json data/config.json
# Edit configuration as needed
nano data/config.jsonEach Module has it's own entry in the config, as described by the module
Create a config.json file in your data directory (use config-template.json as a starting point):
{
"hostName" : "[descriptive name for the server]",
"server": {
"port": 3000,
"cors": {
"origin": "*",
"credentials": true
}
},
"modules": {
// per modules...
}
}# Development mode
npm run dev
# Production mode
npm startThe server will be available at http://localhost:{port} using the port specified in the config.
In the production servers listed above, the server always sits behind an NGINX server which manages
SSL, security, rate limiting etc.
npm testThere are three deployment options: npm global install, Docker, or clone-and-run. All three
use the FHIRSMITH_DATA_DIR environment variable to locate the data directory.
# Install globally
npm install -g fhirsmith
# Create a data directory
mkdir -p /var/lib/fhirsmith
cp node_modules/fhirsmith/config-template.json /var/lib/fhirsmith/config.json
# Edit config.json as needed
# Set the data directory and run
export FHIRSMITH_DATA_DIR=/var/lib/fhirsmith
fhirsmithOr run it inline:
FHIRSMITH_DATA_DIR=/var/lib/fhirsmith fhirsmithThe server is available as a Docker image. Mount a host directory as the data directory:
# Pull the latest image
docker pull ghcr.io/healthintersections/fhirsmith:latest
# Create and populate data directory on host
mkdir -p /path/to/data
cp config-template.json /path/to/data/config.json
# Edit config.json as needed
# Run with data directory mounted
docker run -d --name fhirsmith \
-p 3000:3000 \
-e FHIRSMITH_DATA_DIR=/app/data \
-v /path/to/data:/app/data \
ghcr.io/healthintersections/fhirsmith:latestAvailable tags:
latest: Latest stable releasevX.Y.Z: Specific version (e.g.,v1.0.0)cibuild: Latest build from the main branch
| Variable | Description | Default |
|---|---|---|
FHIRSMITH_DATA_DIR |
Path to the data directory | ./data |
PORT |
Server port (overrides config) | from config.json |
NODE_ENV |
Node environment | production |
You can install as a windows service using windows-install.js. You might need to hack that.
This project follows Semantic Versioning and uses a CHANGELOG.md file to track changes.
Each GitHub Release includes:
- Release notes extracted from CHANGELOG.md
- Source code archives (zip and tar.gz)
- Docker images pushed to GitHub Container Registry:
ghcr.io/healthintersections/fhirsmith:latestghcr.io/healthintersections/fhirsmith:vX.Y.Zghcr.io/healthintersections/fhirsmith:X.Y.Z
- npm package published to npmjs.org as
fhirsmith(if you add this)
GitHub Actions will automatically:
- Run tests
- Create a GitHub Release with notes from CHANGELOG.md
- Build and publish Docker images with appropriate tags
Prerequisites:
- All tests passing on main branch
- CHANGELOG.md updated with changes
Steps:
- Update
CHANGELOG.mdwith your changes under a new version section:
## [vX.Y.Z] - YYYY-MM-DD
### Added
- New feature description
### Changed
- Change description
### Fixed
- Bug fix description-
Update
package.jsonto have the same release version -
Commit your changes:
git commit -m "Prepare release vX.Y.Z"
git push origin main:XXXXXXdo it via a PR
- Tag and push the release:
git tag vX.Y.Z
git push origin vX.Y.Z-
Monitor the release:
- Check GitHub Actions for the Release workflow
- Verify the GitHub Release was created
- Confirm Docker images are available at GHCR
-
Update
package.jsonto have the next release version -SNAPSHOT
If a release fails:
- Delete the tag:
git tag -d vX.Y.Z && git push origin :refs/tags/vX.Y.Z - Fix the issue
- Re-tag and push
- Fork the repository
- Create a feature branch
- Make your changes
- Add tests if applicable
- Submit a pull request
- Issues: GitHub Issues
- Documentation: Wiki
- FHIR Community: chat.fhir.org
