• Stars
    star
    144
  • Rank 255,590 (Top 6 %)
  • Language
    TypeScript
  • License
    Apache License 2.0
  • Created about 5 years ago
  • Updated 2 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

SUSHI (aka "SUSHI Unshortens Short Hand Inputs") is a reference implementation command-line interpreter/compiler for FHIR Shorthand (FSH).

GitHub Workflow Status npm

SUSHI

SUSHI (aka "SUSHI Unshortens Short Hand Inputs") is a reference implementation command-line interpreter/compiler for FHIR Shorthand (FSH).

FHIR Shorthand (FSH) is a specially-designed language for defining the content of FHIR Implementation Guides (IG). It is simple and compact, with tools to produce Fast Healthcare Interoperability Resources (FHIR) profiles, extensions and implementation guides (IG). Because it is a language, written in text statements, FHIR Shorthand encourages distributed, team-based development using conventional source code control tools such as Github.

For more information about the evolving FSH syntax see the FHIR Shorthand Reference Manual.

Installation for SUSHI Users

SUSHI requires Node.js to be installed on the user's system. Users should install Node.js 18. Although previous versions of Node.js may work, they are not officially supported.

Once Node.js is installed, run the following command to install or update SUSHI:

$ npm install -g fsh-sushi

After installation, the sushi commandline will be available on your path:

$ sushi help

Usage: sushi [options] [command]

Options:
  -v, --version                                        print SUSHI version
  -h, --help                                           display help for command

Commands:
  build [options] [path-to-fsh-project]                build a SUSHI project
  init [options]                                       initialize a SUSHI project
  update-dependencies [options] [path-to-fsh-project]  update FHIR packages in project configuration
  help [command]                                       display help for command

To build a SUSHI project, use the build command:

$ sushi build --help

Usage: sushi build [options] [path-to-fsh-project]

build a SUSHI project

Options:
  -l, --log-level <level>  specify the level of log messages (default: "info") (choices: "error", "warn", "info", "debug")
  -o, --out <out>          the path to the output folder
  -p, --preprocessed       output FSH produced by preprocessing steps
  -r, --require-latest     exit with error if this is not the latest version of SUSHI (default: false)
  -s, --snapshot           generate snapshot in Structure Definition output (default: false)
  -h, --help               display help for command

Additional information:
  [path-to-fsh-project]
    Default: "."
  -o, --out <out>
    Default: "fsh-generated"

See the SUSHI documentation for detailed information on using SUSHI.

IG Generation

SUSHI supports publishing implementation guides 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.

Based on the inputs in FSH files, sushi-config.yaml, and the IG project directory, SUSHI populates the output directory. See the documentation on IG Project with SUSHI for more information on using SUSHI to generate IGs.

Installation for Developers

SUSHI is a TypeScript project. At a minimum, SUSHI requires Node.js to build, test, and run the CLI. Developers should install Node.js 18.

Once Node.js is installed, run the following command from this project's root folder:

$ npm install

NPM tasks

The following NPM tasks are useful in development:

Task Description
build compiles src/**/*.ts files to dist/**/*.js files using the TypeScript compiler (tsc)
build:watch similar to build but automatically builds when changes are detected in src files
build:grammar builds the ANTLR grammar from 'antlr/src/main/antlr' to 'src/import/generated'
test runs all unit tests using Jest
test:watch similar to test, but automatically runs affected tests when changes are detected in src files
lint checks all src files to ensure they follow project code styles and rules
lint:fix fixes lint errors when automatic fixes are available for them
prettier checks all src files to ensure they follow project formatting conventions
prettier:fix fixes prettier errors by rewriting files using project formatting conventions
check runs all the checks performed as part of ci (test, lint, prettier)
regression runs regression against repositories found by FSHFinder
regression:last-year runs regression against repositories found by FSHFinder updated in the last 365 days

To run any of these tasks, use npm run. For example:

$ npm run check

Regression

The regression/cli.ts script can be used to run regression on a set of repos. It's default command, run supports the following options:

Options:
  -a, --a <version>      Baseline version of SUSHI. Can be an NPM version number or tag, "gh:branch" to use a GitHub branch, or "local" to use the local code with
                         ts-node. (default: "gh:master")
  -b, --b <version>      Version of SUSHI under test. Can be an NPM version number or tag, "gh:branch" to use a GitHub branch, or "local" to use the local code with
                         ts-node. (default: "local")
  -l, --lookback <days>  The number of days to lookback in FSHFinder repositories (based on last updated date).
  -c, --count <number>   The maximum number of FSHFinder repositories to test (most recent first).
  -r, --repo <repos...>  One or more repos to test, each specified as a Github {org}/{repo}#{branch} (e.g., HL7/fhir-mCODE-ig#master). This option is not
                         compatible with the lookback, count, or file options.
  -f, --file <file>      A text file for which each line is a GitHub {org}/{repo}#{branch} to test (e.g., HL7/fhir-mCODE-ig#master). This is mostly used for legacy
                         purposes and is not compatible with the lookback, count, or repo arguments.
  -o, --output <folder>  The folder to write regression data to (default: "regression/output")
  -h, --help             display help for command

