Skip to content
For the complete documentation index, see llms.txt. This page is also available as Markdown.

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:

  • CodeSystem

  • ValueSet

  • ConceptMap

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*.json

The loader reads these properties from package.json:

  • name

  • version

  • fhir-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:

  1. CodeSystem

  2. ValueSet

  3. ConceptMap

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:

Mode
Request input
Package source

FHIR JSON or XML Parameters resource

Package name, version and registry as indicated by request parameters

Multipart form-data with attachment

Archive uploaded as part of the request

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
Type
Description

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:

Header
Description

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/sct

  • LOINC with URL http://loinc.org

  • ICD-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.json descriptor is missing;

  • package.json has no fhir-version-list property;

  • fhir-version-list contains more than one value;

  • the package contains no recognized CodeSystem, ValueSet, or ConceptMap files;

  • the downloaded package name or version does 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