Skip to content

Commit 60b4f1f

Browse files
authored
Change the sort when fetching careplans from -_lastupdated to -date (#88)
* Change the sort when fetching careplans from -_lastupdated to -date * Update HivRegisterDao.kt * changed the sort to use period.start instead of lastUpdated * Update PatientExtension.kt * Update PatientExtension.kt * Update PatientExtension.kt
1 parent cdb49b2 commit 60b4f1f

File tree

1 file changed

+1
-1
lines changed
  • android/engine/src/main/java/org/smartregister/fhircore/engine/util/extension

1 file changed

+1
-1
lines changed

android/engine/src/main/java/org/smartregister/fhircore/engine/util/extension/PatientExtension.kt

+1-1
Original file line numberDiff line numberDiff line change
@@ -392,7 +392,7 @@ suspend fun Patient.activeCarePlans(fhirEngine: FhirEngine): List<CarePlan> {
392392
.asSequence()
393393
.map { it.resource }
394394
.filter { it.status == CarePlan.CarePlanStatus.ACTIVE }
395-
.sortedBy { it.meta.lastUpdated }
395+
.sortedByDescending { it.period.start }
396396
.toList()
397397
}
398398

0 commit comments

Comments
 (0)