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

Commit a8139f9

Browse files
author
vlad-ciucescu
authored
Merge pull request SORMAS-Foundation#3474 from hzi-braunschweig/feat-3291-export-email
SORMAS-Foundation#3291 add email to case, contact, event participant detailed & custom exports
2 parents 365cfec + ecda677 commit a8139f9

8 files changed

Lines changed: 62 additions & 15 deletions

File tree

sormas-api/src/main/java/de/symeda/sormas/api/caze/CaseExportDto.java

Lines changed: 23 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -181,6 +181,8 @@ public class CaseExportDto implements Serializable {
181181
private String facility;
182182
@SensitiveData
183183
private String phone;
184+
@SensitiveData
185+
private String emailAddress;
184186
private String occupationType;
185187
private String educationType;
186188
private String travelHistory;
@@ -258,7 +260,7 @@ public CaseExportDto(long id, long personId, long personAddressId, long epiDataI
258260
Date deathDate, Date burialDate, BurialConductor burialConductor, String burialPlaceDescription,
259261
String addressRegion, String addressDistrict, String addressCommunity, String city, String street, String houseNumber, String additionalInformation, String postalCode,
260262
String facility, String facilityUuid, String facilityDetails,
261-
String phone, String phoneOwner, EducationType educationType, String educationDetails,
263+
String phone, String phoneOwner, String emailAddress, EducationType educationType, String educationDetails,
262264
OccupationType occupationType, String occupationDetails, YesNoUnknown traveled,
263265
YesNoUnknown burialAttended, YesNoUnknown directContactConfirmedCase, YesNoUnknown directContactProbableCase, YesNoUnknown contactWithRodent,
264266
//Date onsetDate,
@@ -324,6 +326,7 @@ public CaseExportDto(long id, long personId, long personAddressId, long epiDataI
324326
this.postalCode = postalCode;
325327
this.facility = FacilityHelper.buildFacilityString(facilityUuid, facility, facilityDetails);
326328
this.phone = PersonHelper.buildPhoneString(phone, phoneOwner);
329+
this.emailAddress = emailAddress;
327330
this.educationType = PersonHelper.buildEducationString(educationType, educationDetails);
328331
this.occupationType = PersonHelper.buildOccupationString(occupationType, occupationDetails);
329332
this.traveled = traveled;
@@ -973,6 +976,16 @@ public String getPhone() {
973976
}
974977

975978
@Order(75)
979+
@ExportTarget(caseExportTypes = {
980+
CaseExportType.CASE_SURVEILLANCE,
981+
CaseExportType.CASE_MANAGEMENT })
982+
@ExportProperty(PersonDto.EMAIL_ADDRESS)
983+
@ExportGroup(ExportGroupType.SENSITIVE)
984+
public String getEmailAddress() {
985+
return emailAddress;
986+
}
987+
988+
@Order(76)
976989
@ExportTarget(caseExportTypes = {
977990
CaseExportType.CASE_SURVEILLANCE,
978991
CaseExportType.CASE_MANAGEMENT })
@@ -986,7 +999,7 @@ public void setEducationType(String educationType) {
986999
this.educationType = educationType;
9871000
}
9881001

989-
@Order(76)
1002+
@Order(77)
9901003
@ExportTarget(caseExportTypes = {
9911004
CaseExportType.CASE_SURVEILLANCE,
9921005
CaseExportType.CASE_MANAGEMENT })
@@ -996,7 +1009,7 @@ public String getOccupationType() {
9961009
return occupationType;
9971010
}
9981011

999-
@Order(77)
1012+
@Order(78)
10001013
@ExportTarget(caseExportTypes = {
10011014
CaseExportType.CASE_SURVEILLANCE })
10021015
@ExportProperty(TRAVELED)
@@ -1009,7 +1022,7 @@ public void setTraveled(YesNoUnknown traveled) {
10091022
this.traveled = traveled;
10101023
}
10111024

1012-
@Order(78)
1025+
@Order(79)
10131026
@ExportTarget(caseExportTypes = {
10141027
CaseExportType.CASE_SURVEILLANCE })
10151028
@ExportProperty(TRAVEL_HISTORY)
@@ -1018,7 +1031,7 @@ public String getTravelHistory() {
10181031
return travelHistory;
10191032
}
10201033

1021-
@Order(79)
1034+
@Order(80)
10221035
@ExportTarget(caseExportTypes = {
10231036
CaseExportType.CASE_SURVEILLANCE })
10241037
@ExportProperty(EpiDataDto.BURIAL_ATTENDED)
@@ -1031,7 +1044,7 @@ public void setBurialAttended(YesNoUnknown burialAttended) {
10311044
this.burialAttended = burialAttended;
10321045
}
10331046

1034-
@Order(80)
1047+
@Order(81)
10351048
@ExportTarget(caseExportTypes = {
10361049
CaseExportType.CASE_SURVEILLANCE })
10371050
@ExportProperty(EpiDataDto.DIRECT_CONTACT_CONFIRMED_CASE)
@@ -1497,6 +1510,10 @@ public void setPhone(String phone) {
14971510
this.phone = phone;
14981511
}
14991512

1513+
public void setEmailAddress(String emailAddress) {
1514+
this.emailAddress = emailAddress;
1515+
}
1516+
15001517
public void setOccupationType(String occupationType) {
15011518
this.occupationType = occupationType;
15021519
}

sormas-api/src/main/java/de/symeda/sormas/api/contact/ContactExportDto.java

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,8 @@ public class ContactExportDto implements Serializable {
101101
private String facility;
102102
@SensitiveData
103103
private String phone;
104+
@SensitiveData
105+
private String emailAddress;
104106
private String occupationType;
105107
private int numberOfVisits;
106108
private YesNoUnknown lastCooperativeVisitSymptomatic;
@@ -154,7 +156,7 @@ public ContactExportDto(long id, long personId, String uuid, String sourceCaseUu
154156
PresentCondition presentCondition, Date deathDate,
155157
String addressRegion, String addressDistrict, String addressCommunity, String city, String street, String houseNumber, String additionalInformation, String postalCode,
156158
String facility, String facilityUuid, String facilityDetails,
157-
String phone, String phoneOwner, OccupationType occupationType, String occupationDetails,
159+
String phone, String phoneOwner, String emailAddress, OccupationType occupationType, String occupationDetails,
158160
String region, String district, String community,
159161
long epiDataId, YesNoUnknown traveled, YesNoUnknown burialAttended, YesNoUnknown directContactConfirmedCase, YesNoUnknown directContactProbableCase,
160162
YesNoUnknown contactWithRodent, YesNoUnknown returningTraveler, long eventCount, String externalID,
@@ -211,6 +213,7 @@ public ContactExportDto(long id, long personId, String uuid, String sourceCaseUu
211213
this.postalCode = postalCode;
212214
this.facility = FacilityHelper.buildFacilityString(facilityUuid, facility, facilityDetails);
213215
this.phone = PersonHelper.buildPhoneString(phone, phoneOwner);
216+
this.emailAddress = emailAddress;
214217
this.occupationType = PersonHelper.buildOccupationString(occupationType, occupationDetails);
215218
this.region = region;
216219
this.district = district;
@@ -520,6 +523,11 @@ public String getPhone() {
520523
return phone;
521524
}
522525

526+
@Order(53)
527+
public String getEmailAddress() {
528+
return emailAddress;
529+
}
530+
523531
@Order(60)
524532
public String getOccupationType() {
525533
return occupationType;
@@ -731,6 +739,10 @@ public void setPhone(String phone) {
731739
this.phone = phone;
732740
}
733741

742+
public void setEmailAddress(String emailAddress) {
743+
this.emailAddress = emailAddress;
744+
}
745+
734746
public void setOccupationType(String occupationType) {
735747
this.occupationType = occupationType;
736748
}

sormas-api/src/main/java/de/symeda/sormas/api/event/EventParticipantExportDto.java

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,8 @@ public class EventParticipantExportDto implements Serializable {
132132
private String addressGpsCoordinates;
133133
@SensitiveData
134134
private String phone;
135+
@SensitiveData
136+
private String emailAddress;
135137

136138
private String caseUuid;
137139

@@ -140,14 +142,14 @@ public class EventParticipantExportDto implements Serializable {
140142
private EventParticipantJurisdictionDto jurisdiction;
141143

142144
//@formatter:off
143-
public EventParticipantExportDto(long id, long personId, String personUuid, String eventParticipantUuid, String personNationalHealthId, long personAddressId, String reportingUserUuid, String eventUuid,
144-
145+
public EventParticipantExportDto(long id, long personId, String personUuid, String eventParticipantUuid, String personNationalHealthId, long personAddressId, String reportingUserUuid, String eventUuid,
146+
145147
EventStatus eventStatus, EventInvestigationStatus eventInvestigationStatus, Disease eventDisease, TypeOfPlace typeOfPlace, Date eventStartDate, Date eventEndDate, String eventTitle, String eventDesc,
146148
String eventRegion, String eventDistrict, String eventCommunity, String eventCity, String eventStreet, String eventHouseNumber,
147-
String firstName, String lastName, Sex sex, String involvmentDescription, Integer approximateAge, ApproximateAgeType approximateAgeType,
148-
Integer birthdateDD, Integer birthdateMM, Integer birthdateYYYY, PresentCondition presentCondition, Date deathDate, Date burialDate,
149+
String firstName, String lastName, Sex sex, String involvmentDescription, Integer approximateAge, ApproximateAgeType approximateAgeType,
150+
Integer birthdateDD, Integer birthdateMM, Integer birthdateYYYY, PresentCondition presentCondition, Date deathDate, Date burialDate,
149151
BurialConductor burialConductor, String burialPlaceDescription, String addressRegion, String addressDistrict, String addressCommunity, String city, String street, String houseNumber,
150-
String additionalInformation, String postalCode, String phone, String caseUuid) {
152+
String additionalInformation, String postalCode, String phone, String emailAddress, String caseUuid) {
151153
//@formatter:on
152154

153155
this.id = id;
@@ -192,6 +194,7 @@ public EventParticipantExportDto(long id, long personId, String personUuid, Stri
192194
this.additionalInformation = additionalInformation;
193195
this.postalCode = postalCode;
194196
this.phone = phone;
197+
this.emailAddress = emailAddress;
195198
this.caseUuid = caseUuid;
196199

197200
jurisdiction = new EventParticipantJurisdictionDto(reportingUserUuid);
@@ -323,6 +326,11 @@ public String getPhone() {
323326
return phone;
324327
}
325328

329+
@Order(41)
330+
public String getEmailAddress() {
331+
return emailAddress;
332+
}
333+
326334
@Order(42)
327335
@ExportProperty(EventParticipantExportDto.SAMPLE_INFORMATION)
328336
public String getOtherSamplesString() {
@@ -536,6 +544,10 @@ public void setPhone(String phone) {
536544
this.phone = phone;
537545
}
538546

547+
public void setEmailAddress(String emailAddress) {
548+
this.emailAddress = emailAddress;
549+
}
550+
539551
public void setCaseUuid(String caseUuid) {
540552
this.caseUuid = caseUuid;
541553
}

sormas-api/src/main/java/de/symeda/sormas/api/importexport/ImportExportUtils.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,11 @@
2626
import java.util.List;
2727
import java.util.Set;
2828

29+
import org.apache.commons.lang3.CharUtils;
30+
2931
import de.symeda.sormas.api.caze.CaseExportDto;
3032
import de.symeda.sormas.api.utils.DataHelper.Pair;
3133
import de.symeda.sormas.api.utils.Order;
32-
import org.apache.commons.lang3.CharUtils;
3334

3435
public final class ImportExportUtils {
3536

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -567,7 +567,9 @@ public List<CaseExportDto> getExportList(
567567
joins.getPersonAddressFacility().get(Facility.UUID),
568568
joins.getPersonAddress().get(Location.FACILITY_DETAILS),
569569
// phone
570-
joins.getPerson().get(Person.PHONE), joins.getPerson().get(Person.PHONE_OWNER), joins.getPerson().get(Person.EDUCATION_TYPE),
570+
joins.getPerson().get(Person.PHONE), joins.getPerson().get(Person.PHONE_OWNER),
571+
joins.getPerson().get(Person.EMAIL_ADDRESS),
572+
joins.getPerson().get(Person.EDUCATION_TYPE),
571573
joins.getPerson().get(Person.EDUCATION_DETAILS), joins.getPerson().get(Person.OCCUPATION_TYPE),
572574
joins.getPerson().get(Person.OCCUPATION_DETAILS), joins.getEpiData().get(EpiData.TRAVELED), joins.getEpiData().get(EpiData.BURIAL_ATTENDED),
573575
joins.getEpiData().get(EpiData.DIRECT_CONTACT_CONFIRMED_CASE), joins.getEpiData().get(EpiData.DIRECT_CONTACT_PROBABLE_CASE),

sormas-backend/src/main/java/de/symeda/sormas/backend/contact/ContactFacadeEjb.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -483,6 +483,7 @@ public List<ContactExportDto> getExportList(ContactCriteria contactCriteria, int
483483
joins.getAddress().get(Location.FACILITY_DETAILS),
484484
joins.getPerson().get(Person.PHONE),
485485
joins.getPerson().get(Person.PHONE_OWNER),
486+
joins.getPerson().get(Person.EMAIL_ADDRESS),
486487
joins.getPerson().get(Person.OCCUPATION_TYPE),
487488
joins.getPerson().get(Person.OCCUPATION_DETAILS),
488489
joins.getRegion().get(Region.NAME),

sormas-backend/src/main/java/de/symeda/sormas/backend/event/EventParticipantFacadeEjb.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -359,6 +359,7 @@ public List<EventParticipantExportDto> getExportList(
359359
address.get(Location.ADDITIONAL_INFORMATION),
360360
address.get(Location.POSTAL_CODE),
361361
person.get(Person.PHONE),
362+
person.get(Person.EMAIL_ADDRESS),
362363

363364
resultingCase.get(Case.UUID));
364365

sormas-ui/src/main/java/de/symeda/sormas/ui/caze/CasesView.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
import java.util.function.Supplier;
2626
import java.util.stream.Collectors;
2727

28+
import de.symeda.sormas.api.utils.DataHelper;
2829
import org.vaadin.hene.popupbutton.PopupButton;
2930

3031
import com.vaadin.icons.VaadinIcons;
@@ -216,7 +217,7 @@ private ExportConfigurationDto buildDetailedExportConfiguration() {
216217
res.setProperties(
217218
ImportExportUtils.getCaseExportProperties(caseFollowUpEnabled, UserProvider.getCurrent().hasUserRight(UserRight.CASE_MANAGEMENT_ACCESS))
218219
.stream()
219-
.map(p -> p.getElement0())
220+
.map(DataHelper.Pair::getElement0)
220221
.collect(Collectors.toSet()));
221222
return res;
222223
}

0 commit comments

Comments
 (0)