You can run it via ts-node:

$ ts-node regression/cli.ts run -a 3.0.0 -b local -c 50

You can also run it via npm by adding -- followed by the arguments you wish to pass:

$ npm run regression -- -l 30 -c 50

Another example specifying just two specific repositories to run regression on:

$ npm run regression -- --repo HL7/fhir-mCODE-ig#master HL7/davinci-crd#master

The regression script first installs the -a and -b SUSHIs to temporary folders (except for local, in which case it runs npm install on the local SUSHI). Then for each of the relevant repositories, it does the following:

  1. Downloads the repo source from GitHub, creating two copies (for the base version of SUSHI and the version under test)
  2. Runs the base version of SUSHI against one copy of the repo
  3. Runs the version of SUSHI under test against the other copy of the repo
  4. Compares the results and generates a report of the differences

When the script is complete, it will generate and launch a top-level index file with links to the reports and logs for each repo.

Recommended Development Environment

For the best experience, developers should use Visual Studio Code with the following plugins:

License

Copyright 2019-2022 Health Level Seven International

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

More Repositories

1

fhir.js

JavaScript client for FHIR
JavaScript
425
star
2

sql-on-fhir-v2

This project provides the source for the SQL on FHIR v2.0 Implementation Guide
JavaScript
97
star
3

sql-on-fhir

SQL on FHIR Proposal
78
star
4

documents

Documents that support FHIR - tutorials, presentations, analysis documents + old ballot records
XSLT
68
star
5

auto-ig-builder

Implementation Guide builder
JavaScript
47
star
6

sample-ig

A sample, template-driven implementation guide that provides instruction on creating IGs
HTML
42
star
7

fhir-test-cases

Shared test cases across multiple FHIR reference implementations / validators
HTML
40
star
8

GoFSH

GoFSH is a FHIR Shorthand (FSH) decompiler, able to convert formal FHIR definitions from JSON/XML to FSH.
TypeScript
35
star
9

ig-registry

Registry of published implementation guides
JavaScript
30
star
10

packages

Useful FHIR packages to support implementation: fhir.tx.support and fhir.test.data
CSS
29
star
11

genomics-operations

A public reference implementation of HL7 FHIR Genomics Operations (http://build.fhir.org/ig/HL7/genomics-reporting/operations.html)
Python
28
star
12

Ucum-java

FHIR Java library providing UCUM Services
Java
23
star
13

vscode-fsh

A Visual Studio Code language extension for FHIR Shorthand (FSH)
JavaScript
17
star
14

interversion

Maps and scripts for converting between different FHIR versions
JavaScript
15
star
15

cda-examples-to-fhir

Converting cda examples to fhir
Ruby
13
star
16

ig-guidance

An implementation guide that explains how to create FHIR implementation guides - including examples of how to do various things
Batchfile
13
star
17

fhir-terminology

SPA for FHIR valuesets
CoffeeScript
11
star
18

Gravity-SDOH-Exchange-RI

Reference implementation for the Gravity SDOH IG
Java
11
star
19

FSHOnline

A Web Playground for FHIR Shorthand
JavaScript
8
star
20

FSHSchool

Hugo source files for the FSHSchool site
Batchfile
5
star
21

fhir-candle

fhir-candle - A FHIR development and test server implemented in C#
C#
4
star
22

fhir-impl-guidelines

4
star
23

snomed-ig

Implementation Guide for using SNOMED CT with FHIR
CSS
4
star
24

Gravity-Patient-App-RI

Gravity Your Health Mobile App RI
TypeScript
3
star
25

latest-ig-publisher

Release path for the latest version of the FHIR IG Publisher
HTML
3
star
26

bower-fhir

JavaScript
3
star
27

devices.fhir.org

Source for http://devices.fhir.org
HTML
2
star
28

MADFSH

TypeScript
2
star
29

MimicImporter

Java
2
star
30

FSHOnline-Examples

Jupyter Notebook
2
star
31

fhir-tools-ig

This FHIR Implementation Guide documents the extensions used by the FHIR tooling internally
Batchfile
2
star
32

fhir-package-loader

An NPM module and simple CLI for downloading FHIR packages
TypeScript
1
star
33

r5-invariant-test-cases

Test cases for invariants in FHIR R5
1
star
34

hl7-ig-template

Test HL7 template
HTML
1
star
35

terminology-service-liveness-monitor

C#
1
star
36

test-template

this template is the test template for the FHIR IG publisher
CSS
1
star
37

davinci-pdex-plan-net

Da Vinci Payor Data Exchange - Plan Network (Provider, Organization and Location registry) reference implementation
Ruby
1
star