Skip to content

Commit

Permalink
[GITFLOW]merging 'release-1.95.0' into 'master'
Browse files Browse the repository at this point in the history
  • Loading branch information
jenkins committed Feb 22, 2024
2 parents df4501b + 870ed75 commit 372af4b
Show file tree
Hide file tree
Showing 469 changed files with 16,133 additions and 3,312 deletions.
2 changes: 1 addition & 1 deletion sormas-api/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<parent>
<groupId>de.symeda.sormas</groupId>
<artifactId>sormas-base</artifactId>
<version>1.94.0</version>
<version>1.95.0</version>
<relativePath>../sormas-base</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@
import de.symeda.sormas.api.sormastosormas.share.incoming.SormasToSormasShareRequestFacade;
import de.symeda.sormas.api.sormastosormas.share.outgoing.ShareRequestInfoFacade;
import de.symeda.sormas.api.sormastosormas.share.outgoing.SormasToSormasShareInfoFacade;
import de.symeda.sormas.api.specialcaseaccess.SpecialCaseAccessFacade;
import de.symeda.sormas.api.symptoms.SymptomsFacade;
import de.symeda.sormas.api.systemevents.SystemEventFacade;
import de.symeda.sormas.api.systemevents.sync.SyncFacade;
Expand Down Expand Up @@ -524,6 +525,10 @@ public static ManualMessageLogFacade getManualMessageLogFacade() {
return get().lookupEjbRemote(ManualMessageLogFacade.class);
}

public static SpecialCaseAccessFacade getSpecialCaseAccessFacade() {
return get().lookupEjbRemote(SpecialCaseAccessFacade.class);
}

