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

Commit f198aeb

Browse files
Merge branch 'development' of https://github.com/hzi-braunschweig/SORMAS-Project into development
2 parents 87276de + 7abce9c commit f198aeb

42 files changed

Lines changed: 2938 additions & 1357 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

sormas-api/src/main/java/de/symeda/sormas/api/bagexport/BAGExportCaseDto.java

Lines changed: 230 additions & 159 deletions
Large diffs are not rendered by default.

sormas-api/src/main/java/de/symeda/sormas/api/bagexport/BAGExportContactDto.java

Lines changed: 140 additions & 170 deletions
Large diffs are not rendered by default.

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
@@ -1375,6 +1375,7 @@ public interface Captions {
13751375
String SormasToSormasOptions_pseudonymizeSensitiveData = "SormasToSormasOptions.pseudonymizeSensitiveData";
13761376
String SormasToSormasOptions_withAssociatedContacts = "SormasToSormasOptions.withAssociatedContacts";
13771377
String SormasToSormasOptions_withSamples = "SormasToSormasOptions.withSamples";
1378+
String sormasToSormasReturn = "sormasToSormasReturn";
13781379
String sormasToSormasSentFrom = "sormasToSormasSentFrom";
13791380
String sormasToSormasShare = "sormasToSormasShare";
13801381
String sormasToSormasSharedBy = "sormasToSormasSharedBy";

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,8 @@ public interface Validations {
9999
String sormasToSormasContactCaseNotExists = "sormasToSormasContactCaseNotExists";
100100
String sormasToSormasContactExists = "sormasToSormasContactExists";
101101
String sormasToSormasOrganizationIdMissing = "sormasToSormasOrganizationIdMissing";
102+
String sormasToSormasReturnCaseNotExists = "sormasToSormasReturnCaseNotExists";
103+
String sormasToSormasReturnContactNotExists = "sormasToSormasReturnContactNotExists";
102104
String sormasToSormasSampleExists = "sormasToSormasSampleExists";
103105
String sormasToSormasSenderNameMissing = "sormasToSormasSenderNameMissing";
104106
String sormasToSormasShareInfoMissing = "sormasToSormasShareInfoMissing";

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

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,14 @@ public interface SormasToSormasFacade {
3030

3131
void shareContacts(List<String> contactUuids, SormasToSormasOptionsDto options) throws SormasToSormasException;
3232

33+
void returnCase(String caseUuid, SormasToSormasOptionsDto options) throws SormasToSormasException;
34+
35+
void returnContact(String contactUuid, SormasToSormasOptionsDto options) throws SormasToSormasException;
36+
37+
void saveReturnedCase(SormasToSormasEncryptedDataDto sharedCase) throws SormasToSormasException, SormasToSormasValidationException;
38+
39+
void saveReturnedContact(SormasToSormasEncryptedDataDto sharedContact) throws SormasToSormasException, SormasToSormasValidationException;
40+
3341
List<ServerAccessDataReferenceDto> getAvailableOrganizations();
3442

3543
ServerAccessDataReferenceDto getOrganizationRef(String id);
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
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 javax.ejb.Remote;
19+
20+
@Remote
21+
public interface SormasToSormasOriginInfoFacade {
22+
}

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1939,6 +1939,7 @@ sormasToSormasDialogTitle=Share with health department
19391939
sormasToSormasErrorDialogTitle=Error while sharing with another health department
19401940
sormasToSormasListTitle=Share
19411941
sormasToSormasShare=Share
1942+
sormasToSormasReturn=Return
19421943
sormasToSormasCaseNotShared=This case is not shared
19431944
sormasToSormasContactNotShared=This contact is not shared
19441945
sormasToSormasSharedWith=Shared with

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,8 @@ sormasToSormasShareInfoMissing = Sender information is missing
126126
sormasToSormasOrganizationIdMissing = Sender organization is is missing
127127
sormasToSormasSenderNameMissing = Sender name is missing
128128
sormasToSormasSampleExists = This sample already exists
129+
sormasToSormasReturnCaseNotExists = Case does not exist
130+
sormasToSormasReturnContactNotExists = Contact does not exist
129131
validPhoneNumber = %s must be a valid phone number
130132
validEmailAddress = %s must be a valid email address
131133
externalJournalPersonValidationBirthdate = Invalid birthdate.

sormas-backend/src/main/java/de/symeda/sormas/backend/bagexport/BAGExportFacadeEjb.java

Lines changed: 43 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
import java.util.ArrayList;
1919
import java.util.Collections;
2020
import java.util.Comparator;
21+
import java.util.Date;
2122
import java.util.HashMap;
2223
import java.util.List;
2324
import java.util.Map;
@@ -72,7 +73,9 @@ public List<BAGExportCaseDto> getCaseExportList(int first, int max) {
7273
Join<Case, Person> person = caseJoins.getPerson();
7374
Join<Person, Location> homeAddress = caseJoins.getPersonAddress();
7475

76+
Expression<String> homeAddressCountry = cb.literal(TODO_VALUE);
7577
Expression<String> mobileNumber = cb.literal(TODO_VALUE);
78+
Expression<String> activityMappingYn = cb.literal(TODO_VALUE);
7679

7780
cq.multiselect(
7881
caseRoot.get(Case.CASE_ID_ISM),
@@ -84,6 +87,7 @@ public List<BAGExportCaseDto> getCaseExportList(int first, int max) {
8487
homeAddress.get(Location.HOUSE_NUMBER),
8588
homeAddress.get(Location.CITY),
8689
homeAddress.get(Location.POSTAL_CODE),
90+
homeAddressCountry,
8791
person.get(Person.PHONE),
8892
mobileNumber,
8993
person.get(Person.EMAIL_ADDRESS),
@@ -92,14 +96,23 @@ public List<BAGExportCaseDto> getCaseExportList(int first, int max) {
9296
person.get(Person.BIRTHDATE_MM),
9397
person.get(Person.BIRTHDATE_YYYY),
9498
person.get(Person.OCCUPATION_TYPE),
99+
95100
caseJoins.getSymptoms().get(Symptoms.SYMPTOMATIC),
96101
caseRoot.get(Case.COVID_TEST_REASON),
97102
caseRoot.get(Case.COVID_TEST_REASON_DETAILS),
98103
caseJoins.getSymptoms().get(Symptoms.ONSET_DATE),
104+
105+
activityMappingYn,
106+
99107
caseRoot.get(Case.CONTACT_TRACING_FIRST_CONTACT_DATE),
108+
109+
caseRoot.get(Case.WAS_IN_QUARANTINE_BEFORE_ISOLATION),
110+
caseRoot.get(Case.QUARANTINE_REASON_BEFORE_ISOLATION),
111+
caseRoot.get(Case.QUARANTINE_REASON_BEFORE_ISOLATION_DETAILS),
112+
100113
caseRoot.get(Case.QUARANTINE),
101114
caseRoot.get(Case.QUARANTINE_TYPE_DETAILS),
102-
caseRoot.get(Case.FOLLOW_UP_UNTIL),
115+
caseRoot.get(Case.QUARANTINE_FROM),
103116
caseRoot.get(Case.QUARANTINE_TO),
104117
caseRoot.get(Case.END_OF_ISOLATION_REASON),
105118
caseRoot.get(Case.END_OF_ISOLATION_REASON_DETAILS));
@@ -151,20 +164,26 @@ public List<BAGExportCaseDto> getCaseExportList(int first, int max) {
151164
List<Location> addresses = personAddresses.getOrDefault(caze.getPersonId(), Collections.emptyList());
152165

153166
addresses.stream().filter(a -> PersonAddressType.PLACE_OF_WORK.equals(a.getAddressType())).findFirst().ifPresent(workAddress -> {
167+
caze.setWorkPlaceName(TODO_VALUE);
154168
caze.setWorkPlaceStreet(workAddress.getStreet());
155169
caze.setWorkPlaceStreetNumber(workAddress.getHouseNumber());
156-
caze.setWorkPlaceLocation(workAddress.getCity());
170+
caze.setWorkPlaceCity(workAddress.getCity());
157171
caze.setWorkPlacePostalCode(workAddress.getPostalCode());
172+
caze.setWorkPlaceCountry(TODO_VALUE);
158173
});
159174

160-
caze.setInfectionLocationYn(YesNoUnknown.NO);
175+
caze.setExposureLocationYn(YesNoUnknown.NO);
161176
addresses.stream().filter(a -> PersonAddressType.PLACE_OF_EXPOSURE.equals(a.getAddressType())).findFirst().ifPresent(exposureAddress -> {
162-
caze.setInfectionLocationYn(YesNoUnknown.YES);
163-
164-
caze.setInfectionLocationStreet(exposureAddress.getStreet());
165-
caze.setInfectionLocationStreetNumber(exposureAddress.getHouseNumber());
166-
caze.setInfectionLocationCity(exposureAddress.getCity());
167-
caze.setInfectionLocationPostalCode(exposureAddress.getPostalCode());
177+
caze.setExposureLocationYn(YesNoUnknown.YES);
178+
caze.setExposureCountry(TODO_VALUE);
179+
caze.setExposureLocationType(exposureAddress.getFacilityType());
180+
caze.setExposureLocationFlightDetail(exposureAddress.getFacilityDetails());
181+
caze.setExposureLocationName(TODO_VALUE);
182+
caze.setExposureLocationStreet(exposureAddress.getStreet());
183+
caze.setExposureLocationStreetNumber(exposureAddress.getHouseNumber());
184+
caze.setExposureLocationCity(exposureAddress.getCity());
185+
caze.setExposureLocationPostalCode(exposureAddress.getPostalCode());
186+
caze.setExposureLocationFlightDetail(TODO_VALUE);
168187
});
169188

170189
addresses.stream()
@@ -175,6 +194,7 @@ public List<BAGExportCaseDto> getCaseExportList(int first, int max) {
175194
caze.setIsolationLocationStreetNumber(isolationAddress.getHouseNumber());
176195
caze.setIsolationLocationCity(isolationAddress.getCity());
177196
caze.setIsolationLocationPostalCode(isolationAddress.getPostalCode());
197+
caze.setIsolationLocationCountry(TODO_VALUE);
178198
});
179199

180200
List<Sample> caseSamples = samples.get(caze.getCaseId());
@@ -208,8 +228,10 @@ public List<BAGExportContactDto> getContactExportList(int first, int max) {
208228

209229
Join<Contact, Person> person = contactJoins.getPerson();
210230
Join<Person, Location> homeAddress = contactJoins.getPersonAddress();
231+
Join<Contact, Case> caze = contactJoins.getCaze();
211232

212233
Expression<String> mobileNumber = cb.literal(TODO_VALUE);
234+
Expression<Date> caseLinkContactDate = cb.nullLiteral(Date.class);
213235

214236
cq.multiselect(
215237
contactRoot.get(Contact.ID),
@@ -222,15 +244,17 @@ public List<BAGExportContactDto> getContactExportList(int first, int max) {
222244
homeAddress.get(Location.POSTAL_CODE),
223245
person.get(Person.PHONE),
224246
mobileNumber,
225-
person.get(Person.EMAIL_ADDRESS),
226247
person.get(Person.SEX),
227248
person.get(Person.BIRTHDATE_DD),
228249
person.get(Person.BIRTHDATE_MM),
229250
person.get(Person.BIRTHDATE_YYYY),
230251
person.get(Person.OCCUPATION_TYPE),
231252
contactRoot.get(Contact.QUARANTINE),
232253
contactRoot.get(Contact.QUARANTINE_TYPE_DETAILS),
233-
contactRoot.get(Contact.FOLLOW_UP_UNTIL),
254+
caze.get(Case.CASE_ID_ISM),
255+
caze.get(Case.ID),
256+
caseLinkContactDate,
257+
contactRoot.get(Contact.QUARANTINE_FROM),
234258
contactRoot.get(Contact.QUARANTINE_TO),
235259
contactRoot.get(Contact.END_OF_QUARANTINE_REASON),
236260
contactRoot.get(Contact.END_OF_QUARANTINE_REASON_DETAILS));
@@ -282,32 +306,24 @@ public List<BAGExportContactDto> getContactExportList(int first, int max) {
282306
List<Location> addresses = personAddresses.getOrDefault(contact.getPersonId(), Collections.emptyList());
283307

284308
addresses.stream().filter(a -> PersonAddressType.PLACE_OF_WORK.equals(a.getAddressType())).findFirst().ifPresent(workAddress -> {
285-
contact.setWorkPlaceStreet(workAddress.getStreet());
286-
contact.setWorkPlaceStreetNumber(workAddress.getHouseNumber());
287-
contact.setWorkPlaceLocation(workAddress.getCity());
309+
contact.setWorkPlaceName(TODO_VALUE);
288310
contact.setWorkPlacePostalCode(workAddress.getPostalCode());
311+
contact.setWorkPlaceName(TODO_VALUE);
289312
});
290313

291-
contact.setExposureLocationYn(YesNoUnknown.NO);
292314
addresses.stream().filter(a -> PersonAddressType.PLACE_OF_EXPOSURE.equals(a.getAddressType())).findFirst().ifPresent(exposureAddress -> {
293-
contact.setExposureLocationYn(YesNoUnknown.YES);
294-
315+
contact.setExposureLocationCountry(TODO_VALUE);
316+
contact.setExposureLocationType(exposureAddress.getFacilityType());
317+
contact.setExposureLocationTypeDetails(exposureAddress.getFacilityDetails());
318+
contact.setExposureLocationName(TODO_VALUE);
319+
contact.setOtherExposureLocation(exposureAddress.getFacilityDetails());
295320
contact.setExposureLocationStreet(exposureAddress.getStreet());
296321
contact.setExposureLocationStreetNumber(exposureAddress.getHouseNumber());
297322
contact.setExposureLocationCity(exposureAddress.getCity());
298323
contact.setExposureLocationPostalCode(exposureAddress.getPostalCode());
324+
contact.setExposureLocationFlightDetail(TODO_VALUE);
299325
});
300326

301-
addresses.stream()
302-
.filter(a -> PersonAddressType.PLACE_OF_ISOLATION.equals(a.getAddressType()))
303-
.findFirst()
304-
.ifPresent(isolationAddress -> {
305-
contact.setQuarantineLocationStreet(isolationAddress.getStreet());
306-
contact.setQuarantineLocationStreetNumber(isolationAddress.getHouseNumber());
307-
contact.setQuarantineLocationCity(isolationAddress.getCity());
308-
contact.setQuarantineLocationPostalCode(isolationAddress.getPostalCode());
309-
});
310-
311327
List<Sample> contactSamples = samples.get(contact.getContactId());
312328
if (contactSamples != null && contactSamples.size() > 0) {
313329
Sample firstSample = contactSamples.get(0);
@@ -336,7 +352,6 @@ private void setCasePathogenTestData(BAGExportCaseDto caze, PathogenTest test) {
336352
}
337353

338354
private void setContactPathogenTestData(BAGExportContactDto contact, PathogenTest test) {
339-
contact.setLabReportDate(test.getTestDateTime());
340355
contact.setTestType(test.getTestType());
341356
contact.setTestResult(test.getTestResult());
342357
}

sormas-backend/src/main/java/de/symeda/sormas/backend/caze/CaseFacadeEjb.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -228,8 +228,8 @@
228228
import de.symeda.sormas.backend.sample.SampleFacadeEjb;
229229
import de.symeda.sormas.backend.sample.SampleFacadeEjb.SampleFacadeEjbLocal;
230230
import de.symeda.sormas.backend.sample.SampleService;
231-
import de.symeda.sormas.backend.sormastosormas.SormasToSormasFacadeEjb;
232-
import de.symeda.sormas.backend.sormastosormas.SormasToSormasFacadeEjb.SormasToSormasFacadeEjbLocal;
231+
import de.symeda.sormas.backend.sormastosormas.SormasToSormasOriginInfoFacadeEjb;
232+
import de.symeda.sormas.backend.sormastosormas.SormasToSormasOriginInfoFacadeEjb.SormasToSormasOriginInfoFacadeEjbLocal;
233233
import de.symeda.sormas.backend.sormastosormas.SormasToSormasShareInfo;
234234
import de.symeda.sormas.backend.symptoms.Symptoms;
235235
import de.symeda.sormas.backend.symptoms.SymptomsFacadeEjb;
@@ -362,7 +362,7 @@ public class CaseFacadeEjb implements CaseFacade {
362362
@EJB
363363
private CaseJurisdictionChecker caseJurisdictionChecker;
364364
@EJB
365-
private SormasToSormasFacadeEjbLocal sormasToSormasFacade;
365+
private SormasToSormasOriginInfoFacadeEjbLocal originInfoFacade;
366366

367367
@Override
368368
public List<CaseDataDto> getAllActiveCasesAfter(Date date) {
@@ -2097,7 +2097,7 @@ public Case fillOrBuildEntity(@NotNull CaseDataDto source, Case target) {
20972097
target.setTrimester(source.getTrimester());
20982098
target.setFacilityType(source.getFacilityType());
20992099
if (source.getSormasToSormasOriginInfo() != null) {
2100-
target.setSormasToSormasOriginInfo(sormasToSormasFacade.fromSormasToSormasOriginInfoDto(source.getSormasToSormasOriginInfo()));
2100+
target.setSormasToSormasOriginInfo(originInfoFacade.toDto(source.getSormasToSormasOriginInfo()));
21012101
}
21022102

21032103
// TODO this makes sure follow-up is not overriden from the mobile app side. remove once that is implemented
@@ -2361,7 +2361,7 @@ public static CaseDataDto toDto(Case source) {
23612361
target.setEndOfIsolationReason(source.getEndOfIsolationReason());
23622362
target.setEndOfIsolationReasonDetails(source.getEndOfIsolationReasonDetails());
23632363

2364-
target.setSormasToSormasOriginInfo(SormasToSormasFacadeEjb.toSormasToSormasOriginInfoDto(source.getSormasToSormasOriginInfo()));
2364+
target.setSormasToSormasOriginInfo(SormasToSormasOriginInfoFacadeEjb.toDto(source.getSormasToSormasOriginInfo()));
23652365
target.setOwnershipHandedOver(source.getSormasToSormasShares().stream().anyMatch(SormasToSormasShareInfo::isOwnershipHandedOver));
23662366

23672367
return target;

0 commit comments

Comments
 (0)