Skip to content

Commit 3f44faf

Browse files
Merge pull request #13170 from SORMAS-Foundation/feature-13093_Data_protection_update
Feature 13093 data protection update
2 parents b74ceb5 + 7fe8770 commit 3f44faf

File tree

92 files changed

+943
-575
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

92 files changed

+943
-575
lines changed

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -350,6 +350,7 @@ public class CaseDataDto extends SormasToSormasShareableDto implements IsCase {
350350
@Valid
351351
@EmbeddedPersonalData
352352
@EmbeddedSensitiveData
353+
@SensitiveData
353354
private HealthConditionsDto healthConditions;
354355

355356
private YesNoUnknown pregnant;
@@ -513,7 +514,9 @@ public class CaseDataDto extends SormasToSormasShareableDto implements IsCase {
513514
COUNTRY_CODE_GERMANY,
514515
COUNTRY_CODE_SWITZERLAND })
515516
private Date quarantineOfficialOrderSentDate;
517+
@SensitiveData
516518
private YesNoUnknown postpartum;
519+
@SensitiveData
517520
private Trimester trimester;
518521
private FollowUpStatus followUpStatus;
519522
@SensitiveData

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -263,6 +263,7 @@ public class CaseExportDto extends AbstractUuidDto implements IsCase {
263263
private String vaccineBatchNumber;
264264
private String vaccineUniiCode;
265265
private String vaccineAtcCode;
266+
@SensitiveData
266267
private HealthConditionsDto healthConditions;
267268
private int numberOfPrescriptions;
268269
private int numberOfTreatments;

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -312,6 +312,7 @@ public class ContactDto extends SormasToSormasShareableDto implements IsContact
312312
@Valid
313313
private EpiDataDto epiData;
314314
@Valid
315+
@SensitiveData
315316
private HealthConditionsDto healthConditions;
316317
private YesNoUnknown returningTraveler;
317318

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -167,12 +167,16 @@ public class EventDto extends SormasToSormasShareableDto {
167167
private InstitutionalPartnerType srcInstitutionalPartnerType;
168168
@Size(max = FieldConstraints.CHARACTER_LIMIT_DEFAULT, message = Validations.textTooLong)
169169
private String srcInstitutionalPartnerTypeDetails;
170+
@SensitiveData
170171
@Size(max = FieldConstraints.CHARACTER_LIMIT_DEFAULT, message = Validations.textTooLong)
171172
private String srcFirstName;
173+
@SensitiveData
172174
@Size(max = FieldConstraints.CHARACTER_LIMIT_DEFAULT, message = Validations.textTooLong)
173175
private String srcLastName;
176+
@SensitiveData
174177
@Size(max = FieldConstraints.CHARACTER_LIMIT_DEFAULT, message = Validations.textTooLong)
175178
private String srcTelNo;
179+
@SensitiveData
176180
@Size(max = FieldConstraints.CHARACTER_LIMIT_DEFAULT, message = Validations.textTooLong)
177181
private String srcEmail;
178182
@Size(max = FieldConstraints.CHARACTER_LIMIT_DEFAULT, message = Validations.textTooLong)

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

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1421,6 +1421,19 @@ public interface Captions {
14211421
String edit = "edit";
14221422
String endDateTime = "endDateTime";
14231423
String endOfProcessingDate = "endOfProcessingDate";
1424+
String EntityColumn_CAPTION = "EntityColumn.CAPTION";
1425+
String EntityColumn_DATA_PROTECTION = "EntityColumn.DATA_PROTECTION";
1426+
String EntityColumn_DESCRIPTION = "EntityColumn.DESCRIPTION";
1427+
String EntityColumn_DISEASES = "EntityColumn.DISEASES";
1428+
String EntityColumn_ENTITY = "EntityColumn.ENTITY";
1429+
String EntityColumn_EXCLUSIVE_COUNTRIES = "EntityColumn.EXCLUSIVE_COUNTRIES";
1430+
String EntityColumn_FIELD = "EntityColumn.FIELD";
1431+
String EntityColumn_FIELD_ID = "EntityColumn.FIELD_ID";
1432+
String EntityColumn_IGNORED_COUNTRIES = "EntityColumn.IGNORED_COUNTRIES";
1433+
String EntityColumn_NEW_DISEASE = "EntityColumn.NEW_DISEASE";
1434+
String EntityColumn_OUTBREAKS = "EntityColumn.OUTBREAKS";
1435+
String EntityColumn_REQUIRED = "EntityColumn.REQUIRED";
1436+
String EntityColumn_TYPE = "EntityColumn.TYPE";
14241437
String Environment = "Environment";
14251438
String Environment_description = "Environment.description";
14261439
String Environment_environmentMedia = "Environment.environmentMedia";

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1288,6 +1288,7 @@ public interface Strings {
12881288
String messageCountImmunizationsNotRestored = "messageCountImmunizationsNotRestored";
12891289
String messageCountriesArchived = "messageCountriesArchived";
12901290
String messageCountriesDearchived = "messageCountriesDearchived";
1291+
String messageCountriesExcludedFromDataProtection = "messageCountriesExcludedFromDataProtection";
12911292
String messageCountryArchived = "messageCountryArchived";
12921293
String messageCountryDearchived = "messageCountryDearchived";
12931294
String messageCountryDearchivingNotPossible = "messageCountryDearchivingNotPossible";

sormas-api/src/main/java/de/symeda/sormas/api/location/LocationDto.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -101,8 +101,10 @@ public class LocationDto extends PseudonymizableDto {
101101
CountryHelper.COUNTRY_CODE_GERMANY,
102102
CountryHelper.COUNTRY_CODE_FRANCE })
103103
private String details;
104-
@PersonalData
105-
@SensitiveData
104+
@PersonalData(excludeForCountries = {
105+
CountryHelper.COUNTRY_CODE_LUXEMBOURG })
106+
@SensitiveData(excludeForCountries = {
107+
CountryHelper.COUNTRY_CODE_LUXEMBOURG })
106108
@Size(max = FieldConstraints.CHARACTER_LIMIT_DEFAULT, message = Validations.textTooLong)
107109
private String city;
108110
@PersonalData

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,4 +27,6 @@
2727
public @interface PersonalData {
2828

2929
boolean mandatoryField() default false;
30+
31+
String[] excludeForCountries() default {};
3032
}

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

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,16 @@
11
/*
22
* SORMAS® - Surveillance Outbreak Response Management & Analysis System
33
* Copyright © 2016-2020 Helmholtz-Zentrum für Infektionsforschung GmbH (HZI)
4-
*
54
* This program is free software: you can redistribute it and/or modify
65
* it under the terms of the GNU General Public License as published by
76
* the Free Software Foundation, either version 3 of the License, or
87
* (at your option) any later version.
9-
*
108
* This program is distributed in the hope that it will be useful,
119
* but WITHOUT ANY WARRANTY; without even the implied warranty of
12-
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1311
* GNU General Public License for more details.
14-
*
1512
* You should have received a copy of the GNU General Public License
16-
* along with this program. If not, see <https://www.gnu.org/licenses/>.
13+
* along with this program. If not, see <https://www.gnu.org/licenses/>.
1714
*/
1815

1916
package de.symeda.sormas.api.utils;
@@ -28,4 +25,6 @@
2825
public @interface SensitiveData {
2926

3027
boolean mandatoryField() default false;
28+
29+
String[] excludeForCountries() default {};
3130
}

sormas-api/src/main/java/de/symeda/sormas/api/utils/fieldaccess/UiFieldAccessCheckers.java

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -48,41 +48,44 @@ public static <T> UiFieldAccessCheckers<T> getNoop() {
4848
return new UiFieldAccessCheckers<>();
4949
}
5050

51-
public static <T> UiFieldAccessCheckers<T> getDefault(boolean isPseudonymized) {
51+
public static <T> UiFieldAccessCheckers<T> getDefault(boolean isPseudonymized, String serverCountry) {
5252
UiFieldAccessCheckers<T> fieldAccessCheckers = new UiFieldAccessCheckers<>();
5353

54-
fieldAccessCheckers.add(PseudonymizedFieldAccessChecker.forPersonalData(isPseudonymized))
55-
.add(PseudonymizedFieldAccessChecker.forSensitiveData(isPseudonymized));
54+
fieldAccessCheckers.add(PseudonymizedFieldAccessChecker.forPersonalData(isPseudonymized, serverCountry))
55+
.add(PseudonymizedFieldAccessChecker.forSensitiveData(isPseudonymized, serverCountry));
5656

5757
return fieldAccessCheckers;
5858
}
5959

60-
public static <T> UiFieldAccessCheckers<T> forPersonalData(boolean isPseudonymized) {
60+
public static <T> UiFieldAccessCheckers<T> forPersonalData(boolean isPseudonymized, String serverCountry) {
6161
UiFieldAccessCheckers<T> fieldAccessCheckers = new UiFieldAccessCheckers<>();
6262

63-
fieldAccessCheckers.add(PseudonymizedFieldAccessChecker.forPersonalData(isPseudonymized));
63+
fieldAccessCheckers.add(PseudonymizedFieldAccessChecker.forPersonalData(isPseudonymized, serverCountry));
6464

6565
return fieldAccessCheckers;
6666
}
6767

68-
public static <T> UiFieldAccessCheckers<T> forSensitiveData(boolean isPseudonymized) {
68+
public static <T> UiFieldAccessCheckers<T> forSensitiveData(boolean isPseudonymized, String serverCountry) {
6969
UiFieldAccessCheckers<T> fieldAccessCheckers = new UiFieldAccessCheckers<>();
7070

71-
fieldAccessCheckers.add(PseudonymizedFieldAccessChecker.forSensitiveData(isPseudonymized));
71+
fieldAccessCheckers.add(PseudonymizedFieldAccessChecker.forSensitiveData(isPseudonymized, serverCountry));
7272

7373
return fieldAccessCheckers;
7474
}
7575

76-
public static <T> UiFieldAccessCheckers<T> forDataAccessLevel(PseudonymizableDataAccessLevel accessLevel, boolean isPseudonymized) {
76+
public static <T> UiFieldAccessCheckers<T> forDataAccessLevel(
77+
PseudonymizableDataAccessLevel accessLevel,
78+
boolean isPseudonymized,
79+
String serverCountry) {
7780

7881
switch (accessLevel) {
7982
case ALL:
8083
case NONE:
81-
return getDefault(isPseudonymized);
84+
return getDefault(isPseudonymized, serverCountry);
8285
case PERSONAL:
83-
return forSensitiveData(isPseudonymized);
86+
return forSensitiveData(isPseudonymized, serverCountry);
8487
case SENSITIVE:
85-
return forPersonalData(isPseudonymized);
88+
return forPersonalData(isPseudonymized, serverCountry);
8689
default:
8790
throw new IllegalArgumentException(accessLevel.name());
8891
}

0 commit comments

Comments
 (0)