diff --git a/src/main/java/gov/cms/mat/cql_elm_translation/service/CqlParsingService.java b/src/main/java/gov/cms/mat/cql_elm_translation/service/CqlParsingService.java index 620fce1..35b7afa 100644 --- a/src/main/java/gov/cms/mat/cql_elm_translation/service/CqlParsingService.java +++ b/src/main/java/gov/cms/mat/cql_elm_translation/service/CqlParsingService.java @@ -2,7 +2,6 @@ import static java.util.stream.Collectors.toSet; -import java.util.Comparator; import java.util.HashMap; import java.util.HashSet; import java.util.Map; @@ -19,6 +18,7 @@ import gov.cms.madie.cql_elm_translator.utils.cql.parsing.model.CQLDefinition; import gov.cms.madie.cql_elm_translator.utils.cql.parsing.model.DefinitionContent; import gov.cms.madie.cql_elm_translator.dto.CqlBuilderLookup; +import gov.cms.madie.cql_elm_translator.dto.CqlBuilderLookupComparator; import gov.cms.mat.cql_elm_translation.dto.CqlLookups; import gov.cms.mat.cql_elm_translation.dto.ElementLookup; import gov.cms.madie.cql_elm_translator.service.CqlLibraryService; @@ -118,7 +118,8 @@ public CqlBuilderLookup getCqlBuilderLookups(String cql, String accessToken) { Set allCqlDefinitions = buildCqlDefinitions(cqlTools); // prepare lookups for definitions, functions and fluent functions from CQLDefinitions Set definitions = - new TreeSet<>(Comparator.comparingInt(CqlBuilderLookup.Lookup::getStartLine)); + new TreeSet( + new CqlBuilderLookupComparator()); Set functions = new HashSet<>(); Set fluentFunctions = new HashSet<>(); for (CQLDefinition cqlDefinition : allCqlDefinitions) { @@ -136,6 +137,7 @@ public CqlBuilderLookup getCqlBuilderLookups(String cql, String accessToken) { functions.add(lookup); } } else { + log.info("Adding \"{}\".{} ", lookup.getLibraryAlias(), lookup.getName()); definitions.add(lookup); } }