Code System

Ontoserver supports the $lookup and $subsumes operations for both explicit and implicit code systems.

Lookup Operation

A lookup on a code within a given code system can be done using a GET or POST request such as:

http://ontoserver.base.url/fhir/CodeSystem/$lookup

where the code and system to lookup must be provided in the parameters of a GET request, or the body of a POST request.

The $lookup operation is supported according to its definition in the FHIR Specification, and supports the code, system, version and coding and property (including lang.X values) parameters. The date parameter is not currently supported.

Successful lookups on SNOMED codes will include designations for fully specified names and synonyms, as well as properties for any parents or children, and inactive status for inactive codes.

Subsumes Operation

Subsumes tests whether a given concept subsumes another concept. The subsumes operation can be invoked using a GET or POST request, at either the instance or type level, such as:

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

http://ontoserver.base.url/fhir/CodeSystem/$subsumes (type level)

where the codeA and codeB to compare must be provided in the parameters of a GET request, or the body of a POST request, or the codingA and codingB parameters in the body of a POST request. The code system for the codes in a type-level request is identified by the system parameter, and optionally the version parameter.

The $subsumes operation is supported according to its definition in the FHIR Specification, and supports the codeA, codeB, system, version, codingA, and codingB parameters.

Validate Code

The validate-code operation checks whether a given code is valid for the given CodeSystem. This is done by sending a GET or POST request to:

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

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

The CodeSystem for a type-level request is specified using the url parameter. Supplying an in-line CodeSystem via the codeSystem parameter within a Parameters object supplied to a POST-style type-level request is not supported.

The code (with an optional 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.

Loading SNOMED CT

As well as loading SNOMED CT instances via Syndication using the /api/indexCodeSystem API, they can also be loaded by directly POSTing an RF2 release in ZIP format to the /fhir/CodeSystem/$x-upload-external API.

This operation takes two query parameters:

  • system

  • version

The supported values for system are http://snomed.info/sct and the corresponding version parameter must be a full SNOMED CT Version URI.

The body of the POST request must have a Content-Type of application/zip and contain either the corresponding SNAPSHOT release files, or a FULL release.

Explicit Code Systems

Explicit Code Systems support SCRUD (Search, Create, Read, Update and Delete) operations as per the FHIR Specification rules for REST and CodeSystems.

Search for explicit code systems is limited to the following parameters:

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

  • the url and system parameters, including the :missing, :above and :below modifiers, and

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

Implicit SNOMED CT Code Systems

Any SNOMED CT ontologies included in the Ontoserver instance are available as implicit CodeSystem resources, using a url of 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.

For example, the 20171031 version of SNOMED CT-AU has the url:

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

If a version is not supplied, Ontoserver will attempt to find the most recent version using the yyyymmdd version format.

If an edition is not supplied, Ontoserver will attempt to use the most recent version of the edition configured as the default edition. If it cannot find the default edition, and there is only one other edition present, it will use the most recent version of that.

Implicit LOINC Code Systems

Any LOINC distributions loaded into the Ontoserver instance are available as implicit CodeSystem resources, using a url of the format:

http://loinc.org[/version]] where version refers to the distribution’s version.

For example, the 2.64 version of LOINC has the url:

http://loinc.org/2.64

If a version is not supplied, Ontoserver will attempt to find the most recent version using the x.yy version format.