Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bump CQL Translator/Evaluator to 2.4 #1771

Merged
merged 21 commits into from
Jan 10, 2023
Merged
Show file tree
Hide file tree
Changes from 14 commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
6ab643a
Migrating CQL Evaluator and its dependencies to 2.4 to fix #1733
vitorpamplona Nov 29, 2022
98c3533
Merge remote-tracking branch 'origin/HEAD' into Evaluator2_4
vitorpamplona Dec 19, 2022
d9a5bbc
Evaluator 2.4's generate care plan returns an IBaseResource to prepar…
vitorpamplona Dec 19, 2022
0d8f7c9
Migrates to evaluator 2.4
vitorpamplona Dec 19, 2022
3f8e911
Removes outdated antlr dependency fix of 2.4
vitorpamplona Dec 19, 2022
276d5f5
Forces Jackson 2.14.1 due to a dependency bug when using Gradle and t…
vitorpamplona Dec 19, 2022
750ce81
Forces Jackson 2.14.1 due to a dependency bug when using Gradle and t…
vitorpamplona Dec 19, 2022
5859748
Fixing tests to match CQL-Evaluator's tests
vitorpamplona Dec 19, 2022
7712fca
Merge branch 'Evaluator2_4' of https://github.com/Path-Check/android-…
vitorpamplona Dec 19, 2022
25782d8
Spotless apply
vitorpamplona Dec 19, 2022
f0784e1
Force version of caffeine
vitorpamplona Dec 20, 2022
a9e4d85
Forces HAPI and FHIR CORE to earlier versions due to https://github.c…
vitorpamplona Dec 21, 2022
646680d
deleting non existant r4b
vitorpamplona Dec 21, 2022
7255d71
Fixing imports of the Benchmark module
vitorpamplona Dec 21, 2022
1ce0bc3
Moving common blocks to Dependencies.
vitorpamplona Dec 23, 2022
28498cd
Merge remote-tracking branch 'origin/HEAD' into Evaluator2_4
vitorpamplona Dec 23, 2022
e8cc1a7
spotless apply
vitorpamplona Dec 23, 2022
5d0f25b
Merge remote-tracking branch 'origin/HEAD' into Evaluator2_4
vitorpamplona Dec 23, 2022
078af19
Merge branch 'master' into Evaluator2_4
vitorpamplona Jan 3, 2023
af7ed0c
Merge branch 'master' into Evaluator2_4
vitorpamplona Jan 4, 2023
be8c1f0
Merge branch 'master' into Evaluator2_4
vitorpamplona Jan 10, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 26 additions & 3 deletions benchmark/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -73,9 +73,32 @@ configurations {
exclude(module = "javax.json")
exclude(module = "jcl-over-slf4j")
exclude(group = "org.apache.httpcomponents")
// Remove this after this issue has been fixed:
// https://github.com/cqframework/clinical_quality_language/issues/799
exclude(module = "antlr4")

// Removes newer versions of caffeine and manually imports 2.9
// Removes newer versions of hapi and keeps on 6.0.1
// (newer versions don't work on Android)
resolutionStrategy {
vitorpamplona marked this conversation as resolved.
Show resolved Hide resolved
force(Dependencies.HapiFhir.caffeine)
force(Dependencies.HapiFhir.fhirBase)
force(Dependencies.HapiFhir.fhirClient)
force(Dependencies.HapiFhir.structuresDstu2)
force(Dependencies.HapiFhir.structuresDstu3)
force(Dependencies.HapiFhir.structuresR4)
force(Dependencies.HapiFhir.structuresR5)
force(Dependencies.HapiFhir.validation)
force(Dependencies.HapiFhir.validationDstu3)
force(Dependencies.HapiFhir.validationR4)
force(Dependencies.HapiFhir.validationR5)

force(Dependencies.HapiFhir.fhirCoreDstu2)
force(Dependencies.HapiFhir.fhirCoreDstu2016)
force(Dependencies.HapiFhir.fhirCoreDstu3)
force(Dependencies.HapiFhir.fhirCoreR4)
force(Dependencies.HapiFhir.fhirCoreR4b)
force(Dependencies.HapiFhir.fhirCoreR5)
force(Dependencies.HapiFhir.fhirCoreUtils)
force(Dependencies.HapiFhir.fhirCoreConvertors)
}
}
}

