SUSHI 0.11.2 contains the following enhancements and bug fixes:
- Adds support for caret rules on the root element using the
.path (details below)(#277) - Adds do-not-edit warning to generated IG files where allowed (details below) (#309)
- Adds new
SUSHI-GENERATED-FILES.mdfile in IG output (details below) - Adds user-friendly results summary at end of console output (details below)
- Enforces requirement that invariant names be valid FHIR ids (#290)
- Fixes issue w/ sparse differentials and slice paths (#293)
- Fixes duplicate entries for instances used in inline references (#333)
- Fixes issue w/ single-line block comments (#155)
- Updates various application dependencies to their more recent versions
Root Element Path
A simple dot (.) can be used to reference the root element in path-based rules. Prior to this, it was not possible to access the root element in FSH. This capability is most useful for caret rules, e.g.:
Extension: MyExtension
Id: my-extension
* . ^short = "My Extension"
// ...
Do-Not-Edit Warnings in Generated Files
To prevent users from mistakenly editing generated output files (rather than the corresponding input files), SUSHI now inserts comments on generated or copied .xml, .md, .ini, and script files. Currently, this applies only to files related to IG configuration, not FHIR resources or instances. .json files are an exception, as standard JSON does not support comments.
Example (ig.ini):
[IG]
; **************************************************************************************************
; * WARNING: DO NOT EDIT THIS FILE *
; * *
; * This file is generated by SUSHI. Any edits you make to this file will be overwritten. *
; * *
; * This ig.ini was generated by merging values from ig-data/ig.ini with a default set of values, *
; * including values inferred from package.json (name, license, version). To affect the generation *
; * of this file, edit values in the ig-data/ig.ini input file. *
; **************************************************************************************************
ig = input/ImplementationGuide-hl7.fhir.us.mcode.json
; ... etc.SUSHI-GENERATED-FILES.md
SUSHI now creates a file named SUSHI-GENERATED-FILES.md with a table showing IG config files that were generated or copied and the original files that were used to generate or copy them. This gives users more insight into SUSHI's IG generation.
Example excerpt:
| SUSHI-GENERATED FILE | ACTION | INPUT FILE(S) |
| ------------------------------------------------ | --------- | ------------------------------------------------------------------- |
| _gencontinuous.bat | generated | |
| _gencontinuous.sh | generated | |
| _genonce.bat | generated | |
| _genonce.sh | generated | |
| _updatePublisher.bat | generated | |
| _updatePublisher.sh | generated | |
| ig.ini | generated | ../ig-data/ig.ini, ../package.json |
| input/ImplementationGuide-hl7.fhir.us.mcode.json | generated | ../ig-data/ig.ini, ../package.json, {all input resources and pages} |
| input/ignoreWarnings.txt | copied | ../ig-data/input/ignoreWarnings.txt |
| input/includes/menu.xml | copied | ../ig-data/input/includes/menu.xml |
| input/pagecontent/change_log.md | copied | ../ig-data/input/pagecontent/3_change_log.md |
| input/pagecontent/index.md | copied | ../ig-data/input/pagecontent/index.md |
| package-list.json | copied | ../ig-data/package-list.json |
| package.json | copied | ../package.json |
| ... etc. | | |User-Friendly Results Summary
When SUSHI completes, it now prints a summary that is easier to understand at a glance. For consoles that support it, the summary will be color-coded green, orange, or red depending on if your build is clean, has warnings, or has errors. Just for fun, it also gives you a random fish-related pun summarizing the status of your results.
Full Documentation
For additional documentation, refer to the FSH language reference.
Install or Update
To install or update to the latest version, run the following command:
$ npm install -g fsh-sushi
