Smile CDR v2024.05.PRE
On this page:

42.2.1smileutil: Create FHIR Package

 

The create-package command assembles FHIR resources into an NPM package following the FHIR NPM Package Spec. This specification is used to create packages that can be loaded into the Smile CDR Package Registry. Packages can also be used to supply Pre-Seed Resources to be automatically installed into a FHIR Repository.

42.2.2Usage

 
bin/smileutil create-package --fhir-version R4 --name com.example.ig --version 1.0.1 --include-package "/path/to/resources/*.json"

In the example above, a package is being created with the name com.example.ig and the version 1.0.1. The package includes all files matching path /path/to/resources/*.json. Note that we enclose the path in quotes so that the CLI processor will correctly handle the wildcard (i.e. *).

42.2.3Options

 
  • --fhir-version [version] – This is the FHIR version that will be stored as metadata in the package manifest. Valid values include DSTU3, R4, R5, etc.
  • --name [package name] – This is the NPM name for the package. In NPM packages, the name is used as a unique identifier and should be machine processable. By convension, reverse domain name style is used.
  • --version [version] – The version for the package. FHIR Packages use SemVer versioning.
  • --include-package [pathspec](optional/repeating) If set, this option specifies a path specification for resources to include in the package folder. This argument may be repeated to specify multiple paths. Path specs must be in the form /path/to/file/*.ext.
  • --include-example [pathspec](optional/repeating) If set, this option specifies a path specification for resources to include in the example folder. Example resources are included in the package but will not be made accessible to the validator when the package is installed. This argument may be repeated to specify multiple paths. Path specs must be in the form /path/to/file/*.ext.
  • --dependency [name:version](optional/repeating) If set, this option specified the Package Name and Version of a package that the package being created is dependant on. Specifying dependencies adds them as an entry in the package manifest. The value should be in the form name:version.