Skip to content

Commit

Permalink
Merge branch 'master' into fix-sync-state-excepiton
Browse files Browse the repository at this point in the history
  • Loading branch information
dubdabasoduba authored Jan 19, 2023
2 parents cee67c2 + 6dbb614 commit 5e6a522
Show file tree
Hide file tree
Showing 577 changed files with 22,501 additions and 14,391 deletions.
14 changes: 5 additions & 9 deletions benchmark/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
import Dependencies.forceHapiVersion
import Dependencies.removeIncompatibleDependencies

plugins {
id(Plugins.BuildPlugins.androidLib)
id(Plugins.BuildPlugins.kotlinAndroid)
Expand Down Expand Up @@ -67,15 +70,8 @@ android {

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")
// Remove this after this issue has been fixed:
// https://github.com/cqframework/clinical_quality_language/issues/799
exclude(module = "antlr4")
removeIncompatibleDependencies()
forceHapiVersion()
}
}

Expand Down
1 change: 0 additions & 1 deletion buildSrc/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,4 @@ dependencies {
implementation("ca.uhn.hapi.fhir:hapi-fhir-structures-r4:6.0.1")
implementation("com.squareup:kotlinpoet:1.9.0")
implementation("org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.6.21")
implementation("org.jetbrains.dokka:dokka-gradle-plugin:1.6.10")
}
128 changes: 117 additions & 11 deletions buildSrc/src/main/kotlin/Dependencies.kt
Original file line number Diff line number Diff line change
@@ -1,3 +1,22 @@
/*
* Copyright 2022 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

import org.gradle.api.artifacts.Configuration
import org.gradle.kotlin.dsl.exclude

/*
* Copyright 2022 Google LLC
*
Expand Down Expand Up @@ -34,10 +53,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 @@ -53,9 +68,37 @@ object Dependencies {
const val translatorModelJackson = "$translatorGroup:model-jackson:${Versions.Cql.translator}"
}

object Glide {
const val glide = "com.github.bumptech.glide:glide:${Versions.Glide.glide}"
}

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 +107,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 +241,13 @@ 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 Glide {
const val glide = "4.14.2"
}

object Kotlin {
Expand All @@ -204,9 +261,17 @@ object Dependencies {
const val caffeine = "2.9.1"
const val fhirUcum = "1.0.3"
const val guava = "28.2-android"

// Hapi FHIR and HL7 Core Components are interlinked.
// Newer versions of HapiFhir don't work on Android due to the use of Caffeine 3+
// Wait for this to release (6.3): https://github.com/hapifhir/hapi-fhir/pull/4196
const val hapiFhir = "6.0.1"
// Newer versions don't work on Android due to Apache Commons Codec:
// Wait for this fix: https://github.com/hapifhir/org.hl7.fhir.core/issues/1046
const val hapiFhirCore = "5.6.36"

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 Expand Up @@ -245,4 +310,45 @@ object Dependencies {
const val objectDetectionCustom = "16.3.1"
}
}

fun Configuration.removeIncompatibleDependencies() {
exclude(module = "xpp3")
exclude(module = "xpp3_min")
exclude(module = "xmlpull")
exclude(module = "javax.json")
exclude(module = "jcl-over-slf4j")
exclude(group = "org.apache.httpcomponents")
}

fun Configuration.forceHapiVersion() {
// Removes newer versions of caffeine and manually imports 2.9
// Removes newer versions of hapi and keeps on 6.0.1
// Removes newer versions of HL7 core and keeps it on 5.6.36
// (newer versions don't work on Android)
resolutionStrategy {
force(HapiFhir.caffeine)

force(HapiFhir.fhirBase)
force(HapiFhir.fhirClient)
force(HapiFhir.fhirCoreConvertors)

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

force(HapiFhir.structuresDstu2)
force(HapiFhir.structuresDstu3)
force(HapiFhir.structuresR4)
force(HapiFhir.structuresR5)

force(HapiFhir.validation)
force(HapiFhir.validationDstu3)
force(HapiFhir.validationR4)
force(HapiFhir.validationR5)
}
}
}
44 changes: 0 additions & 44 deletions buildSrc/src/main/kotlin/DokkaConfig.kt

This file was deleted.

24 changes: 20 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 Expand Up @@ -149,6 +145,26 @@ fun Project.configureLicensee() {
// Vision Common
// https://developers.google.com/android/reference/com/google/mlkit/vision/common/package-summary
allowDependency("com.google.mlkit", "vision-internal-vkp", "18.0.0") { because("") }

// Glide
allowDependency("com.github.bumptech.glide", "glide", "4.14.2") {
because("BSD, part MIT and Apache 2.0. https://github.com/bumptech/glide#license")
}

// Glide Annotations
allowDependency("com.github.bumptech.glide", "annotations", "4.14.2") {
because("BSD, part MIT and Apache 2.0. https://github.com/bumptech/glide#license")
}

// Glide Disk LRU Cache
allowDependency("com.github.bumptech.glide", "disklrucache", "4.14.2") {
because("BSD, part MIT and Apache 2.0. https://github.com/bumptech/glide#license")
}

// Glide GIF Decoder
allowDependency("com.github.bumptech.glide", "gifdecoder", "4.14.2") {
because("BSD, part MIT and Apache 2.0. https://github.com/bumptech/glide#license")
}
}
}

Expand Down
3 changes: 1 addition & 2 deletions buildSrc/src/main/kotlin/Plugins.kt
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ object Plugins {
const val application = "com.android.application"
const val benchmark = "androidx.benchmark"
const val jetbrainsKotlinAndroid = "org.jetbrains.kotlin.android"
// Use Dokka 1.6.10 until https://github.com/Kotlin/dokka/issues/2452 is resolved.
const val dokka = "org.jetbrains.dokka"
const val kotlin = "kotlin"
const val kotlinAndroid = "kotlin-android"
Expand All @@ -45,7 +44,7 @@ object Plugins {
object Versions {
const val androidGradlePlugin = "7.2.1"
const val benchmarkPlugin = "1.1.0"
// Use Dokka 1.6.10 until https://github.com/Kotlin/dokka/issues/2472 is resolved.
// Change dokka to 1.7.20 once androidGradlePlugin upgrades to 7.3+
const val dokka = "1.6.10"
}
}
19 changes: 18 additions & 1 deletion catalog/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,16 @@
-->
<manifest
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
package="com.google.android.fhir.catalog"
>

<uses-feature android:name="android.hardware.camera" />

<uses-permission android:name="android.permission.CAMERA" />
<uses-permission
android:name="android.permission.CAMERA"
android:required="false"
/>

<application
android:allowBackup="true"
Expand All @@ -40,6 +44,19 @@
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>

<provider
android:name="androidx.core.content.FileProvider"
android:authorities="com.google.android.fhir.catalog.fileprovider"
android:exported="false"
android:grantUriPermissions="true"
>
<meta-data
android:name="android.support.FILE_PROVIDER_PATHS"
android:resource="@xml/file_paths"
>
</meta-data>
</provider>
</application>

</manifest>
52 changes: 52 additions & 0 deletions catalog/src/main/assets/component_attachment.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
{
"resourceType": "Questionnaire",
"item": [
{
"extension": [
{
"url": "http://hl7.org/fhir/StructureDefinition/mimeType",
"valueCode": "image/*"
},
{
"url": "http://hl7.org/fhir/StructureDefinition/mimeType",
"valueCode": "audio/*"
},
{
"url": "http://hl7.org/fhir/StructureDefinition/mimeType",
"valueCode": "video/*"
},
{
"url": "http://hl7.org/fhir/StructureDefinition/mimeType",
"valueCode": "application/pdf"
},
{
"url": "http://hl7.org/fhir/StructureDefinition/maxSize",
"valueDecimal": 5242880
}
],
"linkId": "1",
"text": "Select an image or file to upload",
"type": "attachment",
"item": [
{
"extension": [
{
"url": "http://hl7.org/fhir/StructureDefinition/questionnaire-displayCategory",
"valueCodeableConcept": {
"coding": [
{
"system": "http://hl7.org/fhir/questionnaire-display-category",
"code": "instructions"
}
]
}
}
],
"linkId": "1-media-types-supported",
"text": "Media types supported: .jpg, .png, .mp3, .mp4, .pdf",
"type": "display"
}
]
}
]
}
Loading

0 comments on commit 5e6a522

Please sign in to comment.