You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
The changes in #6360 introduced a bug because the issue detail code for Remote Terminology $validate-code calls was set to always be invalid-code.
The org.hl7.fhir.core, more specifically org.hl7.fhir.validation library expects invalid-code to be used only for CodeSystem$validate-code and is expecting to see codes like not-in-vs for ValueSet$validate-code in cases when a code is not found in an existing ValueSet. This happens in org.hl7.fhir.validation.instance.InstanceValidator#processTxIssues.
When trying to use a profile where a binding for an element against a ValueSet is extensible, the validate operation will return an error which is not expected in this case because the code does exist in the extended profile binding.
Create a custom profile for Encounter resources and store it to a hapi-fhir repository: profile-encounter.json
Setup a hapi-fhir client with a validator that includes an instance of RemoteTerminologyValidationSupportService with https://r4.ontoserver.csiro.au/fhir/.
e.g.
String remoteTerminologyServerUrl = "https://r4.ontoserver.csiro.au/fhir/";
FhirContext fhirCtx = FhirContext.forR4Cached();
FhirInstanceValidator fhirInstanceValidator = new FhirInstanceValidator(fhirCtx);
ValidationSupportChain validationSupport = new ValidationSupportChain(
new DefaultProfileValidationSupport(fhirCtx),
new RemoteTerminologyValidationSupportService(fhirCtx, remoteTerminologyServerUrl);
);
validator.setValidationSupport(validationSupport);
FhirValidator fhirValidator = fhirCtx.newValidator();
fhirValidator.registerValidatorModule(fhirInstanceValidator);
Create an encounter resource instance with an identifier that should be valid according to the profile.
e.g.
You will notice the following issue with severity error: The provided code 'http://terminology.hl7.org/CodeSystem/v2-0203#VN' was not found in the value set 'http://hl7.org/fhir/ValueSet/identifier-type|5.0.0-ballot'
Expected behaviour
No error should be returned since the profile http://hl7.org/fhir/StructureDefinition/Identifier which is in the hierarchy states that element Identifier.type has an extensible binding and the code VN exists in CodeSystemhttp://terminology.hl7.org/CodeSystem/v2-0203 which is the extended binding in the profile created at step 1.
Environment (please complete the following information):
HAPI FHIR Version 7.4.4
The text was updated successfully, but these errors were encountered:
Describe the bug
The changes in #6360 introduced a bug because the issue detail code for Remote Terminology
$validate-code
calls was set to always beinvalid-code
.The org.hl7.fhir.core, more specifically org.hl7.fhir.validation library expects
invalid-code
to be used only forCodeSystem
$validate-code
and is expecting to see codes likenot-in-vs
forValueSet
$validate-code
in cases when a code is not found in an existing ValueSet. This happens inorg.hl7.fhir.validation.instance.InstanceValidator#processTxIssues
.When trying to use a profile where a binding for an element against a
ValueSet
is extensible, the validate operation will return an error which is not expected in this case because the code does exist in the extended profile binding.See: https://github.com/hapifhir/org.hl7.fhir.core/blob/master/org.hl7.fhir.validation/src/main/java/org/hl7/fhir/validation/instance/InstanceValidator.java#L1718
To Reproduce
Steps to reproduce the behaviour:
profile-encounter.json
RemoteTerminologyValidationSupportService
withhttps://r4.ontoserver.csiro.au/fhir/
.e.g.
e.g.
VN
The provided code 'http://terminology.hl7.org/CodeSystem/v2-0203#VN' was not found in the value set 'http://hl7.org/fhir/ValueSet/identifier-type|5.0.0-ballot'
Expected behaviour
No error should be returned since the profile
http://hl7.org/fhir/StructureDefinition/Identifier
which is in the hierarchy states that elementIdentifier.type
has an extensible binding and the codeVN
exists inCodeSystem
http://terminology.hl7.org/CodeSystem/v2-0203
which is the extended binding in the profile created at step 1.Environment (please complete the following information):
The text was updated successfully, but these errors were encountered: