From 82c87c7fd852bd9368624f93b7a3d6ab80cec226 Mon Sep 17 00:00:00 2001 From: Luke Sikina Date: Fri, 20 Sep 2024 08:47:25 -0400 Subject: [PATCH] fix --- .../dbmi/avillach/dictionary/ConceptDecoratorService.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) 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);