Skip to content

Commit

Permalink
Merge branch 'master' into 863-date-time-interval-inclusion
Browse files Browse the repository at this point in the history
  • Loading branch information
lukedegruchy authored Nov 10, 2023
2 parents 805636c + a856e39 commit 53fa40c
Show file tree
Hide file tree
Showing 66 changed files with 439 additions and 180 deletions.
9 changes: 9 additions & 0 deletions Src/java/buildSrc/src/main/groovy/cql.fhir-conventions.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ ext {
dependencies {
api platform("ca.uhn.hapi.fhir:hapi-fhir-bom:${hapiVersion}") {
exclude group: 'org.eclipse.jetty'
exclude group: 'xpp3'
}

implementation "ca.uhn.hapi.fhir:org.hl7.fhir.r5:${coreVersion}"
Expand All @@ -23,4 +24,12 @@ dependencies {
implementation "ca.uhn.hapi.fhir:hapi-fhir-structures-dstu3"
implementation "ca.uhn.hapi.fhir:hapi-fhir-structures-r4"
implementation "ca.uhn.hapi.fhir:hapi-fhir-structures-r5"

// This is to align with the FHIR core dependencies
// Note that this dependency hasn't been updated since 2013
// we probably need to standardize on a fork up the dependency chain
implementation ('org.ogce:xpp3:1.1.6') {
exclude group: 'junit'
exclude group: 'org.hamcrest'
}
}
4 changes: 2 additions & 2 deletions Src/java/buildSrc/src/main/groovy/cql.java-conventions.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ dependencies {

// These are JAXB dependencies excluded because the libraries need to work
// on Android. But for test purposes we use them pretty much everywhere.
testRuntimeOnly 'org.eclipse.persistence:org.eclipse.persistence.moxy:2.7.7'
testRuntimeOnly 'xpp3:xpp3:1.1.4c'
testRuntimeOnly 'org.eclipse.persistence:org.eclipse.persistence.moxy:4.0.2'
testRuntimeOnly 'org.eclipse.parsson:parsson:1.1.5'
}

jar {
Expand Down
20 changes: 10 additions & 10 deletions Src/java/buildSrc/src/main/groovy/cql.xjc-conventions.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -7,19 +7,19 @@ configurations {
}

dependencies {
xjc 'org.jvnet.jaxb2_commons:jaxb2-basics-ant:0.13.1'
xjc 'org.jvnet.jaxb2_commons:jaxb2-basics:0.13.1'
xjc 'org.jvnet.jaxb2_commons:jaxb2-fluent-api:3.0'
xjc 'codes.rafael.jaxb2_commons:jaxb2-basics-ant:3.0.0'
xjc 'codes.rafael.jaxb2_commons:jaxb2-basics:3.0.0'
xjc 'codes.rafael.jaxb2_commons:jaxb2-fluent-api:3.0.0'
// Eclipse has taken over all Java EE reference components
// https://www.infoworld.com/article/3310042/eclipse-takes-over-all-java-ee-reference-components.html
// https://wiki.eclipse.org/Jakarta_EE_Maven_Coordinates
xjc 'jakarta.xml.bind:jakarta.xml.bind-api:2.3.3'
xjc 'org.glassfish.jaxb:jaxb-xjc:2.4.0-b180830.0438'
xjc 'org.eclipse.persistence:org.eclipse.persistence.moxy:2.7.7'
xjc 'jakarta.xml.bind:jakarta.xml.bind-api:4.0.1'
xjc 'org.glassfish.jaxb:jaxb-xjc:3.0.2'
xjc 'org.glassfish.jaxb:jaxb-runtime:4.0.3'
xjc 'org.eclipse.persistence:org.eclipse.persistence.moxy:4.0.2'
xjc 'org.slf4j:slf4j-simple:1.7.36'

api 'org.jvnet.jaxb2_commons:jaxb2-basics-runtime:0.13.1'
api 'jakarta.xml.bind:jakarta.xml.bind-api:2.3.3'
api 'jakarta.xml.bind:jakarta.xml.bind-api:4.0.1'
api 'codes.rafael.jaxb2_commons:jaxb2-basics-runtime:3.0.0'
}

ext.xjc = [
Expand Down Expand Up @@ -66,4 +66,4 @@ sourceSets {

clean {
delete xjc.destDir
}
}
Original file line number Diff line number Diff line change
@@ -1,18 +1,17 @@
package org.cqframework.fhir.npm;

import java.io.ByteArrayInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.util.List;

import jakarta.xml.bind.JAXB;
import org.hl7.cql.model.ModelIdentifier;
import org.hl7.cql.model.ModelInfoProvider;
import org.hl7.elm_modelinfo.r1.ModelInfo;
import org.hl7.fhir.r5.context.IWorkerContext;
import org.hl7.fhir.r5.model.Library;
import org.hl7.fhir.utilities.npm.NpmPackage;

import javax.xml.bind.JAXB;
import java.io.ByteArrayInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.util.List;

/**
* Provides a model info provider that can resolve CQL model info from an Npm package
Expand Down
4 changes: 0 additions & 4 deletions Src/java/cql-to-elm-cli/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,6 @@ dependencies {
implementation project(':model-jaxb')
implementation project(':elm-jaxb')
implementation 'net.sf.jopt-simple:jopt-simple:4.7'
runtimeOnly 'org.eclipse.persistence:org.eclipse.persistence.moxy:2.7.7'
runtimeOnly 'xpp3:xpp3_min:1.1.4c'
runtimeOnly 'xmlpull:xmlpull:1.1.3.1'

testImplementation project(':model-jaxb')
testImplementation project(':model-jackson')
testImplementation project(':elm-jaxb')
Expand Down
23 changes: 8 additions & 15 deletions Src/java/cql-to-elm/build.gradle
Original file line number Diff line number Diff line change
@@ -1,27 +1,20 @@
plugins {
id 'cql.library-conventions'
id 'cql.xjc-conventions'
}

dependencies {
api project(':cql')
api project(':model')
api project(':elm')
api 'org.fhir:ucum:1.0.8'
api 'org.apache.commons:commons-text:1.10.0'

// The FHIR ucum service depends on an
// XML pull-parser being present on the classpath, and have a compile-time reference to xpp3.
// However, some platfoms such as Android provide their own pull-parser implementations.
// Additionally, The xpp3.xpp3 dependency includes the javax.xml packagename, which is invalid in
// Java 9+ because split packages (i.e. the same packagename being available in multipe jar) are
// disallowed. For those reasons xpp3 is excluded here, and included as a runtime dependency for
// tests. Users of the CQL translator will need to supply their own implementation or add xpp3
// at runtime.
api ('org.fhir:ucum:1.0.3') {
exclude group: 'xpp3'
}

implementation 'org.apache.commons:commons-text:1.10.0'
implementation 'com.fasterxml.jackson.module:jackson-module-jaxb-annotations:2.15.2'

// TODO: This dependencies are required due the the fact that the CqlTranslatorOptionsMapper lives
// in the cql-to-elm project. Ideally, we'd factor out all serialization depedencies into common
// libraries such that we could swap out jackson for something else. In the meantime, these are
// "implementation" dependencies so that they are not exported downstream.
implementation 'com.fasterxml.jackson.module:jackson-module-jakarta-xmlbind-annotations:2.15.2'
testImplementation project(':elm-jackson')
testImplementation project(':model-jackson')
testImplementation project(':quick')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,13 @@
import org.hl7.cql_annotations.r1.Tag;
import org.hl7.elm.r1.*;

import javax.xml.bind.JAXBElement;
import jakarta.xml.bind.JAXBElement;
import javax.xml.namespace.QName;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.Stack;
import java.util.stream.Collectors;

/**
* Common functionality used by {@link CqlPreprocessorVisitor} and {@link Cql2ElmVisitor}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
import org.testng.annotations.BeforeClass;
import org.testng.annotations.Test;

import javax.xml.bind.JAXBElement;
import jakarta.xml.bind.JAXBElement;
import java.io.IOException;
import java.util.HashMap;
import java.util.Map;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
import org.testng.annotations.Ignore;
import org.testng.annotations.Test;

import javax.xml.bind.JAXBException;
import jakarta.xml.bind.JAXBException;
import java.io.File;
import java.io.IOException;
import java.util.ArrayList;
Expand Down
7 changes: 3 additions & 4 deletions Src/java/elm-fhir/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,9 @@ ext {
}

dependencies {
implementation project(':cql-to-elm')
implementation project(':engine')
implementation project(":engine-fhir")
implementation "org.mapstruct:mapstruct:${mapstructVersion}"
api project(':cql-to-elm')
api project(':engine')
api project(":engine-fhir")

testImplementation project(':quick')
testImplementation "org.reflections:reflections:0.10.2"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,7 @@
import org.opencds.cqf.cql.engine.fhir.converter.FhirTypeConverter;
import org.opencds.cqf.cql.engine.fhir.converter.FhirTypeConverterFactory;

import javax.xml.bind.JAXBElement;
import javax.xml.namespace.QName;
import jakarta.xml.bind.JAXBElement;
import java.io.Serializable;
import java.math.BigDecimal;
import java.time.ZonedDateTime;
Expand Down
4 changes: 1 addition & 3 deletions Src/java/elm-jackson/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,5 @@ dependencies {
api project(':elm')
implementation 'org.apache.commons:commons-text:1.10.0'
implementation 'com.fasterxml.jackson.dataformat:jackson-dataformat-xml:2.15.2'
implementation 'com.fasterxml.jackson.module:jackson-module-jaxb-annotations:2.15.2'
// needs javax.json.JsonException when using SAXUnmarshaller.getNewXMLReader
implementation 'org.glassfish:javax.json:1.0.4'
implementation 'com.fasterxml.jackson.module:jackson-module-jakarta-xmlbind-annotations:2.15.2'
}
Original file line number Diff line number Diff line change
@@ -1,17 +1,8 @@
package org.cqframework.cql.elm.serializing.jackson;

import com.fasterxml.jackson.databind.DeserializationFeature;
import com.fasterxml.jackson.databind.MapperFeature;
import com.fasterxml.jackson.databind.SerializationFeature;
import com.fasterxml.jackson.databind.json.JsonMapper;
import com.fasterxml.jackson.module.jaxb.JaxbAnnotationModule;
import org.cqframework.cql.elm.serializing.ElmLibraryReader;
import org.cqframework.cql.elm.serializing.LibraryWrapper;
import org.cqframework.cql.elm.serializing.jackson.mixins.CqlToElmBaseMixIn;
import org.cqframework.cql.elm.serializing.jackson.mixins.TypeSpecifierMixIn;
import org.hl7.cql_annotations.r1.CqlToElmBase;
import org.hl7.elm.r1.Library;
import org.hl7.elm.r1.TypeSpecifier;

import java.io.File;
import java.io.IOException;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import com.fasterxml.jackson.databind.MapperFeature;
import com.fasterxml.jackson.databind.SerializationFeature;
import com.fasterxml.jackson.databind.json.JsonMapper;
import com.fasterxml.jackson.module.jaxb.JaxbAnnotationModule;
import com.fasterxml.jackson.module.jakarta.xmlbind.JakartaXmlBindAnnotationModule;
import org.cqframework.cql.elm.serializing.jackson.mixins.CqlToElmBaseMixIn;
import org.cqframework.cql.elm.serializing.jackson.mixins.TrackableMixIn;
import org.cqframework.cql.elm.serializing.jackson.mixins.TypeSpecifierMixIn;
Expand All @@ -20,7 +20,7 @@ public class ElmJsonMapper {
.enable(DeserializationFeature.ACCEPT_SINGLE_VALUE_AS_ARRAY)
.enable(MapperFeature.USE_BASE_TYPE_AS_DEFAULT_IMPL)
.defaultPropertyInclusion(JsonInclude.Value.construct(JsonInclude.Include.NON_NULL, JsonInclude.Include.NON_NULL))
.addModule(new JaxbAnnotationModule())
.addModule(new JakartaXmlBindAnnotationModule())
.addMixIn(Trackable.class, TrackableMixIn.class)
.addMixIn(TypeSpecifier.class, TypeSpecifierMixIn.class)
.addMixIn(CqlToElmBase.class, CqlToElmBaseMixIn.class)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,17 +1,7 @@
package org.cqframework.cql.elm.serializing.jackson;

import com.fasterxml.jackson.databind.DeserializationFeature;
import com.fasterxml.jackson.databind.MapperFeature;
import com.fasterxml.jackson.databind.SerializationFeature;
import com.fasterxml.jackson.dataformat.xml.XmlMapper;
import com.fasterxml.jackson.dataformat.xml.ser.ToXmlGenerator;
import com.fasterxml.jackson.module.jaxb.JaxbAnnotationModule;
import org.cqframework.cql.elm.serializing.ElmLibraryReader;
import org.cqframework.cql.elm.serializing.jackson.mixins.CqlToElmBaseMixIn;
import org.cqframework.cql.elm.serializing.jackson.mixins.TypeSpecifierMixIn;
import org.hl7.cql_annotations.r1.CqlToElmBase;
import org.hl7.elm.r1.Library;
import org.hl7.elm.r1.TypeSpecifier;

import java.io.File;
import java.io.IOException;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
import com.fasterxml.jackson.dataformat.xml.XmlFactory;
import com.fasterxml.jackson.dataformat.xml.XmlMapper;
import com.fasterxml.jackson.dataformat.xml.ser.ToXmlGenerator;
import com.fasterxml.jackson.module.jaxb.JaxbAnnotationModule;
import com.fasterxml.jackson.module.jakarta.xmlbind.JakartaXmlBindAnnotationModule;
import org.cqframework.cql.elm.serializing.jackson.mixins.CqlToElmBaseMixIn;
import org.cqframework.cql.elm.serializing.jackson.mixins.TrackableMixIn;
import org.cqframework.cql.elm.serializing.jackson.mixins.TypeSpecifierMixIn;
Expand All @@ -31,7 +31,7 @@ public class ElmXmlMapper {
.enable(DeserializationFeature.ACCEPT_SINGLE_VALUE_AS_ARRAY)
.enable(MapperFeature.USE_BASE_TYPE_AS_DEFAULT_IMPL)
.defaultPropertyInclusion(JsonInclude.Value.construct(JsonInclude.Include.NON_NULL, JsonInclude.Include.NON_NULL))
.addModule(new JaxbAnnotationModule())
.addModule(new JakartaXmlBindAnnotationModule())
.addMixIn(Trackable.class, TrackableMixIn.class)
.addMixIn(TypeSpecifier.class, TypeSpecifierMixIn.class)
.addMixIn(CqlToElmBase.class, CqlToElmBaseMixIn.class)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
package org.cqframework.cql.elm.serializing.jaxb;

import jakarta.xml.bind.JAXBException;
import jakarta.xml.bind.PropertyException;
import jakarta.xml.bind.Unmarshaller;
import jakarta.xml.bind.ValidationEvent;
import jakarta.xml.bind.ValidationEventHandler;
import org.cqframework.cql.elm.serializing.ElmLibraryReader;
import org.hl7.elm.r1.Library;

import javax.xml.bind.*;
import javax.xml.transform.Source;
import javax.xml.transform.stream.StreamSource;
import java.io.File;
import java.io.IOException;
import java.io.InputStream;
import java.io.Reader;
import java.net.MalformedURLException;
import java.net.URI;
import java.net.URISyntaxException;
import java.net.URL;

public class ElmJsonLibraryReader implements ElmLibraryReader {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
import org.hl7.elm.r1.Library;
import org.hl7.elm.r1.ObjectFactory;

import javax.xml.bind.JAXBException;
import javax.xml.bind.Marshaller;
import javax.xml.bind.PropertyException;
import jakarta.xml.bind.JAXBException;
import jakarta.xml.bind.Marshaller;
import jakarta.xml.bind.PropertyException;
import java.io.IOException;
import java.io.StringWriter;
import java.io.Writer;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
import org.hl7.cql_annotations.r1.CqlToElmBase;
import org.hl7.elm.r1.Library;

import javax.xml.bind.JAXBContext;
import javax.xml.bind.JAXBException;
import jakarta.xml.bind.JAXBContext;
import jakarta.xml.bind.JAXBException;

public class ElmJsonMapper {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
import org.cqframework.cql.elm.serializing.ElmLibraryReader;
import org.hl7.elm.r1.Library;

import javax.xml.bind.JAXBElement;
import javax.xml.bind.JAXBException;
import javax.xml.bind.Unmarshaller;
import jakarta.xml.bind.JAXBElement;
import jakarta.xml.bind.JAXBException;
import jakarta.xml.bind.Unmarshaller;
import javax.xml.transform.Source;
import java.io.File;
import java.io.IOException;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
import org.hl7.elm.r1.Library;
import org.hl7.elm.r1.ObjectFactory;

import javax.xml.bind.JAXBException;
import javax.xml.bind.Marshaller;
import javax.xml.bind.PropertyException;
import jakarta.xml.bind.JAXBException;
import jakarta.xml.bind.Marshaller;
import jakarta.xml.bind.PropertyException;
import java.io.*;

public class ElmXmlLibraryWriter implements ElmLibraryWriter {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
import org.hl7.cql_annotations.r1.CqlToElmBase;
import org.hl7.elm.r1.Library;

import javax.xml.bind.JAXBContext;
import javax.xml.bind.JAXBException;
import jakarta.xml.bind.JAXBContext;
import jakarta.xml.bind.JAXBException;

public class ElmXmlMapper {

Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1 @@
javax.xml.bind.context.factory=org.eclipse.persistence.jaxb.JAXBContextFactory
jakarta.xml.bind.context.factory=org.eclipse.persistence.jaxb.JAXBContextFactory
5 changes: 3 additions & 2 deletions Src/java/elm-test/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ plugins {

dependencies {
implementation project(':cql-to-elm')
implementation project(':model-jaxb')
implementation project(':elm-jackson')
// implementation project(':model-jaxb')
implementation project(':elm-jaxb')
implementation project(':model-jackson')
implementation project(':elm-jackson')
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
import java.util.List;
import java.util.stream.Collectors;

import javax.xml.bind.JAXBException;
import jakarta.xml.bind.JAXBException;

import org.cqframework.cql.cql2elm.CqlTranslator;
import org.cqframework.cql.cql2elm.CqlCompilerOptions;
Expand Down
2 changes: 1 addition & 1 deletion Src/java/elm/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ plugins {
}

dependencies {
implementation project(':model')
api project(':model')
}

generateSources {
Expand Down
Loading

0 comments on commit 53fa40c

Please sign in to comment.