Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#13093 - Update Data Protection for certain Data Fields - fix issues … #13176

Merged
merged 1 commit into from
Oct 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
import de.symeda.sormas.app.R;
import de.symeda.sormas.app.backend.campaign.Campaign;
import de.symeda.sormas.app.backend.campaign.form.CampaignFormMeta;
import de.symeda.sormas.app.backend.config.ConfigProvider;
import de.symeda.sormas.app.component.dialog.FormDialog;
import de.symeda.sormas.app.component.validation.FragmentValidator;
import de.symeda.sormas.app.core.notification.NotificationHelper;
Expand All @@ -51,7 +52,7 @@ public CampaignFormMetaDialog(final FragmentActivity activity, Campaign campaign
R.layout.dialog_root_two_button_panel_layout,
R.string.heading_campaign_form_meta_select,
-1,
UiFieldAccessCheckers.forSensitiveData(campaign.isPseudonymized()));
UiFieldAccessCheckers.forSensitiveData(campaign.isPseudonymized(), ConfigProvider.getServerCountryCode()));

this.campaign = campaign;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ public static CaseEditFragment newInstance(Case activityRootData) {
activityRootData,
FieldVisibilityCheckers.withDisease(activityRootData.getDisease())
.add(new CountryFieldVisibilityChecker(ConfigProvider.getServerLocale())),
UiFieldAccessCheckers.getDefault(activityRootData.isPseudonymized()));
UiFieldAccessCheckers.getDefault(activityRootData.isPseudonymized(), ConfigProvider.getServerCountryCode()));

caseEditFragment.differentPlaceOfStayJurisdiction =
activityRootData.getRegion() != null || activityRootData.getDistrict() != null || activityRootData.getCommunity() != null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ public static CaseEditHealthConditionsFragment newInstance(Case activityRootData
activityRootData,
FieldVisibilityCheckers.withDisease(activityRootData.getDisease())
.add(new CountryFieldVisibilityChecker(ConfigProvider.getServerLocale())),
UiFieldAccessCheckers.forSensitiveData(activityRootData.isPseudonymized()));
UiFieldAccessCheckers.forSensitiveData(activityRootData.isPseudonymized(), ConfigProvider.getServerCountryCode()));
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
import de.symeda.sormas.app.R;
import de.symeda.sormas.app.backend.caze.Case;
import de.symeda.sormas.app.backend.common.DatabaseHelper;
import de.symeda.sormas.app.backend.config.ConfigProvider;
import de.symeda.sormas.app.backend.hospitalization.Hospitalization;
import de.symeda.sormas.app.backend.hospitalization.PreviousHospitalization;
import de.symeda.sormas.app.component.Item;
Expand All @@ -57,7 +58,7 @@ public static CaseEditHospitalizationFragment newInstance(Case activityRootData)
null,
activityRootData,
new FieldVisibilityCheckers(),
UiFieldAccessCheckers.forSensitiveData(activityRootData.isPseudonymized()));
UiFieldAccessCheckers.forSensitiveData(activityRootData.isPseudonymized(), ConfigProvider.getServerCountryCode()));
}

// Instance methods
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
import de.symeda.sormas.app.R;
import de.symeda.sormas.app.backend.caze.Case;
import de.symeda.sormas.app.backend.caze.maternalhistory.MaternalHistory;
import de.symeda.sormas.app.backend.config.ConfigProvider;
import de.symeda.sormas.app.component.Item;
import de.symeda.sormas.app.databinding.FragmentCaseEditMaternalHistoryLayoutBinding;
import de.symeda.sormas.app.util.InfrastructureDaoHelper;
Expand All @@ -44,7 +45,7 @@ public static CaseEditMaternalHistoryFragment newInstance(Case activityRootData)
null,
activityRootData,
null,
UiFieldAccessCheckers.forSensitiveData(activityRootData.isPseudonymized()));
UiFieldAccessCheckers.forSensitiveData(activityRootData.isPseudonymized(), ConfigProvider.getServerCountryCode()));
}

