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

Commit 793b0fa

Browse files
Merge pull request SORMAS-Foundation#3604 from hzi-braunschweig/3411_person-salutation
SORMAS-Foundation#3411 add salutation to person
2 parents 99ac096 + 8b409c0 commit 793b0fa

25 files changed

Lines changed: 276 additions & 21 deletions

File tree

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

Lines changed: 23 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -49,9 +49,11 @@
4949
import de.symeda.sormas.api.person.PersonDto;
5050
import de.symeda.sormas.api.person.PersonHelper;
5151
import de.symeda.sormas.api.person.PresentCondition;
52+
import de.symeda.sormas.api.person.Salutation;
5253
import de.symeda.sormas.api.person.Sex;
5354
import de.symeda.sormas.api.sample.PathogenTestResultType;
5455
import de.symeda.sormas.api.symptoms.SymptomsDto;
56+
import de.symeda.sormas.api.utils.EnumHelper;
5557
import de.symeda.sormas.api.utils.HideForCountriesExcept;
5658
import de.symeda.sormas.api.utils.Order;
5759
import de.symeda.sormas.api.utils.PersonalData;
@@ -123,6 +125,8 @@ public class CaseExportDto implements Serializable {
123125
@PersonalData
124126
@SensitiveData
125127
private String lastName;
128+
@SensitiveData
129+
private String salutation;
126130
private Sex sex;
127131
private YesNoUnknown pregnant;
128132
private String approximateAge;
@@ -247,7 +251,7 @@ public class CaseExportDto implements Serializable {
247251
//@formatter:off
248252
public CaseExportDto(long id, long personId, long personAddressId, long epiDataId, long symptomsId,
249253
long hospitalizationId, long districtId, long healthConditionsId, String uuid, String epidNumber,
250-
Disease disease, String diseaseDetails, String firstName, String lastName, Sex sex, YesNoUnknown pregnant,
254+
Disease disease, String diseaseDetails, String firstName, String lastName, Salutation salutation, String otherSalutation, Sex sex, YesNoUnknown pregnant,
251255
Integer approximateAge, ApproximateAgeType approximateAgeType, Integer birthdateDD, Integer birthdateMM,
252256
Integer birthdateYYYY, Date reportDate, String reportingUserUuid, String regionUuid, String region,
253257
String districtUuid, String district, String communityUuid, String community,
@@ -288,6 +292,7 @@ public CaseExportDto(long id, long personId, long personAddressId, long epiDataI
288292
this.disease = disease;
289293
this.firstName = firstName;
290294
this.lastName = lastName;
295+
this.salutation = EnumHelper.toString(salutation, otherSalutation, Salutation.OTHER);
291296
this.sex = sex;
292297
this.pregnant = pregnant;
293298
this.approximateAge = ApproximateAgeHelper.formatApproximateAge(approximateAge, approximateAgeType);
@@ -465,6 +470,17 @@ public String getLastName() {
465470
}
466471

467472
@Order(12)
473+
@ExportTarget(caseExportTypes = {
474+
CaseExportType.CASE_SURVEILLANCE,
475+
CaseExportType.CASE_MANAGEMENT })
476+
@ExportProperty(PersonDto.SALUTATION)
477+
@ExportGroup(ExportGroupType.SENSITIVE)
478+
@HideForCountriesExcept
479+
public String getSalutation() {
480+
return salutation;
481+
}
482+
483+
@Order(13)
468484
@ExportTarget(caseExportTypes = {
469485
CaseExportType.CASE_SURVEILLANCE,
470486
CaseExportType.CASE_MANAGEMENT })
@@ -474,7 +490,7 @@ public Sex getSex() {
474490
return sex;
475491
}
476492

477-
@Order(13)
493+
@Order(14)
478494
@ExportTarget(caseExportTypes = {
479495
CaseExportType.CASE_SURVEILLANCE,
480496
CaseExportType.CASE_MANAGEMENT })
@@ -484,7 +500,7 @@ public YesNoUnknown getPregnant() {
484500
return pregnant;
485501
}
486502

487-
@Order(14)
503+
@Order(15)
488504
@ExportTarget(caseExportTypes = {
489505
CaseExportType.CASE_SURVEILLANCE,
490506
CaseExportType.CASE_MANAGEMENT })
@@ -494,7 +510,7 @@ public Trimester getTrimester() {
494510
return trimester;
495511
}
496512

497-
@Order(15)
513+
@Order(16)
498514
@ExportTarget(caseExportTypes = {
499515
CaseExportType.CASE_SURVEILLANCE,
500516
CaseExportType.CASE_MANAGEMENT })
@@ -504,7 +520,7 @@ public YesNoUnknown getPostpartum() {
504520
return postpartum;
505521
}
506522

507-
@Order(16)
523+
@Order(17)
508524
@ExportTarget(caseExportTypes = {
509525
CaseExportType.CASE_SURVEILLANCE,
510526
CaseExportType.CASE_MANAGEMENT })
@@ -514,7 +530,7 @@ public String getApproximateAge() {
514530
return approximateAge;
515531
}
516532

517-
@Order(17)
533+
@Order(18)
518534
@ExportTarget(caseExportTypes = {
519535
CaseExportType.CASE_SURVEILLANCE,
520536
CaseExportType.CASE_MANAGEMENT })
@@ -524,7 +540,7 @@ public String getAgeGroup() {
524540
return ageGroup;
525541
}
526542

527-
@Order(18)
543+
@Order(19)
528544
@ExportTarget(caseExportTypes = {
529545
CaseExportType.CASE_SURVEILLANCE,
530546
CaseExportType.CASE_MANAGEMENT })

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

Lines changed: 19 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,9 @@
3232
import de.symeda.sormas.api.person.OccupationType;
3333
import de.symeda.sormas.api.person.PersonHelper;
3434
import de.symeda.sormas.api.person.PresentCondition;
35+
import de.symeda.sormas.api.person.Salutation;
3536
import de.symeda.sormas.api.person.Sex;
37+
import de.symeda.sormas.api.utils.EnumHelper;
3638
import de.symeda.sormas.api.utils.HideForCountriesExcept;
3739
import de.symeda.sormas.api.utils.Order;
3840
import de.symeda.sormas.api.utils.PersonalData;
@@ -60,6 +62,8 @@ public class ContactExportDto implements Serializable {
6062
private String firstName;
6163
@PersonalData
6264
private String lastName;
65+
@SensitiveData
66+
private String salutation;
6367
private Sex sex;
6468
private BirthDateDto birthdate;
6569
private String approximateAge;
@@ -145,7 +149,8 @@ public class ContactExportDto implements Serializable {
145149

146150
//@formatter:off
147151
public ContactExportDto(long id, long personId, String uuid, String sourceCaseUuid, CaseClassification caseClassification, Disease disease, String diseaseDetails,
148-
ContactClassification contactClassification, Date lastContactDate, String firstName, String lastName, Sex sex,
152+
ContactClassification contactClassification, Date lastContactDate, String firstName, String lastName,
153+
Salutation salutation, String otherSalutation, Sex sex,
149154
Integer birthdateDD, Integer birthdateMM, Integer birthdateYYYY,
150155
Integer approximateAge, ApproximateAgeType approximateAgeType, Date reportDate, ContactIdentificationSource contactIdentificationSource,
151156
String contactIdentificationSourceDetails, TracingApp tracingApp, String tracingAppDetails, ContactProximity contactProximity,
@@ -175,6 +180,7 @@ public ContactExportDto(long id, long personId, String uuid, String sourceCaseUu
175180
this.lastContactDate = lastContactDate;
176181
this.firstName = firstName;
177182
this.lastName = lastName;
183+
this.salutation = EnumHelper.toString(salutation, otherSalutation, Salutation.OTHER);
178184
this.sex = sex;
179185
this.birthdate = new BirthDateDto(birthdateDD, birthdateMM, birthdateYYYY);
180186
this.approximateAge = ApproximateAgeHelper.formatApproximateAge(approximateAge, approximateAgeType);
@@ -301,36 +307,42 @@ public String getLastName() {
301307
}
302308

303309
@Order(12)
310+
@HideForCountriesExcept
311+
public String getSalutation() {
312+
return salutation;
313+
}
314+
315+
@Order(13)
304316
public Sex getSex() {
305317
return sex;
306318
}
307319

308-
@Order(13)
320+
@Order(14)
309321
public BirthDateDto getBirthdate() {
310322
return birthdate;
311323
}
312324

313-
@Order(14)
325+
@Order(15)
314326
public String getApproximateAge() {
315327
return approximateAge;
316328
}
317329

318-
@Order(15)
330+
@Order(16)
319331
public Date getReportDate() {
320332
return reportDate;
321333
}
322334

323-
@Order(16)
335+
@Order(17)
324336
public String getRegion() {
325337
return region;
326338
}
327339

328-
@Order(17)
340+
@Order(18)
329341
public String getDistrict() {
330342
return district;
331343
}
332344

333-
@Order(18)
345+
@Order(19)
334346
public String getCommunity() {
335347
return community;
336348
}

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

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,10 @@
3333
import de.symeda.sormas.api.person.ApproximateAgeType;
3434
import de.symeda.sormas.api.person.BurialConductor;
3535
import de.symeda.sormas.api.person.PresentCondition;
36+
import de.symeda.sormas.api.person.Salutation;
3637
import de.symeda.sormas.api.person.Sex;
38+
import de.symeda.sormas.api.utils.EnumHelper;
39+
import de.symeda.sormas.api.utils.HideForCountriesExcept;
3740
import de.symeda.sormas.api.utils.Order;
3841
import de.symeda.sormas.api.utils.PersonalData;
3942
import de.symeda.sormas.api.utils.SensitiveData;
@@ -100,6 +103,8 @@ public class EventParticipantExportDto implements Serializable {
100103
@PersonalData
101104
@SensitiveData
102105
private String lastName;
106+
@SensitiveData
107+
private String salutation;
103108
private Sex sex;
104109
private String approximateAge;
105110
private String ageGroup;
@@ -149,7 +154,7 @@ public EventParticipantExportDto(long id, long personId, String personUuid, Stri
149154

150155
EventStatus eventStatus, EventInvestigationStatus eventInvestigationStatus, Disease eventDisease, TypeOfPlace typeOfPlace, Date eventStartDate, Date eventEndDate, String eventTitle, String eventDesc,
151156
String eventRegion, String eventDistrict, String eventCommunity, String eventCity, String eventStreet, String eventHouseNumber,
152-
String firstName, String lastName, Sex sex, String involvmentDescription, Integer approximateAge, ApproximateAgeType approximateAgeType,
157+
String firstName, String lastName, Salutation salutation, String otherSalutation, Sex sex, String involvmentDescription, Integer approximateAge, ApproximateAgeType approximateAgeType,
153158
Integer birthdateDD, Integer birthdateMM, Integer birthdateYYYY, PresentCondition presentCondition, Date deathDate, Date burialDate,
154159
BurialConductor burialConductor, String burialPlaceDescription, String addressRegion, String addressDistrict, String addressCommunity, String city, String street, String houseNumber,
155160
String additionalInformation, String postalCode, String phone, String emailAddress, String caseUuid) {
@@ -180,6 +185,7 @@ public EventParticipantExportDto(long id, long personId, String personUuid, Stri
180185

181186
this.firstName = firstName;
182187
this.lastName = lastName;
188+
this.salutation = EnumHelper.toString(salutation, otherSalutation, Salutation.OTHER);
183189
this.sex = sex;
184190
this.involvmentDescription = involvmentDescription;
185191
this.approximateAge = ApproximateAgeType.ApproximateAgeHelper.formatApproximateAge(approximateAge, approximateAgeType);
@@ -240,6 +246,12 @@ public String getLastName() {
240246
}
241247

242248
@Order(15)
249+
@HideForCountriesExcept
250+
public String getSalutation() {
251+
return salutation;
252+
}
253+
254+
@Order(16)
243255
public Sex getSex() {
244256
return sex;
245257
}

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1195,6 +1195,7 @@ public interface Captions {
11951195
String Person_occupationRegion = "Person.occupationRegion";
11961196
String Person_occupationType = "Person.occupationType";
11971197
String Person_other_occupationDetails = "Person.other.occupationDetails";
1198+
String Person_otherSalutation = "Person.otherSalutation";
11981199
String Person_passportNumber = "Person.passportNumber";
11991200
String Person_phone = "Person.phone";
12001201
String Person_phoneOwner = "Person.phoneOwner";
@@ -1205,6 +1206,7 @@ public interface Captions {
12051206
String Person_placeOfBirthFacilityType = "Person.placeOfBirthFacilityType";
12061207
String Person_placeOfBirthRegion = "Person.placeOfBirthRegion";
12071208
String Person_presentCondition = "Person.presentCondition";
1209+
String Person_salutation = "Person.salutation";
12081210
String Person_sex = "Person.sex";
12091211
String Person_symptomJournalStatus = "Person.symptomJournalStatus";
12101212
String Person_transporter_occupationDetails = "Person.transporter.occupationDetails";

sormas-api/src/main/java/de/symeda/sormas/api/person/PersonDto.java

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,9 @@ public class PersonDto extends PseudonymizableDto {
5151
public static final String FIRST_NAME = "firstName";
5252
public static final String LAST_NAME = "lastName";
5353

54+
public static final String SALUTATION = "salutation";
55+
public static final String OTHER_SALUTATION = "otherSalutation";
56+
5457
public static final String PRESENT_CONDITION = "presentCondition";
5558
public static final String BIRTH_DATE = "birthdate";
5659
public static final String BIRTH_DATE_DD = "birthdateDD";
@@ -121,6 +124,13 @@ public class PersonDto extends PseudonymizableDto {
121124
@PersonalData(mandatoryField = true)
122125
@SensitiveData(mandatoryField = true)
123126
private String lastName;
127+
@HideForCountriesExcept
128+
@PersonalData
129+
@SensitiveData
130+
private Salutation salutation;
131+
@PersonalData
132+
@SensitiveData
133+
private String otherSalutation;
124134
@PersonalData
125135
@SensitiveData
126136
private String nickname;
@@ -475,6 +485,22 @@ public void setLastName(String lastName) {
475485
this.lastName = lastName;
476486
}
477487

488+
public Salutation getSalutation() {
489+
return salutation;
490+
}
491+
492+
public void setSalutation(Salutation salutation) {
493+
this.salutation = salutation;
494+
}
495+
496+
public String getOtherSalutation() {
497+
return otherSalutation;
498+
}
499+
500+
public void setOtherSalutation(String otherSalutation) {
501+
this.otherSalutation = otherSalutation;
502+
}
503+
478504
public EducationType getEducationType() {
479505
return educationType;
480506
}
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.person;
17+
18+
import de.symeda.sormas.api.i18n.I18nProperties;
19+
20+
public enum Salutation {
21+
22+
MR,
23+
MRS,
24+
MR_AND_MRS,
25+
FAMILY,
26+
GUARDIAN_OF_MINOR,
27+
OTHER;
28+
29+
public String toString() {
30+
return I18nProperties.getEnumCaption(this);
31+
}
32+
}
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
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.utils;
17+
18+
public class EnumHelper {
19+
20+
public static String toString(Enum<?> enumValue, String otherValue, Enum<?> otherEnumItem) {
21+
if (enumValue == null) {
22+
return null;
23+
}
24+
25+
return enumValue.equals(otherEnumItem) ? otherValue : enumValue.toString();
26+
}
27+
}

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1329,6 +1329,8 @@ Person.hasCovidApp=Has COVID app
13291329
Person.covidCodeDelivered=COVID code was generated and delivered
13301330
Person.externalId=External ID
13311331
Person.symptomJournalStatus=Symptom journal status
1332+
Person.salutation=Salutation
1333+
Person.otherSalutation=Other salutation
13321334

13331335
pointOfEntryActivePointsOfEntry=Active points of entry
13341336
pointOfEntryArchivedPointsOfEntry=Archived points of entry

sormas-api/src/main/resources/captions_de-DE.properties

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1288,6 +1288,8 @@ Person.hasCovidApp=Hat COVID App
12881288
Person.covidCodeDelivered=COVID Code wurde generiert und ausgeliefert
12891289
Person.externalId=Externe ID
12901290
Person.symptomJournalStatus=Symptomtagebuch-Status
1291+
Person.salutation=Anrede
1292+
Person.otherSalutation=Andere Anrede
12911293

12921294
pointOfEntryActivePointsOfEntry=Aktive Einreiseorte
12931295
pointOfEntryArchivedPointsOfEntry=Archivierte Einreiseorte

0 commit comments

Comments
 (0)