Skip to main content

$translate

$translate(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 the mapped targets.

This helper requires the relevant ConceptMap to be available through the configured environment. Its return shape depends on the input shape: code-like input returns a target code or array of codes, while Coding-like input returns a target Coding-like object or array of objects. If the ConceptMap lookup is unmapped, unsupported, or otherwise does not produce targets, the function returns undefined. If you always need one output shape, use $translateCode() or $translateCoding() instead. When a packageFilter is supplied, translation uses packages only and skips server ConceptMap resolution.

Examples

Translate a primitive code by ConceptMap name (requires a configured FHIR server or matching package content)

Input

This example uses the v2.AdministrativeGender ConceptMap from FHIR R4.

Example input

JSON
{
"resourceType": "Patient",
"id": "pat-0001",
"gender": "female",
"identifier": [
{
"system": "urn:examplecare:member-id",
"value": "mbr-3001"
}
],
"name": [
{
"use": "official",
"family": "Reed",
"given": [
"Avery"
]
}
],
"managingOrganization": {
"reference": "Organization/org-0001",
"display": "ExampleCare Clinic"
}
}

Expression

$translate(gender, "v2.AdministrativeGender")

Because the input is the primitive gender value, the mapped result is also a primitive target code.

Result

"F"