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.
Implementation Considerations
Aliases
Aliases
Alias: $loinc = http://loinc.org
Alias: $sct = http://snomed.info/sct
Alias: $auBase = http://hl7.org.au/fhir
RuleSets
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