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

Commit 4c4eafc

Browse files
author
FredrikSchäferVitagroup
committed
SORMAS-Foundation#3418 Added ArmedForcesRelationType field to Person
1 parent f4b9686 commit 4c4eafc

12 files changed

Lines changed: 95 additions & 20 deletions

File tree

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

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -185,6 +185,7 @@ public class CaseExportDto implements Serializable {
185185
@SensitiveData
186186
private String emailAddress;
187187
private String occupationType;
188+
private String armedForcesRelationType;
188189
private String educationType;
189190
private String travelHistory;
190191
private boolean traveled;
@@ -260,7 +261,7 @@ public CaseExportDto(long id, long personId, long personAddressId, long epiDataI
260261
String addressRegion, String addressDistrict, String addressCommunity, String city, String street, String houseNumber, String additionalInformation, String postalCode,
261262
String facility, String facilityUuid, String facilityDetails,
262263
String phone, String phoneOwner, String emailAddress, EducationType educationType, String educationDetails,
263-
OccupationType occupationType, String occupationDetails, YesNoUnknown contactWithSourceCaseKnown,
264+
OccupationType occupationType, String occupationDetails, String ArmedForcesRelationType, YesNoUnknown contactWithSourceCaseKnown,
264265
//Date onsetDate,
265266
Vaccination vaccination, String vaccinationDoses, Date vaccinationDate,
266267
VaccinationInfoSource vaccinationInfoSource, YesNoUnknown postpartum, Trimester trimester,
@@ -327,6 +328,7 @@ public CaseExportDto(long id, long personId, long personAddressId, long epiDataI
327328
this.emailAddress = emailAddress;
328329
this.educationType = PersonHelper.buildEducationString(educationType, educationDetails);
329330
this.occupationType = PersonHelper.buildOccupationString(occupationType, occupationDetails);
331+
this.armedForcesRelationType = armedForcesRelationType;
330332
this.contactWithSourceCaseKnown = contactWithSourceCaseKnown;
331333
// this.onsetDate = onsetDate;
332334
this.vaccination = vaccination;
@@ -971,8 +973,8 @@ public String getPhone() {
971973

972974
@Order(75)
973975
@ExportTarget(caseExportTypes = {
974-
CaseExportType.CASE_SURVEILLANCE,
975-
CaseExportType.CASE_MANAGEMENT })
976+
CaseExportType.CASE_SURVEILLANCE,
977+
CaseExportType.CASE_MANAGEMENT })
976978
@ExportProperty(PersonDto.EMAIL_ADDRESS)
977979
@ExportGroup(ExportGroupType.SENSITIVE)
978980
public String getEmailAddress() {
@@ -1004,6 +1006,16 @@ public String getOccupationType() {
10041006
}
10051007

10061008
@Order(78)
1009+
@ExportTarget(caseExportTypes = {
1010+
CaseExportType.CASE_SURVEILLANCE,
1011+
CaseExportType.CASE_MANAGEMENT })
1012+
@ExportProperty(PersonDto.ARMED_FORCES_RELATION_TYPE)
1013+
@ExportGroup(ExportGroupType.PERSON)
1014+
public String getArmedForcesRelationType() {
1015+
return armedForcesRelationType;
1016+
}
1017+
1018+
@Order(79)
10071019
@ExportTarget(caseExportTypes = {
10081020
CaseExportType.CASE_SURVEILLANCE })
10091021
@ExportProperty(TRAVELED)
@@ -1016,7 +1028,7 @@ public void setTraveled(boolean traveled) {
10161028
this.traveled = traveled;
10171029
}
10181030

1019-
@Order(79)
1031+
@Order(80)
10201032
@ExportTarget(caseExportTypes = {
10211033
CaseExportType.CASE_SURVEILLANCE })
10221034
@ExportProperty(TRAVEL_HISTORY)
@@ -1025,7 +1037,7 @@ public String getTravelHistory() {
10251037
return travelHistory;
10261038
}
10271039

1028-
@Order(80)
1040+
@Order(81)
10291041
@ExportTarget(caseExportTypes = {
10301042
CaseExportType.CASE_SURVEILLANCE })
10311043
@ExportProperty(BURIAL_ATTENDED)
@@ -1038,7 +1050,7 @@ public void setBurialAttended(boolean burialAttended) {
10381050
this.burialAttended = burialAttended;
10391051
}
10401052

1041-
@Order(81)
1053+
@Order(82)
10421054
@ExportTarget(caseExportTypes = {
10431055
CaseExportType.CASE_SURVEILLANCE })
10441056
@ExportProperty(EpiDataDto.CONTACT_WITH_SOURCE_CASE_KNOWN)
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
package de.symeda.sormas.api.person;
2+
3+
import de.symeda.sormas.api.i18n.I18nProperties;
4+
5+
public enum ArmedForcesRelationType {
6+
7+
NOT_COLLECTED,
8+
UNKNOWN,
9+
NO_RELATION,
10+
// working for armed forces, but not as soldier
11+
CIVIL,
12+
SOLDIER_OR_RELATIVE;
13+
14+
public String toString() {
15+
return I18nProperties.getEnumCaption(this);
16+
}
17+
18+
}

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

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,7 @@ public class PersonDto extends PseudonymizableDto {
8383
public static final String EDUCATION_DETAILS = "educationDetails";
8484
public static final String OCCUPATION_TYPE = "occupationType";
8585
public static final String OCCUPATION_DETAILS = "occupationDetails";
86+
public static final String ARMED_FORCES_RELATION_TYPE = "armedForcesRelationType";
8687

8788
public static final String FATHERS_NAME = "fathersName";
8889
public static final String MOTHERS_NAME = "mothersName";
@@ -255,6 +256,9 @@ public class PersonDto extends PseudonymizableDto {
255256
@SensitiveData
256257
private String occupationDetails;
257258
@SensitiveData
259+
@HideForCountriesExcept(countries = CountryHelper.COUNTRY_CODE_GERMANY)
260+
private ArmedForcesRelationType armedForcesRelationType;
261+
@SensitiveData
258262
private String generalPractitionerDetails;
259263
@SensitiveData
260264
private String passportNumber;
@@ -498,6 +502,14 @@ public void setOccupationDetails(String occupationDetails) {
498502
this.occupationDetails = occupationDetails;
499503
}
500504

505+
public ArmedForcesRelationType getArmedForcesRelationType() {
506+
return armedForcesRelationType;
507+
}
508+
509+
public void setArmedForcesRelationType(ArmedForcesRelationType armedForcesRelationType) {
510+
this.armedForcesRelationType = armedForcesRelationType;
511+
}
512+
501513
public String getMothersName() {
502514
return mothersName;
503515
}

sormas-api/src/main/java/de/symeda/sormas/api/utils/InfoProvider.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ public static synchronized InfoProvider get() {
4949
* @return
5050
*/
5151
public String getMinimumRequiredVersion() {
52-
return "1.52.0";
52+
return "1.53.0";
5353
}
5454

5555
/**

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1249,6 +1249,7 @@ Person.occupationFacilityType=Facility type
12491249
Person.occupationRegion=Facility region
12501250
Person.occupationType=Type of occupation
12511251
Person.other.occupationDetails=Please specify occupation
1252+
Person.armedForcesRelationType=Staff of armed forces
12521253
Person.phone=Phone number
12531254
Person.phoneOwner=Owner of phone
12541255
Person.placeOfBirthRegion=Region of birth

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1249,6 +1249,7 @@ Person.occupationFacilityType=Art der Einrichtung
12491249
Person.occupationRegion=Bundesland der Einrichtung
12501250
Person.occupationType=Beschäftigungsart
12511251
Person.other.occupationDetails=Bitte geben Sie Ihren Beruf an
1252+
Person.armedForcesRelationType=Zugehörigkeit zur Bundeswehr
12521253
Person.phone=Telefonnummer
12531254
Person.phoneOwner=Besitzer des Telefons
12541255
Person.placeOfBirthRegion=Geburt Bundesland

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

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,12 @@ AreaType.URBAN = Urban
9393
AreaType.RURAL = Rural
9494
AreaType.UNKNOWN = Unknown
9595

96+
ArmedForcesRelationType.NOT_COLLECTED = Data not collected
97+
ArmedForcesRelationType.UNKNOWN = Unknown
98+
ArmedForcesRelationType.NO_RELATION = No relation to armed forces
99+
ArmedForcesRelationType.CIVIL = Civil person working for/accomodated in facility of armed forces
100+
ArmedForcesRelationType.SOLDIER_OR_RELATIVE = Soldier, Relative
101+
96102
ArrivalOrDeparture.ARRIVAL = Arrival
97103
ArrivalOrDeparture.DEPARTURE = Departure
98104
ArrivalOrDeparture.UNKNOWN = Unknown

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

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,12 @@ AreaType.URBAN = Städtisch
9393
AreaType.RURAL = Ländlich
9494
AreaType.UNKNOWN = Unbekannt
9595

96+
ArmedForcesRelationType.NOT_COLLECTED = Nicht erhoben
97+
ArmedForcesRelationType.UNKNOWN = Nicht ermittelbar
98+
ArmedForcesRelationType.NO_RELATION = Kein Bezug zur BW
99+
ArmedForcesRelationType.CIVIL = Zivilperson tätig/untergebrach in Einrichtung der BW
100+
ArmedForcesRelationType.SOLDIER_OR_RELATIVE = Soldat/BW-Angehöriger
101+
96102
ArrivalOrDeparture.ARRIVAL = Ankunft
97103
ArrivalOrDeparture.DEPARTURE = Abreise
98104
ArrivalOrDeparture.UNKNOWN = Unbekannt

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

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@
4242
import de.symeda.sormas.api.Disease;
4343
import de.symeda.sormas.api.facility.FacilityType;
4444
import de.symeda.sormas.api.person.ApproximateAgeType;
45+
import de.symeda.sormas.api.person.ArmedForcesRelationType;
4546
import de.symeda.sormas.api.person.BurialConductor;
4647
import de.symeda.sormas.api.person.CauseOfDeath;
4748
import de.symeda.sormas.api.person.DeathPlaceType;
@@ -94,6 +95,7 @@ public class Person extends AbstractDomainObject {
9495
public static final String EDUCATION_DETAILS = "educationDetails";
9596
public static final String OCCUPATION_TYPE = "occupationType";
9697
public static final String OCCUPATION_DETAILS = "occupationDetails";
98+
public static final String ARMED_FORCES_RELATION_TYPE = "armedForcesRelationType";
9799
public static final String PHONE = "phone";
98100
public static final String PHONE_OWNER = "phoneOwner";
99101
public static final String FATHERS_NAME = "fathersName";
@@ -165,6 +167,7 @@ public class Person extends AbstractDomainObject {
165167

166168
private OccupationType occupationType;
167169
private String occupationDetails;
170+
private ArmedForcesRelationType armedForcesRelationType;
168171
private String generalPractitionerDetails;
169172
private String passportNumber;
170173
private String nationalHealthId;
@@ -430,6 +433,15 @@ public void setOccupationDetails(String occupationDetails) {
430433
this.occupationDetails = occupationDetails;
431434
}
432435

436+
@Enumerated(EnumType.STRING)
437+
public ArmedForcesRelationType getArmedForcesRelationType() {
438+
return armedForcesRelationType;
439+
}
440+
441+
public void setArmedForcesRelationType(ArmedForcesRelationType armedForcesRelationType) {
442+
this.armedForcesRelationType = armedForcesRelationType;
443+
}
444+
433445
@Column(length = COLUMN_LENGTH_DEFAULT)
434446
public String getMothersName() {
435447
return mothersName;
@@ -664,4 +676,5 @@ public Set<Contact> getContacts() {
664676
public String toString() {
665677
return PersonDto.buildCaption(firstName, lastName);
666678
}
679+
667680
}

sormas-backend/src/main/java/de/symeda/sormas/backend/person/PersonFacadeEjb.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -547,6 +547,7 @@ public Person fillOrBuildEntity(@NotNull PersonDto source, Person target) {
547547

548548
target.setOccupationType(source.getOccupationType());
549549
target.setOccupationDetails(source.getOccupationDetails());
550+
target.setArmedForcesRelationType(source.getArmedForcesRelationType());
550551

551552
target.setMothersName(source.getMothersName());
552553
target.setFathersName(source.getFathersName());
@@ -705,6 +706,7 @@ public static PersonDto toDto(Person source) {
705706

706707
target.setOccupationType(source.getOccupationType());
707708
target.setOccupationDetails(source.getOccupationDetails());
709+
target.setArmedForcesRelationType(source.getArmedForcesRelationType());
708710

709711
target.setMothersName(source.getMothersName());
710712
target.setFathersName(source.getFathersName());

0 commit comments

Comments
 (0)