Fixed bug in finding QuestionnaireResponse child items

This commit is contained in:
Okko Kauhanen 2018-11-05 17:49:12 +02:00
parent 4c4c8ba87a
commit c099fcda0a
1 changed files with 1 additions and 2 deletions

View File

@ -46,7 +46,6 @@ public class DefaultEnableWhenEvaluator implements IEnableWhenEvaluator {
protected EnableWhenResult evaluateCondition(QuestionnaireItemEnableWhenComponent enableCondition, protected EnableWhenResult evaluateCondition(QuestionnaireItemEnableWhenComponent enableCondition,
Element questionnaireResponse, String linkId) { Element questionnaireResponse, String linkId) {
//TODO: Fix EnableWhenResult stuff
List<Element> answerItems = findQuestionAnswers(questionnaireResponse, List<Element> answerItems = findQuestionAnswers(questionnaireResponse,
enableCondition.getQuestion()); enableCondition.getQuestion());
QuestionnaireItemOperator operator = enableCondition.getOperator(); QuestionnaireItemOperator operator = enableCondition.getOperator();
@ -157,7 +156,7 @@ public class DefaultEnableWhenEvaluator implements IEnableWhenEvaluator {
return true; return true;
} }
private List<Element> findSubItems(Element item) { private List<Element> findSubItems(Element item) {
List<Element> results = item.getChildren(LINKID_ELEMENT) List<Element> results = item.getChildren(ITEM_ELEMENT)
.stream() .stream()
.flatMap(i -> findSubItems(i).stream()) .flatMap(i -> findSubItems(i).stream())
.collect(Collectors.toList()); .collect(Collectors.toList());