Inferensys

Glossary

FHIR Shorthand (FSH)

A concise, text-based authoring language used to define FHIR profiles, extensions, and implementation guides, which is then compiled into formal FHIR definitions.
Stylish WeWork-like workspace with hot desks and document wall, professional searching through enterprise knowledge base on a mounted ultrawide display, warm industrial pendants overhead.
DEFINITION

What is FHIR Shorthand (FSH)?

A concise, text-based authoring language designed to simplify the creation and maintenance of FHIR profiles, extensions, and implementation guides.

FHIR Shorthand (FSH) is a domain-specific, text-based grammar for defining FHIR profiles, extensions, and implementation guides in a human-readable format. It serves as a source language that is compiled into formal StructureDefinition and ImplementationGuide resources, replacing the error-prone process of manually authoring complex JSON or XML conformance artifacts.

By using a declarative syntax with keywords like Profile, Extension, and Instance, FSH allows authors to express constraints, bindings, and slicing logic succinctly. The official SUSHI compiler translates .fsh files into valid FHIR definitions, enabling version control and diff-friendly workflows that are impractical with raw JSON structures.

AUTHORING LANGUAGE

Key Features of FHIR Shorthand

FHIR Shorthand (FSH) is a text-based grammar for defining FHIR artifacts. It compiles into formal StructureDefinitions and Implementation Guides, enabling version-controlled, collaborative profile development.

01

Declarative Profile Authoring

Define FHIR profiles and extensions using a concise, human-readable syntax. FSH allows authors to specify constraints, cardinality, and terminology bindings directly on elements without manually editing complex XML or JSON StructureDefinitions.

  • Differential approach: Only specify the changes from a base resource
  • Element path syntax: Use dot-notation like name.family to target nested elements
  • Compiled output: FSH compiles to valid FHIR Shorthand via SUSHI, the reference compiler
02

Invariant and Rule Definition

Embed formal constraints and validation logic directly within profile definitions. FSH supports FHIRPath expressions to define co-occurrence rules, conditional required fields, and cross-element validation.

  • Invariant keyword: Define named rules with severity levels (error/warning)
  • Context specification: Target specific elements or the entire resource
  • Natural language descriptions: Pair machine-readable logic with human-readable explanations for implementation guidance
03

Instance and Example Generation

Create sample FHIR resources for testing and documentation using the Instance keyword. These instances serve as realistic test data that conform to defined profiles, accelerating implementation validation.

  • Assignment syntax: Set element values using a clean key = value format
  • Reference resolution: Define inter-resource links that compile into valid FHIR references
  • Usage markers: Tag instances as #example or #definition to control their role in the Implementation Guide
04

ValueSet and CodeSystem Definition

Author terminology artifacts natively in FSH without switching to external tooling. Define custom code systems and compose value sets using inclusion and exclusion rules.

  • Hierarchical codes: Define codes with parent-child relationships using indentation
  • Intensional and extensional: Compose value sets by enumerating codes or by filtering code system properties
  • External imports: Reference codes from established terminologies like SNOMED CT and LOINC
05

Implementation Guide Assembly

Orchestrate a complete FHIR Implementation Guide from a single configuration file. FSH specifies the canonical URL, dependencies, pages, and artifact groupings that SUSHI compiles into a publishable IG.

  • Dependency management: Declare external IGs like US Core as dependencies
  • Page generation: Author narrative content in Markdown that integrates with generated artifacts
  • Parameterized builds: Define IG-wide parameters for consistent artifact naming and versioning
06

Alias and Mixin Reusability

Reduce repetition and improve maintainability through aliases and mixins. Aliases assign short names to long URLs, while mixins define reusable sets of rules that can be applied across multiple profiles.

  • Alias syntax: Alias: SCT = http://snomed.info/sct for cleaner terminology references
  • Mixin composition: Define a common constraint pattern once and insert it into multiple profiles
  • RuleSet insertion: Apply predefined rule blocks to ensure consistent profiling patterns across an IG
FHIR SHORTHAND

Frequently Asked Questions

Clear, technical answers to the most common questions about using FHIR Shorthand (FSH) to author and maintain FHIR implementation guides.

FHIR Shorthand (FSH) is a concise, text-based domain-specific language designed by HL7 for authoring FHIR profiles, extensions, and implementation guides. Instead of manually editing complex JSON or XML StructureDefinitions, authors write human-readable .fsh files using a declarative syntax. The FSH compiler, SUSHI, then compiles these files into the formal, computable FHIR definitions required by servers and validators. FSH works by defining logical entities: Alias for URLs, Profile for constrained resources, Extension for custom elements, Instance for example data, and ValueSet/CodeSystem for terminology. Rules like * status 1..1 or * component ^slicing.discriminator.type = #pattern apply constraints directly to FHIR elements using a path-based grammar, dramatically reducing the verbosity and error-proneness of hand-coding JSON.

AUTHORING COMPARISON

FSH vs. FHIR Mapping Language vs. StructureDefinition

Comparing the three primary methods for defining FHIR profiles, extensions, and data transformation rules.

FeatureFHIR Shorthand (FSH)FHIR Mapping LanguageStructureDefinition

Primary Purpose

Authoring FHIR profiles, extensions, and implementation guides

Defining transformations from legacy formats to FHIR resources

The formal, machine-readable definition of a FHIR profile or extension

Authoring Format

Concise, text-based domain-specific language

Text-based domain-specific language with map syntax

JSON or XML document conforming to the StructureDefinition resource

Human Readability

Compilation Required

Defines Element Constraints

Defines Data Transformations

Output Artifact

StructureDefinition, ImplementationGuide, and other FHIR resource instances

StructureMap resource instance

N/A (is the final artifact itself)

Typical Author

Profile author, implementation guide editor

Interoperability engineer, integration specialist

Software application consuming or generating the definition

Prasad Kumkar

About the author

Prasad Kumkar

CEO & MD, Inference Systems

Prasad Kumkar is the CEO & MD of Inference Systems and writes about AI systems architecture, LLM infrastructure, model serving, evaluation, and production deployment. Over 5+ years, he has worked across computer vision models, L5 autonomous vehicle systems, and LLM research, with a focus on taking complex AI ideas into real-world engineering systems.

His work and writing cover AI systems, large language models, AI agents, multimodal systems, autonomous systems, inference optimization, RAG, evaluation, and production AI engineering.