// Overrides
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
import de.symeda.sormas.api.utils.ValidationException;
import de.symeda.sormas.api.utils.fieldaccess.UiFieldAccessCheckers;
import de.symeda.sormas.app.R;
import de.symeda.sormas.app.backend.config.ConfigProvider;
import de.symeda.sormas.app.backend.hospitalization.PreviousHospitalization;
import de.symeda.sormas.app.backend.infrastructure.InfrastructureHelper;
import de.symeda.sormas.app.component.Item;
Expand Down Expand Up @@ -60,7 +61,7 @@ public class PreviousHospitalizationDialog extends FormDialog {
R.layout.dialog_root_three_button_panel_layout,
R.string.heading_previous_hospitalization,
-1,
UiFieldAccessCheckers.forSensitiveData(previousHospitalization.isPseudonymized()));
UiFieldAccessCheckers.forSensitiveData(previousHospitalization.isPseudonymized(), ConfigProvider.getServerCountryCode()));

this.data = previousHospitalization;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ public static CaseReadFragment newInstance(Case activityRootData) {
activityRootData,
FieldVisibilityCheckers.withDisease(activityRootData.getDisease())
.add(new CountryFieldVisibilityChecker(ConfigProvider.getServerLocale())),
UiFieldAccessCheckers.getDefault(activityRootData.isPseudonymized()));
UiFieldAccessCheckers.getDefault(activityRootData.isPseudonymized(), ConfigProvider.getServerCountryCode()));

return caseReadFragment;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
import de.symeda.sormas.app.BaseReadFragment;
import de.symeda.sormas.app.R;
import de.symeda.sormas.app.backend.caze.Case;
import de.symeda.sormas.app.backend.config.ConfigProvider;
import de.symeda.sormas.app.backend.hospitalization.Hospitalization;
import de.symeda.sormas.app.backend.hospitalization.PreviousHospitalization;
import de.symeda.sormas.app.databinding.FragmentCaseReadHospitalizationLayoutBinding;
Expand All @@ -48,7 +49,7 @@ public static CaseReadHospitalizationFragment newInstance(Case activityRootData)
null,
activityRootData,
new FieldVisibilityCheckers(),
UiFieldAccessCheckers.forSensitiveData(activityRootData.isPseudonymized()));
UiFieldAccessCheckers.forSensitiveData(activityRootData.isPseudonymized(), ConfigProvider.getServerCountryCode()));
}

// Overrides
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
import de.symeda.sormas.app.BaseEditFragment;
import de.symeda.sormas.app.R;
import de.symeda.sormas.app.backend.clinicalcourse.ClinicalVisit;
import de.symeda.sormas.app.backend.config.ConfigProvider;
import de.symeda.sormas.app.databinding.FragmentClinicalVisitEditLayoutBinding;

public class ClinicalVisitEditFragment extends BaseEditFragment<FragmentClinicalVisitEditLayoutBinding, ClinicalVisit, ClinicalVisit> {
Expand All @@ -32,7 +33,7 @@ public static ClinicalVisitEditFragment newInstance(ClinicalVisit activityRootDa
null,
activityRootData,
null,
UiFieldAccessCheckers.forSensitiveData(activityRootData.isPseudonymized()));
UiFieldAccessCheckers.forSensitiveData(activityRootData.isPseudonymized(), ConfigProvider.getServerCountryCode()));
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ public static ContactEditFragment newInstance(Contact activityRootData) {
activityRootData,
FieldVisibilityCheckers.withDisease(activityRootData.getDisease())
.add(new CountryFieldVisibilityChecker(ConfigProvider.getServerLocale())),
UiFieldAccessCheckers.forSensitiveData(activityRootData.isPseudonymized()));
UiFieldAccessCheckers.forSensitiveData(activityRootData.isPseudonymized(), ConfigProvider.getServerCountryCode()));
}

private void setUpControlListeners(FragmentContactEditLayoutBinding contentBinding) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public static EnvironmentReadFragment newInstance(Environment activityRootData)
null,
activityRootData,
FieldVisibilityCheckers.getNoop(),
UiFieldAccessCheckers.getDefault(activityRootData.isPseudonymized()));
UiFieldAccessCheckers.getDefault(activityRootData.isPseudonymized(), ConfigProvider.getServerCountryCode()));

