Value set code validation provides the ability to validate that a coded value is in the set of codes allowed by a value set. For more details, see the official documentation FHIR Terminology Value Set based Validation.
GET/POST URL: [base]/ValueSet/$validate-code
GET/POST URL: [base]/ValueSet/[id]/$validate-code
Example: for validation that female
code allowed by a default AdministrativeGender ValueSet.
GET [base]/ValueSet/administrative-gender/$validate-code?code=female
Parameter | Type | Status | Example |
---|---|---|---|
url | uri | supported |
url |
context | uri | not supported |
|
valueSet | ValueSet | supported |
valueSet |
code | code | supported |
code |
system | uri | supported |
system |
version | string | supported |
version |
display | string | supported |
display |
coding | Coding | supported |
coding |
codeableConcept | CodeableConcept | supported |
codeableConcept |
date | dateTime | not supported |
|
abstract | boolean | not supported |
|
displayLanguage | code | not supported |
One of the concept property
{% tabs %} {% tab title="Request" %}
GET [base]/ValueSet/$validate-code?url=http://hl7.org/fhir/ValueSet/administrative-gender&code=male&display=Male
Or
POST [base]/ValueSet/$validate-code
content-type: text/yaml
resourceType: Parameters
parameter:
- {name: url, valueUri: 'http://hl7.org/fhir/ValueSet/administrative-gender'}
- {name: code, valueCode: male}
- {name: system, valueUri: 'http://hl7.org/fhir/administrative-gender'}
- {name: display, valueString: Male}
{% endtab %}
{% tab title="Response" %}
resourceType: Parameters
parameter:
- {name: result, valueBoolean: true}
{% endtab %} {% endtabs %}
The value set is provided directly as a part of the request.
{% tabs %} {% tab title="Request" %}
POST [base]/ValueSet/$validate-code
content-type: text/yaml
resourceType: Parameters
parameter:
- {name: code, valueCode: male}
- {name: system, valueUri: 'http://hl7.org/fhir/administrative-gender'}
- name: valueSet
resource:
resourceType: ValueSet
url: http://custom/administrative-gender
compose:
include:
- valueSet: ['http://hl7.org/fhir/ValueSet/administrative-gender']
{% endtab %}
{% tab title="Response" %}
resourceType: Parameters
parameter:
- {name: result, valueBoolean: true}
{% endtab %} {% endtabs %}
A coding to validate
{% hint style="info" %}
url
parameter is required for $validate-code
{% endhint %}
{% tabs %} {% tab title="Request" %}
POST [base]/ValueSet/$validate-code
content-type: text/yaml
resourceType: Parameters
parameter:
- name: coding
valueCoding: {system: 'http://hl7.org/fhir/administrative-gender', code: male}
- {name: url, valueUri: 'http://hl7.org/fhir/ValueSet/administrative-gender'}
{% endtab %}
{% tab title="Rsponse" %}
resourceType: Parameters
parameter:
- {name: result, valueBoolean: true}
{% endtab %} {% endtabs %}
A full codeableConcept to validate.
{% tabs %} {% tab title="Request" %}
POST [base]/ValueSet/$validate-code
content-type: text/yaml
resourceType: Parameters
parameter:
- name: codeableConcept
valueCodeableConcept:
coding:
- {system: 'http://hl7.org/fhir/administrative-gender', code: male_wrong}
- {system: 'http://hl7.org/fhir/administrative-gender', code: male}
- {name: url, valueUri: 'http://hl7.org/fhir/ValueSet/administrative-gender'}
{% endtab %}
{% tab title="Response" %}
resourceType: Parameters
parameter:
- {name: result, valueBoolean: true}
{% endtab %} {% endtabs %}