Skip to content

Commit

Permalink
[GITFLOW]merging 'release-1.92.0' into 'master'
Browse files Browse the repository at this point in the history
  • Loading branch information
jenkins committed Nov 30, 2023
2 parents 1822673 + 37bbdfc commit df074e0
Show file tree
Hide file tree
Showing 390 changed files with 5,988 additions and 2,024 deletions.
2 changes: 1 addition & 1 deletion docs/DEVELOPMENT_ENVIRONMENT.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ The SORMAS CI is using JDK 17 to build all modules. The only known difference th

## Step 3: Install Maven
The scripts in `sormas-base/dev` expect `mvn` as command-line tool.
Download and install Maven for your operating system, see [binaries](https://dlcdn.apache.org/maven/maven-3/3.6.3/binaries/).
Download and install Maven for your operating system, see [binaries](https://dlcdn.apache.org/maven/maven-3/3.8.8/binaries/).

## Step 4: Install a Local SORMAS Server
Please follow the [Server Installation Instructions](../docs/SERVER_SETUP.md#sormas-installation) to set up a local SORMAS instance that you will use to test your code. Alternatively, you can also use [Maven Cargo](../sormas-cargoserver/README.md), or a [Docker installation](SERVER_DOCKER_SETUP.md) (not recommended at this time).
Expand Down
2 changes: 1 addition & 1 deletion docs/SOP_DISEASES.md
Original file line number Diff line number Diff line change
Expand Up @@ -82,5 +82,5 @@ Log in as any user (e.g. the default user on the play server), open the *About*
If there are still things that are necessary in order to properly implement the new disease in SORMAS (you might require us to create a whole new area for cases or there might be very complex mechanics that need a lot more specification), please give us as many details about them as possible. Just put all this information into your email.

### Step 11: Send Your Disease Definition to the SORMAS Team
Send your email containing the updated Data Dictionary file, the case classification criteria and your additional notes to [email protected]. Congratulations, your work is done! We should now have all the information we need in order to integrate your disease into SORMAS.
Send your email containing the updated Data Dictionary file, the case classification criteria and your additional notes to [email protected]. Congratulations, your work is done! We should now have all the information we need in order to integrate your disease into SORMAS.
If there is anything that is unclear or if we need additional details, we will get in touch with you as soon as possible. Thank you so much for contributing to SORMAS and helping us to fight the spread of as many diseases as possible!
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.91.0</version>
<version>1.92.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 @@ -53,6 +53,7 @@
import de.symeda.sormas.api.event.EventGroupFacade;
import de.symeda.sormas.api.event.EventParticipantFacade;
import de.symeda.sormas.api.event.eventimport.EventImportFacade;
import de.symeda.sormas.api.externalemail.ExternalEmailFacade;
import de.symeda.sormas.api.externaljournal.ExternalJournalFacade;
import de.symeda.sormas.api.externalmessage.ExternalMessageAdapterFacade;
import de.symeda.sormas.api.externalmessage.ExternalMessageFacade;
Expand Down Expand Up @@ -514,6 +515,10 @@ public static EnvironmentImportFacade getEnvironmentImportFacade() {
return get().lookupEjbRemote(EnvironmentImportFacade.class);
}

public static ExternalEmailFacade getExternalEmailFacade() {
return get().lookupEjbRemote(ExternalEmailFacade.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 @@ -31,8 +31,6 @@ public interface DiseaseConfigurationFacade {

boolean isPrimaryDisease(Disease disease);

List<Disease> getAllPrimaryDiseases();

boolean hasFollowUp(Disease disease);

List<Disease> getAllDiseasesWithFollowUp();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,12 @@
import static de.symeda.sormas.api.docgeneneration.RootEntityType.ROOT_VACCINATION;
import static de.symeda.sormas.api.docgeneneration.TemplateFileType.DOCX;
import static de.symeda.sormas.api.docgeneneration.TemplateFileType.HTML;
import static de.symeda.sormas.api.docgeneneration.TemplateFileType.TXT;

import java.util.ArrayList;
import java.util.List;
import java.util.Set;

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

public enum DocumentWorkflow {

Expand All @@ -44,30 +45,111 @@ public enum DocumentWorkflow {
// to either a CaseDataDto or a ContactDto, depending on from where
// it is called. So "${case.person.firstName}" in the template refers
// to the case's or contact's person's first name in either case.
QUARANTINE_ORDER_CASE("quarantine", DOCX, ROOT_CASE, ROOT_PERSON, ROOT_USER, ROOT_SAMPLE, ROOT_PATHOGEN_TEST, ROOT_VACCINATION),
QUARANTINE_ORDER_CONTACT("quarantineContact", DOCX, ROOT_CONTACT, ROOT_PERSON, ROOT_USER, ROOT_SAMPLE, ROOT_PATHOGEN_TEST, ROOT_VACCINATION),
QUARANTINE_ORDER_EVENT_PARTICIPANT("quarantineEventParticipant",
QUARANTINE_ORDER_CASE(DocumentWorkflowType.DOCUMENT,
"quarantine",
DOCX,
UserRight.DOCUMENT_TEMPLATE_MANAGEMENT,
ROOT_CASE,
ROOT_PERSON,
ROOT_USER,
ROOT_SAMPLE,
ROOT_PATHOGEN_TEST,
ROOT_VACCINATION),
QUARANTINE_ORDER_CONTACT(DocumentWorkflowType.DOCUMENT,
"quarantineContact",
DOCX,
UserRight.DOCUMENT_TEMPLATE_MANAGEMENT,
ROOT_CONTACT,
ROOT_PERSON,
ROOT_USER,
ROOT_SAMPLE,
ROOT_PATHOGEN_TEST,
ROOT_VACCINATION),
QUARANTINE_ORDER_EVENT_PARTICIPANT(DocumentWorkflowType.DOCUMENT,
"quarantineEventParticipant",
DOCX,
UserRight.DOCUMENT_TEMPLATE_MANAGEMENT,
ROOT_EVENT_PARTICIPANT,
ROOT_PERSON,
ROOT_USER,
ROOT_SAMPLE,
ROOT_PATHOGEN_TEST,
ROOT_VACCINATION),
QUARANTINE_ORDER_TRAVEL_ENTRY(DocumentWorkflowType.DOCUMENT,
"quarantineTravelEntry",
DOCX,
UserRight.DOCUMENT_TEMPLATE_MANAGEMENT,
ROOT_TRAVEL_ENTRY,
ROOT_PERSON,
ROOT_USER),
EVENT_HANDOUT(DocumentWorkflowType.DOCUMENT,
"eventHandout",
HTML,
UserRight.DOCUMENT_TEMPLATE_MANAGEMENT,
ROOT_EVENT,
ROOT_USER,
ROOT_EVENT_ACTIONS,
ROOT_EVENT_PARTICIPANTS),
CASE_EMAIL(DocumentWorkflowType.EMAIL,
Constants.EMAIL_TEMPLATES_FOLDER + "/cases",
TXT,
UserRight.EMAIL_TEMPLATE_MANAGEMENT,
ROOT_CASE,
ROOT_PERSON,
ROOT_USER,
ROOT_SAMPLE,
ROOT_PATHOGEN_TEST,
ROOT_VACCINATION),
CONTACT_EMAIL(DocumentWorkflowType.EMAIL,
Constants.EMAIL_TEMPLATES_FOLDER + "/contacts",
TXT,
UserRight.EMAIL_TEMPLATE_MANAGEMENT,
ROOT_CONTACT,
ROOT_PERSON,
ROOT_USER,
ROOT_SAMPLE,
ROOT_PATHOGEN_TEST,
ROOT_VACCINATION),
EVENT_PARTICIPANT_EMAIL(DocumentWorkflowType.EMAIL,
Constants.EMAIL_TEMPLATES_FOLDER + "/eventParticipants",
TXT,
UserRight.EMAIL_TEMPLATE_MANAGEMENT,
ROOT_EVENT_PARTICIPANT,
ROOT_PERSON,
ROOT_USER,
ROOT_SAMPLE,
ROOT_PATHOGEN_TEST,
ROOT_VACCINATION),
QUARANTINE_ORDER_TRAVEL_ENTRY("quarantineTravelEntry", DOCX, ROOT_TRAVEL_ENTRY, ROOT_PERSON, ROOT_USER),
EVENT_HANDOUT("eventHandout", HTML, ROOT_EVENT, ROOT_USER, ROOT_EVENT_ACTIONS, ROOT_EVENT_PARTICIPANTS);
TRAVEL_ENTRY_EMAIL(DocumentWorkflowType.EMAIL,
Constants.EMAIL_TEMPLATES_FOLDER + "/travelEntries",
TXT,
UserRight.EMAIL_TEMPLATE_MANAGEMENT,
ROOT_TRAVEL_ENTRY,
ROOT_PERSON,
ROOT_USER);

private final DocumentWorkflowType type;
private final String templateDirectory;
private final TemplateFileType fileType;

private String templateDirectory;
private TemplateFileType fileType;
private List<String> rootEntityNames;
private final UserRight managementUserRight;
private final Set<RootEntityType> rootEntityTypes;

DocumentWorkflow(String templateDirectory, TemplateFileType fileType, RootEntityType... rootEntityTypes) {
DocumentWorkflow(
DocumentWorkflowType type,
String templateDirectory,
TemplateFileType fileType,
UserRight managementUserRight,
RootEntityType... rootEntityTypes) {
this.type = type;
this.templateDirectory = templateDirectory;
this.fileType = fileType;
this.rootEntityNames = new ArrayList<>();
for (RootEntityType rootEntityName : rootEntityTypes) {
this.rootEntityNames.add(rootEntityName.getEntityName().toLowerCase());
}
this.managementUserRight = managementUserRight;
this.rootEntityTypes = Set.of(rootEntityTypes);
}

public DocumentWorkflowType getType() {
return type;
}

public String getTemplateDirectory() {
Expand All @@ -78,8 +160,8 @@ public TemplateFileType getFileType() {
return fileType;
}

public List<String> getRootEntityNames() {
return rootEntityNames;
public Set<RootEntityType> getRootEntityTypes() {
return rootEntityTypes;
}

public String getFileExtension() {
Expand All @@ -90,8 +172,17 @@ public boolean isDocx() {
return fileType == DOCX;
}

public UserRight getManagementUserRight() {
return managementUserRight;
}

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

private static class Constants {

public static final String EMAIL_TEMPLATES_FOLDER = "emailTemplates";
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
/*
* 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.docgeneneration;

public enum DocumentWorkflowType {
DOCUMENT,
EMAIL
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
/*
* 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.docgeneneration;

import java.util.Properties;

import javax.ejb.Remote;

import de.symeda.sormas.api.caze.CaseReferenceDto;

@Remote
public interface EmailTemplateFacade {

String generateCaseEmailContent(String templateName, CaseReferenceDto cazeRef, Properties extraProperties) throws DocumentTemplateException;
}
Original file line number Diff line number Diff line change
Expand Up @@ -15,25 +15,26 @@

package de.symeda.sormas.api.docgeneneration;

import de.symeda.sormas.api.Disease;
import de.symeda.sormas.api.event.EventParticipantReferenceDto;
import de.symeda.sormas.api.vaccination.VaccinationReferenceDto;
import java.util.List;
import java.util.Map;
import java.util.Properties;

import javax.ejb.Remote;

import de.symeda.sormas.api.Disease;
import de.symeda.sormas.api.ReferenceDto;
import de.symeda.sormas.api.event.EventParticipantReferenceDto;
import de.symeda.sormas.api.sample.PathogenTestReferenceDto;
import de.symeda.sormas.api.sample.SampleReferenceDto;
import de.symeda.sormas.api.vaccination.VaccinationReferenceDto;

@Remote
public interface QuarantineOrderFacade {

byte[] getGeneratedDocument(
String templateName,
DocumentWorkflow workflow,
RootEntityType rootEntityType,
ReferenceDto rootEntityReference,
SampleReferenceDto sampleReference,
PathogenTestReferenceDto pathogenTestReference,
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.externalemail;

public class ExternalEmailException extends Exception {

private static final long serialVersionUID = -8417080660416586849L;

public ExternalEmailException(String message) {
super(message);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
/*
* 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.externalemail;

import java.util.List;

import javax.ejb.Remote;
import javax.validation.Valid;

import de.symeda.sormas.api.docgeneneration.DocumentTemplateException;
import de.symeda.sormas.api.docgeneneration.DocumentWorkflow;

@Remote
public interface ExternalEmailFacade {

List<String> getTemplateNames(DocumentWorkflow documentWorkflow);

void sendEmail(@Valid ExternalEmailOptionsDto options) throws DocumentTemplateException, ExternalEmailException;
}
Loading

0 comments on commit df074e0

Please sign in to comment.