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
{
3
"resourceType" : "Parameters",
4
"parameter" : [
5
{
6
"name" : "url",
7
"valueUri" : "http://hl7.org/fhir/ValueSet/administrative-gender"
8
},
9
{
10
"name" : "code",
11
"valueCode" : "male"
12
},
13
{
14
"name" : "system",
15
"valueUri" : "http://hl7.org/fhir/administrative-gender"
16
},
17
{
18
"name" : "display",
19
"valueString" : "Male"
20
}
21
]
22
}
Copied!
1
{
2
"resourceType": "Parameters",
3
"parameter": [
4
{
5
"name": "result",
6
"valueBoolean": true
7
}
8
]
9
}
Copied!

valueSet

The value set is provided directly as a part of the request.
Request
Response
1
POST [base]/ValueSet/$validate-code
2
{
3
"resourceType" : "Parameters",
4
"parameter" : [
5
{
6
"name" : "code",
7
"valueCode" : "male"
8
},
9
{
10
"name" : "system",
11
"valueUri" : "http://hl7.org/fhir/administrative-gender"
12
},
13
{
14
"name" : "valueSet",
15
"resource" : {
16
"resourceType": "ValueSet",
17
"url": "http://custom/administrative-gender",
18
"compose": {
19
"include": [
20
{
21
"valueSet": ["http://hl7.org/fhir/ValueSet/administrative-gender"]
22
}
23
]
24
}
25
}
26
}
27
]
28
}
Copied!
1
{
2
"resourceType": "Parameters",
3
"parameter": [
4
{
5
"name": "result",
6
"valueBoolean": true
7
}
8
]
9
}
Copied!

coding

A coding to validate
Request
Rsponse
1
POST [base]/ValueSet/$validate-code
2
{
3
"resourceType" : "Parameters",
4
"parameter" : [
5
{
6
"name" : "coding",
7
"valueCoding" :
8
{
9
"system": "http://hl7.org/fhir/administrative-gender",
10
"code": "male"
11
}
12
},
13
{
14
"name" : "url",
15
"valueUri" : "http://hl7.org/fhir/ValueSet/administrative-gender"
16
}
17
]
18
}
Copied!
1
{
2
"resourceType": "Parameters",
3
"parameter": [
4
{
5
"name": "result",
6
"valueBoolean": true
7
}
8
]
9
}
Copied!

codeableConcept

A full codeableConcept to validate.
Request
Response
1
POST [base]/ValueSet/$validate-code
2
{
3
"resourceType" : "Parameters",
4
"parameter" : [
5
{
6
"name" : "codeableConcept",
7
"valueCodeableConcept" :
8
{
9
"coding":
10
[
11
{
12
"system": "http://hl7.org/fhir/administrative-gender",
13
"code": "male_wrong"
14
},
15
{
16
"system": "http://hl7.org/fhir/administrative-gender",
17
"code": "male"
18
}
19
]
20
}
21
},
22
{
23
"name" : "url",
24
"valueUri" : "http://hl7.org/fhir/ValueSet/administrative-gender"
25
}
26
]
27
}
Copied!
1
{
2
"resourceType": "Parameters",
3
"parameter": [
4
{
5
"name": "result",
6
"valueBoolean": true
7
}
8
]
9
}
Copied!
Last modified 8mo ago