Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Filtering childs

  • Loading branch information...
commit e75ac0a0e211a14dcb46bfe577926414f20b1966 1 parent d6505a7
Martin Westergaard Lassen mwl authored
10 sc-web/src/main/java/dk/sst/snomedcave/controllers/ConceptController.java
@@ -6,6 +6,7 @@
6 6 import dk.sst.snomedcave.dao.ConceptRepository;
7 7 import dk.sst.snomedcave.model.Concept;
8 8 import dk.sst.snomedcave.model.ConceptRelation;
  9 +import org.apache.commons.collections15.CollectionUtils;
9 10 import org.apache.commons.collections15.Predicate;
10 11 import org.apache.commons.collections15.Transformer;
11 12 import org.apache.log4j.Logger;
@@ -91,10 +92,15 @@ private ConceptNode toConceptNodeWithChilds(Concept concept) {
91 92
92 93 private ConceptNode toConceptNodeWithChilds(Concept concept, final ConceptNode included) {
93 94 get(concept);
94   - //TODO: filter childs
  95 + final Collection<ConceptRelation> childs = CollectionUtils.select(concept.getChilds(), new Predicate<ConceptRelation>() {
  96 + @Override
  97 + public boolean evaluate(ConceptRelation relation) {
  98 + return shouldInclude(relation);
  99 + }
  100 + });
95 101 return toConceptNodeWithChilds(
96 102 concept,
97   - collect(concept.getChilds(), new Transformer<ConceptRelation, ConceptNode>() {
  103 + collect(childs, new Transformer<ConceptRelation, ConceptNode>() {
98 104 @Override
99 105 public ConceptNode transform(ConceptRelation relation) {
100 106 final Concept child = get(relation).getChild();

0 comments on commit e75ac0a

Please sign in to comment.
Something went wrong with that request. Please try again.