FHIR Terminology Ecosystem IG, published by HL7 FHIR Product Director. This guide is not an authorized publication; it is the continuous build for version 1.9.5-SNAPSHOT built by the FHIR (HL7® FHIR® Standard) CI Build. This version is based on the current content of https://github.com/HL7/fhir-tx-ecosystem-ig/ and changes regularly. See the Directory of published versions
The test cases are expressed in R5, but are intended to test R4 servers as well (in fact, most servers that are tested are R4 servers).
How R4 testing works is that the Test Case runner that runs
when the validator runs the test cases asks the server what
version of FHIR it speaks - first by calling $versions, and
if the server doesn't support that, by reading
CapabilityStatement.fhirVersion from /metadata - and then
converts all the requests and responses between R5 and R4 on
the fly.
You don't tell the runner which version to test; it is a property of the server. If the runner cannot determine the version, it stops rather than guessing.
The /tests directory contains a /test/r4 subdirectory that contains a copy of all the requests converted to R4 to help with understanding the conversion process. Unfortunately, because the responses are not valid resources, there's no similar conversion process.
This documentation has to suffice.
The main difference is around ValueSet.expansion.property and ValueSet.expansion.contains.property. The Test Case runner uses cross-version extensions for these in R4. Here's an example in R5 for a response with properties:
"expansion" : {
"property" : [{
"code" : "definition",
"uri" : "http://hl7.org/fhir/concept-properties#definition"
}],
}
Note: some JSON properties have been omitted.
Here's the same definition in R4:
"expansion" : {
"extension" : [{
"extension" : [{
"url" : "uri",
"valueUri" : "http://hl7.org/fhir/concept-properties#definition"
},
{
"url" : "code",
"valueCode" : "definition"
}],
"url" : "http://hl7.org/fhir/5.0/StructureDefinition/extension-ValueSet.expansion.property"
}]
}
Properties on contained entries are similar. R5:
"contains" : [{
"system" : "http://hl7.org/fhir/test/CodeSystem/simple",
"code" : "code1",
"display" : "Display 1",
"designation" : [{
"use" : {
"system" : "http://hl7.org/fhir/test/CodeSystem/designations",
"code" : "olde-english"
},
"value" : "mine own first code"
}],
"property" : [{
"code" : "definition",
"valueString" : "My first code"
}]
}]
and in R4:
"contains" : [{
"extension" : [{
"extension" : [{
"url" : "code",
"valueCode" : "definition"
},
{
"url" : "value",
"valueString" : "My first code"
}],
"url" : "http://hl7.org/fhir/5.0/StructureDefinition/extension-ValueSet.expansion.contains.property"
}],
"system" : "http://hl7.org/fhir/test/CodeSystem/simple",
"code" : "code1",
"display" : "Display 1",
"designation" : [{
"use" : {
"system" : "http://hl7.org/fhir/test/CodeSystem/designations",
"code" : "olde-english"
},
"value" : "mine own first code"
}]
}]