CodeSystem Code Composition

Overview

Given a set of properties, return one or more possible matching codes. For more details, see the official FHIR terminology documentation CodeSystem Code Composition​
$compose may return 3 possible types of match
  • complete match - a code that represents all the provided properties correctly
  • partial match - a code that represents some of the provided properties correctly and not others
  • possible match - code that may represent the provided properties closely
When send exact parameter is true - $compose operation only returns complete and partial matches. When exact is false - $compose include possible matches to a response. Default value is true; that means that by default returning only complete and partial matches.

Api

1
GET/POST URL: [base]/ValueSet/$compose
Copied!
1
GET/POST URL: [base]/ValueSet/[id]/$compose
Copied!

Parameters

Parameter
Type
Status
Example
system
​uri​
supported
​property​
version
​string​
not supported
​
exact
​boolean​
supported
​exact​
property
​
supported
​property​
property.code
​code​
supported
​
property.value
code | Coding | string |
integer | boolean | dateTime
supported
​
property.subproperty
​
not supported
​
property.subproperty.code
​code​
not supported
​
property.subproperty.value
code | Coding | string |
integer | boolean | dateTime
not supported
​
compositional
​boolean​
not supported
​

property

One or more properties that contain information to be composed into the code.
Example: Compose from system http://hl7.org/fhir/goal-status where code is proposed
Request
Response
1
POST [BASE]/CodeSystem/$compose
2
{
3
"resourceType" : "Parameters",
4
"parameter" : [
5
{
6
"name" : "system",
7
"valueUri" : "http://hl7.org/fhir/goal-status"
8
},
9
{
10
"name" : "exact",
11
"valueUri" : true
12
},
13
{
14
"name": "property",
15
"part": [
16
{
17
"name": "code",
18
"valueCode": "code"
19
},
20
{
21
"name": "value",
22
"valueString": "proposed"
23
}]
24
}
25
]
26
}
Copied!
1
{
2
"resourceType": "Parameters",
3
"parameter": [
4
{
5
"name": "match",
6
"part": [
7
{
8
"name": "code",
9
"valueCoding": {
10
"code": "proposed",
11
"module": "fhir-3.3.0",
12
"system": "http://hl7.org/fhir/goal-status",
13
"display": "Proposed",
14
"definition": "A goal is proposed for this patient"
15
}
16
}
17
]
18
}
19
]
20
}
Copied!
Example: Compose from system http://hl7.org/fhir/goal-status where code is proposed or accepted
Request
Response
1
POST [BASE]/CodeSystem/$compose
2
{
3
"resourceType" : "Parameters",
4
"parameter" : [
5
{
6
"name" : "system",
7
"valueUri" : "http://hl7.org/fhir/goal-status"
8
},
9
{
10
"name" : "exact",
11
"valueUri" : true
12
},
13
{
14
"name": "property",
15
"part": [
16
{
17
"name": "code",
18
"valueCode": "code"
19
},
20
{
21
"name": "value",
22
"valueString": "proposed"
23
},
24
{
25
"name": "value",
26
"valueString": "accepted"
27
}]
28
}
29
]
30
}
Copied!
1
{
2
"resourceType": "Parameters",
3
"parameter": [
4
{
5
"name": "match",
6
"part": [
7
{
8
"name": "code",
9
"valueCoding": {
10
"code": "accepted",
11
"module": "fhir-3.3.0",
12
"system": "http://hl7.org/fhir/goal-status",
13
"display": "Accepted",
14
"definition": "A proposed goal was accepted or acknowledged"
15
}
16
},
17
{
18
"name": "code",
19
"valueCoding": {
20
"code": "proposed",
21
"module": "fhir-3.3.0",
22
"system": "http://hl7.org/fhir/goal-status",
23
"display": "Proposed",
24
"definition": "A goal is proposed for this patient"
25
}
26
}
27
]
28
}
29
]
30
}
Copied!
Example: Compose from system http://hl7.org/fhir/goal-status where code is proposed or accepted and/or where definition is Planned
Request
Response
1
POST [BASE]/CodeSystem/$compose
2
{
3
"resourceType" : "Parameters",
4
"parameter" : [
5
{
6
"name" : "system",
7
"valueUri" : "http://hl7.org/fhir/goal-status"
8
},
9
{
10
"name" : "exact",
11
"valueUri" : true
12
},
13
{
14
"name": "property",
15
"part": [
16
{
17
"name": "code",
18
"valueCode": "code"
19
},
20
{
21
"name": "value",
22
"valueString": "proposed"
23
},
24
{
25
"name": "value",
26
"valueString": "accepted"
27
}]
28
},
29
{
30
"name": "property",
31
"part": [
32
{
33
"name": "code",
34
"valueCode": "display"
35
},
36
{
37
"name": "value",
38
"valueString": "Planned"
39
}]
40
}
41
]
42
}
Copied!
1
{
2
"resourceType": "Parameters",
3
"parameter": [
4
{
5
"name": "match",
6
"part": [
7
{
8
"name": "code",
9
"valueCoding": {
10
"code": "accepted",
11
"module": "fhir-3.3.0",
12
"system": "http://hl7.org/fhir/goal-status",
13
"display": "Accepted",
14
"definition": "A proposed goal was accepted or acknowledged"
15
}
16
},
17
{
18
"name": "code",
19
"valueCoding": {
20
"code": "proposed",
21
"module": "fhir-3.3.0",
22
"system": "http://hl7.org/fhir/goal-status",
23
"display": "Proposed",
24
"definition": "A goal is proposed for this patient"
25
}
26
},
27
{
28
"name": "code",
29
"valueCoding": {
30
"code": "planned",
31
"module": "fhir-3.3.0",
32
"system": "http://hl7.org/fhir/goal-status",
33
"display": "Planned",
34
"hierarchy": [
35
"accepted"
36
],
37
"definition": "A goal is planned for this patient"
38
}
39
}
40
]
41
}
42
]
43
}
Copied!

exact

Whether the operation is being used by a human, or a machine. When false include to response possible matches.
Example: lets try to compose code system from concepts where the code contains on-
Request
Response
1
POST [BASE]/CodeSystem/$compose
2
{
3
"resourceType" : "Parameters",
4
"parameter" : [
5
{
6
"name" : "system",
7
"valueUri" : "http://hl7.org/fhir/goal-status"
8
},
9
{
10
"name" : "exact",
11
"valueUri" : false
12
},
13
{
14
"name": "property",
15
"part": [
16
{
17
"name": "code",
18
"valueCode": "code"
19
},
20
{
21
"name": "value",
22
"valueString": "on-"
23
}]
24
}
25
]
26
}
Copied!
1
{
2
"resourceType": "Parameters",
3
"parameter": [
4
{
5
"name": "match",
6
"part": [
7
{
8
"name": "code",
9
"valueCoding": {
10
"code": "on-target",
11
"module": "fhir-3.3.0",
12
"system": "http://hl7.org/fhir/goal-status",
13
"display": "On Target",
14
"hierarchy": [
15
"accepted",
16
"in-progress"
17
],
18
"definition": "The goal is on schedule for the planned timelines"
19
}
20
},
21
{
22
"name": "code",
23
"valueCoding": {
24
"code": "on-hold",
25
"module": "fhir-3.3.0",
26
"system": "http://hl7.org/fhir/goal-status",
27
"display": "On Hold",
28
"hierarchy": [
29
"accepted"
30
],
31
"definition": "The goal remains a long term objective but is no longer being actively pursued for a temporary period of time."
32
}
33
}
34
]
35
}
36
]
37
}
Copied!
​
Last modified 9mo ago