kaitenzushi
v0.0.7
Published
A build system for FHIR Shorthand
Downloads
16
Readme
Kaitenzushi (回転寿司) is a build system for FHIR Shorthand.
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
| Parameter | Alias | Description | Default value | Required | Usage example | |----------------|-------|-----------------------------------------------|---------------|----------|----------------------------------------------| | --inputPath | -i | Path to folder or single file. | None | True | npx kaitenzushi -i fsh | | --outputPath | -o | Place to keep results. | /artifacts | False | npx kaitenzushi -i fsh -o results | | --resourceType | -r | Target resource to translate. | TestScript | False | npx kaitenzushi -i fsh -r Patient | | --target | -t | Extension of the result. Can be yaml or json. | YAML | False | npx kaitenzushi -i fsh -t JSON | | --dependency | -d | Link to GitHub repo with FSH files. | None | False | npx kaitenzushi -i fsh -t <reps/github/repo> |
How to use as a local package
General
- ⚙️ Install dependencies
yarn install
For the test you implementation FSH -> JSON
- 🐟 Add your FSH file to the /fsh folder;
- 🔥 Add your FHIR file in JSON format to the /fhir folder (the expected result of the transform from FSH to FHIR);
- 🧪 Run tests
yarn test
To convert files FSH -> YAML/JSON
- Base translate
yarn fshToFHIR -i path/to/source/or/single/file
- Translate with all parameters
yarn fshToFHIR -i path/to/source/or/single/file -o path/to/output/folder -r TestScript -e yaml
Notes
- The FSH file should have a similar name to the JSON file (ex: ./fsh/TestScript_test.fsh => ./fhir/TestScript_test.json);
- 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
- 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.
- RuleSet: Rule sets provide the ability to define a group of rules as an independent entity.
- SUSHI: SUSHI (SUSHI Unshortens ShortHand Inputs) is a FSH compiler. SUSHI converts FSH language to FHIR artifacts.
- TestScript: A structured set of tests against a FHIR server or client implementation to determine compliance against the FHIR specification.
- 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.