Skip to main content

$translateCoding

$translateCoding(value?, url, packageFilter?) -> value
Compact type signature<x-so?:x>

If value is omitted, the current context value is used.

Execution
AsyncCan run in parallel

This helper performs terminology work asynchronously. Independent calls can start together when they wait on terminology resolution. See Parallelism And Async Evaluation and Async And Concurrency.

Source: FUME

Documentation

Translates a code or Coding-like value through a ConceptMap and returns Coding-like targets.

This helper requires the relevant ConceptMap to be available through the configured environment. A single mapped target is returned as one Coding-like object, multiple targets are returned as an array, and unmapped lookups return undefined. Use this helper when you need normalized system and code data instead of just the code value. When a packageFilter is supplied, translation uses packages only and skips server ConceptMap resolution.

Examples

Translate a FHIR Coding by canonical ConceptMap URL (requires a configured FHIR server or matching package content)

Input

This example uses the Specimen mapping from v2 table 0487 to SNOMED CT ConceptMap from FHIR R4.

The source coding in this example comes from the v2.0487 ValueSet carried directly in the specimen payload.

Example input

JSON
{
"resourceType": "Specimen",
"id": "spec-0001",
"status": "available",
"subject": {
"reference": "Patient/pat-0001",
"display": "Avery Reed"
},
"type": {
"coding": [
{
"system": "http://terminology.hl7.org/CodeSystem/v2-0487",
"code": "SER",
"display": "Serum"
}
],
"text": "Serum specimen"
}
}

Expression

$translateCoding(type.coding[0], "http://hl7.org/fhir/ConceptMap/102")

The source system is read from type.coding[0], so the expression does not need to repeat it.

Result

{
"system": "http://snomed.info/sct",
"code": "119364003"
}