Filter Extensions from enablewhen evaluation

This commit is contained in:
Matti Uusitalo 2018-12-12 14:22:38 +02:00
parent 755eaa5f25
commit a1f79a2063
2 changed files with 6 additions and 1 deletions

View File

@ -11,7 +11,7 @@
<artifactId>hapi-fhir-validation</artifactId>
<packaging>bundle</packaging>
<version>3.6.1-PHRFIX</version>
<version>3.6.2-PHRFIX</version>
<name>HAPI FHIR - Validation</name>

View File

@ -143,9 +143,14 @@ public class DefaultEnableWhenEvaluator implements IEnableWhenEvaluator {
return item.getChildrenByName(ANSWER_ELEMENT)
.stream()
.flatMap(c -> c.getChildren().stream())
.filter(DefaultEnableWhenEvaluator::notExtension)
.collect(Collectors.toList());
}
private static boolean notExtension(Element e) {
return !Extension.class.isAssignableFrom(e.getClass());
}
private boolean compareCodingAnswer(Coding expectedAnswer, Coding actualAnswer, QuestionnaireItemOperator questionnaireItemOperator) {
boolean result = compareSystems(expectedAnswer, actualAnswer) && compareCodes(expectedAnswer, actualAnswer);
if (questionnaireItemOperator == QuestionnaireItemOperator.EQUAL){