@SuppressWarnings("unchecked")
public <P> P lookupEjbRemote(Class<P> clazz) {
try {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@
import de.symeda.sormas.api.utils.DependingOnUserRight;
import de.symeda.sormas.api.utils.Diseases;
import de.symeda.sormas.api.utils.EmbeddedPersonalData;
import de.symeda.sormas.api.utils.EmbeddedSensitiveData;
import de.symeda.sormas.api.utils.FieldConstraints;
import de.symeda.sormas.api.utils.HideForCountries;
import de.symeda.sormas.api.utils.HideForCountriesExcept;
Expand All @@ -85,7 +86,7 @@
import de.symeda.sormas.api.utils.pseudonymization.valuepseudonymizers.LongitudePseudonymizer;

@DependingOnFeatureType(featureType = FeatureType.CASE_SURVEILANCE)
public class CaseDataDto extends SormasToSormasShareableDto {
public class CaseDataDto extends SormasToSormasShareableDto implements IsCase {

private static final long serialVersionUID = 5007131477733638086L;
private static final long MILLISECONDS_30_DAYS = 30L * 24L * 60L * 60L * 1000L;
Expand Down Expand Up @@ -342,6 +343,8 @@ public class CaseDataDto extends SormasToSormasShareableDto {
private String healthFacilityDetails;

@Valid
@EmbeddedPersonalData
@EmbeddedSensitiveData
private HealthConditionsDto healthConditions;

private YesNoUnknown pregnant;
Expand Down Expand Up @@ -408,6 +411,8 @@ public class CaseDataDto extends SormasToSormasShareableDto {
@Valid
private HospitalizationDto hospitalization;
@Valid
@EmbeddedPersonalData
@EmbeddedSensitiveData
private SymptomsDto symptoms;
@Valid
private EpiDataDto epiData;
Expand All @@ -416,6 +421,8 @@ public class CaseDataDto extends SormasToSormasShareableDto {
@Valid
private ClinicalCourseDto clinicalCourse;
@Valid
@EmbeddedPersonalData
@EmbeddedSensitiveData
private MaternalHistoryDto maternalHistory;
@Size(max = 32, message = Validations.textTooLong)
private String creationVersion;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@
import de.symeda.sormas.api.user.UserRoleReferenceDto;
import de.symeda.sormas.api.utils.DataHelper;
import de.symeda.sormas.api.utils.DependingOnUserRight;
import de.symeda.sormas.api.utils.EmbeddedSensitiveData;
import de.symeda.sormas.api.utils.HideForCountries;
import de.symeda.sormas.api.utils.HideForCountriesExcept;
import de.symeda.sormas.api.utils.LocationHelper;
Expand All @@ -80,7 +81,7 @@
* recommended to remove properties that are removed from this file from existing export configurations.
*/
@ExportEntity(CaseDataDto.class)
public class CaseExportDto extends AbstractUuidDto {
public class CaseExportDto extends AbstractUuidDto implements IsCase {

private static final long serialVersionUID = 8581579464816945555L;

Expand Down Expand Up @@ -140,6 +141,7 @@ public class CaseExportDto extends AbstractUuidDto {
private YesNoUnknown pregnant;
private String approximateAge;
private String ageGroup;
@EmbeddedSensitiveData
private BirthDateDto birthdate;
private Date reportDate;
private String region;
Expand Down Expand Up @@ -191,6 +193,7 @@ public class CaseExportDto extends AbstractUuidDto {
private String initialDetectionPlace;
private PresentCondition presentCondition;
private Date deathDate;
@EmbeddedSensitiveData
private BurialInfoDto burialInfo;
private String addressRegion;
private String addressDistrict;
Expand Down Expand Up @@ -241,6 +244,7 @@ public class CaseExportDto extends AbstractUuidDto {
private boolean traveled;
private boolean burialAttended;
private YesNoUnknown contactWithSourceCaseKnown;
@EmbeddedSensitiveData
private SymptomsDto symptoms;
// private Date onsetDate;
// private String symptoms;
Expand All @@ -261,8 +265,11 @@ public class CaseExportDto extends AbstractUuidDto {
private int numberOfPrescriptions;
private int numberOfTreatments;
private int numberOfClinicalVisits;
@EmbeddedSensitiveData
private EmbeddedSampleExportDto sample1 = new EmbeddedSampleExportDto(null);
@EmbeddedSensitiveData
private EmbeddedSampleExportDto sample2 = new EmbeddedSampleExportDto(null);
@EmbeddedSensitiveData
private EmbeddedSampleExportDto sample3 = new EmbeddedSampleExportDto(null);
private List<EmbeddedSampleExportDto> otherSamples = new ArrayList<>();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -231,4 +231,6 @@ List<ProcessedEntity> saveBulkEditWithFacilities(
boolean hasOtherValidVaccination(CaseDataDto caze, String vaccinationUuid);

Pair<RegionReferenceDto, DistrictReferenceDto> getRegionAndDistrictRefsOf(CaseReferenceDto caze);

boolean hasCurrentUserSpecialAccess(CaseReferenceDto caze);
}
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
import de.symeda.sormas.api.followup.FollowUpDto;
import de.symeda.sormas.api.person.SymptomJournalStatus;

public class CaseFollowUpDto extends FollowUpDto {
public class CaseFollowUpDto extends FollowUpDto implements IsCase {

private static final long serialVersionUID = -7782443664670559221L;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,13 @@
import de.symeda.sormas.api.person.Sex;
import de.symeda.sormas.api.person.SymptomJournalStatus;
import de.symeda.sormas.api.share.ExternalShareStatus;
import de.symeda.sormas.api.utils.EmbeddedPersonalData;
import de.symeda.sormas.api.utils.PersonalData;
import de.symeda.sormas.api.utils.SensitiveData;
import de.symeda.sormas.api.utils.pseudonymization.PseudonymizableIndexDto;
import de.symeda.sormas.api.uuid.HasUuid;

public class CaseIndexDto extends PseudonymizableIndexDto implements MergeableIndexDto, Serializable, Cloneable, HasUuid {
public class CaseIndexDto extends PseudonymizableIndexDto implements MergeableIndexDto, Serializable, Cloneable, HasUuid, IsCase {

private static final long serialVersionUID = -7764607075875188799L;

Expand Down Expand Up @@ -110,6 +111,7 @@ public class CaseIndexDto extends PseudonymizableIndexDto implements MergeableIn
private String surveillanceOfficerUuid;
private CaseOutcome outcome;
private Sex sex;
@EmbeddedPersonalData
private AgeAndBirthDateDto ageAndBirthDate;
private Float completeness;
private Date quarantineTo;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import de.symeda.sormas.api.Disease;
import de.symeda.sormas.api.utils.pseudonymization.PseudonymizableIndexDto;

public class CaseListEntryDto extends PseudonymizableIndexDto implements Serializable, Cloneable {
public class CaseListEntryDto extends PseudonymizableIndexDto implements Serializable, Cloneable, IsCase {

private static final long serialVersionUID = -8812926682263746469L;
private Date reportDate;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
import de.symeda.sormas.api.utils.PersonalData;

@DependingOnFeatureType(featureType = FeatureType.CASE_SURVEILANCE)
public class CaseReferenceDto extends ReferenceDto {
public class CaseReferenceDto extends ReferenceDto implements IsCase {

private static final long serialVersionUID = 5007131477733638086L;

Expand Down Expand Up @@ -82,4 +82,8 @@ public static String buildCaption(String uuid, String firstName, String lastName

return shortUuid;
}

public String getName() {
return PersonDto.buildCaption(firstName, lastName);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@

import de.symeda.sormas.api.Disease;
import de.symeda.sormas.api.person.Sex;
import de.symeda.sormas.api.utils.EmbeddedPersonalData;
import de.symeda.sormas.api.utils.PersonalData;
import de.symeda.sormas.api.utils.SensitiveData;
import de.symeda.sormas.api.utils.pseudonymization.PseudonymizableIndexDto;
import org.apache.commons.lang3.StringUtils;

public class CaseSelectionDto extends PseudonymizableIndexDto implements Serializable, Cloneable {
public class CaseSelectionDto extends PseudonymizableIndexDto implements Serializable, Cloneable, IsCase {

public static final String I18N_PREFIX = "CaseData";

Expand All @@ -36,6 +36,7 @@ public class CaseSelectionDto extends PseudonymizableIndexDto implements Seriali
@PersonalData
@SensitiveData
private String personLastName;
@EmbeddedPersonalData
private AgeAndBirthDateDto ageAndBirthDate;
private String responsibleDistrictName;
@PersonalData
Expand Down
21 changes: 21 additions & 0 deletions sormas-api/src/main/java/de/symeda/sormas/api/caze/IsCase.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
/*
* SORMAS® - Surveillance Outbreak Response Management & Analysis System
* Copyright © 2016-2024 Helmholtz-Zentrum für Infektionsforschung GmbH (HZI)
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/

package de.symeda.sormas.api.caze;

import de.symeda.sormas.api.uuid.HasUuid;

public interface IsCase extends HasUuid {
}
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,16 @@
import de.symeda.sormas.api.Disease;
import de.symeda.sormas.api.person.PersonReferenceDto;
import de.symeda.sormas.api.utils.DataHelper;
import de.symeda.sormas.api.utils.EmbeddedPersonalData;
import de.symeda.sormas.api.utils.EmbeddedSensitiveData;
import de.symeda.sormas.api.utils.PersonalData;
import de.symeda.sormas.api.utils.SensitiveData;
import de.symeda.sormas.api.utils.pseudonymization.Pseudonymizer;
import de.symeda.sormas.api.utils.pseudonymization.valuepseudonymizers.LatitudePseudonymizer;
import de.symeda.sormas.api.utils.pseudonymization.valuepseudonymizers.LongitudePseudonymizer;
import de.symeda.sormas.api.uuid.AbstractUuidDto;

public class MapCaseDto extends AbstractUuidDto {
public class MapCaseDto extends AbstractUuidDto implements IsCase {

private static final long serialVersionUID = -3021332968056368431L;

Expand All @@ -35,6 +37,8 @@ public class MapCaseDto extends AbstractUuidDto {
private Date reportDate;
private CaseClassification caseClassification;
private Disease disease;
@EmbeddedPersonalData
@EmbeddedSensitiveData
private PersonReferenceDto person;
@PersonalData
@SensitiveData
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,16 +59,6 @@ public class SurveillanceReportDto extends SormasToSormasShareableDto {

private String externalId;

public static SurveillanceReportDto build(CaseReferenceDto caze, UserReferenceDto reportingUser) {
SurveillanceReportDto surveillanceReport = new SurveillanceReportDto();

surveillanceReport.setUuid(DataHelper.createUuid());
surveillanceReport.setCaze(caze);
surveillanceReport.setReportingUser(reportingUser);

return surveillanceReport;
}

@NotNull(message = Validations.validReportDateTime)
private Date reportDate;

Expand All @@ -92,6 +82,16 @@ public static SurveillanceReportDto build(CaseReferenceDto caze, UserReferenceDt

private CaseReferenceDto caze;

public static SurveillanceReportDto build(CaseReferenceDto caze, UserReferenceDto reportingUser) {
SurveillanceReportDto surveillanceReport = new SurveillanceReportDto();

surveillanceReport.setUuid(DataHelper.createUuid());
surveillanceReport.setCaze(caze);
surveillanceReport.setReportingUser(reportingUser);

return surveillanceReport;
}

public ReportingType getReportingType() {
return reportingType;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
import de.symeda.sormas.api.symptoms.SymptomsDto;
import de.symeda.sormas.api.utils.DataHelper;
import de.symeda.sormas.api.utils.DependingOnFeatureType;
import de.symeda.sormas.api.utils.EmbeddedSensitiveData;
import de.symeda.sormas.api.utils.FieldConstraints;
import de.symeda.sormas.api.utils.SensitiveData;
import de.symeda.sormas.api.utils.pseudonymization.PseudonymizableDto;
Expand All @@ -33,6 +34,7 @@ public class ClinicalVisitDto extends PseudonymizableDto {

private ClinicalCourseReferenceDto clinicalCourse;
@Valid
@EmbeddedSensitiveData
private SymptomsDto symptoms;
private Disease disease;
private Date visitDateTime;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import java.io.Serializable;

import de.symeda.sormas.api.audit.AuditedClass;
import de.symeda.sormas.api.uuid.HasUuid;

@AuditedClass
public class ProcessedEntity implements Serializable {
Expand All @@ -11,6 +12,14 @@ public class ProcessedEntity implements Serializable {

ProcessedEntityStatus processedEntityStatus;

public static ProcessedEntity successful(HasUuid entity) {
return new ProcessedEntity(entity.getUuid(), ProcessedEntityStatus.SUCCESS);
}

public static ProcessedEntity failedInternally(HasUuid entity) {
return new ProcessedEntity(entity.getUuid(), ProcessedEntityStatus.INTERNAL_FAILURE);
}

public ProcessedEntity(String entityUuid, ProcessedEntityStatus processedEntityStatus) {
this.entityUuid = entityUuid;
this.processedEntityStatus = processedEntityStatus;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@
import de.symeda.sormas.api.utils.pseudonymization.valuepseudonymizers.LongitudePseudonymizer;

@DependingOnFeatureType(featureType = FeatureType.CONTACT_TRACING)
public class ContactDto extends SormasToSormasShareableDto {
public class ContactDto extends SormasToSormasShareableDto implements IsContact {

private static final long serialVersionUID = -7764607075875188799L;

Expand Down Expand Up @@ -149,6 +149,7 @@ public class ContactDto extends SormasToSormasShareableDto {
public static final String DELETION_REASON = "deletionReason";
public static final String OTHER_DELETION_REASON = "otherDeletionReason";

@EmbeddedPersonalData
private CaseReferenceDto caze;
@Size(max = FieldConstraints.CHARACTER_LIMIT_DEFAULT, message = Validations.textTooLong)
private String caseIdExternalSystem;
Expand Down Expand Up @@ -254,6 +255,7 @@ public class ContactDto extends SormasToSormasShareableDto {
@SensitiveData
private UserReferenceDto contactOfficer;

@EmbeddedPersonalData
private CaseReferenceDto resultingCase; // read-only now, but editable long-term
@SensitiveData
private UserReferenceDto resultingCaseUser;
Expand Down Expand Up @@ -611,12 +613,7 @@ public void setReportLatLonAccuracy(Float reportLatLonAccuracy) {
}

public ContactReferenceDto toReference() {
return new ContactReferenceDto(
getUuid(),
getPerson().getFirstName(),
getPerson().getLastName(),
getCaze() != null ? getCaze().getFirstName() : null,
getCaze() != null ? getCaze().getLastName() : null);
return new ContactReferenceDto(getUuid(), getPerson().getFirstName(), getPerson().getLastName(), getCaze());
}

public UserReferenceDto getResultingCaseUser() {
Expand Down
Loading

0 comments on commit 372af4b

Please sign in to comment.