Aidbox
Search…
ValueSet Code Validation

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
Request
Response
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}
resourceType: Parameters
parameter:
- {name: result, valueBoolean: true}

The value set is provided directly as a part of the request.
Request
Response
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']
resourceType: Parameters
parameter:
- {name: result, valueBoolean: true}

A coding to validate
url parameter is required for $validate-code
Request
Rsponse
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'}
resourceType: Parameters
parameter:
- {name: result, valueBoolean: true}

A full codeableConcept to validate.
Request
Response
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'}
resourceType: Parameters
parameter:
- {name: result, valueBoolean: true}
Copy link
Edit on GitHub
On this page
Overview
API
Parameters
url code system version display
valueSet
coding
codeableConcept