Content management
FHIR Packages
Snow Owl implements the $load-package operation to import terminology resources from a FHIR NPM package. A package can be downloaded from a registry or uploaded as a local .tgz archive.
The operation currently supports the same terminology-related resource types as individual requests mentioned elsewhere in the documentation:
CodeSystemValueSetConceptMap
All other package content is ignored.
Package structure
The input must be a gzip-compressed tar archive (.tgz), that follows the FHIR package layout:
package/
├─── package.json
├─── CodeSystem*.json
├─── ValueSet*.json
└─── ConceptMap*.jsonThe loader reads these properties from package.json:
nameversionfhir-version-list
fhir-version-list must contain exactly one FHIR version. Packages that omit the property or declare multiple FHIR versions are rejected.
The loader processes resources in the following order:
CodeSystemValueSetConceptMap
This allows value sets and concept maps to refer to resources imported before them in the same request.
Operations
$load-package
The request accepts local uploads as well as registry locations to download from, depending on the content type:
FHIR JSON or XML Parameters resource
Package name, version and registry as indicated by request parameters
The operation responds with a Parameters resource to indicate success or failure.
Load from a registry
If no registry parameter is added, Snow Owl uses https://packages.fhir.org by default.
The final artifact URL is assembled from the registry and package coordinates. In the example above, the package hl7.fhir.r4.core version 4.0.1 will be requested from https://packages.fhir.org/hl7.fhir.r4.core/4.0.1.
The implementation considers the following operation parameters:
name
string
Package name
version
string
Package version
registry
URI
Registry base URL
resourceUrl
URI (repeatable)
Restrict import to resources where the canonical URL matches an entry in the list
If a downloaded package declares a name or version different from the requested values, the request fails.
Upload a package
The query parameter resourceUrl may be supplied multiple times to select resources by canonical URL. If omitted, all recognized resources are considered for import.
The uploaded archive as form parameter file is stored temporarily as an attachment, copied to Snow Owl's fhir-packages data directory for processing, and is removed at the end of the import process.
Common request headers
Both modes support the following Snow Owl headers:
X-Author
User identifier recorded as the change author
X-Owner
Resource owner; if omitted, the normal Snow Owl owner fallback behavior applies
X-Owner-Profile-Name
User profile name stored in resource settings for client use
X-Effective-Date
Default effective date used when an imported resource has a version but no corresponding effective date; format: YYYY-MM-DD
X-Bundle-Id
Parent bundle identifier; defaults to the root bundle if omitted
Resources deliberately skipped
The FHIR package loader skips the following code systems because Snow Owl treats them as terminology standards with dedicated support elsewhere:
SNOMED CT with URL
http://snomed.info/sctLOINC with URL
http://loinc.orgICD-10 and variants with URLs beginning with
http://hl7.org/fhir/sid/icd-10
Import behavior
A package may declare a code system as content = complete while containing no concepts. To tolerate this inconsistency, the loader changes its content property to not-present before importing the resource.
Value sets are imported after code systems. Value sets where the required terminology references can not be resolved will be skipped (and logged).
Concept maps are imported after code systems and value sets. If referenced source or target code systems cannot be resolved, the affected concept map is skipped and the failure is logged.
If an imported resource does not declare its own version property, Snow Owl assigns the package version value from package.json.
Response
A successful request returns a FHIR Parameters resource indicating the number of resources that were imported successfully (i.e. not skipped):
Failure cases
The operation returns a 400 Bad Request error when, among other cases:
neither a package upload nor package coordinates are provided;
both an uploaded package and registry package coordinates are provided;
the package cannot be downloaded from the selected registry;
the input is not a readable archive;
package/package.jsondescriptor is missing;package.jsonhas nofhir-version-listproperty;fhir-version-listcontains more than one value;the package contains no recognized
CodeSystem,ValueSet, orConceptMapfiles;the downloaded package
nameorversiondoes not match the requested package information.
Where possible, resource-level import failures are logged and the affected resource is skipped, which allows importing the rest of the package's contents.
Last updated