Skip to content

Commit

Permalink
Merge pull request #5 from MeasureAuthoringTool/MAT-6463_UpdateCqfram…
Browse files Browse the repository at this point in the history
…ework

Mat 6463 update cqframework
  • Loading branch information
gregory-akins committed Aug 28, 2024
2 parents fee1bbe + 86d1074 commit 643a5c8
Show file tree
Hide file tree
Showing 3 changed files with 15 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.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,7 +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 @@ -134,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 @@ -24,7 +24,9 @@
import org.apache.commons.collections4.CollectionUtils;
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 All @@ -40,7 +42,6 @@
import org.cqframework.cql.gen.cqlParser.WhereClauseContext;
import org.cqframework.cql.gen.cqlParser.WithClauseContext;
import org.cqframework.cql.gen.cqlParser.WithoutClauseContext;
import org.cqframework.cql.cql2elm.CqlCompilerOptions;
import org.hl7.elm.r1.CodeDef;
import org.hl7.elm.r1.CodeSystemDef;
import org.hl7.elm.r1.Element;
Expand Down Expand Up @@ -689,13 +690,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 643a5c8

Please sign in to comment.