2.3.1 • Published 16 days ago

gofsh v2.3.1

Weekly downloads
9
License
Apache-2.0
Repository
github
Last release
16 days ago

GoFSH

GoFSH is a FHIR Shorthand (FSH) decompiler, able to convert formal FHIR definitions from JSON to 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 GoFSH Users

GoFSH 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 GoFSH:

$ npm install -g gofsh

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

$ gofsh --help

Usage: goFSH [path-to-fhir-resources] [options]

Options:
  -o, --out <out>                    the path to the output folder
  -l, --log-level <level>            specify the level of log messages: error, warn, info (default), debug
  -d, --dependency <dependency...>   specify dependencies to be loaded using format dependencyId@version (FHIR R4 included by default)
  -s, --style <style>                specify how the output is organized into files: file-per-definition (default), group-by-fsh-type, group-by-profile, single-file
  -f, --fshing-trip                  run SUSHI on the output of GoFSH and generate a comparison of the round trip results
  -i, --installed-sushi              use the locally installed version of SUSHI when generating comparisons with the "-f" option
  -t, --file-type <type>             specify which file types GoFSH should accept as input: json-only (default), xml-only, json-and-xml
  --indent                           output FSH with indented rules using context paths
  --meta-profile <mode>              specify how meta.profile on Instances should be applied to the InstanceOf keyword: only-one (default), first, none
  -a, --alias-file <alias-filePath>  specify an existing FSH file containing aliases to be loaded.
  --no-alias                         output FSH without generating Aliases
  -u, --useFHIRVersion <fhirVersion> specify which FHIR version to use when it cannot be inferred
  -v, --version                      print goFSH version
  -h, --help                         display help for command

Installation for Developers

GoFSH is a TypeScript project. At a minimum, GoFSH requires Node.js to build, test, and run the CLI. Developers 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 from this project's root folder:

$ npm install

NPM tasks

The following NPM tasks are useful in development:

TaskDescription
buildcompiles src/**/*.ts files to dist/**/*.js files using the TypeScript compiler (tsc)
testruns all unit tests using Jest
test:watchsimilar to test, but automatically runs affected tests when changes are detected in src files
coveragelaunches your browser to display the test coverage report
lintchecks all src files to ensure they follow project code styles and rules
lint:fixfixes lint errors when automatic fixes are available for them
prettierchecks all src files to ensure they follow project formatting conventions
prettier:fixfixes prettier errors by rewriting files using project formatting conventions
checkruns all the checks performed as part of ci (test, lint, prettier)
prepareruns the build task before this project is packed or published
prepublishOnlyruns the check task before this project is published

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

$ npm run check

Recommended Development Environment

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

License

Copyright 2020 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.

2.3.1

16 days ago

2.3.0

3 months ago

2.1.2

7 months ago

2.2.0

7 months ago

2.1.1

8 months ago

2.1.0

8 months ago

2.0.1

10 months ago

2.0.0

11 months ago

1.6.5

1 year ago

1.6.4

1 year ago

1.6.3

2 years ago

1.6.2

2 years ago

1.6.1

2 years ago

1.6.0

2 years ago

1.5.0

2 years ago

1.4.3

2 years ago

1.4.2

2 years ago

1.4.1

2 years ago

1.3.2

3 years ago

1.3.1

3 years ago

1.3.0

3 years ago

1.2.0

3 years ago

1.1.0

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago

0.4.0

3 years ago

0.3.0

4 years ago

0.2.0

4 years ago

0.1.0

4 years ago