diff --git a/sormas-api/pom.xml b/sormas-api/pom.xml
index 4f4acaaf4d5..d0a311b7ea6 100644
--- a/sormas-api/pom.xml
+++ b/sormas-api/pom.xml
@@ -2,7 +2,7 @@
de.symeda.sormas
sormas-base
- 1.73.2
+ 1.73.3
../sormas-base
4.0.0
diff --git a/sormas-api/src/main/java/de/symeda/sormas/api/event/EventParticipantExportDto.java b/sormas-api/src/main/java/de/symeda/sormas/api/event/EventParticipantExportDto.java
index 77257bedd8d..9ee12138dea 100644
--- a/sormas-api/src/main/java/de/symeda/sormas/api/event/EventParticipantExportDto.java
+++ b/sormas-api/src/main/java/de/symeda/sormas/api/event/EventParticipantExportDto.java
@@ -82,6 +82,7 @@ public class EventParticipantExportDto implements Serializable {
private long personAddressId;
private String eventUuid;
+ private Date eventReportDateTime;
private final EventStatus eventStatus;
private final EventInvestigationStatus eventInvestigationStatus;
@@ -177,7 +178,7 @@ public class EventParticipantExportDto implements Serializable {
private long contactCount;
//@formatter:off
- public EventParticipantExportDto(long id, long personId, String personUuid, String eventParticipantUuid, String nationalHealthId, long personAddressId, boolean isInJurisdiction, String eventUuid,
+ public EventParticipantExportDto(long id, long personId, String personUuid, String eventParticipantUuid, String nationalHealthId, long personAddressId, boolean isInJurisdiction, String eventUuid, Date eventReportDateTime,
EventStatus eventStatus, EventInvestigationStatus eventInvestigationStatus, Disease eventDisease, TypeOfPlace typeOfPlace, Date eventStartDate, Date eventEndDate, String eventTitle, String eventDesc,
String eventRegion, String eventDistrict, String eventCommunity, String eventCity, String eventStreet, String eventHouseNumber,
@@ -197,6 +198,7 @@ public EventParticipantExportDto(long id, long personId, String personUuid, Stri
this.nationalHealthId = nationalHealthId;
this.personAddressId = personAddressId;
this.eventUuid = eventUuid;
+ this.eventReportDateTime = eventReportDateTime;
this.eventStatus = eventStatus;
this.eventInvestigationStatus = eventInvestigationStatus;
@@ -978,4 +980,8 @@ public void setVaccineUniiCode(String vaccineUniiCode) {
public void setVaccineAtcCode(String vaccineAtcCode) {
this.vaccineAtcCode = vaccineAtcCode;
}
+
+ public Date getEventReportDateTime() {
+ return eventReportDateTime;
+ }
}
diff --git a/sormas-app/pom.xml b/sormas-app/pom.xml
index f5552a1794a..e65a5777924 100644
--- a/sormas-app/pom.xml
+++ b/sormas-app/pom.xml
@@ -3,7 +3,7 @@
sormas-base
de.symeda.sormas
- 1.73.2
+ 1.73.3
../sormas-base
4.0.0
diff --git a/sormas-backend/pom.xml b/sormas-backend/pom.xml
index d58a5dd3a85..3abceeab160 100644
--- a/sormas-backend/pom.xml
+++ b/sormas-backend/pom.xml
@@ -3,7 +3,7 @@
sormas-base
de.symeda.sormas
- 1.73.2
+ 1.73.3
../sormas-base
4.0.0
diff --git a/sormas-backend/src/main/java/de/symeda/sormas/backend/caze/CaseFacadeEjb.java b/sormas-backend/src/main/java/de/symeda/sormas/backend/caze/CaseFacadeEjb.java
index 871c4f61da8..8c954edbcb4 100644
--- a/sormas-backend/src/main/java/de/symeda/sormas/backend/caze/CaseFacadeEjb.java
+++ b/sormas-backend/src/main/java/de/symeda/sormas/backend/caze/CaseFacadeEjb.java
@@ -885,16 +885,13 @@ public List getExportList(
List resultCaseIds = resultList.stream().map(CaseExportDto::getId).collect(Collectors.toList());
if (!resultList.isEmpty()) {
- Map symptoms = null;
- if (ExportHelper.shouldExportFields(exportConfiguration, CaseDataDto.SYMPTOMS)) {
- List symptomsList = null;
- CriteriaQuery symptomsCq = cb.createQuery(Symptoms.class);
- Root symptomsRoot = symptomsCq.from(Symptoms.class);
- Expression symptomsIdsExpr = symptomsRoot.get(Symptoms.ID);
- symptomsCq.where(symptomsIdsExpr.in(resultList.stream().map(CaseExportDto::getSymptomsId).collect(Collectors.toList())));
- symptomsList = em.createQuery(symptomsCq).setHint(ModelConstants.HINT_HIBERNATE_READ_ONLY, true).getResultList();
- symptoms = symptomsList.stream().collect(Collectors.toMap(Symptoms::getId, Function.identity()));
- }
+ List symptomsList = null;
+ CriteriaQuery symptomsCq = cb.createQuery(Symptoms.class);
+ Root symptomsRoot = symptomsCq.from(Symptoms.class);
+ Expression symptomsIdsExpr = symptomsRoot.get(Symptoms.ID);
+ symptomsCq.where(symptomsIdsExpr.in(resultList.stream().map(CaseExportDto::getSymptomsId).collect(Collectors.toList())));
+ symptomsList = em.createQuery(symptomsCq).setHint(ModelConstants.HINT_HIBERNATE_READ_ONLY, true).getResultList();
+ Map symptoms = symptomsList.stream().collect(Collectors.toMap(Symptoms::getId, Function.identity()));
Map healthConditions = null;
if (exportType == null || exportType == CaseExportType.CASE_MANAGEMENT) {
@@ -1048,7 +1045,7 @@ public List getExportList(
if (exportConfiguration == null || exportConfiguration.getProperties().contains(CaseExportDto.COUNTRY)) {
exportDto.setCountry(configFacade.getEpidPrefix());
}
- if (symptoms != null) {
+ if (ExportHelper.shouldExportFields(exportConfiguration, CaseDataDto.SYMPTOMS)) {
Optional.ofNullable(symptoms.get(exportDto.getSymptomsId()))
.ifPresent(symptom -> exportDto.setSymptoms(SymptomsFacadeEjb.toDto(symptom)));
}
@@ -1135,10 +1132,12 @@ public List getExportList(
filteredImmunizations.sort(Comparator.comparing(i -> ImmunizationEntityHelper.getDateForComparison(i, false)));
Immunization mostRecentImmunization = filteredImmunizations.get(filteredImmunizations.size() - 1);
Integer numberOfDoses = mostRecentImmunization.getNumberOfDoses();
+ Date onsetDate = Optional.ofNullable(symptoms.get(exportDto.getSymptomsId())).map(Symptoms::getOnsetDate).orElse(null);
- List relevantSortedVaccinations = getRelevantSortedVaccinations(
- exportDto.getUuid(),
- filteredImmunizations.stream().flatMap(i -> i.getVaccinations().stream()).collect(Collectors.toList()));
+ List relevantSortedVaccinations = vaccinationService.getRelevantSortedVaccinations(
+ filteredImmunizations.stream().flatMap(i -> i.getVaccinations().stream()).collect(Collectors.toList()),
+ onsetDate,
+ exportDto.getReportDate());
Vaccination firstVaccination = null;
Vaccination lastVaccination = null;
@@ -1281,15 +1280,6 @@ private Map getCaseUsersForExport(List resul
return caseUsers;
}
- private List getRelevantSortedVaccinations(String caseUuid, List vaccinations) {
- Case caze = caseService.getByUuid(caseUuid);
-
- return vaccinations.stream()
- .filter(v -> vaccinationService.isVaccinationRelevant(caze, v))
- .sorted(Comparator.comparing(ImmunizationEntityHelper::getVaccinationDateForComparison))
- .collect(Collectors.toList());
- }
-
private String getNumberOfDosesFromVaccinations(Vaccination vaccination) {
return vaccination != null ? vaccination.getVaccineDose() : "";
}
diff --git a/sormas-backend/src/main/java/de/symeda/sormas/backend/contact/ContactFacadeEjb.java b/sormas-backend/src/main/java/de/symeda/sormas/backend/contact/ContactFacadeEjb.java
index b86f72532bd..89cd3250fdb 100644
--- a/sormas-backend/src/main/java/de/symeda/sormas/backend/contact/ContactFacadeEjb.java
+++ b/sormas-backend/src/main/java/de/symeda/sormas/backend/contact/ContactFacadeEjb.java
@@ -847,9 +847,10 @@ public List getExportList(
Immunization mostRecentImmunization = filteredImmunizations.get(filteredImmunizations.size() - 1);
Integer numberOfDoses = mostRecentImmunization.getNumberOfDoses();
- List relevantSortedVaccinations = getRelevantSortedVaccinations(
- exportContact.getUuid(),
- filteredImmunizations.stream().flatMap(i -> i.getVaccinations().stream()).collect(Collectors.toList()));
+ List relevantSortedVaccinations = vaccinationService.getRelevantSortedVaccinations(
+ filteredImmunizations.stream().flatMap(i -> i.getVaccinations().stream()).collect(Collectors.toList()),
+ exportContact.getLastContactDate(),
+ exportContact.getReportDate());
Vaccination firstVaccination = null;
Vaccination lastVaccination = null;
@@ -2259,15 +2260,6 @@ private User getRandomDistrictContactResponsible(District district) {
return userService.getRandomDistrictUser(district, UserRight.CONTACT_RESPONSIBLE);
}
- private List getRelevantSortedVaccinations(String caseUuid, List vaccinations) {
- Contact contact = contactService.getByUuid(caseUuid);
-
- return vaccinations.stream()
- .filter(v -> vaccinationService.isVaccinationRelevant(contact, v))
- .sorted(Comparator.comparing(ImmunizationEntityHelper::getVaccinationDateForComparison))
- .collect(Collectors.toList());
- }
-
private String getNumberOfDosesFromVaccinations(Vaccination vaccination) {
return vaccination != null ? vaccination.getVaccineDose() : "";
}
diff --git a/sormas-backend/src/main/java/de/symeda/sormas/backend/event/EventParticipantFacadeEjb.java b/sormas-backend/src/main/java/de/symeda/sormas/backend/event/EventParticipantFacadeEjb.java
index 513226500a4..7dadc35347a 100644
--- a/sormas-backend/src/main/java/de/symeda/sormas/backend/event/EventParticipantFacadeEjb.java
+++ b/sormas-backend/src/main/java/de/symeda/sormas/backend/event/EventParticipantFacadeEjb.java
@@ -277,15 +277,6 @@ private void archiveAllArchivableEventParticipants(int daysAfterEventParticipant
}
}
- private List getRelevantSortedVaccinations(String eventUuid, List vaccinations) {
- Event event = eventService.getByUuid(eventUuid);
-
- return vaccinations.stream()
- .filter(v -> vaccinationService.isVaccinationRelevant(event, v))
- .sorted(Comparator.comparing(ImmunizationEntityHelper::getVaccinationDateForComparison))
- .collect(Collectors.toList());
- }
-
private String getNumberOfDosesFromVaccinations(Vaccination vaccination) {
return vaccination != null ? vaccination.getVaccineDose() : "";
}
@@ -657,6 +648,7 @@ public List getExportList(
JurisdictionHelper.booleanSelector(cb, service.inJurisdictionOrOwned(eventParticipantQueryContext)),
event.get(Event.UUID),
+ event.get(Event.REPORT_DATE_TIME),
event.get(Event.EVENT_STATUS),
event.get(Event.EVENT_INVESTIGATION_STATUS),
@@ -804,9 +796,11 @@ public List getExportList(
Immunization mostRecentImmunization = filteredImmunizations.get(filteredImmunizations.size() - 1);
Integer numberOfDoses = mostRecentImmunization.getNumberOfDoses();
- List relevantSortedVaccinations = getRelevantSortedVaccinations(
- exportDto.getEventUuid(),
- filteredImmunizations.stream().flatMap(i -> i.getVaccinations().stream()).collect(Collectors.toList()));
+ List relevantSortedVaccinations = vaccinationService.getRelevantSortedVaccinations(
+ filteredImmunizations.stream().flatMap(i -> i.getVaccinations().stream()).collect(Collectors.toList()),
+ exportDto.getEventStartDate(),
+ exportDto.getEventEndDate(),
+ exportDto.getEventReportDateTime());
Vaccination firstVaccination = null;
Vaccination lastVaccination = null;
diff --git a/sormas-backend/src/main/java/de/symeda/sormas/backend/sormastosormas/entities/contact/SormasToSormasContactFacadeEjb.java b/sormas-backend/src/main/java/de/symeda/sormas/backend/sormastosormas/entities/contact/SormasToSormasContactFacadeEjb.java
index 198aff96650..1e737c1b0a3 100644
--- a/sormas-backend/src/main/java/de/symeda/sormas/backend/sormastosormas/entities/contact/SormasToSormasContactFacadeEjb.java
+++ b/sormas-backend/src/main/java/de/symeda/sormas/backend/sormastosormas/entities/contact/SormasToSormasContactFacadeEjb.java
@@ -49,6 +49,7 @@
import de.symeda.sormas.api.sormastosormas.validation.ValidationErrorGroup;
import de.symeda.sormas.api.sormastosormas.validation.ValidationErrorMessage;
import de.symeda.sormas.api.sormastosormas.validation.ValidationErrors;
+import de.symeda.sormas.backend.caze.CaseFacadeEjb.CaseFacadeEjbLocal;
import de.symeda.sormas.backend.common.BaseAdoService;
import de.symeda.sormas.backend.contact.Contact;
import de.symeda.sormas.backend.contact.ContactService;
@@ -83,6 +84,8 @@ public class SormasToSormasContactFacadeEjb extends AbstractSormasToSormasInterf
private ImmunizationService immunizationService;
@EJB
private SormasToSormasShareRequestService shareRequestService;
+ @EJB
+ private CaseFacadeEjbLocal caseFacade;
public SormasToSormasContactFacadeEjb() {
super(
@@ -206,7 +209,7 @@ protected void validateShareRequestBeforeAccept(SormasToSormasShareRequestDto sh
ValidationErrors.create(
new ValidationErrorGroup(Captions.Contact),
new ValidationErrorMessage(Validations.sormasToSormasAcceptContactHasNoCase))));
- } else {
+ } else if (!caseFacade.exists(c.getCaze().getUuid())) {
List caseRequests = shareRequestService.getShareRequestsForCase(c.getCaze());
if (caseRequests.isEmpty()
|| caseRequests.stream()
diff --git a/sormas-backend/src/main/java/de/symeda/sormas/backend/vaccination/VaccinationService.java b/sormas-backend/src/main/java/de/symeda/sormas/backend/vaccination/VaccinationService.java
index 1fce00baa51..efd992abf36 100644
--- a/sormas-backend/src/main/java/de/symeda/sormas/backend/vaccination/VaccinationService.java
+++ b/sormas-backend/src/main/java/de/symeda/sormas/backend/vaccination/VaccinationService.java
@@ -16,6 +16,8 @@
package de.symeda.sormas.backend.vaccination;
import java.util.ArrayList;
+import java.util.Comparator;
+import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@@ -45,6 +47,7 @@
import de.symeda.sormas.backend.common.CriteriaBuilderHelper;
import de.symeda.sormas.backend.contact.Contact;
import de.symeda.sormas.backend.event.Event;
+import de.symeda.sormas.backend.immunization.ImmunizationEntityHelper;
import de.symeda.sormas.backend.immunization.entity.Immunization;
import de.symeda.sormas.backend.person.Person;
@@ -52,6 +55,8 @@
@LocalBean
public class VaccinationService extends BaseAdoService {
+ public static final int REPORT_DATE_RELEVANT_DAYS = 14;
+
public VaccinationService() {
super(Vaccination.class);
}
@@ -118,28 +123,65 @@ public List getVaccinationsByCriteria(
}
public boolean isVaccinationRelevant(Case caze, Vaccination vaccination) {
- return vaccination.getVaccinationDate() != null
- && (caze.getSymptoms().getOnsetDate() != null
- ? DateHelper.getEndOfDay(vaccination.getVaccinationDate()).before(caze.getSymptoms().getOnsetDate())
- : DateHelper.getEndOfDay(vaccination.getVaccinationDate()).before(caze.getReportDate()));
+ return isVaccinationRelevant(vaccination, caze.getSymptoms().getOnsetDate(), caze.getReportDate());
}
public boolean isVaccinationRelevant(Contact contact, Vaccination vaccination) {
- return vaccination.getVaccinationDate() != null
- && (contact.getLastContactDate() != null
- ? DateHelper.getEndOfDay(vaccination.getVaccinationDate()).before(contact.getLastContactDate())
- : DateHelper.getEndOfDay(vaccination.getVaccinationDate()).before(contact.getReportDateTime()));
+ return isVaccinationRelevant(vaccination, contact.getLastContactDate(), contact.getReportDateTime());
+
}
+ /**
+ * HEADS UP! When this method gets changed, most probably the database logic in
+ * {@link de.symeda.sormas.backend.event.EventParticipantService#updateVaccinationStatuses(Long, Disease, Date)}
+ * will also need an update.
+ *
+ * @param event
+ * to decide whether the vaccination is relevant for
+ * @param vaccination
+ * to be decided about
+ * @return true when the vaccination is relevant, false otherwise
+ */
public boolean isVaccinationRelevant(Event event, Vaccination vaccination) {
- if (vaccination.getVaccinationDate() == null) {
- return false;
- }
- if (event.getStartDate() != null) {
- return DateHelper.getEndOfDay(vaccination.getVaccinationDate()).before(event.getStartDate());
+ return isVaccinationRelevant(vaccination, event.getStartDate(), event.getEndDate(), event.getReportDateTime());
+ }
+
+ /*
+ * HEADS UP! If you make changes here, you most probably also need to update the database queries in
+ * ContactService.updateVaccinationStatuses(...) and
+ * EventParticipantService.updateVaccinationStatuses(...).
+ */
+ private boolean isVaccinationRelevant(Vaccination vaccination, Date... relevanceFilterDates) {
+
+ Date relevantVaccineDate = getRelevantVaccineDate(vaccination);
+ for (Date comparisonDate : relevanceFilterDates) {
+ if (comparisonDate != null) {
+ return DateHelper.getEndOfDay(relevantVaccineDate).before(comparisonDate);
+ }
}
- return event.getEndDate() != null
- ? DateHelper.getEndOfDay(vaccination.getVaccinationDate()).before(event.getEndDate())
- : DateHelper.getEndOfDay(vaccination.getVaccinationDate()).before(event.getReportDateTime());
+ return false;
+ }
+
+ public List getRelevantSortedVaccinations(List vaccinations, Date... relevanceFilterDates) {
+
+ return vaccinations.stream()
+ .filter(v -> isVaccinationRelevant(v, relevanceFilterDates))
+ .sorted(Comparator.comparing(ImmunizationEntityHelper::getVaccinationDateForComparison))
+ .collect(Collectors.toList());
+ }
+
+ /**
+ * * Obtains the date used for calculating the relevance of a vaccination for a case/contact/event participant.
+ * * There is a 14-day buffer when the report date needs to be used.
+ * * There is an identical method for VaccinationDtos below!
+ *
+ * @param vaccination
+ * to obtain the relevant date from
+ * @return relevant date
+ */
+ public Date getRelevantVaccineDate(Vaccination vaccination) {
+ return vaccination.getVaccinationDate() != null
+ ? vaccination.getVaccinationDate()
+ : DateHelper.subtractDays(vaccination.getReportDate(), REPORT_DATE_RELEVANT_DAYS);
}
}
diff --git a/sormas-base/dependencies/serverlibs.pom b/sormas-base/dependencies/serverlibs.pom
index 4b683411423..69e9744ff4f 100644
--- a/sormas-base/dependencies/serverlibs.pom
+++ b/sormas-base/dependencies/serverlibs.pom
@@ -8,7 +8,7 @@
sormas-base
de.symeda.sormas
- 1.73.2
+ 1.73.3
../
diff --git a/sormas-base/pom.xml b/sormas-base/pom.xml
index 825eb0115ae..06685871db7 100644
--- a/sormas-base/pom.xml
+++ b/sormas-base/pom.xml
@@ -5,7 +5,7 @@
de.symeda.sormas
sormas-base
pom
- 1.73.2
+ 1.73.3
1.8
diff --git a/sormas-cargoserver/pom.xml b/sormas-cargoserver/pom.xml
index d7654c04bb1..a5dc1e24da7 100644
--- a/sormas-cargoserver/pom.xml
+++ b/sormas-cargoserver/pom.xml
@@ -3,7 +3,7 @@
de.symeda.sormas
sormas-base
- 1.73.2
+ 1.73.3
../sormas-base
diff --git a/sormas-ear/pom.xml b/sormas-ear/pom.xml
index b5b868f3cf0..8f70a162ff2 100644
--- a/sormas-ear/pom.xml
+++ b/sormas-ear/pom.xml
@@ -3,7 +3,7 @@
de.symeda.sormas
sormas-base
- 1.73.2
+ 1.73.3
../sormas-base
diff --git a/sormas-keycloak-service-provider/pom.xml b/sormas-keycloak-service-provider/pom.xml
index 48490950fd2..0b5c779af8d 100644
--- a/sormas-keycloak-service-provider/pom.xml
+++ b/sormas-keycloak-service-provider/pom.xml
@@ -3,7 +3,7 @@
sormas-base
de.symeda.sormas
- 1.73.2
+ 1.73.3
../sormas-base
4.0.0
diff --git a/sormas-rest/pom.xml b/sormas-rest/pom.xml
index 110655b743a..23da96a5068 100644
--- a/sormas-rest/pom.xml
+++ b/sormas-rest/pom.xml
@@ -3,7 +3,7 @@
de.symeda.sormas
sormas-base
- 1.73.2
+ 1.73.3
../sormas-base
diff --git a/sormas-ui/pom.xml b/sormas-ui/pom.xml
index 7081b224b6f..2fbd3799c4c 100644
--- a/sormas-ui/pom.xml
+++ b/sormas-ui/pom.xml
@@ -3,7 +3,7 @@
sormas-base
de.symeda.sormas
- 1.73.2
+ 1.73.3
../sormas-base
4.0.0
diff --git a/sormas-ui/src/main/java/de/symeda/sormas/ui/caze/CaseController.java b/sormas-ui/src/main/java/de/symeda/sormas/ui/caze/CaseController.java
index 6c3df105c06..99c0268dd0c 100644
--- a/sormas-ui/src/main/java/de/symeda/sormas/ui/caze/CaseController.java
+++ b/sormas-ui/src/main/java/de/symeda/sormas/ui/caze/CaseController.java
@@ -68,6 +68,7 @@
import de.symeda.sormas.api.common.DeletionDetails;
import de.symeda.sormas.api.common.DeletionReason;
import de.symeda.sormas.api.contact.ContactClassification;
+import de.symeda.sormas.api.contact.ContactCriteria;
import de.symeda.sormas.api.contact.ContactDto;
import de.symeda.sormas.api.contact.ContactSimilarityCriteria;
import de.symeda.sormas.api.contact.ContactStatus;
@@ -412,10 +413,11 @@ private void showConvertToCaseSelection(
convertToCaseSelectComponent.addCommitListener(() -> {
List selectedContacts = convertToCaseSelectionField.getSelectedContacts();
if (!selectedContacts.isEmpty()) {
- caze.getEpiData().setContactWithSourceCaseKnown(YesNoUnknown.YES);
+ CaseDataDto refreshedCaze = FacadeProvider.getCaseFacade().getCaseDataByUuid(caze.getUuid());
+ refreshedCaze.getEpiData().setContactWithSourceCaseKnown(YesNoUnknown.YES);
+ saveCase(refreshedCaze);
}
- CaseDataDto refreshedCaze = FacadeProvider.getCaseFacade().getCaseDataByUuid(caze.getUuid());
- saveCase(refreshedCaze);
+
setResultingCase(caze, selectedContacts, convertToCaseSelectionField.getSelectedEventParticipants());
SormasUI.refreshView();
});
@@ -1354,9 +1356,10 @@ public CommitDiscardWrapperComponent getEpiDataComponent(final Stri
EpiDataForm epiDataForm = new EpiDataForm(caze.getDisease(), CaseDataDto.class, caze.isPseudonymized(), sourceContactsToggleCallback);
epiDataForm.setValue(caze.getEpiData());
+ UserProvider currentUserProvider = UserProvider.getCurrent();
final CommitDiscardWrapperComponent editView = new CommitDiscardWrapperComponent(
epiDataForm,
- UserProvider.getCurrent().hasUserRight(UserRight.CASE_EDIT),
+ currentUserProvider.hasUserRight(UserRight.CASE_EDIT),
epiDataForm.getFieldGroup());
editView.addCommitListener(() -> {
@@ -1365,6 +1368,13 @@ public CommitDiscardWrapperComponent getEpiDataComponent(final Stri
saveCase(cazeDto);
});
+ if (currentUserProvider.hasUserRight(UserRight.CONTACT_VIEW)) {
+ long sourceContactCount = FacadeProvider.getContactFacade().count(new ContactCriteria().resultingCase(caze.toReference()));
+ if (sourceContactCount > 0) {
+ epiDataForm.disableContactWithSourceCaseKnownField();
+ }
+ }
+
return editView;
}
diff --git a/sormas-ui/src/main/java/de/symeda/sormas/ui/epidata/CaseEpiDataView.java b/sormas-ui/src/main/java/de/symeda/sormas/ui/epidata/CaseEpiDataView.java
index 8fb35a4a196..4210c296028 100644
--- a/sormas-ui/src/main/java/de/symeda/sormas/ui/epidata/CaseEpiDataView.java
+++ b/sormas-ui/src/main/java/de/symeda/sormas/ui/epidata/CaseEpiDataView.java
@@ -109,10 +109,6 @@ protected void initView(String params) {
sourceContactsLayout.addComponent(contactCreationDisclaimer);
}
- if (!sourceContactList.isEmpty()) {
- epiDataComponent.getWrappedComponent().disableContactWithSourceCaseKnownField();
- }
-
epiDataComponent.getWrappedComponent().setGetSourceContactsCallback(sourceContactList::getEntries);
}
layout.addComponent(sourceContactsLayout, LOC_SOURCE_CONTACTS);
diff --git a/sormas-ui/src/main/java/de/symeda/sormas/ui/externalmessage/physiciansreport/PhysiciansReportCaseEditComponent.java b/sormas-ui/src/main/java/de/symeda/sormas/ui/externalmessage/physiciansreport/PhysiciansReportCaseEditComponent.java
index c22080c4a58..8004d0d5601 100644
--- a/sormas-ui/src/main/java/de/symeda/sormas/ui/externalmessage/physiciansreport/PhysiciansReportCaseEditComponent.java
+++ b/sormas-ui/src/main/java/de/symeda/sormas/ui/externalmessage/physiciansreport/PhysiciansReportCaseEditComponent.java
@@ -64,6 +64,13 @@ public PhysiciansReportCaseEditComponent(CaseDataDto caze, ExternalMessageDto ex
tabsMenu = new SubMenu();
tabConfigs = createTabConfigs();
+ // save on active tab on commit
+ setPreCommitListener(callback -> {
+ if (activeTabComponent.commitAndHandle()) {
+ callback.run();
+ }
+ });
+
backButton = ButtonHelper.createButton(Captions.actionBack, (e) -> {
if (activeTabIndex > 0) {
String previousTab = tabConfigs.get(activeTabIndex - 1).captionTag;
@@ -88,8 +95,7 @@ public PhysiciansReportCaseEditComponent(CaseDataDto caze, ExternalMessageDto ex
getButtonsPanel().addComponent(nextButton);
saveAndOpenCaseButton = ButtonHelper.createButton(Captions.actionSaveAndOpenCase, (b) -> {
- if (activeTabComponent.commitAndHandle()) {
- commit();
+ if (commitAndHandle()) {
ControllerProvider.getCaseController().navigateToCase(caze.getUuid());
}
}, ValoTheme.BUTTON_PRIMARY);
diff --git a/sormas-ui/src/main/java/de/symeda/sormas/ui/externalmessage/physiciansreport/PhysiciansReportCaseImmunizationsComponent.java b/sormas-ui/src/main/java/de/symeda/sormas/ui/externalmessage/physiciansreport/PhysiciansReportCaseImmunizationsComponent.java
index 7d80e8e9dd4..2c77ff8dd7d 100644
--- a/sormas-ui/src/main/java/de/symeda/sormas/ui/externalmessage/physiciansreport/PhysiciansReportCaseImmunizationsComponent.java
+++ b/sormas-ui/src/main/java/de/symeda/sormas/ui/externalmessage/physiciansreport/PhysiciansReportCaseImmunizationsComponent.java
@@ -17,7 +17,6 @@
import static de.symeda.sormas.ui.utils.CssStyles.H3;
-import de.symeda.sormas.ui.utils.DirtyCheckPopup;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
@@ -55,6 +54,7 @@
import de.symeda.sormas.ui.utils.CssStyles;
import de.symeda.sormas.ui.utils.DateFormatHelper;
import de.symeda.sormas.ui.utils.DeletableUtils;
+import de.symeda.sormas.ui.utils.DirtyCheckPopup;
import de.symeda.sormas.ui.vaccination.VaccinationEditForm;
public class PhysiciansReportCaseImmunizationsComponent extends CommitDiscardWrapperComponent {
@@ -208,12 +208,11 @@ private void handleEditVaccination(VaccinationDto vaccination, CaseDataDto caze)
VaccinationListItem collapsedComponent = vaccinationList.getItemByVaccination(vaccination);
currentVaccinationEditComponent = ControllerProvider.getVaccinationController()
- .getVaccinationEditComponent(
- vaccination,
- caze.getDisease(),
- UiFieldAccessCheckers.getDefault(caze.isPseudonymized()),
- false,
- vaccinationsToUpdate::add);
+ .getVaccinationEditComponent(vaccination, caze.getDisease(), UiFieldAccessCheckers.getDefault(caze.isPseudonymized()), false, (v) -> {
+ if (!vaccinationsToCreate.contains(v)) {
+ vaccinationsToUpdate.add(v);
+ }
+ });
currentVaccinationEditComponent.getDiscardButton().setCaption(I18nProperties.getCaption(Captions.actionCancel));
currentVaccinationEditComponent.getButtonsPanel()
diff --git a/sormas-ui/src/main/java/de/symeda/sormas/ui/sormastosormas/SormasToSormasController.java b/sormas-ui/src/main/java/de/symeda/sormas/ui/sormastosormas/SormasToSormasController.java
index 7d0375bb230..108ccd20ede 100644
--- a/sormas-ui/src/main/java/de/symeda/sormas/ui/sormastosormas/SormasToSormasController.java
+++ b/sormas-ui/src/main/java/de/symeda/sormas/ui/sormastosormas/SormasToSormasController.java
@@ -160,6 +160,11 @@ public void acceptShareRequest(SormasToSormasShareRequestIndexDto request, Runna
List contacts = shareRequest.getContacts();
for (int i = 0, contactsSize = contacts.size(); i < contactsSize && !hasErrors; i++) {
SormasToSormasContactPreview c = contacts.get(i);
+
+ if (FacadeProvider.getCaseFacade().exists(c.getCaze().getUuid())) {
+ continue;
+ }
+
List caseRequests =
FacadeProvider.getSormasToSormasShareRequestFacade().getShareRequestsForCase(c.getCaze());
if (caseRequests.isEmpty()) {
diff --git a/sormas-widgetset/pom.xml b/sormas-widgetset/pom.xml
index d9fe7574b5c..fb65ca8123a 100644
--- a/sormas-widgetset/pom.xml
+++ b/sormas-widgetset/pom.xml
@@ -3,7 +3,7 @@
sormas-base
de.symeda.sormas
- 1.73.2
+ 1.73.3
../sormas-base
4.0.0