Releases: FHIR/sushi
SUSHI 0.6.2
SUSHI 0.6.2 contains the following minor enhancements and bug fixes:
- Reverts default output folder back to
build
(#132)- NOTE: Resources will still be written to
${outDir}/input/resources
- NOTE: Resources will still be written to
- Allows authors to fix/set xhtml values (e.g.,
^text.div = "<div>My Text</div>"
) (#129) - Associates examples with profiles in IG when applicable (to populate "Examples" tab) (#127)
- Fixes instance generation to ensure proper serialization of array properties (#114)
- NOTE: This introduces additional validation that may expose errors related to #121, which is still open
- Fixes issue with ordering of slices when one slicename is substring of another (#122)
- Fixes IG dependency issues for dependencies using "current" or "dev" version (#140)
- Fixes line comments so that space is not required after
//
(e.g.,//My Comment
) (#130)
Install or Update
To install or update to the latest version, run the following command:
$ npm install -g fsh-sushi
SUSHI 0.6.1
SUSHI 0.6.1 contains the following minor enhancements and bug fixes:
- Supports the
-v
or--version
flags to print the SUSHI version - Changes default output location to
build/input/resources
even when not generating an IG (#104) - Fixes importer bug that caused syntax errors to silently fail and skip rest of file (#85)
- Adds source info (e.g., File and Line) to error messages where it was previously missing (#82)
- Automatically adds
id
to instances based on instance name (#103) - Automatically adds
url
value when adding extensions to an instance (#113) - Allows extensions to be referenced by id, name, URL, or alias in rule paths (#108)
- Reports when an alias has been assigned to two different values (#124)
- Removes invalid parent resource extensions from profiles and extensions (#116)
- Fixes occasionally occurring
e.type is not iterable
error (#107, #112)
Install or Update
To install or update to the latest version, run the following command:
$ npm install -g fsh-sushi
SUSHI 0.6.0
SUSHI 0.6.0 contains the following features and bug fixes:
- New: Value Sets
- Define and export ValueSets
- NOTE: Escape syntax (
^
) is currently not supported in ValueSets - ValueSet syntax: https://build.fhir.org/ig/HL7/fhir-shorthand/#defining-value-sets
- New: Code Systems
- Define and exporting CodeSystems
- NOTE: Escape syntax (
^
) is currently not supported in CodeSystems - CodeSystem syntax: https://build.fhir.org/ig/HL7/fhir-shorthand/#defining-code-systems
- Improved: Instances
- Assign references to other instances (e.g.,
patient = Reference(PatientBob)
) - Use slicenames in instance paths (e.g.,
component[systolic].valueQuantity = 110 'mm[Hg]'
) - Correctly serializes id and extension on primitive values
- Automatically adds profile URL to
meta.profile
array - Instance syntax: https://build.fhir.org/ig/HL7/fhir-shorthand/#defining-instances
- Assign references to other instances (e.g.,
- Improved: Profiles and Extensions
- Global Aliases (aliases no longer need to be defined in the same file)
- Package version (defined in
package.json
) used as defaultversion
in generated profiles/extensions - Better and safer handling of circular references
- Fixed slicing implementation of
BackboneElements
- Improved: Implementation Guide Generation
- Generated bash scripts (i.e.,
_updatePublisher.sh
,_genonce.sh
) executable on Mac - Dependencies in
package.json
properly translated intodependsOn
in ImplementionGuide JSON
- Generated bash scripts (i.e.,
Install or Update
To install or update to the latest version, run the following command:
$ npm install -g fsh-sushi
SUSHI 0.5.0
SUSHI 0.5.0 contains the following new features:
- Support for creating Instances (details below)
- Loading externally defined packages (details below)
Support for creating Instances
Authors can now use the Instance
keyword to create an instance of a resource or a profile on a resource. For more information on the syntax for defining an instance, see the documenation here: http://build.fhir.org/ig/HL7/fhir-shorthand/index.html#defining-instances. Setting values on slices in an instance is not yet supported, and is planned for a later release. If a resource has fixed values, those fixed values will be automatically set on the instance if they are at the root of the resource, or if their parent element is set in the instance. In the example below, if OurPatientProfile
had Patient.active
fixed to true
, then on the Instance below, active
would be set to true
automatically, without the author writing a rule such as: * active = true
.
Example:
Instance: EveAnyperson
InstanceOf: OurPatientProfile
* name[0].family = "Anyperson"
* name[0].given[0] = "Eve"
* name[0].given[1] = "Steve"
* birthDate = "1960-04-25"
Loading externally defined packages
Externally defined packages can now be loaded when using SUSHI. Dependencies are added in the configuration file using the canonical name and a version of the package as shown below:
"dependencies": {
"hl7.fhir.r4.core": "4.0.1",
"hl7.fhir.us.core": "3.1.0"
}
When a package is declared as a dependency, SUSHI will first check the local cache of the user, located at ~/.fhir/packages
to see if the package is there. If the package is not available, SUSHI downloads the package to this cache from https://simplifier.net/packages. A package version number can be replaced by dev
. This indicates that the package should be locally available in the FHIR cache, so it will not be downloaded. A package version number can also be replaced by current
. If this is the case, SUSHI will attempt to download the package from http://build.fhir.org/ig/HL7/ rather than https://simplifier.net/packages. Once a dependency is added and successfully loaded, all FHIR artifacts (profiles, extensions, value sets, etc.) defined in that package can be referenced by name, Id, or URL when authoring FSH definitions. For example, if an author wanted to base a profile off of the US Core profile of the Patient resource, they could add US Core as a dependency as shown above, and create a profile as shown:
Profile: OurPatientProfile
Parent: http://hl7.org/fhir/us/core/StructureDefinition/us-core-patient
// some rules
Install or Update
$ npm install -g fsh-sushi
SUSHI 0.4.1
SUSHI 0.4.1 contains the following bug fix:
- Fixes a bug that caused duplicate profiles and/or extensions to be reported in the output count and listed in the ImplementationGuide JSON file. When this bug occurred, IGs might not properly build.
SUSHI 0.4.0 contained the following features and fixes:
- Simplified support for adding extensions to profiles(details below)
- Initial (limited) support for generating Implementation Guides (details below)
- Default output folder changed from
out
tobuild
- Bug fix for applying constraints to extension values
- Reports total number of errors and warnings after processing completes
Simplified support for adding extensions to profiles
Prior to this release, authors could add extensions using the contains
keyword, but they were required to specify the slicing discriminator manually (using the ^
feature). Now when authors add extensions, if no discriminator has been specified already, SUSHI will automatically add a value
-based discriminator on the url
path (unordered and open).
Example:
Profile: Pirate
Parent: Patient
* extension contains ParrotName 0..1
Extension: ParrotName
* extension 0..0
* value[x] only string
Initial (limited) support for generating Implementation Guides (IG)
SUSHI generates implementation guides that can be published via the new template-based IG Publisher. The template-based publisher is still being developed by the FHIR community. See the Guidance for HL7 IG Creation for more details.
To indicate that SUSHI should generate the IG structure and files, add a folder named ig-data
to the folder containing your FSH files (i.e. the "FSH Tank"). If the folder is empty, SUSHI will generate a basic implementation guide using information in your package.json
and FSH files. In this initial release, SUSHI also supports very limited customization of the IG via the following files:
ig-data/ig.ini
: If present, the user-provided igi.ini values will be merged with the SUSHI-generated ig.ini. The FHIR team has not yet fully documented the ig.ini file, but the following example shows the default values for some of the fields that authors may commonly want to override:Possible values for[IG] template = fhir.base.template copyrightyear = 2019+ ballotstatus = STU1 excludexml = No excludejson = No excludettl = No excludeMaps = No
template
arefhir.base.template
,hl7.fhir.template
, andfhir.davinci.template
.ig-data/package-list.json
: If present, the user-provided package-list.json will be used. If not present, SUSHI will generate a package-list.json. See the FHIR PackageList documentation.ig-data/input/pagecontent/index.md
: If present, the user-provided index.md will be used as the content for the IG's main page. If not preset, SUSHI will generate this file and insert thedescription
value from thepackage.json
file.
Future versions of SUSHI will allow authors to configure the menu, add custom resources, and add additional content (such as pages and snippets).
After running SUSHI, navigate to the output folder (default name: build
) and run the _updatePublisher
script to download the latest publisher to the input-cache
folder. After the download is completed, run the _genonce
script to initiate the Java-based IG builder process (NOTE: Java must be installed). After the publishing process is complete, open the output/index.html
file in your browser.
For more details about the template-based IG Publisher, see Using the HL7 Templates.
Install or Update
To install or update to the latest version, run the following command:
$ npm install -g fsh-sushi
SUSHI 0.4.0
NOTE: This version contains a bug that has been fixed in the SUSHI 0.4.1 release. Please use SUSHI 0.4.1.
SUSHI 0.4.0 contains the following features and fixes:
- Simplified support for adding extensions to profiles (details below)
- Initial (limited) support for generating Implementation Guides (details below)
- Default output folder changed from
out
tobuild
- Bug fix for applying constraints to extension values
- Reports total number of errors and warnings after processing completes
Simplified support for adding extensions to profiles
Prior to this release, authors could add extensions using the contains
keyword, but they were required to specify the slicing discriminator manually (using the ^
feature). Now when authors add extensions, if no discriminator has been specified already, SUSHI will automatically add a value
-based discriminator on the url
path (unordered and open).
Example:
Profile: Pirate
Parent: Patient
* extension contains ParrotName 0..1
Extension: ParrotName
* extension 0..0
* value[x] only string
Initial (limited) support for generating Implementation Guides (IG)
SUSHI generates implementation guides that can be published via the new template-based IG Publisher. The template-based publisher is still being developed by the FHIR community. See the Guidance for HL7 IG Creation for more details.
To indicate that SUSHI should generate the IG structure and files, add a folder named ig-data
to the folder containing your FSH files (i.e. the "FSH Tank"). If the folder is empty, SUSHI will generate a basic implementation guide using information in your package.json
and FSH files. In this initial release, SUSHI also supports very limited customization of the IG via the following files:
ig-data/ig.ini
: If present, the user-provided igi.ini values will be merged with the SUSHI-generated ig.ini. The FHIR team has not yet fully documented the ig.ini file, but the following example shows the default values for some of the fields that authors may commonly want to override:Possible values for[IG] template = fhir.base.template copyrightyear = 2019+ ballotstatus = STU1 excludexml = No excludejson = No excludettl = No excludeMaps = No
template
arefhir.base.template
,hl7.fhir.template
, andfhir.davinci.template
.ig-data/package-list.json
: If present, the user-provided package-list.json will be used. If not present, SUSHI will generate a package-list.json. See the FHIR PackageList documentation.ig-data/input/pagecontent/index.md
: If present, the user-provided index.md will be used as the content for the IG's main page. If not preset, SUSHI will generate this file and insert thedescription
value from thepackage.json
file.
Future versions of SUSHI will allow authors to configure the menu, add custom resources, and add additional content (such as pages and snippets).
After running SUSHI, navigate to the output folder (default name: build
) and run the _updatePublisher
script to download the latest publisher to the input-cache
folder. After the download is completed, run the _genonce
script to initiate the Java-based IG builder process (NOTE: Java must be installed). After the publishing process is complete, open the output/index.html
file in your browser.
For more details about the template-based IG Publisher, see Using the HL7 Templates.
Install or Update
To install or update to the latest version, run the following command:
$ npm install -g fsh-sushi
SUSHI 0.3.0
The SUSHI 0.3.0 release adds several new capabilities and fixes:
- Error messages now report the FSH file name and line number related to the error
- Support for
^
syntax to set metadata values in the underlyingStructureDefinition
/ElementDefinition
- Profiles and extensions can now declare parents that are other FSH-defined profiles/extensions
- Preliminary support for slicing (requires discriminator to be manually set using
^
syntax) - Generated
StructureDefinition
renamesid
/path
for type slices on choice elements (best practice) - Bug Fix: Constraining extension
value[x]
usingonly
keyword now works properly - Bug Fix: Generated
StructureDefinition
differential no longer lists unchanged expanded elements - Bug Fix: Syntax errors are now reported (previous version suppressed them)
To install or update this version, run the following command:
$ npm install -g fsh-sushi
SUSHI 0.2.1
This release includes various bug fixes from issues that were noticed in SUSHI 0.2.0.
SUSHI 0.2.0
This release incorporates support for the Fixed Value Rule. This rule allows a user to fix an element to a specific value using the =
operator.
This also fixes a few bugs in the initial 0.1.0 release.
SUSHI 0.1.0
Introducing SUSHI, the world's first compiler for FHIR Shorthand!
This initial release is intended mainly for the development team in order to test that the basic process works as intended. It is limited in features and lacks basic documentation. Basic documentation, as well as at least one more feature, will be added in the coming days.
Current supported features:
- Defining profiles and extensions
- Parents are limited to FHIR resources and profiles defined as part of FHIR
- Cardinality constraints
- Flags (
MS
,SU
,?!
) - Value Set bindings
- Only (e.g. type) constraints (limited to FHIR resources and profiles defined as part of FHIR)
To install SUSHI, first install Node.js, then run:
npm install -g fsh-sushi
After installing fsh-sushi, the sushi
command should be in your path:
$ sushi --help
Usage: sushi <path-to-fsh-defs> [options]
Options:
-o, --out <out> the path to the output folder (default: "out")
-h, --help output usage information
sushi
should be run against a FSH Tank folder containing a package.json
config file and .fsh
files:
$ sushi sushi-0.1.0-fsh-examples
info: Exported 4 profile(s) and 1 extension(s).
An example FSH Tank zip is attached to this release below. It is for demonstration purposes only and needs to be unzipped before running sushi
against it. Note that the example FSH files may use features of FHIR Shorthand that are not supported in this release of SUSHI.