From 173f7c7471cda35d859579dfe9de536cc726d6aa Mon Sep 17 00:00:00 2001 From: JP Date: Thu, 25 Jan 2024 11:52:58 -0700 Subject: [PATCH] Update to CQL 3.6.0, prep for release 3.1.0 (#510) * Update to CQL 3.6.0, prep for release 3.1.0 * Updating RxMix API url - now a legacy operation --------- Co-authored-by: c-schuler --- pom.xml | 6 ++--- scripts/deploy.sh | 2 +- scripts/install.sh | 2 +- scripts/maintenance.sh | 2 +- scripts/setversion.sh | 2 +- tooling-cli/pom.xml | 6 ++--- tooling-ui/pom.xml | 6 ++--- tooling/pom.xml | 4 +-- .../opencds/cqf/tooling/constants/Api.java | 2 +- .../cql_generation/context/ElmContext.java | 6 ++--- .../drool/visitor/ElmToCqlVisitor.java | 27 +++---------------- 11 files changed, 21 insertions(+), 44 deletions(-) diff --git a/pom.xml b/pom.xml index e6b75f6c1..b2ede2028 100644 --- a/pom.xml +++ b/pom.xml @@ -5,15 +5,15 @@ org.opencds.cqf tooling-parent - 3.1.0-SNAPSHOT + 3.1.0 pom UTF-8 UTF-8 - 3.5.1 - 6.10.0 + 3.6.0 + 6.10.2 6.1.2.2 2.1.5.RELEASE 2.0.5 diff --git a/scripts/deploy.sh b/scripts/deploy.sh index 291b02753..94c039fe6 100755 --- a/scripts/deploy.sh +++ b/scripts/deploy.sh @@ -24,7 +24,7 @@ fi # Import maven settings cp .travis.settings.xml $HOME/.m2/settings.xml -CMD="mvn deploy -DskipTests=true -Dmaven.test.skip=true -B" +CMD="./mvnw deploy -DskipTests=true -Dmaven.test.skip=true -B" # Import signing key and publish a release on a tag if [[ ! -z "$TRAVIS_TAG" ]] diff --git a/scripts/install.sh b/scripts/install.sh index b2803c361..974d6e894 100755 --- a/scripts/install.sh +++ b/scripts/install.sh @@ -4,4 +4,4 @@ set -euxo pipefail bash -n "$0" -mvn install -U -DskipTests=true -Dmaven.javadoc.skip=true -B -V \ No newline at end of file +./mvnw install -U -DskipTests=true -Dmaven.javadoc.skip=true -B -V \ No newline at end of file diff --git a/scripts/maintenance.sh b/scripts/maintenance.sh index aead89787..f10c87258 100755 --- a/scripts/maintenance.sh +++ b/scripts/maintenance.sh @@ -4,4 +4,4 @@ set -euxo pipefail bash -n "$0" -mvn versions:update-properties versions:use-releases versions:use-latest-releases -Dexcludes=com.github.ben-manes.caffeine:caffeine:jar:\*,org.slf4j:\*,org.glassfish.jaxb:\*,com.sun.istack:\*,com.sun.xml.fastinfoset:\*,net.sf.jopt-simple:\*,ch.qos.logback:\* +./mvnw versions:update-properties versions:use-releases versions:use-latest-releases -Dexcludes=com.github.ben-manes.caffeine:caffeine:jar:\*,org.slf4j:\*,org.glassfish.jaxb:\*,com.sun.istack:\*,com.sun.xml.fastinfoset:\*,net.sf.jopt-simple:\*,ch.qos.logback:\* diff --git a/scripts/setversion.sh b/scripts/setversion.sh index 4c4e81298..c1a1bbcac 100755 --- a/scripts/setversion.sh +++ b/scripts/setversion.sh @@ -1,4 +1,4 @@ #!/usr/bin/env sh # usage ./scripts/setversion.sh N.N.N (or N.N.N-SNAPSHOT) -mvn versions:set -DnewVersion=$1 \ No newline at end of file +./mvnw versions:set -DnewVersion=$1 \ No newline at end of file diff --git a/tooling-cli/pom.xml b/tooling-cli/pom.xml index 10e639548..3844f56a8 100644 --- a/tooling-cli/pom.xml +++ b/tooling-cli/pom.xml @@ -6,11 +6,11 @@ org.opencds.cqf tooling-parent - 3.1.0-SNAPSHOT + 3.1.0 tooling-cli - 3.1.0-SNAPSHOT + 3.1.0 jar CQF Tooling CLI @@ -19,7 +19,7 @@ org.opencds.cqf tooling - 3.1.0-SNAPSHOT + 3.1.0 diff --git a/tooling-ui/pom.xml b/tooling-ui/pom.xml index af84d9b48..c6bb5ab76 100644 --- a/tooling-ui/pom.xml +++ b/tooling-ui/pom.xml @@ -6,11 +6,11 @@ org.opencds.cqf tooling-parent - 3.1.0-SNAPSHOT + 3.1.0 tooling-ui - 3.1.0-SNAPSHOT + 3.1.0 jar CQF Tooling UI @@ -19,7 +19,7 @@ org.opencds.cqf tooling - 3.1.0-SNAPSHOT + 3.1.0 org.openjfx diff --git a/tooling/pom.xml b/tooling/pom.xml index daa2f0d67..8f4d64c7c 100644 --- a/tooling/pom.xml +++ b/tooling/pom.xml @@ -6,11 +6,11 @@ org.opencds.cqf tooling-parent - 3.1.0-SNAPSHOT + 3.1.0 tooling - 3.1.0-SNAPSHOT + 3.1.0 jar diff --git a/tooling/src/main/java/org/opencds/cqf/tooling/constants/Api.java b/tooling/src/main/java/org/opencds/cqf/tooling/constants/Api.java index f03985a02..fa2774678 100644 --- a/tooling/src/main/java/org/opencds/cqf/tooling/constants/Api.java +++ b/tooling/src/main/java/org/opencds/cqf/tooling/constants/Api.java @@ -4,7 +4,7 @@ public class Api { private Api() {} - public static final String RXMIX_WORKFLOW_URL = "https://mor.nlm.nih.gov/RxMix/executeConfig.do"; + public static final String RXMIX_WORKFLOW_URL = "https://rxmix-legacy.nlm.nih.gov/RxMix/executeConfig.do"; public static final String LOINC_HIERARCHY_QUERY_URL = "https://loinc.regenstrief.org/searchapi/hierarchy/component-system/search?searchString="; public static final String LOINC_FHIR_SERVER_URL = "https://fhir.loinc.org"; public static final String FHIR_LOOKUP_OPERATION_NAME = "$lookup"; diff --git a/tooling/src/main/java/org/opencds/cqf/tooling/cql_generation/context/ElmContext.java b/tooling/src/main/java/org/opencds/cqf/tooling/cql_generation/context/ElmContext.java index feaab14dd..1c9ef91a3 100644 --- a/tooling/src/main/java/org/opencds/cqf/tooling/cql_generation/context/ElmContext.java +++ b/tooling/src/main/java/org/opencds/cqf/tooling/cql_generation/context/ElmContext.java @@ -7,11 +7,10 @@ import java.util.Stack; import org.apache.commons.lang3.tuple.Pair; -import org.cqframework.cql.cql2elm.CqlCompilerOptions; -import org.cqframework.cql.cql2elm.CqlTranslatorOptions; import org.cqframework.cql.cql2elm.LibraryBuilder; import org.cqframework.cql.cql2elm.LibraryManager; import org.cqframework.cql.cql2elm.ModelManager; +import org.cqframework.cql.elm.IdObjectFactory; import org.fhir.ucum.UcumEssenceService; import org.fhir.ucum.UcumException; import org.fhir.ucum.UcumService; @@ -60,8 +59,7 @@ public void newLibraryBuilder(Pair libraryInfo) UcumService ucumService = new UcumEssenceService( UcumEssenceService.class.getResourceAsStream("/ucum-essence.xml")); libraryManager.setUcumService(ucumService); - this.libraryBuilder = new LibraryBuilder(libraryManager); - this.libraryBuilder.setCompilerOptions(CqlCompilerOptions.defaultOptions()); + this.libraryBuilder = new LibraryBuilder(libraryManager, new IdObjectFactory()); this.libraryBuilder.setLibraryIdentifier(libraryInfo.getLeft()); this.libraryBuilder.getModel(new UsingDef().withUri(modelBuilder.getModelUri()) .withLocalIdentifier(modelBuilder.getModelIdentifier()).withVersion(modelBuilder.getModelVersion())); diff --git a/tooling/src/main/java/org/opencds/cqf/tooling/cql_generation/drool/visitor/ElmToCqlVisitor.java b/tooling/src/main/java/org/opencds/cqf/tooling/cql_generation/drool/visitor/ElmToCqlVisitor.java index 476ebc9ae..6ac709c55 100644 --- a/tooling/src/main/java/org/opencds/cqf/tooling/cql_generation/drool/visitor/ElmToCqlVisitor.java +++ b/tooling/src/main/java/org/opencds/cqf/tooling/cql_generation/drool/visitor/ElmToCqlVisitor.java @@ -4,7 +4,7 @@ import java.util.Stack; import java.util.stream.Collectors; -import org.cqframework.cql.elm.visiting.ElmBaseLibraryVisitor; +import org.cqframework.cql.elm.visiting.BaseElmLibraryVisitor; import org.hl7.elm.r1.*; import org.hl7.elm.r1.Library.Statements; import org.opencds.cqf.tooling.cql_generation.context.ElmContext; @@ -19,7 +19,7 @@ * @author Joshua Reynolds * @since 2021-04-05 */ -public class ElmToCqlVisitor extends ElmBaseLibraryVisitor { +public class ElmToCqlVisitor extends BaseElmLibraryVisitor { private static final Logger logger = LoggerFactory.getLogger(ElmToCqlVisitor.class); private boolean useSpaces = true; @@ -864,7 +864,7 @@ public Void visitQuery(Query query, ElmContext context) { query.getRelationship().stream().forEach(relationship -> visitRelationshipClause(relationship, context)); } if (query.getWhere() != null) { - visitWhereClause(query.getWhere(), context); + visitExpression(query.getWhere(), context); } if (query.getReturn() != null) { visitReturnClause(query.getReturn(), context); @@ -961,27 +961,6 @@ public Void visitLetClause(LetClause let, ElmContext context) { return null; } - /** - * Visit WhereClause. This method will be called for - * WhereClause expression nodes. - * - * @param where the Expression - * @param context the context passed to the visitor - * @return the visitor result - */ - @Override - public Void visitWhereClause(Expression where, ElmContext context) { - try { - enterClause(); - output.append("where"); - visitElement(where, context); - return null; - } - finally { - exitClause(); - } - } - /** * Visit ReturnClause. This method will be called for * every node in the tree that is a ReturnClause.