Skip to content

SUSHI 2.2.0

Compare
Choose a tag to compare
@cmoesel cmoesel released this 12 Nov 20:39
· 296 commits to master since this release
24cb643

SUSHI 2.2.0 includes the following enhancements and bug fixes:

  • Allow authors to control if instances should serialize the meta.profile and/or id (#844) (details below)
  • Allow authors to provide instances of logical models (#941) (details below)
  • Allow authors to insert RuleSets at concept paths in CodeSystem definitions (#942)
  • Allow authors to specify mappings for logical models and custom resources (#940)
  • Allow authors to use string values for all ValueSet filter operators (#936)
  • Provide more details and optional configurations in sushi --init config file (#944)
  • Limited support for validating codes defined in local code systems (#595)
  • Limited support for validating slicing logic in profiles (#885, #952)
  • Clarify error message regarding attempts to "widen" cardinality (#943)
  • Fix id generation bug on manually sliced choice elements (#927)
  • Fix dependency loading bug for dependence with version "current" (#951)

Allow Authors to Control if Instances Should Serialize the meta.profile and/or id

By default, SUSHI always generates an instance id and the meta.profile property (for instances of profiles). Now authors can control this by specifying an instanceOptions configuration property in sushi-config.yaml. This configuration allows setMetaProfile and setId sub-properties.

The setMetaProfile value controls whether or not meta.profile is set on generated instances. It can have the following values:

  • always: Set meta.profile for all Instances of profiles (default)
  • never: Do not set meta.profile on any Instances
  • inline-only: Set meta.profile for only Instances of profiles with Usage set to #inline
  • standalone-only: Set meta.profile for only Instances of profiles where Usage is any value other than #inline

The setId value controls whether or not id is set on generated instances. It can have the following values:

  • always: Set id for all Instances (default)
  • standalone-only: Set id for only Instances where Usage is any value other than #inline

The setId flag can't have an inline-only or never option, because the IG Publisher requires ids for non-inline instances.

Allow Authors to Provide Instances of Logical Models

A recent version of the IG Publisher added support for including instances of logical models as binary resources. This feature was announced and discussed in a Logical Model Examples thread on chat.fhir.org. The basic steps an author needs to take in order to include logical model examples in a SUSHI project are:

  1. Add the example to the input/resources or input/examples folder
    a. The file name of the example should be Binary-{id}.json or Binary-{id}.xml (substituting {id} for the real id)
  2. Add an entry for the example in the sushi-config.yaml resources property
    a. Specify a name
    b. Specify exampleCanonical pointing to the canonical of your logical model
    c. Add an extension w/ the proper resource format (application/fhir+json or application/xml)

For example, given the following simple logical model definition in an IG w/ IG canonical root http://example.org:

Logical: MyLM
Id: MyLM
Title: "My LM"
Description: "This is mine"
* important 1..1 SU boolean "Is this resource important"

Create the file input/examples/Binary-my-logical-example.json:

{
  "resourceType": "MyLM",
  "id": "my-logical-example",
  "important": true
}

And add the following in your sushi-config.yaml:

resources:
  Binary/my-logical-example:
    extension:
      - url: http://hl7.org/fhir/StructureDefinition/implementationguide-resource-format
        valueCode: application/fhir+json
    name: Example of LM
    exampleCanonical: http://example.org/StructureDefinition/MyLM

This will result in your logical model example being listed and displayed as a proper example of the logical model.

NOTE: This does not allow/support using the Instance keyword for creating examples of logical models. Authors must created the example as raw JSON or XML. Support for the Instance keyword may come in future versions of SUSHI.

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

To install or update to this release, run the following command:

$ npm install -g fsh-sushi

To revert to a previous stable release, run a command like the following:

$ npm install -g [email protected]

To check or confirm what version of SUSHI you have installed, you can run the following command:

$ sushi -v