Registry / type-stubs / fsh-sushi

fsh-sushi

JSON →
library3.19.0jsnpmunverified

SUSHI (SUSHI Unshortens Short Hand Inputs) is a reference implementation compiler for FHIR Shorthand (FSH), a domain-specific language for defining FHIR Implementation Guides. Current stable version is 3.19.0, released with monthly cadence. Key differentiators: first-class support for FHIR R4/R4B/R5, dependency aliasing (since v3.16.0), multiline strings in invariants and mapping comments (v3.18.0), and integration with IG Publisher. Primarily used via CLI (`sushi build`). Ships TypeScript types.

npm install fsh-sushi
INSTALL
IMPORT
SIG · FSH-SUSHI
F
fsh-sushi
type-stubsjavascriptv3.19.0
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

sushi
import sushi from 'fsh-sushi'
const sushi = require('fsh-sushi')
ESM-only since v3; CLI usage does not require imports.
build
import { build } from 'fsh-sushi'
import build from 'fsh-sushi'
Named export for programmatic API.
FSHToFHIR
import { FSHToFHIR } from 'fsh-sushi'
import FSHToFHIR from 'fsh-sushi'
TypeScript types available; use named import.

Demonstrates programmatic use of SUSHI compiler via ESM import, building a project from the command-line argument.

#!/usr/bin/env node import sushi from 'fsh-sushi'; import path from 'path'; const projectPath = process.argv[2] || '.'; try { const result = await sushi.build(projectPath, { logLevel: 'info' }); console.log('Build succeeded:', result); } catch (err) { console.error('Build failed:', err.message); }
sushi --version
Debug
Known issues
gotchaSUSHI requires Node.js >=18, but Node 22 is strongly recommended. Older versions may experience dependency resolution issues.
fix
Upgrade Node.js to version 22.
affects: <3.19
breakingDependency aliasing syntax introduced in v3.16.0: alias@npm:packageId. Projects with duplicate package names must update their sushi-config.yaml.
fix
Add alias prefix for duplicate dependency entries.
affects: <3.16.0
deprecatedThe _updatePublisher and _genonce scripts are replaced by _build in sushi init since v3.19.0.
fix
Use `sushi init` to generate _build script.
affects: >=3.19.0
gotchaMultiline strings in invariants are only supported since v3.18.0. Older versions will fail to parse FSH with multiline invariant expressions.
fix
Upgrade to v3.18.0 or later.
affects: <3.18.0
Errors
Common errors & fixes
Error: Could not find package 'hl7.fhir.us.core#6.1.0'
SUSHI cannot resolve a FHIR package dependency, possibly due to network issues or missing registry.
fix
Check internet connection and ensure the package exists. Use `sushi update-dependencies` to refresh.
TypeError: Cannot read properties of undefined (reading 'profile')
Attempting to access a profile that was not defined or loaded correctly.
fix
Ensure the FSH file contains a valid Profile statement and that all dependent profiles are resolved.
ERROR: SUSHI requires Node.js version >=18. Current version: 14.15.0
Node.js version is too old.
fix
Install Node.js v18 or later. Recommended: v22.
Upgrade
Version history
3.19.0latest on npm
Audit
Dependencies
fhir-package-loaderoptionalResolves FHIR package dependencies from registry
lodashoptionalUtility library used internally
axiosoptionalHTTP client for network requests
Agent activity
27 hits · last 30 days
node
22
OpenAI (training)
1
Resources
fsh-sushi — npm install fsh-sushi · libregistry