Skip to main content

Crate haste_fhir_package

Crate haste_fhir_package 

Source
Expand description

FHIR NPM packages, the form implementation guides are published in: reading a package tarball (read) and fetching one from a package registry such as packages.fhir.org (resolve_version, download).

A package is a gzipped tarball with a package/ folder holding package.json, the conformance resources as one JSON file each, and the examples in package/example/. See https://hl7.org/fhir/packages.html.

Structs§

Directories
Limits
Bounds on what reading one package may cost. A tarball is untrusted input, and a small gzip can expand to far more than it weighs.
Manifest
A package’s package.json, as far as installing it needs.
Package
A package read from its tarball.
PackageFile
A JSON file in a package.
PackageSpec
A package to install, named the way registries and package.json dependencies name one: name@version, name#version or name alone for the latest version. A version may end in .x to take the latest match.

Enums§

PackageError
Why a package could not be read or fetched.

Functions§

download
Downloads name at version from registry, refusing a tarball larger than max_bytes.
pack
Packs a package folder (one holding package.json) into a gzipped tarball laid out as npm packs one, under package/. Only what read uses is packed: the JSON files directly in the folder and in its example folder.
read
Reads a package tarball, gzipped (.tgz, as registries serve them) or not.
resolve_version
The version of name to install: requested when it names one exactly, else the registry’s latest (no version, or latest) or newest match (6.1.x).
valid_name
Package names are lowercase in practice (hl7.fhir.us.core); any case is accepted here. They become a URL path segment, so nothing else is.
valid_version
A semver-like version (6.1.0, 2.0.0-ballot, 6.1.x). It becomes a URL path segment, so nothing else is accepted.