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

1
GET/POST URL: [base]/ValueSet/$validate-code
Copied!
1
GET/POST URL: [base]/ValueSet/[id]/$validate-code
Copied!
Example: for validation that female code allowed by a default AdministrativeGender ValueSet.
1
GET [base]/ValueSet/administrative-gender/$validate-code?code=female
Copied!

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

url code system version display

One of the concept property
Request
Response
1
GET [base]/ValueSet/$validate-code?url=http://hl7.org/fhir/ValueSet/administrative-gender&code=male&display=Male
Copied!
Or
1
POST [base]/ValueSet/$validate-code
2
content-type: text/yaml
3
​
4
resourceType: Parameters
5
parameter:
6
- {name: url, valueUri: 'http://hl7.org/fhir/ValueSet/administrative-gender'}
7
- {name: code, valueCode: male}
8
- {name: system, valueUri: 'http://hl7.org/fhir/administrative-gender'}
9
- {name: display, valueString: Male}
Copied!
1
resourceType: Parameters
2
parameter:
3
- {name: result, valueBoolean: true}
Copied!

valueSet

The value set is provided directly as a part of the request.
Request
Response
1
POST [base]/ValueSet/$validate-code
2
content-type: text/yaml
3
​
4
resourceType: Parameters
5
parameter:
6
- {name: code, valueCode: male}
7
- {name: system, valueUri: 'http://hl7.org/fhir/administrative-gender'}
8
- name: valueSet
9
resource:
10
resourceType: ValueSet
11
url: http://custom/administrative-gender
12
compose:
13
include:
14
- valueSet: ['http://hl7.org/fhir/ValueSet/administrative-gender']
Copied!
1
resourceType: Parameters
2
parameter:
3
- {name: result, valueBoolean: true}
Copied!

coding

A coding to validate
url parameter is required for $validate-code
Request
Rsponse
1
POST [base]/ValueSet/$validate-code
2
content-type: text/yaml
3
​
4
resourceType: Parameters
5
parameter:
6
- name: coding
7
valueCoding: {system: 'http://hl7.org/fhir/administrative-gender', code: male}
8
- {name: url, valueUri: 'http://hl7.org/fhir/ValueSet/administrative-gender'}
Copied!
1
resourceType: Parameters
2
parameter:
3
- {name: result, valueBoolean: true}
Copied!

codeableConcept

A full codeableConcept to validate.
Request
Response
1
POST [base]/ValueSet/$validate-code
2
content-type: text/yaml
3
​
4
resourceType: Parameters
5
parameter:
6
- name: codeableConcept
7
valueCodeableConcept:
8
coding:
9
- {system: 'http://hl7.org/fhir/administrative-gender', code: male_wrong}
10
- {system: 'http://hl7.org/fhir/administrative-gender', code: male}
11
- {name: url, valueUri: 'http://hl7.org/fhir/ValueSet/administrative-gender'}
Copied!
1
resourceType: Parameters
2
parameter:
3
- {name: result, valueBoolean: true}
Copied!