return environmentReadFragment;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ public static EnvironmentSampleEditFragment newInstance(EnvironmentSample activi
null,
activityRootData,
FieldVisibilityCheckers.withCountry(ConfigProvider.getServerCountryCode()),
UiFieldAccessCheckers.forSensitiveData(activityRootData.isPseudonymized()),
UiFieldAccessCheckers.forSensitiveData(activityRootData.isPseudonymized(), ConfigProvider.getServerCountryCode()),
UserRight.ENVIRONMENT_SAMPLE_EDIT);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ public class ActivityAsCaseDialog extends FormDialog {
R.string.heading_activityAsCase,
-1,
false,
UiFieldAccessCheckers.forSensitiveData(activityAsCase.isPseudonymized()),
UiFieldAccessCheckers.forSensitiveData(activityAsCase.isPseudonymized(), ConfigProvider.getServerCountryCode()),
FieldVisibilityCheckers.withDisease(getDiseaseOfCaseOrContact(activityRootData)).andWithCountry(ConfigProvider.getServerCountryCode()));

this.data = activityAsCase;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
import de.symeda.sormas.app.backend.caze.Case;
import de.symeda.sormas.app.backend.common.DatabaseHelper;
import de.symeda.sormas.app.backend.common.PseudonymizableAdo;
import de.symeda.sormas.app.backend.config.ConfigProvider;
import de.symeda.sormas.app.backend.contact.Contact;
import de.symeda.sormas.app.backend.epidata.EpiData;
import de.symeda.sormas.app.backend.exposure.Exposure;
Expand All @@ -65,7 +66,7 @@ public static EpidemiologicalDataEditFragment newInstance(PseudonymizableAdo act
null,
activityRootData,
FieldVisibilityCheckers.withDisease(getDiseaseOfCaseOrContact(activityRootData)),
UiFieldAccessCheckers.forSensitiveData(activityRootData.isPseudonymized()));
UiFieldAccessCheckers.forSensitiveData(activityRootData.isPseudonymized(), ConfigProvider.getServerCountryCode()));
}

private void setUpControlListeners(final FragmentEditEpidLayoutBinding contentBinding) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ public static EpidemiologicalDataReadFragment newInstance(Case activityRootData)
null,
activityRootData,
FieldVisibilityCheckers.withDisease(getDiseaseOfCaseOrContact(activityRootData)).andWithCountry(ConfigProvider.getServerCountryCode()),
UiFieldAccessCheckers.forSensitiveData(activityRootData.isPseudonymized()));
UiFieldAccessCheckers.forSensitiveData(activityRootData.isPseudonymized(), ConfigProvider.getServerCountryCode()));
}

public static EpidemiologicalDataReadFragment newInstance(Contact activityRootData) {
Expand All @@ -78,7 +78,7 @@ public static EpidemiologicalDataReadFragment newInstance(Contact activityRootDa
null,
activityRootData,
FieldVisibilityCheckers.withDisease(getDiseaseOfCaseOrContact(activityRootData)).andWithCountry(ConfigProvider.getServerCountryCode()),
UiFieldAccessCheckers.forSensitiveData(activityRootData.isPseudonymized()));
UiFieldAccessCheckers.forSensitiveData(activityRootData.isPseudonymized(), ConfigProvider.getServerCountryCode()));
}

private void setUpControlListeners() {
Expand Down Expand Up @@ -107,7 +107,7 @@ private void setUpControlListeners() {
ExposureDto.class,
(ViewGroup) infoDialog.getBinding().getRoot(),
FieldVisibilityCheckers.withDisease(getDiseaseOfCaseOrContact(getActivityRootData())),
UiFieldAccessCheckers.forSensitiveData(((PseudonymizableAdo) getActivityRootData()).isPseudonymized()));
UiFieldAccessCheckers.forSensitiveData(((PseudonymizableAdo) getActivityRootData()).isPseudonymized(), ConfigProvider.getServerCountryCode()));

infoDialog.show();
};
Expand Down Expand Up @@ -141,7 +141,7 @@ private void setUpControlListeners() {
(ViewGroup) infoDialog.getBinding().getRoot(),
FieldVisibilityCheckers.withDisease(getDiseaseOfCaseOrContact(getActivityRootData()))
.andWithCountry(ConfigProvider.getServerCountryCode()),
UiFieldAccessCheckers.forSensitiveData(((PseudonymizableAdo) getActivityRootData()).isPseudonymized()));
UiFieldAccessCheckers.forSensitiveData(((PseudonymizableAdo) getActivityRootData()).isPseudonymized(), ConfigProvider.getServerCountryCode()));

