Skip to content

Commit

Permalink
MAT-6463: Reapplhying CQFramework upgrade with a more obscure pom ver…
Browse files Browse the repository at this point in the history
…sion name
  • Loading branch information
gregory-akins committed Aug 29, 2024
1 parent 8a52908 commit 810af5a
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 18 deletions.
6 changes: 3 additions & 3 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,18 @@
<modelVersion>4.0.0</modelVersion>
<groupId>gov.cms.madie</groupId>
<artifactId>madie-translator-commons</artifactId>
<version>0.0.2-SNAPSHOT</version>
<version>0.0.3-cqframework3.14.0-SNAPSHOT</version>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<java.version>17</java.version>
<maven.compiler.source>17</maven.compiler.source>
<maven.compiler.target>17</maven.compiler.target>
<mockito.version>5.12.0</mockito.version>
<slf4j.version>2.0.13</slf4j.version>
<cqframework.version>3.3.2</cqframework.version>
<cqframework.version>3.14.0</cqframework.version>
<spotify.fmt.version>2.21.1</spotify.fmt.version>
<lombok.version>1.18.24</lombok.version>
<madie.rest.commons.version>0.0.4-SNAPSHOT</madie.rest.commons.version>
<madie.rest.commons.version>0.0.7-SNAPSHOT</madie.rest.commons.version>
<hamcrest.version>3.0-rc1</hamcrest.version>
<jaxb.api.version>2.3.1</jaxb.api.version>
<spring.test.version>6.1.11</spring.test.version>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@
import org.cqframework.cql.cql2elm.CqlTranslator;
import org.cqframework.cql.cql2elm.LibraryBuilder;
import org.cqframework.cql.cql2elm.model.CompiledLibrary;
import org.cqframework.cql.cql2elm.preprocessor.CqlPreprocessorVisitor;

import org.cqframework.cql.cql2elm.preprocessor.CqlPreprocessorElmCommonVisitor;
import org.cqframework.cql.elm.IdObjectFactory;
import org.cqframework.cql.gen.cqlLexer;
import org.cqframework.cql.gen.cqlParser;
import org.hl7.elm.r1.ExpressionDef;
Expand Down Expand Up @@ -135,9 +135,10 @@ public void generate() throws IOException {
|| usingProperties.getLibraryType()
== "QICore"); // <-- BADDDDD!!!! Defaults to fhir

CqlPreprocessorVisitor preprocessor =
new CqlPreprocessorVisitor(
new LibraryBuilder(translationResource.getLibraryManager()), tokens);
CqlPreprocessorElmCommonVisitor preprocessor =
new CqlPreprocessorElmCommonVisitor(
new LibraryBuilder(translationResource.getLibraryManager(), new IdObjectFactory()),
tokens);

preprocessor.visit(tree);
ParseTreeWalker walker = new ParseTreeWalker();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,10 @@
import org.antlr.v4.runtime.tree.ParseTree;
import org.antlr.v4.runtime.tree.ParseTreeWalker;
import org.apache.commons.collections4.CollectionUtils;
import org.cqframework.cql.cql2elm.CqlCompilerOptions;
import org.cqframework.cql.cql2elm.LibraryBuilder;
import org.cqframework.cql.cql2elm.model.CompiledLibrary;
import org.cqframework.cql.cql2elm.preprocessor.CqlPreprocessorVisitor;
import org.cqframework.cql.cql2elm.preprocessor.CqlPreprocessorElmCommonVisitor;
import org.cqframework.cql.elm.IdObjectFactory;
import org.cqframework.cql.gen.cqlBaseListener;
import org.cqframework.cql.gen.cqlLexer;
import org.cqframework.cql.gen.cqlParser;
Expand Down Expand Up @@ -689,14 +689,10 @@ private void parseChildLibraries(IncludeDef def) throws IOException {
TranslationResource translationResource =
TranslationResource.getInstance(true); // <-- BADDDDD!!!! Defaults to fhir

// Add CqlCompilerOptions from LibraryManager to prevent NPE while walking through CQL
LibraryBuilder libraryBuilder = new LibraryBuilder(translationResource.getLibraryManager());
// MAT-7300: change signature level to overloads
CqlCompilerOptions options = translationResource.getLibraryManager().getCqlCompilerOptions();
options.setSignatureLevel(LibraryBuilder.SignatureLevel.Overloads);
libraryBuilder.setCompilerOptions(options);
CqlPreprocessorVisitor preprocessor = new CqlPreprocessorVisitor(libraryBuilder, tokens);

CqlPreprocessorElmCommonVisitor preprocessor =
new CqlPreprocessorElmCommonVisitor(
new LibraryBuilder(translationResource.getLibraryManager(), new IdObjectFactory()),
tokens);
preprocessor.visit(tree);
ParseTreeWalker walker = new ParseTreeWalker();
walker.walk(listener, tree);
Expand Down

0 comments on commit 810af5a

Please sign in to comment.