Skip to content

Commit

Permalink
[GITFLOW]merging 'release-1.75.0' into 'master'
Browse files Browse the repository at this point in the history
  • Loading branch information
jenkins committed Aug 23, 2022
2 parents 2c0a8f8 + 8f131d2 commit 7a4043b
Show file tree
Hide file tree
Showing 667 changed files with 29,859 additions and 4,546 deletions.
2 changes: 1 addition & 1 deletion openapi/external_visits_API.json
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,7 @@
},
"disease" : {
"type" : "string",
"enum" : [ "Acute Flaccid Paralysis", "Cholera", "Congenital Rubella", "Meningitis (CSM)", "Dengue Fever", "Ebola Virus Disease", "Guinea Worm", "Lassa", "Measles", "Monkeypox", "Influenza (New subtype)", "Plague", "Poliomyelitis", "Unspecified VHF", "West Nile Fever", "Yellow Fever", "Human Rabies", "Anthrax", "COVID-19", "Pneumonia", "Malaria", "Typhoid Fever", "Acute Viral Hepatitis", "Non-Neonatal Tetanus", "HIV", "Schistosomiasis", "Soil-Transmitted Helminths", "Trypanosomiasis", "Diarrhea w/ Dehydration (< 5)", "Diarrhea w/ Blood (Shigella)", "Snake Bite", "Rubella", "Tuberculosis", "Leprosy", "Lymphatic Filariasis", "Buruli Ulcer", "Pertussis", "Neonatal Tetanus", "Onchocerciasis", "Diphteria", "Trachoma", "Yaws and Endemic Syphilis", "Maternal Deaths", "Perinatal Deaths", "Influenza A", "Influenza B", "H.metapneumovirus", "Respiratory syncytial virus (RSV)", "Parainfluenza (1-4)", "Adenovirus", "Rhinovirus", "Enterovirus", "M.pneumoniae", "C.pneumoniae", "Other Epidemic Disease", "Not Yet Defined" ]
"enum" : [ "Acute Flaccid Paralysis", "Cholera", "Congenital Rubella", "Meningitis (CSM)", "Dengue Fever", "Ebola Virus Disease", "Guinea Worm", "Lassa", "Measles", "Monkeypox", "Influenza (New subtype)", "Plague", "Poliomyelitis", "Unspecified VHF", "West Nile Fever", "Yellow Fever", "Human Rabies", "Anthrax", "COVID-19", "Pneumonia", "Malaria", "Typhoid Fever", "Acute Viral Hepatitis", "Non-Neonatal Tetanus", "HIV", "Schistosomiasis", "Soil-Transmitted Helminths", "Trypanosomiasis", "Diarrhea w/ Dehydration (< 5)", "Diarrhea w/ Blood (Shigella)", "Snake Bite", "Rubella", "Tuberculosis", "Leprosy", "Lymphatic Filariasis", "Buruli Ulcer", "Pertussis", "Neonatal Tetanus", "Onchocerciasis", "Diphteria", "Trachoma", "Yaws and Endemic Syphilis", "Maternal Deaths", "Perinatal Deaths", "Influenza A", "Influenza B", "H.metapneumovirus", "Respiratory syncytial virus (RSV)", "Parainfluenza (1-4)", "Adenovirus", "Rhinovirus", "Enterovirus", "M.pneumoniae", "C.pneumoniae", "ARI (Acute Respiratory Infections)", "Chikungunya", "Post-immunization adverse events mild", "Post-immunization adverse events severe", "FHA (Functional Hypothalamic Amenorrhea)", "Other Epidemic Disease", "Not Yet Defined" ]
},
"visitDateTime" : {
"type" : "string",
Expand Down
5 changes: 5 additions & 0 deletions openapi/external_visits_API.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -458,6 +458,11 @@ components:
- Enterovirus
- M.pneumoniae
- C.pneumoniae
- ARI (Acute Respiratory Infections)
- Chikungunya
- Post-immunization adverse events mild
- Post-immunization adverse events severe
- FHA (Functional Hypothalamic Amenorrhea)
- Other Epidemic Disease
- Not Yet Defined
visitDateTime:
Expand Down
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.74.2</version>
<version>1.75.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 @@ -31,5 +31,5 @@ public interface BaseFacade<DTO extends EntityDto, INDEX_DTO extends Serializabl

List<String> getObsoleteUuidsSince(Date since);

void validate(DTO dto) throws ValidationRuntimeException;
void validate(@Valid DTO dto) throws ValidationRuntimeException;
}
139 changes: 73 additions & 66 deletions sormas-api/src/main/java/de/symeda/sormas/api/Disease.java
Original file line number Diff line number Diff line change
Expand Up @@ -27,71 +27,72 @@ public enum Disease
implements
StatisticsGroupingKey {

AFP(true, true, true, false, 0, true, false, false),
CHOLERA(true, true, true, true, 5, true, false, false),
CONGENITAL_RUBELLA(true, true, true, true, 21, true, false, false),
CSM(true, true, true, false, 10, true, false, false),
DENGUE(true, true, true, false, 14, true, false, false),
EVD(true, true, true, true, 21, true, false, false),
GUINEA_WORM(true, true, true, false, 0, true, false, false),
LASSA(true, true, true, true, 21, true, false, false),
MEASLES(true, true, true, false, 21, true, true, false),
MONKEYPOX(true, true, true, true, 21, true, false, false),
NEW_INFLUENZA(true, true, true, true, 17, true, false, false),
PLAGUE(true, true, true, true, 7, true, false, false),
POLIO(true, true, true, false, 0, true, false, false),
UNSPECIFIED_VHF(true, true, true, true, 21, true, false, false),
WEST_NILE_FEVER(true, false, true, false, 0, true, false, false),
YELLOW_FEVER(true, true, true, false, 6, true, false, false),
RABIES(true, true, true, true, 6, true, false, false),
ANTHRAX(true, true, true, false, 0, true, false, false),
CORONAVIRUS(true, true, true, true, 14, true, true, true),
PNEUMONIA(true, false, true, false, 0, true, false, false),
MALARIA(true, false, false, false, 0, true, false, false),
TYPHOID_FEVER(true, false, false, false, 0, true, false, false),
ACUTE_VIRAL_HEPATITIS(true, false, false, false, 0, true, false, false),
NON_NEONATAL_TETANUS(true, false, false, false, 0, true, false, false),
HIV(true, false, false, false, 0, true, false, false),
SCHISTOSOMIASIS(true, false, false, false, 0, true, false, false),
SOIL_TRANSMITTED_HELMINTHS(true, false, false, false, 0, true, false, false),
TRYPANOSOMIASIS(true, false, false, false, 0, true, false, false),
DIARRHEA_DEHYDRATION(true, false, false, false, 0, true, false, false),
DIARRHEA_BLOOD(true, false, false, false, 0, true, false, false),
SNAKE_BITE(true, false, false, false, 0, true, false, false),
RUBELLA(true, false, false, false, 0, true, false, false),
TUBERCULOSIS(true, false, false, false, 0, true, false, false),
LEPROSY(true, false, false, false, 0, true, false, false),
LYMPHATIC_FILARIASIS(true, false, false, false, 0, true, false, false),
BURULI_ULCER(true, false, false, false, 0, true, false, false),
PERTUSSIS(true, false, false, false, 0, true, false, false),
NEONATAL_TETANUS(true, false, false, false, 0, true, false, false),
ONCHOCERCIASIS(true, false, false, false, 0, true, false, false),
DIPHTERIA(true, false, false, false, 0, true, false, false),
TRACHOMA(true, false, false, false, 0, true, false, false),
YAWS_ENDEMIC_SYPHILIS(true, false, false, false, 0, true, false, false),
MATERNAL_DEATHS(true, false, false, false, 0, true, false, false),
PERINATAL_DEATHS(true, false, false, false, 0, true, false, false),
INFLUENZA_A(true, false, true, false, 0, true, false, false),
INFLUENZA_B(true, false, true, false, 0, true, false, false),
H_METAPNEUMOVIRUS(true, false, true, false, 0, true, false, false),
RESPIRATORY_SYNCYTIAL_VIRUS(true, false, true, false, 0, true, false, false),
PARAINFLUENZA_1_4(true, false, true, false, 0, true, false, false),
ADENOVIRUS(true, false, true, false, 0, true, false, false),
RHINOVIRUS(true, false, true, false, 0, true, false, false),
ENTEROVIRUS(true, false, true, false, 0, true, false, false),
M_PNEUMONIAE(true, false, true, false, 0, true, false, false),
C_PNEUMONIAE(true, false, true, false, 0, true, false, false),
ARI(true, false, false, false, 0, true, false, false),
CHIKUNGUNYA(true, false, false, false, 0, true, false, false),
POST_IMMUNIZATION_ADVERSE_EVENTS_MILD(true, false, false, false, 0, true, false, false),
POST_IMMUNIZATION_ADVERSE_EVENTS_SEVERE(true, false, false, false, 0, true, false, false),
FHA(true, false, false, false, 0, true, false, false),
OTHER(true, true, true, true, 21, false, false, false),
UNDEFINED(true, true, true, true, 0, false, false, false);
AFP(true, true, true, false, false, 0, true, false, false),
CHOLERA(true, true, true, false, true, 5, true, false, false),
CONGENITAL_RUBELLA(true, true, true, false, true, 21, true, false, false),
CSM(true, true, true, false, false, 10, true, false, false),
DENGUE(true, true, true, false, false, 14, true, false, false),
EVD(true, true, true, false, true, 21, true, false, false),
GUINEA_WORM(true, true, true, false, false, 0, true, false, false),
LASSA(true, true, true, false, true, 21, true, false, false),
MEASLES(true, true, true, false, false, 21, true, true, false),
MONKEYPOX(true, true, true, false, true, 21, true, false, false),
NEW_INFLUENZA(true, true, true, false, true, 17, true, false, false),
PLAGUE(true, true, true, false, true, 7, true, false, false),
POLIO(true, true, true, false, false, 0, true, false, false),
UNSPECIFIED_VHF(true, true, true, false, true, 21, true, false, false),
WEST_NILE_FEVER(true, false, true, false, false, 0, true, false, false),
YELLOW_FEVER(true, true, true, false, false, 6, true, false, false),
RABIES(true, true, true, false, true, 6, true, false, false),
ANTHRAX(true, true, true, false, false, 0, true, false, false),
CORONAVIRUS(true, true, true, false, true, 14, true, true, true),
PNEUMONIA(true, false, true, false, false, 0, true, false, false),
MALARIA(true, false, false, true, false, 0, true, false, false),
TYPHOID_FEVER(true, false, false, true, false, 0, true, false, false),
ACUTE_VIRAL_HEPATITIS(true, false, false, true, false, 0, true, false, false),
NON_NEONATAL_TETANUS(true, false, false, true, false, 0, true, false, false),
HIV(true, false, false, true, false, 0, true, false, false),
SCHISTOSOMIASIS(true, false, false, true, false, 0, true, false, false),
SOIL_TRANSMITTED_HELMINTHS(true, false, false, true, false, 0, true, false, false),
TRYPANOSOMIASIS(true, false, false, true, false, 0, true, false, false),
DIARRHEA_DEHYDRATION(true, false, false, true, false, 0, true, false, false),
DIARRHEA_BLOOD(true, false, false, true, false, 0, true, false, false),
SNAKE_BITE(true, false, false, true, false, 0, true, false, false),
RUBELLA(true, false, false, true, false, 0, true, false, false),
TUBERCULOSIS(true, false, false, true, false, 0, true, false, false),
LEPROSY(true, false, false, true, false, 0, true, false, false),
LYMPHATIC_FILARIASIS(true, false, false, true, false, 0, true, false, false),
BURULI_ULCER(true, false, false, true, false, 0, true, false, false),
PERTUSSIS(true, false, false, true, false, 0, true, false, false),
NEONATAL_TETANUS(true, false, false, true, false, 0, true, false, false),
ONCHOCERCIASIS(true, false, false, true, false, 0, true, false, false),
DIPHTERIA(true, false, false, true, false, 0, true, false, false),
TRACHOMA(true, false, false, true, false, 0, true, false, false),
YAWS_ENDEMIC_SYPHILIS(true, false, false, true, false, 0, true, false, false),
MATERNAL_DEATHS(true, false, false, true, false, 0, true, false, false),
PERINATAL_DEATHS(true, false, false, true, false, 0, true, false, false),
INFLUENZA_A(true, false, true, false, false, 0, true, false, false),
INFLUENZA_B(true, false, true, false, false, 0, true, false, false),
H_METAPNEUMOVIRUS(true, false, true, false, false, 0, true, false, false),
RESPIRATORY_SYNCYTIAL_VIRUS(true, false, true, false, false, 0, true, false, false),
PARAINFLUENZA_1_4(true, false, true, false, false, 0, true, false, false),
ADENOVIRUS(true, false, true, false, false, 0, true, false, false),
RHINOVIRUS(true, false, true, false, false, 0, true, false, false),
ENTEROVIRUS(true, false, true, false, false, 0, true, false, false),
M_PNEUMONIAE(true, false, true, false, false, 0, true, false, false),
C_PNEUMONIAE(true, false, true, false, false, 0, true, false, false),
ARI(true, false, false, true, false, 0, true, false, false),
CHIKUNGUNYA(true, false, false, true, false, 0, true, false, false),
POST_IMMUNIZATION_ADVERSE_EVENTS_MILD(true, false, false, true, false, 0, true, false, false),
POST_IMMUNIZATION_ADVERSE_EVENTS_SEVERE(true, false, false, true, false, 0, true, false, false),
FHA(true, false, false, true, false, 0, true, false, false),
OTHER(true, true, true, false, true, 21, false, false, false),
UNDEFINED(true, true, true, false, true, 0, false, false, false);

private final boolean defaultActive;
private final boolean defaultPrimary;
private final boolean defaultCaseBased;
private final boolean defaultCaseSurveillanceEnabled;
private final boolean defaultAggregateReportingEnabled;
private final boolean defaultFollowUpEnabled;
private final int defaultFollowUpDuration;
private final boolean variantAllowed;
Expand All @@ -101,7 +102,8 @@ public enum Disease
Disease(
boolean defaultActive,
boolean defaultPrimary,
boolean defaultCaseBased,
boolean defaultCaseSurveillanceEnabled,
boolean defaultAggregateReportingEnabled,
boolean defaultFollowUpEnabled,
int defaultFollowUpDuration,
boolean variantAllowed,
Expand All @@ -110,7 +112,8 @@ public enum Disease

this.defaultActive = defaultActive;
this.defaultPrimary = defaultPrimary;
this.defaultCaseBased = defaultCaseBased;
this.defaultCaseSurveillanceEnabled = defaultCaseSurveillanceEnabled;
this.defaultAggregateReportingEnabled = defaultAggregateReportingEnabled;
this.defaultFollowUpEnabled = defaultFollowUpEnabled;
this.defaultFollowUpDuration = defaultFollowUpDuration;
this.variantAllowed = variantAllowed;
Expand Down Expand Up @@ -150,8 +153,12 @@ public boolean isDefaultPrimary() {
return defaultPrimary;
}

public boolean isDefaultCaseBased() {
return defaultCaseBased;
public boolean isDefaultCaseSurveillanceEnabled() {
return defaultCaseSurveillanceEnabled;
}

public boolean isDefaultAggregateReportingEnabled() {
return defaultAggregateReportingEnabled;
}

public boolean isDefaultFollowUpEnabled() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,11 @@ public interface ActionFacade {

void deleteAction(ActionDto ActionDto);

List<ActionDto> getAllActionsAfter(Date date);
List<ActionDto> getAllActiveActionsAfter(Date date);

List<ActionDto> getByUuids(List<String> uuids);

List<String> getAllUuids();
List<String> getAllActiveUuids();

List<ActionStatEntry> getActionStats(ActionCriteria actionCriteria);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
import javax.validation.Valid;
import javax.validation.constraints.Max;
import javax.validation.constraints.Min;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;

import org.apache.commons.lang3.StringUtils;
Expand Down Expand Up @@ -262,7 +263,7 @@ public class CaseDataDto extends SormasToSormasShareableDto {
@Required
private Date reportDate;
@Outbreaks
@Required
@NotNull(message = Validations.validReportingUser)
private UserReferenceDto reportingUser;
@HideForCountries(countries = {
COUNTRY_CODE_FRANCE,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2182,7 +2182,7 @@ public String getBirthName() {
CaseDataDto.PERSON,
PersonDto.BIRTH_COUNTRY })
@ExportGroup(ExportGroupType.SENSITIVE)
@HideForCountriesExcept
@HideForCountriesExcept(countries = {})
public String getBirthCountry() {
return birthCountry;
}
Expand All @@ -2196,7 +2196,7 @@ public String getBirthCountry() {
CaseDataDto.PERSON,
PersonDto.CITIZENSHIP })
@ExportGroup(ExportGroupType.SENSITIVE)
@HideForCountriesExcept
@HideForCountriesExcept(countries = {})
public String getCitizenship() {
return citizenship;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@
import de.symeda.sormas.api.utils.DataHelper.Pair;
import de.symeda.sormas.api.utils.SortProperty;
import de.symeda.sormas.api.utils.ValidationRuntimeException;
import de.symeda.sormas.api.vaccination.VaccinationDto;

@Remote
public interface CaseFacade extends CoreFacade<CaseDataDto, CaseIndexDto, CaseReferenceDto, CaseCriteria> {
Expand Down Expand Up @@ -220,6 +221,8 @@ void saveBulkEditWithFacilities(

List<CaseDataDto> getByExternalId(String externalId);

List<CaseDataDto> getRelevantCasesForVaccination(VaccinationDto vaccination);

void updateExternalData(@Valid List<ExternalDataDto> externalData) throws ExternalDataUpdateException;

int updateCompleteness();
Expand All @@ -233,5 +236,9 @@ void saveBulkEditWithFacilities(
void dearchive(List<String> entityUuids, String dearchiveReason, boolean includeContacts);

void setResultingCase(EventParticipantReferenceDto eventParticipantReferenceDto, CaseReferenceDto caseReferenceDto);

EditPermissionType isEditContactAllowed(String uuid);

boolean hasOtherValidVaccination(CaseDataDto caze, String vaccinationUuid);

}
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
import javax.validation.Valid;
import javax.validation.constraints.Max;
import javax.validation.constraints.Min;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;

import de.symeda.sormas.api.Disease;
Expand Down Expand Up @@ -161,7 +162,7 @@ public class ContactDto extends SormasToSormasShareableDto {

@Required
private Date reportDateTime;
@Required
@NotNull(message = Validations.validReportingUser)
private UserReferenceDto reportingUser;
@SensitiveData
@Pseudonymizer(LatitudePseudonymizer.class)
Expand Down Expand Up @@ -197,9 +198,13 @@ public class ContactDto extends SormasToSormasShareableDto {
@Size(max = FieldConstraints.CHARACTER_LIMIT_DEFAULT, message = Validations.textTooLong)
private String tracingAppDetails;
private ContactProximity contactProximity;
@HideForCountriesExcept
@SensitiveData
@Size(max = FieldConstraints.CHARACTER_LIMIT_DEFAULT, message = Validations.textTooLong)
private String contactProximityDetails;
@HideForCountriesExcept
@Diseases({
Disease.CORONAVIRUS })
private ContactCategory contactCategory;
@Required
private ContactClassification contactClassification;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1158,7 +1158,7 @@ public String getBirthName() {
CaseDataDto.PERSON,
PersonDto.BIRTH_COUNTRY })
@ExportGroup(ExportGroupType.SENSITIVE)
@HideForCountriesExcept
@HideForCountriesExcept(countries = {})
public String getBirthCountry() {
return birthCountry;
}
Expand All @@ -1168,7 +1168,7 @@ public String getBirthCountry() {
CaseDataDto.PERSON,
PersonDto.CITIZENSHIP })
@ExportGroup(ExportGroupType.SENSITIVE)
@HideForCountriesExcept
@HideForCountriesExcept(countries = {})
public String getCitizenship() {
return citizenship;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,24 @@

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.event.SpecificRisk;
import de.symeda.sormas.api.person.OccupationType;

/**
* An enum storing all enumerations that support customization.
*/
public enum CustomizableEnumType {

DISEASE_VARIANT(DiseaseVariant.class),
SPECIFIC_EVENT_RISK(SpecificRisk.class);
SPECIFIC_EVENT_RISK(SpecificRisk.class),
OCCUPATION_TYPE(OccupationType.class);

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

private final Class<? extends CustomizableEnum> enumClass;

Expand All @@ -46,4 +54,9 @@ public Class<? extends CustomizableEnum> getEnumClass() {
return enumClass;
}

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

}
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,11 @@ public class CustomizableEnumValueDto extends EntityDto {
@Valid
private List<CustomizableEnumTranslation> descriptionTranslations;
private Map<String, Object> properties;
/**
* Whether the value is a default value provided by the software. Default values don't need a caption
* or translations because they can be translated via properties files.
*/
private boolean defaultValue;

public CustomizableEnumType getDataType() {
return dataType;
Expand Down Expand Up @@ -112,4 +117,12 @@ public Map<String, Object> getProperties() {
public void setProperties(Map<String, Object> properties) {
this.properties = properties;
}

public boolean isDefaultValue() {
return defaultValue;
}

public void setDefaultValue(boolean defaultValue) {
this.defaultValue = defaultValue;
}
}
Loading

0 comments on commit 7a4043b

Please sign in to comment.