infoDialog.show();
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ public class ExposureDialog extends FormDialog {
R.string.heading_exposure,
-1,
false,
UiFieldAccessCheckers.forSensitiveData(exposure.isPseudonymized()),
UiFieldAccessCheckers.forSensitiveData(exposure.isPseudonymized(), ConfigProvider.getServerCountryCode()),
FieldVisibilityCheckers.withDisease(getDiseaseOfCaseOrContact(activityRootData)).andWithCountry(ConfigProvider.getServerCountryCode()));

this.data = exposure;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ public static EventEditFragment newInstance(Event activityRootData) {
null,
activityRootData,
FieldVisibilityCheckers.withCountry(ConfigProvider.getServerCountryCode()),
UiFieldAccessCheckers.getDefault(activityRootData.isPseudonymized()));
UiFieldAccessCheckers.getDefault(activityRootData.isPseudonymized(), ConfigProvider.getServerCountryCode()));

fragment.isMultiDayEvent = activityRootData.getEndDate() != null;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
import de.symeda.sormas.app.BaseEditFragment;
import de.symeda.sormas.app.R;
import de.symeda.sormas.app.backend.common.DatabaseHelper;
import de.symeda.sormas.app.backend.config.ConfigProvider;
import de.symeda.sormas.app.backend.event.EventParticipant;
import de.symeda.sormas.app.backend.location.Location;
import de.symeda.sormas.app.caze.edit.CaseNewActivity;
Expand All @@ -50,7 +51,7 @@ public static EventParticipantEditFragment newInstance(EventParticipant activity
null,
activityRootData,
new FieldVisibilityCheckers(),
UiFieldAccessCheckers.getDefault(activityRootData.isPseudonymized()));
UiFieldAccessCheckers.getDefault(activityRootData.isPseudonymized(), ConfigProvider.getServerCountryCode()));
}

// Instance methods
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
import de.symeda.sormas.app.BaseReadFragment;
import de.symeda.sormas.app.R;
import de.symeda.sormas.app.backend.common.DatabaseHelper;
import de.symeda.sormas.app.backend.config.ConfigProvider;
import de.symeda.sormas.app.backend.event.EventParticipant;
import de.symeda.sormas.app.caze.read.CaseReadActivity;
import de.symeda.sormas.app.databinding.FragmentEventParticipantReadLayoutBinding;
Expand All @@ -41,7 +42,7 @@ public static EventParticipantReadFragment newInstance(EventParticipant activity
null,
activityRootData,
FieldVisibilityCheckers.withDisease(activityRootData.getEvent().getDisease()),
UiFieldAccessCheckers.getDefault(activityRootData.isPseudonymized()));
UiFieldAccessCheckers.getDefault(activityRootData.isPseudonymized(), ConfigProvider.getServerCountryCode()));
}

// Instance methods
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ public static EventReadFragment newInstance(Event activityRootData) {
null,
activityRootData,
FieldVisibilityCheckers.withCountry(ConfigProvider.getServerCountryCode()),
UiFieldAccessCheckers.forSensitiveData(activityRootData.isPseudonymized()));
UiFieldAccessCheckers.forSensitiveData(activityRootData.isPseudonymized(), ConfigProvider.getServerCountryCode()));
}

// Overrides
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ public static ImmunizationEditFragment newInstance(Immunization activityRootData
activityRootData,
FieldVisibilityCheckers.withDisease(activityRootData.getDisease())
.add(new CountryFieldVisibilityChecker(ConfigProvider.getServerLocale())),
UiFieldAccessCheckers.getDefault(activityRootData.isPseudonymized()));
UiFieldAccessCheckers.getDefault(activityRootData.isPseudonymized(), ConfigProvider.getServerCountryCode()));

immunizationEditFragment.setMeansOfImmunizationChange(meansOfImmunizationChange);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ public static ImmunizationReadFragment newInstance(Immunization activityRootData
activityRootData,
FieldVisibilityCheckers.withDisease(activityRootData.getDisease())
.add(new CountryFieldVisibilityChecker(ConfigProvider.getServerLocale())),
UiFieldAccessCheckers.getDefault(activityRootData.isPseudonymized()));
UiFieldAccessCheckers.getDefault(activityRootData.isPseudonymized(), ConfigProvider.getServerCountryCode()));

