@Override public ExpressionItem toExpressionItem() throws IllegalStateException { String gtCode = firedRuleReferenceRuleElement.getValue().getValue(); return new UnaryExpression(new Variable(gtCode), firedRuleOperatorRuleLineElement.getValue()); } }
public AssignmentExpression toAssignmentExpression() throws IllegalStateException { if (archetypeElementRuleLineElement.getValue() == null) { throw new IllegalStateException("No variable set"); } Variable var = new Variable( archetypeElementRuleLineElement.getValue().getValue(), null, null, OpenEHRConst.NULL_FLAVOR_ATTRIBUTE); DvCodedText nullValue = nullValueRuleLineElement.getValue(); if (nullValue == null) { throw new IllegalStateException("No null value set"); } String dataValueStr = nullValue.toString(); LoggerFactory.getLogger(SetElementAttributeActionRuleLine.class).debug("dataValueStr: " + dataValueStr); return new AssignmentExpression( var, new ConstantExpression(dataValueStr)); } }
public ExpressionItem toExpressionItem() throws IllegalStateException { ArchetypeElementVO archetypeElementVO = getArchetypeElement(); if (archetypeElementVO != null) { String path = archetypeElementVO.getPath(); OperatorKind operatorKind = getExistenceOperatorRuleLineElement().getOperator(); if (operatorKind == null) { throw new IllegalStateException("No operator set"); } String name = getArchetypeManager().getArchetypeElements().getText(archetypeElementVO, getLanguage()); return new BinaryExpression( new Variable(null, name, path), new ConstantExpression(NULL_STR), operatorKind); } else { throw new IllegalStateException("Element instance not found for" + this.toString()); } }
@Override public AssignmentExpression toAssignmentExpression() throws IllegalStateException { ArchetypeReference archetypeReference = getArchetypeReference(); if (archetypeReference != null) { String name = archetypeReference.getIdArchetype(); Variable var = new Variable( cdsEntryRuleLineElement.getValue().getValue(), null, name, CreateInstanceExpression.FUNCTION_CREATE_NAME); List<AssignmentExpression> assignmentExpressions = new ArrayList<>(); if (!getChildrenRuleLines().getRuleLines().isEmpty()) { for (RuleLine childRuleLine : getChildrenRuleLines().getRuleLines()) { AssignmentExpressionRuleLine assignmentExpressionRuleLine = (AssignmentExpressionRuleLine) childRuleLine; assignmentExpressions.add(assignmentExpressionRuleLine.toAssignmentExpression()); } } else { log.debug("No assignment rules on create instance action rule"); return null; } return new CreateInstanceExpression( var, assignmentExpressions); } else { log.debug("No archetype reference set on create instance action rule"); return null; } }
@Override public ExpressionItem toExpressionItem() { ArchetypeElementVO archetypeElementVO = getArchetypeElementRuleLineDefinitionElement().getValue(); String path = archetypeElementVO.getPath(); OperatorKind operatorKind = getFunctionRuleLineElement().getValue(); String name = getArchetypeManager().getArchetypeElements().getText(archetypeElementVO, getLanguage()); return new UnaryExpression( new Variable(null, name, path), operatorKind); }
public ExpressionItem toExpressionItem() throws IllegalStateException { ArchetypeElementVO archetypeElementVO = getArchetypeElementRuleLineElement().getArchetypeElementVO(); if (archetypeElementVO != null) { String gtCode = getArchetypeElementRuleLineElement().getValue().getValue(); if (getSecondArchetypeElementRuleLineElement().getValue() == null) { throw new IllegalStateException("No expression set"); } String secondGtCode = getSecondArchetypeElementRuleLineElement().getValue().getValue(); OperatorKind operatorKind = getComparisonOperatorRuleLineElement().getValue(); if (operatorKind == null) { throw new IllegalStateException("No operator kind set"); } String name = getArchetypeManager().getArchetypeElements().getText(archetypeElementVO, getLanguage()); return new BinaryExpression( new Variable(gtCode, null, name), new Variable(secondGtCode), operatorKind); } else { throw new IllegalStateException("Invalid rule line: " + getArchetypeElementRuleLineElement()); } } }
public AssignmentExpression toAssignmentExpression() throws IllegalStateException { ArchetypeElementVO archetypeElementVO = getArchetypeElementRuleLineElement().getArchetypeElementVO(); if (archetypeElementVO == null) { throw new IllegalStateException("No variable set"); } String name = getArchetypeManager().getArchetypeElements().getText(archetypeElementVO, getLanguage()); Variable var = new Variable( archetypeElementRuleLineElement.getValue().getValue(), null, name); ArchetypeElementVO archetypeElementVO2 = getSecondArchetypeElementRuleLineElement().getArchetypeElementVO(); if (archetypeElementVO2 == null) { throw new IllegalStateException("No variable to assign set"); } Variable varAux = new Variable( archetypeElementRuleLineElement2.getValue().getValue(), null, name); return new AssignmentExpression(var, varAux);//TODO }
public AssignmentExpression toAssignmentExpression() throws IllegalStateException { if (archetypeElementAttributeRuleLineElement.getValue() == null || archetypeElementAttributeRuleLineElement.getValue().getValue() == null) { throw new IllegalStateException("No variable set"); } Variable var = new Variable( archetypeElementAttributeRuleLineElement.getValue().getValue().getValue(), null, null, archetypeElementAttributeRuleLineElement.getAttribute()); return new AssignmentExpression( var, expressionRuleLineElement.getValue()); }
@Override public ExpressionItem toExpressionItem() { ArchetypeElementVO archetypeElementVO = getArchetypeElementRuleLineDefinitionElement().getValue(); String path = archetypeElementVO.getPath(); DataValue dataValue = getDataValueRuleLineElement().getValue(); OperatorKind operatorKind = getComparisonOperatorRuleLineElement().getValue(); ConstantExpression constantExpression; if (dataValue != null) { constantExpression = DVUtil.convertToExpression(dataValue); } else { throw new IllegalStateException("No data value set"); } String name = getArchetypeManager().getArchetypeElements().getText(archetypeElementVO, getLanguage()); return new BinaryExpression( new Variable(null, name, path), constantExpression, operatorKind); }
public ExpressionItem toExpressionItem() throws IllegalStateException { ArchetypeElementVO archetypeElementVO = getArchetypeElementRuleLineElement().getArchetypeElementVO(); if (archetypeElementVO != null) { String gtCode = getArchetypeElementRuleLineElement().getValue().getValue(); OperatorKind operatorKind = getExistenceOperatorRuleLineElement().getOperator(); if (operatorKind == null) { log.debug("No operator set"); return null; } String name = getArchetypeManager().getArchetypeElements().getText(archetypeElementVO, getLanguage()); return new BinaryExpression( new Variable(gtCode, null, name), new ConstantExpression(NULL_STR), operatorKind); } else { log.debug("Element instance not found for" + this.toString()); return null; } } }
@Override public ExpressionItem toExpressionItem() { ArchetypeElementVO archetypeElementVO = getArchetypeElementAttributeRuleLineDefinitionElement().getValue(); String attribute = getArchetypeElementAttributeRuleLineDefinitionElement().getAttribute(); String path = archetypeElementVO.getPath() + "/value/" + attribute; ExpressionRuleLineElement expressionRuleLineElement = getExpressionRuleLineElement(); OperatorKind operatorKind = getComparisonOperatorRuleLineElement().getValue(); String name = getArchetypeManager().getArchetypeElements().getText(archetypeElementVO, getLanguage()); return new BinaryExpression( new Variable(null, name, path), expressionRuleLineElement.getValue(), operatorKind); }
public ExpressionItem toExpressionItem() throws IllegalStateException { ArchetypeElementVO archetypeElementVO = getArchetypeElementRuleLineElement().getArchetypeElementVO(); if (archetypeElementVO != null) { String gtCode = getArchetypeElementRuleLineElement().getValue().getValue(); DataValue dataValue = getArchetypeDataValueRuleLineElement().getValue(); ConstantExpression constantExpression; if (dataValue != null) { constantExpression = DVUtil.convertToExpression(dataValue); } else { log.debug("No data value set"); return null; } OperatorKind operatorKind = getComparisonOperatorRuleLineElement().getValue(); if (operatorKind == null) { log.debug("No operator set"); return null; } String name = getArchetypeManager().getArchetypeElements().getText(archetypeElementVO, getLanguage()); return new BinaryExpression( new Variable(gtCode, null, name), constantExpression, operatorKind); } else { log.debug("Element instance not found for " + this.toString()); return null; } }
public AssignmentExpression toAssignmentExpression() throws IllegalStateException { ArchetypeElementVO archetypeElementVO = getArchetypeElementRuleLineElement().getArchetypeElementVO(); if (archetypeElementVO == null) { log.debug("No variable set on assignment expression"); return null; } String name = getArchetypeManager().getArchetypeElements().getText(archetypeElementVO, getLanguage()); Variable var = new Variable( archetypeElementRuleLineElement.getValue().getValue(), null, name); DataValue dataValue = archetypeDataValueRuleLineElement.getValue(); ConstantExpression constantExpression; if (dataValue != null) { constantExpression = DVUtil.convertToExpression(dataValue); } else { log.debug("No data value set"); return null; } return new AssignmentExpression( var, constantExpression); } }
new Variable( gtCode, name,
public ExpressionItem toExpressionItem() throws IllegalStateException { if (archetypeElementAttributeRuleLineElement != null && getArchetypeElementAttributeRuleLineElement().getValue() != null) { String gtCode = getArchetypeElementAttributeRuleLineElement().getValue().getValue().getValue(); ExpressionRuleLineElement expressionRuleLineElement = getExpressionRuleLineElement(); OperatorKind operatorKind = getComparisonOperatorRuleLineElement().getValue(); if (operatorKind == null) { throw new IllegalStateException("No operator kind set"); } Variable var = new Variable(gtCode, null, null, getArchetypeElementAttributeRuleLineElement().getAttribute()); if (expressionRuleLineElement.getValue() == null) { throw new IllegalStateException("No expression set"); } return new BinaryExpression( var, expressionRuleLineElement.getValue(), operatorKind); } else { throw new IllegalStateException("Element instance not found for" + this.toString()); } }
{if (true) return new Variable(code, label, path, attribute);} throw new Error("Missing return statement in function");