Skip to content

Commit 8ed0e2f

Browse files
authored
Merge pull request #13535 from SORMAS-Foundation/bugfix-aefi_events_sorting
Added missing columns in AEFI and Events sorting
2 parents 4ef309a + c8875c2 commit 8ed0e2f

2 files changed

Lines changed: 15 additions & 2 deletions

File tree

sormas-backend/src/main/java/de/symeda/sormas/backend/adverseeventsfollowingimmunization/AefiInvestigationService.java

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,8 @@ public class AefiInvestigationService extends AbstractCoreAdoService<AefiInvesti
8888
@EJB
8989
private FeatureConfigurationFacadeEjb.FeatureConfigurationFacadeEjbLocal featureConfigurationFacade;
9090

91+
private static final String PRIMARY_VACCINE_COLUMN = "primaryVaccineColumn";
92+
9193
public AefiInvestigationService() {
9294
super(AefiInvestigation.class, DeletableEntityType.ADVERSE_EVENTS_FOLLOWING_IMMUNIZATION);
9395
}
@@ -264,12 +266,18 @@ private List<Selection<?>> sortBy(List<SortProperty> sortProperties, AefiInvesti
264266
Expression<?> expression;
265267
switch (sortProperty.propertyName) {
266268
case AefiInvestigationIndexDto.UUID:
267-
case AefiInvestigationIndexDto.DISEASE:
269+
case AefiInvestigationIndexDto.INVESTIGATION_CASE_ID:
268270
case AefiInvestigationIndexDto.INVESTIGATION_DATE:
271+
case AefiInvestigationIndexDto.INVESTIGATION_STATUS:
272+
case AefiInvestigationIndexDto.INVESTIGATION_STAGE:
269273
case AefiInvestigationIndexDto.STATUS_ON_DATE_OF_INVESTIGATION:
270274
case AefiInvestigationIndexDto.AEFI_CLASSIFICATION:
275+
case AefiInvestigationIndexDto.REPORT_DATE:
271276
expression = queryContext.getRoot().get(sortProperty.propertyName);
272277
break;
278+
case AefiInvestigationIndexDto.DISEASE:
279+
expression = queryContext.getJoins().getAefiJoins().getImmunizationJoins().getRoot().get(Immunization.DISEASE);
280+
break;
273281
case AefiInvestigationIndexDto.AEFI_REPORT_UUID:
274282
expression = queryContext.getJoins().getAefi().get(Aefi.UUID);
275283
break;
@@ -285,6 +293,9 @@ private List<Selection<?>> sortBy(List<SortProperty> sortProperties, AefiInvesti
285293
case AefiInvestigationIndexDto.SEX:
286294
expression = queryContext.getJoins().getAefiJoins().getImmunizationJoins().getPerson().get(Person.SEX);
287295
break;
296+
case PRIMARY_VACCINE_COLUMN:
297+
expression = queryContext.getJoins().getAefiJoins().getPrimarySuspectVaccination().get(Vaccination.VACCINE_NAME);
298+
break;
288299
case AefiInvestigationIndexDto.REGION:
289300
expression = cb.lower(
290301
queryContext.getJoins()

sormas-backend/src/main/java/de/symeda/sormas/backend/event/EventFacadeEjb.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -764,14 +764,16 @@ private List<Selection<?>> sortBy(List<SortProperty> sortProperties, EventQueryC
764764
case EventIndexDto.EVENT_INVESTIGATION_STATUS:
765765
case EventIndexDto.EVENT_MANAGEMENT_STATUS:
766766
case EventIndexDto.DISEASE:
767-
case EventIndexDto.DISEASE_VARIANT:
768767
case EventIndexDto.START_DATE:
769768
case EventIndexDto.EVOLUTION_DATE:
770769
case EventIndexDto.SRC_TYPE:
771770
case EventIndexDto.REPORT_DATE_TIME:
772771
case EventIndexDto.EVENT_IDENTIFICATION_SOURCE:
773772
orderList = orderBuilder.build(eventQueryContext.getRoot().get(sortProperty.propertyName));
774773
break;
774+
case EventIndexDto.DISEASE_VARIANT:
775+
orderList = orderBuilder.build(eventQueryContext.getRoot().get(Event.DISEASE_VARIANT_VALUE));
776+
break;
775777
case EventIndexDto.EXTERNAL_ID:
776778
case EventIndexDto.EXTERNAL_TOKEN:
777779
case EventIndexDto.INTERNAL_TOKEN:

0 commit comments

Comments
 (0)