CodeSystem
Tooling support
Snow Owl TS differentiates between certain "families" (toolings) of code system resources. Each tooling uses an internal representation for its terminology components that can be searched and edited more effectively. These components are converted to a FHIR-compatible form when a read or search interaction happens, and back when new a CodeSystem resource is created via the FHIR API (or an existing resource receives an update).
SNOMED CT
SNOMED CT and its extensions are effectively read-only from the FHIR API's point of view – they can not be created via a create interaction, nor can content be loaded or updated from an RF2 archive. Only Snow Owl's native API has provisions for doing so.
SNOMED CT code system URLs follow the conventions described in the SNOMED CT URI Standard.
As SNOMED CT code systems contain a considerable amount of concepts, resource responses for this tooling do not include a concept array:
GET /snowowl/fhir/CodeSystem/SNOMEDCT-US?_pretty=true
[Response headers]
Content-Type: application/fhir+xml
<CodeSystem xmlns="http://hl7.org/fhir">
<id value="SNOMEDCT-US"/>
<meta>
<lastUpdated value="2023-10-18T01:52:16.04Z"/>
</meta>
<language value="en"/>
...
<url value="http://snomed.info/sct"/>
<version value="http://snomed.info/sct/731000124108"/>
<valueSet value="http://snomed.info/sct/731000124108?fhir_vs"/>
...
<name value="SNOMEDCT-US"/>
<title value="SNOMED CT US Extension"/>
<status value="active"/>
<publisher value="NIH - National Library of Medicine"/>
...
<content value="complete"/>
<count value="513765"/>
...All SNOMED CT resources behave like editions, which means lookup operations succeed for any concept that can be found within eg. the International Edition's content, or in any other extension the resource depends on:
Filters
The following filters are supported in value set compose statements, should they reference a SNOMED CT code system:
expression
=
ECL expression
Matches concepts using the Expression Constraint Language
expressions
=
true or false
Specifies whether Post-Coordinated Expressions should be included in the filtered result set
concept
is-a
SCTID (any concept)
Matches the descendants of the specified parent concept
concept
in
SCTID (reference set identifier)
Matches concepts that are members of the specified reference set
Properties
All SNOMED CT relationship types are supported and can be returned along with concept data if requested. In addition to these (and the common properties that are applicable to all code systems), Snow Owl can also return a set of SNOMED CT-specific concept properties.
A single example for a type concept property and all SNOMED CT-specific properties are listed in the table below:
288556008
code
The SCTID of destination concepts on relationships with a typeId value of 288556008|Before|
inactive
boolean
Inactive status based on the concept's active RF2 property (its inverse is returned)
moduleId
code
The concept's moduleId RF2 property
effectiveTime
string
The concept's effectiveTime RF2 property
(in yyyyMMdd format)
sufficientlyDefined
boolean
A boolean value derived from the concept's definitionStatusId RF2 property(set to true if the original value is 900000000000073002)
Use the following values if you need to refer to these properties by URI instead of code:
288556008
http://snomed.info/id/288556008
inactive
http://snomed.info/field/Concept.inactive
moduleId
http://snomed.info/field/Concept.moduleId
effectiveTime
http://snomed.info/field/Concept.effectiveTime
sufficientlyDefined
http://snomed.info/field/Concept.sufficientlyDefined
ICD-10 
ICD-10 and its national variants can be imported from XML release files using the ClaML format in the paid edition of Snow Owl, however this functionality is not exposed via FHIR requests; neither can such a code system be created using a create interaction.
ICD-10 URLs are typically following the naming convention described in HL7's FHIR specification: http://hl7.org/fhir/sid/icd-10-[x], where the -[x] suffix is only included if it is a national variant. One exception is the German Modification where the publisher uses a different value.
Similarly to SNOMED CT resources, the concept array remains unpopulated in the response. ICD-10 concepts can still participate in lookup, validation or subsumption testing operations.
LOINC 
In the paid edition the official release archive can be used to populate the code system's contents. It is available over the FHIR API in a read-only fashion as the previous two toolings.
Local Code Systems (LCS) 
In Snow Owl's paid edition FHIR code system resources submitted as part of a create or update interaction (if no resource existed with the same ID earlier) become members of the LCS tooling. Custom properties may be defined when submitting the creation request and added to concepts of the code system.
The code system URL can be set upon creation and is checked for uniqueness.
The concept array is fully populated in LCS responses and content is set to complete.
Properties
User-defined properties listed in the top-level property elements of the resource get included in the LCS schema. The cardinality is set to [0..*], which means concepts can have any number of properties associated with the same type code.
Interactions
read (instance)
GET requests that include the code system identifier as the final path segment return the current (non-versioned) resource state:
Common parameters like _format, _summary, _elements and _pretty are also applicable. These are described on the previous page: Common request parameters
vread (instance)
To retrieve a single historical version of the resource, use the following GET request:
Notable differences between a versioned and the current representation are marked with a comment in the code block above:
If a FHIR URL override value was set in resource settings at the time the version was created, it will be reflected in the response
Similarly, if the resource was configured to use its native
urlvalue as the FHIR version at the time it was created, it will also be reflected in the responseThe effective time appears as the value of
dateThe effective time also appears as the value of
effectivePeriod.startOther properties like concept count or actual terminology content will reflect the state of the resource at version creation time
The version path parameter accepts the following values:
HEAD
Returns the current resource representation
LATEST
Returns the most recent historical revision
Any other valid version identifier
Returns the specified historical revision
HEAD is implemented as a fallback to the regular resource read operation, while LATEST selects the latest historical version based on version timestamps.
history (instance)
GET requests that include a resource identifier with a _history path segment added to the end return a FHIR Bundle of type history, containing historical revisions of the specified resource:
Supported search parameters are:
_count
Limits the number of returned history entries (50 by default)
_since
Returns revisions created on or after the supplied ISO-8601 instant
_at
Returns revisions created on or before the supplied ISO-8601 instant
Note that while the specification allows a wider set of comparisons for date(time) inputs, Snow Owl currently only supports instant values without a comparison operator prefix.
Allowed values for the _sort parameter:
-_lastUpdated
Newest revisions first (default)
_lastUpdated
Oldest revisions first
none
Does not effectively override the default sort
Any other value
400 Bad Request is returned
update (instance)
PUT requests that include a resource identifier update an existing (local) code system or create a new instance:
The response code is 201 Created if the resource did not exist previously, and the URL is included in the Location response header. Existing code systems are updated and a 200 OK response is returned instead.
The actual content of Location will differ depending on whether a versioned resource is sent in as the input or a draft one. The former will generate a vread interaction with the version value included, while the latter will be a URL that can be used to issue a read interaction on the most recent content.
If an error occurs during the update, a 400 Bad Request response with an OperationOutcome resource as the response body is emitted instead.
The following request headers can be used to control certain aspects of the commit process:
X-Effective-Date
The effective date to use if a version identifier is present in the resource without a corresponding date element (defaults to the current date if neither the resource nor this header specifies a value)
X-Author
Sets the user identifier that the commit should be attributed to (defaults to the authenticated user)
X-Owner
Sets the owner of the resource, for access control purposes in external systems (defaults to the author or the authenticated user if the former is not set)
X-Owner-Profile
Sets the human-readable name of the owner of the resource, for presentation purposes in external systems (optional)
X-Bundle-Id
Specifies the parent bundle's resource identifier (defaults to the root bundle if not set)
delete (instance)
A DELETE request removes an existing code system:
Successful removal of a code system resource results in a 204 No Content response. Code systems that have been published can not be removed without adding the force=true query parameter to signal a forced deletion – this option in turn is only available to administrators.
create (type)
POST requests are very similar to the instance-level update interactions with the following important difference: the identifier included in the request body is ignored and a new, random one is generated from scratch. The request path should also omit the path segments corresponding to the resource identifier:
The response code is 201 Created if the interaction is successful and a new resource has been created, 200 OK if an update was performed.
As mentioned above, the request URL that can be used in e.g. follow-up read or vread interactions is included in the Location response header; the latter is provided if the input resource also contained version information.
search (type)
GET requests targeting the endpoint corresponding to the resource type return all code systems that satisfy the specified search criteria, in the form of query parameters. The following example uses the count summary mode to determine the total number of code systems registered in the system, without returning any of the matches:
The following search parameters are supported:
_id
Matches code systems by logical identifier
name
Matches code systems by name (in Snow Owl this is set to the logical identifier)
title
Matches code systems by title (Snow Owl uses exact, phrase and prefix matching during its lexical search activities)
url
Matches code systems by their assigned url value
version
Matches code systems by their version value
status
Matches code systems by resource status (e.g. draft, active, etc.)
Operations
$lookup
Both GET as well as POST HTTP methods are supported. Concepts are queried based on code, version, system or Coding. Designations are included as part of the response as well as supported concept properties when requested. Date parameters are not supported.
The following example request retrieves details about the SNOMED CT concept 128927009|Procedure by method|, including properties "inactive" and "Method" (a SNOMED CT attribute), using the latest version of the code system:
$validate-code
Both GET as well as POST HTTP methods are supported.
The example request below validates that 128927009|Procedure by method| is present in SNOMED CT, selecting the resource to use for validation using a versioned identifier (an instance-level invocation):
$subsumes
Both GET as well as POST HTTP methods are supported.
Subsumption testing is supported for all terminologies, including SNOMED CT. The example uses the un-versioned SNOMED CT code system (via the URL in the system query parameter) to determine whether 409822003|Domain Bacteria| is an ancestor of 112283007|Escherichia coli| (type-level invocation):
The response is positive (and encouraging). Changing the role of the two codes gives us a subsumed-by result instead.
$set-include-in-capabilities (instance)
The operation is used to add or remove a code system (or version) to/from the TerminologyCapabilities.codeSystem list shown in Metadata.
Use this operation when:
You want Snow Owl to advertise an existing code system not yet appearing in the terminology list
You want to expose another version under an existing code system entry
"In" parameters
"Out" parameters
result
1..1
Indicates whether terminology capability resource content changed as a result of the operation (failures are typically reported as OperationOutcome resources, in more detail)
Both GET and POST methods are accepted. In the former case the input value can be supplied as a query parameter:
Once registered, subsequent responses should include the selected code system in TerminologyCapabilities:
$set-as-default (instance)
When multiple independent code system resources share the same FHIR URL (such as in the case of SNOMED CT or LOINC), individual Editions/Extensions will be presented as versions of the same entry in TerminologyCapabilities.codeSystem. This operation is used to control where requests are routed to when they only mention the common URL, and has no effect on the outcome when clients specify an appropriate "version" parameter for their request.
"In" parameters
None required.
"Out" parameters
result
1..1
Indicates whether terminology capability resource content changed as a result of the operation (failures are typically reported as OperationOutcome resources, in more detail)
As an example, to use the Swedish extension for operations where only system is set, issue the following request:
A call to $lookup should now resolve Swedish concepts by default:
Last updated