public ArchetypeReference getArchetypeReference() { ArchetypeInstantiationRuleLine airl = getArchetypeInstantiationRuleLine(); if (airl != null) { return airl.getArchetypeReference(); } else { return null; } }
public void setArchetypeReference(ArchetypeReference ar) { getArchetypeReferenceRuleLineDefinitionElement().setValue(ar); }
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(); }
private void generateGtCodeMapForArchetypeBinding(ArchetypeBinding archetypeBinding) throws InternalErrorException { ArchetypeInstantiationRuleLine airl = new ArchetypeInstantiationRuleLine(); airl.setReadableGuide(readableGuide); airl.setGTCode(archetypeBinding.getId()); ArchetypeReference ar = new ArchetypeReference( archetypeBinding.getDomain(), archetypeBinding.getArchetypeId(), archetypeBinding.getTemplateId()); airl.setArchetypeReference(ar); gtCodeElementMap.put(archetypeBinding.getId(), airl); if (archetypeBinding.getElements() != null) { for (ElementBinding elementBinding : archetypeBinding.getElements().values()) { generateGTCodeMapForElementBinding(archetypeBinding, airl, elementBinding); } } }
String dvStr = constantExpression2.getValue(); ArchetypeElementVO archetypeElementVO = airl.getArchetypeManager().getArchetypeElements().getArchetypeElement( archetypeBinding.getTemplateId(), archetypeBinding.getArchetypeId() + path); airl.addChildRuleLine(wepdrl); wepdrl.getArchetypeElementRuleLineDefinitionElement().setValue(archetypeElementVO); String rmType = archetypeElementVO.getType(); } else { WithElementPredicateExistsDefinitionRuleLine wepedrl = new WithElementPredicateExistsDefinitionRuleLine(); airl.addChildRuleLine(wepedrl); wepedrl.getArchetypeElementRuleLineDefinitionElement().setValue(archetypeElementVO); wepedrl.getExistenceOperatorRuleLineElement().setValue(binaryExpression.getOperator().getSymbol() + "null"); path = StringUtils.substringBeforeLast(path, "/value/"); ArchetypeElementVO archetypeElementVO = airl.getArchetypeManager().getArchetypeElements().getArchetypeElement( archetypeBinding.getTemplateId(), archetypeBinding.getArchetypeId() + path); WithElementPredicateFunctionDefinitionRuleLine wefd = new WithElementPredicateFunctionDefinitionRuleLine(); Variable variable = (Variable) unaryExpression.getOperand(); airl.addChildRuleLine(wefd); String path = variable.getPath(); ArchetypeElementVO archetypeElementVO = airl.getArchetypeManager().getArchetypeElements().getArchetypeElement( archetypeBinding.getTemplateId(),
public ArchetypeElementInstantiationRuleLine( ArchetypeInstantiationRuleLine archetypeInstantiationRuleLine) { super(OpenEHRLanguageManager.getMessage("ArchetypeElementInstantiation"), OpenEHRLanguageManager.getMessage("ArchetypeElementInstantiationDesc")); if (archetypeInstantiationRuleLine != null) { archetypeInstantiationRuleLine.addChildRuleLine(this); } archetypeElementRuleLineDefinitionElement = new ArchetypeElementRuleLineDefinitionElement(this); gtCodeRuleLineElement = new GTCodeRuleLineElement(this); getRuleLineElements().add(new StaticTextRuleLineElement(this, "InstantiateElementRLE")); getRuleLineElements().add(archetypeElementRuleLineDefinitionElement); getRuleLineElements().add(new StaticTextRuleLineElement(this, "asRLE")); getRuleLineElements().add(gtCodeRuleLineElement); }
public String getGTCode() { return getGTCodeRuleLineElement().getValue(); }
private static String getPredicateDescription(ArchetypeInstantiationRuleLine airl) { StringBuilder sb = new StringBuilder(); String prefix = ""; for (RuleLine ruleLine : airl.getChildrenRuleLines().getRuleLines()) { if (ruleLine instanceof PredicateRuleLine) { sb.append(prefix); sb.append(((PredicateRuleLine) ruleLine).getPredicateDescription()); prefix = ", "; } } return sb.toString(); }
public ArchetypeInstantiationRuleLine() { super(OpenEHRLanguageManager.getMessage("ArchetypeInstantiation"), OpenEHRLanguageManager.getMessage("ArchetypeInstantiationDesc")); archetypeReferenceRuleLineDefinitionElement = new ArchetypeReferenceRuleLineDefinitionElement(this); gtCodeRuleLineElement = new GTCodeRuleLineElement(this); getRuleLineElements().add(new StaticTextRuleLineElement(this, "InstantiateArchetypeRLE")); getRuleLineElements().add(archetypeReferenceRuleLineDefinitionElement); }
public void generateGTCodeElementMap(Guide guide) throws InternalErrorException { gtCodeElementMap = new HashMap<>(); ArchetypeElementInstantiationRuleLine dummyAEIRL = new ArchetypeElementInstantiationRuleLine(new ArchetypeInstantiationRuleLine()); dummyAEIRL.setReadableGuide(readableGuide); dummyAEIRL.setGTCode("currentDateTime"); gtCodeElementMap.put("currentDateTime", dummyAEIRL); GuideDefinition guideDefinition = guide.getDefinition(); Map<String, ArchetypeBinding> ab = guideDefinition.getArchetypeBindings(); for (ArchetypeBinding archetypeBinding : ab.values()) { generateGtCodeMapForArchetypeBinding(archetypeBinding); } generateGTCodeMapForRules(guide); }
@Override public String getLabelText(String lang) { if (getArchetypeInstantiationRuleLine() != null) { return getArchetypeInstantiationRuleLine().getIdArchetype(); } else { return super.getLabelText(lang); } }
public WithElementPredicateExpressionDefinitionRuleLine( ArchetypeInstantiationRuleLine archetypeInstantiationRuleLine) { super(OpenEHRLanguageManager.getMessage("ElementPredicateExpression"), OpenEHRLanguageManager.getMessage("ElementPredicateExpressionDesc")); archetypeElementAttributeRuleLineDefinitionElement = new PredicateArchetypeElementAttributeRuleLineElement(this); comparisonOperatorRuleLineElement = new PredicateAttributeComparisonOperatorRuleLineElement(this); expressionRuleLineElement = new ExpressionRuleLineElement(this); if (archetypeInstantiationRuleLine != null) { archetypeInstantiationRuleLine.addChildRuleLine(this); } getRuleLineElements().add(new StaticTextRuleLineElement(this, "WithElementRLE")); getRuleLineElements().add(archetypeElementAttributeRuleLineDefinitionElement); getRuleLineElements().add(comparisonOperatorRuleLineElement); getRuleLineElements().add(expressionRuleLineElement); }
public void setGTCode(String term) { getGTCodeRuleLineElement().setValue(term); }
@Override public ArchetypeReference getArchetypeReference() { return getArchetypeReferenceRuleLineDefinitionElement().getValue(); }
public static String getDescription(ArchetypeInstantiationRuleLine airl) { if (airl != null) { ArchetypeReference ar = airl.getArchetypeReference(); if (ar != null) { return ar.getIdArchetype(); } } return "*UNKNOWN*"; }
public ArchetypeReference getArchetypeReference() { ArchetypeInstantiationRuleLine airl = getArchetypeInstantiationRuleLine(); if (airl != null) { return airl.getArchetypeReferenceRuleLineDefinitionElement().getValue(); } else { return null; } }
public String getIdArchetype() { return getArchetypeReference().getIdArchetype(); }
@Override public ArchetypeReference getArchetypeReference() { return getArchetypeInstantiationRuleLine().getArchetypeReferenceRuleLineDefinitionElement().getValue(); }
public static String getName(ArchetypeInstantiationRuleLine airl, boolean withPredicate) { if (airl != null) { ArchetypeReference ar = airl.getArchetypeReference(); if (ar != null) { String name = ar.getIdArchetype(); if (withPredicate) { String predicateDesc = getShortPredicateDescription(airl); if (!predicateDesc.isEmpty()) { name = name + " (" + predicateDesc + ")"; } } return name; } } LoggerFactory.getLogger(ArchetypeReference.class).warn("Unknown name for AR '" + airl + "'"); return "*UNKNOWN*"; }
@Override public ArchetypeReference getArchetypeReference() { return getArchetypeInstantiationRuleLine().getArchetypeReferenceRuleLineDefinitionElement().getValue(); }