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

Commit b415686

Browse files
lgallgal
authored andcommitted
SORMAS-Foundation#3411 add salutation to person
1 parent 72e913a commit b415686

17 files changed

Lines changed: 184 additions & 21 deletions

File tree

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
@@ -1139,6 +1139,7 @@ public interface Captions {
11391139
String Person_occupationRegion = "Person.occupationRegion";
11401140
String Person_occupationType = "Person.occupationType";
11411141
String Person_other_occupationDetails = "Person.other.occupationDetails";
1142+
String Person_otherSalutation = "Person.otherSalutation";
11421143
String Person_passportNumber = "Person.passportNumber";
11431144
String Person_phone = "Person.phone";
11441145
String Person_phoneOwner = "Person.phoneOwner";
@@ -1149,6 +1150,7 @@ public interface Captions {
11491150
String Person_placeOfBirthFacilityType = "Person.placeOfBirthFacilityType";
11501151
String Person_placeOfBirthRegion = "Person.placeOfBirthRegion";
11511152
String Person_presentCondition = "Person.presentCondition";
1153+
String Person_salutation = "Person.salutation";
11521154
String Person_sex = "Person.sex";
11531155
String Person_symptomJournalStatus = "Person.symptomJournalStatus";
11541156
String Person_transporter_occupationDetails = "Person.transporter.occupationDetails";

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

Lines changed: 25 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,12 @@ public class PersonDto extends PseudonymizableDto {
121124
private String lastName;
122125
@PersonalData
123126
@SensitiveData
127+
private Salutation salutation;
128+
@PersonalData
129+
@SensitiveData
130+
private String otherSalutation;
131+
@PersonalData
132+
@SensitiveData
124133
private String nickname;
125134
@PersonalData
126135
@SensitiveData
@@ -466,6 +475,22 @@ public void setLastName(String lastName) {
466475
this.lastName = lastName;
467476
}
468477

478+
public Salutation getSalutation() {
479+
return salutation;
480+
}
481+
482+
public void setSalutation(Salutation salutation) {
483+
this.salutation = salutation;
484+
}
485+
486+
public String getOtherSalutation() {
487+
return otherSalutation;
488+
}
489+
490+
public void setOtherSalutation(String otherSalutation) {
491+
this.otherSalutation = otherSalutation;
492+
}
493+
469494
public EducationType getEducationType() {
470495
return educationType;
471496
}
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+
}

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1269,6 +1269,8 @@ Person.hasCovidApp=Has COVID app
12691269
Person.covidCodeDelivered=COVID code was generated and delivered
12701270
Person.externalId=External ID
12711271
Person.symptomJournalStatus=Symptom journal status
1272+
Person.salutation=Salutation
1273+
Person.otherSalutation=Other salutation
12721274

12731275
pointOfEntryActivePointsOfEntry=Active points of entry
12741276
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
@@ -1269,6 +1269,8 @@ Person.hasCovidApp=Hat COVID App
12691269
Person.covidCodeDelivered=COVID Code wurde generiert und ausgeliefert
12701270
Person.externalId=Externe ID
12711271
Person.symptomJournalStatus=Symptomtagebuch-Status
1272+
Person.salutation=Anrede
1273+
Person.otherSalutation=Anderer Anrede
12721274

12731275
pointOfEntryActivePointsOfEntry=Aktive Einreiseorte
12741276
pointOfEntryArchivedPointsOfEntry=Archivierte Einreiseorte

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

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1209,3 +1209,10 @@ EndOfQuarantineReason.ASYMPTOMATIC=Asymptomatic after 10 days
12091209
EndOfQuarantineReason.ISOLATED_AS_CASE=Isolated as Case
12101210
EndOfQuarantineReason.LOST_TO_FOLLOWUP=Lost to follow-up
12111211
EndOfQuarantineReason.OTHER=Other
1212+
1213+
Salutation.MR=dear Sir
1214+
Salutation.MRS=dear Madame
1215+
Salutation.MR_AND_MRS=dear Sir and Madame
1216+
Salutation.FAMILY=dear family
1217+
Salutation.GUARDIAN_OF_MINOR=dear guardian of the child
1218+
Salutation.OTHER=Other

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

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1209,3 +1209,10 @@ EndOfQuarantineReason.ASYMPTOMATIC=Asymptomatisch nach 10 Tagen
12091209
EndOfQuarantineReason.ISOLATED_AS_CASE=Als Fall isoliert
12101210
EndOfQuarantineReason.LOST_TO_FOLLOWUP=Keine Nachverfolgung möglich
12111211
EndOfQuarantineReason.OTHER=Sonstiges
1212+
1213+
Salutation.MR=Sehr geehrter Herr
1214+
Salutation.MRS=Sehr geehrte Frau
1215+
Salutation.MR_AND_MRS=Sehr geehrte Dame, sehr geehrter Herr
1216+
Salutation.FAMILY=Sehr geehrte Familie
1217+
Salutation.GUARDIAN_OF_MINOR=Sehr geehrte Erziehungsberechtigte des Kindes
1218+
Salutation.OTHER=Sonstiges

sormas-app/app/src/main/java/de/symeda/sormas/app/backend/common/DatabaseHelper.java

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ public class DatabaseHelper extends OrmLiteSqliteOpenHelper {
152152
public static final String DATABASE_NAME = "sormas.db";
153153
// any time you make changes to your database objects, you may have to increase the database version
154154

155-
public static final int DATABASE_VERSION = 247;
155+
public static final int DATABASE_VERSION = 248;
156156

157157
private static DatabaseHelper instance = null;
158158

@@ -1774,7 +1774,13 @@ public void onUpgrade(SQLiteDatabase db, ConnectionSource connectionSource, int
17741774
+ "FROM tmp_epidata;");
17751775
getDao(EpiData.class).executeRaw("DROP TABLE tmp_epidata;");
17761776

1777-
// ATTENTION: break should only be done after last version
1777+
case 247:
1778+
currentVersion = 247;
1779+
1780+
getDao(Person.class).executeRaw("ALTER TABLE person ADD COLUMN salutation varchar(255)");
1781+
getDao(Person.class).executeRaw("ALTER TABLE person ADD COLUMN otherSalutation varchar(512)");
1782+
1783+
// ATTENTION: break should only be done after last version
17781784
break;
17791785
default:
17801786
throw new IllegalStateException("onUpgrade() with unknown oldVersion " + oldVersion);

sormas-app/app/src/main/java/de/symeda/sormas/app/backend/person/Person.java

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@
4141
import de.symeda.sormas.api.person.EducationType;
4242
import de.symeda.sormas.api.person.OccupationType;
4343
import de.symeda.sormas.api.person.PresentCondition;
44+
import de.symeda.sormas.api.person.Salutation;
4445
import de.symeda.sormas.api.person.Sex;
4546
import de.symeda.sormas.app.backend.common.PseudonymizableAdo;
4647
import de.symeda.sormas.app.backend.facility.Facility;
@@ -73,6 +74,10 @@ public class Person extends PseudonymizableAdo {
7374
private String firstName;
7475
@Column(nullable = false)
7576
private String lastName;
77+
@Enumerated(EnumType.STRING)
78+
private Salutation salutation;
79+
@Column(length = COLUMN_LENGTH_DEFAULT)
80+
private String otherSalutation;
7681
@Column(length = COLUMN_LENGTH_DEFAULT)
7782
private String nickname;
7883
@Column(length = COLUMN_LENGTH_DEFAULT)
@@ -190,6 +195,22 @@ public void setLastName(String lastName) {
190195
this.lastName = lastName;
191196
}
192197

198+
public Salutation getSalutation() {
199+
return salutation;
200+
}
201+
202+
public void setSalutation(Salutation salutation) {
203+
this.salutation = salutation;
204+
}
205+
206+
public String getOtherSalutation() {
207+
return otherSalutation;
208+
}
209+
210+
public void setOtherSalutation(String otherSalutation) {
211+
this.otherSalutation = otherSalutation;
212+
}
213+
193214
public String getNickname() {
194215
return nickname;
195216
}

sormas-app/app/src/main/java/de/symeda/sormas/app/backend/person/PersonDtoHelper.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,8 @@ public void fillInnerFromDto(Person target, PersonDto source) {
6868

6969
target.setFirstName(source.getFirstName());
7070
target.setLastName(source.getLastName());
71+
target.setSalutation(source.getSalutation());
72+
target.setOtherSalutation(source.getOtherSalutation());
7173
target.setNickname(source.getNickname());
7274
target.setMothersMaidenName(source.getMothersMaidenName());
7375
target.setSex(source.getSex());
@@ -136,6 +138,8 @@ public void fillInnerFromAdo(PersonDto target, Person source) {
136138

137139
target.setFirstName(source.getFirstName());
138140
target.setLastName(source.getLastName());
141+
target.setSalutation(source.getSalutation());
142+
target.setOtherSalutation(source.getOtherSalutation());
139143
target.setNickname(source.getNickname());
140144
target.setMothersMaidenName(source.getMothersMaidenName());
141145
target.setSex(source.getSex());

0 commit comments

Comments
 (0)