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

Commit fa47006

Browse files
author
barnabartha
committed
Merge branch 'development' into 2644-populationDataInCampaignDiagrams
2 parents c5bc4cd + 31a4d45 commit fa47006

369 files changed

Lines changed: 25335 additions & 670 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.

SERVER_CUSTOMIZATION.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ The following properties are currently configurable:
1919
* **EPID prefix** `country.epidprefix`: SORMAS automatically generates EPID numbers for new cases. This is the prefix your country is using for all of these numbers. Most of the time it will be some sort of country code and should be three characters long.
2020
* **Country center/zoom** `country.center.latitude`, `country.center.longitude` and `map.zoom`: These are the geo coordinates of the geographical center of the country or region you're using SORMAS in. Used to set the initial location of the maps used in dashboards and statistics.
2121
* **App URL** `app.url`: The directory on your server where the mobile .apk file is stored that is used to automatically update the Android app after a new release. You should be able to copy the example given in the properties file and only have to replace the SERVER-NAME placeholder.
22-
* **File paths** `temp.path`, `generated.path` and `custom.path`: The folders that SORMAS stores files in, either temporarily during case export or permanently like import templates. Files in temp.path are automatically deleted at midnight. Files in custom.path can be used to customize the login page, e.g. to provide default logins for demo servers or add additional contributors to the right sidebar.
22+
* **File paths** `documents.path`, `temp.path`, `generated.path` and `custom.path`: The folders that SORMAS stores files in, either temporarily during case export or permanently like import templates or documents. Files in temp.path are automatically deleted at midnight. Files in custom.path can be used to customize the login page, e.g. to provide default logins for demo servers or add additional contributors to the right sidebar.
2323
* **Automatic case classification** `feature.automaticcaseclassification`: Determines whether SORMAS automatically classifies cases based on a number of criteria that are defined in the code.
2424
* **Email settings** `email.sender.address` and `email.sender.name`: The email address and sender name that should be used when SORMAS is sending out emails, e.g. to notify users about specific events.
2525
* **SMS settings** `sms.sender.name, sms.auth.key and sms.auth.secret`: Besides emails, SORMAS also supports sending automatic SMS to users at the same time (e.g. when a case has been classified as confirmed). The SMS provider SORMAS is using is the Vonage SMS API (https://www.vonage.com/communications-apis/sms/). If you have an account there, you can use your key and secret here to enable sending out SMS. Leaving these properties empty will disable this feature.
@@ -87,3 +87,4 @@ The following features are currently configurable:
8787
* **Area Infrastructure** `INFRASTRUCTURE_TYPE_AREA`: Enables an additional infrastructure level above region that is called area by default. Currently only used in the campaigns module.
8888
* **Case Follow-Up** `CASE_FOLLOWUP`: Enables the contact follow-up module for cases as well to allow a more detailed daily documentation of symptoms.
8989
* **Line Listing** `LINE_LISTING`: Whether or not using line listing for case entry is enabled in the specified jurisdiction for the specified disease. Configurable from the UI, no database interaction needed.
90+
* **Documents** `DOCUMENTS`: Enables document storage.

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

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,17 @@
1-
/*******************************************************************************
1+
/*
22
* SORMAS® - Surveillance Outbreak Response Management & Analysis System
3-
* Copyright © 2016-2018 Helmholtz-Zentrum für Infektionsforschung GmbH (HZI)
4-
*
3+
* Copyright © 2016-2020 Helmholtz-Zentrum für Infektionsforschung GmbH (HZI)
54
* This program is free software: you can redistribute it and/or modify
65
* it under the terms of the GNU General Public License as published by
76
* the Free Software Foundation, either version 3 of the License, or
87
* (at your option) any later version.
9-
*
108
* This program is distributed in the hope that it will be useful,
119
* but WITHOUT ANY WARRANTY; without even the implied warranty of
1210
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1311
* GNU General Public License for more details.
14-
*
1512
* You should have received a copy of the GNU General Public License
1613
* along with this program. If not, see <https://www.gnu.org/licenses/>.
17-
*******************************************************************************/
14+
*/
1815
package de.symeda.sormas.api;
1916

2017
import javax.ejb.Remote;
@@ -50,6 +47,8 @@ public interface ConfigFacade {
5047

5148
String getSmsAuthSecret();
5249

50+
String getDocumentFilesPath();
51+
5352
String getTempFilesPath();
5453

5554
String getGeneratedFilesPath();
@@ -113,4 +112,7 @@ public interface ConfigFacade {
113112
boolean isExternalJournalActive();
114113

115114
int getDashboardMapMarkerLimit();
115+
116+
boolean isSmsServiceSetUp();
117+
116118
}

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

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,17 @@
1-
/*******************************************************************************
1+
/*
22
* SORMAS® - Surveillance Outbreak Response Management & Analysis System
3-
* Copyright © 2016-2018 Helmholtz-Zentrum für Infektionsforschung GmbH (HZI)
4-
*
3+
* Copyright © 2016-2020 Helmholtz-Zentrum für Infektionsforschung GmbH (HZI)
54
* This program is free software: you can redistribute it and/or modify
65
* it under the terms of the GNU General Public License as published by
76
* the Free Software Foundation, either version 3 of the License, or
87
* (at your option) any later version.
9-
*
108
* This program is distributed in the hope that it will be useful,
119
* but WITHOUT ANY WARRANTY; without even the implied warranty of
1210
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1311
* GNU General Public License for more details.
14-
*
1512
* You should have received a copy of the GNU General Public License
1613
* along with this program. If not, see <https://www.gnu.org/licenses/>.
17-
*******************************************************************************/
14+
*/
1815
package de.symeda.sormas.api;
1916

2017
import javax.naming.InitialContext;
@@ -37,6 +34,7 @@
3734
import de.symeda.sormas.api.disease.DiseaseConfigurationFacade;
3835
import de.symeda.sormas.api.disease.DiseaseFacade;
3936
import de.symeda.sormas.api.docgeneneration.QuarantineOrderFacade;
37+
import de.symeda.sormas.api.document.DocumentFacade;
4038
import de.symeda.sormas.api.epidata.EpiDataFacade;
4139
import de.symeda.sormas.api.event.EventFacade;
4240
import de.symeda.sormas.api.event.EventParticipantFacade;
@@ -54,6 +52,7 @@
5452
import de.symeda.sormas.api.person.PersonFacade;
5553
import de.symeda.sormas.api.region.AreaFacade;
5654
import de.symeda.sormas.api.region.CommunityFacade;
55+
import de.symeda.sormas.api.region.CountryFacade;
5756
import de.symeda.sormas.api.region.DistrictFacade;
5857
import de.symeda.sormas.api.region.GeoShapeProvider;
5958
import de.symeda.sormas.api.region.RegionFacade;
@@ -158,6 +157,9 @@ public static FacilityFacade getFacilityFacade() {
158157
return get().lookupEjbRemote(FacilityFacade.class);
159158
}
160159

160+
public static CountryFacade getCountryFacade() {
161+
return get().lookupEjbRemote(CountryFacade.class);
162+
}
161163
public static RegionFacade getRegionFacade() {
162164
return get().lookupEjbRemote(RegionFacade.class);
163165
}
@@ -310,11 +312,15 @@ public static QuarantineOrderFacade getQuarantineOrderFacade() {
310312
return get().lookupEjbRemote(QuarantineOrderFacade.class);
311313
}
312314

313-
public static ExternalJournalFacade getExternalJournalFacade() {
315+
public static ExternalJournalFacade getExternalJournalFacade() {
314316
return get().lookupEjbRemote(ExternalJournalFacade.class);
315-
}
317+
}
318+
319+
public static DocumentFacade getDocumentFacade() {
320+
return get().lookupEjbRemote(DocumentFacade.class);
321+
}
316322

317-
@SuppressWarnings("unchecked")
323+
@SuppressWarnings("unchecked")
318324
public <P> P lookupEjbRemote(Class<P> clazz) {
319325
try {
320326
return (P) get().ic.lookup(buildJndiLookupName(clazz));

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -505,7 +505,7 @@ public CaseReferenceDto toReference() {
505505
* Returns true if the case is an original point of entry case and has not yet
506506
* been assigned a health facility.
507507
*/
508-
public boolean isUnreferredPortHealthCase() {
508+
public boolean checkIsUnreferredPortHealthCase() {
509509
return caseOrigin == CaseOrigin.POINT_OF_ENTRY && healthFacility == null;
510510
}
511511

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

Lines changed: 23 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -181,6 +181,8 @@ public class CaseExportDto implements Serializable {
181181
private String facility;
182182
@SensitiveData
183183
private String phone;
184+
@SensitiveData
185+
private String emailAddress;
184186
private String occupationType;
185187
private String educationType;
186188
private String travelHistory;
@@ -258,7 +260,7 @@ public CaseExportDto(long id, long personId, long personAddressId, long epiDataI
258260
Date deathDate, Date burialDate, BurialConductor burialConductor, String burialPlaceDescription,
259261
String addressRegion, String addressDistrict, String addressCommunity, String city, String street, String houseNumber, String additionalInformation, String postalCode,
260262
String facility, String facilityUuid, String facilityDetails,
261-
String phone, String phoneOwner, EducationType educationType, String educationDetails,
263+
String phone, String phoneOwner, String emailAddress, EducationType educationType, String educationDetails,
262264
OccupationType occupationType, String occupationDetails, YesNoUnknown traveled,
263265
YesNoUnknown burialAttended, YesNoUnknown directContactConfirmedCase, YesNoUnknown directContactProbableCase, YesNoUnknown contactWithRodent,
264266
//Date onsetDate,
@@ -324,6 +326,7 @@ public CaseExportDto(long id, long personId, long personAddressId, long epiDataI
324326
this.postalCode = postalCode;
325327
this.facility = FacilityHelper.buildFacilityString(facilityUuid, facility, facilityDetails);
326328
this.phone = PersonHelper.buildPhoneString(phone, phoneOwner);
329+
this.emailAddress = emailAddress;
327330
this.educationType = PersonHelper.buildEducationString(educationType, educationDetails);
328331
this.occupationType = PersonHelper.buildOccupationString(occupationType, occupationDetails);
329332
this.traveled = traveled;
@@ -973,6 +976,16 @@ public String getPhone() {
973976
}
974977

975978
@Order(75)
979+
@ExportTarget(caseExportTypes = {
980+
CaseExportType.CASE_SURVEILLANCE,
981+
CaseExportType.CASE_MANAGEMENT })
982+
@ExportProperty(PersonDto.EMAIL_ADDRESS)
983+
@ExportGroup(ExportGroupType.SENSITIVE)
984+
public String getEmailAddress() {
985+
return emailAddress;
986+
}
987+
988+
@Order(76)
976989
@ExportTarget(caseExportTypes = {
977990
CaseExportType.CASE_SURVEILLANCE,
978991
CaseExportType.CASE_MANAGEMENT })
@@ -986,7 +999,7 @@ public void setEducationType(String educationType) {
986999
this.educationType = educationType;
9871000
}
9881001

989-
@Order(76)
1002+
@Order(77)
9901003
@ExportTarget(caseExportTypes = {
9911004
CaseExportType.CASE_SURVEILLANCE,
9921005
CaseExportType.CASE_MANAGEMENT })
@@ -996,7 +1009,7 @@ public String getOccupationType() {
9961009
return occupationType;
9971010
}
9981011

999-
@Order(77)
1012+
@Order(78)
10001013
@ExportTarget(caseExportTypes = {
10011014
CaseExportType.CASE_SURVEILLANCE })
10021015
@ExportProperty(TRAVELED)
@@ -1009,7 +1022,7 @@ public void setTraveled(YesNoUnknown traveled) {
10091022
this.traveled = traveled;
10101023
}
10111024

1012-
@Order(78)
1025+
@Order(79)
10131026
@ExportTarget(caseExportTypes = {
10141027
CaseExportType.CASE_SURVEILLANCE })
10151028
@ExportProperty(TRAVEL_HISTORY)
@@ -1018,7 +1031,7 @@ public String getTravelHistory() {
10181031
return travelHistory;
10191032
}
10201033

1021-
@Order(79)
1034+
@Order(80)
10221035
@ExportTarget(caseExportTypes = {
10231036
CaseExportType.CASE_SURVEILLANCE })
10241037
@ExportProperty(EpiDataDto.BURIAL_ATTENDED)
@@ -1031,7 +1044,7 @@ public void setBurialAttended(YesNoUnknown burialAttended) {
10311044
this.burialAttended = burialAttended;
10321045
}
10331046

1034-
@Order(80)
1047+
@Order(81)
10351048
@ExportTarget(caseExportTypes = {
10361049
CaseExportType.CASE_SURVEILLANCE })
10371050
@ExportProperty(EpiDataDto.DIRECT_CONTACT_CONFIRMED_CASE)
@@ -1497,6 +1510,10 @@ public void setPhone(String phone) {
14971510
this.phone = phone;
14981511
}
14991512

1513+
public void setEmailAddress(String emailAddress) {
1514+
this.emailAddress = emailAddress;
1515+
}
1516+
15001517
public void setOccupationType(String occupationType) {
15011518
this.occupationType = occupationType;
15021519
}

sormas-api/src/main/java/de/symeda/sormas/api/contact/ContactCriteria.java

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@
2525
import de.symeda.sormas.api.EntityRelevanceStatus;
2626
import de.symeda.sormas.api.caze.CaseClassification;
2727
import de.symeda.sormas.api.caze.CaseReferenceDto;
28+
import de.symeda.sormas.api.event.EventParticipantReferenceDto;
29+
import de.symeda.sormas.api.event.EventReferenceDto;
2830
import de.symeda.sormas.api.person.PersonReferenceDto;
2931
import de.symeda.sormas.api.person.SymptomJournalStatus;
3032
import de.symeda.sormas.api.region.CommunityReferenceDto;
@@ -112,6 +114,8 @@ public class ContactCriteria extends BaseCriteria implements Serializable {
112114
private String eventUuid;
113115
private Boolean includeContactsFromOtherJurisdictions = Boolean.FALSE;
114116
private Boolean onlyContactsSharingEventWithSourceCase;
117+
private EventParticipantReferenceDto eventParticipant;
118+
private EventReferenceDto onlyContactsWithSourceCaseInGivenEvent;
115119

116120
public UserRole getReportingUserRole() {
117121
return reportingUserRole;
@@ -531,4 +535,32 @@ public Boolean getIncludeContactsFromOtherJurisdictions() {
531535
public void setIncludeContactsFromOtherJurisdictions(Boolean includeContactsFromOtherJurisdictions) {
532536
this.includeContactsFromOtherJurisdictions = includeContactsFromOtherJurisdictions;
533537
}
538+
539+
public void setEventParticipant(EventParticipantReferenceDto eventParticipant) {
540+
this.eventParticipant = eventParticipant;
541+
}
542+
543+
@IgnoreForUrl
544+
public EventParticipantReferenceDto getEventParticipant() {
545+
return eventParticipant;
546+
}
547+
548+
public ContactCriteria eventParticipant(EventParticipantReferenceDto eventParticipant) {
549+
this.eventParticipant = eventParticipant;
550+
return this;
551+
}
552+
553+
public void setOnlyContactsWithSourceCaseInGivenEvent(EventReferenceDto onlyContactsWithSourceCaseInGivenEvent) {
554+
this.onlyContactsWithSourceCaseInGivenEvent = onlyContactsWithSourceCaseInGivenEvent;
555+
}
556+
557+
@IgnoreForUrl
558+
public EventReferenceDto getOnlyContactsWithSourceCaseInGivenEvent() {
559+
return onlyContactsWithSourceCaseInGivenEvent;
560+
}
561+
562+
public ContactCriteria onlyContactsWithSourceCaseInGivenEvent(EventReferenceDto onlyContactsWithSourceCaseInGivenEvent) {
563+
this.onlyContactsWithSourceCaseInGivenEvent = onlyContactsWithSourceCaseInGivenEvent;
564+
return this;
565+
}
534566
}

sormas-api/src/main/java/de/symeda/sormas/api/contact/ContactDto.java

Lines changed: 19 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
import de.symeda.sormas.api.caze.CaseReferenceDto;
2828
import de.symeda.sormas.api.clinicalcourse.HealthConditionsDto;
2929
import de.symeda.sormas.api.epidata.EpiDataDto;
30+
import de.symeda.sormas.api.event.EventParticipantDto;
3031
import de.symeda.sormas.api.person.PersonReferenceDto;
3132
import de.symeda.sormas.api.region.CommunityReferenceDto;
3233
import de.symeda.sormas.api.region.DistrictReferenceDto;
@@ -247,27 +248,32 @@ public class ContactDto extends PseudonymizableDto {
247248
private String endOfQuarantineReasonDetails;
248249

249250
public static ContactDto build() {
250-
return build(null, null, null);
251+
final ContactDto contact = new ContactDto();
252+
contact.setUuid(DataHelper.createUuid());
253+
contact.setPerson(new PersonReferenceDto(DataHelper.createUuid()));
254+
contact.setReportDateTime(new Date());
255+
contact.setContactClassification(ContactClassification.UNCONFIRMED);
256+
contact.setContactStatus(ContactStatus.ACTIVE);
257+
contact.setEpiData(EpiDataDto.build());
258+
contact.setHealthConditions(HealthConditionsDto.build());
259+
260+
return contact;
261+
}
262+
263+
public static ContactDto build(EventParticipantDto eventParticipant) {
264+
final ContactDto contact = build();
265+
contact.setPerson(eventParticipant.getPerson().toReference());
266+
267+
return contact;
251268
}
252269

253270
public static ContactDto build(CaseDataDto caze) {
254271
return build(caze.toReference(), caze.getDisease(), caze.getDiseaseDetails());
255272
}
256273

257274
public static ContactDto build(CaseReferenceDto caze, Disease disease, String diseaseDetails) {
258-
ContactDto contact = new ContactDto();
259-
contact.setUuid(DataHelper.createUuid());
260-
275+
final ContactDto contact = build();
261276
contact.assignCase(caze, disease, diseaseDetails);
262-
contact.setPerson(new PersonReferenceDto(DataHelper.createUuid()));
263-
264-
contact.setReportDateTime(new Date());
265-
contact.setContactClassification(ContactClassification.UNCONFIRMED);
266-
contact.setContactStatus(ContactStatus.ACTIVE);
267-
268-
contact.setEpiData(EpiDataDto.build());
269-
270-
contact.setHealthConditions(HealthConditionsDto.build());
271277

272278
return contact;
273279
}

sormas-api/src/main/java/de/symeda/sormas/api/contact/ContactExportDto.java

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,8 @@ public class ContactExportDto implements Serializable {
101101
private String facility;
102102
@SensitiveData
103103
private String phone;
104+
@SensitiveData
105+
private String emailAddress;
104106
private String occupationType;
105107
private int numberOfVisits;
106108
private YesNoUnknown lastCooperativeVisitSymptomatic;
@@ -154,7 +156,7 @@ public ContactExportDto(long id, long personId, String uuid, String sourceCaseUu
154156
PresentCondition presentCondition, Date deathDate,
155157
String addressRegion, String addressDistrict, String addressCommunity, String city, String street, String houseNumber, String additionalInformation, String postalCode,
156158
String facility, String facilityUuid, String facilityDetails,
157-
String phone, String phoneOwner, OccupationType occupationType, String occupationDetails,
159+
String phone, String phoneOwner, String emailAddress, OccupationType occupationType, String occupationDetails,
158160
String region, String district, String community,
159161
long epiDataId, YesNoUnknown traveled, YesNoUnknown burialAttended, YesNoUnknown directContactConfirmedCase, YesNoUnknown directContactProbableCase,
160162
YesNoUnknown contactWithRodent, YesNoUnknown returningTraveler, long eventCount, String externalID,
@@ -211,6 +213,7 @@ public ContactExportDto(long id, long personId, String uuid, String sourceCaseUu
211213
this.postalCode = postalCode;
212214
this.facility = FacilityHelper.buildFacilityString(facilityUuid, facility, facilityDetails);
213215
this.phone = PersonHelper.buildPhoneString(phone, phoneOwner);
216+
this.emailAddress = emailAddress;
214217
this.occupationType = PersonHelper.buildOccupationString(occupationType, occupationDetails);
215218
this.region = region;
216219
this.district = district;
@@ -520,6 +523,11 @@ public String getPhone() {
520523
return phone;
521524
}
522525

526+
@Order(53)
527+
public String getEmailAddress() {
528+
return emailAddress;
529+
}
530+
523531
@Order(60)
524532
public String getOccupationType() {
525533
return occupationType;
@@ -731,6 +739,10 @@ public void setPhone(String phone) {
731739
this.phone = phone;
732740
}
733741

742+
public void setEmailAddress(String emailAddress) {
743+
this.emailAddress = emailAddress;
744+
}
745+
734746
public void setOccupationType(String occupationType) {
735747
this.occupationType = occupationType;
736748
}

0 commit comments

Comments
 (0)