Releases: FHIR/sushi
SUSHI 3.1.0
SUSHI 3.1.0 introduces new features that are proposed in FHIR Shorthand 3.0.0 (to be balloted in September 2023). SUSHI 3.1.0 also contains several minor enhancements and bug fixes.
What's Changed
- Support Context keyword when defining Extensions by @mint-thompson in #1282 (details below)
- Support Characteristics keyword when defining Logical models by @mint-thompson in #1293 (details below)
- Add CodeableReference keyword by @jafeltra in #1292 (details below)
- Log an error when applying type and binding constraints on CodeableReference subelements by @jafeltra in #1294
- Slicing rules should not be on slices by @mint-thompson in #1291
- Include version in Only Rules by @jafeltra in #1295
- Handle spaces after bracketed parameters by @mint-thompson in #1290
- Assignment on primitive satisfies cardinality of value element by @mint-thompson in #1284
Full Changelog: v3.0.0...v3.1.0
Extension Context Keyword
When defining extensions, it is considered best practice to specify the contexts under which the extension can be used. Until now, authors did this by setting StructureDefinition.context via caret assignment rules. FHIR Shorthand 3.0 (balloting in September 2023) introduces a new Context:
keyword for specifying one or more extension contexts. Context values can be an entity, entity with a FSH path, or FHIRPath string.
For example, the following extension is applicable to most resources representing a person in FHIR:
Extension: FavoriteBaseballTeam
Id: favorite-baseball-team
Title: "Favorite Baseball Team"
Description: "The person's favorite baseball team"
Context: Patient, RelatedPerson, Person, Practitioner
* value[x] only CodeableConcept
* value[x] from BaseballTeamsVS
For more information, see Defining Extensions in the current build of the FSH specification.
Logical Model Characteristics Keyword
When defining logical models, authors may want to indicate the type characteristics that apply to the type (e.g., has-target
, has-range
, can-bind
, etc.). Until now, authors did this by specifying one or more Type Characteristics extensions. FHIR Shorthand 3.0 (balloting in September 2023) introduces a new Characteristics:
keyword for specifying one or more type characteristic codes.
For example, the following logical model indicates that it can be the target of a reference from another logical model:
Logical: Human
Id: human-being-logical-model
Title: "Human Being"
Description: "A member of the Homo sapiens species."
Characteristics: #can-be-target
* name 0..* SU HumanName "Name(s) of the human" "The names by which the human is or has been known"
// more rules...
NOTE: The can-be-target
characteristic was mistakenly left out of the current version of the Type Characteristics code system. Since this is an important characteristic, however, SUSHI allows authors to specify the #can-be-target
characteristic. While can-be-target
remains missing from the code system, SUSHI will represent it using the Logical Target extension. Once the Type Characteristics code system supports can-be-target
, SUSHI will represent it using the Type Characteristics extension. See the Reference to Logical Model topic on Zulip for more discussion.
For more information, see Defining Logical Models in the current build of the FSH specification.
CodeableReference Keyword
FHIR Shorthand 2.0 introduced trial-use support for CodeableReferences by leveraging the existing Reference
keyword. While this works well for assigning the reference component of a CodeableReference, it does not always work well when constraining the reference type of a CodeableReference or adding a new CodeableReference element to a logical model or custom resource. To better support these use cases, FHIR Shorthand 3.0 (balloting in September 2023) introduces a new CodeableReference
keyword for use with add element rules and type rules.
For example, the following rule constrains MedicationRequest.reason to a CodeableReference targeting an Observation:
* reason only CodeableReference(Observation)
For more information, see Add Element Rules and Type Rules in the current build of the FSH specification.
Other Features Introduced in FHIR Shorthand 3.0
The previous SUSHI release, SUSHI 3.0.0, introduced support for other proposed FHIR Shorthand 3.0 features, such as:
- defining instances of logical models (spec)
- using rules in Invariant definitions (spec)
- using assignment rules and constraining inherited elements in logical models (spec)
- avoiding excessive escapes in insert rules by using double square brackets (spec)
The following feature, also proposed in FHIR Shorthand 3.0.0, is not yet implemented in SUSHI:
- assigning metadata to concepts in value sets (spec)
Install or Update
SUSHI 3.1.0 is the latest stable release of fsh-sushi. To install or update to SUSHI 3.1.0, run the following command:
$ npm install -g fsh-sushi
To revert to the previous SUSHI 3.0.0 stable release, run the following command:
$ npm install -g [email protected]
To check or confirm what version of SUSHI you have installed, you can run the following command:
$ sushi -v
SUSHI 3.0.0
SUSHI 3.0.0 is a major release of SUSHI introducing a number of new features, enhancements, and bug fixes. In addition, it adds preliminary support for FSH syntax and features that will be balloted in September. As a major release, this version contains breaking changes and updated system requirements.
The SUSHI team recommends that all users upgrade to SUSHI 3.0.0 by running the following command:
$ npm install -g fsh-sushi
Breaking Changes
The following breaking changes affect how you use SUSHI:
The following changes are considered breaking in that they change SUSHI's output in significant ways:
- Element ids and paths no longer use choice type renaming (#954)
- Choice elements are not sliced when they are restricted to only a single type (#1088)
- The resource
status
element defaults to IG status instead ofactive
(#1143) - The resource
version
element is only included when specifically set by the author (#1143) - Title and description elements are automatically assigned for Instances that support them (#1003)
New Features
The following new features support FSH specification changes that will be balloted in September:
- Instances of logical models can be defined in FSH (#1280)
- Elements of Invariant definitions can be defined using rules (#1272)
- Insert rule parameters can be enclosed in double brackets to avoid excessive escaping (#1216)
- Optional "manual slicing" mode improves control over slice order (#1121, #1200)
- Path rules may be used to force export of required fixed values (#1252)
The following new features are specific to SUSHI, but not related to the specification:
- Include the
fsh-link-references.md
file for easier linking in pages (#1136) - Run the
update-dependencies
command to check for dependency updates (#1152) - Configure log levels to affect logging output (#1208)
- Specify an alternate package server to use for downloading dependencies (#1260)
Enhancements
The following enhancements affect how SUSHI processes FSH and FSH projects:
- Support for scientific notation when defining number types (#1203)
- Improved support for versioned canonicals (#1275)
- Logical and Resource element names are checked against FHIR naming rules (#1230)
- Improved ordering of resources in generated IG file (#1118)
- Improved validation of
sushi-config.yaml
property names (#1265) - Improved support for paths whose names contain FSH keywords (#1244)
- A new environment variable can be used to force fancy characters in console output (#1177)
- Dependency loading uses new FHIR Package Loader library (#1026)
- New and improved (?) puns (#1229)
Bug Fixes
The following bug fixes address bugs from the latest 2.x release:
- Correctly resolve references to non-instance items (#1254, #1257)
- Support versions in instance meta.profile when setting exampleCanonical in IG (#1228)
- Populate IG exampleCanonicals regardless of meta.profile configuration (#1245)
- Correctly parse unicode characters using
\u
escape sequence in strings (#1233) - Improve assigning instance as values, especially when instance id is a number or boolean (#1242)
- Fix bug that sometimes caused primitives to be exported as objects (#1261)
- Don't create Instances if the nearest specialization ancestor is abstract (#1237)
Additional Details
Breaking: SUSHI now requires Node.js 18 (#933)
Node.js 12 and 14 have reached their end-of-life and Node.js 16 will reach end-of-life in September 2023 (see Node.js Releases). In order to ensure that SUSHI remains performant and secure, it now requires Node.js 18 (LTS). Although previous versions of Node.js may work with this release of SUSHI, they are not officially supported (and may stop working in the future).
To download a more recent version of Node.js go to: https://nodejs.org/en/download/.
Breaking: SUSHI executable now uses commands (#1163)
The sushi
executable now takes a command as the second argument. Available commands are: build
, init
, update-dependencies
, and help
. This provides a more consistent approach to using SUSHI and allows for further functionality in the future.
- To build a project, use
sushi build path/to/project
(orsushi build
to build the current directory). - To initialize a new project, use
sushi init
. - To update your dependencies to the latest versions, use
sushi update-dependencies path/to/project
(orsushi update-dependencies
to update dependencies in the current directory).
For now, SUSHI will continue to accept the legacy usage for building, allowing for users to enter just sushi
or sushi path/to/project
. Future versions, however, may deprecate and/or remove legacy command support.
Breaking: Element ids and paths no longer use choice type renaming (#954)
SUSHI 2.x utilized an approach to choice types that simplified their element ids and paths. For example, Observation.value[x]:valueQuantity
could be simplified to Observation.valueQuantity
in the profile's differential and the IG Publisher would convert it to the "long form" during the snapshot generation process. This was referred to as choice type renaming.
As of 2023, this is no longer considered best practice. As a results, SUSHI 3.0.0 no longer uses choice type renaming.
Consider the following rule on an Observation
profile:
* valueQuantity MS
In SUSHI 2.x, this results in a differential element with the following id
and path
:
{
"id": "Observation.valueQuantity",
"path": "Observation.valueQuantity",
// additional properties
}
In SUSHI 3.0.0, this results in the following id
and path
instead:
{
"id": "Observation.value[x]:valueQuantity",
"path": "Observation.value[x]",
// additional properties
}
This provides a more consistent representation of choice type elements without changing their meaning.
Breaking: Choice elements are not sliced when they are restricted to only a single type (#1088)
In SUSHI 2.x, whenever an author uses a type-specific path (such as valueCodeableConcept
), it uses the standard type slicing mechanism to represent it. While this is necessary to distinguish types when there are multiple types to choose from, it is not necessary when a choice element has already been constrained to a single type.
For example, consider the following FSH definition:
Profile: MyObservation
Parent: Observation
* value[x] only CodeableConcept
* valueCodeableConcept from MyValueSet
Given the definition above, SUSHI 2.x will produce a differential that slices value[x]
by type and introduces a specific choice type slice for valueCodeableConcept
:
Given the same definition, SUSHI 3.0.0 will recognize that value[x]
can only be a CodeableConcept
and will simplify the differential by applying the constraint directly to value[x]
instead of slicing it:
This maintains the intent of the profile while simplifying its representation by avoiding unnecessary slices when possible.
Note: If a choice element has already been sliced (i.e., by a parent profile), then SUSHI 3.0.0 will maintain consistency by using choice type slicing even if the choice element has already been reduced to a single type.
Breaking: The resource status
element defaults to IG status instead of active
(#1143)
SUSHI 2.x automatically defaults the status
field to active
on Profiles, Extensions, Logical Models, Resources, Value Sets, and Code Systems. SUSHI 3.0.0, however, now defaults the status
to be the same as the overall IG status
. This aligns more closely to the behavior of the IG Publisher and more likely reflects the intended status of resources. Authors can always override the status on individual definitions via a caret rule (e.g., * ^status = #active
).
Breaking: The resource version
element is only included when specifically set by the author (#1143)
SUSHI 2.x automatically defaults the version
field on Profiles, Extensions, Logical Models, Resources, Value Sets, and Code Systems to the version
of the IG. SUSHI 3.0.0, however, no longer sets the version
unless the author has specifically set it via a FSH rule. This allows the version
to be controlled by the FHIR templates and IG Publisher. The default behavior for these is to apply the IG version across all resources, so most authors will not see a change in the end result when using the IG Publisher.
Authors who want more control over when and how version
is set should look into the apply-version
and default-version
IG parameters, which can be set in the sushi-config.yaml
parameters
object.
Breaking: Title and description elements are automatically assigned for Instances that support them (#1003)
To define conformance resources other than profiles, extensions, code systems, and value sets, authors must define an Instance
of the resource. Although conformance resources often have a title
and description
, SUSHI 2.x requires authors to set those using assignment rules (e.g., * title = "My Operation Definition"
), even when the author already specified a title using the Title:
keyword.
In SUSHI 3.0.0, if an author specifies a Title:
on an Instance
whose type supports a title
element, SUSHI 3.0.0 will automatically assign that value to the instance's title
element. Similarly, if an author specifies a `Descri...
v2.10.2
SUSHI 3.0.0 Beta 3
SUSHI 3.0.0 Beta 3 is the third beta release for SUSHI 3.0. The SUSHI 3.0 beta releases change SUSHI behavior and output. They also require a later version of Node.js. As such, SUSHI 3.0 is considered to have breaking changes.
SUSHI 3.0.0 Beta 3 Overview
SUSHI 3.0.0 Beta 3 introduces the following changes from the SUSHI 3.0.0 Beta 2 release:
- Insert rule parameters can be enclosed in double brackets by @mint-thompson in #1216
- Parse Path Rules on Instances by @jafeltra in #1252
- Improve import & export of ids/extensions on primitives by @cmoesel in #1240
- Import and Parse Unicode Characters by @jafeltra in #1233
- Automatically load hl7.fhir.uv.extensions for FHIR R5 (Draft Final and Final) by @cmoesel in #1234
- Change hl7.fhir.uv.extensions autoload to use 'latest' version by @cmoesel in #1248
- Correctly resolve references to non-instance items by @cmoesel in #1254
- Replace references to contained canonicals w/ fragment reference by @cmoesel in #1257
- Allow most FSH keywords to be used as paths. by @mint-thompson in #1244
- Populate exampleCanonical regardless of meta.profile configuration by @mint-thompson in #1245
- Allow versioned URL in extension contains rule by @mint-thompson in #1251
- Support versions in instance meta.profile when setting exampleCanonical in IG by @mint-thompson in #1228
- Allow assignment of Instance values in any entity using Assignment or Caret Value rules, even when Instance has a numeric or boolean id by @mint-thompson in #1242
- Check ElementDefinition invariants related to element name when adding elements to Logical or Resource by @mint-thompson in #1230
- Don't create Instances if the nearest specialization ancestor is abstract by @mint-thompson in #1237
- Introduce an ENV variable to force fancy characters use by @qligier in #1177
- Update puns.ts by @markkramerus in #1229
- Update fhir-package-loader to v0.2.0 by @cmoesel in #1246
- Update find-repos script, repos-all, and repos-select by @cmoesel in #1231
SUSHI 3.0.0 Beta 3 Details
Insert rule parameters can be enclosed in double brackets
Parameter values used in insert rules can be enclosed in double brackets to avoid most of instances of needing to escape )
and ,
. More details on the use of this syntax are available in the FSH language reference.
Parse Path Rules on Instances, and use them when exporting the Instance
A path rule on a FSH Instance now has two useful side effects:
- If a path rule refers to an optional element, fixed values on that element will be set on that element. Additionally, any required child elements with fixed values will be set on that element. This is useful if those fixed values are the only values the author wants to set on the parent element.
- When manual slice ordering is enabled, path rules can be used to define the ordering of slices.
More details about path rules are available in the FSH language reference.
Improve import & export of ids/extensions on primitives
SUSHI now correctly handles extensions on ElementDefinition.type.profile
and ElementDefinition.type.targetProfile
, as well as other cases where primitive values have child elements. This applies to importing and exporting resources. Previously, SUSHI would drop all properties starting with _
when importing a StructureDefinition from a JSON definition, and would not check properties starting with _
when calculating a differential.
Import and Parse Unicode Characters
Unicode characters can be used in FSH strings by using \u
followed by the character's four-digit code. For example:
* valueString = "F\u00FCmms b\u00F6"
Automatically load hl7.fhir.uv.extensions for FHIR R5 (Draft Final and Final)
Core FHIR extensions are provided by the hl7.fhir.uv.extensions
package as of FHIR R5 Draft Final. This package is automatically loaded when a SUSHI project's FHIR version is FHIR R5 Draft Final or later. The latest published version of the extensions package is used.
Correctly resolve references to non-instance items, and Replace references to contained canonicals w/ fragment reference
References to non-Instance items will be resolved using relative URLs, when possible. This applies to References to both local and external items. Furthermore, if the Reference points to a contained resource, the fragment id of the referenced item will be used.
Allow most FSH keywords to be used as paths
SUSHI's parser now correctly recognizes when a FSH keyword, such as exclude
, is being used as a path. Most FSH keywords can now be used as paths. There are still some cases that can result in ambiguous statements, but for most uses, there should no longer be any problems.
Populate exampleCanonical regardless of meta.profile configuration
SUSHI will add an exampleCanonical
for example instances defined in FSH to the IG's resource list, even if the example instance's meta.profile
element is not set.
Allow versioned URL in extension contains rule
When defining slices on an extension element, an extension's URL may be followed by a |
and a version. For example:
* extension contains http://hl7.org/fhir/StructureDefinition/familymemberhistory-type|4.0.1 named history 0..1
If the version specified in the rule doesn't match the version of the available extension, SUSHI emits a warning.
Support versions in instance meta.profile when setting exampleCanonical in IG
Example instances may have a URL with a version in their meta.profile
. If the profile with that URL and version are available, use that URL to set exampleCanonical
in the IG.
Allow assignment of Instance values in any entity using Assignment or Caret Value rules, even when Instance has a numeric or boolean id
Assignment rules, with or without caret paths, now consistently allow for the assignment of instances. Previously, SUSHI would not allow instance assignment in many situations, such as when defining a ValueSet. Additionally, since instances can legally have an id that looks like a number or boolean, SUSHI will be flexible when trying to assign such values. For example, an instance with id 12E1
can now be used in assignment rules.
Check ElementDefinition invariants related to element name when adding elements to Logical or Resource
The specification for ElementDefinition defines two invariants regarding element names: a strict invariant regarding prohibited characters and name length, and a less strict invariant regarding recommended format. When adding elements on Logical or Resource definitions, SUSHI now outputs errors for violations of the strict invariant and warnings for violations of the less strict invariant.
Don't create Instances if the nearest specialization ancestor is abstract
SUSHI will not allow authors to create instances of abstract specializations, such as DomainResource. An instance of an abstract Profile is fine, as long as the nearest specialization ancestor is not abstract.
Introduce an ENV variable to force fancy characters use
The environment variable FORCE_FANCY_CHARACTERS
can be set to force SUSHI to output fancy characters when being run by the IG publisher. Previously, SUSHI would never output fancy characters when being run by the IG publisher. The FORCE_FANCY_CHARACTERS
environment variable should be set to 1
or true
to enable this feature. Users may also wish to set the FORCE_COLOR
environment variable, which is defined and used by chalk, to control color output.
Update puns
Some freshly-caught fish puns are added in this release.
SUSHI 3.0.0 Beta 1 and 2 Overview
The previous beta releases, SUSHI 3.0.0 Beta 1 and SUSHI 3.0.0 Beta 2, introduced the following changes from the SUSHI 2.x releases:
Changes from SUSHI 3.0.0 Beta 2
- Changes to how you use SUSHI on the command line (#1163)
- New optional "manual slicing" mode for improved control over slice order (#1121, #1200) (breaking change if enabled)
- Do not set resource version unless specifically set by author (#1143) (breaking change)
- Default resource status to IG status instead of
active
(#1143) (breaking change) - New
fsh-link-references.md
file for easier linking in pages (#1136) - Support for scientific notation of numbers (#1203)
- Order IG resources based on the configuration order (#1118)
- New
update-dependencies
command (#1152) - Configurable log levels (#1208)
- Include default type slicing in differential (#1179)
- All updates from SUSHI 2.6.1, 2.7.0, 2.7.1, 2.8.0, and 2.9.0
Changes from SUSHI 3.0.0 Beta 1
- Require Node.js 16 or Node.js 18 (breaking change)
- Do not use choice type renaming in element ids or paths (#954) (breaking change)
- Do not slice choice elements when ...
SUSHI 2.10.1
What's Changed
- Allow versioned URL in extension contains rule (#1251) by @mint-thompson in #1255
To install or update, run:
npm install -g fsh-sushi
Full Changelog: v2.10.0...v2.10.1
SUSHI 2.10.0
What's Changed
- Automatically load hl7.fhir.uv.extensions for FHIR R5 by @cmoesel in #1236 and #1247 (details below)
- Support dependencies on specific CI build branches by @cmoesel in #1241 (details below)
- Improve import & export of ids/extensions on primitives by @cmoesel in #1249
- Update find-repos script, repos-all, and repos-select (development utility) by @cmoesel in #1235
Details
Automatically load hl7.fhir.uv.extensions for FHIR R5
The FHIR R5 core package no longer includes extensions. Instead, extensions are provided by the hl7.fhir.uv.extensions
package. In order to provide a seamless and user-friendly experience, the latest released extensions package is loaded automatically for IGs based on R5. This follows the same behavior as the IG Publisher.
Support dependencies on specific CI build branches
If an author specifies a dependency package with the version current
, then the latest package from the CI build server will be used. This functionality has existed in SUSHI for quite a while. In this release, authors may now specify CI builds of specific branches by using the version: current$branchname
. For example, to get the CI build for a branch named my-test-branch
, specify the dependency version as current$my-test-branch
.
To install or update, run:
npm install -g fsh-sushi
Full Changelog: v2.9.0...v2.10.0
SUSHI 3.0.0 Beta 2
SUSHI 3.0.0 Beta 2 is the second beta release for SUSHI 3.0. The SUSHI 3.0 beta releases change SUSHI behavior and output. They also require a later version of Node.js. As such, SUSHI 3.0 is considered to have breaking changes.
SUSHI 3.0.0 Beta 2 Overview
SUSHI 3.0.0 Beta 2 introduces the following changes from the SUSHI 3.0.0 Beta 1 release:
- Changes to how you use SUSHI on the command line (#1163)
- New optional "manual slicing" mode for improved control over slice order (#1121, #1200) (breaking change if enabled)
- Do not set resource version unless specifically set by author (#1143) (breaking change)
- Default resource status to IG status instead of
active
(#1143) (breaking change) - New
fsh-link-references.md
file for easier linking in pages (#1136) - Support for scientific notation of numbers (#1203)
- Order IG resources based on the configuration order (#1118)
- New
update-dependencies
command (#1152) - Configurable log levels (#1208)
- Include default type slicing in differential (#1179)
- All updates from SUSHI 2.6.1, 2.7.0, 2.7.1, 2.8.0, and 2.9.0
SUSHI 3.0.0 Beta 2 Details
Changes to how you use SUSHI on the command line
The sushi
executable now takes a command as the second argument. Available commands are: build
, init
, update-dependencies
, and help
. This provides a more consistent approach to using SUSHI and allows for further functionality in the future.
- To build a project, use
sushi build path/to/project
(orsushi build
to build the current directory). - To initialize a new project, use
sushi init
. - To update your dependencies to the latest versions, use
sushi update-dependencies path/to/project
(orsushi update-dependencies
to update dependencies in the current directory). See New update-dependencies command below for more details.
For now, SUSHI will continue to accept the legacy usage for building, allowing for users to enter just sushi
or sushi path/to/project
. Future versions, however, may deprecate and/or remove legacy command support.
New optional "manual slicing" mode for improved control over slice order
When processing Instances in SUSHI 2.x, SUSHI always processes the slices according to the following rules:
- Required slices are added as the first elements in the sliced array.
- If an author adds optional slices using named slice paths, they are added after the required slices.
- If an author uses numeric index paths or soft index paths to reference slices, they may overwrite existing values and/or add new values.
This approach makes it difficult (or impossible) for authors to control the exact order of elements in a sliced array. In addition, it causes confusion when authors use soft indexing and mistakenly overwrite a required slice (partially or completely). That said, many authors have come to expect this behavior and have written their FSH to accommodate it. For this reason, SUSHI 3.0.0 continues to work this way by default (avoiding unexpected changes in existing IGs).
Going forward, however, FSH authors are encouraged to use the new instanceOptions
--> manualSliceOrdering
option in sushi-config.yaml
. When set to true
, this indicates that SUSHI should use the new manual slice ordering mode when processing instances. This new mode processes slices according to the following rules:
- Authors should always add slice values using named slice paths.
- Slice values are added to the array in the order they are referenced in the FSH Instance rules (while keeping items in the same slice contiguous).
- When values are added using a soft index path, the soft index takes into account preceding named slice paths, adding the item after them.
- Any remaining unreferenced required slices are added at the end.
Authors who enable manualSliceOrdering
on existing projects should carefully review the results, as the new rules for slice application may result in unexpected output. To mitigate risk, authors should check all of their Instances to ensure they use named slice paths when assigning slice values in Instances.
To enable manual slice ordering add (or modify) the following in your sushi-config.yaml
:
instanceOptions:
manualSliceOrdering: true
NOTE: The FSH team recommends that new projects enable manualSliceOrdering
. As such, the sushi init
command will generate a sushi-config.yaml
with manualSliceOrdering
set to true
.
For more information and examples, see Manual Slice Ordering on FSHSchool.
Do not set resource version unless specifically set by author
SUSHI 2.x automatically defaults the version
field on Profiles, Extensions, Logical Models, Resources, Value Sets, and Code Systems to the version
of the IG. SUSHI 3.0.0, however, no longer sets the version
unless the author has specifically set it via a FSH rule. This allows the version
to be controlled by the FHIR templates and IG Publisher. The default behavior for these is to apply the IG version across all resources, so most authors will not see a change in the end result.
Authors who want more control over when and how version
is set should look into the apply-version
and default-version
IG parameters, which can be set in the sushi-config.yaml
parameters
object.
Default resource status to IG status instead of active
SUSHI 2.x automatically defaults the status
field to active
on Profiles, Extensions, Logical Models, Resources, Value Sets, and Code Systems. SUSHI 3.0.0, however, now defaults the status
to be the same as the overall IG status
. This aligns more closely to the behavior of the IG Publisher and more likely reflects the intended status of resources. Authors can always override the status on individual definitions via a caret rule (e.g., * ^status = #active
).
New fsh-link-references.md
file for easier linking in pages
SUSHI 3.0.0 now generates a file at fsh-generated/includes/fsh-link-references.md
. This file makes linking to IG resources easier in IG markdown pages. To use it, add {% include fsh-link-references.md %}
to the bottom of the markdown (.md
) file where you want to link by resource names.
After doing that, you can reference IG resources in that markdown file using their name surround by square brackets. For example, if your FSH defines Profile: NationalPatient
, then the following markdown will correctly link to that profile:
This IG defines a [NationalPatient] that represents...
...
{% include fsh-link-references.md %}
This feature is optional. Authors who do not wish to use it should not add the include
directive in their markdown files.
For more information and examples, see Link References on FSHSchool.
Support for scientific notation of numbers
Authors can now assign numbers using scientific notation. For example:
* valueInteger = 2e8
Both positive and negative exponents are supported, but authors should take care to ensure that the resulting value is appropriate for the data type it is being assigned to.
Order IG resources based on the configuration order
SUSHI 3.0.0 preserves the order of resources when all resources are manually listed in sushi-config.yaml
's resources
section or groups
sections. Otherwise SUSHI orders the resources by their title (when applicable) or id. This ordering affects the order in which resources are listed in the IG's generated table of contents.
New update-dependencies
command
SUSHI 3.0.0 introduces a new update-dependencies
command. When run, this command checks the dependencies defined in the sushi-config.yaml
file to see if they are at the latest published versions. If SUSHI finds outdated dependencies, it will display a list of the outdated dependencies and ask the user if they wish to update. If the user chooses to update them, SUSHI will directly modify the sushi-config.yaml
file with the latest versions and download them to the FHIR cache. Any dependency with a current
or dev
version will not be modified. This command can be used in the root folder of a project as follows:
sushi update-dependencies
Users can also specify a project path:
sushi update-dependencies path/to/project
For more information, see update-dependencies on FSHSchool.
Configurable log levels
While SUSHI 2.x allowed users to indicate if they wanted debug logging, SUSHI 3.0 allows users more control of the logging. Users can pass a -l
or --log-level
flag to specify the desired log-level: error
, warn
, info
, or debug
. For example, sushi build -l warn
will run SUSHI in the current directory, outputting only warn
and error
messages.
Include default type slicing in differential
SUSHI 3.0.0 Beta 1 stopped using choice type renaming in eleme...
SUSHI 2.9.0
What's Changed
- Allow Logical Models and Resources to constrain inherited elements by @cmoesel in #1207
- Support IG R5 properties in R4 IGs by @jafeltra in #1189
- Automatically load hl7.terminology package by @cmoesel in #1205
- Find entities by id, even when their id is set by a rule by @mint-thompson in #1198
- Use inserted rules when checking new concepts by @mint-thompson in #1196
- Update uninherited extensions based on JIRA-28441 by @cmoesel in #1212
- Load dependencies in deterministic order by @cmoesel in #1213
Details
Allow Logical Models and Resources to constrain inherited elements
In prior versions of SUSHI, SUSHI prevented authors from constraining inherited elements in logical models and custom resources. Based on discussions with the FHIR team and clarifications in the specification, we have lifted this restriction. Authors can now constrain inherited elements in logical models and custom resources. Slicing, however, is still not allowed in either case.
Support IG R5 properties in R4 IGs
FHIR R5 added several new properties in the Implementation Guide resource. To support a consistent authoring experience, IG authors can reference these new properties in sushi-config.yaml
for R5 IGs and R4 IGs. When used in R4 IGs, the property will be translated into the corresponding R4 property or an interversion extension. Authors should note, however, that in some cases the IG Publisher may not yet use these properties in an R4 context.
Automatically load hl7.terminology package
The hl7.terminology package (a.k.a. THO) defines Code Systems and Value Sets that are used by HL7 standards and implementation guides. Since these terminology definitions are considered a core aspect of standards and IGs, they are loaded by default. The IG Publisher already does this; now SUSHI does it as well. Normally, the latest release of hl7.terminology.r4
is loaded, but authors can override this by explicitly adding a hl7.terminology
, hl7.terminology.r4
, or hl7.terminology.r5
dependency (to a specific version) in their sushi-config.yaml
file.
When this dependency is automatically added, failure to download it is considered only a warning and SUSHI proceeds as normal.
To install or update, run:
npm install -g fsh-sushi
Full Changelog: v2.8.0...v2.9.0
SUSHI 2.8.0
SUSHI 2.8.0 introduces minor enhancements and bug fixes.
What's Changed
- Automatically load hl7.fhir.uv.tools dependency by @mint-thompson in #1186
- Warn when ig.ini does not point to SUSHI-generated IG JSON by @cmoesel in #1193
- Keep parent's fixedUri on Extension.url of child extensions by @mint-thompson in #1182
Details
Automatically load hl7.fhir.uv.tools dependency
The FHIR Tooling Extensions IG (hl7.fhir.uv.tools) defines the extensions that may be useful in the development of implementation guides. For example, the Additional Binding Extension can be used to specify additional binding types on a coded element.
Since these extensions are considered a core aspect of IG tooling, the package that provides them is included by default. The IG Publisher already does this; now SUSHI does it as well. Normally, the latest build of hl7.fhir.uv.tools
is included, but authors can override this by explicitly adding a hl7.fhir.uv.tools
dependency (to a specific version) in their sushi-config.yaml
file.
When this dependency is automatically added, failure to download it is considered only a warning and SUSHI proceeds as normal.
Full Changelog: v2.7.1...v2.8.0
SUSH 2.7.1
SUSHI 2.7.1 is a patch release containing several bug fixes and minor enhancements.
What's Changed
- Fix CodeSystem resolution for systems in external packages by @jafeltra in #1175
- Fix fishing for profiles with a version by @jafeltra in #1167
- Escape reserved characters in menu.xml by @jafeltra in #1153
- Avoid redefining inherited elements in logical models and resources by @guhanthuran in #1114
- Improve warning message related to naming rules by @guhanthuran in #1147
- Warn on empty titles and descriptions by @guhanthuran in #1158
- Update IG parameters links by @qligier in #1164
New Contributors
To install or update, run:
npm install -g fsh-sushi
Full Changelog: v2.7.0...v2.7.1