Code validation fails when using PrePopulatedValidationSupport together with InMemoryTerminologyServerValidationSupport in a validation chain; when the value set include specifies a codesystem version.
This is internally caused by the valueset expansion not yielding any results.
The root cause seems to be that PrePopulatedValidationSupport is not version-aware, but InMemoryTerminologyServerValidationSupport uses canonical URLs (including pipe-separated version) to lookup codesystems from the context with the codesystemLoader.
To Reproduce
The following code snippet illustrates the issue:
IBaseResource csRes = prePopulatedSupport.fetchCodeSystem("https://example.nz/cs/example-code");
assertNotNull(csRes); // WORKS
IBaseResource vsRes = prePopulatedSupport.fetchValueSet("https://example.nz/vs/example-code");
assertNotNull(vsRes); // WORKS
// This is how InMemoryTerminologyServerValidationSupport looks up the codesystem
csRes = prePopulatedSupport.fetchCodeSystem("https://example.nz/cs/example-code|1.0");
assertNotNull(csRes); // FAILS
vsRes = prePopulatedSupport.fetchValueSet("https://example.nz/vs/example-code|1.0");
assertNotNull(vsRes); // FAILS
Describe the bug
Code validation fails when using
PrePopulatedValidationSupport
together withInMemoryTerminologyServerValidationSupport
in a validation chain; when the value set include specifies a codesystem version.This is internally caused by the valueset expansion not yielding any results.
The root cause seems to be that
PrePopulatedValidationSupport
is not version-aware, butInMemoryTerminologyServerValidationSupport
uses canonical URLs (including pipe-separated version) to lookup codesystems from the context with the codesystemLoader.To Reproduce The following code snippet illustrates the issue:
The root cause is shown here:
codesystem.xml
valueset.xml
Expected behavior The code validation to succeed.
Environment (please complete the following information):
Additional context Happy to provide a test case in a pull request if required.