0.0.7 • Published 7 months ago

kaitenzushi v0.0.7

Weekly downloads
-
License
MIT
Repository
-
Last release
7 months ago

Kaitenzushi (回転寿司) is a build system for FHIR Shorthand.

Kaitenzushi banner

Motivation

For research purposes...

As developers of healthcare applications, we manipulate FHIR resources every day, which often have a large number of rows. FSH allows us to reduce the amount of code and thanks to tools such as RuleSet, we can create reusable pieces in FHIR-first applications. We want to find a way to write simple, maintainable FHIR resources for our projects.

The current main goal is to understand how FSH could help us to create comfortable for developers TestScript resources.

How to use it as a package

npx kaitenzushi -i <path/to/sources> -o <path/to/output/dir> -r <FHIR resource name>

Available Parameters

ParameterAliasDescriptionDefault valueRequiredUsage example
--inputPath-iPath to folder or single file.NoneTruenpx kaitenzushi -i fsh
--outputPath-oPlace to keep results./artifactsFalsenpx kaitenzushi -i fsh -o results
--resourceType-rTarget resource to translate.TestScriptFalsenpx kaitenzushi -i fsh -r Patient
--target-tExtension of the result. Can be yaml or json.YAMLFalsenpx kaitenzushi -i fsh -t JSON
--dependency-dLink to GitHub repo with FSH files.NoneFalsenpx kaitenzushi -i fsh -t <reps/github/repo>

How to use as a local package

General

  1. ⚙️ Install dependencies
    yarn install

For the test you implementation FSH -> JSON

  1. 🐟 Add your FSH file to the /fsh folder;
  2. 🔥 Add your FHIR file in JSON format to the /fhir folder (the expected result of the transform from FSH to FHIR);
  3. 🧪 Run tests
    yarn test

To convert files FSH -> YAML/JSON

  1. Base translate
    yarn fshToFHIR -i path/to/source/or/single/file
  2. Translate with all parameters
    yarn fshToFHIR -i path/to/source/or/single/file -o path/to/output/folder -r TestScript -e yaml

Notes

  1. The FSH file should have a similar name to the JSON file (ex: ./fsh/TestScript_test.fsh => ./fhir/TestScript_test.json);
  2. File names should include a prefix with target resourceType (Because in some cases to generate an FHIR resource you should create a few FHIR artifacts and the SUSHI compilator will return back a list of the resources. We should mark a target resource for test purposes);

Dictionary

  1. FSH: FHIR Shorthand (FSH) is a domain-specific language for defining the contents of FHIR Implementation Guides (IG). FSH can be created and updated using any text editor. Because it is text, it enables distributed, team-based development using source code control tools such as GitHub.
  2. RuleSet: Rule sets provide the ability to define a group of rules as an independent entity.
  3. SUSHI: SUSHI (SUSHI Unshortens ShortHand Inputs) is a FSH compiler. SUSHI converts FSH language to FHIR artifacts.
  4. TestScript: A structured set of tests against a FHIR server or client implementation to determine compliance against the FHIR specification.
  5. Kaitenzushi: Kaitenzushi (回転寿司), also known as conveyor belt sushi or sushi train, is a convenient and affordable type of sushi restaurant characterized by the conveyor belt that winds through the restaurant. The conveyor belt carries plates of sushi past the diners, who can take whatever they wish. The price per plate starts around 100 yen. Kaitenzushi tend to be considerably cheaper than conventional sushi-ya.

References

  1. FSHschool;
  2. TestScript resource FHIR documentation;
  3. RuleSet description FHIR documentation.