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

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

Parameters

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/$compose
content-type: text/yaml

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}

Example: Compose from system http://hl7.org/fhir/goal-status where code is proposed or accepted

POST [BASE]/CodeSystem/$compose
content-type: text/yaml

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}

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
content-type: text/yaml

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}

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/$compose
content-type: text/yaml

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-}

Last updated