Value Set

Ontoserver supports the $expand and $validate-code operations for both explicit and implicit value sets.

Expand

A ValueSet resource can be expanded using a GET or POST request to a URL such as:

http://ontoserver.base.url/fhir/ValueSet/[id]/$expand (instance level)

http://ontoserver.base.url/fhir/ValueSet/$expand (type-level)

The value set to be expanded in a type-level request is identified by the url parameter or the context if using a GET-style request. Potential values for these parameters are explained in detail in the following sections.

Alternatively, if a type-level request is sent using POST, the value set to be expanded can be specified either using the url or context parameter in a Parameters object of the POST body, or as a JSON/XML resource, in the valueSet parameter of a Parameters object (if valueSet is the only parameter being provided to the expand request, the JSON/XML resource may be passed as the POST body without a surrounding Parameters object).

A value set expansion can also be controlled using the following parameters:

Parameter Type Description
filter string A text filter that is applied to restrict the codes that are returned (this is useful in a UI context). Ontoserver implements a multi-prefix match scoring algorithm.
count integer Paging support - where to start if a subset is desired (default = 0). This refers to items, not pages, i.e. offset = 2 means that the second matching record will be returned, not the second page.
offset integer Paging support - how many codes should be provided in a partial view. If count = 0, the client is asking how large the expansion is.
activeOnly boolean Whether or not inactive concepts are included in the expansion (false by default)
includeDesignations boolean Whether or not concepts included in the expansion should also come with their designations (false by default)
includeDefinition boolean Whether or not to include the logical definition and metadata of the value set in the expansion (true by default)
context uri A reference to an element in a profile, whose terminology binding should be used for the expansion, e.g. http://hl7.org/fhir/StructureDefinition/DiagnosticReport#DiagnosticReport.category

More details on the expand operation can be found in the FHIR value set specification.

Validate Code

The validate-code operation checks whether a given code is valid within a given ValueSet resource. This is done by sending a GET or POST request to:

http://ontoserver.base.url/fhir/ValueSet/[id]/$validate-code (instance level)

http://ontoserver.base.url/fhir/ValueSet/$validate-code (type level)

The ValueSet for a type-level request is specified using the url parameter. In the case of a POST-style type-level request, the ValueSet may alternatively be provided as an XML/JSON resource in the valueSet parameter within a Parameters object.

The code (with a system and optionally a version) is specified as a parameter to a GET request, or in the body of a POST request (POST requests may alternatively provide a coding parameter. If a display parameter is provided, the operation will also verify whether the display is correct for the specified concept.

More details on the validate-code operation can be found in the FHIR value set specification.

Explicit Value Sets

Explicit Value Sets in Ontoserver support SCRUD (Search, Create, Read, Update and Delete) operations as per the FHIR Specification rules for REST and ValueSets.

Search for explicit value sets is limited to the following parameters:

  • the name, _id, description parameters (these 3 additionally support the :exact, :contains and :missing modifiers)

  • the url parameter, including the :missing, :above and :below modifiers, and

  • the identifier, version and _tag parameters, including code, |code, system| and system|code formats, and the :missing modifier

Implicit Value Sets

Ontoserver supports two kinds of implicit value sets: implicit value sets for FHIR Code Systems, and implicit value sets for SNOMED CT resources.

Code System implicit value sets

Each explicit Code System resource has a corresponding implicit value set, which includes all concepts in the code system.

The url for the Code System’s implicit Value Set is defined in the Code System’s valueSet property if it is provided, or the Code System’s url property otherwise.

SNOMED CT Implicit Value Sets

When populated with Systematized Nomenclature of Medicine - Clinical Terms (SNOMED CT) terminology, Ontoserver exposes a number of implicit value sets according to the FHIR specification. These include implicit value sets for reference sets and by subsumption.

A SNOMED CT value set is technically identified by a URL. This URL has two parts: a base part that identifies the SNOMED CT edition and version, and a query part that specifies the scope of the value set’s content.

Base Part

The base part of the URL has the format, http://snomed.info/sct[/edition[/version]] where edition refers to the SNOMED CT module (e.g. SNOMED CT-AU) and version refers to the module’s version. More details can be found in the SNOMED CT URI Standard.

E.g. http://snomed.info/sct/32506021000036107/version/20171031

If an edition is specified with no version, then the server will look for the latest version of the edition that is available. If no edition or version are specified then the server will look for the latest version of a preconfigured edition, which is specific to each FHIR server. The default edition in the National Terminology Server (NTS) is SNOMED CT-AU.

Query Part

The query part of the URL determines the type of value set.

The fixed URL for the implicit ValueSet of all SNOMED concepts is http://snomed.info/sct/fhir_vs. This may optionally include the edition and version (http://snomed.info/sct[/edition[/version]]?fhir_vs).

Ontoserver also supports implicit ValueSets based on reference sets, and based on subsumption.

Based on Reference Sets

The query part of the URL for value sets based on reference sets has the format,

?fhir_vs=refset/[sctid]

where sctId is the concept id of a reference set.

The list of reference sets available for an edition is also available as an implicit value set with URL,

http://snomed.info/sct[/edition[/version]]?fhir_vs=refset

Based on Subsumption

The query part of the URL for value sets based on subsumption has the format,

?fhir_vs=isa/[sctid]

where sctId is the concept id of any SNOMED CT concept in the specified edition.

LOINC Implicit Value Sets

When populated with LOINC terminology, Ontoserver exposes a number of implicit value sets according to the FHIR specification. These include implicit value sets for answer lists and multi-axial hierarchy entries.

The code system URL for LOINC is http://loinc.org.

The implicit ValueSet URL for all LOINC terms is http://loinc.org[/version/]?/vs where the optional version is a LOINC version. For example, http://loinc.org/vs or http://loinc.org/2.64/vs

The implicit ValueSet URL for a LOINC answer list is http://loinc.org[/version/]?/vs/[answer-list-code].

The implicit ValueSet URL for the LOINC multi-axial hierarchy given by a LOINC part code is http://loinc.org[/version/]?/vs/[part-code].