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

[Quest/Malawi Core] Bug Fix: Unable to open save Guardian Registration Questionnaires when the patient is on ART due to FHIR Engine Library update #84

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 1 addition & 1 deletion android/engine/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,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-preview8.1-SNAPSHOT") {
api("org.smartregister:data-capture:1.1.0-preview11-SNAPSHOT") {
isTransitive = true
exclude(group = "ca.uhn.hapi.fhir")
exclude(group = "com.google.android.fhir", module = "engine")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
package org.smartregister.fhircore.engine.util.helper

import com.google.android.fhir.FhirEngine
import com.google.android.fhir.get
import com.google.android.fhir.search.search
import javax.inject.Inject
import javax.inject.Singleton
Expand Down Expand Up @@ -101,6 +102,21 @@ constructor(val simpleWorkerContext: SimpleWorkerContext, val fhirEngine: FhirEn

@Throws(FHIRException::class)
override fun performSearch(appContext: Any, url: String): List<Base> {
return runBlocking { fhirEngine.search(url).map { it.resource } }
return runBlocking {
try {
if (url.startsWith("Patient")) {
val id = url.split("_id=").lastOrNull()

if (id != null) {
return@runBlocking listOf(fhirEngine.get<Patient>(id))
}
}
val results = fhirEngine.search(url)
results.map { it.resource }
} catch (e: Exception) {
Timber.e(e)
return@runBlocking listOf()
}
}
}
}
9 changes: 7 additions & 2 deletions android/quest/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -134,8 +134,8 @@ android {
dimension = "apps"
applicationIdSuffix = ".mwcore"
versionNameSuffix = "-mwcore"
versionCode = 7
versionName = "0.0.6.1"
versionCode = 9
versionName = "0.0.6.3"
}
create("mwcoreDev") {
dimension = "apps"
Expand Down Expand Up @@ -198,6 +198,11 @@ dependencies {
testImplementation("com.google.dagger:hilt-android-testing:${Deps.versions.hiltVersion}")
kaptTest("com.google.dagger:hilt-android-compiler:${Deps.versions.hiltVersion}")

// Room
implementation("androidx.room:room-runtime:2.6.1")
kapt("androidx.room:room-compiler:2.6.1")
implementation("androidx.room:room-ktx:2.6.1")

androidTestImplementation(Deps.atsl.ext_junit)
androidTestImplementation(Deps.atsl.espresso)
debugImplementation("androidx.compose.ui:ui-test-manifest")
Expand Down
Loading