Skip to content

SUSHI 3.0.0 Beta 3

Pre-release
Pre-release
Compare
Choose a tag to compare
@mint-thompson mint-thompson released this 25 Apr 17:00
· 154 commits to master since this release
e9d33a1

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 they have been restricted to a single type (#1088) (breaking change)
  • Automatically assign title and description for Instances that support them (#1003) (breaking change)
  • Use separate FHIR Package Loader library for handling dependencies (#1026)
  • Update parser/lexer library to support more current versions of Node (#933)

For more details on these changes, see the SUSHI 3.0.0 Beta 1 Release Notes and the SUSHI 3.0.0 Beta 2 Release Notes.

Install or Update

NPM only installs non-stable releases when a tag or version number is specified. To install or update to this beta version of SUSHI, run the following command:

$ npm install -g [email protected]

To revert to the most recent stable (non-beta) release, run the following command:

$ npm install -g fsh-sushi

To check or confirm what version of SUSHI you have installed, you can run the following command:

$ sushi -v