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
GET/POST URL: [base]/ValueSet/$compose
GET/POST URL: [base]/ValueSet/[id]/$compose
Parameters
Parameter
Type
Status
Example
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
POST [BASE]/CodeSystem/$composecontent-type:text/yamlresourceType:Parametersparameter:- {name:system,valueUri:'http://hl7.org/fhir/goal-status'}- {name:exact,valueUri:true}- name:propertypart: - {name:code,valueCode:code} - {name:value,valueString:proposed}
resourceType:Parametersparameter:- name:matchpart: - 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
resourceType:Parametersparameter:- name:matchpart: - name:codevalueCoding:code:acceptedmodule:fhir-3.3.0system:'http://hl7.org/fhir/goal-status'display:Accepteddefinition:A proposed goal was accepted or acknowledged - name:codevalueCoding:code:proposedmodule:fhir-3.3.0system:'http://hl7.org/fhir/goal-status'display:Proposeddefinition: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
resourceType:Parametersparameter:- name:matchpart: - name:codevalueCoding:code:acceptedmodule:fhir-3.3.0system:'http://hl7.org/fhir/goal-status'display:Accepteddefinition:A proposed goal was accepted or acknowledged - name:codevalueCoding:code:proposedmodule:fhir-3.3.0system:'http://hl7.org/fhir/goal-status'display:Proposeddefinition:A goal is proposed for this patient - name:codevalueCoding:code:plannedmodule:fhir-3.3.0system:http://hl7.org/fhir/goal-statusdisplay:Plannedhierarchy: [accepted]definition:A goal is planned for this patient
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-
POST [BASE]/CodeSystem/$composecontent-type:text/yamlresourceType:Parametersparameter:- {name:system,valueUri:'http://hl7.org/fhir/goal-status'}- {name:exact,valueUri:false}- name:propertypart: - {name:code,valueCode:code} - {name:value,valueString:on-}
resourceType:Parametersparameter:- name:matchpart: - name:codevalueCoding:code:on-targetmodule:fhir-3.3.0system:http://hl7.org/fhir/goal-statusdisplay:On Targethierarchy: [accepted,in-progress]definition:The goal is on schedule for the planned timelines - name:codevalueCoding:code:on-holdmodule:fhir-3.3.0system:http://hl7.org/fhir/goal-statusdisplay:On Holdhierarchy: [accepted] definition: The goal remains a long term objective but is no longer being actively pursued for a temporary period of time.