Skip to content

Commit ddc0eec

Browse files
Merge pull request #13530 from SORMAS-Foundation/13528-aefi-sorting-issue
Fixed: Adverse events sorting issue
2 parents 53e07f3 + b5230c5 commit ddc0eec

1 file changed

Lines changed: 11 additions & 2 deletions

File tree

  • sormas-backend/src/main/java/de/symeda/sormas/backend/adverseeventsfollowingimmunization

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

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,8 @@ public class AefiService extends AbstractCoreAdoService<Aefi, AefiJoins> {
9898
@EJB
9999
private FeatureConfigurationFacadeEjb.FeatureConfigurationFacadeEjbLocal featureConfigurationFacade;
100100

101+
private static final String PRIMARY_VACCINE_COLUMN = "primaryVaccineColumn";
102+
101103
public AefiService() {
102104
super(Aefi.class, DeletableEntityType.ADVERSE_EVENTS_FOLLOWING_IMMUNIZATION);
103105
}
@@ -416,10 +418,17 @@ private List<Selection<?>> sortBy(List<SortProperty> sortProperties, AefiQueryCo
416418
Expression<?> expression;
417419
switch (sortProperty.propertyName) {
418420
case AefiIndexDto.UUID:
419-
case AefiIndexDto.DISEASE:
421+
case AefiIndexDto.REPORT_DATE:
422+
case AefiIndexDto.ADVERSE_EVENTS:
420423
case AefiIndexDto.START_DATE_TIME:
421424
expression = aefiQueryContext.getRoot().get(sortProperty.propertyName);
422425
break;
426+
case AefiIndexDto.IMMUNIZATION_UUID:
427+
expression = aefiQueryContext.getJoins().getImmunization().get(Immunization.UUID);
428+
break;
429+
case AefiIndexDto.DISEASE:
430+
expression = aefiQueryContext.getJoins().getImmunization().get(Immunization.DISEASE);
431+
break;
423432
case AefiIndexDto.PERSON_UUID:
424433
expression = aefiQueryContext.getJoins().getImmunizationJoins().getPerson().get(Person.UUID);
425434
break;
@@ -443,7 +452,7 @@ private List<Selection<?>> sortBy(List<SortProperty> sortProperties, AefiQueryCo
443452
expression = cb.lower(
444453
aefiQueryContext.getJoins().getImmunizationJoins().getPersonJoins().getAddressJoins().getDistrict().get(District.NAME));
445454
break;
446-
case AefiIndexDto.PRIMARY_VACCINE_NAME:
455+
case PRIMARY_VACCINE_COLUMN:
447456
expression = aefiQueryContext.getJoins().getPrimarySuspectVaccination().get(Vaccination.VACCINE_NAME);
448457
break;
449458
case AefiIndexDto.VACCINATION_DATE:

0 commit comments

Comments
 (0)