npm fsh-sushi 0.5.0
SUSHI 0.5.0

latest releases: 3.17.0, 3.16.5, 3.16.4...
6 years ago

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

Don't miss a new fsh-sushi release

NewReleases is sending notifications on new releases.