From 89e3cac0e284e83522cf4627112f28c7f2a6713e Mon Sep 17 00:00:00 2001 From: Matti Uusitalo Date: Mon, 17 Dec 2018 13:55:15 +0200 Subject: [PATCH] Corrected problems caused by merge --- .../QuestionnaireResponseValidatorDstu3Test.java | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/hapi-fhir-validation/src/test/java/org/hl7/fhir/dstu3/hapi/validation/QuestionnaireResponseValidatorDstu3Test.java b/hapi-fhir-validation/src/test/java/org/hl7/fhir/dstu3/hapi/validation/QuestionnaireResponseValidatorDstu3Test.java index 9c9eb9ea785..e50b14f40bc 100644 --- a/hapi-fhir-validation/src/test/java/org/hl7/fhir/dstu3/hapi/validation/QuestionnaireResponseValidatorDstu3Test.java +++ b/hapi-fhir-validation/src/test/java/org/hl7/fhir/dstu3/hapi/validation/QuestionnaireResponseValidatorDstu3Test.java @@ -347,20 +347,12 @@ public class QuestionnaireResponseValidatorDstu3Test { } @Test - public void testRequiredQuestionWithEnableWhenHidesQuestionHasAnswerTrue() { + public void testEnableWhenWithHasAnswerTrueDisablesQuestionWhenNoAnswerIsPresent() { Questionnaire q = new Questionnaire(); - q.addItem().setLinkId("link0").setRequired(true).setType(QuestionnaireItemType.STRING); + q.addItem().setLinkId("link0").setRequired(false).setType(QuestionnaireItemType.STRING); + q.addItem().setLinkId("link1").setRequired(true).addEnableWhen().setQuestion("link0").setHasAnswer(true); - // create the questionnaire - QuestionnaireItemComponent item1 = new QuestionnaireItemComponent(); - item1.setLinkId("link1").setRequired(true); - q.addItem(item1); - QuestionnaireItemEnableWhenComponent enable = new QuestionnaireItemEnableWhenComponent(); - item1.addEnableWhen(enable); - enable.setQuestion("link0"); - enable.setHasAnswer(true); - QuestionnaireResponse qa = new QuestionnaireResponse(); qa.setStatus(QuestionnaireResponseStatus.COMPLETED);