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
property.subproperty
not supported
property.subproperty.code
code
not supported
property.subproperty.value
code
Coding
string
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
content-type: text/yaml
3
4
resourceType: Parameters
5
parameter:
6
- {name: system, valueUri: 'http://hl7.org/fhir/goal-status'}
7
- {name: exact, valueUri: true}
8
- name: property
9
part:
10
- {name: code, valueCode: code}
11
- {name: value, valueString: proposed}
Copied!
1
resourceType: Parameters
2
parameter:
3
- name: match
4
part:
5
- name: code
6
valueCoding: {code: proposed, module: fhir-3.3.0, system: 'http://hl7.org/fhir/goal-status', display: Proposed, definition: A goal is proposed for this patient}
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
content-type: text/yaml
3
4
resourceType: Parameters
5
parameter:
6
- {name: system, valueUri: 'http://hl7.org/fhir/goal-status'}
7
- {name: exact, valueUri: true}
8
- name: property
9
part:
10
- {name: code, valueCode: code}
11
- {name: value, valueString: proposed}
12
- {name: value, valueString: accepted}
Copied!
1
resourceType: Parameters
2
parameter:
3
- name: match
4
part:
5
- name: code
6
valueCoding:
7
code: accepted
8
module: fhir-3.3.0
9
system: 'http://hl7.org/fhir/goal-status'
10
display: Accepted
11
definition: A proposed goal was accepted or acknowledged
12
- name: code
13
valueCoding:
14
code: proposed
15
module: fhir-3.3.0
16
system: 'http://hl7.org/fhir/goal-status'
17
display: Proposed
18
definition: A goal is proposed for this patient
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
content-type: text/yaml
3
4
resourceType: Parameters
5
parameter:
6
- {name: system, valueUri: 'http://hl7.org/fhir/goal-status'}
7
- {name: exact, valueUri: true}
8
- name: property
9
part:
10
- {name: code, valueCode: code}
11
- {name: value, valueString: proposed}
12
- {name: value, valueString: accepted}
13
- name: property
14
part:
15
- {name: code, valueCode: display}
16
- {name: value, valueString: Planned}
Copied!
1
resourceType: Parameters
2
parameter:
3
- name: match
4
part:
5
- name: code
6
valueCoding:
7
code: accepted
8
module: fhir-3.3.0
9
system: 'http://hl7.org/fhir/goal-status'
10
display: Accepted
11
definition: A proposed goal was accepted or acknowledged
12
- name: code
13
valueCoding:
14
code: proposed
15
module: fhir-3.3.0
16
system: 'http://hl7.org/fhir/goal-status'
17
display: Proposed
18
definition: A goal is proposed for this patient
19
- name: code
20
valueCoding:
21
code: planned
22
module: fhir-3.3.0
23
system: http://hl7.org/fhir/goal-status
24
display: Planned
25
hierarchy: [accepted]
26
definition: A goal is planned for this patient
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
content-type: text/yaml
3
4
resourceType: Parameters
5
parameter:
6
- {name: system, valueUri: 'http://hl7.org/fhir/goal-status'}
7
- {name: exact, valueUri: false}
8
- name: property
9
part:
10
- {name: code, valueCode: code}
11
- {name: value, valueString: on-}
Copied!
1
resourceType: Parameters
2
parameter:
3
- name: match
4
part:
5
- name: code
6
valueCoding:
7
code: on-target
8
module: fhir-3.3.0
9
system: http://hl7.org/fhir/goal-status
10
display: On Target
11
hierarchy: [accepted, in-progress]
12
definition: The goal is on schedule for the planned timelines
13
- name: code
14
valueCoding:
15
code: on-hold
16
module: fhir-3.3.0
17
system: http://hl7.org/fhir/goal-status
18
display: On Hold
19
hierarchy: [accepted]
20
definition: The goal remains a long term objective but is no longer being actively pursued for a temporary period of time.
Copied!