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

Commit 9c4d464

Browse files
Merge pull request SORMAS-Foundation#3746 from hzi-braunschweig/3412_SurvNet-person-country-of-birth
3412 SurvNet person country of birth
2 parents f85592d + 9fffeea commit 9c4d464

27 files changed

Lines changed: 452 additions & 19 deletions

File tree

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

Lines changed: 44 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -248,6 +248,12 @@ public class CaseExportDto implements Serializable {
248248
private EventStatus latestEventStatus;
249249
private String externalID;
250250

251+
@PersonalData
252+
@SensitiveData
253+
private String birthName;
254+
private String birthCountry;
255+
private String citizenship;
256+
251257
//@formatter:off
252258
public CaseExportDto(long id, long personId, long personAddressId, long epiDataId, long symptomsId,
253259
long hospitalizationId, long districtId, long healthConditionsId, String uuid, String epidNumber,
@@ -274,7 +280,8 @@ public CaseExportDto(long id, long personId, long personAddressId, long epiDataI
274280
//Date onsetDate,
275281
Vaccination vaccination, String vaccinationDoses, Date vaccinationDate,
276282
VaccinationInfoSource vaccinationInfoSource, YesNoUnknown postpartum, Trimester trimester,
277-
long eventCount, String externalID) {
283+
long eventCount, String externalID,
284+
String birthName, String birthCountryIsoCode, String birthCountryName, String citizenshipIsoCode, String citizenshipCountryName) {
278285
//@formatter:on
279286

280287
this.id = id;
@@ -353,6 +360,9 @@ public CaseExportDto(long id, long personId, long personAddressId, long epiDataI
353360
this.followUpUntil = followUpUntil;
354361
this.eventCount = eventCount;
355362
this.externalID = externalID;
363+
this.birthName = birthName;
364+
this.birthCountry = I18nProperties.getCountryName(birthCountryIsoCode, birthCountryName);
365+
this.citizenship = I18nProperties.getCountryName(citizenshipIsoCode, citizenshipCountryName);
356366

357367
jurisdiction = new CaseJurisdictionDto(reportingUserUuid, regionUuid, districtUuid, communityUuid, healthFacilityUuid, pointOfEntryUuid);
358368
}
@@ -1391,6 +1401,39 @@ public String getLatestEventTitle() {
13911401
return latestEventTitle;
13921402
}
13931403

1404+
@Order(150)
1405+
@ExportTarget(caseExportTypes = {
1406+
CaseExportType.CASE_SURVEILLANCE,
1407+
CaseExportType.CASE_MANAGEMENT })
1408+
@ExportProperty(PersonDto.BIRTH_NAME)
1409+
@ExportGroup(ExportGroupType.SENSITIVE)
1410+
@HideForCountriesExcept
1411+
public String getBirthName() {
1412+
return birthName;
1413+
}
1414+
1415+
@Order(151)
1416+
@ExportTarget(caseExportTypes = {
1417+
CaseExportType.CASE_SURVEILLANCE,
1418+
CaseExportType.CASE_MANAGEMENT })
1419+
@ExportProperty(PersonDto.BIRTH_COUNTRY)
1420+
@ExportGroup(ExportGroupType.SENSITIVE)
1421+
@HideForCountriesExcept
1422+
public String getBirthCountry() {
1423+
return birthCountry;
1424+
}
1425+
1426+
@Order(152)
1427+
@ExportTarget(caseExportTypes = {
1428+
CaseExportType.CASE_SURVEILLANCE,
1429+
CaseExportType.CASE_MANAGEMENT })
1430+
@ExportProperty(PersonDto.CITIZENSHIP)
1431+
@ExportGroup(ExportGroupType.SENSITIVE)
1432+
@HideForCountriesExcept
1433+
public String getCitizenship() {
1434+
return citizenship;
1435+
}
1436+
13941437
public void setCountry(String country) {
13951438
this.country = country;
13961439
}

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

Lines changed: 30 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
import de.symeda.sormas.api.caze.CaseClassification;
2727
import de.symeda.sormas.api.caze.CaseJurisdictionDto;
2828
import de.symeda.sormas.api.facility.FacilityHelper;
29+
import de.symeda.sormas.api.i18n.I18nProperties;
2930
import de.symeda.sormas.api.person.ApproximateAgeType;
3031
import de.symeda.sormas.api.person.ApproximateAgeType.ApproximateAgeHelper;
3132
import de.symeda.sormas.api.person.ArmedForcesRelationType;
@@ -147,6 +148,12 @@ public class ContactExportDto implements Serializable {
147148
private String latestEventTitle;
148149
private String externalID;
149150

151+
@PersonalData
152+
@SensitiveData
153+
private String birthName;
154+
private String birthCountry;
155+
private String citizenship;
156+
150157
//@formatter:off
151158
public ContactExportDto(long id, long personId, String uuid, String sourceCaseUuid, CaseClassification caseClassification, Disease disease, String diseaseDetails,
152159
ContactClassification contactClassification, Date lastContactDate, String firstName, String lastName,
@@ -163,7 +170,8 @@ public ContactExportDto(long id, long personId, String uuid, String sourceCaseUu
163170
String facility, String facilityUuid, String facilityDetails,
164171
String phone, String phoneOwner, String emailAddress, OccupationType occupationType, String occupationDetails, ArmedForcesRelationType armedForcesRelationType,
165172
String region, String district, String community,
166-
long epiDataId, YesNoUnknown contactWithSourceCaseKnown, YesNoUnknown returningTraveler, String externalID,
173+
long epiDataId, YesNoUnknown contactWithSourceCaseKnown, YesNoUnknown returningTraveler, String externalID,
174+
String birthName, String birthCountryIsoCode, String birthCountryName, String citizenshipIsoCode, String citizenshipCountryName,
167175
String reportingUserUuid, String regionUuid, String districtUuid, String communityUuid,
168176
String caseReportingUserUuid, String caseRegionUuid, String caseDistrictUuid, String caseCommunityUuid, String caseHealthFacilityUuid, String casePointOfEntryUuid
169177
) {
@@ -228,6 +236,9 @@ public ContactExportDto(long id, long personId, String uuid, String sourceCaseUu
228236
this.contactWithSourceCaseKnown = contactWithSourceCaseKnown;
229237
this.returningTraveler = returningTraveler;
230238
this.externalID = externalID;
239+
this.birthName = birthName;
240+
this.birthCountry = I18nProperties.getCountryName(birthCountryIsoCode, birthCountryName);
241+
this.citizenship = I18nProperties.getCountryName(citizenshipIsoCode, citizenshipCountryName);
231242

232243
CaseJurisdictionDto caseJurisdiction = caseReportingUserUuid != null
233244
? null
@@ -633,6 +644,24 @@ public long getEventCount() {
633644
return this.eventCount;
634645
}
635646

647+
@Order(80)
648+
@HideForCountriesExcept
649+
public String getBirthName() {
650+
return birthName;
651+
}
652+
653+
@Order(81)
654+
@HideForCountriesExcept
655+
public String getBirthCountry() {
656+
return birthCountry;
657+
}
658+
659+
@Order(82)
660+
@HideForCountriesExcept
661+
public String getCitizenship() {
662+
return citizenship;
663+
}
664+
636665
public void setEventCount(Long eventCount) {
637666
this.eventCount = eventCount;
638667
}

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

Lines changed: 35 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,11 @@
2929
import de.symeda.sormas.api.caze.BirthDateDto;
3030
import de.symeda.sormas.api.caze.BurialInfoDto;
3131
import de.symeda.sormas.api.caze.EmbeddedSampleExportDto;
32+
import de.symeda.sormas.api.i18n.I18nProperties;
3233
import de.symeda.sormas.api.importexport.ExportProperty;
3334
import de.symeda.sormas.api.person.ApproximateAgeType;
3435
import de.symeda.sormas.api.person.BurialConductor;
36+
import de.symeda.sormas.api.person.PersonDto;
3537
import de.symeda.sormas.api.person.PresentCondition;
3638
import de.symeda.sormas.api.person.Salutation;
3739
import de.symeda.sormas.api.person.Sex;
@@ -140,6 +142,11 @@ public class EventParticipantExportDto implements Serializable {
140142
private String phone;
141143
@SensitiveData
142144
private String emailAddress;
145+
@PersonalData
146+
@SensitiveData
147+
private String birthName;
148+
private String birthCountry;
149+
private String citizenship;
143150

144151
private String caseUuid;
145152

@@ -157,7 +164,8 @@ public EventParticipantExportDto(long id, long personId, String personUuid, Stri
157164
String firstName, String lastName, Salutation salutation, String otherSalutation, Sex sex, String involvmentDescription, Integer approximateAge, ApproximateAgeType approximateAgeType,
158165
Integer birthdateDD, Integer birthdateMM, Integer birthdateYYYY, PresentCondition presentCondition, Date deathDate, Date burialDate,
159166
BurialConductor burialConductor, String burialPlaceDescription, String addressRegion, String addressDistrict, String addressCommunity, String city, String street, String houseNumber,
160-
String additionalInformation, String postalCode, String phone, String emailAddress, String caseUuid) {
167+
String additionalInformation, String postalCode, String phone, String emailAddress, String caseUuid,
168+
String birthName, String birthCountryIsoCode, String birthCountryName, String citizenshipIsoCode, String citizenshipCountryName) {
161169
//@formatter:on
162170

163171
this.id = id;
@@ -205,6 +213,9 @@ public EventParticipantExportDto(long id, long personId, String personUuid, Stri
205213
this.phone = phone;
206214
this.emailAddress = emailAddress;
207215
this.caseUuid = caseUuid;
216+
this.birthName = birthName;
217+
this.birthCountry = I18nProperties.getCountryName(birthCountryIsoCode, birthCountryName);
218+
this.citizenship = I18nProperties.getCountryName(citizenshipIsoCode, citizenshipCountryName);
208219

209220
jurisdiction = new EventParticipantJurisdictionDto(reportingUserUuid);
210221
}
@@ -343,10 +354,31 @@ public String getPhone() {
343354

344355
@Order(41)
345356
public String getEmailAddress() {
346-
return emailAddress;
357+
return emailAddress;
347358
}
348359

349360
@Order(42)
361+
@ExportProperty(PersonDto.BIRTH_NAME)
362+
@HideForCountriesExcept
363+
public String getBirthName() {
364+
return birthName;
365+
}
366+
367+
@Order(43)
368+
@ExportProperty(PersonDto.BIRTH_COUNTRY)
369+
@HideForCountriesExcept
370+
public String getBirthCountry() {
371+
return birthCountry;
372+
}
373+
374+
@Order(44)
375+
@ExportProperty(PersonDto.CITIZENSHIP)
376+
@HideForCountriesExcept
377+
public String getCitizenship() {
378+
return citizenship;
379+
}
380+
381+
@Order(45)
350382
@ExportProperty(EventParticipantExportDto.SAMPLE_INFORMATION)
351383
public String getOtherSamplesString() {
352384
StringBuilder samples = new StringBuilder();
@@ -359,7 +391,7 @@ public String getOtherSamplesString() {
359391
return samples.length() > 0 ? samples.substring(0, samples.length() - separator.length()) : "";
360392
}
361393

362-
@Order(43)
394+
@Order(46)
363395
@ExportProperty(EventParticipantExportDto.EVENT_PARTICIPANT_INVOLVMENT_DESCRIPTION)
364396
public String getInvolvmentDescription() {
365397
return involvmentDescription;

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1153,10 +1153,12 @@ public interface Captions {
11531153
String Person_approximateAgeReferenceDate = "Person.approximateAgeReferenceDate";
11541154
String Person_approximateAgeType = "Person.approximateAgeType";
11551155
String Person_armedForcesRelationType = "Person.armedForcesRelationType";
1156+
String Person_birthCountry = "Person.birthCountry";
11561157
String Person_birthdate = "Person.birthdate";
11571158
String Person_birthdateDD = "Person.birthdateDD";
11581159
String Person_birthdateMM = "Person.birthdateMM";
11591160
String Person_birthdateYYYY = "Person.birthdateYYYY";
1161+
String Person_birthName = "Person.birthName";
11601162
String Person_birthWeight = "Person.birthWeight";
11611163
String Person_burialConductor = "Person.burialConductor";
11621164
String Person_burialDate = "Person.burialDate";
@@ -1166,6 +1168,7 @@ public interface Captions {
11661168
String Person_causeOfDeathDetails = "Person.causeOfDeathDetails";
11671169
String Person_causeOfDeathDisease = "Person.causeOfDeathDisease";
11681170
String Person_causeOfDeathDiseaseDetails = "Person.causeOfDeathDiseaseDetails";
1171+
String Person_citizenship = "Person.citizenship";
11691172
String Person_covidCodeDelivered = "Person.covidCodeDelivered";
11701173
String Person_deathDate = "Person.deathDate";
11711174
String Person_deathPlaceDescription = "Person.deathPlaceDescription";

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

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
import de.symeda.sormas.api.facility.FacilityType;
2929
import de.symeda.sormas.api.location.LocationDto;
3030
import de.symeda.sormas.api.region.CommunityReferenceDto;
31+
import de.symeda.sormas.api.region.CountryReferenceDto;
3132
import de.symeda.sormas.api.region.DistrictReferenceDto;
3233
import de.symeda.sormas.api.region.RegionReferenceDto;
3334
import de.symeda.sormas.api.utils.DataHelper;
@@ -75,6 +76,7 @@ public class PersonDto extends PseudonymizableDto {
7576
public static final String BURIAL_PLACE_DESCRIPTION = "burialPlaceDescription";
7677
public static final String BURIAL_CONDUCTOR = "burialConductor";
7778

79+
public static final String BIRTH_NAME = "birthName";
7880
public static final String NICKNAME = "nickname";
7981
public static final String MOTHERS_MAIDEN_NAME = "mothersMaidenName";
8082

@@ -112,6 +114,9 @@ public class PersonDto extends PseudonymizableDto {
112114
public static final String COVID_CODE_DELIVERED = "covidCodeDelivered";
113115
public static final String EXTERNAL_ID = "externalId";
114116

117+
public static final String BIRTH_COUNTRY = "birthCountry";
118+
public static final String CITIZENSHIP = "citizenship";
119+
115120
// Fields are declared in the order they should appear in the import template
116121

117122
@Outbreaks
@@ -133,6 +138,10 @@ public class PersonDto extends PseudonymizableDto {
133138
private String otherSalutation;
134139
@PersonalData
135140
@SensitiveData
141+
@HideForCountriesExcept
142+
private String birthName;
143+
@PersonalData
144+
@SensitiveData
136145
private String nickname;
137146
@PersonalData
138147
@SensitiveData
@@ -293,6 +302,11 @@ public class PersonDto extends PseudonymizableDto {
293302
@HideForCountriesExcept(countries = CountryHelper.COUNTRY_CODE_GERMANY)
294303
private String externalId;
295304

305+
@HideForCountriesExcept
306+
private CountryReferenceDto birthCountry;
307+
@HideForCountriesExcept
308+
private CountryReferenceDto citizenship;
309+
296310
public Integer getBirthdateDD() {
297311
return birthdateDD;
298312
}
@@ -453,6 +467,14 @@ public void setAddress(LocationDto address) {
453467
this.address = address;
454468
}
455469

470+
public String getBirthName() {
471+
return birthName;
472+
}
473+
474+
public void setBirthName(String birthName) {
475+
this.birthName = birthName;
476+
}
477+
456478
public String getNickname() {
457479
return nickname;
458480
}
@@ -702,6 +724,22 @@ public void setExternalId(String externalId) {
702724
this.externalId = externalId;
703725
}
704726

727+
public CountryReferenceDto getBirthCountry() {
728+
return birthCountry;
729+
}
730+
731+
public void setBirthCountry(CountryReferenceDto birthCountry) {
732+
this.birthCountry = birthCountry;
733+
}
734+
735+
public CountryReferenceDto getCitizenship() {
736+
return citizenship;
737+
}
738+
739+
public void setCitizenship(CountryReferenceDto citizenship) {
740+
this.citizenship = citizenship;
741+
}
742+
705743
@Override
706744
public String toString() {
707745
return buildCaption(firstName, lastName);

sormas-api/src/main/java/de/symeda/sormas/api/region/CountryFacade.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,4 +29,6 @@ public interface CountryFacade {
2929
List<CountryDto> getByUuids(List<String> uuids);
3030

3131
List<String> getAllUuids();
32+
33+
List<CountryReferenceDto> getAllActiveAsReference();
3234
}

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1332,6 +1332,9 @@ Person.externalId=External ID
13321332
Person.symptomJournalStatus=Symptom journal status
13331333
Person.salutation=Salutation
13341334
Person.otherSalutation=Other salutation
1335+
Person.birthName=Birth name
1336+
Person.birthCountry=Country of birth
1337+
Person.citizenship=Citizenship
13351338

13361339
pointOfEntryActivePointsOfEntry=Active points of entry
13371340
pointOfEntryArchivedPointsOfEntry=Archived points of entry

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1291,6 +1291,9 @@ Person.externalId=Externe ID
12911291
Person.symptomJournalStatus=Symptomtagebuch-Status
12921292
Person.salutation=Anrede
12931293
Person.otherSalutation=Andere Anrede
1294+
Person.birthName=Geburtsname
1295+
Person.birthCountry=Geburtsland
1296+
Person.citizenship=Staatsangehörigkeit
12941297

12951298
pointOfEntryActivePointsOfEntry=Aktive Einreiseorte
12961299
pointOfEntryArchivedPointsOfEntry=Archivierte Einreiseorte

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

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

154-
public static final int DATABASE_VERSION = 255;
154+
public static final int DATABASE_VERSION = 256;
155155

156156
private static DatabaseHelper instance = null;
157157

@@ -1817,6 +1817,12 @@ public void onUpgrade(SQLiteDatabase db, ConnectionSource connectionSource, int
18171817
getDao(Person.class).executeRaw("ALTER TABLE person ADD COLUMN salutation varchar(255)");
18181818
getDao(Person.class).executeRaw("ALTER TABLE person ADD COLUMN otherSalutation text");
18191819

1820+
case 255:
1821+
currentVersion = 255;
1822+
getDao(Person.class).executeRaw("ALTER TABLE person ADD column birthName varchar(255);");
1823+
getDao(Person.class).executeRaw("ALTER TABLE person ADD column birthCountry_id bigint REFERENCES country (id);");
1824+
getDao(Person.class).executeRaw("ALTER TABLE person ADD column citizenship_id bigint REFERENCES country (id);");
1825+
18201826
// ATTENTION: break should only be done after last version
18211827
break;
18221828

0 commit comments

Comments
 (0)