Skip to content

Aliases and RuleSets

Intent

Centralise constants and reusable rule blocks to reduce duplication, improve consistency, and make refactoring safer. When terminology URLs and common constraints are defined once, changes propagate automatically.

Structure

Aliases and RuleSets provide reusable building blocks for FSH profiles. Aliases give short names to long URLs (terminology systems, extension URLs). RuleSets encapsulate groups of constraints that can be applied to multiple profiles with a single line.

FSH Aliases and RuleSets structure showing reuse across profiles

Implementation Considerations

Aliases

Aliases
Alias: $loinc = http://loinc.org
Alias: $sct = http://snomed.info/sct
Alias: $auBase = http://hl7.org.au/fhir

RuleSets

RuleSets
RuleSet: rs-common-patient
* active 1..1 MS
* identifier 1..* MS
* telecom 0..* MS

Conventions

  • One file per profile; group RuleSets by domain
  • Prefer Additive RuleSets over copy-paste
  • Prefix RuleSets with rs- and Aliases with $cap_words

Benefits

  • Fewer diffs
  • Safer refactors

Trade-offs

  • Indirection for newcomers