Skip to content

Commit

Permalink
Merge branch 'development' into #12414_generate_enum_values_based_on_…
Browse files Browse the repository at this point in the history
…locale_in_dev_view
  • Loading branch information
carina29 committed Oct 9, 2023
2 parents 0bd719d + f18d58e commit d3a0925
Show file tree
Hide file tree
Showing 422 changed files with 13,245 additions and 2,846 deletions.
26 changes: 4 additions & 22 deletions docs/EXTERNAL_MESSAGES_ADAPTER.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,6 @@ A minimal maven project structure for an external message adapter module is show
| | | | |-- MyExternalMessageFacadeEjb.java
| | |-- resources
| | | |-- version.txt
| | |-- webapp
| | | |-- META-INF
| | | | |-- context.xml
| |-- test
| | |-- java
| | | |-- my.project
Expand Down Expand Up @@ -90,14 +87,6 @@ Example:
${project.name} ${project.version}
```

### context.xml
This xml is used to configure the context path of your external message adapter module.
```xml
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE xml>
<Context antiJARLocking="true" path="${myProject.apiRoot}"/>
```

### pom.xml
This is the maven project configuration file.

Expand All @@ -114,7 +103,7 @@ Example with default dependencies for java-ee, sormas-api, logging and testing:

<properties>
<sormas.version>1.85.0</sormas.version>
<myProject.apiRoot>/my-message-adapter</myProject.apiRoot>
<warName>my-message-adapter</warName>

<javaee.version>8.0</javaee.version>
<slf4j.version>1.7.30</slf4j.version>
Expand Down Expand Up @@ -171,7 +160,7 @@ Example with default dependencies for java-ee, sormas-api, logging and testing:

<properties>
<sormas.version>1.85.0</sormas.version>
<myProject.apiRoot>/my-message-adapter</myProject.apiRoot>
<warName>my-message-adapter</warName>

<junit.version>4.13.1</junit.version>
<mockito.version>3.6.0</mockito.version>
Expand Down Expand Up @@ -297,22 +286,15 @@ Example with default dependencies for java-ee, sormas-api, logging and testing:
</resources>

<plugins>
<!-- Provide WebApp context path via value of `myProject.apiRoot` property -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<version>3.2.3</version>
<configuration>
<warName>${warName}</warName>

<filteringDeploymentDescriptors>true</filteringDeploymentDescriptors>
<webResources>
<resource>
<directory>src/main/webapp/META-INF</directory>
<includes>
<include>context.xml</include>
</includes>
<targetPath>/META-INF</targetPath>
<filtering>true</filtering>
</resource>
<resource>
<directory>src/main/webapp</directory>
<targetPath>/</targetPath>
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.89.0-SNAPSHOT</version>
<version>1.90.0-SNAPSHOT</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 @@ -15,7 +15,7 @@

package de.symeda.sormas.api.common;

public enum CoreEntityType {
public enum DeletableEntityType {

//ENTITY LIST
CASE,
Expand All @@ -25,5 +25,8 @@ public enum CoreEntityType {
IMMUNIZATION,
TRAVEL_ENTRY,
CAMPAIGN,
ENVIRONMENT;
SAMPLE,
PATHOGEN_TEST,
ENVIRONMENT,
ENVIRONMENT_SAMPLE;
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import de.symeda.sormas.api.EntityRelevanceStatus;
import de.symeda.sormas.api.caze.InvestigationStatus;
import de.symeda.sormas.api.infrastructure.community.CommunityReferenceDto;
import de.symeda.sormas.api.infrastructure.country.CountryReferenceDto;
import de.symeda.sormas.api.infrastructure.district.DistrictReferenceDto;
import de.symeda.sormas.api.infrastructure.region.RegionReferenceDto;
import de.symeda.sormas.api.user.UserReferenceDto;
Expand All @@ -32,6 +33,8 @@ public class EnvironmentCriteria extends BaseCriteria implements Serializable {
private static final long serialVersionUID = -2947852193651003088L;

private String freeText;
private String externalId;
private CountryReferenceDto country;
private RegionReferenceDto region;
private DistrictReferenceDto district;
private CommunityReferenceDto community;
Expand All @@ -47,6 +50,14 @@ public class EnvironmentCriteria extends BaseCriteria implements Serializable {
private Double gpsLatTo;
private Double gpsLonFrom;
private Double gpsLonTo;
/**
* Used for similarity detection at import
*/
private Double gpsLat;
/**
* Used for similarity detection at import
*/
private Double gpsLon;

@IgnoreForUrl
public String getFreeText() {
Expand All @@ -62,6 +73,33 @@ public void setFreeText(String freeText) {
this.freeText = freeText;
}

@IgnoreForUrl
public String getExternalId() {
return externalId;
}

public EnvironmentCriteria externalId(String externalId) {
this.externalId = externalId;
return this;
}

public void setExternalId(String externalId) {
this.externalId = externalId;
}

public CountryReferenceDto getCountry() {
return country;
}

public EnvironmentCriteria country(CountryReferenceDto country) {
this.country = country;
return this;
}

public void setCountry(CountryReferenceDto country) {
this.country = country;
}

public RegionReferenceDto getRegion() {
return region;
}
Expand Down Expand Up @@ -244,6 +282,32 @@ public void setGpsLonTo(Double gpsLonTo) {
this.gpsLonTo = gpsLonTo;
}

public Double getGpsLat() {
return gpsLat;
}

public EnvironmentCriteria gpsLat(Double gpsLat) {
this.gpsLat = gpsLat;
return this;
}

public void setGpsLat(Double gpsLat) {
this.gpsLat = gpsLat;
}

public Double getGpsLon() {
return gpsLon;
}

public EnvironmentCriteria gpsLon(Double gpsLon) {
this.gpsLon = gpsLon;
return this;
}

public void setGpsLon(Double gpsLon) {
this.gpsLon = gpsLon;
}

public void reportDateBetween(Date reportDateFrom, Date reportDateTo, DateFilterOption dateFilterOption) {
this.reportDateFrom = reportDateFrom;
this.reportDateTo = reportDateTo;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,12 +47,12 @@ public class EnvironmentDto extends PseudonymizableDto {
public static final String DELETION_REASON = "deletionReason";
public static final String OTHER_DELETION_REASON = "otherDeletionReason";

@NotNull
@NotNull(message = Validations.validReportDateTime)
private Date reportDate;
@NotNull
@NotNull(message = Validations.validReportingUser)
private UserReferenceDto reportingUser;
@Size(max = FieldConstraints.CHARACTER_LIMIT_TEXT, message = Validations.textTooLong)
@NotBlank
@NotBlank(message = Validations.environmentName)
private String environmentName;
@Size(max = FieldConstraints.CHARACTER_LIMIT_TEXT, message = Validations.textTooLong)
private String description;
Expand All @@ -61,7 +61,7 @@ public class EnvironmentDto extends PseudonymizableDto {
private UserReferenceDto responsibleUser;
@NotNull
private InvestigationStatus investigationStatus;
@NotNull
@NotNull(message = Validations.environmentMedia)
private EnvironmentMedia environmentMedia;
private WaterType waterType;
@Size(max = FieldConstraints.CHARACTER_LIMIT_TEXT, message = Validations.textTooLong)
Expand All @@ -85,6 +85,7 @@ public class EnvironmentDto extends PseudonymizableDto {
public static EnvironmentDto build() {
final EnvironmentDto environment = new EnvironmentDto();
environment.setUuid(DataHelper.createUuid());
environment.setReportDate(new Date());
environment.setLocation(LocationDto.build());
environment.setInvestigationStatus(InvestigationStatus.PENDING);

Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@
package de.symeda.sormas.api.environment;

import java.util.List;

import javax.ejb.Remote;

import de.symeda.sormas.api.CoreFacade;

@Remote
public interface EnvironmentFacade extends CoreFacade<EnvironmentDto, EnvironmentIndexDto, EnvironmentReferenceDto, EnvironmentCriteria> {

List<String> getAllActiveUuids();

}
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
import java.util.Date;

import de.symeda.sormas.api.EntityRelevanceStatus;
import de.symeda.sormas.api.environment.EnvironmentReferenceDto;
import de.symeda.sormas.api.infrastructure.district.DistrictReferenceDto;
import de.symeda.sormas.api.infrastructure.facility.FacilityReferenceDto;
import de.symeda.sormas.api.infrastructure.region.RegionReferenceDto;
Expand Down Expand Up @@ -54,6 +55,7 @@ public class EnvironmentSampleCriteria extends BaseCriteria implements Serializa
private DateFilterOption dateFilterOption = DateFilterOption.DATE;
private Date reportDateFrom;
private Date reportDateTo;
private EnvironmentReferenceDto environment;

public EnvironmentSampleCriteria() {
super();
Expand Down Expand Up @@ -184,4 +186,17 @@ public void reportDateBetween(Date reportDateFrom, Date reportDateTo, DateFilter
this.reportDateTo = reportDateTo;
this.dateFilterOption = dateFilterOption;
}

public EnvironmentReferenceDto getEnvironment() {
return environment;
}

public void setEnvironment(EnvironmentReferenceDto environment) {
this.environment = environment;
}

public EnvironmentSampleCriteria withEnvironment(EnvironmentReferenceDto environment) {
this.environment = environment;
return this;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;

import de.symeda.sormas.api.common.DeletionReason;
import de.symeda.sormas.api.environment.EnvironmentReferenceDto;
import de.symeda.sormas.api.feature.FeatureType;
import de.symeda.sormas.api.i18n.Validations;
Expand All @@ -48,6 +49,36 @@ public class EnvironmentSampleDto extends PseudonymizableDto {

public static final long APPROXIMATE_JSON_SIZE_IN_BYTES = 2000;

public static final String I18N_PREFIX = "EnvironmentSample";

public static final String ENVIRONMENT = "environment";
public static final String SAMPLE_DATE_TIME = "sampleDateTime";
public static final String SAMPLE_MATERIAL = "sampleMaterial";
public static final String OTHER_SAMPLE_MATERIAL = "otherSampleMaterial";
public static final String SAMPLE_VOLUME = "sampleVolume";
public static final String FIELD_SAMPLE_ID = "fieldSampleId";
public static final String TURBIDITY = "turbidity";
public static final String PH_VALUE = "phValue";
public static final String SAMPLE_TEMPERATURE = "sampleTemperature";
public static final String CHLORINE_RESIDUALS = "chlorineResiduals";
public static final String LABORATORY = "laboratory";
public static final String LABORATORY_DETAILS = "laboratoryDetails";
public static final String REQUESTED_PATHOGEN_TESTS = "requestedPathogenTests";
public static final String OTHER_REQUESTED_PATHOGEN_TESTS = "otherRequestedPathogenTests";
public static final String WEATHER_CONDITIONS = "weatherConditions";
public static final String HEAVY_RAIN = "heavyRain";
public static final String DISPATCHED = "dispatched";
public static final String DISPATCH_DATE = "dispatchDate";
public static final String DISPATCH_DETAILS = "dispatchDetails";
public static final String RECEIVED = "received";
public static final String RECEIVAL_DATE = "receivalDate";
public static final String LAB_SAMPLE_ID = "labSampleId";
public static final String SPECIMEN_CONDITION = "specimenCondition";
public static final String LOCATION = "location";
public static final String GENERAL_COMMENT = "generalComment";
public static final String DELETION_REASON = "deletionReason";
public static final String OTHER_DELETION_REASON = "otherDeletionReason";

@NotNull
private EnvironmentReferenceDto environment;
@NotNull
Expand Down Expand Up @@ -104,6 +135,10 @@ public class EnvironmentSampleDto extends PseudonymizableDto {
@SensitiveData
@Size(max = FieldConstraints.CHARACTER_LIMIT_TEXT, message = Validations.textTooLong)
private String generalComment;
private boolean deleted;
private DeletionReason deletionReason;
@Size(max = FieldConstraints.CHARACTER_LIMIT_TEXT, message = Validations.textTooLong)
private String otherDeletionReason;

public static EnvironmentSampleDto build(EnvironmentReferenceDto environment, UserReferenceDto reportingUser) {
EnvironmentSampleDto sample = new EnvironmentSampleDto();
Expand Down Expand Up @@ -333,4 +368,32 @@ public String getGeneralComment() {
public void setGeneralComment(String generalComment) {
this.generalComment = generalComment;
}

public boolean isDeleted() {
return deleted;
}

public void setDeleted(boolean deleted) {
this.deleted = deleted;
}

public DeletionReason getDeletionReason() {
return deletionReason;
}

public void setDeletionReason(DeletionReason deletionReason) {
this.deletionReason = deletionReason;
}

public String getOtherDeletionReason() {
return otherDeletionReason;
}

public void setOtherDeletionReason(String otherDeletionReason) {
this.otherDeletionReason = otherDeletionReason;
}

public EnvironmentSampleReferenceDto toReference() {
return new EnvironmentSampleReferenceDto(getUuid());
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,20 @@

import de.symeda.sormas.api.BaseFacade;
import de.symeda.sormas.api.DeletableFacade;
import de.symeda.sormas.api.EditPermissionType;
import de.symeda.sormas.api.deletionconfiguration.DeletionInfoDto;

@Remote
public interface EnvironmentSampleFacade
extends BaseFacade<EnvironmentSampleDto, EnvironmentSampleIndexDto, EnvironmentSampleReferenceDto, EnvironmentSampleCriteria>, DeletableFacade {

boolean exists(String uuid);

boolean isEditAllowed(String uuid);

EditPermissionType getEditPermissionType(String sampleUuid);

DeletionInfoDto getAutomaticDeletionInfo(String sampleUuid);

DeletionInfoDto getManuallyDeletionInfo(String sampleUuid);
}
Loading

0 comments on commit d3a0925

Please sign in to comment.