$translate on ConceptMap
Translate code from one value set to another, based on the existing value set and concept maps resources, and/or other additional knowledge available to the server.
All the examples can be found at the "FHIR ConceptMap Resource and translation"community notebook which is accessible via your Aidbox Notebooks UI Tab

Parameters and usage

Parameter
Type
Description
code
required
The code that is to be translated
system
required
The system for the code that is to be translated
url
optional
A canonical URL for a concept map.
Ignored when ConceptMap id is provided
reverse
optional
If true, the translate should return all the codes that might be mapped to the given code

Example request

Request
Response
1
GET /fhir/ConceptMap/cm1/$translate?code=fetus-speciment&system=http://snomed&reverse=true
Copied!
1
status: 200
2
body:
3
resourceType: Parameters
4
parameter:
5
- name: result
6
valueBoolean: true
7
- name: match
8
part:
9
- name: equivalence
10
valueCode: equivalent
11
- name: concept
12
valueCoding:
13
system: http://hl7
14
code: fetus-scalp
15
userSelected: false
16
- name: source
17
valueUri: http://cm1
18
- name: product
19
part:
20
- name: element
21
valueUri: http://snomed/scalp-structure
22
- name: concept
23
valueCoding:
24
system: http://snomed
25
code: scalp-structure
26
userSelected: false
Copied!

Ungrouping ConceptMaps on create

ConceptMaps are ungrouped on create to have an opportunity to use Search API instead of $tranalate operation. ConceptMaps are transformed into ConceptMapRule resources.

ConceptMapRule resource schema:

  • element as in ConceptMap
  • source: source system where concepts to be mapped are defined
  • target: target system that the concepts are to be mapped to
  • sourceValueSet: the source value set that contains the concepts that are being mapped
  • targetValueSet: the target value set which provides context for the mappings
  • conceptMapId: id of the original ConceptMap
  • conceptmapUrl: url of the original ConceptMap
  • unmapped: as in ConceptMap

Aidbox Search API for ConceptMapRule

Request
Response
1
GET /fhir/ConceptMapRule?.source=http://hl7.org/fhir/address-use&.target=http://terminology.hl7.org/CodeSystem/v3-AddressUse&.element.code=home&_elements=.element.target
Copied!
1
status: 200
2
body:
3
resourceType: Bundle
4
type: searchset
5
meta:
6
versionId: '70'
7
total: 1
8
link:
9
- relation: first
10
url: "/fhir/ConceptMapRule?.source=http://hl7.org/fhir/address-use&.target=http://terminology.hl7.org/CodeSystem/v3-AddressUse&.element.code=home&_elements=.element.target&page=1"
11
- relation: self
12
url: "/fhir/ConceptMapRule?.source=http://hl7.org/fhir/address-use&.target=http://terminology.hl7.org/CodeSystem/v3-AddressUse&.element.code=home&_elements=.element.target&page=1"
13
entry:
14
- resource:
15
element:
16
target:
17
- code: H
18
display: home
19
equivalence: equivalent
20
id: 7378326f-d142-43d5-8ef4-97cdad65d159
21
resourceType: ConceptMapRule
Copied!
Created ConceptMap does not have group property as it is just a meta header resource.

Convert ConceptMap.json to ndjson bundle

In order to convert a huge ConceptMap to ndjson bundle use this FHIR converter.
1
java -jar [JAR_PATH] cmndj -i PATH/TO/CONCEPT_MAP.json -o PATH/TO/OUTPUT_BUNDLE.ndjson
Copied!
The output bundle consists of ConceptMap meta resource and the set of ConceptMapRule resources.
Use Bulk API to upload output bundle.

How to get full ConceptMap resource

Aidbox doesn't store ConceptMap groups in ConceptMap resource as mentioned above.
To get full ConceptMap resource make a request using /fhir prefix.
Example:
1
GET /fhir/ConceptMap/my-concept-map
Copied!