Aidbox
Search…
⌃K

ValueSet Code Validation

Overview

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.

API

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

Parameters

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
supported
date
dateTime
not supported
abstract
boolean
not supported
displayLanguage
code
not supported

url code system version display

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}

valueSet

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}

coding

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}

codeableConcept

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}