From d4c9da3b2befa831827de8e65d0e13e68dc1503f Mon Sep 17 00:00:00 2001 From: Marc Date: Wed, 18 Dec 2024 21:05:44 +0100 Subject: [PATCH] feat: Sort data elements and event fields as single unit [DHIS2-18012] --- .../tracker/export/event/HibernateEventChangeLogStore.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dhis-2/dhis-services/dhis-service-tracker/src/main/java/org/hisp/dhis/tracker/export/event/HibernateEventChangeLogStore.java b/dhis-2/dhis-services/dhis-service-tracker/src/main/java/org/hisp/dhis/tracker/export/event/HibernateEventChangeLogStore.java index af20e21fb6a..8c99d2fed62 100644 --- a/dhis-2/dhis-services/dhis-service-tracker/src/main/java/org/hisp/dhis/tracker/export/event/HibernateEventChangeLogStore.java +++ b/dhis-2/dhis-services/dhis-service-tracker/src/main/java/org/hisp/dhis/tracker/export/event/HibernateEventChangeLogStore.java @@ -57,7 +57,7 @@ public class HibernateEventChangeLogStore { private static final String COLUMN_CHANGELOG_USER = "ecl.createdByUsername"; private static final String COLUMN_CHANGELOG_DATA_ELEMENT = "d.uid"; private static final String COLUMN_CHANGELOG_FIELD = "ecl.eventField"; - private static final String ORDER_DATA_ITEM_EXPRESSION = + private static final String ORDER_CHANGE_EXPRESSION = "CONCAT(COALESCE(d.formname, ''), COALESCE(" + COLUMN_CHANGELOG_FIELD + ", ''))"; private static final String DEFAULT_ORDER = COLUMN_CHANGELOG_CREATED + " " + SortDirection.DESC.getValue(); @@ -71,7 +71,7 @@ public class HibernateEventChangeLogStore { Map.ofEntries( entry("createdAt", COLUMN_CHANGELOG_CREATED), entry("username", COLUMN_CHANGELOG_USER), - entry("change", ORDER_DATA_ITEM_EXPRESSION)); + entry("change", ORDER_CHANGE_EXPRESSION)); private static final Map>, String> FILTERABLE_FIELDS = Map.ofEntries(