Skip to content

Commit df074e0

Browse files
author
jenkins
committed
[GITFLOW]merging 'release-1.92.0' into 'master'
2 parents 1822673 + 37bbdfc commit df074e0

390 files changed

Lines changed: 5988 additions & 2024 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

docs/DEVELOPMENT_ENVIRONMENT.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ The SORMAS CI is using JDK 17 to build all modules. The only known difference th
2121

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

2626
## Step 4: Install a Local SORMAS Server
2727
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).

docs/SOP_DISEASES.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,5 +82,5 @@ Log in as any user (e.g. the default user on the play server), open the *About*
8282
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.
8383

8484
### Step 11: Send Your Disease Definition to the SORMAS Team
85-
Send your email containing the updated Data Dictionary file, the case classification criteria and your additional notes to sormas@helmholtz-hzi.de. Congratulations, your work is done! We should now have all the information we need in order to integrate your disease into SORMAS.
85+
Send your email containing the updated Data Dictionary file, the case classification criteria and your additional notes to info@sormas.org. Congratulations, your work is done! We should now have all the information we need in order to integrate your disease into SORMAS.
8686
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!

sormas-api/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<parent>
33
<groupId>de.symeda.sormas</groupId>
44
<artifactId>sormas-base</artifactId>
5-
<version>1.91.0</version>
5+
<version>1.92.0</version>
66
<relativePath>../sormas-base</relativePath>
77
</parent>
88
<modelVersion>4.0.0</modelVersion>

sormas-api/src/main/java/de/symeda/sormas/api/FacadeProvider.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@
5353
import de.symeda.sormas.api.event.EventGroupFacade;
5454
import de.symeda.sormas.api.event.EventParticipantFacade;
5555
import de.symeda.sormas.api.event.eventimport.EventImportFacade;
56+
import de.symeda.sormas.api.externalemail.ExternalEmailFacade;
5657
import de.symeda.sormas.api.externaljournal.ExternalJournalFacade;
5758
import de.symeda.sormas.api.externalmessage.ExternalMessageAdapterFacade;
5859
import de.symeda.sormas.api.externalmessage.ExternalMessageFacade;
@@ -514,6 +515,10 @@ public static EnvironmentImportFacade getEnvironmentImportFacade() {
514515
return get().lookupEjbRemote(EnvironmentImportFacade.class);
515516
}
516517

