Skip to content

Commit

Permalink
MAT-6463: Reverting to CqFramework 3.3.2 because 0.0.2-SNAPSHOT got '…
Browse files Browse the repository at this point in the history
…repurposed' while I was working through my upgrades to CqFramework 3.14.0
  • Loading branch information
gregory-akins committed Aug 29, 2024
1 parent 643a5c8 commit 904c03d
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 15 deletions.
4 changes: 2 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@
<maven.compiler.target>17</maven.compiler.target>
<mockito.version>5.12.0</mockito.version>
<slf4j.version>2.0.13</slf4j.version>
<cqframework.version>3.14.0</cqframework.version>
<cqframework.version>3.3.2</cqframework.version>
<spotify.fmt.version>2.21.1</spotify.fmt.version>
<lombok.version>1.18.24</lombok.version>
<madie.rest.commons.version>0.0.7-SNAPSHOT</madie.rest.commons.version>
<madie.rest.commons.version>0.0.4-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.CqlPreprocessorElmCommonVisitor;
import org.cqframework.cql.elm.IdObjectFactory;
import org.cqframework.cql.cql2elm.preprocessor.CqlPreprocessorVisitor;

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

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

preprocessor.visit(tree);
ParseTreeWalker walker = new ParseTreeWalker();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +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.CqlPreprocessorElmCommonVisitor;

import org.cqframework.cql.elm.IdObjectFactory;
import org.cqframework.cql.cql2elm.preprocessor.CqlPreprocessorVisitor;
import org.cqframework.cql.gen.cqlBaseListener;
import org.cqframework.cql.gen.cqlLexer;
import org.cqframework.cql.gen.cqlParser;
Expand Down Expand Up @@ -690,10 +689,14 @@ private void parseChildLibraries(IncludeDef def) throws IOException {
TranslationResource translationResource =
TranslationResource.getInstance(true); // <-- BADDDDD!!!! Defaults to fhir

CqlPreprocessorElmCommonVisitor preprocessor =
new CqlPreprocessorElmCommonVisitor(
new LibraryBuilder(translationResource.getLibraryManager(), new IdObjectFactory()),
tokens);
// 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);

preprocessor.visit(tree);
ParseTreeWalker walker = new ParseTreeWalker();
walker.walk(listener, tree);
Expand Down

0 comments on commit 904c03d

Please sign in to comment.