Skip to content
This repository was archived by the owner on May 5, 2021. It is now read-only.

Commit f94c13d

Browse files
lgallgal
authored andcommitted
SORMAS-Foundation#3136 share case/contacts in bulk
1 parent 69c7abe commit f94c13d

17 files changed

Lines changed: 626 additions & 179 deletions

File tree

sormas-api/src/main/java/de/symeda/sormas/api/i18n/Captions.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -269,6 +269,7 @@ public interface Captions {
269269
String CaseData_sharedToCountry = "CaseData.sharedToCountry";
270270
String CaseData_smallpoxVaccinationReceived = "CaseData.smallpoxVaccinationReceived";
271271
String CaseData_smallpoxVaccinationScar = "CaseData.smallpoxVaccinationScar";
272+
String CaseData_sormasToSormasOriginInfo = "CaseData.sormasToSormasOriginInfo";
272273
String CaseData_surveillanceOfficer = "CaseData.surveillanceOfficer";
273274
String CaseData_symptoms = "CaseData.symptoms";
274275
String CaseData_therapy = "CaseData.therapy";

sormas-api/src/main/java/de/symeda/sormas/api/i18n/Strings.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -175,6 +175,7 @@ public interface Strings {
175175
String errorSormasToSormasResult = "errorSormasToSormasResult";
176176
String errorSormasToSormasSend = "errorSormasToSormasSend";
177177
String errorSormasToSormasServerAccess = "errorSormasToSormasServerAccess";
178+
String errorSormasToSormasShare = "errorSormasToSormasShare";
178179
String errorViewNotFound = "errorViewNotFound";
179180
String errorWasReported = "errorWasReported";
180181
String forCase = "forCase";

sormas-api/src/main/java/de/symeda/sormas/api/sormastosormas/SormasToSormasApiConstants.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@ public class SormasToSormasApiConstants {
2121

2222
public static final String RESOURCE_PATH = "/sormasToSormas";
2323

24-
public static final String CASE_ENDPOINT = "/case";
24+
public static final String CASE_ENDPOINT = "/cases";
2525

26-
public static final String CONTACT_ENDPOINT = "/contact";
26+
public static final String CONTACT_ENDPOINT = "/contacts";
2727

2828
}

sormas-api/src/main/java/de/symeda/sormas/api/sormastosormas/SormasToSormasErrorResponse.java

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16,23 +16,25 @@
1616
package de.symeda.sormas.api.sormastosormas;
1717

1818
import java.io.Serializable;
19+
import java.util.List;
20+
import java.util.Map;
1921

2022
public class SormasToSormasErrorResponse implements Serializable {
2123

22-
private String message;
24+
private Map<String, Map<String, List<String>>> errors;
2325

2426
public SormasToSormasErrorResponse() {
2527
}
2628

27-
public SormasToSormasErrorResponse(String message) {
28-
this.message = message;
29+
public SormasToSormasErrorResponse(Map<String, Map<String, List<String>>> errors) {
30+
this.errors = errors;
2931
}
3032

31-
public String getMessage() {
32-
return message;
33+
public Map<String, Map<String, List<String>>> getErrors() {
34+
return errors;
3335
}
3436

35-
public void setMessage(String message) {
36-
this.message = message;
37+
public void setErrors(Map<String, Map<String, List<String>>> errors) {
38+
this.errors = errors;
3739
}
3840
}

sormas-api/src/main/java/de/symeda/sormas/api/sormastosormas/SormasToSormasException.java

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,27 @@
1515

1616
package de.symeda.sormas.api.sormastosormas;
1717

18+
import java.util.List;
19+
import java.util.Map;
20+
1821
public class SormasToSormasException extends Exception {
1922

23+
private Map<String, Map<String, List<String>>> errors;
24+
2025
public SormasToSormasException(String message) {
2126
super(message);
2227
}
28+
29+
public SormasToSormasException(String message, Map<String, Map<String, List<String>>> errors) {
30+
super(message);
31+
this.errors = errors;
32+
}
33+
34+
public Map<String, Map<String, List<String>>> getErrors() {
35+
return errors;
36+
}
37+
38+
public void setErrors(Map<String, Map<String, List<String>>> errors) {
39+
this.errors = errors;
40+
}
2341
}

sormas-api/src/main/java/de/symeda/sormas/api/sormastosormas/SormasToSormasFacade.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,13 @@
2222
@Remote
2323
public interface SormasToSormasFacade {
2424

25-
void saveSharedCase(SormasToSormasEncryptedDataDto encryptedData) throws SormasToSormasException;
25+
void saveSharedCases(SormasToSormasEncryptedDataDto encryptedData) throws SormasToSormasException, SormasToSormasValidationException;
2626

27-
void saveSharedContact(SormasToSormasEncryptedDataDto sharedContact) throws SormasToSormasException;
27+
void saveSharedContacts(SormasToSormasEncryptedDataDto sharedContact) throws SormasToSormasException, SormasToSormasValidationException;
2828

29-
void shareCase(String uuid, SormasToSormasOptionsDto options) throws SormasToSormasException;
29+
void shareCases(List<String> caseUuids, SormasToSormasOptionsDto options) throws SormasToSormasException;
3030

31-
void shareContact(String uuid, SormasToSormasOptionsDto options) throws SormasToSormasException;
31+
void shareContacts(List<String> contactUuids, SormasToSormasOptionsDto options) throws SormasToSormasException;
3232

3333
List<ServerAccessDataReferenceDto> getAvailableOrganizations();
3434

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
/*
2+
* SORMAS® - Surveillance Outbreak Response Management & Analysis System
3+
* Copyright © 2016-2020 Helmholtz-Zentrum für Infektionsforschung GmbH (HZI)
4+
* This program is free software: you can redistribute it and/or modify
5+
* it under the terms of the GNU General Public License as published by
6+
* the Free Software Foundation, either version 3 of the License, or
7+
* (at your option) any later version.
8+
* This program is distributed in the hope that it will be useful,
9+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
10+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11+
* GNU General Public License for more details.
12+
* You should have received a copy of the GNU General Public License
13+
* along with this program. If not, see <https://www.gnu.org/licenses/>.
14+
*/
15+
16+
package de.symeda.sormas.api.sormastosormas;
17+
18+
import java.util.List;
19+
import java.util.Map;
20+
21+
public class SormasToSormasValidationException extends Exception {
22+
23+
private final Map<String, Map<String, List<String>>> errors;
24+
25+
public SormasToSormasValidationException(Map<String, Map<String, List<String>>> errors) {
26+
this.errors = errors;
27+
}
28+
29+
public Map<String, Map<String, List<String>>> getErrors() {
30+
return errors;
31+
}
32+
}

sormas-api/src/main/resources/captions.properties

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -376,6 +376,7 @@ CaseData.quarantineReasonBeforeIsolation=Reason why the case was in quarantine b
376376
CaseData.quarantineReasonBeforeIsolationDetails=Other reason
377377
CaseData.endOfIsolationReason=Reason for end of isolation
378378
CaseData.endOfIsolationReasonDetails=Other reason
379+
CaseData.sormasToSormasOriginInfo=Shared by
379380

380381
# CaseExport
381382
CaseExport.address=Address

sormas-api/src/main/resources/strings.properties

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -221,6 +221,7 @@ errorWasReported = The error was automatically reported to the support.
221221
errorInvalidValue = Invalid value
222222
errorCaseDuplicateDeletion = The duplicate case could not be deleted due to an internal error.
223223
errorCaseMerging = The cases could not be merged due to an internal error.
224+
errorSormasToSormasShare = The shared data could not be saved due to some errors.
224225
errorSormasToSormasServerAccess = The selected health department is not configured. Please contact an admin and tell them about this issue.
225226
errorSormasToSormasSend = Unexpected error occurred while sharing. Please contact an admin and tell them about this issue.
226227
errorSormasToSormasConnection = Connection refused by the target health department.

0 commit comments

Comments
 (0)