Skip to content

SUSHI 1.1.0

Compare
Choose a tag to compare
@cmoesel cmoesel released this 14 Jan 02:06
· 409 commits to master since this release

SUSHI 1.1.0 is a significant release of SUSHI that introduces several new features, including changes that may impact existing FSH projects. All SUSHI users should read these release notes for more details.

SUSHI 1.1.0 introduces the following significant features and enhancements:

  • Supports soft indexing (#687, #781, proposed FSH STU2 feature, details below)
  • Supports parameterized RuleSets (#700, proposed FSH STU2 feature, details below)
  • Extends Quantity syntax to include unit string (#652, proposed FSH STU2 feature, details below)
  • Introduces limited support for R5 (#698, details below)
  • Applies extension metadata to root element (#719, affects existing projects, details below)

In addition, SUSHI 1.1.0 also contains the following minor enhancements and bug fixes:

  • Allows aliases to be used with canonical | and version (#702)
  • Allows SUSHI projects w/ sushi-config.yaml but no FSH files (#672)
  • Allows sushi-config.yaml to reference generated pages (#696)
  • Relaxes validation of array slices when indexed items are present (#707)
  • Downloads IG publisher scripts from new location (#718)
  • Fixes poor character rendering when run in IG Publisher (#697)
  • Fixes bug that dropped the first character in some multi-line strings (#708)
  • Fixes bug when using inline resources with meta properties (#726)
  • Fixes bug when using Canonical with inline resources (#688)
  • Fixes bug when using block comments without whitespace (#681)
  • Fixes incorrect paths in generated document comments (#705, #706)
  • Improves potentially confusing error message (#703)

Soft Indexing

FHIR Shorthand STU1 requires that all items in an array be indexed using numeric indices (or an omitted index to represent [0]). For example, to assign multiple names in an instance of Patient, the following FSH could be used:

* name[0].given = "Robert"
* name[0].family = "Smith"
* name[1].given = "Rob"
* name[1].family = "Smith"
* name[2].given = "Bob"
* name[2].family = "Smith"

In complex resources such as Bundle and CapabilityStatement, arrays may have tens or hundreds of items. As a result, managing their indices can become quite tedious and error prone when needing to add or remove items in the middle of a list.

Soft indexing is a proposed feature for FHIR Shorthand STU2. Soft indexing allows authors to signal when an array index should be incremented rather than needing to track specific numeric indices. Using soft indexing, [+] increments the index and [=] represents the most recently used index. When an array is empty, [+] refers to the first element ([0]). Using soft indexing, the example above could be written as:

* name[+].given = "Robert"
* name[=].family = "Smith"
* name[+].given = "Rob"
* name[=].family = "Smith"
* name[+].given = "Bob"
* name[=].family = "Smith"

For more information, see the soft indexing documentation.

Parameterized RuleSets

FHIR Shorthand STU1 supports simple RuleSets with static content. Wherever the RuleSet is inserted, the same exact FSH will be inserted. In many cases, however, authors may want to insert a RuleSet for which a few values might be variable.

Parameterized RuleSets is a proposed FSH STU2 feature that allows authors to define RuleSets with variable parameters that can be supplied when the RuleSet is inserted. Following the example from the soft indexing section above, an author could create a parameterized RuleSet to assign a Patient's first and last name:

RuleSet: Name(first, last)
* name[+].given = "{first}"
* name[=].family = "{last}"

To assign three different names in a Patient instance, the author could insert the RuleSet three times, each with the desired first and last names:

* insert Name(Robert, Smith)
* insert Name(Rob, Smith)
* insert Name(Bob, Smith)

When the inserted RuleSets are expanded, and soft indexing is resolved, the result would be equivalent to:

* name[0].given = "Robert"
* name[0].family = "Smith"
* name[1].given = "Rob"
* name[1].family = "Smith"
* name[2].given = "Bob"
* name[2].family = "Smith"

For more information, see the documentation for defining parameterized RuleSets and inserting parameterized RuleSets.

Extended Quantity Syntax

FHIR Shorthand STU1 supports a simple syntax for assigning a Quantity with a value and a UCUM unit (which sets the system and code). To also assign the string unit property, however, the author needs an additional assignment rule. For example:

* valueQuantity = 155.0 '[lb_av]'
* valueQuantity.unit = "lb"

Supporting the string unit property in the Quantity syntax is proposed for FHIR Shorthand STU2. Using this new syntax, the above FSH could be written as a single rule:

* valueQuantity = 155.0 '[lb_av]' "lb"

Limited Support for R5

SUSHI 1.0.x (and previous versions) supports only FHIR 4.0.1. Starting with SUSHI 1.1.0, authors can specify any of the following fhirVersion values in their sushi-config.yaml or IG file:

  • 4.0.1
  • 4.2.0
  • 4.4.0
  • 4.5.0
  • current

SUSHI will use the formal FHIR definitions for the version of FHIR that is specified. If current is specified, SUSHI will use the latest CI build of FHIR.

Limitations: SUSHI has not been extensively tested with versions of FHIR > 4.0.1. In addition, SUSHI 1.1.0 does not yet contain specific support for the new integer64 or CodeableReference datatypes. Constraining or assigning elements of type integer64 or CodeableReference is not expected to work in this release.

Application of Extension Metadata

When an extension is applied to a profile definition, the FHIR IG publisher uses the extension root element's short and definition values as the extension description in the profile's snapshot/differential tables and "Detailed Descriptions" tab. If the author has not explicitly set the extension's root element's short and definiton values, generic placeholders will be used. For example:

image
image

Starting in SUSHI 1.1.0, if an author has not explicitly defined an extension root element's short or definition, SUSHI will automatically apply the extension definition's Title to the root element short, and Description to the root element definition. This provides the default behavior and rendering that most IG authors would expect and desire, without requiring redundant descriptions in the FSH. This will result in the above example now be rendered like this:

image
image

Authors who do not want this behavior can turn it off by using the applyExtensionMetadataToRoot configuration property in sushi-config.yaml:

applyExtensionMetadataToRoot: false

Full Documentation

For additional documentation, refer to FSH School's SUSHI documentation, the FSH STU1 specification, and/or the FSH current build specification.

Install or Update

To install or update to this release, run the following command:

$ npm install -g fsh-sushi

To revert to a previous stable release, run a command like the following:

$ npm install -g [email protected]

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

$ sushi -v