File tree 2 files changed +16
-6
lines changed
engine/src/main/java/org/smartregister/fhircore/engine/data/local/register/dao
2 files changed +16
-6
lines changed Original file line number Diff line number Diff line change @@ -312,8 +312,18 @@ constructor(
312
312
}
313
313
}
314
314
315
- internal suspend fun Patient.activeCarePlans () =
316
- patientCarePlan(this .logicalId).filter { it.status == CarePlan .CarePlanStatus .ACTIVE }
315
+ internal suspend fun Patient.activeCarePlans (): List <CarePlan > {
316
+ patientCarePlan(this .logicalId)
317
+ .filter { it.status == CarePlan .CarePlanStatus .ACTIVE }
318
+ .apply {
319
+ val sortByLastUpdated = sortedBy { it.meta.lastUpdated }
320
+ return if (size > 1 || size == 1 ) {
321
+ listOf (sortByLastUpdated.first())
322
+ } else {
323
+ listOf ()
324
+ }
325
+ }
326
+ }
317
327
318
328
internal suspend fun patientCarePlan (patientId : String ) =
319
329
defaultRepository.searchResourceFor<CarePlan >(
Original file line number Diff line number Diff line change @@ -145,8 +145,8 @@ android {
145
145
dimension = " apps"
146
146
applicationIdSuffix = " .mwcore"
147
147
versionNameSuffix = " -mwcore"
148
- versionCode = 35
149
- versionName = " 0.1.24 "
148
+ versionCode = 36
149
+ versionName = " 0.1.25 "
150
150
}
151
151
create(" mwcoreDev" ) {
152
152
dimension = " apps"
@@ -159,8 +159,8 @@ android {
159
159
dimension = " apps"
160
160
applicationIdSuffix = " .mwcoreProd"
161
161
versionNameSuffix = " -mwcoreProd"
162
- versionCode = 12
163
- versionName = " 0.1.2 "
162
+ versionCode = 14
163
+ versionName = " 0.1.3 "
164
164
}
165
165
create(" afyayangu" ) {
166
166
dimension = " apps"
You can’t perform that action at this time.
0 commit comments