use of com.b2international.commons.tree.NoopTreeVisitor in project snow-owl by b2ihealthcare.
the class SnomedEclLabelerRequest method expand.
private void expand(ExpressionConstraint constraint, final Map<String, String> labels) {
EObjectWalker.createContainmentWalker(new NoopTreeVisitor<EObjectTreeNode>() {
@Override
protected void doVisit(EObjectTreeNode node) {
if (node.getEObject() instanceof EclConceptReference) {
EclConceptReference ref = (EclConceptReference) node.getEObject();
String label = labels.get(ref.getId());
// if the given label is not the concept's ID then set the label
if (!Objects.equals(ref.getId(), label)) {
ref.setTerm(label);
}
// TODO report missing labels?
}
}
}).walk(constraint);
}
use of com.b2international.commons.tree.NoopTreeVisitor in project snow-owl by b2ihealthcare.
the class SnomedEclLabelerRequest method collect.
private Set<String> collect(ExpressionConstraint constraint) {
final Set<String> conceptIds = Sets.newHashSet();
EObjectWalker.createContainmentWalker(new NoopTreeVisitor<EObjectTreeNode>() {
@Override
protected void doVisit(EObjectTreeNode node) {
if (node.getEObject() instanceof EclConceptReference) {
EclConceptReference ref = (EclConceptReference) node.getEObject();
conceptIds.add(ref.getId());
}
}
}).walk(constraint);
return conceptIds;
}
Aggregations