From be6354ff13580a30984aa2a0e2c84f6066df1ce3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=E2=89=A1ZRS?= <12814349+LZRS@users.noreply.github.com> Date: Fri, 4 Oct 2024 04:15:00 +0300 Subject: [PATCH] Downgrade data-capture to include suspend fhirpath PR --- android/engine/build.gradle.kts | 4 +- .../questionnaire/QuestionnaireViewModel.kt | 59 ------------------- android/quest/build.gradle.kts | 3 + android/quest/src/main/AndroidManifest.xml | 2 - 4 files changed, 4 insertions(+), 64 deletions(-) diff --git a/android/engine/build.gradle.kts b/android/engine/build.gradle.kts index c8e3a812d4..5384fd8da9 100644 --- a/android/engine/build.gradle.kts +++ b/android/engine/build.gradle.kts @@ -112,8 +112,6 @@ dependencies { implementation("androidx.cardview:cardview:1.0.0") implementation("joda-time:joda-time:2.10.14") implementation("androidx.paging:paging-runtime-ktx:3.3.0") - api("com.github.bumptech.glide:glide:4.16.0") - kapt("com.github.bumptech.glide:compiler:4.16.0") implementation("id.zelory:compressor:3.0.1") implementation(group = "javax.xml.stream", name = "stax-api", version = "1.0-2") @@ -186,7 +184,7 @@ dependencies { exclude(group = "com.google.android.fhir", module = "common") exclude(group = "com.google.android.fhir", module = "engine") } - api("org.smartregister:data-capture:1.1.0-preview14-rc2-SNAPSHOT") { + api("org.smartregister:data-capture:1.1.0-preview11-MWCore2-SNAPSHOT") { isTransitive = true exclude(group = "ca.uhn.hapi.fhir") exclude(group = "com.google.android.fhir", module = "engine") diff --git a/android/engine/src/main/java/org/smartregister/fhircore/engine/ui/questionnaire/QuestionnaireViewModel.kt b/android/engine/src/main/java/org/smartregister/fhircore/engine/ui/questionnaire/QuestionnaireViewModel.kt index 4044429bc9..08aa69467b 100644 --- a/android/engine/src/main/java/org/smartregister/fhircore/engine/ui/questionnaire/QuestionnaireViewModel.kt +++ b/android/engine/src/main/java/org/smartregister/fhircore/engine/ui/questionnaire/QuestionnaireViewModel.kt @@ -84,7 +84,6 @@ import org.smartregister.fhircore.engine.util.extension.assertSubject import org.smartregister.fhircore.engine.util.extension.deleteRelatedResources import org.smartregister.fhircore.engine.util.extension.extractId import org.smartregister.fhircore.engine.util.extension.extractLogicalIdUuid -import org.smartregister.fhircore.engine.util.extension.filterByResourceTypeId import org.smartregister.fhircore.engine.util.extension.find import org.smartregister.fhircore.engine.util.extension.isExtractionCandidate import org.smartregister.fhircore.engine.util.extension.isIn @@ -583,23 +582,6 @@ constructor( } } - private suspend fun getLastActiveCarePlan(patientId: String): CarePlan? { - val carePlans = - withContext(dispatcherProvider.io()) { - fhirEngine - .search { - filterByResourceTypeId(CarePlan.SUBJECT, ResourceType.Patient, patientId) - filter( - CarePlan.STATUS, - { value = of(CarePlan.CarePlanStatus.COMPLETED.toCoding()) }, - operation = Operation.OR, - ) - } - .map { it.resource } - } - return carePlans.sortedByDescending { it.meta.lastUpdated }.firstOrNull() - } - private suspend fun getActiveListResource(patient: String): ListResource? { val list = withContext(dispatcherProvider.io()) { @@ -637,47 +619,6 @@ constructor( } } - suspend fun loadTracing(patientId: String): List { - val tasks = - withContext(dispatcherProvider.io()) { - fhirEngine - .search { - filter(Task.SUBJECT, { value = "Patient/$patientId" }) - filter( - TokenClientParam("code"), - { - value = - of( - CodeableConcept() - .addCoding( - Coding( - "http://snomed.info/sct", - "225368008", - null, - ), - ), - ) - }, - ) - filter( - Task.STATUS, - { value = of(Task.TaskStatus.READY.toCode()) }, - { value = of(Task.TaskStatus.INPROGRESS.toCode()) }, - operation = Operation.OR, - ) - filter( - Task.PERIOD, - { - value = of(DateTimeType.now()) - prefix = ParamPrefixEnum.GREATERTHAN - }, - ) - } - .map { it.resource } - } - return tasks.filter { it.status in arrayOf(TaskStatus.READY, TaskStatus.INPROGRESS) } - } - fun saveResource(resource: Resource) { viewModelScope.launch { defaultRepository.save(resource = resource) } } diff --git a/android/quest/build.gradle.kts b/android/quest/build.gradle.kts index 78c38dd0f9..0d18ad5fc8 100644 --- a/android/quest/build.gradle.kts +++ b/android/quest/build.gradle.kts @@ -208,6 +208,9 @@ dependencies { kapt("androidx.room:room-compiler:2.6.1") implementation("androidx.room:room-ktx:2.6.1") + implementation("com.github.bumptech.glide:glide:4.16.0") + kapt("com.github.bumptech.glide:compiler:4.16.0") + androidTestImplementation(Deps.atsl.ext_junit) androidTestImplementation(Deps.atsl.espresso) debugImplementation("androidx.compose.ui:ui-test-manifest") diff --git a/android/quest/src/main/AndroidManifest.xml b/android/quest/src/main/AndroidManifest.xml index 63cb197191..9031fed68c 100644 --- a/android/quest/src/main/AndroidManifest.xml +++ b/android/quest/src/main/AndroidManifest.xml @@ -8,10 +8,8 @@ android:hardwareAccelerated="true" android:icon="@drawable/ic_launcher" android:label="@string/app_name" - android:largeHeap="true" android:networkSecurityConfig="@xml/network_security_config" android:supportsRtl="true" - android:theme="@style/AppTheme.NoActionBar" tools:ignore="UnusedAttribute">