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

Pre production fixes and clean up #66

Merged
merged 55 commits into from
Jun 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
55 commits
Select commit Hold shift + click to select a range
ec39eb6
Refactor getting config sync params
LZRS May 20, 2024
b09ed02
Load registers page count only after population
LZRS May 23, 2024
619a7df
Merge remote-tracking branch 'd-tree-org/update-app-for-new-resources…
LZRS May 23, 2024
7366df6
Lazy load pages/counts in register
LZRS May 24, 2024
4ea8d05
Merge remote-tracking branch 'd-tree-org/update-app-for-new-resources…
LZRS May 24, 2024
ca5aee4
Implement caching for Questionnaires & StructureMaps
ndegwamartin May 26, 2024
f21f1d2
Merge pull request #61 from d-tree-org/cache-content-resources
LZRS May 27, 2024
a44025a
Merge remote-tracking branch 'd-tree-org/refector-config-services' in…
LZRS May 27, 2024
06f050d
Update Questionnaire/StructureMap cache keys
LZRS May 27, 2024
0245f6e
Use lazy pagination in register search
LZRS May 27, 2024
27492d8
Prepend 'showing' to paginated search results header
LZRS May 28, 2024
14d1f50
Update dependencies
LZRS May 30, 2024
eb05490
Refactor patient register viewmodel
LZRS May 30, 2024
4c0d079
Refactor loading of patient pregnancy status through revInclude
LZRS May 30, 2024
ecbb3b9
Replace Worker#doWork to run from single dedicated thread
LZRS May 31, 2024
459717f
Add SyncJobStatus.Failed event when sync worker fails
LZRS Jun 3, 2024
d112a26
Paginate FhirEngine#search operations in Workers
LZRS Jun 3, 2024
f6e8ed9
Merge remote-tracking branch 'd-tree-org/refector-config-services' in…
LZRS Jun 3, 2024
8eb6a4d
Refactor resoucePurger purging CarePlans
LZRS Jun 3, 2024
93a509d
Update to latest engine to test SingleResourcePost uploadstrategy
LZRS Jun 4, 2024
1f1feda
Paginate register without getting total counts
LZRS Jun 5, 2024
6cdf69d
Fix compose crash 'CompositionLocal LocalLifecycleOwner not present E…
LZRS Jun 6, 2024
ae72def
Move side menu counts to a 'Counters' screen
LZRS Jun 6, 2024
4b71ca8
Show refresh loader whenever counts are loading
LZRS Jun 6, 2024
c8f1a0a
Fix pagination for tracing/appointment registers
LZRS Jun 7, 2024
d024d61
Fix patient register search displaying wrong results
LZRS Jun 7, 2024
11408a4
Merge remote-tracking branch 'd-tree-org/refector-config-services' in…
LZRS Jun 7, 2024
52b45fb
Alternate uploadStrategy depending on number of sync attempts
LZRS Jun 8, 2024
6267b53
Fix errors in FhirResourceUtil and Resourcepurger for large data
LZRS Jun 9, 2024
77cd853
fetch configs by _id
sevenreup Jun 10, 2024
083a67c
Use navigateUp instead of popBackStack
sevenreup Jun 10, 2024
53779d0
use contract when launching tracing outcomes
sevenreup Jun 10, 2024
e9f19d6
Update registerViewModels to use IO dispatchers context
LZRS Jun 10, 2024
f19c0d2
Merge branch 'perf-improvements' into pre-production-changes
sevenreup Jun 10, 2024
684d9d6
Add priority to identifier
sevenreup Jun 10, 2024
3434708
Update SystemConstants.kt
sevenreup Jun 11, 2024
14bd111
skip saving if bundle entry null
sevenreup Jun 11, 2024
78b9ade
fix patient type
sevenreup Jun 11, 2024
e1673f5
update configs
sevenreup Jun 12, 2024
505739b
Clean up audit event
sevenreup Jun 12, 2024
c00d1d1
create location picker
sevenreup Jun 12, 2024
9e0c0ee
filter only art
sevenreup Jun 12, 2024
1ab21e4
Revert alternating uploadStrategy due errors in ID assignment
LZRS Jun 12, 2024
92ead08
Bump versions
sevenreup Jun 12, 2024
7fc007e
Merge branch 'perf-improvements' into pre-production-changes
sevenreup Jun 13, 2024
80acc54
Bump update
sevenreup Jun 13, 2024
69a5b18
Update CustomQuestItemDataProvider.kt
sevenreup Jun 13, 2024
7624bad
Update error reporting format
sevenreup Jun 13, 2024
f297c57
Fetch task states from from Task Resource (#68)
sevenreup Jun 17, 2024
d1b91f5
Update build.gradle.kts
sevenreup Jun 17, 2024
63f9673
only set duplicate tasks as Entered in error
sevenreup Jun 17, 2024
fc58cb8
update location picker
sevenreup Jun 18, 2024
faa054c
bump version
sevenreup Jun 18, 2024
baf6dc8
Update phone number fetching logic
sevenreup Jun 18, 2024
fbc5f68
Update PatientExtension.kt
sevenreup Jun 18, 2024
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
4 changes: 2 additions & 2 deletions android/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,15 @@ import org.gradle.api.tasks.testing.logging.TestLogEvent

buildscript {
dependencies {
classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:1.9.22")
classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:1.9.24")
classpath(Deps.kotlin_coveralls_plugin)
classpath("com.android.tools.build:gradle:8.2.2")
classpath(Deps.dokka_plugin)
}
}

plugins {
id("org.jetbrains.kotlin.jvm") version "1.9.22"
id("org.jetbrains.kotlin.jvm") version "1.9.24"
id("com.github.kt3k.coveralls") version "2.12.2"
id("org.jetbrains.kotlin.plugin.serialization") version "1.8.10"
id("com.google.dagger.hilt.android") version Deps.versions.hiltVersion apply false
Expand Down
4 changes: 2 additions & 2 deletions android/buildSrc/src/main/kotlin/Deps.kt
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ object Deps {
const val atsl_runner = "1.5.2"
const val caffeine = "2.9.0"
const val constraint_layout = "1.1.3"
const val coroutines = "1.7.3"
const val coroutines = "1.8.1"
const val core = "1.7.0"
const val cql_engine = "1.3.14-SNAPSHOT"
const val desugar = "2.0.4"
Expand All @@ -32,7 +32,7 @@ object Deps {
const val guava = "28.2-android"
const val hapi_r4 = "5.3.0"
const val junit5_api = "5.9.3"
const val kotlin = "1.8.22"
const val kotlin = "1.9.24"
const val lifecycle = "2.2.0"
const val material = "1.5.0"
const val okhttp_logging_interceptor = "4.0.0"
Expand Down
20 changes: 10 additions & 10 deletions android/dataclerk/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ android {
buildConfig = true
}

composeOptions { kotlinCompilerExtensionVersion = "1.5.9" }
composeOptions { kotlinCompilerExtensionVersion = "1.5.14" }

testOptions {
execution = "ANDROIDX_TEST_ORCHESTRATOR"
Expand All @@ -139,15 +139,15 @@ android {
dimension = "apps"
applicationIdSuffix = ".exposedInfant"
versionNameSuffix = "-exposedInfant"
versionCode = 1
versionName = "0.0.1"
versionCode = 3
versionName = "0.0.3"
}
create("artClient") {
dimension = "apps"
applicationIdSuffix = ".artClient"
versionNameSuffix = "-artClient"
versionCode = 1
versionName = "0.0.1"
versionCode = 3
versionName = "0.0.3"
}
create("exposedInfantDev") {
dimension = "apps"
Expand Down Expand Up @@ -190,19 +190,19 @@ dependencies {
coreLibraryDesugaring(Deps.desugar)
implementation(project(":engine"))

implementation("androidx.core:core-ktx:1.12.0")
implementation("androidx.core:core-ktx:1.13.1")
implementation(platform("org.jetbrains.kotlin:kotlin-bom:1.9.20"))
implementation("androidx.lifecycle:lifecycle-runtime-ktx:2.7.0")
implementation("androidx.activity:activity-compose:1.8.2")
implementation("androidx.lifecycle:lifecycle-runtime-ktx:2.8.1")
implementation("androidx.activity:activity-compose:1.9.0")

implementation(Deps.accompanist.swiperefresh)

implementation(platform("androidx.compose:compose-bom:2024.02.01"))
implementation(platform("androidx.compose:compose-bom:2024.05.00"))
implementation("androidx.compose.ui:ui")
implementation("androidx.compose.ui:ui-graphics")
implementation("androidx.compose.ui:ui-tooling-preview")
implementation("androidx.compose.material3:material3")
implementation("androidx.paging:paging-compose:3.2.1")
implementation("androidx.paging:paging-compose:3.3.0")

implementation("com.github.anrwatchdog:anrwatchdog:1.4.0")

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.padding
import androidx.compose.material.ExperimentalMaterialApi
import androidx.compose.material.icons.Icons
import androidx.compose.material.icons.filled.BugReport
import androidx.compose.material.icons.filled.Refresh
import androidx.compose.material.icons.filled.Search
import androidx.compose.material.icons.filled.Settings
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ package org.dtree.fhircore.dataclerk.ui.main
import ca.uhn.fhir.rest.gclient.DateClientParam
import ca.uhn.fhir.rest.gclient.TokenClientParam
import com.google.android.fhir.FhirEngine
import com.google.android.fhir.datacapture.extensions.logicalId
import com.google.android.fhir.get
import com.google.android.fhir.logicalId
import com.google.android.fhir.search.Operation
import com.google.android.fhir.search.Order
import com.google.android.fhir.search.Search
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ fun PatientScreen(
topBar = {
TopAppBar(
navigationIcon = {
IconButton(onClick = { navController.popBackStack() }) {
IconButton(onClick = { navController.navigateUp() }) {
Icon(Icons.Filled.ArrowBack, contentDescription = "")
}
},
Expand Down
28 changes: 15 additions & 13 deletions android/engine/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ android {
dataBinding = true
buildConfig = true
}
composeOptions { kotlinCompilerExtensionVersion = "1.5.9" }
composeOptions { kotlinCompilerExtensionVersion = "1.5.14" }

packaging {
resources {
Expand Down Expand Up @@ -96,22 +96,22 @@ dependencies {
implementation("androidx.preference:preference-ktx:1.2.1")
coreLibraryDesugaring(Deps.desugar)

api("androidx.core:core-ktx:1.12.0")
api("androidx.appcompat:appcompat:1.6.1")
api("com.google.android.material:material:1.11.0")
api("androidx.core:core-ktx:1.13.1")
api("androidx.appcompat:appcompat:1.7.0")
api("com.google.android.material:material:1.12.0")
implementation("androidx.constraintlayout:constraintlayout:2.1.4")
implementation("androidx.constraintlayout:constraintlayout-compose:1.0.1")
implementation("androidx.fragment:fragment-ktx:1.6.2")
implementation("androidx.fragment:fragment-ktx:1.7.1")
api("io.jsonwebtoken:jjwt:0.9.1")
implementation("androidx.security:security-crypto:1.1.0-alpha06")
api("org.smartregister:fhir-common-utils:0.0.8-SNAPSHOT") {
exclude(group = "org.slf4j", module = "jcl-over-slf4j")
}
implementation("com.squareup.okhttp3:logging-interceptor:4.11.0")
implementation("com.squareup.okhttp3:logging-interceptor:4.12.0")
implementation("com.squareup.okhttp3:okhttp:4.12.0")
implementation("androidx.cardview:cardview:1.0.0")
implementation("joda-time:joda-time:2.10.14")
implementation("androidx.paging:paging-runtime-ktx:3.2.1")
implementation("androidx.paging:paging-runtime-ktx:3.3.0")
implementation("com.github.bumptech.glide:glide:4.16.0")
implementation("id.zelory:compressor:3.0.1")

Expand Down Expand Up @@ -151,13 +151,13 @@ dependencies {
api("androidx.lifecycle:lifecycle-viewmodel-ktx:2.7.0")

// Jetpack - DataStore
implementation("androidx.datastore:datastore-preferences:1.0.0")
implementation("androidx.datastore:datastore-preferences:1.1.1")

// P2P dependency
api("org.smartregister:p2p-lib:0.3.0-SNAPSHOT")

// Configure Jetpack Compose
api(platform("androidx.compose:compose-bom:2024.02.02"))
api(platform("androidx.compose:compose-bom:2024.05.00"))
api("androidx.compose.ui:ui")
api("androidx.compose.ui:ui-tooling")
api("androidx.compose.foundation:foundation")
Expand All @@ -169,13 +169,13 @@ dependencies {
api("androidx.navigation:navigation-compose:2.7.7")
api("androidx.hilt:hilt-navigation-compose:1.2.0")
api("androidx.lifecycle:lifecycle-viewmodel-compose:2.7.0")
api("androidx.paging:paging-compose:3.2.1")
api("androidx.activity:activity-compose:1.8.2")
api("androidx.paging:paging-compose:3.3.0")
api("androidx.activity:activity-compose:1.9.0")
api("org.jetbrains.kotlinx:kotlinx-serialization-json:1.6.0")
api("androidx.work:work-runtime-ktx:2.9.0")
testApi("androidx.work:work-testing:2.9.0")

val coroutineVersion = "1.7.3"
val coroutineVersion = "1.8.1"
api("org.jetbrains.kotlinx:kotlinx-coroutines-core:$coroutineVersion")
api("org.jetbrains.kotlinx:kotlinx-coroutines-android:$coroutineVersion")
api("org.smartregister:contrib-barcode:0.1.0-beta3-preview7-SNAPSHOT") {
Expand All @@ -195,7 +195,9 @@ dependencies {

api("org.smartregister:common:0.1.0-alpha05-preview3-SNAPSHOT") { isTransitive = true }

api("org.smartregister:engine:1.0.0-preview7.1-SNAPSHOT") {
// api("org.smartregister:engine:1.0.0-preview7.1-SNAPSHOT") {
api("org.smartregister:engine:1.0.0-preview8-PERF-TEST-SNAPSHOT") {
// api("org.smartregister:engine:1.0.0-preview7.1-PERF-TEST5-SNAPSHOT") {
isTransitive = true
exclude(group = "com.google.android.fhir", module = "common")
exclude(group = "com.github.ben-manes.caffeine")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ constructor(
val dispatcherProvider: DispatcherProvider,
) : CoroutineWorker(appContext, workerParameters) {
override suspend fun doWork(): Result {
return withContext(dispatcherProvider.io()) {
return withContext(dispatcherProvider.singleThread()) {
fhirResourceUtil.handleMissedAppointment()
Result.success()
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ constructor(
val dispatcherProvider: DispatcherProvider,
) : CoroutineWorker(appContext, workerParameters) {
override suspend fun doWork(): Result {
return withContext(dispatcherProvider.io()) {
return withContext(dispatcherProvider.singleThread()) {
fhirResourceUtil.handleWelcomeServiceAppointmentWorker()
Result.success()
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,26 +23,28 @@ import javax.inject.Singleton
import org.hl7.fhir.r4.model.AuditEvent
import org.hl7.fhir.r4.model.Coding
import org.hl7.fhir.r4.model.Practitioner
import org.hl7.fhir.r4.model.ResourceType
import org.smartregister.fhircore.engine.R
import org.smartregister.fhircore.engine.data.local.DefaultRepository
import org.smartregister.fhircore.engine.util.SharedPreferenceKey
import org.smartregister.fhircore.engine.util.SharedPreferencesHelper
import org.smartregister.fhircore.engine.util.extension.asReference
import org.smartregister.fhircore.engine.util.extension.extractLogicalIdUuid

@Singleton
class AuditEventRepository
@Inject
constructor(
val defaultRepository: DefaultRepository,
val sharedPreferences: SharedPreferencesHelper,
private val sharedPreferences: SharedPreferencesHelper,
) : IAuditEventRepository {
override suspend fun createAuditEvent() {
// Get Practitioner Resource
val practitionerID =
sharedPreferences.read(key = SharedPreferenceKey.PRACTITIONER_ID.name, defaultValue = null)
sharedPreferences.read(SharedPreferenceKey.PRACTITIONER_ID.name, null)?.extractLogicalIdUuid()
?: return

val practitioner = defaultRepository.loadResource<Practitioner>(practitionerID!!)
val practitioner = practitionerID.asReference(ResourceType.Practitioner)

val context = sharedPreferences.context

Expand Down Expand Up @@ -70,12 +72,11 @@ constructor(
agent =
listOf(
AuditEvent.AuditEventAgentComponent().apply {
who = practitioner?.asReference()
who = practitioner
requestor = true
},
)
source =
AuditEvent.AuditEventSourceComponent().apply { observer = practitioner?.asReference() }
source = AuditEvent.AuditEventSourceComponent().apply { observer = practitioner }
}

// Save AuditEvent Resource
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ import androidx.work.CoroutineWorker
import androidx.work.WorkerParameters
import dagger.assisted.Assisted
import dagger.assisted.AssistedInject
import kotlinx.coroutines.withContext
import org.smartregister.fhircore.engine.util.DispatcherProvider
import timber.log.Timber

@HiltWorker
Expand All @@ -31,12 +33,15 @@ constructor(
@Assisted val appContext: Context,
@Assisted workerParameters: WorkerParameters,
private val auditEventRepository: AuditEventRepository,
val dispatcherProvider: DispatcherProvider,
) : CoroutineWorker(appContext, workerParameters) {

override suspend fun doWork(): Result {
Timber.e("AuditEventWorker is running")
auditEventRepository.createAuditEvent()
return Result.success()
return withContext(dispatcherProvider.singleThread()) {
Timber.e("AuditEventWorker is running")
auditEventRepository.createAuditEvent()
Result.success()
}
}

companion object {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
/*
* Copyright 2021 Ona Systems, Inc
*
* 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 org.smartregister.fhircore.engine.data.domain

data class PhoneContact(val number: String, val owner: String)
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,11 @@ package org.smartregister.fhircore.engine.data.local
import ca.uhn.fhir.rest.gclient.ReferenceClientParam
import ca.uhn.fhir.rest.gclient.TokenClientParam
import com.google.android.fhir.FhirEngine
import com.google.android.fhir.datacapture.extensions.logicalId
import com.google.android.fhir.db.ResourceNotFoundException
import com.google.android.fhir.delete
import com.google.android.fhir.get
import com.google.android.fhir.getLocalizedText
import com.google.android.fhir.logicalId
import com.google.android.fhir.search.search
import javax.inject.Inject
import javax.inject.Singleton
Expand Down
Loading