From 38a2b17a5e7ee9c862ed101010f27d2f93ad37d0 Mon Sep 17 00:00:00 2001 From: Okko Kauhanen Date: Mon, 5 Nov 2018 13:00:32 +0200 Subject: [PATCH] fix enablewhen result --- .../fhir/r4/validation/EnableWhenResult.java | 48 +++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100644 hapi-fhir-validation/src/main/java/org/hl7/fhir/r4/validation/EnableWhenResult.java diff --git a/hapi-fhir-validation/src/main/java/org/hl7/fhir/r4/validation/EnableWhenResult.java b/hapi-fhir-validation/src/main/java/org/hl7/fhir/r4/validation/EnableWhenResult.java new file mode 100644 index 00000000000..4f6d5d7f7db --- /dev/null +++ b/hapi-fhir-validation/src/main/java/org/hl7/fhir/r4/validation/EnableWhenResult.java @@ -0,0 +1,48 @@ +package org.hl7.fhir.r4.validation; + + +import org.hl7.fhir.r4.elementmodel.Element; +import org.hl7.fhir.r4.model.Questionnaire.QuestionnaireItemEnableWhenComponent; + +public class EnableWhenResult { + private final boolean enabled; + private final QuestionnaireItemEnableWhenComponent enableWhenCondition; + private final Element answerItem; + private final String linkId; + + /** + * Evaluation result of enableWhen condition + * + * @param enabled + * Evaluation result + * @param linkId + * LinkId of the questionnaire item + * @param enableWhenCondition + * Evaluated enableWhen condition + * @param responseItem + * item in QuestionnaireResponse + */ + public EnableWhenResult(boolean enabled, String linkId, QuestionnaireItemEnableWhenComponent enableWhenCondition, + Element answerItem) { + this.enabled = enabled; + this.linkId = linkId; + this.answerItem = answerItem; + this.enableWhenCondition = enableWhenCondition; + } + + public boolean isEnabled() { + return enabled; + } + + public String getLinkId() { + return linkId; + } + + public Element getAnswerItem() { + return answerItem; + } + + public QuestionnaireItemEnableWhenComponent getEnableWhenCondition() { + return enableWhenCondition; + } +}