Skip to content
This repository was archived by the owner on May 5, 2021. It is now read-only.

Commit 39aca11

Browse files
lgallgal
authored andcommitted
Merge remote-tracking branch 'origin/development' into 3412_SurvNet-person-country-of-birth
# Conflicts: # sormas-backend/src/main/resources/sql/sormas_schema.sql
2 parents 6e08cb0 + 88a4b6a commit 39aca11

257 files changed

Lines changed: 4907 additions & 482 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.

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,8 @@ SORMAS officially supports and is tested on **Chromium-based browsers** (like Go
2727

2828
#### Is there a ReST API documentation?
2929
Yes! Please download the [latest release](https://github.com/hzi-braunschweig/SORMAS-Project/releases/latest) and copy the content of /deploy/openapi/sormas-rest.yaml to an editor that generates a visual API documentation (e.g. https://editor.swagger.io/).
30+
<br/>
31+
Runtime Swagger documentation of the External Visits Resource (used by external symptom journals such as CLIMEDO or PIA) is also available at ``<<host>>/sormas-rest/visits-external/openapi.json`` or ``<<host>>/sormas-rest/visits-external/openapi.yaml``
3032

3133
<p align="center"><img src="https://user-images.githubusercontent.com/23701005/74659600-ebb8fc00-5194-11ea-836b-a7ca9d682301.png"/></p>
3234

sormas-api/pom.xml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,11 @@
6767
<artifactId>simmetrics-core</artifactId>
6868
</dependency>
6969

70+
<dependency>
71+
<groupId>org.jsoup</groupId>
72+
<artifactId>jsoup</artifactId>
73+
</dependency>
74+
7075
</dependencies>
7176

7277
</project>

sormas-api/src/main/java/de/symeda/sormas/api/caze/CaseFacade.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,8 @@
2727
import de.symeda.sormas.api.CaseMeasure;
2828
import de.symeda.sormas.api.Disease;
2929
import de.symeda.sormas.api.Language;
30+
import de.symeda.sormas.api.messaging.ManualMessageLogDto;
31+
import de.symeda.sormas.api.messaging.MessageType;
3032
import de.symeda.sormas.api.contact.ContactReferenceDto;
3133
import de.symeda.sormas.api.contact.DashboardQuarantineDataDto;
3234
import de.symeda.sormas.api.event.EventParticipantReferenceDto;
@@ -175,4 +177,10 @@ List<DashboardQuarantineDataDto> getQuarantineDataForDashBoard(
175177
Date to);
176178

177179
long countCasesConvertedFromContacts(CaseCriteria caseCriteria);
180+
181+
void sendMessage(List<String> caseUuids, String subject, String messageContent, MessageType... messageTypes);
182+
183+
long countCasesWithMissingContactInformation(List<String> caseUuids, MessageType messageType);
184+
185+
List<ManualMessageLogDto> getMessageLog(String caseUuid, MessageType messageType);
178186
}

sormas-api/src/main/java/de/symeda/sormas/api/caze/classification/ClassificationHtmlRenderer.java

Lines changed: 10 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -17,14 +17,11 @@
1717
*******************************************************************************/
1818
package de.symeda.sormas.api.caze.classification;
1919

20-
import static de.symeda.sormas.api.utils.HtmlHelper.escapeAndUnescapeBasicTags;
21-
import static de.symeda.sormas.api.utils.HtmlHelper.unescapeBasicTags;
22-
2320
import java.util.Date;
2421
import java.util.List;
2522

2623
import org.apache.commons.lang3.StringUtils;
27-
import org.apache.commons.text.StringEscapeUtils;
24+
import org.jsoup.safety.Whitelist;
2825

2926
import de.symeda.sormas.api.Disease;
3027
import de.symeda.sormas.api.FacadeProvider;
@@ -34,6 +31,7 @@
3431
import de.symeda.sormas.api.i18n.Strings;
3532
import de.symeda.sormas.api.utils.DataHelper;
3633
import de.symeda.sormas.api.utils.DateHelper;
34+
import de.symeda.sormas.api.utils.HtmlHelper;
3735
import de.symeda.sormas.api.utils.InfoProvider;
3836

3937
/**
@@ -176,7 +174,7 @@ public static String createHtmlForDownload(String sormasServerUrl, List<Disease>
176174
html.append("<h1 style=\"text-align: center; color: #005A9C;\">").append(I18nProperties.getString(Strings.classificationClassificationRules)).append("</h1>");
177175
html.append("<h4 style=\"text-align: center;\">")
178176
.append(I18nProperties.getString(Strings.classificationGeneratedFor))
179-
.append(" ").append(StringEscapeUtils.escapeHtml4(InfoProvider.get().getVersion()))
177+
.append(" ").append(HtmlHelper.cleanHtml(InfoProvider.get().getVersion()))
180178
.append(StringUtils.wrap(I18nProperties.getString(Strings.on), " "))
181179
.append(sormasServerUrl).append(StringUtils.wrap(I18nProperties.getString(Strings.at), " "))
182180
.append(DateHelper.formatLocalDateTime(new Date(), language)).append("</h4>");
@@ -241,7 +239,7 @@ private static String buildSubCriteriaDiv(
241239
for (ClassificationCriteriaDto subCriteria : ((ClassificationCollectiveCriteria) criteria).getSubCriteria()) {
242240
if (!(subCriteria instanceof ClassificationCollectiveCriteria) || subCriteria instanceof ClassificationCompactCriteria) {
243241
// For non-collective or compact collective criteria, add the description as a list item
244-
subCriteriaSb.append("- " + escapeAndUnescapeBasicTags(subCriteria.buildDescription() + "</br>"));
242+
subCriteriaSb.append("- " + HtmlHelper.cleanHtml(subCriteria.buildDescription(), Whitelist.basic()) + "</br>");
245243
} else if (subCriteria instanceof ClassificationCollectiveCriteria
246244
&& !(subCriteria instanceof ClassificationAllOfCriteriaDto)
247245
&& !(subCriteria.getClass() == ClassificationXOfCriteriaDto.class)) {
@@ -273,7 +271,7 @@ private static String createSurroundingDiv(ClassificationCriteriaType criteriaTy
273271
//@formatter:off
274272
return "<div class='classification-rules'>"
275273
+ "<div class='main-criteria main-criteria-"
276-
+ StringEscapeUtils.escapeHtml4(criteriaType.toString())
274+
+ HtmlHelper.cleanHtml(criteriaType.toString())
277275
+ "'>"
278276
+ content
279277
+ "</div></div>";
@@ -287,7 +285,7 @@ private static String createHeadlineDiv(String headline) {
287285

288286
//@formatter:off
289287
return "<div class='headline'>"
290-
+ StringEscapeUtils.escapeHtml4(headline)
288+
+ HtmlHelper.cleanHtml(headline, Whitelist.basic())
291289
+ "</div>";
292290
//@formatter:on
293291
}
@@ -296,13 +294,12 @@ private static String createHeadlineDiv(String headline) {
296294
* Creates a div containing an info text.
297295
*/
298296
private static String createInfoDiv() {
299-
return unescapeBasicTags(StringEscapeUtils.escapeHtml4(I18nProperties.getString(Strings.classificationInfoText)));
297+
return HtmlHelper.cleanI18nString(I18nProperties.getString(Strings.classificationInfoText));
300298
}
301299

302300
private static String createInfoDiv(int requirementsNumber) {
303-
return unescapeBasicTags(
304-
StringEscapeUtils.escapeHtml4(
305-
String.format(I18nProperties.getString(Strings.classificationInfoNumberText), DataHelper.parseNumberToString(requirementsNumber))));
301+
return HtmlHelper.cleanI18nString(
302+
String.format(I18nProperties.getString(Strings.classificationInfoNumberText), DataHelper.parseNumberToString(requirementsNumber)));
306303
}
307304

308305
/**
@@ -334,7 +331,7 @@ private static String createSubCriteriaSurroundingDiv(String content) {
334331
* Specific tags are allowed to be contained in i18n strings and are thus unescaped
335332
*/
336333
private static String createCriteriaItemDiv(String text) {
337-
return unescapeBasicTags(StringEscapeUtils.escapeHtml4(text) + "<br>");
334+
return (HtmlHelper.cleanHtml(text, Whitelist.basic()) + "<br>");
338335
}
339336

340337
private enum ClassificationCriteriaType {

sormas-api/src/main/java/de/symeda/sormas/api/feature/FeatureType.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,9 +50,11 @@ public enum FeatureType {
5050
true,
5151
new FeatureType[] {
5252
TASK_MANAGEMENT }),
53+
MANUAL_EXTERNAL_MESSAGES(true, true, null),
5354
OTHER_NOTIFICATIONS(true, true, null),
5455
DOCUMENTS(true, false, null),
55-
OUTBREAKS(true, true, null);
56+
OUTBREAKS(true, true, null),
57+
LAB_MESSAGES(true, false, null);
5658

5759
/**
5860
* Server feature means that the feature only needs to be configured once per server since they define the way the system

sormas-api/src/main/java/de/symeda/sormas/api/i18n/Captions.java

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@ public interface Captions {
6767
String actionSave = "actionSave";
6868
String actionSaveChanges = "actionSaveChanges";
6969
String actionSelectAll = "actionSelectAll";
70+
String actionSend = "actionSend";
7071
String actionSettings = "actionSettings";
7172
String actionShowLessFilters = "actionShowLessFilters";
7273
String actionShowMoreFilters = "actionShowMoreFilters";
@@ -999,6 +1000,32 @@ public interface Captions {
9991000
String importSkips = "importSkips";
10001001
String inaccessibleValue = "inaccessibleValue";
10011002
String info = "info";
1003+
String LabMessage = "LabMessage";
1004+
String LabMessage_labMessageDetails = "LabMessage.labMessageDetails";
1005+
String LabMessage_labSampleId = "LabMessage.labSampleId";
1006+
String LabMessage_personBirthDateDD = "LabMessage.personBirthDateDD";
1007+
String LabMessage_personBirthDateMM = "LabMessage.personBirthDateMM";
1008+
String LabMessage_personBirthDateYYYY = "LabMessage.personBirthDateYYYY";
1009+
String LabMessage_personCity = "LabMessage.personCity";
1010+
String LabMessage_personFirstName = "LabMessage.personFirstName";
1011+
String LabMessage_personHouseNumber = "LabMessage.personHouseNumber";
1012+
String LabMessage_personLastName = "LabMessage.personLastName";
1013+
String LabMessage_personPostalCode = "LabMessage.personPostalCode";
1014+
String LabMessage_personSex = "LabMessage.personSex";
1015+
String LabMessage_personStreet = "LabMessage.personStreet";
1016+
String LabMessage_processed = "LabMessage.processed";
1017+
String LabMessage_sampleDateTime = "LabMessage.sampleDateTime";
1018+
String LabMessage_sampleMaterial = "LabMessage.sampleMaterial";
1019+
String LabMessage_sampleReceivedDate = "LabMessage.sampleReceivedDate";
1020+
String LabMessage_specimenCondition = "LabMessage.specimenCondition";
1021+
String LabMessage_testDateTime = "LabMessage.testDateTime";
1022+
String LabMessage_testedDisease = "LabMessage.testedDisease";
1023+
String LabMessage_testLabCity = "LabMessage.testLabCity";
1024+
String LabMessage_testLabExternalId = "LabMessage.testLabExternalId";
1025+
String LabMessage_testLabName = "LabMessage.testLabName";
1026+
String LabMessage_testLabPostalCode = "LabMessage.testLabPostalCode";
1027+
String LabMessage_testResult = "LabMessage.testResult";
1028+
String LabMessage_testType = "LabMessage.testType";
10021029
String lastName = "lastName";
10031030
String lineListingAddLine = "lineListingAddLine";
10041031
String lineListingDisableAll = "lineListingDisableAll";
@@ -1076,6 +1103,16 @@ public interface Captions {
10761103
String MaternalHistory_swollenLymphsMonth = "MaternalHistory.swollenLymphsMonth";
10771104
String MaternalHistory_swollenLymphsOnset = "MaternalHistory.swollenLymphsOnset";
10781105
String menu = "menu";
1106+
String messagesCharacters = "messagesCharacters";
1107+
String messagesEmail = "messagesEmail";
1108+
String messagesNoPhoneNumberForCasePerson = "messagesNoPhoneNumberForCasePerson";
1109+
String messagesNoSmsSentForCase = "messagesNoSmsSentForCase";
1110+
String messagesNumberOfMessages = "messagesNumberOfMessages";
1111+
String messagesNumberOfMissingPhoneNumbers = "messagesNumberOfMissingPhoneNumbers";
1112+
String messagesSendingSms = "messagesSendingSms";
1113+
String messagesSendSMS = "messagesSendSMS";
1114+
String messagesSentBy = "messagesSentBy";
1115+
String messagesSms = "messagesSms";
10791116
String moreActions = "moreActions";
10801117
String name = "name";
10811118
String nationalHealthId = "nationalHealthId";

sormas-api/src/main/java/de/symeda/sormas/api/i18n/Strings.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -629,6 +629,7 @@ public interface Strings {
629629
String messageDistrictsArchivingNotPossible = "messageDistrictsArchivingNotPossible";
630630
String messageDistrictsDearchived = "messageDistrictsDearchived";
631631
String messageDistrictsDearchivingNotPossible = "messageDistrictsDearchivingNotPossible";
632+
String messageEnterSms = "messageEnterSms";
632633
String messageEntryCreated = "messageEntryCreated";
633634
String messageEpiDataHint = "messageEpiDataHint";
634635
String messageEpidNumberWarning = "messageEpidNumberWarning";
@@ -769,6 +770,7 @@ public interface Strings {
769770
String notificationLabSampleShippedShort = "notificationLabSampleShippedShort";
770771
String notificationLabSampleShippedShortForContact = "notificationLabSampleShippedShortForContact";
771772
String notificationLabSampleShippedShortForEventParticipant = "notificationLabSampleShippedShortForEventParticipant";
773+
String notificationSmsSent = "notificationSmsSent";
772774
String notificationTaskDueGeneral = "notificationTaskDueGeneral";
773775
String notificationTaskDueSpecific = "notificationTaskDueSpecific";
774776
String notificationTaskStartGeneral = "notificationTaskStartGeneral";

0 commit comments

Comments
 (0)