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