Skip to content

Commit

Permalink
[GITFLOW]merging 'release-1.93.0' into 'master'
Browse files Browse the repository at this point in the history
  • Loading branch information
jenkins committed Dec 23, 2023
2 parents df074e0 + 1639821 commit 3aa26a4
Show file tree
Hide file tree
Showing 415 changed files with 8,796 additions and 836 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.92.0</version>
<version>1.93.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 @@ -84,6 +84,8 @@ public interface ConfigFacade {

boolean isDuplicateChecksExcludePersonsOfArchivedEntries();

boolean isDuplicateChecksNationalHealthIdOverridesCriteria();

double getNameSimilarityThreshold();

int getInfrastructureSyncThreshold();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@
import de.symeda.sormas.api.infrastructure.pointofentry.PointOfEntryFacade;
import de.symeda.sormas.api.infrastructure.region.RegionFacade;
import de.symeda.sormas.api.infrastructure.subcontinent.SubcontinentFacade;
import de.symeda.sormas.api.manualmessagelog.ManualMessageLogFacade;
import de.symeda.sormas.api.outbreak.OutbreakFacade;
import de.symeda.sormas.api.person.PersonFacade;
import de.symeda.sormas.api.report.AggregateReportFacade;
Expand Down Expand Up @@ -519,6 +520,10 @@ public static ExternalEmailFacade getExternalEmailFacade() {
return get().lookupEjbRemote(ExternalEmailFacade.class);
}

public static ManualMessageLogFacade getManualMessageLogFacade() {
return get().lookupEjbRemote(ManualMessageLogFacade.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 @@ -48,7 +48,7 @@
import de.symeda.sormas.api.infrastructure.district.DistrictDto;
import de.symeda.sormas.api.infrastructure.district.DistrictReferenceDto;
import de.symeda.sormas.api.infrastructure.region.RegionReferenceDto;
import de.symeda.sormas.api.messaging.ManualMessageLogDto;
import de.symeda.sormas.api.manualmessagelog.ManualMessageLogDto;
import de.symeda.sormas.api.messaging.MessageType;
import de.symeda.sormas.api.person.PersonReferenceDto;
import de.symeda.sormas.api.sample.PathogenTestDto;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ public abstract class CustomizableEnum implements Serializable {

private static final long serialVersionUID = 8698428745095686559L;

public static final String I18N_PREFIX = "CustomizableEnum";

/**
* The enum value, identical {@link CustomizableEnumValueDto#getValue()}.
*/
Expand Down Expand Up @@ -93,4 +95,6 @@ public boolean equals(Object o) {
public int hashCode() {
return Objects.hash(value);
}

public abstract Map<String, Class<?>> getAllProperties();
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
/*
* SORMAS® - Surveillance Outbreak Response Management & Analysis System
* Copyright © 2016-2023 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.customizableenum;

import java.io.Serializable;

import de.symeda.sormas.api.Disease;
import de.symeda.sormas.api.utils.criteria.BaseCriteria;

public class CustomizableEnumCriteria extends BaseCriteria implements Serializable, Cloneable {

private static final long serialVersionUID = 6254688396874544620L;

private String freeTextFilter;
private CustomizableEnumType dataType;
private Disease disease;

public String getFreeTextFilter() {
return freeTextFilter;
}

public CustomizableEnumCriteria freeTextFilter(String freeTextFilter) {
this.freeTextFilter = freeTextFilter;
return this;
}

public CustomizableEnumType getDataType() {
return dataType;
}

public CustomizableEnumCriteria dataType(CustomizableEnumType dataType) {
this.dataType = dataType;
return this;
}

public Disease getDisease() {
return disease;
}

public CustomizableEnumCriteria disease(Disease disease) {
this.disease = disease;
return this;
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,12 @@

import javax.ejb.Remote;

import de.symeda.sormas.api.BaseFacade;
import de.symeda.sormas.api.Disease;

@Remote
public interface CustomizableEnumFacade {
public interface CustomizableEnumFacade
extends BaseFacade<CustomizableEnumValueDto, CustomizableEnumValueIndexDto, CustomizableEnumValueReferenceDto, CustomizableEnumCriteria> {

List<CustomizableEnumValueDto> getAllAfter(Date date);

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
/*
* SORMAS® - Surveillance Outbreak Response Management & Analysis System
* Copyright © 2016-2023 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.customizableenum;

import java.util.regex.Pattern;

public class CustomizableEnumHelper {

private static final String ENUM_VALUE_PATTERN = "[A-Z0-9_.]+";

public static boolean isValidEnumValue(String value) {
return Pattern.matches(ENUM_VALUE_PATTERN, value);
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,15 @@ public class CustomizableEnumTranslation implements Serializable {
@Size(max = CHARACTER_LIMIT_DEFAULT, message = Validations.textTooLong)
private String value;

public CustomizableEnumTranslation() {

}

public CustomizableEnumTranslation(String languageCode, String value) {
this.languageCode = languageCode;
this.value = value;
}

public String getLanguageCode() {
return languageCode;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,10 @@

package de.symeda.sormas.api.customizableenum;

import org.apache.commons.text.WordUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import de.symeda.sormas.api.disease.DiseaseVariant;
import de.symeda.sormas.api.environment.environmentsample.Pathogen;
import de.symeda.sormas.api.event.SpecificRisk;
import de.symeda.sormas.api.i18n.I18nProperties;
import de.symeda.sormas.api.person.OccupationType;

/**
Expand All @@ -34,8 +31,6 @@ public enum CustomizableEnumType {
OCCUPATION_TYPE(OccupationType.class),
PATHOGEN(Pathogen.class);

private static final Logger logger = LoggerFactory.getLogger(CustomizableEnumType.class);

private final Class<? extends CustomizableEnum> enumClass;

CustomizableEnumType(Class<? extends CustomizableEnum> enumClass) {
Expand All @@ -58,7 +53,7 @@ public Class<? extends CustomizableEnum> getEnumClass() {

@Override
public String toString() {
return WordUtils.capitalize(name().toLowerCase(), '_').replace("_", "");
return I18nProperties.getEnumCaption(this);
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,16 @@

import java.util.List;
import java.util.Map;
import java.util.Set;

import javax.validation.Valid;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;

import de.symeda.sormas.api.Disease;
import de.symeda.sormas.api.EntityDto;
import de.symeda.sormas.api.i18n.Validations;
import de.symeda.sormas.api.utils.DataHelper;
import de.symeda.sormas.api.utils.FieldConstraints;

/**
Expand All @@ -35,14 +38,27 @@ public class CustomizableEnumValueDto extends EntityDto {

private static final long serialVersionUID = 4360662500289404985L;

public static final String I18N_PREFIX = "CustomizableEnumValue";

public static final String DATA_TYPE = "dataType";
public static final String VALUE = "value";
public static final String CAPTION = "caption";
public static final String DESCRIPTION = "description";
public static final String TRANSLATIONS = "translations";
public static final String DISEASES = "diseases";
public static final String PROPERTIES = "properties";

@NotNull(message = Validations.required)
private CustomizableEnumType dataType;
@NotNull(message = Validations.required)
@Size(max = FieldConstraints.CHARACTER_LIMIT_TEXT, message = Validations.textTooLong)
private String value;
@NotNull(message = Validations.required)
@Size(max = FieldConstraints.CHARACTER_LIMIT_TEXT, message = Validations.textTooLong)
private String caption;
@Valid
private List<CustomizableEnumTranslation> translations;
private List<Disease> diseases;
private Set<Disease> diseases;
@Size(max = FieldConstraints.CHARACTER_LIMIT_TEXT, message = Validations.textTooLong)
private String description;
@Valid
Expand All @@ -54,6 +70,12 @@ public class CustomizableEnumValueDto extends EntityDto {
*/
private boolean defaultValue;

public static CustomizableEnumValueDto build() {
CustomizableEnumValueDto dto = new CustomizableEnumValueDto();
dto.setUuid(DataHelper.createUuid());
return dto;
}

public CustomizableEnumType getDataType() {
return dataType;
}
Expand Down Expand Up @@ -86,11 +108,11 @@ public void setTranslations(List<CustomizableEnumTranslation> translations) {
this.translations = translations;
}

public List<Disease> getDiseases() {
public Set<Disease> getDiseases() {
return diseases;
}

public void setDiseases(List<Disease> diseases) {
public void setDiseases(Set<Disease> diseases) {
this.diseases = diseases;
}

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
/*
* SORMAS® - Surveillance Outbreak Response Management & Analysis System
* Copyright © 2016-2023 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.customizableenum;

import java.util.Map;
import java.util.Set;

import de.symeda.sormas.api.Disease;
import de.symeda.sormas.api.EntityDto;

public class CustomizableEnumValueIndexDto extends EntityDto {

private static final long serialVersionUID = -2014244462630609783L;

public static final String I18N_PREFIX = "CustomizableEnumValue";

public static final String DATA_TYPE = "dataType";
public static final String VALUE = "value";
public static final String CAPTION = "caption";
public static final String DISEASES = "diseases";
public static final String PROPERTIES = "properties";

private CustomizableEnumType dataType;
private String value;
private String caption;
private Set<Disease> diseases;
private Map<String, Object> properties;

public CustomizableEnumType getDataType() {
return dataType;
}

public void setDataType(CustomizableEnumType dataType) {
this.dataType = dataType;
}

public String getValue() {
return value;
}

public void setValue(String value) {
this.value = value;
}

public String getCaption() {
return caption;
}

public void setCaption(String caption) {
this.caption = caption;
}

public Set<Disease> getDiseases() {
return diseases;
}

public void setDiseases(Set<Disease> diseases) {
this.diseases = diseases;
}

public Map<String, Object> getProperties() {
return properties;
}

public void setProperties(Map<String, Object> properties) {
this.properties = properties;
}

}
Loading

0 comments on commit 3aa26a4

Please sign in to comment.