diff --git a/src/main/java/gov/cms/mat/cql_elm_translation/service/filters/CqlTranslatorExceptionFilter.java b/src/main/java/gov/cms/mat/cql_elm_translation/service/filters/CqlTranslatorExceptionFilter.java index 05dafe2..2414c59 100644 --- a/src/main/java/gov/cms/mat/cql_elm_translation/service/filters/CqlTranslatorExceptionFilter.java +++ b/src/main/java/gov/cms/mat/cql_elm_translation/service/filters/CqlTranslatorExceptionFilter.java @@ -4,6 +4,7 @@ import lombok.Getter; import lombok.extern.slf4j.Slf4j; import org.apache.commons.collections4.CollectionUtils; +import org.apache.commons.lang3.StringUtils; import org.cqframework.cql.cql2elm.CqlCompilerException; import org.hl7.elm.r1.VersionedIdentifier; @@ -113,7 +114,7 @@ private List filterBySyntax( } /* - * MAT-7995: error: "No Viable Input at 'define :'" + * MAT-7995: error: "No viable alternative at input 'define :'" * should be customized as: "Definition is missing a name." * This is done in cql-antlr-parse, so on the frontend we don't want a duplicate error message * therefore we are filtering it out here. @@ -123,9 +124,8 @@ private List filterOutCustomErrors( return filteredCqlTranslatorExceptions.stream() .filter( cqlCompilerException -> - !cqlCompilerException - .getMessage() - .contains("no viable alternative at input 'define")) + !StringUtils.containsIgnoreCase( + cqlCompilerException.getMessage(), "no viable alternative at input 'define")) .toList(); } }