From f2fa725bba4605e94f658a398cda37153f320e64 Mon Sep 17 00:00:00 2001 From: "Md. Asaduzzaman" Date: Tue, 25 Jun 2024 13:34:16 +0600 Subject: [PATCH 1/4] Support Custom Search Parameter in x-fhir-query (#2555) * Support Custom Search Parameter in x-fhir-query * Instead of exposing whole FhirEngineConfiguration use SearchParamDefinitionsProvider * Added kdoc for newly created function --- .../google/android/fhir/FhirEngineProvider.kt | 10 +++++ .../com/google/android/fhir/FhirServices.kt | 6 ++- .../fhir/search/query/XFhirQueryTranslator.kt | 7 ++- .../search/query/XFhirQueryTranslatorTest.kt | 45 ++++++++++++++++++- 4 files changed, 64 insertions(+), 4 deletions(-) diff --git a/engine/src/main/java/com/google/android/fhir/FhirEngineProvider.kt b/engine/src/main/java/com/google/android/fhir/FhirEngineProvider.kt index ae3ab614fe..2095bbfd0d 100644 --- a/engine/src/main/java/com/google/android/fhir/FhirEngineProvider.kt +++ b/engine/src/main/java/com/google/android/fhir/FhirEngineProvider.kt @@ -19,6 +19,7 @@ package com.google.android.fhir import android.content.Context import com.google.android.fhir.DatabaseErrorStrategy.UNSPECIFIED import com.google.android.fhir.db.Database +import com.google.android.fhir.index.SearchParamDefinitionsProvider import com.google.android.fhir.sync.DataSource import com.google.android.fhir.sync.FhirDataStore import com.google.android.fhir.sync.HttpAuthenticator @@ -100,6 +101,15 @@ object FhirEngineProvider { return checkNotNull(fhirServices) } + /** + * Returns the [SearchParamDefinitionsProvider] instance created in [FhirServices] class once the + * [FhirServices] class has been created, ie, which is when [FhirEngine] instance has been asked + * for by the application. + * + * If this method is called without creating [FhirEngine] instance, this will return null. + */ + internal fun getSearchParamProvider() = fhirServices?.searchParamProvider + @Synchronized fun cleanup() { check(fhirEngineConfiguration?.testMode == true) { diff --git a/engine/src/main/java/com/google/android/fhir/FhirServices.kt b/engine/src/main/java/com/google/android/fhir/FhirServices.kt index 600bf0790b..efa76f0536 100644 --- a/engine/src/main/java/com/google/android/fhir/FhirServices.kt +++ b/engine/src/main/java/com/google/android/fhir/FhirServices.kt @@ -27,6 +27,7 @@ import com.google.android.fhir.db.impl.DatabaseEncryptionKeyProvider.isDatabaseE import com.google.android.fhir.db.impl.DatabaseImpl import com.google.android.fhir.impl.FhirEngineImpl import com.google.android.fhir.index.ResourceIndexer +import com.google.android.fhir.index.SearchParamDefinitionsProvider import com.google.android.fhir.index.SearchParamDefinitionsProviderImpl import com.google.android.fhir.sync.DataSource import com.google.android.fhir.sync.FhirDataStore @@ -41,6 +42,7 @@ internal data class FhirServices( val database: Database, val remoteDataSource: DataSource? = null, val fhirDataStore: FhirDataStore, + val searchParamProvider: SearchParamDefinitionsProvider, ) { class Builder(private val context: Context) { private var inMemory: Boolean = false @@ -76,13 +78,14 @@ internal data class FhirServices( val terser = FhirTerser(FhirContext.forCached(FhirVersionEnum.R4)) val searchParamMap = searchParameters?.asMapOfResourceTypeToSearchParamDefinitions() ?: emptyMap() + val provider = SearchParamDefinitionsProviderImpl(searchParamMap) val db = DatabaseImpl( context = context, iParser = parser, fhirTerser = terser, DatabaseConfig(inMemory, enableEncryption, databaseErrorStrategy), - resourceIndexer = ResourceIndexer(SearchParamDefinitionsProviderImpl(searchParamMap)), + resourceIndexer = ResourceIndexer(provider), ) val engine = FhirEngineImpl(database = db, context = context) val remoteDataSource = @@ -101,6 +104,7 @@ internal data class FhirServices( database = db, remoteDataSource = remoteDataSource, fhirDataStore = FhirDataStore(context), + searchParamProvider = provider, ) } } diff --git a/engine/src/main/java/com/google/android/fhir/search/query/XFhirQueryTranslator.kt b/engine/src/main/java/com/google/android/fhir/search/query/XFhirQueryTranslator.kt index 9681728c0a..3fbe87c854 100644 --- a/engine/src/main/java/com/google/android/fhir/search/query/XFhirQueryTranslator.kt +++ b/engine/src/main/java/com/google/android/fhir/search/query/XFhirQueryTranslator.kt @@ -23,9 +23,10 @@ import ca.uhn.fhir.rest.gclient.ReferenceClientParam import ca.uhn.fhir.rest.gclient.StringClientParam import ca.uhn.fhir.rest.gclient.TokenClientParam import ca.uhn.fhir.rest.gclient.UriClientParam +import com.google.android.fhir.FhirEngineProvider import com.google.android.fhir.getResourceClass import com.google.android.fhir.index.SearchParamDefinition -import com.google.android.fhir.index.getSearchParamList +import com.google.android.fhir.index.SearchParamDefinitionsProviderImpl import com.google.android.fhir.isValidDateOnly import com.google.android.fhir.search.Order import com.google.android.fhir.search.Search @@ -47,6 +48,8 @@ import org.hl7.fhir.r4.model.ResourceType internal object XFhirQueryTranslator { private const val XFHIR_QUERY_SORT_PARAM = "_sort" private const val XFHIR_QUERY_COUNT_PARAM = "_count" + private val searchParamProvider = + FhirEngineProvider.getSearchParamProvider() ?: SearchParamDefinitionsProviderImpl() /** * Translates the basic x-fhir-query string defined in @@ -177,7 +180,7 @@ internal object XFhirQueryTranslator { } private val ResourceType.resourceSearchParameters - get() = getSearchParamList(getResourceClass(this).newInstance()) + get() = searchParamProvider.get(getResourceClass(this).newInstance()) /** Parse string key-val map to SearchParamDefinition-Value map */ private fun Map.toSearchParamDefinitionValueMap( diff --git a/engine/src/test/java/com/google/android/fhir/search/query/XFhirQueryTranslatorTest.kt b/engine/src/test/java/com/google/android/fhir/search/query/XFhirQueryTranslatorTest.kt index 25df4af9a2..6bbf69be6d 100644 --- a/engine/src/test/java/com/google/android/fhir/search/query/XFhirQueryTranslatorTest.kt +++ b/engine/src/test/java/com/google/android/fhir/search/query/XFhirQueryTranslatorTest.kt @@ -1,5 +1,5 @@ /* - * Copyright 2023 Google LLC + * Copyright 2023-2024 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -17,6 +17,9 @@ package com.google.android.fhir.search.query import android.os.Build +import androidx.test.core.app.ApplicationProvider +import com.google.android.fhir.FhirEngineConfiguration +import com.google.android.fhir.FhirEngineProvider import com.google.android.fhir.index.SearchParamDefinition import com.google.android.fhir.search.Order import com.google.android.fhir.search.Search @@ -26,7 +29,10 @@ import com.google.android.fhir.search.query.XFhirQueryTranslator.translate import com.google.common.truth.Truth.assertThat import org.hl7.fhir.r4.model.Enumerations import org.hl7.fhir.r4.model.ResourceType +import org.hl7.fhir.r4.model.SearchParameter +import org.junit.After import org.junit.Assert.assertThrows +import org.junit.Before import org.junit.Test import org.junit.runner.RunWith import org.robolectric.RobolectricTestRunner @@ -35,6 +41,33 @@ import org.robolectric.annotation.Config @RunWith(RobolectricTestRunner::class) @Config(sdk = [Build.VERSION_CODES.P]) class XFhirQueryTranslatorTest { + private val provider: FhirEngineProvider = FhirEngineProvider + + @Before + fun setUp() { + provider.init( + FhirEngineConfiguration( + customSearchParameters = + listOf( + SearchParameter().apply { + addBase("Patient") + name = "maritalStatus" + code = "maritalStatus" + type = Enumerations.SearchParamType.TOKEN + expression = "Patient.maritalStatus.coding.code" + description = "Search the maritalStatus of Patient" + }, + ), + ), + ) + + provider.getInstance(ApplicationProvider.getApplicationContext()) + } + + @After + fun tearDown() { + provider.forceCleanup() + } @Test fun `translate() should add descending sort for sort param with hyphen`() { @@ -360,4 +393,14 @@ class XFhirQueryTranslatorTest { .isEqualTo("http://hl7.org/fhir/us/core/StructureDefinition/us-core-patient") } } + + @Test + fun `translate() should consider custom search parameter through fhir engine configuration`() { + val search = translate("Patient?maritalStatus=M") + + search.tokenFilterCriteria.first().run { + assertThat(this.parameter.paramName).isEqualTo("maritalStatus") + assertThat(this.filters.first().value!!.tokenFilters.first().code).isEqualTo("M") + } + } } From eb563f6f782847cac941b3ec28a120b7ff2aca7b Mon Sep 17 00:00:00 2001 From: Madhuram Jajoo Date: Tue, 25 Jun 2024 15:58:30 +0530 Subject: [PATCH 2/4] Update documentation for custom widget (#2580) * update readme according to review comments * remove extra sub-header * remove extra * recommend to try catalog app in action * add catalog app link * improve documentation * Update docs/use/SDCL/Customize-how-a-Questionnaire-is-displayed.md Co-authored-by: Jing Tang * Update docs/use/SDCL/Customize-how-a-Questionnaire-is-displayed.md Co-authored-by: Jing Tang * Update docs/use/SDCL/Customize-how-a-Questionnaire-is-displayed.md Co-authored-by: Jing Tang * Update docs/use/SDCL/Customize-how-a-Questionnaire-is-displayed.md Co-authored-by: Jing Tang * Update docs/use/SDCL/Customize-how-a-Questionnaire-is-displayed.md Co-authored-by: Jing Tang * Update docs/use/SDCL/Customize-how-a-Questionnaire-is-displayed.md Co-authored-by: Jing Tang * Update docs/use/SDCL/Customize-how-a-Questionnaire-is-displayed.md Co-authored-by: Jing Tang --------- Co-authored-by: Jing Tang --- .../fhir/catalog/CustomNumberPickerFactory.kt | 52 ---------- ...tomize-how-a-Questionnaire-is-displayed.md | 98 +++++++++++-------- 2 files changed, 55 insertions(+), 95 deletions(-) delete mode 100644 catalog/src/main/java/com/google/android/fhir/catalog/CustomNumberPickerFactory.kt diff --git a/catalog/src/main/java/com/google/android/fhir/catalog/CustomNumberPickerFactory.kt b/catalog/src/main/java/com/google/android/fhir/catalog/CustomNumberPickerFactory.kt deleted file mode 100644 index 1aa2c21000..0000000000 --- a/catalog/src/main/java/com/google/android/fhir/catalog/CustomNumberPickerFactory.kt +++ /dev/null @@ -1,52 +0,0 @@ -/* - * 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. - */ - -package com.google.android.fhir.catalog - -import android.view.View -import android.widget.NumberPicker -import com.google.android.fhir.datacapture.views.QuestionnaireViewItem -import com.google.android.fhir.datacapture.views.factories.QuestionnaireItemViewHolderDelegate -import com.google.android.fhir.datacapture.views.factories.QuestionnaireItemViewHolderFactory - -object CustomNumberPickerFactory : - QuestionnaireItemViewHolderFactory(R.layout.custom_number_picker_layout) { - override fun getQuestionnaireItemViewHolderDelegate(): QuestionnaireItemViewHolderDelegate = - object : QuestionnaireItemViewHolderDelegate { - private lateinit var numberPicker: NumberPicker - override lateinit var questionnaireViewItem: QuestionnaireViewItem - - override fun init(itemView: View) { - /** - * Call the [QuestionnaireItemViewHolderDelegate.onAnswerChanged] function when the widget - * is interacted with and answer is changed by user input - */ - numberPicker = itemView.findViewById(R.id.number_picker) - } - - override fun bind(questionnaireViewItem: QuestionnaireViewItem) { - numberPicker.minValue = 1 - numberPicker.maxValue = 100 - } - - override fun setReadOnly(isReadOnly: Boolean) { - numberPicker.isEnabled = !isReadOnly - } - } - - const val WIDGET_EXTENSION = "http://dummy-widget-type-extension" - const val WIDGET_TYPE = "number-picker" -} diff --git a/docs/use/SDCL/Customize-how-a-Questionnaire-is-displayed.md b/docs/use/SDCL/Customize-how-a-Questionnaire-is-displayed.md index 0541490405..3ed391bded 100644 --- a/docs/use/SDCL/Customize-how-a-Questionnaire-is-displayed.md +++ b/docs/use/SDCL/Customize-how-a-Questionnaire-is-displayed.md @@ -79,53 +79,65 @@ component. ### Create a custom component -In order to create a custom component: - -1. Create a layout for the custom component - ([example](https://github.com/google/android-fhir/blob/master/catalog/src/main/res/layout/custom_number_picker_layout.xml)). -2. Create a class for your component that implements - `QuestionnaireItemViewHolderFactory` - ([example](https://github.com/google/android-fhir/blob/master/catalog/src/main/java/com/google/android/fhir/catalog/CustomNumberPickerFactory.kt)). - In that class: - 1. Pass the layout resource for your custom component in the constructor of - your custom factory. - 2. Override the `getQuestionnaireItemViewHolderDelegate()` function. It - must return a `QuestionnaireItemViewHolderDelegate` which implements the - following functions: -3. `init`: a delegate function for the `init` function of - `RecyclerView.ViewHolder` -4. `bind`: a delegate function for the `bind` function of - `RecyclerView.ViewHolder` -5. `displayValidationResult`: displays the validation result for the answer(s) - provided by the user -6. `setReadOnly`: configures the UI based on the read-only status of the - questionnaire item - -### Apply a custom component to questions - -Now that you have defined the custom widget and its behavior, it is time to -configure the Structured Data Capture Library in order for the custom widget to -be applied to the appropriate questions. - -1. Create a QuestionnaireFragment.QuestionnaireItemViewHolderFactoryMatcher - ([example](https://github.com/google/android-fhir/blob/master/catalog/src/main/java/com/google/android/fhir/catalog/CustomQuestionnaireFragment.kt#L26)) - that defines: - 1. factory: The custom component factory to use. - 2. matches: A predicate function which, given a - [`Questionnaire.QuestionnaireItemComponent`](https://hapifhir.io/hapi-fhir/apidocs/hapi-fhir-structures-r4/org/hl7/fhir/r4/model/Questionnaire.QuestionnaireItemComponent.html), - returns true if the factory should apply to that item. -2. Create a custom implementation of `QuestionnaireFragment` that - overrides `getCustomQuestionnaireItemViewHolderFactoryMatchers` - ([example](https://github.com/google/android-fhir/blob/master/catalog/src/main/java/com/google/android/fhir/catalog/CustomQuestionnaireFragment.kt#L22)). - It should return a list that contains your - `QuestionnaireItemViewHolderFactoryMatcher`. -3. When rendering your questionnaire, use your custom implementation of - QuestionnaireFragment instead. +This guide outlines the step-by-step process to create and incorporate custom widgets into FHIR questionnaires using the Android FHIR SDK. + +Note: Examples given below are all from the [catalog](https://github.com/google/android-fhir/tree/master/catalog) application in this repository. We recommend you try out the application to see these concepts in action. + +1. Create a layout for the Custom Component + + Design an XML layout file to define the visual structure and appearance of your custom widget. + + * Example: See this [example location_widget_view.xml](https://github.com/google/android-fhir/blob/master/contrib/locationwidget/src/main/res/layout/location_widget_view.xml). + +2. Create a `QuestionnaireItemViewHolderFactory` class + + Implement a class that extends [QuestionnaireItemViewHolderFactory](https://github.com/google/android-fhir/blob/master/datacapture/src/main/java/com/google/android/fhir/datacapture/views/factories/QuestionnaireItemViewHolderFactory.kt#L35). This class will be responsible for creating and managing the view holder for your custom component. + + * Example: Check out this [example LocationWidgetViewHolderFactory](https://github.com/google/android-fhir/blob/master/contrib/locationwidget/src/main/java/com/google/android/fhir/datacapture/contrib/views/locationwidget/LocationWidgetViewHolderFactory.kt#L29). + + Within this class: + + * Pass the layout resource ID to the constructor. + * Override `getQuestionnaireItemViewHolderDelegate()` to return a `QuestionnaireItemViewHolderDelegate` implementation. This delegate should include: + * `init`: Initializes the `RecyclerView.ViewHolder`. + * `bind`: Binds data to the `RecyclerView.ViewHolder`. + * `displayValidationResult`: Displays validation feedback for user input. + * `setReadOnly`: Configures the UI for read-only mode. + +3. Create `QuestionnaireItemViewHolderFactoryMatcher` Objects + + For each custom `ViewHolderFactory`, create a corresponding factory matcher object - [QuestionnaireItemViewHolderFactoryMatcher](https://github.com/google/android-fhir/blob/master/datacapture/src/main/java/com/google/android/fhir/datacapture/QuestionnaireFragment.kt#L538) + + * Example: Refer to these [matcher examples](https://github.com/google/android-fhir/blob/master/catalog/src/main/java/com/google/android/fhir/catalog/ContribQuestionnaireItemViewHolderFactoryMatchersProviderFactory.kt#L38C15-L45C16). + + Each matcher should define: + + * `factory`: The custom `ViewHolderFactory` instance. + * `matches`: A predicate function that takes a [`Questionnaire.QuestionnaireItemComponent`](https://hapifhir.io/hapi-fhir/apidocs/hapi-fhir-structures-r4/org/hl7/fhir/r4/model/Questionnaire.QuestionnaireItemComponent.html) and returns `true` if this factory is suitable for rendering that item. + +4. Create a `QuestionnaireItemViewHolderFactoryMatchersProviderFactory` + + Create a factory class that implements this interface. It acts as a central registry for your custom widget associations. + + * Example: This [example factory class](https://github.com/google/android-fhir/blob/master/catalog/src/main/java/com/google/android/fhir/catalog/ContribQuestionnaireItemViewHolderFactoryMatchersProviderFactory.kt) demonstrates this. + +5. Register the Factory in `DataCaptureConfig` + + In your `DataCaptureConfig` object, set the `questionnaireItemViewHolderFactoryMatchersProviderFactory` property to your custom factory instance. + + * Example: See how this is done in [this code](https://github.com/google/android-fhir/blob/master/catalog/src/main/java/com/google/android/fhir/catalog/CatalogApplication.kt#L42C5-L47C8). + +6. Use the Custom Widget in Your Questionnaire Fragment + + When building your `QuestionnaireFragment`, call the `setCustomQuestionnaireItemViewHolderFactoryMatchersProvider` method on the builder, providing the string identifier associated with your custom widget. + + * Example: This [usage example](https://github.com/google/android-fhir/blob/master/catalog/src/main/java/com/google/android/fhir/catalog/DemoQuestionnaireFragment.kt#L142C13-L150C23) shows how to set up the fragment. + ## Localize questionnaires When rendering your questionnaire, the library will look for the -[translation extension](http://hl7.org/fhir/extension-translation.html), and if +[translation extension](https://www.hl7.org/fhir/R4/languages.html##ext), and if the lang element matches the application default locale, will use the value of the content element of the extension instead of the text element of the questionnaire item. You can also use the From ada0b03cd57ecfe972e7a633b29b98ec81b93ce8 Mon Sep 17 00:00:00 2001 From: Jing Tang Date: Tue, 25 Jun 2024 12:58:21 +0100 Subject: [PATCH 3/4] Remove old plan generation APIs (#2587) * Deprecate old plan generation APIs * Rename params --- .../android/fhir/workflow/FhirOperator.kt | 94 ++----------------- .../android/fhir/workflow/FhirOperatorTest.kt | 11 ++- 2 files changed, 12 insertions(+), 93 deletions(-) diff --git a/workflow/src/main/java/com/google/android/fhir/workflow/FhirOperator.kt b/workflow/src/main/java/com/google/android/fhir/workflow/FhirOperator.kt index 6b92d735f4..39dc05843d 100644 --- a/workflow/src/main/java/com/google/android/fhir/workflow/FhirOperator.kt +++ b/workflow/src/main/java/com/google/android/fhir/workflow/FhirOperator.kt @@ -154,93 +154,11 @@ internal constructor( * NOTE: The API may internally result in a blocking IO operation. The user should call the API * from a worker thread or it may throw [BlockingMainThreadException] exception. */ - @WorkerThread - @Deprecated( - "Use generateCarePlan with the planDefinition's url instead.", - ReplaceWith("this.generateCarePlan(CanonicalType, String)"), - ) - fun generateCarePlan(planDefinitionId: String, subject: String): IBaseResource { - return generateCarePlan(planDefinitionId, subject, encounterId = null) - } - - /** - * Generates a [CarePlan] based on the provided inputs. - * - * NOTE: The API may internally result in a blocking IO operation. The user should call the API - * from a worker thread or it may throw [BlockingMainThreadException] exception. - */ - @WorkerThread - @Deprecated( - "Use generateCarePlan with the planDefinition's url instead.", - ReplaceWith("this.generateCarePlan(CanonicalType, String, String)"), - ) - fun generateCarePlan( - planDefinitionId: String, - subject: String, - encounterId: String?, - ): IBaseResource { - return planDefinitionProcessor.apply( - /* id = */ IdType("PlanDefinition", planDefinitionId), - /* canonical = */ null, - /* planDefinition = */ null, - /* subject = */ subject, - /* encounterId = */ encounterId, - /* practitionerId = */ null, - /* organizationId = */ null, - /* userType = */ null, - /* userLanguage = */ null, - /* userTaskContext = */ null, - /* setting = */ null, - /* settingContext = */ null, - /* parameters = */ null, - /* useServerData = */ null, - /* bundle = */ null, - /* prefetchData = */ null, - libraryProcessor, - ) as IBaseResource - } - - @WorkerThread - fun generateCarePlan( - planDefinition: CanonicalType, - subject: String, - encounterId: String? = null, - practitionerId: String? = null, - organizationId: String? = null, - userType: IBaseDatatype? = null, - userLanguage: IBaseDatatype? = null, - userTaskContext: IBaseDatatype? = null, - setting: IBaseDatatype? = null, - settingContext: IBaseDatatype? = null, - parameters: IBaseParameters? = null, - useServerData: Boolean? = null, - bundle: IBaseBundle? = null, - prefetchData: IBaseParameters? = null, - ): IBaseResource { - return planDefinitionProcessor.apply( - /* id = */ null, - /* canonical = */ planDefinition, - /* planDefinition = */ null, - /* subject = */ subject, - /* encounterId = */ encounterId, - /* practitionerId = */ practitionerId, - /* organizationId = */ organizationId, - /* userType = */ userType, - /* userLanguage = */ userLanguage, - /* userTaskContext = */ userTaskContext, - /* setting = */ setting, - /* settingContext = */ settingContext, - /* parameters = */ parameters, - /* useServerData = */ useServerData, - /* bundle = */ bundle, - /* prefetchData = */ prefetchData, - libraryProcessor, - ) as IBaseResource - } - @WorkerThread fun generateCarePlan( - planDefinition: PlanDefinition, + planDefinitionId: String? = null, + planDefinitionCanonical: CanonicalType? = null, + planDefinition: PlanDefinition? = null, subject: String, encounterId: String? = null, practitionerId: String? = null, @@ -256,8 +174,8 @@ internal constructor( prefetchData: IBaseParameters? = null, ): IBaseResource { return planDefinitionProcessor.apply( - /* id = */ null, - /* canonical = */ null, + /* id = */ planDefinitionId?.let { IdType("PlanDefinition", it) }, + /* canonical = */ planDefinitionCanonical, /* planDefinition = */ planDefinition, /* subject = */ subject, /* encounterId = */ encounterId, @@ -277,7 +195,7 @@ internal constructor( } /** Checks if the Resource ID contains a type and if not, adds a default type */ - fun checkAndAddType(id: String, defaultType: String): String { + private fun checkAndAddType(id: String, defaultType: String): String { return if (id.indexOf("/") == -1) "$defaultType/$id" else id } diff --git a/workflow/src/test/java/com/google/android/fhir/workflow/FhirOperatorTest.kt b/workflow/src/test/java/com/google/android/fhir/workflow/FhirOperatorTest.kt index c534d728b4..98cf265766 100644 --- a/workflow/src/test/java/com/google/android/fhir/workflow/FhirOperatorTest.kt +++ b/workflow/src/test/java/com/google/android/fhir/workflow/FhirOperatorTest.kt @@ -1,5 +1,5 @@ /* - * Copyright 2023 Google LLC + * Copyright 2023-2024 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -28,7 +28,6 @@ import com.google.android.fhir.workflow.testing.FhirEngineProviderTestRule import com.google.common.truth.Truth.assertThat import java.io.File import java.io.InputStream -import java.lang.IllegalArgumentException import java.util.TimeZone import kotlin.reflect.KSuspendFunction1 import org.hl7.fhir.r4.model.Bundle @@ -99,7 +98,7 @@ class FhirOperatorTest { assertThat( fhirOperator.generateCarePlan( - planDefinition = + planDefinitionCanonical = CanonicalType( "http://hl7.org/fhir/us/ecr/PlanDefinition/plandefinition-RuleFilters-1.0.0", ), @@ -117,7 +116,8 @@ class FhirOperatorTest { val carePlan = fhirOperator.generateCarePlan( - planDefinition = CanonicalType("http://localhost/PlanDefinition/MedRequest-Example"), + planDefinitionCanonical = + CanonicalType("http://localhost/PlanDefinition/MedRequest-Example"), subject = "Patient/Patient-Example", ) @@ -139,7 +139,8 @@ class FhirOperatorTest { val carePlan = fhirOperator.generateCarePlan( - planDefinition = CanonicalType("http://example.com/PlanDefinition/Plan-Definition-Example"), + planDefinitionCanonical = + CanonicalType("http://example.com/PlanDefinition/Plan-Definition-Example"), subject = "Patient/Female-Patient-Example", ) From e1929703bda4cbe6352766dde34073a6ad23a881 Mon Sep 17 00:00:00 2001 From: Jing Tang Date: Wed, 26 Jun 2024 08:10:50 +0100 Subject: [PATCH 4/4] Migrate AndroidX dependencies to the version catalog (#2591) * Migrate AndroidX dependencies to the version catalog * Update Dependencies.kt --- buildSrc/src/main/kotlin/Dependencies.kt | 54 ------------------------ buildSrc/src/main/kotlin/Plugins.kt | 3 +- catalog/build.gradle.kts | 12 +++--- contrib/barcode/build.gradle.kts | 6 +-- contrib/locationwidget/build.gradle.kts | 6 +-- datacapture/build.gradle.kts | 12 +++--- demo/build.gradle.kts | 24 +++++------ document/build.gradle.kts | 4 +- engine/benchmark/build.gradle.kts | 4 +- engine/build.gradle.kts | 20 ++++----- gradle/libs.versions.toml | 31 ++++++++++++++ knowledge/build.gradle.kts | 8 ++-- workflow/benchmark/build.gradle.kts | 4 +- workflow/build.gradle.kts | 4 +- 14 files changed, 84 insertions(+), 108 deletions(-) diff --git a/buildSrc/src/main/kotlin/Dependencies.kt b/buildSrc/src/main/kotlin/Dependencies.kt index 296b3b9290..a602784c79 100644 --- a/buildSrc/src/main/kotlin/Dependencies.kt +++ b/buildSrc/src/main/kotlin/Dependencies.kt @@ -19,21 +19,6 @@ import org.gradle.api.artifacts.DependencyConstraint import org.gradle.kotlin.dsl.exclude object Dependencies { - - object Androidx { - const val activity = "androidx.activity:activity:${Versions.Androidx.activity}" - const val appCompat = "androidx.appcompat:appcompat:${Versions.Androidx.appCompat}" - const val constraintLayout = - "androidx.constraintlayout:constraintlayout:${Versions.Androidx.constraintLayout}" - const val coreKtx = "androidx.core:core-ktx:${Versions.Androidx.coreKtx}" - const val datastorePref = - "androidx.datastore:datastore-preferences:${Versions.Androidx.datastorePref}" - const val fragmentKtx = "androidx.fragment:fragment-ktx:${Versions.Androidx.fragmentKtx}" - const val recyclerView = "androidx.recyclerview:recyclerview:${Versions.Androidx.recyclerView}" - const val sqliteKtx = "androidx.sqlite:sqlite-ktx:${Versions.Androidx.sqliteKtx}" - const val workRuntimeKtx = "androidx.work:work-runtime-ktx:${Versions.Androidx.workRuntimeKtx}" - } - object Cql { const val evaluator = "org.opencds.cqf.fhir:cqf-fhir-cr:${Versions.Cql.clinicalReasoning}" const val evaluatorFhirJackson = @@ -106,32 +91,11 @@ object Dependencies { const val stdlib = "org.jetbrains.kotlin:kotlin-stdlib:${Versions.Kotlin.stdlib}" } - object Lifecycle { - const val liveDataKtx = - "androidx.lifecycle:lifecycle-livedata-ktx:${Versions.Androidx.lifecycle}" - const val runtime = "androidx.lifecycle:lifecycle-runtime:${Versions.Androidx.lifecycle}" - const val viewModelKtx = - "androidx.lifecycle:lifecycle-viewmodel-ktx:${Versions.Androidx.lifecycle}" - } - - object Navigation { - const val navFragmentKtx = - "androidx.navigation:navigation-fragment-ktx:${Versions.Androidx.navigation}" - const val navUiKtx = "androidx.navigation:navigation-ui-ktx:${Versions.Androidx.navigation}" - } - object Retrofit { const val coreRetrofit = "com.squareup.retrofit2:retrofit:${Versions.retrofit}" const val gsonConverter = "com.squareup.retrofit2:converter-gson:${Versions.retrofit}" } - object Room { - const val compiler = "androidx.room:room-compiler:${Versions.Androidx.room}" - const val ktx = "androidx.room:room-ktx:${Versions.Androidx.room}" - const val runtime = "androidx.room:room-runtime:${Versions.Androidx.room}" - const val testing = "androidx.room:room-testing:${Versions.Androidx.room}" - } - object Mlkit { const val barcodeScanning = "com.google.mlkit:barcode-scanning:${Versions.Mlkit.barcodeScanning}" @@ -157,7 +121,6 @@ object Dependencies { const val desugarJdkLibs = "com.android.tools:desugar_jdk_libs:${Versions.desugarJdkLibs}" const val fhirUcum = "org.fhir:ucum:${Versions.fhirUcum}" - const val gson = "com.google.code.gson:gson:${Versions.gson}" const val guavaModule = "com.google.guava:guava" const val guava = "$guavaModule:${Versions.guava}" @@ -188,8 +151,6 @@ object Dependencies { "androidx.fragment:fragment-testing:${Versions.AndroidxTest.fragmentVersion}" const val rules = "androidx.test:rules:${Versions.AndroidxTest.rules}" const val runner = "androidx.test:runner:${Versions.AndroidxTest.runner}" - const val workTestingRuntimeKtx = - "androidx.work:work-testing:${Versions.Androidx.workRuntimeKtx}" } object Espresso { @@ -212,20 +173,6 @@ object Dependencies { const val xmlUnit = "org.xmlunit:xmlunit-core:${Versions.xmlUnit}" object Versions { - object Androidx { - const val activity = "1.7.2" - const val appCompat = "1.6.1" - const val constraintLayout = "2.1.4" - const val coreKtx = "1.10.1" - const val datastorePref = "1.0.0" - const val fragmentKtx = "1.6.0" - const val lifecycle = "2.6.1" - const val navigation = "2.6.0" - const val recyclerView = "1.3.0" - const val room = "2.5.2" - const val sqliteKtx = "2.3.1" - const val workRuntimeKtx = "2.8.1" - } object Cql { const val clinicalReasoning = "3.0.0-PRE9-SNAPSHOT" @@ -243,7 +190,6 @@ object Dependencies { const val desugarJdkLibs = "2.0.3" const val caffeine = "2.9.1" const val fhirUcum = "1.0.3" - const val gson = "2.9.1" const val guava = "32.1.3-android" const val hapiFhir = "6.8.0" diff --git a/buildSrc/src/main/kotlin/Plugins.kt b/buildSrc/src/main/kotlin/Plugins.kt index a28bfd9f3d..ac076028ab 100644 --- a/buildSrc/src/main/kotlin/Plugins.kt +++ b/buildSrc/src/main/kotlin/Plugins.kt @@ -37,8 +37,7 @@ object Plugins { "androidx.benchmark:benchmark-gradle-plugin:${Versions.benchmarkPlugin}" const val kotlinGradlePlugin = "org.jetbrains.kotlin:kotlin-gradle-plugin:${Dependencies.Versions.Kotlin.stdlib}" - const val navSafeArgsGradlePlugin = - "androidx.navigation:navigation-safe-args-gradle-plugin:${Dependencies.Versions.Androidx.navigation}" + const val navSafeArgsGradlePlugin = "androidx.navigation:navigation-safe-args-gradle-plugin:2.6.0" const val rulerGradlePlugin = "com.spotify.ruler:ruler-gradle-plugin:1.2.1" const val flankGradlePlugin = "com.osacky.flank.gradle:fladle:0.17.4" const val kspGradlePlugin = diff --git a/catalog/build.gradle.kts b/catalog/build.gradle.kts index 2e1fe9a966..88cd75bdc8 100644 --- a/catalog/build.gradle.kts +++ b/catalog/build.gradle.kts @@ -46,14 +46,14 @@ dependencies { coreLibraryDesugaring(Dependencies.desugarJdkLibs) - implementation(Dependencies.Androidx.appCompat) - implementation(Dependencies.Androidx.constraintLayout) - implementation(Dependencies.Androidx.coreKtx) - implementation(Dependencies.Androidx.fragmentKtx) implementation(Dependencies.material) implementation(Dependencies.Kotlin.stdlib) - implementation(Dependencies.Navigation.navFragmentKtx) - implementation(Dependencies.Navigation.navUiKtx) + implementation(libs.androidx.appcompat) + implementation(libs.androidx.constraintlayout) + implementation(libs.androidx.core) + implementation(libs.androidx.fragment) + implementation(libs.androidx.navigation.fragment) + implementation(libs.androidx.navigation.ui) implementation(project(path = ":datacapture")) implementation(project(path = ":engine")) diff --git a/contrib/barcode/build.gradle.kts b/contrib/barcode/build.gradle.kts index 69790d9f7e..438e766125 100644 --- a/contrib/barcode/build.gradle.kts +++ b/contrib/barcode/build.gradle.kts @@ -59,14 +59,14 @@ dependencies { androidTestImplementation(Dependencies.truth) implementation(project(":datacapture")) - implementation(Dependencies.Androidx.coreKtx) - implementation(Dependencies.Androidx.fragmentKtx) implementation(Dependencies.Mlkit.barcodeScanning) implementation(Dependencies.Mlkit.objectDetection) implementation(Dependencies.Mlkit.objectDetectionCustom) implementation(Dependencies.material) implementation(Dependencies.timber) - implementation(Dependencies.Androidx.appCompat) + implementation(libs.androidx.appcompat) + implementation(libs.androidx.core) + implementation(libs.androidx.fragment) testImplementation(Dependencies.AndroidxTest.core) testImplementation(Dependencies.AndroidxTest.fragmentTesting) diff --git a/contrib/locationwidget/build.gradle.kts b/contrib/locationwidget/build.gradle.kts index 324638d7d0..ae8fa5cd33 100644 --- a/contrib/locationwidget/build.gradle.kts +++ b/contrib/locationwidget/build.gradle.kts @@ -51,13 +51,13 @@ configurations { all { removeIncompatibleDependencies() } } dependencies { implementation(project(":datacapture")) - implementation(Dependencies.Androidx.coreKtx) - implementation(Dependencies.Androidx.fragmentKtx) implementation(Dependencies.playServicesLocation) implementation(Dependencies.Kotlin.kotlinCoroutinesPlay) implementation(Dependencies.material) implementation(Dependencies.timber) - implementation(Dependencies.Androidx.appCompat) + implementation(libs.androidx.appcompat) + implementation(libs.androidx.core) + implementation(libs.androidx.fragment) testImplementation(Dependencies.AndroidxTest.fragmentTesting) testImplementation(Dependencies.Kotlin.kotlinTestJunit) diff --git a/datacapture/build.gradle.kts b/datacapture/build.gradle.kts index 31bf97ba65..b5dd9edef2 100644 --- a/datacapture/build.gradle.kts +++ b/datacapture/build.gradle.kts @@ -84,11 +84,6 @@ dependencies { coreLibraryDesugaring(Dependencies.desugarJdkLibs) - implementation(Dependencies.Androidx.appCompat) - implementation(Dependencies.Androidx.constraintLayout) - implementation(Dependencies.Androidx.coreKtx) - implementation(Dependencies.Androidx.fragmentKtx) - implementation(libs.glide) implementation(Dependencies.HapiFhir.guavaCaching) implementation(Dependencies.HapiFhir.validation) { exclude(module = "commons-logging") @@ -96,10 +91,15 @@ dependencies { } implementation(Dependencies.Kotlin.kotlinCoroutinesCore) implementation(Dependencies.Kotlin.stdlib) - implementation(Dependencies.Lifecycle.viewModelKtx) implementation(Dependencies.androidFhirCommon) implementation(Dependencies.material) implementation(Dependencies.timber) + implementation(libs.androidx.appcompat) + implementation(libs.androidx.constraintlayout) + implementation(libs.androidx.core) + implementation(libs.androidx.fragment) + implementation(libs.androidx.lifecycle.viewmodel) + implementation(libs.glide) testImplementation(Dependencies.AndroidxTest.core) testImplementation(Dependencies.AndroidxTest.fragmentTesting) diff --git a/demo/build.gradle.kts b/demo/build.gradle.kts index 7cf86019d7..c861d363a9 100644 --- a/demo/build.gradle.kts +++ b/demo/build.gradle.kts @@ -43,23 +43,23 @@ dependencies { coreLibraryDesugaring(Dependencies.desugarJdkLibs) - implementation(Dependencies.Androidx.activity) - implementation(Dependencies.Androidx.appCompat) - implementation(Dependencies.Androidx.constraintLayout) - implementation(Dependencies.Androidx.datastorePref) - implementation(Dependencies.Androidx.fragmentKtx) - implementation(Dependencies.Androidx.recyclerView) - implementation(Dependencies.Androidx.workRuntimeKtx) implementation(Dependencies.Kotlin.kotlinCoroutinesAndroid) implementation(Dependencies.Kotlin.kotlinCoroutinesCore) implementation(Dependencies.Kotlin.stdlib) - implementation(Dependencies.Lifecycle.liveDataKtx) - implementation(Dependencies.Lifecycle.runtime) - implementation(Dependencies.Lifecycle.viewModelKtx) - implementation(Dependencies.Navigation.navFragmentKtx) - implementation(Dependencies.Navigation.navUiKtx) implementation(Dependencies.material) implementation(Dependencies.timber) + implementation(libs.androidx.activity) + implementation(libs.androidx.appcompat) + implementation(libs.androidx.constraintlayout) + implementation(libs.androidx.datastore.preferences) + implementation(libs.androidx.fragment) + implementation(libs.androidx.lifecycle.livedata) + implementation(libs.androidx.lifecycle.runtime) + implementation(libs.androidx.lifecycle.viewmodel) + implementation(libs.androidx.navigation.fragment) + implementation(libs.androidx.navigation.ui) + implementation(libs.androidx.recyclerview) + implementation(libs.androidx.work.runtime) implementation(project(":datacapture")) { exclude(group = Dependencies.androidFhirGroup, module = Dependencies.androidFhirEngineModule) } diff --git a/document/build.gradle.kts b/document/build.gradle.kts index 000bebbfbe..49e5df618f 100644 --- a/document/build.gradle.kts +++ b/document/build.gradle.kts @@ -33,8 +33,6 @@ android { } dependencies { - implementation(Dependencies.Androidx.coreKtx) - implementation(Dependencies.Androidx.appCompat) implementation(Dependencies.material) implementation(Dependencies.androidFhirEngine) implementation(Dependencies.Retrofit.coreRetrofit) @@ -43,6 +41,8 @@ dependencies { implementation(Dependencies.zxing) implementation(Dependencies.nimbus) implementation(Dependencies.timber) + implementation(libs.androidx.appcompat) + implementation(libs.androidx.core) coreLibraryDesugaring(Dependencies.desugarJdkLibs) diff --git a/engine/benchmark/build.gradle.kts b/engine/benchmark/build.gradle.kts index 4ac37e5d05..889040b0ff 100644 --- a/engine/benchmark/build.gradle.kts +++ b/engine/benchmark/build.gradle.kts @@ -44,16 +44,16 @@ android { afterEvaluate { configureFirebaseTestLabForMicroBenchmark() } dependencies { - androidTestImplementation(Dependencies.Androidx.workRuntimeKtx) androidTestImplementation(Dependencies.AndroidxTest.benchmarkJunit) androidTestImplementation(Dependencies.AndroidxTest.extJunit) androidTestImplementation(Dependencies.AndroidxTest.runner) - androidTestImplementation(Dependencies.AndroidxTest.workTestingRuntimeKtx) androidTestImplementation(Dependencies.Kotlin.kotlinCoroutinesAndroid) androidTestImplementation(Dependencies.Retrofit.coreRetrofit) androidTestImplementation(Dependencies.junit) androidTestImplementation(Dependencies.mockWebServer) androidTestImplementation(Dependencies.truth) + androidTestImplementation(libs.androidx.work.runtime) + androidTestImplementation(libs.androidx.work.testing) androidTestImplementation(project(":engine")) // for test json files only diff --git a/engine/build.gradle.kts b/engine/build.gradle.kts index 24b24ada6c..337f524559 100644 --- a/engine/build.gradle.kts +++ b/engine/build.gradle.kts @@ -95,10 +95,10 @@ dependencies { androidTestImplementation(Dependencies.AndroidxTest.core) androidTestImplementation(Dependencies.AndroidxTest.extJunitKtx) androidTestImplementation(Dependencies.AndroidxTest.runner) - androidTestImplementation(Dependencies.AndroidxTest.workTestingRuntimeKtx) - androidTestImplementation(Dependencies.Room.testing) androidTestImplementation(Dependencies.junit) androidTestImplementation(Dependencies.truth) + androidTestImplementation(libs.androidx.room.testing) + androidTestImplementation(libs.androidx.work.testing) api(Dependencies.HapiFhir.structuresR4) { exclude(module = "junit") } @@ -115,18 +115,12 @@ dependencies { coreLibraryDesugaring(Dependencies.desugarJdkLibs) - implementation(Dependencies.Androidx.datastorePref) - implementation(Dependencies.Androidx.sqliteKtx) - implementation(Dependencies.Androidx.workRuntimeKtx) implementation(Dependencies.HapiFhir.validation) { exclude(module = "commons-logging") exclude(module = "httpclient") } implementation(Dependencies.Kotlin.stdlib) - implementation(Dependencies.Lifecycle.liveDataKtx) implementation(Dependencies.Retrofit.coreRetrofit) - implementation(Dependencies.Room.ktx) - implementation(Dependencies.Room.runtime) implementation(Dependencies.androidFhirCommon) implementation(Dependencies.guava) implementation(Dependencies.httpInterceptor) @@ -134,12 +128,17 @@ dependencies { implementation(Dependencies.sqlcipher) implementation(Dependencies.timber) implementation(Dependencies.truth) + implementation(libs.androidx.datastore.preferences) + implementation(libs.androidx.lifecycle.livedata) + implementation(libs.androidx.room.room) + implementation(libs.androidx.room.runtime) + implementation(libs.androidx.sqlite) + implementation(libs.androidx.work.runtime) - ksp(Dependencies.Room.compiler) + ksp(libs.androidx.room.compiler) testImplementation(Dependencies.AndroidxTest.archCore) testImplementation(Dependencies.AndroidxTest.core) - testImplementation(Dependencies.AndroidxTest.workTestingRuntimeKtx) testImplementation(Dependencies.Kotlin.kotlinCoroutinesTest) testImplementation(Dependencies.Kotlin.kotlinTestJunit) testImplementation(Dependencies.junit) @@ -149,6 +148,7 @@ dependencies { testImplementation(Dependencies.mockWebServer) testImplementation(Dependencies.robolectric) testImplementation(Dependencies.truth) + testImplementation(libs.androidx.work.testing) constraints { Dependencies.hapiFhirConstraints().forEach { (libName, constraints) -> diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index ac89294412..c333ac986e 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -1,9 +1,40 @@ # see https://docs.gradle.org/current/userguide/platforms.html [versions] +androidx-acivity = "1.7.2" +androidx-appcompat = "1.6.1" +androidx-constraintlayout = "2.1.4" +androidx-core = "1.10.1" +androidx-datastore-preferences = "1.0.0" +androidx-fragment = "1.6.0" +androidx-lifecycle = "2.6.1" +androidx-navigation = "2.6.0" +androidx-recyclerview = "1.3.0" +androidx-room = "2.5.2" +androidx-sqlite = "2.3.1" +androidx-work = "2.8.1" glide = "4.16.0" [libraries] +androidx-activity = { module = "androidx.activity:activity", version.ref = "androidx-acivity" } +androidx-appcompat = { module = "androidx.appcompat:appcompat", version.ref = "androidx-appcompat" } +androidx-constraintlayout = { module = "androidx.constraintlayout:constraintlayout", version.ref = "androidx-constraintlayout" } +androidx-core = { module = "androidx.core:core-ktx", version.ref = "androidx-core" } +androidx-datastore-preferences = { module = "androidx.datastore:datastore-preferences", version.ref = "androidx-datastore-preferences" } +androidx-fragment = { module = "androidx.fragment:fragment-ktx", version.ref = "androidx-fragment" } +androidx-lifecycle-livedata = { module = "androidx.lifecycle:lifecycle-livedata-ktx", version.ref = "androidx-lifecycle" } +androidx-lifecycle-runtime = { module = "androidx.lifecycle:lifecycle-runtime", version.ref = "androidx-lifecycle" } +androidx-lifecycle-viewmodel = { module = "androidx.lifecycle:lifecycle-viewmodel-ktx", version.ref = "androidx-lifecycle" } +androidx-navigation-fragment = { module = "androidx.navigation:navigation-fragment-ktx", version.ref = "androidx-navigation" } +androidx-navigation-ui = { module = "androidx.navigation:navigation-ui-ktx", version.ref = "androidx-navigation" } +androidx-recyclerview = { module = "androidx.recyclerview:recyclerview", version.ref = "androidx-recyclerview" } +androidx-room-compiler = { module = "androidx.room:room-compiler", version.ref = "androidx-room" } +androidx-room-room = { module = "androidx.room:room-ktx", version.ref = "androidx-room" } +androidx-room-runtime = { module = "androidx.room:room-runtime", version.ref = "androidx-room" } +androidx-room-testing = { module = "androidx.room:room-testing", version.ref = "androidx-room" } +androidx-sqlite = { module = "androidx.sqlite:sqlite-ktx", version.ref = "androidx-sqlite" } +androidx-work-runtime = { module = "androidx.work:work-runtime-ktx", version.ref = "androidx-work" } +androidx-work-testing = { module = "androidx.work:work-testing", version.ref = "androidx-work" } glide = { module = "com.github.bumptech.glide:glide", version.ref = "glide" } [bundles] diff --git a/knowledge/build.gradle.kts b/knowledge/build.gradle.kts index 7cd6cdc356..d2d69ef2be 100644 --- a/knowledge/build.gradle.kts +++ b/knowledge/build.gradle.kts @@ -84,15 +84,15 @@ dependencies { implementation(Dependencies.Kotlin.stdlib) implementation(Dependencies.Kotlin.kotlinCoroutinesCore) - implementation(Dependencies.Lifecycle.liveDataKtx) - implementation(Dependencies.Room.ktx) - implementation(Dependencies.Room.runtime) implementation(Dependencies.timber) implementation(Dependencies.http) implementation(Dependencies.HapiFhir.fhirCoreConvertors) implementation(Dependencies.apacheCommonsCompress) + implementation(libs.androidx.lifecycle.livedata) + implementation(libs.androidx.room.room) + implementation(libs.androidx.room.runtime) - ksp(Dependencies.Room.compiler) + ksp(libs.androidx.room.compiler) testImplementation(Dependencies.AndroidxTest.archCore) testImplementation(Dependencies.AndroidxTest.core) diff --git a/workflow/benchmark/build.gradle.kts b/workflow/benchmark/build.gradle.kts index 258054a8aa..b438decfdb 100644 --- a/workflow/benchmark/build.gradle.kts +++ b/workflow/benchmark/build.gradle.kts @@ -57,8 +57,8 @@ dependencies { androidTestImplementation(Dependencies.junit) androidTestImplementation(Dependencies.Kotlin.kotlinCoroutinesAndroid) androidTestImplementation(Dependencies.truth) - androidTestImplementation(Dependencies.Androidx.workRuntimeKtx) - androidTestImplementation(Dependencies.AndroidxTest.workTestingRuntimeKtx) + androidTestImplementation(libs.androidx.work.runtime) + androidTestImplementation(libs.androidx.work.testing) androidTestImplementation(project(":engine")) androidTestImplementation(project(":knowledge")) { exclude(group = Dependencies.androidFhirGroup, module = Dependencies.androidFhirEngineModule) diff --git a/workflow/build.gradle.kts b/workflow/build.gradle.kts index 8342fd38e0..a16b9418dd 100644 --- a/workflow/build.gradle.kts +++ b/workflow/build.gradle.kts @@ -82,17 +82,16 @@ dependencies { androidTestImplementation(Dependencies.AndroidxTest.extJunit) androidTestImplementation(Dependencies.AndroidxTest.extJunitKtx) androidTestImplementation(Dependencies.AndroidxTest.runner) - androidTestImplementation(Dependencies.AndroidxTest.workTestingRuntimeKtx) androidTestImplementation(Dependencies.jsonAssert) androidTestImplementation(Dependencies.junit) androidTestImplementation(Dependencies.truth) androidTestImplementation(Dependencies.xmlUnit) + androidTestImplementation(libs.androidx.work.testing) androidTestImplementation(project(":workflow-testing")) api(Dependencies.HapiFhir.structuresR4) { exclude(module = "junit") } api(Dependencies.HapiFhir.guavaCaching) - implementation(Dependencies.Androidx.coreKtx) implementation(Dependencies.Cql.evaluator) implementation(Dependencies.Cql.evaluatorFhirJackson) implementation(Dependencies.HapiFhir.guavaCaching) @@ -103,6 +102,7 @@ dependencies { implementation(Dependencies.androidFhirKnowledge) implementation(Dependencies.timber) implementation(Dependencies.xerces) + implementation(libs.androidx.core) testImplementation(Dependencies.AndroidxTest.core) testImplementation(Dependencies.jsonAssert)