diff --git a/sormas-api/pom.xml b/sormas-api/pom.xml
index 3d40d3303be..4fc9c5d6aeb 100644
--- a/sormas-api/pom.xml
+++ b/sormas-api/pom.xml
@@ -2,7 +2,7 @@
de.symeda.sormas
sormas-base
- 1.76.7
+ 1.76.8
../sormas-base
4.0.0
diff --git a/sormas-app/pom.xml b/sormas-app/pom.xml
index 9cc792843ce..e887b02f78d 100644
--- a/sormas-app/pom.xml
+++ b/sormas-app/pom.xml
@@ -3,7 +3,7 @@
sormas-base
de.symeda.sormas
- 1.76.7
+ 1.76.8
../sormas-base
4.0.0
diff --git a/sormas-backend/pom.xml b/sormas-backend/pom.xml
index cedd23ac60a..32d18e3f1c7 100644
--- a/sormas-backend/pom.xml
+++ b/sormas-backend/pom.xml
@@ -3,7 +3,7 @@
sormas-base
de.symeda.sormas
- 1.76.7
+ 1.76.8
../sormas-base
4.0.0
diff --git a/sormas-backend/src/main/java/de/symeda/sormas/backend/ExtendedPostgreSQL94Dialect.java b/sormas-backend/src/main/java/de/symeda/sormas/backend/ExtendedPostgreSQL94Dialect.java
index 0e75d48f3ac..71a747359df 100644
--- a/sormas-backend/src/main/java/de/symeda/sormas/backend/ExtendedPostgreSQL94Dialect.java
+++ b/sormas-backend/src/main/java/de/symeda/sormas/backend/ExtendedPostgreSQL94Dialect.java
@@ -9,6 +9,8 @@
import com.vladmihalcea.hibernate.type.json.JsonStringType;
+import de.symeda.sormas.backend.vaccination.VaccinationService;
+
public class ExtendedPostgreSQL94Dialect extends PostgreSQL94Dialect {
public final static String SIMILARITY_OPERATOR = "similarity_operator";
@@ -24,7 +26,7 @@ public class ExtendedPostgreSQL94Dialect extends PostgreSQL94Dialect {
public final static String WINDOW_FIRST_VALUE_DESC = "window_first_value_desc";
public final static String WINDOW_COUNT = "window_count";
public final static String GREATEST = "greatest";
- public final static String TIMESTAMP_SUBTRACT_DAYS = "timestamp_subtract_days";
+ public final static String TIMESTAMP_SUBTRACT_14_DAYS = "timestamp_subtract_14_days";
public final static String AT_END_OF_DAY = "at_end_of_day";
public ExtendedPostgreSQL94Dialect() {
@@ -51,7 +53,9 @@ public ExtendedPostgreSQL94Dialect() {
registerFunction(GREATEST, new StandardSQLFunction(GREATEST));
registerFunction(ARRAY_CONTAINS_TEXT, new SQLFunctionTemplate(StandardBasicTypes.BOOLEAN, "?1 @> array[?2]::text[]"));
registerFunction(JSON_EXTRACT_PATH_TEXT, new SQLFunctionTemplate(StandardBasicTypes.STRING, "json_extract_path_text(?1, ?2)"));
- registerFunction(TIMESTAMP_SUBTRACT_DAYS, new SQLFunctionTemplate(StandardBasicTypes.DATE, "?1 - interval '?2 days'"));
+ registerFunction(
+ TIMESTAMP_SUBTRACT_14_DAYS,
+ new SQLFunctionTemplate(StandardBasicTypes.DATE, "?1 - interval '" + VaccinationService.REPORT_DATE_RELEVANT_DAYS + " days'"));
registerFunction(AT_END_OF_DAY, new SQLFunctionTemplate(StandardBasicTypes.DATE, "?1::date + interval '1 day' - interval '1 microsecond'"));
}
}
diff --git a/sormas-backend/src/main/java/de/symeda/sormas/backend/caze/CaseService.java b/sormas-backend/src/main/java/de/symeda/sormas/backend/caze/CaseService.java
index e34ec55e25a..7f0eef920c1 100644
--- a/sormas-backend/src/main/java/de/symeda/sormas/backend/caze/CaseService.java
+++ b/sormas-backend/src/main/java/de/symeda/sormas/backend/caze/CaseService.java
@@ -956,7 +956,7 @@ public Predicate createCriteriaFilter(CaseCrite
cb,
from,
ExternalShareInfo.CAZE,
- (latestShareDate) -> createChangeDateFilter(cq, cb, from, latestShareDate, true, true)));
+ (latestShareDate) -> createChangeDateFilter(cq, cb, from, joins, latestShareDate, true, true)));
return filter;
}
@@ -1224,6 +1224,7 @@ private Predicate createChangeDateFilter(
CriteriaQuery> cq,
CriteriaBuilder cb,
From, Case> casePath,
+ CaseJoins joins,
Expression extends Date> dateExpression,
boolean includeExtendedChangeDateFilters,
boolean includeRelevantVaccinations) {
@@ -1231,12 +1232,7 @@ private Predicate createChangeDateFilter(
ChangeDateFilterBuilder builder = addChangeDates(new ChangeDateFilterBuilder(cb, dateExpression), casePath, includeExtendedChangeDateFilters);
if (includeRelevantVaccinations) {
- Subquery symptomsSq = cq.subquery(Symptoms.class);
- Root symptomsSqRoot = symptomsSq.from(Symptoms.class);
- symptomsSq.select(symptomsSqRoot.get(Symptoms.ONSET_DATE));
- symptomsSq.where(cb.equal(symptomsSqRoot, casePath.get(Case.SYMPTOMS)));
-
- Join immunizationJoin = casePath.join(Case.PERSON, JoinType.LEFT).join(Person.IMMUNIZATIONS, JoinType.LEFT);
+ Join immunizationJoin = joins.getPersonJoins().getImmunization();
Join vaccinationsJoin = immunizationJoin.join(Immunization.VACCINATIONS, JoinType.LEFT);
builder.add(vaccinationsJoin.on(vaccinationService.getRelevantVaccinationPredicate(casePath, cq, cb, vaccinationsJoin)));
diff --git a/sormas-backend/src/main/java/de/symeda/sormas/backend/share/ExternalShareInfoService.java b/sormas-backend/src/main/java/de/symeda/sormas/backend/share/ExternalShareInfoService.java
index 84ca6e1d979..ec3783d4fa9 100644
--- a/sormas-backend/src/main/java/de/symeda/sormas/backend/share/ExternalShareInfoService.java
+++ b/sormas-backend/src/main/java/de/symeda/sormas/backend/share/ExternalShareInfoService.java
@@ -261,7 +261,7 @@ public Predicate buildLatestSurvToolShareDateFilter(
String associatedObjectName,
Function, Predicate> shareDatePredicateBuilder) {
- Subquery survToolShareSubQuery = cq.subquery(Timestamp.class);
+ Subquery