Skip to content

Commit

Permalink
[GITFLOW]merging 'release-1.79.0' into 'master'
Browse files Browse the repository at this point in the history
  • Loading branch information
jenkins committed Jan 27, 2023
2 parents aae9f89 + 0d1e719 commit c09a6cb
Show file tree
Hide file tree
Showing 494 changed files with 6,893 additions and 2,251 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.78.0</version>
<version>1.79.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 @@ -4,5 +4,5 @@ public enum EditPermissionType {
ALLOWED,
ARCHIVING_STATUS_ONLY,
REFUSED,
DOCUMENTS_ONLY
WITHOUT_OWNERSHIP
}
3 changes: 2 additions & 1 deletion sormas-api/src/main/java/de/symeda/sormas/api/EntityDto.java
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
import de.symeda.sormas.api.audit.AuditedClass;
import de.symeda.sormas.api.i18n.Validations;
import de.symeda.sormas.api.utils.FieldConstraints;
import de.symeda.sormas.api.utils.HasCaption;
import de.symeda.sormas.api.utils.Outbreaks;
import de.symeda.sormas.api.uuid.HasUuid;

Expand All @@ -43,7 +44,7 @@
*/
@AuditedClass
@JsonInclude(JsonInclude.Include.NON_NULL)
public abstract class EntityDto implements Serializable, Cloneable, HasUuid {
public abstract class EntityDto implements Serializable, Cloneable, HasUuid, HasCaption {

private static final long serialVersionUID = -1L;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,13 @@
import java.util.HashMap;
import java.util.Map;

import de.symeda.sormas.api.uuid.HasUuid;
import org.apache.commons.lang3.StringUtils;

import de.symeda.sormas.api.caze.BirthDateDto;
import de.symeda.sormas.api.caze.BurialInfoDto;
import de.symeda.sormas.api.utils.DataHelper;
import de.symeda.sormas.api.utils.HasCaption;
import de.symeda.sormas.api.uuid.HasUuid;

public class EntityDtoAccessHelper {

Expand Down Expand Up @@ -114,6 +115,7 @@ public static Object formatObject(Object value) {
} else if (value instanceof Date
|| value instanceof BurialInfoDto
|| value instanceof BirthDateDto
|| value instanceof HasCaption
|| value.getClass().equals(Boolean.class)) {
return DataHelper.valueToString(value);
} else {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,26 @@
package de.symeda.sormas.api;

import java.util.Arrays;
import java.util.stream.Collectors;

import de.symeda.sormas.api.i18n.I18nProperties;

public enum EntityRelevanceStatus {

ACTIVE,
ARCHIVED,
ALL;
ACTIVE_AND_ARCHIVED,
DELETED;

@Override
public String toString() {
return I18nProperties.getEnumCaption(this);
}

public static EntityRelevanceStatus[] getAllExceptDeleted() {
return Arrays.stream(EntityRelevanceStatus.values())
.filter(val -> val != EntityRelevanceStatus.DELETED)
.collect(Collectors.toList())
.toArray(new EntityRelevanceStatus[] {});
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
import de.symeda.sormas.api.caze.caseimport.CaseImportFacade;
import de.symeda.sormas.api.caze.classification.CaseClassificationFacade;
import de.symeda.sormas.api.caze.maternalhistory.MaternalHistoryFacade;
import de.symeda.sormas.api.caze.porthealthinfo.PortHealthInfoFacade;
import de.symeda.sormas.api.caze.surveillancereport.SurveillanceReportFacade;
import de.symeda.sormas.api.clinicalcourse.ClinicalCourseFacade;
import de.symeda.sormas.api.clinicalcourse.ClinicalVisitFacade;
Expand Down Expand Up @@ -318,6 +319,10 @@ public static PointOfEntryFacade getPointOfEntryFacade() {
return get().lookupEjbRemote(PointOfEntryFacade.class);
}

public static PortHealthInfoFacade getPortHealthInfoFacade() {
return get().lookupEjbRemote(PortHealthInfoFacade.class);
}

public static PopulationDataFacade getPopulationDataFacade() {
return get().lookupEjbRemote(PopulationDataFacade.class);
}
Expand Down
11 changes: 9 additions & 2 deletions sormas-api/src/main/java/de/symeda/sormas/api/ReferenceDto.java
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,17 @@
import javax.validation.constraints.Pattern;

import org.apache.commons.lang3.ObjectUtils;
import org.apache.commons.lang3.StringUtils;

import de.symeda.sormas.api.audit.AuditIncludeProperty;
import de.symeda.sormas.api.audit.AuditedClass;
import de.symeda.sormas.api.i18n.Validations;
import de.symeda.sormas.api.utils.HasCaption;
import de.symeda.sormas.api.utils.Required;
import de.symeda.sormas.api.uuid.HasUuid;

@AuditedClass
public abstract class ReferenceDto implements Serializable, HasUuid, Comparable<ReferenceDto> {
public abstract class ReferenceDto implements Serializable, HasUuid, HasCaption, Comparable<ReferenceDto> {

public static final String CAPTION = "caption";
public static final String NO_REFERENCE_UUID = "SORMAS-CONSTID-NO-REFERENCE";
Expand Down Expand Up @@ -70,10 +72,15 @@ public void setCaption(String caption) {
}

@Override
public String toString() {
public String buildCaption() {
return getCaption();
}

@Override
public String toString() {
return getClass().getSimpleName() + StringUtils.SPACE + this.getUuid();
}

@Override
public boolean equals(Object o) {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ public class CampaignCriteria extends BaseCriteria implements Serializable {
private Date startDateBefore;
private Date endDateAfter;
private Date endDateBefore;
private Boolean deleted = Boolean.FALSE;
private String freeText;
private EntityRelevanceStatus relevanceStatus;

Expand Down Expand Up @@ -55,16 +54,6 @@ public Date getEndDateBefore() {
return endDateBefore;
}

public CampaignCriteria deleted(Boolean deleted) {
this.deleted = deleted;
return this;
}

@IgnoreForUrl
public Boolean getDeleted() {
return deleted;
}

public CampaignCriteria freeText(String freeText) {
this.freeText = freeText;
return this;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,6 @@ public class CaseCriteria extends CriteriaWithDateType implements ExternalShareC
private Boolean withExtendedQuarantine;
private Boolean withReducedQuarantine;
private Boolean onlyQuarantineHelpNeeded;
private Boolean deleted = Boolean.FALSE;
private String caseLike;
private String eventLike;
private Boolean onlyCasesWithEvents = Boolean.FALSE;
Expand Down Expand Up @@ -452,16 +451,6 @@ public EntityRelevanceStatus getRelevanceStatus() {
return relevanceStatus;
}

public CaseCriteria deleted(Boolean deleted) {
this.deleted = deleted;
return this;
}

@IgnoreForUrl
public Boolean getDeleted() {
return deleted;
}

/**
* returns all entries that match ALL of the passed words
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,11 @@
import java.util.List;
import java.util.Map;
import java.util.Set;

import org.apache.commons.lang3.StringUtils;
import java.util.stream.Collectors;

import de.symeda.sormas.api.CountryHelper;
import de.symeda.sormas.api.Disease;
import de.symeda.sormas.api.ReferenceDto;
import de.symeda.sormas.api.clinicalcourse.HealthConditionsDto;
import de.symeda.sormas.api.contact.FollowUpStatus;
import de.symeda.sormas.api.contact.QuarantineType;
Expand Down Expand Up @@ -2334,7 +2334,7 @@ public String getReportingUserRoles() {
}

public void setReportingUserRoles(Set<UserRoleReferenceDto> roles) {
this.reportingUserRoles = StringUtils.join(roles, ", ");
this.reportingUserRoles = roles.stream().map(ReferenceDto::buildCaption).collect(Collectors.joining(", "));
}

@Order(177)
Expand All @@ -2361,33 +2361,36 @@ public String getFollowUpStatusChangeUserRoles() {
return followUpStatusChangeUserRoles;
}


@Order(179)
@ExportTarget(caseExportTypes = {
CaseExportType.CASE_SURVEILLANCE,
CaseExportType.CASE_MANAGEMENT })
CaseExportType.CASE_SURVEILLANCE,
CaseExportType.CASE_MANAGEMENT })
@ExportProperty(CaseDataDto.INVESTIGATED_DATE)
@ExportGroup(ExportGroupType.ADDITIONAL)
public Date getDateOfInvestigation() {
return dateOfInvestigation;
}

public void setDateOfInvestigation(Date dateOfInvestigation) {
this.dateOfInvestigation = dateOfInvestigation;
}

@Order(180)
@ExportTarget(caseExportTypes = {
CaseExportType.CASE_SURVEILLANCE,
CaseExportType.CASE_MANAGEMENT })
CaseExportType.CASE_SURVEILLANCE,
CaseExportType.CASE_MANAGEMENT })
@ExportProperty(CaseDataDto.OUTCOME_DATE)
@ExportGroup(ExportGroupType.ADDITIONAL)
public Date getDateOfOutcome() {
return dateOfOutcome;
}

public void setDateOfInvestigation(Date dateOfInvestigation) { this.dateOfInvestigation = dateOfInvestigation; }

public void setDateOfOutcome(Date dateOfOutcome) { this.dateOfOutcome = dateOfOutcome; }
public void setDateOfOutcome(Date dateOfOutcome) {
this.dateOfOutcome = dateOfOutcome;
}

public void setFollowUpStatusChangeUserRoles(Set<UserRoleReferenceDto> roles) {
this.followUpStatusChangeUserRoles = StringUtils.join(roles, ", ");
this.followUpStatusChangeUserRoles = roles.stream().map(ReferenceDto::buildCaption).collect(Collectors.joining(", "));;
}

public void setCountry(String country) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import java.util.Date;

import de.symeda.sormas.api.Disease;
import de.symeda.sormas.api.common.DeletionReason;
import de.symeda.sormas.api.contact.FollowUpStatus;
import de.symeda.sormas.api.disease.DiseaseVariant;
import de.symeda.sormas.api.event.EventStatus;
Expand Down Expand Up @@ -81,7 +82,7 @@ public CaseIndexDetailedDto(long id, String uuid, String epidNumber, String exte
String pointOfEntryUuid, String pointOfEntryName, String pointOfEntryDetails, String surveillanceOfficerUuid, CaseOutcome outcome,
Integer age, ApproximateAgeType ageType, Integer birthdateDD, Integer birthdateMM, Integer birthdateYYYY, Sex sex,
Date quarantineTo, Float completeness, FollowUpStatus followUpStatus, Date followUpUntil, SymptomJournalStatus symptomJournalStatus, VaccinationStatus vaccinationStatus, Date changeDate, Long facilityId,
String responsibleRegionUuid, String responsibleDistrictUuid, String responsibleDistrictName, boolean isInJurisdiction,
String responsibleRegionUuid, String responsibleDistrictUuid, String responsibleDistrictName, DeletionReason deletionReason, String otherDeleteReason, boolean isInJurisdiction,
//detailed fields
YesNoUnknown reInfection, String city, String street, String houseNumber, String additionalInformation, String postalCode, String phone,
String reportingUserUuid, String reportingUserFirstName, String reportingUserLastName, Date symptomOnsetDate,
Expand All @@ -94,7 +95,7 @@ public CaseIndexDetailedDto(long id, String uuid, String epidNumber, String exte
healthFacilityName, healthFacilityDetails, pointOfEntryUuid, pointOfEntryName, pointOfEntryDetails, surveillanceOfficerUuid, outcome,
age, ageType, birthdateDD, birthdateMM, birthdateYYYY, sex,
quarantineTo, completeness, followUpStatus, followUpUntil, symptomJournalStatus, vaccinationStatus, changeDate, facilityId,
responsibleRegionUuid, responsibleDistrictUuid, responsibleDistrictName, isInJurisdiction, visitCount, latestChangedDate);
responsibleRegionUuid, responsibleDistrictUuid, responsibleDistrictName, deletionReason, otherDeleteReason, isInJurisdiction, visitCount, latestChangedDate);
//@formatter:on

this.reInfection = reInfection;
Expand All @@ -113,6 +114,7 @@ public CaseIndexDetailedDto(long id, String uuid, String epidNumber, String exte
this.responsibleCommunity = responsibleCommunity;
}

//@formatter:off
public CaseIndexDetailedDto(
long id, String uuid, String epidNumber, String externalID, String externalToken, String internalToken,
String personUuid, String personFirstName, String personLastName,
Expand All @@ -125,7 +127,7 @@ public CaseIndexDetailedDto(
CaseOutcome outcome, Integer age, ApproximateAgeType ageType, Integer birthdateDD, Integer birthdateMM, Integer birthdateYYYY,
Sex sex, Date quarantineTo, Float completeness, FollowUpStatus followUpStatus, Date followUpUntil,
SymptomJournalStatus symptomJournalStatus, VaccinationStatus vaccinationStatus, Date changeDate, Long facilityId,
String responsibleRegionUuid, String responsibleDistrictUuid, String responsibleDistrictName, boolean isInJurisdiction,
String responsibleRegionUuid, String responsibleDistrictUuid, String responsibleDistrictName, DeletionReason deletionReason, String otherDeleteReason, boolean isInJurisdiction,
//detailed fields
YesNoUnknown reInfection, String city, String street, String houseNumber, String additionalInformation,
String postalCode, String phone, String reportingUserUuid, String reportingUserFirstName, String reportingUserLastName,
Expand All @@ -137,10 +139,11 @@ public CaseIndexDetailedDto(
healthFacilityDetails, pointOfEntryUuid, pointOfEntryName, pointOfEntryDetails, surveillanceOfficerUuid,
outcome, age, ageType, birthdateDD, birthdateMM, birthdateYYYY, sex, quarantineTo, completeness,
followUpStatus, followUpUntil, symptomJournalStatus, vaccinationStatus, changeDate, facilityId,
responsibleRegionUuid, responsibleDistrictUuid, responsibleDistrictName, isInJurisdiction, reInfection,
responsibleRegionUuid, responsibleDistrictUuid, responsibleDistrictName, deletionReason, otherDeleteReason, isInJurisdiction, reInfection,
city, street, houseNumber, additionalInformation, postalCode, phone, reportingUserUuid,
reportingUserFirstName, reportingUserLastName, symptomOnsetDate, responsibleRegion, responsibleCommunity,
visitCount, 0, latestSampleDateTime, sampleCount, latestChangedDate);
//@formatter:on
}

public YesNoUnknown getReInfection() {
Expand Down
Loading

0 comments on commit c09a6cb

Please sign in to comment.