Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/development' into feature-11574-…
Browse files Browse the repository at this point in the history
…environment-samples-on-dashboard-map
  • Loading branch information
Levente Gal committed Oct 9, 2023
2 parents 9dbcb74 + f18d58e commit 7f0d310
Show file tree
Hide file tree
Showing 136 changed files with 903 additions and 132 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 @@ -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,13 +1,14 @@
package de.symeda.sormas.api.environment;

import java.util.List;

import javax.ejb.Remote;

import de.symeda.sormas.api.CoreFacade;

import java.util.List;

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

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

}
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,8 @@ public class ExternalMessageDto extends SormasToSormasShareableDto {
*/
private UserReferenceDto reportingUser;

private boolean automaticProcessingPossible;

public ExternalMessageType getType() {
return type;
}
Expand Down Expand Up @@ -497,4 +499,11 @@ public void setReportingUser(UserReferenceDto reportingUser) {
this.reportingUser = reportingUser;
}

public boolean isAutomaticProcessingPossible() {
return automaticProcessingPossible;
}

public void setAutomaticProcessingPossible(boolean automaticProcessingPossible) {
this.automaticProcessingPossible = automaticProcessingPossible;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ public enum FeatureType {
new FeatureType[] {
SAMPLES_LAB },
null,
null),
ImmutableMap.of(FeatureTypeProperty.FETCH_MODE, Boolean.FALSE)),
MANUAL_EXTERNAL_MESSAGES(true,
true,
new FeatureType[] {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@ public enum FeatureTypeProperty {
SHARE_ASSOCIATED_CONTACTS(Boolean.class),
SHARE_SAMPLES(Boolean.class),
SHARE_IMMUNIZATIONS(Boolean.class),
SHARE_REPORTS(Boolean.class);
SHARE_REPORTS(Boolean.class),
FETCH_MODE(Boolean.class);

private final Class<?> returnType;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -491,6 +491,7 @@ public interface Strings {
String headingCreateNewContact = "headingCreateNewContact";
String headingCreateNewContactIssue = "headingCreateNewContactIssue";
String headingCreateNewEnvironment = "headingCreateNewEnvironment";
String headingCreateNewEnvironmentSample = "headingCreateNewEnvironmentSample";
String headingCreateNewEvent = "headingCreateNewEvent";
String headingCreateNewEventGroup = "headingCreateNewEventGroup";
String headingCreateNewEventParticipant = "headingCreateNewEventParticipant";
Expand Down Expand Up @@ -1219,6 +1220,7 @@ public interface Strings {
String messageDistrictsArchived = "messageDistrictsArchived";
String messageDistrictsDearchived = "messageDistrictsDearchived";
String messageDontShareWithReportingToolWarning = "messageDontShareWithReportingToolWarning";
String messageDuplicateEnvironmentFound = "messageDuplicateEnvironmentFound";
String messageEnterSms = "messageEnterSms";
String messageEntitiesNotEditable = "messageEntitiesNotEditable";
String messageEntityNotFound = "messageEntityNotFound";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@ public interface Validations {
String duplicateEpidNumber = "duplicateEpidNumber";
String duplicateExternalToken = "duplicateExternalToken";
String emptyOverwrittenFollowUpUntilDate = "emptyOverwrittenFollowUpUntilDate";
String environmentMedia = "environmentMedia";
String environmentName = "environmentName";
String environmentWaterFieldsSetWithNotWaterMedia = "environmentWaterFieldsSetWithNotWaterMedia";
String errorsInForm = "errorsInForm";
String eventSubordinateEventFromDateFilterValidation = "eventSubordinateEventFromDateFilterValidation";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,11 @@ public static <E> ImportLineResultDto<E> errorResult(String message) {
}

public static <E> ImportLineResultDto<E> duplicateResult(E entities) {
return new ImportLineResultDto<>(ImportLineResult.DUPLICATE, null, entities);
return duplicateResult(entities, null);
}

public static <E> ImportLineResultDto<E> duplicateResult(E entities, String message) {
return new ImportLineResultDto<>(ImportLineResult.DUPLICATE, message, entities);
}

public static <E> ImportLineResultDto<E> skippedResult(String message) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -257,9 +257,6 @@ public enum UserRight {

EXTERNAL_MESSAGE_VIEW(UserRightGroup.EXTERNAL),
EXTERNAL_MESSAGE_PROCESS(UserRightGroup.EXTERNAL, UserRight._EXTERNAL_MESSAGE_VIEW,
UserRight._CASE_CREATE, UserRight._CASE_EDIT,
UserRight._CONTACT_CREATE, UserRight._CONTACT_EDIT,
UserRight._EVENT_CREATE, UserRight._EVENT_EDIT, UserRight._EVENTPARTICIPANT_CREATE, UserRight._EVENTPARTICIPANT_EDIT,
UserRight._SAMPLE_CREATE, UserRight._SAMPLE_EDIT, UserRight._PATHOGEN_TEST_CREATE, UserRight._PATHOGEN_TEST_EDIT, UserRight._PATHOGEN_TEST_DELETE,
UserRight._IMMUNIZATION_CREATE, UserRight._IMMUNIZATION_EDIT, UserRight._IMMUNIZATION_DELETE),
EXTERNAL_MESSAGE_PUSH(UserRightGroup.EXTERNAL),
Expand Down
Binary file modified sormas-api/src/main/resources/doc/SORMAS_Data_Dictionary.xlsx
Binary file not shown.
Binary file modified sormas-api/src/main/resources/doc/SORMAS_User_Roles.xlsx
Binary file not shown.
2 changes: 2 additions & 0 deletions sormas-api/src/main/resources/strings.properties
Original file line number Diff line number Diff line change
Expand Up @@ -497,6 +497,7 @@ headingCreateNewTreatment = Create new treatment
headingCreateNewUser = Create new user
headingCreateNewUserRole = Create new user role
headingCreateNewVisit = Create new visit
headingCreateNewEnvironmentSample = Create new environment sample
headingCreatePathogenTestResult = Create new pathogen test result
headingDatabaseExportFailed = Database export failed
headingDearchiveCampaign = De-Archive campaign
Expand Down Expand Up @@ -1462,6 +1463,7 @@ messageCountEnvironmentSamplesNotDeleted = %s environment samples not deleted: %
messageCountEnvironmentSamplesNotDeletedAccessDeniedReason = %s environment samples not deleted because they are not in jurisdiction or owned: %s
messageEnvironmentSamplesRestored = All selected environment samples have been restored
messageEnvironmentSampleSaved = Environment sample saved
messageDuplicateEnvironmentFound = A similar environment already exists in the database (UUID: %s)

# Notifications
notificationCaseClassificationChanged = The classification of case %s has changed to %s.
Expand Down
2 changes: 2 additions & 0 deletions sormas-api/src/main/resources/strings_ar-SA.properties
Original file line number Diff line number Diff line change
Expand Up @@ -497,6 +497,7 @@ headingCreateNewTreatment = Create new treatment
headingCreateNewUser = Create new user
headingCreateNewUserRole = Create new user role
headingCreateNewVisit = Create new visit
headingCreateNewEnvironmentSample = Create new environment sample
headingCreatePathogenTestResult = Create new pathogen test result
headingDatabaseExportFailed = Database export failed
headingDearchiveCampaign = De-Archive campaign
Expand Down Expand Up @@ -1462,6 +1463,7 @@ messageCountEnvironmentSamplesNotDeleted = %s environment samples not deleted\:
messageCountEnvironmentSamplesNotDeletedAccessDeniedReason = %s environment samples not deleted because they are not in jurisdiction or owned\: %s
messageEnvironmentSamplesRestored = All selected environment samples have been restored
messageEnvironmentSampleSaved = Environment sample saved
messageDuplicateEnvironmentFound = A similar environment already exists in the database (UUID\: %s)

# Notifications
notificationCaseClassificationChanged = The classification of case %s has changed to %s.
Expand Down
2 changes: 2 additions & 0 deletions sormas-api/src/main/resources/strings_cs-CZ.properties
Original file line number Diff line number Diff line change
Expand Up @@ -497,6 +497,7 @@ headingCreateNewTreatment = Vytvořit novou léčbu
headingCreateNewUser = Vytvořit nového uživatele
headingCreateNewUserRole = Vytvořit novou uživatelskou roli
headingCreateNewVisit = Vytvořit novou návštěvu
headingCreateNewEnvironmentSample = Vytvořit nový vzorek prostředí
headingCreatePathogenTestResult = Vytvořit nový výsledek testu patogenu
headingDatabaseExportFailed = Export databáze selhal
headingDearchiveCampaign = Vyjmout z archivu kampaň
Expand Down Expand Up @@ -1462,6 +1463,7 @@ messageCountEnvironmentSamplesNotDeleted = %s environment samples not deleted\:
messageCountEnvironmentSamplesNotDeletedAccessDeniedReason = %s environment samples not deleted because they are not in jurisdiction or owned\: %s
messageEnvironmentSamplesRestored = All selected environment samples have been restored
messageEnvironmentSampleSaved = Vzorek prostředí uložen
messageDuplicateEnvironmentFound = Podobné prostředí již existuje v databázi (UUID\: %s)

# Notifications
notificationCaseClassificationChanged = Klasifikace případu %s se změnila na %s.
Expand Down
2 changes: 2 additions & 0 deletions sormas-api/src/main/resources/strings_de-CH.properties
Original file line number Diff line number Diff line change
Expand Up @@ -497,6 +497,7 @@ headingCreateNewTreatment = Neue Behandlung erstellen
headingCreateNewUser = Neuen Benutzer erstellen
headingCreateNewUserRole = Neue Benutzerrolle erstellen
headingCreateNewVisit = Neuen Anruf erstellen
headingCreateNewEnvironmentSample = Create new environment sample
headingCreatePathogenTestResult = Neues Erregertestergebnis erstellen
headingDatabaseExportFailed = Datenbank-Export fehlgeschlagen
headingDearchiveCampaign = Kampagne de-archivieren
Expand Down Expand Up @@ -1462,6 +1463,7 @@ messageCountEnvironmentSamplesNotDeleted = %s environment samples not deleted\:
messageCountEnvironmentSamplesNotDeletedAccessDeniedReason = %s environment samples not deleted because they are not in jurisdiction or owned\: %s
messageEnvironmentSamplesRestored = All selected environment samples have been restored
messageEnvironmentSampleSaved = Environment sample saved
messageDuplicateEnvironmentFound = A similar environment already exists in the database (UUID\: %s)

# Notifications
notificationCaseClassificationChanged = Die Falldefinitionskategorie des Falls %s wurde auf %s geändert.
Expand Down
2 changes: 2 additions & 0 deletions sormas-api/src/main/resources/strings_de-DE.properties
Original file line number Diff line number Diff line change
Expand Up @@ -497,6 +497,7 @@ headingCreateNewTreatment = Neue Behandlung erstellen
headingCreateNewUser = Neuen Benutzer erstellen
headingCreateNewUserRole = Neue Benutzerrolle erstellen
headingCreateNewVisit = Neuen Anruf erstellen
headingCreateNewEnvironmentSample = Create new environment sample
headingCreatePathogenTestResult = Neues Erregertestergebnis erstellen
headingDatabaseExportFailed = Datenbank-Export fehlgeschlagen
headingDearchiveCampaign = Kampagne de-archivieren
Expand Down Expand Up @@ -1462,6 +1463,7 @@ messageCountEnvironmentSamplesNotDeleted = %s environment samples not deleted\:
messageCountEnvironmentSamplesNotDeletedAccessDeniedReason = %s environment samples not deleted because they are not in jurisdiction or owned\: %s
messageEnvironmentSamplesRestored = All selected environment samples have been restored
messageEnvironmentSampleSaved = Environment sample saved
messageDuplicateEnvironmentFound = A similar environment already exists in the database (UUID\: %s)

# Notifications
notificationCaseClassificationChanged = Die Falldefinitionskategorie des Falls %s wurde auf %s geändert.
Expand Down
Loading

0 comments on commit 7f0d310

Please sign in to comment.