diff --git a/src/main/java/edu/harvard/dbmi/avillach/dictionary/ConceptDecoratorService.java b/src/main/java/edu/harvard/dbmi/avillach/dictionary/ConceptDecoratorService.java index 9678f1d..a67bc8f 100644 --- a/src/main/java/edu/harvard/dbmi/avillach/dictionary/ConceptDecoratorService.java +++ b/src/main/java/edu/harvard/dbmi/avillach/dictionary/ConceptDecoratorService.java @@ -10,6 +10,7 @@ import org.springframework.stereotype.Service; import java.util.List; +import java.util.stream.Stream; @Service public class ConceptDecoratorService { @@ -36,8 +37,8 @@ public Concept populateParentConcepts(Concept concept) { } // In some environments, certain parent concepts have critical details that we need to add to the detailed response - List conceptNodes = List.of(concept.conceptPath() - .split("\\\\")); // you have to double escape the slash. Once for strings, and once for regex + List conceptNodes = Stream.of(concept.conceptPath() + .split("\\\\")).filter(String::isBlank).toList(); // you have to double escape the slash. Once for strings, and once for regex return switch (conceptNodes.size()) { case COMPLIANT, NON_COMPLIANT_TABLED -> populateTabledConcept(concept, conceptNodes);