Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Filtering childs

  • Loading branch information...
commit e75ac0a0e211a14dcb46bfe577926414f20b1966 1 parent d6505a7
@mwl mwl authored
View
10 sc-web/src/main/java/dk/sst/snomedcave/controllers/ConceptController.java
@@ -6,6 +6,7 @@
import dk.sst.snomedcave.dao.ConceptRepository;
import dk.sst.snomedcave.model.Concept;
import dk.sst.snomedcave.model.ConceptRelation;
+import org.apache.commons.collections15.CollectionUtils;
import org.apache.commons.collections15.Predicate;
import org.apache.commons.collections15.Transformer;
import org.apache.log4j.Logger;
@@ -91,10 +92,15 @@ private ConceptNode toConceptNodeWithChilds(Concept concept) {
private ConceptNode toConceptNodeWithChilds(Concept concept, final ConceptNode included) {
get(concept);
- //TODO: filter childs
+ final Collection<ConceptRelation> childs = CollectionUtils.select(concept.getChilds(), new Predicate<ConceptRelation>() {
+ @Override
+ public boolean evaluate(ConceptRelation relation) {
+ return shouldInclude(relation);
+ }
+ });
return toConceptNodeWithChilds(
concept,
- collect(concept.getChilds(), new Transformer<ConceptRelation, ConceptNode>() {
+ collect(childs, new Transformer<ConceptRelation, ConceptNode>() {
@Override
public ConceptNode transform(ConceptRelation relation) {
final Concept child = get(relation).getChild();
Please sign in to comment.
Something went wrong with that request. Please try again.