Skip to content

SHR CLI 6.10.2

Compare
Choose a tag to compare
@cmoesel cmoesel released this 02 Dec 23:13
· 8 commits to master since this release

SHR CLI version 6.10.2 is a significant release that introduces the following changes:

  • Easier installation procedure (PR #6 and #10, details below)
  • New Graph Viewer export (PR #8, details below)
  • Complex extensions w/ inline sub-extensions (PR #9, details below)
  • Human-readable titles (PR #1, more details below)
  • Update FHIR R4 to 4.0.1 (PR #24)
  • Update FHIR STU3 to 3.0.2 (PR #24)
  • Update US Core to 2.0.0 for FHIR STU3 IGs (PR #20)
  • Update text on IG Code Systems page to properly reflect content (PR #22)
  • Remove ES6 Exporter and JSON Schema Exporter (PR #12, details below)
  • Report an error when a new property is introduced without the Property keyword (PR #11)
  • Report an error when an author attempts to use a non-existent namespace (PR #16)
  • Fix filtering issues that resulted in unnecessary profiles and extensions being added to IGs (PR #23)
  • Fix bug in FHIR export that caused unchanged elements to be displayed in differential (PR #4)
  • Fix bug in data dictionary that caused base properties to be listed in some cases instead of substituted properties (PR #7)
  • Fix min cardinality of system and code to 1 when fixing Coding or CodeableConcept (PR #3)
  • Fix incorrect/confusing error messages (PR #9)
  • Update dependencies to address reported vulnerabilities (PR #14 and #25)

Easier installation procedure

This release now supports installation as a global NPM module. This means that users no longer need to clone the GitHub repository or download the release zip file. The new installation procedure is as follows:

Install Node.js LTS edition (version 8, 10, or 12). Once Node.js is installed, run the following command to install SHR-CLI:

$ npm install -g shr-cli

Once it is installed, the shr-cli command should be available on your path.

$ shr-cli --help
Usage: shr-cli <path-to-shr-defs> [options]

Options:
  -l, --log-level <level>  the console log level <fatal,error,warn,info,debug,trace> (default: "info")
  -s, --skip <feature>     skip an export feature <fhir,model-doc,data-dict,graph,all> (default: [])
  -m, --log-mode <mode>    the console log mode <normal,json,off> (default: "normal")
  -o, --out <out>          the path to the output folder (default: "out")
  -c, --config <config>    the name of the config file (default: "config.json")
  -d, --deduplicate        do not show duplicate error messages (default: false)
  -i, --import-cimcore     import CIMCORE files instead of CIMPL (default: false)
  -n, --clean              Save archive of old output directory and perform clean build (default: false)
  -h, --help               output usage information

NOTE: The former approach of downloading and unzipping shr-cli-6.10.2.zip, then running yarn install still works as well, but most users will find the global install much easier.

New Graph Viewer export

Graph Viewer

The new Graph Viewer is an interactive graphical visualization of the primary entries in an Implementation Guide. The Graph Viewer is yet another automatic export included into the CIMPL toolchain.

GraphViewer

To generate an IG with the Graph Viewer included, please ensure that the config file supplied to the CLI has an implementationGuide.includeGraph field which is set to true. Additionally, ensure that there is at least one entry listed as primary for this IG (either through the soon-to-be-deprecated implementationGuide.primarySelectionStrategy field in the config file, or through the contentProfile field in the config file. Otherwise, there will be no Graph Viewer included in the IG.

Once the IG is published, click on the Graph Viewer tab in the top menu. By clicking on one of the primary entries listed on the left of the graph viewer, a user can view the visual representation of this entry's logical model. Hovering over nodes provides a description if available. Clicking on the root node will take the user to the IG page associated with this entry. Branches can be collapsed or expanded by clicking on the small circles connected to them.

Complex extensions w/ inline sub-extensions

In FHIR, complex extensions are represented using an array of sub-extensions. In previous versions of CIMPL, each sub-extension was generated as its own standalone extension and then referenced from the parent complex extension. While this resulted in supreme modularity, it also caused a very large number of extensions to be generated, many of which were only used in the context of the parent complex extension.

Most IG authors using other tools, however, choose to define sub-extensions inline inside the complex extension. This means that standalone sub-extensions don't need to be defined This simplifies the IG by reducing the number of overall extensions and by allowing complex extensions to be more self-contained.

This version of the SHR CLI switches its approach to generate complex extensions with inlined sub-extensions rather than externally defined sub-extensions.

Human-readable titles

When generating titles from DataElements, an algorithm parses the data element name into a more human-readable title. For example, the profile with the name ComprehensiveMetabolic2000SerumOrPlasmaPanel will have the corresponding title: Comprehensive Metabolic 2000 Serum Or Plasma Panel. This affects profiles, extensions, logical models, model doc, and any other exports that use a title.

Remove ES6 Exporter and JSON Schema Exporter

The ES6 exporter was originally intended as a simple way to work with data defined using CIMPL data elements. In practice, however, it turned out that the value gained did not justify the effort required to develop and maintain it. In particular, serialization and deserialization to/from FHIR proved to be quite difficult and error-prone. This being the case, and given that no external users were using the ES6 class generation, the team decided to remove support for it so that we can focus on other priorities. Since the JSON Schema exports were primarily used by the ES6 classes, this capability was also removed.

NOTE: Directory structure has changed. If you are not using the new global install method, then download shr-cli-6.10.2.zip for an experience consistent with previous SHR CLI releases.