Skip to content

Commit

Permalink
MAt-7649: Adding uniqueness check for drop down definitions; fixes is…
Browse files Browse the repository at this point in the history
…sue where included libraries aren't shown
  • Loading branch information
gregory-akins committed Dec 1, 2024
1 parent 2837f43 commit fdefdee
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;
Expand Down Expand Up @@ -118,7 +118,8 @@ public CqlBuilderLookup getCqlBuilderLookups(String cql, String accessToken) {
Set<CQLDefinition> allCqlDefinitions = buildCqlDefinitions(cqlTools);
// prepare lookups for definitions, functions and fluent functions from CQLDefinitions
Set<CqlBuilderLookup.Lookup> definitions =
new TreeSet<>(Comparator.comparingInt(CqlBuilderLookup.Lookup::getStartLine));
new TreeSet<CqlBuilderLookup.Lookup>(
new CqlBuilderLookupComparator<CqlBuilderLookup.Lookup>());
Set<CqlBuilderLookup.Lookup> functions = new HashSet<>();
Set<CqlBuilderLookup.Lookup> fluentFunctions = new HashSet<>();
for (CQLDefinition cqlDefinition : allCqlDefinitions) {
Expand All @@ -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);
}
}
Expand Down

0 comments on commit fdefdee

Please sign in to comment.