@torchlab/fhir
v1.0.1
Published
FHIR developer toolkit — search 1,300+ packages, resolve canonicals, validate IGs, scaffold projects, and run the IG Publisher.
Maintainers
Readme
@torchlab/fhir
npm install -g @torchlab/fhirGet started
torch check # scan your environment — installs missing tools if you want
torch setup # add shell aliases to your profile, set up VS Code and JetBrains
torch scaffold # interactive wizard: new FHIR IG in under two minutesThat's the one-time setup. After that, every IG project gets ig-run, ig-watch, and fv as global commands.
Commands
Anywhere:
| Command | Alias | What it does |
|---------|-------|-------------|
| torch check | torch-check | Full env check — Java, Node, SUSHI, Ruby, Jekyll, .NET, Firely |
| torch scaffold | torch-scaffold | Interactive new IG wizard (FSH / JSON / XML, R4 / R4B / R5) |
| torch validate <file> | fhir-validate, fv | Validate a FHIR resource or directory |
| torch setup | torch-setup | Install shell aliases + VS Code extensions |
| torch new <Type> | fhir-new | Create a starter resource file and open it |
| torch update | torch-update | Update to the latest published version |
Inside an IG project:
| Command | Alias | What it does |
|---------|-------|-------------|
| torch run | ig-run | Build the IG once |
| torch watch | ig-watch | Build and watch for file changes |
| torch build | | SUSHI + build in one step (FSH projects) |
| torch update-publisher | ig-update | Download the latest HL7 Publisher jar |
| torch open | ig-open | Open output/index.html in your browser |
One publisher jar, not one per project
By default, every FHIR IG downloads its own publisher.jar. It's 100 MB. Five IGs means 500 MB of identical files, each needing its own update cycle.
torch keeps a single copy at ~/.torch/publisher.jar and links it into each project's input-cache/. Run ig-update once — every IG on your machine gets it. The HL7 terminology cache at ~/fhircache is already shared by the publisher automatically.
~/.torch/
├── publisher.jar ← one copy, all your IGs
└── validator_cli.jar ← one copy, all your validationsWhat torch scaffold generates
my-ig/
├── sushi-config.yaml ← or ImplementationGuide.json / .xml
├── input/
│ ├── fsh/ ← stub profiles, extensions, value sets
│ └── pagecontent/index.md
├── _genonce.sh / .bat ← build once
├── _gencontinuous.sh / .bat ← build and watch
├── _updatePublisher.sh / .bat ← fetch latest publisher to ~/.torch/
├── .vscode/tasks.json ← Ctrl+Shift+B builds the IG
├── .idea/runConfigurations/ ← JetBrains run configs
└── .gitignorePlatform notes
Windows — if PowerShell blocks the scripts after install, set the execution policy once:
Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUserCorporate / managed machines — torch check detects proxy settings, non-admin environments, and missing PATH entries. On Windows it offers to auto-install missing tools via winget. On Mac/Linux it prints the exact install command for each missing tool and generates a ready-to-send IT request.
macOS — shell scripts are marked executable automatically. If you clone rather than install via npm, run chmod +x on any .sh files.
Requirements
| Tool | Minimum | Purpose |
|------|---------|---------|
| Node.js | 18 LTS | Required to install and run torch |
| Java | 17 (21 recommended) | HL7 IG Publisher and FHIR Validator |
| Git | 2.x | IG version control |
| — | — | Everything else: torch check installs it |
