public ElementComparisonWithNullValueConditionRuleLine() { super(OpenEHRLanguageManager.getMessage("CompareElementWithNullValue"), OpenEHRLanguageManager.getMessage("CompareElementWithNullValueDesc")); archetypeElementRuleLineElement = new ArchetypeElementRuleLineElement(this); equalityComparisonOperatorRuleLineElement = new EqualityComparisonOperatorRuleLineElement(this); nullValueRuleLineElement = new NullValueRuleLineElement(this); getRuleLineElements().add(new StaticTextRuleLineElement(this, "ElementRLE")); getRuleLineElements().add(archetypeElementRuleLineElement); getRuleLineElements().add(new StaticTextRuleLineElement(this, "NullValueRLE")); getRuleLineElements().add(equalityComparisonOperatorRuleLineElement); getRuleLineElements().add(nullValueRuleLineElement); }
public ExpressionItem toExpressionItem() throws IllegalStateException { ArchetypeElementVO archetypeElementVO = getArchetypeElementRuleLineElement().getArchetypeElementVO(); if (archetypeElementVO != null) { String gtCode = getArchetypeElementRuleLineElement().getValue().getValue(); DataValue nullValue = getNullValueRuleLineElement().getValue(); if (nullValue == null) { throw new IllegalStateException("No null value set"); getEqualityComparisonOperatorRuleLineElement().getValue(); if (operatorKind == null) { throw new IllegalStateException("No operator kind set"); String name = getArchetypeManager().getArchetypeElements().getText(archetypeElementVO, getLanguage()); return new BinaryExpression( new Variable( operatorKind); } else { throw new IllegalStateException("Element instance not found for" + this.toString());
ElementComparisonWithNullValueConditionRuleLine ecwnvc = new ElementComparisonWithNullValueConditionRuleLine(); addRuleLine(ecwnvc, ruleLines, parentRuleLine); ecwnvc.getArchetypeElementRuleLineElement().setValue(gtCodeRuleLineElement); ConstantExpression constantExpression = (ConstantExpression) binaryExpression.getRight(); String dvStr = constantExpression.getValue(); DataValue dv = parseDataValue(OpenEHRDataValues.DV_CODED_TEXT, dvStr, null); if (dv instanceof DvCodedText) { ecwnvc.getNullValueRuleLineElement().setValue((DvCodedText) dv); ecwnvc.getEqualityComparisonOperatorRuleLineElement().setValue(binaryExpression.getOperator()); } else { ElementAttributeComparisonConditionRuleLine eaccrl = new ElementAttributeComparisonConditionRuleLine();