518+
public static ExternalEmailFacade getExternalEmailFacade() {
519+
return get().lookupEjbRemote(ExternalEmailFacade.class);
520+
}
521+
517522
@SuppressWarnings("unchecked")
518523
public <P> P lookupEjbRemote(Class<P> clazz) {
519524
try {

sormas-api/src/main/java/de/symeda/sormas/api/disease/DiseaseConfigurationFacade.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,6 @@ public interface DiseaseConfigurationFacade {
3131

3232
boolean isPrimaryDisease(Disease disease);
3333

34-
List<Disease> getAllPrimaryDiseases();
35-
3634
boolean hasFollowUp(Disease disease);
3735

3836
List<Disease> getAllDiseasesWithFollowUp();

sormas-api/src/main/java/de/symeda/sormas/api/docgeneneration/DocumentWorkflow.java

Lines changed: 108 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,12 @@
2929
import static de.symeda.sormas.api.docgeneneration.RootEntityType.ROOT_VACCINATION;
3030
import static de.symeda.sormas.api.docgeneneration.TemplateFileType.DOCX;
3131
import static de.symeda.sormas.api.docgeneneration.TemplateFileType.HTML;
32+
import static de.symeda.sormas.api.docgeneneration.TemplateFileType.TXT;
3233

33-
import java.util.ArrayList;
34-
import java.util.List;
34+
import java.util.Set;
3535

3636
import de.symeda.sormas.api.i18n.I18nProperties;
37+
import de.symeda.sormas.api.user.UserRight;
3738

3839
public enum DocumentWorkflow {
3940

@@ -44,30 +45,111 @@ public enum DocumentWorkflow {
4445
// to either a CaseDataDto or a ContactDto, depending on from where
4546
// it is called. So "${case.person.firstName}" in the template refers
4647
// to the case's or contact's person's first name in either case.
47-
QUARANTINE_ORDER_CASE("quarantine", DOCX, ROOT_CASE, ROOT_PERSON, ROOT_USER, ROOT_SAMPLE, ROOT_PATHOGEN_TEST, ROOT_VACCINATION),
48-
QUARANTINE_ORDER_CONTACT("quarantineContact", DOCX, ROOT_CONTACT, ROOT_PERSON, ROOT_USER, ROOT_SAMPLE, ROOT_PATHOGEN_TEST, ROOT_VACCINATION),
49-
QUARANTINE_ORDER_EVENT_PARTICIPANT("quarantineEventParticipant",
48+
QUARANTINE_ORDER_CASE(DocumentWorkflowType.DOCUMENT,
49+
"quarantine",
5050
DOCX,
51+
UserRight.DOCUMENT_TEMPLATE_MANAGEMENT,
52+
ROOT_CASE,
53+
ROOT_PERSON,
54+
ROOT_USER,
55+
ROOT_SAMPLE,
56+
ROOT_PATHOGEN_TEST,
57+
ROOT_VACCINATION),
58+
QUARANTINE_ORDER_CONTACT(DocumentWorkflowType.DOCUMENT,
59+
"quarantineContact",
60+
DOCX,
61+
UserRight.DOCUMENT_TEMPLATE_MANAGEMENT,
62+
ROOT_CONTACT,
63+
ROOT_PERSON,
64+
ROOT_USER,
65+
ROOT_SAMPLE,
66+
ROOT_PATHOGEN_TEST,
67+
ROOT_VACCINATION),
68+
QUARANTINE_ORDER_EVENT_PARTICIPANT(DocumentWorkflowType.DOCUMENT,
69+
"quarantineEventParticipant",
70+
DOCX,
71+
UserRight.DOCUMENT_TEMPLATE_MANAGEMENT,
72+
ROOT_EVENT_PARTICIPANT,
73+
ROOT_PERSON,
74+
ROOT_USER,
75+
ROOT_SAMPLE,
76+
ROOT_PATHOGEN_TEST,
77+
ROOT_VACCINATION),
78+
QUARANTINE_ORDER_TRAVEL_ENTRY(DocumentWorkflowType.DOCUMENT,
79+
"quarantineTravelEntry",
80+
DOCX,
81+
UserRight.DOCUMENT_TEMPLATE_MANAGEMENT,
82+
ROOT_TRAVEL_ENTRY,
83+
ROOT_PERSON,
84+
ROOT_USER),
85+
EVENT_HANDOUT(DocumentWorkflowType.DOCUMENT,
86+
"eventHandout",
87+
HTML,
88+
UserRight.DOCUMENT_TEMPLATE_MANAGEMENT,
89+
ROOT_EVENT,
90+
ROOT_USER,
91+
ROOT_EVENT_ACTIONS,
92+
ROOT_EVENT_PARTICIPANTS),
93+
CASE_EMAIL(DocumentWorkflowType.EMAIL,
94+
Constants.EMAIL_TEMPLATES_FOLDER + "/cases",
95+
TXT,
96+
UserRight.EMAIL_TEMPLATE_MANAGEMENT,
97+
ROOT_CASE,
98+
ROOT_PERSON,
99+
ROOT_USER,
100+
ROOT_SAMPLE,
101+
ROOT_PATHOGEN_TEST,
102+
ROOT_VACCINATION),
103+
CONTACT_EMAIL(DocumentWorkflowType.EMAIL,
104+
Constants.EMAIL_TEMPLATES_FOLDER + "/contacts",
105+
TXT,
106+
UserRight.EMAIL_TEMPLATE_MANAGEMENT,
107+
ROOT_CONTACT,
108+
ROOT_PERSON,
109+
ROOT_USER,
110+
ROOT_SAMPLE,
111+
ROOT_PATHOGEN_TEST,
112+
ROOT_VACCINATION),
113+
EVENT_PARTICIPANT_EMAIL(DocumentWorkflowType.EMAIL,
114+
Constants.EMAIL_TEMPLATES_FOLDER + "/eventParticipants",
115+
TXT,
116+
UserRight.EMAIL_TEMPLATE_MANAGEMENT,
51117
ROOT_EVENT_PARTICIPANT,
52118
ROOT_PERSON,
53119
ROOT_USER,
54120
ROOT_SAMPLE,
55121
ROOT_PATHOGEN_TEST,
56122
ROOT_VACCINATION),
57-
QUARANTINE_ORDER_TRAVEL_ENTRY("quarantineTravelEntry", DOCX, ROOT_TRAVEL_ENTRY, ROOT_PERSON, ROOT_USER),
58-
EVENT_HANDOUT("eventHandout", HTML, ROOT_EVENT, ROOT_USER, ROOT_EVENT_ACTIONS, ROOT_EVENT_PARTICIPANTS);
123+
TRAVEL_ENTRY_EMAIL(DocumentWorkflowType.EMAIL,
124+
Constants.EMAIL_TEMPLATES_FOLDER + "/travelEntries",
125+
TXT,
126+
UserRight.EMAIL_TEMPLATE_MANAGEMENT,
127+
ROOT_TRAVEL_ENTRY,
128+
ROOT_PERSON,
129+
ROOT_USER);
130+
131+
private final DocumentWorkflowType type;
132+
private final String templateDirectory;
133+
private final TemplateFileType fileType;
59134

60-
private String templateDirectory;
61-
private TemplateFileType fileType;
62-
private List<String> rootEntityNames;
135+
private final UserRight managementUserRight;
136+
private final Set<RootEntityType> rootEntityTypes;
63137

64-
DocumentWorkflow(String templateDirectory, TemplateFileType fileType, RootEntityType... rootEntityTypes) {
138+
DocumentWorkflow(
139+
DocumentWorkflowType type,
140+
String templateDirectory,
141+
TemplateFileType fileType,
142+
UserRight managementUserRight,
143+
RootEntityType... rootEntityTypes) {
144+
this.type = type;
65145
this.templateDirectory = templateDirectory;
66146
this.fileType = fileType;
67-
this.rootEntityNames = new ArrayList<>();
68-
for (RootEntityType rootEntityName : rootEntityTypes) {
69-
this.rootEntityNames.add(rootEntityName.getEntityName().toLowerCase());
70-
}
147+
this.managementUserRight = managementUserRight;
148+
this.rootEntityTypes = Set.of(rootEntityTypes);
149+
}
150+
151+
public DocumentWorkflowType getType() {
152+
return type;
71153
}
72154

73155
public String getTemplateDirectory() {
@@ -78,8 +160,8 @@ public TemplateFileType getFileType() {
78160
return fileType;
79161
}
80162

81-
public List<String> getRootEntityNames() {
82-
return rootEntityNames;
163+
public Set<RootEntityType> getRootEntityTypes() {
164+
return rootEntityTypes;
83165
}
84166

85167
public String getFileExtension() {
@@ -90,8 +172,17 @@ public boolean isDocx() {
90172
return fileType == DOCX;
91173
}
92174

175+
public UserRight getManagementUserRight() {
176+
return managementUserRight;
177+
}
178+
93179
@Override
94180
public String toString() {
95181
return I18nProperties.getEnumCaption(this);
96182
}
183+
184+
private static class Constants {
185+
186+
public static final String EMAIL_TEMPLATES_FOLDER = "emailTemplates";
187+
}
97188
}
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
/*
2+
* SORMAS® - Surveillance Outbreak Response Management & Analysis System
3+
* Copyright © 2016-2023 Helmholtz-Zentrum für Infektionsforschung GmbH (HZI)
4+
*
5+
* This program is free software: you can redistribute it and/or modify
6+
* it under the terms of the GNU General Public License as published by
7+
* the Free Software Foundation, either version 3 of the License, or
8+
* (at your option) any later version.
9+
*
10+
* This program is distributed in the hope that it will be useful,
11+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
12+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13+
* GNU General Public License for more details.
14+
*
15+
* You should have received a copy of the GNU General Public License
16+
* along with this program. If not, see <https://www.gnu.org/licenses/>.
17+
*/
18+
19+
package de.symeda.sormas.api.docgeneneration;
20+
21+
public enum DocumentWorkflowType {
22+
DOCUMENT,
23+
EMAIL
24+
}
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
/*
2+
* SORMAS® - Surveillance Outbreak Response Management & Analysis System
3+
* Copyright © 2016-2023 Helmholtz-Zentrum für Infektionsforschung GmbH (HZI)
4+
*
5+
* This program is free software: you can redistribute it and/or modify
6+
* it under the terms of the GNU General Public License as published by
7+
* the Free Software Foundation, either version 3 of the License, or
8+
* (at your option) any later version.
9+
*
10+
* This program is distributed in the hope that it will be useful,
11+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
12+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13+
* GNU General Public License for more details.
14+
*
15+
* You should have received a copy of the GNU General Public License
16+
* along with this program. If not, see <https://www.gnu.org/licenses/>.
17+
*/
18+
19+
package de.symeda.sormas.api.docgeneneration;
20+
21+
import java.util.Properties;
22+
23+
import javax.ejb.Remote;
24+
25+
import de.symeda.sormas.api.caze.CaseReferenceDto;
26+
27+
@Remote
28+
public interface EmailTemplateFacade {
29+
30+
String generateCaseEmailContent(String templateName, CaseReferenceDto cazeRef, Properties extraProperties) throws DocumentTemplateException;
31+
}

sormas-api/src/main/java/de/symeda/sormas/api/docgeneneration/QuarantineOrderFacade.java

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,25 +15,26 @@
1515

1616
package de.symeda.sormas.api.docgeneneration;
1717

18-
import de.symeda.sormas.api.Disease;
19-
import de.symeda.sormas.api.event.EventParticipantReferenceDto;
20-
import de.symeda.sormas.api.vaccination.VaccinationReferenceDto;
2118
import java.util.List;
2219
import java.util.Map;
2320
import java.util.Properties;
2421

2522
import javax.ejb.Remote;
2623

24+
import de.symeda.sormas.api.Disease;
2725
import de.symeda.sormas.api.ReferenceDto;
26+
import de.symeda.sormas.api.event.EventParticipantReferenceDto;
2827
import de.symeda.sormas.api.sample.PathogenTestReferenceDto;
2928
import de.symeda.sormas.api.sample.SampleReferenceDto;
29+
import de.symeda.sormas.api.vaccination.VaccinationReferenceDto;
3030

3131
@Remote
3232
public interface QuarantineOrderFacade {
3333

3434
byte[] getGeneratedDocument(
3535
String templateName,
3636
DocumentWorkflow workflow,
37+
RootEntityType rootEntityType,
3738
ReferenceDto rootEntityReference,
3839
SampleReferenceDto sampleReference,
3940
PathogenTestReferenceDto pathogenTestReference,
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
/*
2+
* SORMAS® - Surveillance Outbreak Response Management & Analysis System
3+
* Copyright © 2016-2023 Helmholtz-Zentrum für Infektionsforschung GmbH (HZI)
4+
*
5+
* This program is free software: you can redistribute it and/or modify
6+
* it under the terms of the GNU General Public License as published by
7+
* the Free Software Foundation, either version 3 of the License, or
8+
* (at your option) any later version.
9+
*
10+
* This program is distributed in the hope that it will be useful,
11+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
12+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13+
* GNU General Public License for more details.
14+
*
15+
* You should have received a copy of the GNU General Public License
16+
* along with this program. If not, see <https://www.gnu.org/licenses/>.
17+
*/
18+
19+
package de.symeda.sormas.api.externalemail;
20+
21+
public class ExternalEmailException extends Exception {
22+
23+
private static final long serialVersionUID = -8417080660416586849L;
24+
25+
public ExternalEmailException(String message) {
26+
super(message);
27+
}
28+
}

0 commit comments

Comments
 (0)