return immunizationReadFragment;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ public static VaccinationEditFragment newInstance(Vaccination activityRootData)
null,
activityRootData,
null,
UiFieldAccessCheckers.forSensitiveData(activityRootData.isPseudonymized()));
UiFieldAccessCheckers.forSensitiveData(activityRootData.isPseudonymized(), ConfigProvider.getServerCountryCode()));
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ public static VaccinationEditHealthConditionsFragment newInstance(Vaccination ac
activityRootData,
FieldVisibilityCheckers.withDisease(activityRootData.getImmunization().getDisease())
.add(new CountryFieldVisibilityChecker(ConfigProvider.getServerLocale())),
UiFieldAccessCheckers.forSensitiveData(activityRootData.isPseudonymized()));
UiFieldAccessCheckers.forSensitiveData(activityRootData.isPseudonymized(), ConfigProvider.getServerCountryCode()));
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ public static PathogenTestEditFragment newInstance(PathogenTest activityRootData
null,
activityRootData,
FieldVisibilityCheckers.withDisease(activityRootData.getTestedDisease()).andWithCountry(ConfigProvider.getServerCountryCode()),
UiFieldAccessCheckers.forSensitiveData(activityRootData.isPseudonymized()));
UiFieldAccessCheckers.forSensitiveData(activityRootData.isPseudonymized(), ConfigProvider.getServerCountryCode()));
}

// Overrides
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ public static PathogenTestReadFragment newInstance(PathogenTest activityRootData
null,
activityRootData,
FieldVisibilityCheckers.withCountry(ConfigProvider.getServerCountryCode()),
UiFieldAccessCheckers.forSensitiveData(activityRootData.isPseudonymized()));
UiFieldAccessCheckers.forSensitiveData(activityRootData.isPseudonymized(), ConfigProvider.getServerCountryCode()));
}

// Overrides
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ public static PersonEditFragment newInstance(Case activityRootData) {
activityRootData,
FieldVisibilityCheckers.withDisease(activityRootData.getDisease())
.add(new CountryFieldVisibilityChecker(ConfigProvider.getServerLocale())),
UiFieldAccessCheckers.getDefault(activityRootData.isPseudonymized()));
UiFieldAccessCheckers.getDefault(activityRootData.isPseudonymized(), ConfigProvider.getServerCountryCode()));
}

public static PersonEditFragment newInstance(Contact activityRootData) {
Expand All @@ -111,7 +111,7 @@ public static PersonEditFragment newInstance(Contact activityRootData) {
null,
activityRootData,
FieldVisibilityCheckers.withDisease(activityRootData.getDisease()),
UiFieldAccessCheckers.getDefault(activityRootData.isPseudonymized()));
UiFieldAccessCheckers.getDefault(activityRootData.isPseudonymized(), ConfigProvider.getServerCountryCode()));
}

public static PersonEditFragment newInstance(Immunization activityRootData) {
Expand All @@ -121,7 +121,7 @@ public static PersonEditFragment newInstance(Immunization activityRootData) {
null,
activityRootData,
FieldVisibilityCheckers.withDisease(activityRootData.getDisease()),
UiFieldAccessCheckers.getDefault(activityRootData.isPseudonymized()));
UiFieldAccessCheckers.getDefault(activityRootData.isPseudonymized(), ConfigProvider.getServerCountryCode()));
}

public static PersonEditFragment newInstance(EventParticipant activityRootData) {
Expand All @@ -131,7 +131,7 @@ public static PersonEditFragment newInstance(EventParticipant activityRootData)
null,
activityRootData,
FieldVisibilityCheckers.withDisease(activityRootData.getEvent().getDisease()),
UiFieldAccessCheckers.getDefault(activityRootData.isPseudonymized()));
UiFieldAccessCheckers.getDefault(activityRootData.isPseudonymized(), ConfigProvider.getServerCountryCode()));
}

private void setUpLayoutBinding(final BaseEditFragment fragment, final Person record, final FragmentPersonEditLayoutBinding contentBinding) {
Expand Down
Loading
Loading