FHIR API
FHIR terminology resource types
There are three core terminology-related resources from the FHIR standard that form the foundation of Ontoserver’s FHIR API. Together they support the goal of promoting standardisation of the representation of terminology and mappings.
- Code System – a set of codes with meanings (also known as a terminology).
- Value Set – a set of codes defined in one or more Code Systems for use within a particular context.
- Concept Map – a statement of relationships between the codes within two Value Sets.
A detailed overview of Ontoserver’s support for these and other resources and associated operations can be found here.
Profiles
Australia’s NCTS specifications define a profile for each of these resources. Each profile defines some extra constraints on the resource which are seen to have value in terms of interoperability within the NCTS ecosystem. Each of the NCTS profiles have been given a more specific name, and an associated StructureDefinition resource which helps define them:
- Complete Code System
https://healthterminologies.gov.au/fhir/StructureDefinition/complete-code-system-2 - Composed Value Set
https://healthterminologies.gov.au/fhir/StructureDefinition/composed-value-set-2 - General Concept Map
https://healthterminologies.gov.au/fhir/StructureDefinition/general-concept-map-2
NCTS specifications also define content types for SNOMED CT and LOINC releases, for the purposes of supporting their inclusion within syndication feeds. For the formal definition of all the NCTS Content Types, see the NCTS Specifications.
Bundle
Ontoserver supports the management of Bundle resources.
This management is performed by gathering a collection of resources into a single instance with containing context, referred to as “bundling” the resources together. Resource bundles are useful for a variety of different reasons, including:
- Returning a set of resources that meet some criteria as part of a server operation (see RESTful Search)
- Returning a set of versions of resources as part of the history operation on a server (see History)
- Sending a set of resources as part of a message exchange (see Messaging)
- Grouping a self-contained set of resources to act as an exchangeable and persistable collection with clinical integrity – e.g. a clinical document (see Documents)
- Creating/updating/deleting a set of resources on a server as a single operation (including doing so as a single atomic transaction) (see Transactions)
- Storing a collection of resources
API Extensions
Open allClose allOntoserver supports the algorithmic concept maps listed below. These all extract the display text from a supplied Coding
and CodeableConcept
items (no code or system required) and attempt to find the best match in the target ValueSet.
Additionally, these strategies understand a special CodeSystem with URI http://ontoserver.csiro.au/fhir/CodeSystem/codesystem-terms
which represents the code system of all strings (without leading/trailing whitespace). Hence, simple (cacheable) GET request style invocation is possible. For example, to automap “heart attack” to codes in SNOMED CT:
GET /ConceptMap/$translate
?url=http://ontoserver.csiro.au/fhir/ConceptMap/automapstrategy- default
&system=http://ontoserver.csiro.au/fhir/CodeSystem/codesystem-terms
&code=heart%20attack
&target=http://snomed.info/sct?fhir_vs
- http://ontoserver.csiro.au/fhir/ConceptMap/automapstrategy-default Ontoserver’s default automapping strategy. It does not require all words to match, and also attempts simple spelling correction. It is designed for reasonably well-formed textual input, and is not suitable for arbitrary free text.
- http://ontoserver.csiro.au/fhir/ConceptMap/automapstrategy-strict A matching strategy much closer to that used by Ontoserver for the filter parameter to $expand. It is designed for reasonably well-formed textual input, and is not suitable for arbitrary free text.
- http://ontoserver.csiro.au/fhir/ConceptMap/automapstrategy-MML A re-implementation approximation of the MetaMapLite strategy. It is designed for reasonably well-formed textual input, and is somewhat suitable for short spans of arbitrary free text.
- http://ontoserver.csiro.au/fhir/ConceptMap/automapstrategy-seq(;name)+ This is a sequenced-strategy. The semi-colon separated sequence of names may include any of automapstrategy-default, automapstrategy-strict, and automapstrategy-MML. Each strategy will be attempted in turn until a match is found. Once a strategy has syccessfully found a match, the evaluation terminates (i.e., short-circuit evaluation).
For example, http://ontoserver.csiro.au/fhir/ConceptMap/automapstrategy-seq;automapstrategy-default;automapstrategy-MML
The logs that Ontoserver produces allow an Ontoserver operator to track the searches, lookups, translations, etc, that are conducted. However, it does not allow the operator to track the selection of a code.
To facilitate this, Ontoserver provides an endpoint for the creation of FHIR AuditEvent resources, by posting them as JSON/XML resources to /fhir/AuditEvent
. These are not persisted, but are logged in order to allow capture and analysis.
An example of an AuditEvent (in JSON) follows. This event indicates the selection of a code (in this case the SNOMED code for ‘Elbow Region Structure’, following a search (i.e. ValueSet
$expand
with a filter
) of the SNOMED Body Structure implicit ValueSet. More detail about AuditEvent can be found in its definition in the FHIR® Specification
{
"resourceType": "AuditEvent",
"type": {
"system": "http://ontoserver.csiro.au/CodeSystem/ontoserver-reporting",
"code": "code-selected",
"display": "Code Selected"
},
"action": "E",
"recorded": "2017-06-02T22:04:27+11:00",
"outcome": "0",
"agent": [{
"requestor": false
}],
"source": {
"site": "IT Department",
"observer": {
"display": "John's Laptop"
}
},
"entity": [{
"what": {
"identifier": {
"system": "http://snomed.info/sct",
"value": "127949000"
}
},
"name": "selected code",
"detail": [{
"type": "valueSetExpansionUrl",
"valueString": "http://snomed.info/sct?fhir_vs=refset/32570061000036105"
},
{
"type": "valueSetExpansionFilter",
"valueString": "elbow"
},
{
"type": "indexInSearchResult",
"valueString": "2"
}]
}]
}
The Extension URL http://ontoserver.csiro.au/profiles/boost
can be added to the ValueSet.compose.include
element to adjust the ranking up (value > 1.0) or down (value < 1.0) of codes when performing an $expand
with filter
.
The following example demonstrates usage:
{
"resourceType" : "ValueSet",
"url" : "http://csiro.au/example/ValueSet/boost1",
"compose" : {
"include" : [ {
"system" : "http://snomed.info/sct",
"filter" : [ {
"property" : "concept",
"op" : "is-a",
"value" : "30560011000036108"
} ],
// This extension reduces the significance of codes matching this filter
"extension" : [ {
"url" : "http://ontoserver.csiro.au/profiles/boost",
"valueDecimal" : 0.01
} ]
}, {
"system" : "http://snomed.info/sct",
"filter" : [ {
"property" : "concept",
"op" : "is-a",
"value" : "30404011000036106"
} ],
"extension" : [ {
// This extension increases the significance of codes matching this filter
"url" : "http://ontoserver.csiro.au/profiles/boost",
"valueDecimal" : 10.01
} ]
}, {
"valueSet": [
"http://snomed.info/sct?fhir_vs=refset/30513011000036104"
],
"extension" : [ {
// This extension increases the significance of codes in the imported ValueSet
"url" : "http://ontoserver.csiro.au/profiles/boost",
"valueDecimal" : 5.0
} ]
} ]
}
}
Use cases for the FHIR API
Open allClose allOnce you have chosen or defined the code systems and value sets, you can:
- Determine the binding strength
- Set up the code system and value set maintenance and update processes
- Concepts can become deprecated over time – you need to watch and plan for this!
- You may be able to use ConceptMaps to find the concepts that have changed
Once you have chosen or defined the code systems and value sets, you can:
- use $validate-code to check whether the codes are valid in your context, and whether the display text is correct (Clinical systems often allow users to change the display term)
- use $translate to map local or non-standard coded data to the standard code systems/value sets for analysis
- You can use $lookup to retrieve the properties and display them in a table (or other useful format)
- You can navigate the hierarchy between concepts using the ‘child’ and ‘parent’ properties or by $subsumes (or $closure)
More information about use cases can be found at https://ontoserver.csiro.au/docs/6/using.html.