Expand Down
53 changes: 42 additions & 11 deletions buildSrc/src/main/kotlin/Dependencies.kt
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,6 @@ object Dependencies {
const val openCdsGroup = "org.opencds.cqf.cql"
const val translatorGroup = "info.cqframework"

// Remove this after this issue has been fixed:
// https://github.com/cqframework/clinical_quality_language/issues/799
const val antlr4Runtime = "org.antlr:antlr4-runtime:${Versions.Cql.antlr}"

const val engine = "$openCdsGroup:engine:${Versions.Cql.engine}"
const val engineJackson = "$openCdsGroup:engine.jackson:${Versions.Cql.engine}"

Expand All @@ -54,8 +50,32 @@ object Dependencies {
}

object HapiFhir {
const val fhirBase = "ca.uhn.hapi.fhir:hapi-fhir-base:${Versions.hapiFhir}"
const val fhirClient = "ca.uhn.hapi.fhir:hapi-fhir-client:${Versions.hapiFhir}"
const val structuresDstu2 = "ca.uhn.hapi.fhir:hapi-fhir-structures-dstu2:${Versions.hapiFhir}"
const val structuresDstu3 = "ca.uhn.hapi.fhir:hapi-fhir-structures-dstu3:${Versions.hapiFhir}"
const val structuresR4 = "ca.uhn.hapi.fhir:hapi-fhir-structures-r4:${Versions.hapiFhir}"
const val structuresR4b = "ca.uhn.hapi.fhir:hapi-fhir-structures-r4b:${Versions.hapiFhir}"
const val structuresR5 = "ca.uhn.hapi.fhir:hapi-fhir-structures-r5:${Versions.hapiFhir}"

const val validation = "ca.uhn.hapi.fhir:hapi-fhir-validation:${Versions.hapiFhir}"
const val validationDstu3 =
"ca.uhn.hapi.fhir:hapi-fhir-validation-resources-dstu3:${Versions.hapiFhir}"
const val validationR4 =
"ca.uhn.hapi.fhir:hapi-fhir-validation-resources-r4:${Versions.hapiFhir}"
const val validationR5 =
"ca.uhn.hapi.fhir:hapi-fhir-validation-resources-r5:${Versions.hapiFhir}"

const val fhirCoreDstu2 = "ca.uhn.hapi.fhir:org.hl7.fhir.dstu2:${Versions.hapiFhirCore}"
const val fhirCoreDstu2016 =
"ca.uhn.hapi.fhir:org.hl7.fhir.dstu2016may:${Versions.hapiFhirCore}"
const val fhirCoreDstu3 = "ca.uhn.hapi.fhir:org.hl7.fhir.dstu3:${Versions.hapiFhirCore}"
const val fhirCoreR4 = "ca.uhn.hapi.fhir:org.hl7.fhir.r4:${Versions.hapiFhirCore}"
const val fhirCoreR4b = "ca.uhn.hapi.fhir:org.hl7.fhir.r4b:${Versions.hapiFhirCore}"
const val fhirCoreR5 = "ca.uhn.hapi.fhir:org.hl7.fhir.r5:${Versions.hapiFhirCore}"
const val fhirCoreUtils = "ca.uhn.hapi.fhir:org.hl7.fhir.utilities:${Versions.hapiFhirCore}"
const val fhirCoreConvertors =
"ca.uhn.hapi.fhir:org.hl7.fhir.convertors:${Versions.hapiFhirCore}"

// Runtime dependency that is required to run FhirPath (also requires minSDK of 26).
// Version 3.0 uses java.lang.System.Logger, which is not available on Android
Expand All @@ -64,9 +84,19 @@ object Dependencies {
}

object Jackson {
const val annotations = "com.fasterxml.jackson.core:jackson-annotations:${Versions.jackson}"
const val core = "com.fasterxml.jackson.core:jackson-core:${Versions.jackson}"
const val databind = "com.fasterxml.jackson.core:jackson-databind:${Versions.jackson}"
const val mainGroup = "com.fasterxml.jackson"
const val coreGroup = "$mainGroup.core"
const val dataformatGroup = "$mainGroup.dataformat"
const val datatypeGroup = "$mainGroup.datatype"
const val moduleGroup = "$mainGroup.module"

const val annotations = "$coreGroup:jackson-annotations:${Versions.jackson}"
const val bom = "$mainGroup:jackson-bom:${Versions.jackson}"
const val core = "$coreGroup:jackson-core:${Versions.jackson}"
const val databind = "$coreGroup:jackson-databind:${Versions.jackson}"
const val dataformatXml = "$dataformatGroup:jackson-dataformat-xml:${Versions.jackson}"
const val jaxbAnnotations = "$moduleGroup:jackson-module-jaxb-annotations:${Versions.jackson}"
const val jsr310 = "$datatypeGroup:jackson-datatype-jsr310:${Versions.jackson}"
}

object Kotlin {
Expand Down Expand Up @@ -188,9 +218,9 @@ object Dependencies {

object Cql {
const val antlr = "4.10.1"
const val engine = "2.1.0"
const val evaluator = "2.1.0"
const val translator = "2.2.0"
const val engine = "2.4.0"
const val evaluator = "2.4.0"
const val translator = "2.4.0"
}

object Kotlin {
Expand All @@ -205,8 +235,9 @@ object Dependencies {
const val fhirUcum = "1.0.3"
const val guava = "28.2-android"
const val hapiFhir = "6.0.1"
const val hapiFhirCore = "5.6.36"
vitorpamplona marked this conversation as resolved.
Show resolved Hide resolved
const val http = "4.9.1"
const val jackson = "2.12.2"
const val jackson = "2.14.1"
const val jsonToolsPatch = "1.13"
const val jsonAssert = "1.5.1"
const val kotlinPoet = "1.9.0"
Expand Down
4 changes: 0 additions & 4 deletions buildSrc/src/main/kotlin/LicenseeConfig.kt
Original file line number Diff line number Diff line change
Expand Up @@ -100,10 +100,6 @@ fun Project.configureLicensee() {
allowDependency("org.antlr", "antlr4-runtime", "4.10.1") {
because("BSD 3-clause. http://www.antlr.org/license.html")
}
// ANTLR 4
allowDependency("org.antlr", "antlr4", "4.10.1") {
because("BSD 3-clause. http://www.antlr.org/license.html")
}

// Utilities
// https://developers.google.com/android/reference/com/google/android/gms/common/package-summary
Expand Down
47 changes: 47 additions & 0 deletions workflow-testing/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,43 @@ android {
kotlinOptions { jvmTarget = Java.kotlinJvmTarget.toString() }
}

configurations {
all {
exclude(module = "xpp3")
exclude(module = "xpp3_min")
exclude(module = "xmlpull")
exclude(module = "javax.json")
exclude(module = "jcl-over-slf4j")
exclude(group = "org.apache.httpcomponents")

// Removes newer versions of caffeine and manually imports 2.9
// Removes newer versions of hapi and keeps on 6.0.1
// (newer versions don't work on Android)
resolutionStrategy {
force(Dependencies.HapiFhir.caffeine)
force(Dependencies.HapiFhir.fhirBase)
force(Dependencies.HapiFhir.fhirClient)
force(Dependencies.HapiFhir.structuresDstu2)
force(Dependencies.HapiFhir.structuresDstu3)
force(Dependencies.HapiFhir.structuresR4)
force(Dependencies.HapiFhir.structuresR5)
force(Dependencies.HapiFhir.validation)
force(Dependencies.HapiFhir.validationDstu3)
force(Dependencies.HapiFhir.validationR4)
force(Dependencies.HapiFhir.validationR5)

force(Dependencies.HapiFhir.fhirCoreDstu2)
force(Dependencies.HapiFhir.fhirCoreDstu2016)
force(Dependencies.HapiFhir.fhirCoreDstu3)
force(Dependencies.HapiFhir.fhirCoreR4)
force(Dependencies.HapiFhir.fhirCoreR4b)
force(Dependencies.HapiFhir.fhirCoreR5)
force(Dependencies.HapiFhir.fhirCoreUtils)
force(Dependencies.HapiFhir.fhirCoreConvertors)
}
}
}

dependencies {
compileOnly(Dependencies.Cql.engine)
compileOnly(Dependencies.Cql.evaluator)
Expand All @@ -28,6 +65,16 @@ dependencies {
compileOnly(Dependencies.Cql.translatorElm)
compileOnly(Dependencies.Cql.translatorModel)

// Forces the most recent version of jackson, ignoring what dependencies use.
// Remove these lines when HAPI 6.4 becomes available.
compileOnly(Dependencies.Jackson.annotations)
compileOnly(Dependencies.Jackson.bom)
compileOnly(Dependencies.Jackson.core)
compileOnly(Dependencies.Jackson.databind)
compileOnly(Dependencies.Jackson.dataformatXml)
compileOnly(Dependencies.Jackson.jaxbAnnotations)
compileOnly(Dependencies.Jackson.jsr310)

compileOnly(Dependencies.junit)
compileOnly(Dependencies.jsonAssert)
compileOnly(Dependencies.woodstox)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ import ca.uhn.fhir.context.FhirVersionEnum
import org.hl7.fhir.instance.model.api.IBaseBundle
import org.hl7.fhir.instance.model.api.IBaseResource
import org.hl7.fhir.r4.model.Bundle
import org.hl7.fhir.r4.model.CarePlan
import org.hl7.fhir.r4.model.Coding
import org.hl7.fhir.r4.model.Endpoint
import org.hl7.fhir.r4.model.IdType
Expand Down Expand Up @@ -49,7 +48,7 @@ import org.opencds.cqf.cql.evaluator.fhir.adapter.r4.AdapterFactory
import org.opencds.cqf.cql.evaluator.fhir.dal.FhirDal
import org.opencds.cqf.cql.evaluator.library.CqlFhirParametersConverter
import org.opencds.cqf.cql.evaluator.library.LibraryProcessor
import org.opencds.cqf.cql.evaluator.plandefinition.r4.OperationParametersParser
import org.opencds.cqf.cql.evaluator.plandefinition.OperationParametersParser
import org.opencds.cqf.cql.evaluator.plandefinition.r4.PlanDefinitionProcessor
import org.skyscreamer.jsonassert.JSONAssert

Expand Down Expand Up @@ -218,7 +217,7 @@ object PlanDefinition : Loadable() {
}
}

class GeneratedCarePlan(val carePlan: CarePlan) {
class GeneratedCarePlan(val carePlan: IBaseResource) {
fun isEqualsTo(expectedCarePlanAssetName: String) {
try {
JSONAssert.assertEquals(
Expand All @@ -229,6 +228,9 @@ object PlanDefinition : Loadable() {
} catch (e: JSONException) {
e.printStackTrace()
fail("Unable to compare Jsons: " + e.message)
} catch (e: AssertionError) {
println("Actual: " + jsonParser.encodeResourceToString(carePlan))
throw e
}
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,66 +1,90 @@
{
"resourceType": "CarePlan",
"contained": [ {
"resourceType": "RequestGroup",
"id": "1",
"status": "draft",
"intent": "proposal",
"action": [ {
"title": "Child Monthly Routine Visit",
"description": "This action will performed every month for a patient < 5 years old. The start date with be next month after registration while the end date will be the 60th week after birth.",
"timingTiming": {
"repeat": {
"countMax": 59,
"duration": 2,
"durationMax": 4,
"durationUnit": "h",
"frequency": 1,
"frequencyMax": 1,
"period": 1,
"periodMax": 1,
"periodUnit": "mo"
"contained": [
{
"resourceType": "RequestGroup",
"id": "ChildRoutineVisit-PlanDefinition-1.0.0",
"instantiatesCanonical": [ "http://fhir.org/guides/cdc/opioid-cds/PlanDefinition/ChildRoutineVisit-PlanDefinition-1.0.0" ],
"status": "draft",
"intent": "proposal",
"subject": {
"reference": "Patient/ChildRoutine-Reportable"
},
"action": [
{
"title": "Child Monthly Routine Visit",
"description": "This action will performed every month for a patient < 5 years old. The start date with be next month after registration while the end date will be the 60th week after birth.",
"timingTiming": {
"repeat": {
"countMax": 59,
"duration": 2,
"durationMax": 4,
"durationUnit": "h",
"frequency": 1,
"frequencyMax": 1,
"period": 1,
"periodMax": 1,
"periodUnit": "mo"
}
},
"resource": {
"reference": "https://fhir.labs.smartregister.org/fhir/Questionnaire/105056"
}
}
]
},
{
"resourceType": "Goal",
"id": "1",
"category": [
{
"coding": [
{
"system": "https://www.hl7.org/fhir/codesystem-goal-category.html",
"code": "nursing",
"display": "Nursing"
}
]
}
],
"priority": {
"coding": [
{
"system": "https://www.hl7.org/fhir/codesystem-goal-priority.html",
"code": "high-priority",
"display": "High Priority"
}
]
},
"resource": {
"reference": "https://fhir.labs.smartregister.org/fhir/Questionnaire/105056"
"startCodeableConcept": {
"coding": [
{
"system": "http://www.snomed.org/",
"code": "32485007",
"display": "Admission to hospital"
}
]
}
} ]
}, {
"resourceType": "Goal",
"id": "2",
"category": [ {
"coding": [ {
"system": "https://www.hl7.org/fhir/codesystem-goal-category.html",
"code": "nursing",
"display": "Nursing"
} ]
} ],
"priority": {
"coding": [ {
"system": "https://www.hl7.org/fhir/codesystem-goal-priority.html",
"code": "high-priority",
"display": "High Priority"
} ]
},
"startCodeableConcept": {
"coding": [ {
"system": "http://www.snomed.org/",
"code": "32485007",
"display": "Admission to hospital"
} ]
}
} ],
"instantiatesCanonical": [ "ChildRoutineVisit-PlanDefinition-1.0.0" ],
],
"instantiatesCanonical": [
"http://fhir.org/guides/cdc/opioid-cds/PlanDefinition/ChildRoutineVisit-PlanDefinition-1.0.0"
],
"status": "draft",
"intent": "proposal",
"subject": {
"reference": "Patient/ChildRoutine-Reportable"
},
"goal": [ {
"reference": "#2"
} ],
"activity": [ {
"reference": {
"goal": [
{
"reference": "#1"
}
} ]
],
"activity": [
{
"reference": {
"reference": "#ChildRoutineVisit-PlanDefinition-1.0.0"
}
}
]
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
"resource": {
"resourceType": "PlanDefinition",
"id": "ChildRoutineVisit-PlanDefinition-1.0.0",
"url": "http://fhir.org/guides/cdc/opioid-cds/PlanDefinition/ChildRoutineVisit-PlanDefinition-1.0.0",
"name": "Child Routine visit PlanDefinition",
"title": "Child Routine visit PlanDefinition",
"status": "active",
Expand Down
Loading