Given a set of properties, return one or more possible matching codes. For more details see 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 return only complete and partial matches. When exact is false
- $compose include in to response possible matches. Default value is true, that means, that by default returning only complete and partial matches.
GET/POST URL: [base]/ValueSet/$compose
GET/POST URL: [base]/ValueSet/[id]/$compose
Parameter | Type | Status | Example |
system | ​uri​ |
| ​property​ |
version | ​string​ |
| ​ |
exact | ​boolean​ |
| ​exact​ |
property | ​ |
| ​property​ |
property.code | ​code​ |
| ​ |
property.value | code | Coding | string | integer | boolean | dateTime |
| ​ |
property.subproperty | ​ |
| ​ |
property.subproperty.code | ​code​ |
| ​ |
property.subproperty.value | code | Coding | string | integer | boolean | dateTime |
| ​ |
compositional | ​boolean​ |
| ​ |
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
POST [BASE]/CodeSystem/$compose{"resourceType" : "Parameters","parameter" : [{"name" : "system","valueUri" : "http://hl7.org/fhir/goal-status"},{"name" : "exact","valueUri" : true},{"name": "property","part": [{"name": "code","valueCode": "code"},{"name": "value","valueString": "proposed"}]}]}
{"resourceType": "Parameters","parameter": [{"name": "match","part": [{"name": "code","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"}}]}]}
Example: Compose from system http://hl7.org/fhir/goal-status
where code
is proposed
or accepted
POST [BASE]/CodeSystem/$compose{"resourceType" : "Parameters","parameter" : [{"name" : "system","valueUri" : "http://hl7.org/fhir/goal-status"},{"name" : "exact","valueUri" : true},{"name": "property","part": [{"name": "code","valueCode": "code"},{"name": "value","valueString": "proposed"},{"name": "value","valueString": "accepted"}]}]}
{"resourceType": "Parameters","parameter": [{"name": "match","part": [{"name": "code","valueCoding": {"code": "accepted","module": "fhir-3.3.0","system": "http://hl7.org/fhir/goal-status","display": "Accepted","definition": "A proposed goal was accepted or acknowledged"}},{"name": "code","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"}}]}]}
Example: Compose from system http://hl7.org/fhir/goal-status
where code
is proposed
or accepted
and/or where definition
is Planned
POST [BASE]/CodeSystem/$compose{"resourceType" : "Parameters","parameter" : [{"name" : "system","valueUri" : "http://hl7.org/fhir/goal-status"},{"name" : "exact","valueUri" : true},{"name": "property","part": [{"name": "code","valueCode": "code"},{"name": "value","valueString": "proposed"},{"name": "value","valueString": "accepted"}]},{"name": "property","part": [{"name": "code","valueCode": "display"},{"name": "value","valueString": "Planned"}]}]}
{"resourceType": "Parameters","parameter": [{"name": "match","part": [{"name": "code","valueCoding": {"code": "accepted","module": "fhir-3.3.0","system": "http://hl7.org/fhir/goal-status","display": "Accepted","definition": "A proposed goal was accepted or acknowledged"}},{"name": "code","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"}},{"name": "code","valueCoding": {"code": "planned","module": "fhir-3.3.0","system": "http://hl7.org/fhir/goal-status","display": "Planned","hierarchy": ["accepted"],"definition": "A goal is planned for this patient"}}]}]}
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 code contains on-
POST [BASE]/CodeSystem/$compose{"resourceType" : "Parameters","parameter" : [{"name" : "system","valueUri" : "http://hl7.org/fhir/goal-status"},{"name" : "exact","valueUri" : false},{"name": "property","part": [{"name": "code","valueCode": "code"},{"name": "value","valueString": "on-"}]}]}
{"resourceType": "Parameters","parameter": [{"name": "match","part": [{"name": "code","valueCoding": {"code": "on-target","module": "fhir-3.3.0","system": "http://hl7.org/fhir/goal-status","display": "On Target","hierarchy": ["accepted","in-progress"],"definition": "The goal is on schedule for the planned timelines"}},{"name": "code","valueCoding": {"code": "on-hold","module": "fhir-3.3.0","system": "http://hl7.org/fhir/goal-status","display": "On Hold","hierarchy": ["accepted"],"definition": "The goal remains a long term objective but is no longer being actively pursued for a temporary period of time."}}]}]}
​