public String toHTMLString(int level, String lang) { StringBuilder sb = new StringBuilder(); sb.append(toHTMLStringSingle(level, lang)).append("<br/>"); String prefix = ""; for (RuleLine ruleLine : getChildrenRuleLines().getRuleLines()) { sb.append(prefix); sb.append(ruleLine.toHTMLString(level + 1, lang)); prefix = "<br/>"; } return sb.toString(); }
public CreateInstanceActionRuleLine() { super(CDSLanguageManager.getMessage("CreateInstance"), CDSLanguageManager.getMessage("CreateInstanceDesc")); cdsEntryRuleLineElement = new CDSEntryRuleLineElement(this); getRuleLineElements().add(new StaticTextRuleLineElement(this, "CreateInstanceRLE")); getRuleLineElements().add(cdsEntryRuleLineElement); }
CreateInstanceActionRuleLine cirl = new CreateInstanceActionRuleLine(); ruleLines.add(cirl); RuleLineCollection ruleLinesAssignmentInstance = new RuleLineCollection(cirl.getReadableGuide()); if (!(expressionItemAux instanceof MultipleAssignmentExpression)) { throw new InternalErrorException(new Exception("Unknown expression in creation statement '" + expressionItemAux.toString() + "'")); cirl.addChildRuleLine(ruleLine); cirl.setCDSEntryGTCodeRuleLineElementValue(gtCodeRuleLineElement); } else if (OpenEHRConst.NULL_FLAVOR_ATTRIBUTE.equals(attribute)) { SetElementWithNullValueActionRuleLine sewnvrl = new SetElementWithNullValueActionRuleLine();
@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; } }
public String toString() { StringBuilder sb = new StringBuilder(); sb.append(super.toString()); for (RuleLine ruleLine : getChildrenRuleLines().getRuleLines()) { sb.append(ruleLine.toString()); sb.append("\n"); } return sb.toString(); }