npm fsh-sushi 2.0.0-beta.1
SUSHI 2.0.0 Beta 1

latest releases: 3.18.1, 3.18.0, 3.17.0...
4 years ago

SUSHI 2.0.0-beta.1 is the first beta release for SUSHI 2.0.0. This release introduces significant new features, bug fixes, and several breaking changes.

New Features

  • Rule indentation for succinct specification of subpaths (#797)
  • Logical models and custom resources (#822)
  • Hierarchical CodeSystems and concept-specific caret rules (#814)
  • Option to output preprocessed FSH (#756)
  • Extensions for representing elements from other versions of FHIR (#805)
  • Extension for profiling BackboneElements (#767)

The above features are detailed further below in the release notes.

Bug Fixes

  • Fixes overly strict checks on assignments to items in an array (#821)
  • Fixes parser to allow more than two value set filters to be chained (#823)

Breaking Changes

  • Indent rules make whitespace before * significant. This may affect a small number of existing IGs.
  • Support for deprecated syntax has been removed (#817), including:
    • Mixins: keyword
    • units keyword
    • , path separator (replaced by and)
    • | type separator (replaced by or)
  • Support for limited ValueSet expansion (added in SUSHI 1.3.0) has been removed (#807)
  • Support for deprecated pre-SUSHI 1.0 project structures has been removed (#820)

All projects using SUSHI 2.0.0-beta.1 must use the project structure described on the Project Structure section of FSH School. Old project structures will now fail with an error. For instructions on migrating from an old project structure, see FSH School's Migration documentation.

Rule Indentation for Succinct Specification of Subpaths

Indentation can now be used to provide a more succinct visual representation of rules with nested paths. When one rule is indented below another, the full path of the indented rule or rules is obtained by prepending the path from the previous less-indented rule. For example:

* item[0]
  * linkId = "title"
  * type = #display
  * item[0]
    * linkId = "uniquearv_number"
    * type = #string
  * item[1]
    * linkId = "personal_info"
    * type = #group
* status = #active

is equivalent to the more repetitive FSH STU1 approach:

* item[0].linkId = "title"
* item[0].type = #display
* item[0].item[0].linkId = "uniquearv_number"
* item[0].item[0].type = #string
* item[0].item[1].linkId = "personal_info"
* item[0].item[1].type = #group
* status = #active

Using rule indentation is optional. Authors can continue using the longer path form if desired. Existing users should note, however, that this feature assigns meaning to whitespace before the * in rules. Prior to SUSHI 2.0.0, whitespace before the * was insignficant. Existing projects that have arbitrary whitespace before * or put multiple rules on the same line will likely experience errors when running SUSHI 2.0.0-beta.1. These errors can be fixed by removing unnecessary whitespace before * where needed.

See the following section from the current build FSH specification for additional details:

Logical Models and Custom Resources

Logical models can be defined with the Logical keyword, and the optional Parent, Id, Title, and Description keywords. The default parent for logical models is Base. Logical models are useful for representing arbitrary content since a logical model supports adding elements, unlike profiles and extensions. Elements are added via an AddElement rule. These rules specify a path, cardinality, optional flags, type(s), short definition, and optional long definition. For example:

* email 0..* SU string "The person's email addresses" "Email addresses by which the person may be contacted." 

The following demonstrates how logical models could be used to represent a human and their family (also using the optional rule indentation described above):

Logical:        Human
Title:          "Human Being"
Description:    "A member of the Homo sapien species."
* name 0..* SU HumanName "Name(s) of the human" "The names by which the human is or has been known"
* birthDate 0..1 SU dateTime "The date of birth, if known"
    "The date on which the person was born. Approximations may be used if exact date is unknown."
* deceased[x] 0..1 SU boolean or dateTime or Age "Indication if the human is deceased"
    "An indication if the human has died. Boolean should not be used if date or age at death are known."
* family 0..1 BackboneElement "Family" "Members of the human's immediate family."
  * mother 0..2 FamilyMember "Mother" "Biological mother, current adoptive mother, or both."
  * father 0..2 FamilyMember "Father" "Biological father, current adoptive father, or both."
  * sibling 0..* FamilyMember "Sibling" "Other children of the human's mother and/or father."

Logical:        FamilyMember
Title:          "Family Member"
Description:    "A reference to a human's family member."
* human 1..1 SU Reference(Human) "Family member" "A reference to the human family member"
* biological 0..1 boolean "Biologically related?"
      "A family member may not be biologically related due to adoption, blended families, etc."

Custom resources are defined much like logical models, but use the Resource keyword rather than Logical. The default parent for resources is DomainResource.

See the following sections from the current build FSH specification for additional details:

NOTE: The SUSHI team would like to thank Joe Paquette and athenahealth for implementing this feature in SUSHI. Their quality contribution and teamwork has greatly improved SUSHI and allowed the SUSHI team to focus on many of the other proposed FSH STU2 features found in this release. Thank you, Joe and athenahealth!

Hierarchical CodeSystems and Concept-Specific Caret Rules

Concepts in a CodeSystem can now be defined in a hierarchical structure. To define such concepts, list all of the preceding codes in the hierarchy before the new code:

* #{parent code} "{display string}" "{definition string}"
* #{parent code} #{child code} "{display string}" "{definition string}"

This can also be accomplished with indentation:

* #{parent code} "{display string}" "{definition string}"
  * #{child code} "{display string}" "{definition string}"

In addition, authors can now use caret (^) rules on specific concepts to set metadata elements such as designation and property. For example:

#rash ^designation.use = SCT#900000000000013009 "Synonym"

See the following sections from the current build FSH specification for additional details:

Option to Output Preprocessed FSH

The -p or --preprocessed flag can be used to to create a _preprocessed folder in a SUSHI project. This folder contains representations of the input FSH after several preprocessing steps have taken place. These steps include resolution of Alias values, insertion of RuleSet rules, and resolution of soft indexing. For example, the following FSH:

Alias: CAT = http://hl7.org/fhir/ValueSet/observation-category

Profile: ObservationProfile
Parent: Observation
* insert Metadata
* category from CAT (required)

RuleSet: Metadata
* ^version = "1.2.3"
* ^publisher = "Example publisher"

Instance: PatientInstance
InstanceOf: Patient
* name.given[+] = "John"
* name.given[+] = "Q"

results in the following preprocessed output:

Alias: CAT = http://hl7.org/fhir/ValueSet/observation-category

// Originally defined on lines 3 - 6
Profile: ObservationProfile
Parent: Observation
Id: ObservationProfile
* ^version = "1.2.3"
* ^publisher = "Example publisher"
* category from http://hl7.org/fhir/ValueSet/observation-category (required)

// Originally defined on lines 12 - 15
Instance: PatientInstance
InstanceOf: Patient
Usage: #example
* name.given[0] = "John"
* name.given[1] = "Q"

See the following section from the FSH School SUSHI documentation for additional details:

Extensions for Representing Elements From Other Versions of FHIR

The FHIR specification defines behavior for a feature they refer to as extensions for converting between versions (also known as "implied extensions"). This feature allows authors to represent specific elements from past and future versions of FHIR using a specific extension URL format (as described in the spec linked above). These extensions are not available in any physical package, but rather, are understood and processed conceptually.

To use this feature in SUSHI, authors must specify a dependency on a package using an id and version of the form hl7.fhir.extensions.<extension-version>: <package-version>, where valid extension-versions are r2, r3, r4, and r5. As an example, if an author wanted to represent the Patient.animal.species element as defined in STU3, the dependencies should be specified as:

  dependencies:
    hl7.fhir.extensions.r3: 4.0.1

An author can then reference the extension using a URL following the format defined in the FHIR specification linked above. For example, the extension referring to the R3 Patient.animal.species element would be: http://hl7.org/fhir/3.0/StructureDefinition/extension-Patient.animal.species.

See the following documentation for additional details:

Extension for Profiling BackboneElements

The profile-element extension can be used to profile a BackboneElement by pointing at another BackboneElement defined elsewhere. This is typically used to indicate that constraints on the target of a contentReference should be applied to all the references as well. For example, the following snippet indicates the all recursive references to Questionnaire.item (e.g., Questionnaire.item.item) should conform to the same constraints as the original Questionnaire.item in this profile:

Profile: MyQuestionnaire
Parent: Questionnaire
* Questionnaire.item ^type.profile = http://example.org/StructureDefinition/MyQuestionnaire
* Questionnaire.item ^type.profile.extension.url = http://hl7.org/fhir/StructureDefinition/elementdefinition-profile-element
* Questionnaire.item ^type.profile.extension.valueString = "Questionnaire.item"
// ...

See the following documentation for additional details:

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

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 fsh-sushi@2.0.0-beta.1

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

Using SUSHI 2.0.0 Beta Releases in the Auto Build

The autobuild environment uses the latest stable version of SUSHI. To force the IG Publisher to use SUSHI 2.0.0-beta.1 when building your project (such as in the autobuild environment), create a fsh.ini file at the root of your project with the following contents:

[FSH]
sushi-version=2.0.0-beta.1

Don't miss a new fsh-sushi release

NewReleases is sending notifications on new releases.