When a value set includes two versions of the same code system, $validate-code
pins one of them before it checks the display, so a coding that is valid under
the other version fails.
http://hl7.org/fhir/test/ValueSet/overload-all of the terminology ecosystem
suite includes overload|1.0.0 and overload|2.0.0. In 1.0.0 code2 displays
"Display 2"; in 2.0.0 it displays "Display #2". A Coding of code2 with
"Display 2" and no version is a member of that value set through the 1.0.0
include, with the display that include's version states, so the answer is
result = true with version = 1.0.0. The server answers result = false with
version = 2.0.0 and an invalid-display issue.
R5 states the input as "A coding to validate. The system must match the
specified code system"
(tools/fhir-codegen/vendor/hl7.fhir.r5.core/package/OperationDefinition-ValueSet-validate-code.json),
and the version output as "The version of the system of the code that was
validated": the version reported is the one the code actually validated in, so
the choice among the versions a value set includes belongs to the validation,
not before it. crates/fhir-terminology/src/operations/value_set_validate_code.rs
already has containing_version, which picks the first version holding the
code; it needs to prefer a version that also accepts the asserted display, and
the same choice governs which version an exclude at another version removes.
Five general cases turn on this: overload/validate-good2a,
overload/validate-good-code2-v1display, overload/validate-bad-exclude-code1,
overload/validate-bad-v1code4, and overload/validate-bad-v2code3.
Acceptance criteria
When a value set includes two versions of the same code system,
$validate-codepins one of them before it checks the display, so a coding that is valid under
the other version fails.
http://hl7.org/fhir/test/ValueSet/overload-allof the terminology ecosystemsuite includes
overload|1.0.0andoverload|2.0.0. In 1.0.0code2displays"Display 2"; in 2.0.0 it displays "Display #2". A
Codingofcode2with"Display 2" and no version is a member of that value set through the 1.0.0
include, with the display that include's version states, so the answer is
result = truewithversion = 1.0.0. The server answersresult = falsewithversion = 2.0.0and aninvalid-displayissue.R5 states the input as "A coding to validate. The system must match the
specified code system"
(
tools/fhir-codegen/vendor/hl7.fhir.r5.core/package/OperationDefinition-ValueSet-validate-code.json),and the
versionoutput as "The version of the system of the code that wasvalidated": the version reported is the one the code actually validated in, so
the choice among the versions a value set includes belongs to the validation,
not before it.
crates/fhir-terminology/src/operations/value_set_validate_code.rsalready has
containing_version, which picks the first version holding thecode; it needs to prefer a version that also accepts the asserted display, and
the same choice governs which version an exclude at another version removes.
Five
generalcases turn on this:overload/validate-good2a,overload/validate-good-code2-v1display,overload/validate-bad-exclude-code1,overload/validate-bad-v1code4, andoverload/validate-bad-v2code3.Acceptance criteria
picks the one under which the coding is valid, and reports that version.
displays differ.
overloadcases pass on/r4b,/r4, and/r5and join thecommitted pass lists.