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

Commit 61246c0

Browse files
committed
Merge branch 'development' into feature-2982-add-area-field-to-campaign-form
# Conflicts: # sormas-api/src/main/java/de/symeda/sormas/api/i18n/Captions.java
2 parents 07ab0f1 + 3fda56a commit 61246c0

252 files changed

Lines changed: 3111 additions & 987 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.

CONTRIBUTING.md

Lines changed: 22 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -79,19 +79,36 @@ If you're interested in participating in the development of SORMAS, you can use
7979
> #61 - added model to define classification, apply automatic case classification whenever a field value changes
8080
6. Each pull request should be related to a single issue (if possible).
8181

82-
### SORMAS Sprint Board
82+
### SORMAS Product Backlog
8383

84-
The SORMAS sprint board is segmented into the following categories:
84+
The board **Product Backlog** is used to plan, refine and prioritize the tickets for the upcoming sprints.
85+
The sorting from top to bottom in every column reflects the priority for the product. The Product Owner is responsible to put tickets into the Backlog and keep the ticket information updated.
8586

86-
* **Backlog:** Issues that have been selected to be done in the current sprint, but for which work has not yet started.
87+
The Product Backlog contains the following columns:
88+
* **Backlog:** Issues that have been identified by the Product Owner to be done in the next sprints. There can be a column for each Scrum Team if it fits the need.
89+
* **Sprint n:** Contain tickets picked by the Product Owner to be done in the named sprint. Text notes or separate columns are used to separate issues between Scrum Teams. It gives a forecast what might come in the upcoming sprint and it is the starting point for the Sprint Planning. Every ticket the Development Team do not pick into their Sprint Backlog needs to be moved back to the Backlog column or one sprint further.
90+
* **Done:** Tickets that are closed (usually resolved within the running sprint) are moved here **automatically**. The sorting does not represent the priority here any more.
91+
92+
93+
### SORMAS Sprint Backlog
94+
95+
The board **Sprint Backlog** exists for each Scrum Team and is segmented into the following categories:
96+
97+
* **Backlog:** Issues that have been selected by the Development Team to be done in the current sprint, but for which work has not yet started. The sorting top to bottom on this column reflects the priority given by the Product Owner at the time of the Sprint Planning.
8798
* **In Progress:** Issues that have been assigned to a contributor and for which work has started.
8899
* **Waiting:** Issues for which work has started and that have been put on hold, e.g. because action or feedback by an external contributor is required.
89100
* **Review:** Issues that have been resolved, but not been reviewed by another contributor yet. The ticket status is usually **Open**, but **Closed** is also allowed if no code change or merge is needed.
101+
* **Testing:** Issues that have been reviewed and merged to **development** branch to be tested and verified on a central TEST instance. The ticket status is supposed to be **Closed**.
90102
* **Done:** Issues that have been resolved, reviewed and satisfy the Definition of Done. The ticket status is supposed to be **Closed**.
91103

92-
The general workflow is that whenever a contributor starts working on an issue, they **assign** themselves to it and manually **move the issue** from **Backlog** to **In Progress**.
104+
The general workflow is that whenever a contributor starts working on an issue, they **assign** themselves to it and manually **move the issue** from **Backlog** to **In Progress**.
105+
Transitions to **Waiting** and **Review** also need to be done manually. When the developer is done with all work (no code changes or merges needed, milestone is set), the ticket is supposed to be closed to go automatically to **Testing**.
106+
Approved tickets are supposed to be moved manually from **Testing** to **Done*.
107+
108+
The GitHub project has been configured to **automatically** move issues that are closed to **Testing** and issues that are reopened back to **In Progress**.
109+
110+
The Development Team is responsible to keep the tickets up to date on this board and to assign the appropriate milestone in which the work is going to be released.
93111

94-
The GitHub project has been configured to **automatically** move issues that are closed to **Done** and issues that are reopened back to **In Progress**.
95112

96113
### Eclipse Troubleshooting
97114

DEVELOPMENT_ENVIRONMENT.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,14 +68,15 @@
6868
- Open the Ant window, click on the "+" icon and select the build.xml file from the sormas-base project
6969
- Execute the "install" and "deploy-serverlibs" scripts in this order
7070
- Set the default working directory for run configurations: Run -> Edit Configurations -> Templates -> Application -> set the value for *Working directory* to ``$MODULE_WORKING_DIR$``
71-
- Configure code formatting:
71+
- **Configure code formatting:**
72+
- disable "Optimize imports on the fly" (Editor -> General -> Auto Import)
7273
- install Eclipse Code Formatter for IntelliJ (https://plugins.jetbrains.com/plugin/6546-eclipse-code-formatter)
7374
- open the plugin settings (Other Settings -> Eclipse Code Formatter) and select "Use the Eclipse Code Formatter"
7475
- under "Eclipse Formatter config file", select ``sormas-base/java-formatter-profile.xml``
7576
- check optimize imports and, for "Import order", select ``sormas-base/java-importorder-profile.importorder``
7677
- **Important:** select "Do not format other file types by IntelliJ formatter"
7778
- go to Preferences -> Editor -> Code style -> Java -> Imports: set class and static names counts for import with * to 99
78-
- for IntelliJ, code formatting is usually done with Ctrl+Alt+L. For automatic formatting, it's recommended to use the plugin Save Actions (https://plugins.jetbrains.com/plugin/7642-save-actions)
79+
- for IntelliJ, code formatting is usually done with Ctrl+Alt+L. For automatic formatting, it's recommended to use the plugin Save Actions and check the first three checkboxes in "General" and the first two checkboxes in "Formatting Actions" (https://plugins.jetbrains.com/plugin/7642-save-actions)
7980

8081
## Android Studio
8182
**Note: This is only needed for development of the SORMAS Android app

SERVER_CUSTOMIZATION.md

Lines changed: 23 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -58,16 +58,28 @@ SORMAS supports a wide range of diseases, and not all of those might be relevant
5858

5959
Right now, changing these variables unfortunately is not possible from within the user interface, but requires **direct database access**. If you have this access, you can edit the entries in the *diseaseconfiguration* table according to your needs.
6060

61-
**IMPORTANT:** Whenever you edit an entry in this table, you also need to manually set the *changedate* to the current date and time. This is required in order for the mobile app to synchronize the changes and use the edited disease configuration.
61+
**VERY IMPORTANT:** Whenever you edit an entry in this table, you also need to manually set the *changedate* to the current date and time. This is required in order for the mobile app to synchronize the changes and use the edited disease configuration.
6262

6363
## Feature Configuration
64-
Some of the features in SORMAS can be enabled or disabled for the system.
65-
Examples for this are aggregated reporting, event surveillance, national case sharing and more.
66-
67-
Right now, changing these variables unfortunately is not possible from within the user interface, but requires **direct database access**. If you have this access, you can edit the entries in the *featureconfiguration* table.
68-
69-
* There will be an entry in the database table for each feature that is available in SORMAS
70-
* Set the "enabled" value of the feature to true or false to enable or disable it
71-
* The region, district, disease and enddate columns are currently only appicable for the line listing feature. The line listing feature is the only feature that can currently be configured using the UI.
72-
73-
**IMPORTANT:** Whenever you edit an entry in this table, you also need to manually set the *changedate* to the current date and time. This is required in order for the mobile app to synchronize the changes and use the edited disease configuration.
64+
Some of the features in SORMAS can be enabled or disabled to further customize the system. Right now, changing these variables unfortunately is not possible from within the user interface, but requires **direct database access**. If you have this access, you can edit the entries in the *featureconfiguration* table. There is one entry for every configurable feature in this table, and you can set the value of the *enabled* column to *true* to enable it and *false* to disable it. The *region*, *district*, *disease* and *enddate* columns are currently only applicable for the line listing feature and define the scope in which line listing is used. Line listing is configurable from within the UI and does not need to be manually edited in the database.
65+
66+
**VERY IMPORTANT:** Whenever you edit an entry in this table, you also need to manually set the *changedate* to the current date and time. This is required in order for the mobile app to synchronize the changes and use the edited feature configuration.
67+
68+
The following features are currently configurable:
69+
70+
* **Case Surveillance** *(CASE_SURVEILANCE)*: The core module of SORMAS which allows the creation and management of suspect or confirmed disease cases.
71+
* **Contact Tracing** *(CONTACT_TRACING)*: Management and follow-up of contacts of disease cases.
72+
* **Sample Management** *(SAMPLES_LAB)*: Management of samples for cases, contacts or event participants and the documentation of pathogen tests performed on these samples.
73+
* **Event Surveillance** *(EVENT_SURVEILLANCE)*: Creating and managing events and event participants to identify potential outbreaks or disease hotspots.
74+
* **Aggregate Reporting** *(AGGREGATE_REPORTING)*: Allows collecting case numbers for a number of additional diseases for which case-based surveillance is not used. Commonly referred to as mSers in African countries.
75+
* **Weekly Reporting** *(WEEKLY_REPORTING)*: Allows mobile users to confirm the number of cases they have collected on a weekly basis and web users to see an overview of whether or not mobile users have submitted their reports and how many cases they have reported.
76+
* **Clinical Management** *(CLINICAL_MANAGEMENT)*: Enables the clinical management module of cases that allow collecting prescriptions and treatments as well as doctor's visits in a clinical context.
77+
* **National Case Sharing** *(NATIONAL_CASE_SHARING)*: Allows users with the respective rights to make cases available to the whole country, i.e. other users will see these cases even if they don't belong to their jurisdiction.
78+
* **Task Generation (Case Surveillance)** *(TASK_GENERATION_CASE_SURVEILLANCE)*: Enables or disables the automatic generation of tasks associated with case surveillance, especially the *Case Investigation* tasks that are usually generated when creating a new case.
79+
* **Task Generation (Contact Tracing)** *(TASK_GENERATION_CONTACT_TRACING)*: Enables or disables the automatic generation of tasks associated with contact tracing, especially the *Contact Investigation* tasks that are usually generated when creating a new contact and the *Contact Follow-Up* tasks that are created once a day for every contact that is under follow-up.
80+
* **Task Generation (Event Surveillance)** *(TASK_GENERATION_EVENT_SURVEILLANCE)*: Enables or disables the automatic generation of tasks associated with event surveillance.
81+
* **Task Generation (General)** *(TASK_GENERATION_GENERAL)*: Enables or disables the automatic generation of tasks that aren't directly associated with one of the three other task types described above, e.g. the *Weekly Report Generation* task that asks mobile users to submit their weekly reports.
82+
* **Campaigns** *(CAMPAIGNS)*: The campaigns module allows collecting flexible data which can be customized using the JSON format. Currently this is heavily geared towards vaccination campaigns in Afghanistan, but will be usable in a more generic way in the future for other countries as well.
83+
* **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.
84+
* **Case Follow-Up** *(CASE_FOLLOWUP)*: Enables the contact follow-up module for cases as well to allow a more detailed daily documentation of symptoms.
85+
* **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.

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

Lines changed: 54 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,15 +19,66 @@
1919
package de.symeda.sormas.api;
2020

2121
/**
22-
* Authentication provider which can be obtained trough the {@link ConfigFacade#getAuthenticationProvider()} property.
22+
* Authentication provider which can be configured trough the {@link ConfigFacade#getAuthenticationProvider()} property.
23+
* Once initialized it provides Auth Provider specific authentication configs like:
24+
* <ul>
25+
* <li>is user name case sensitive</li>
26+
* <li>is email required</li>
27+
* </ul>
2328
*
2429
* @author Alex Vidrean
2530
* @since 13-Aug-20
2631
*/
2732
public class AuthProvider {
2833

29-
public static final String KEYCLOAK = "KEYCLOAK";
34+
public static final String KEYCLOAK = "KEYCLOAK";
3035

31-
public static final String SORMAS = "SORMAS";
36+
public static final String SORMAS = "SORMAS";
3237

38+
private static AuthProvider provider;
39+
40+
private final boolean isUsernameCaseSensitive;
41+
42+
private final boolean isEmailRequired;
43+
44+
private final boolean isDefaultProvider;
45+
46+
private AuthProvider() {
47+
String configuredProvider = FacadeProvider.getConfigFacade().getAuthenticationProvider();
48+
isUsernameCaseSensitive = SORMAS.equalsIgnoreCase(configuredProvider);
49+
isEmailRequired = KEYCLOAK.equalsIgnoreCase(configuredProvider);
50+
isDefaultProvider = SORMAS.equalsIgnoreCase(configuredProvider);
51+
}
52+
53+
public static AuthProvider getProvider() {
54+
if (provider == null) {
55+
synchronized (AuthProvider.class) {
56+
if (provider == null) {
57+
provider = new AuthProvider();
58+
}
59+
}
60+
}
61+
return provider;
62+
}
63+
64+
/**
65+
* Authentication Provider requires usernames to be case sensitive or insensitive
66+
*/
67+
public boolean isUsernameCaseSensitive() {
68+
return isUsernameCaseSensitive;
69+
}
70+
71+
/**
72+
* Authentication Provider requires emails to be required or optional.
73+
*/
74+
public boolean isEmailRequired() {
75+
return isEmailRequired;
76+
}
77+
78+
/**
79+
* Current Authentication Provider is the SORMAS default one.
80+
*/
81+
public boolean isDefaultProvider() {
82+
return isDefaultProvider;
83+
}
3384
}

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ public String getString(String key, String defaultValue) {
2222

2323
}
2424

25-
return StringEscapeUtils.escapeHtml4(value);
25+
return value;
2626
}
2727

2828
public String getString(String key) {

sormas-api/src/main/java/de/symeda/sormas/api/campaign/CampaignDto.java

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,12 @@
11
package de.symeda.sormas.api.campaign;
22

33
import java.util.Date;
4+
import java.util.List;
5+
import java.util.Set;
46

57
import de.symeda.sormas.api.EntityDto;
8+
import de.symeda.sormas.api.campaign.diagram.CampaignDashboardElement;
9+
import de.symeda.sormas.api.campaign.form.CampaignFormMetaReferenceDto;
610
import de.symeda.sormas.api.user.UserReferenceDto;
711
import de.symeda.sormas.api.utils.DataHelper;
812

@@ -23,6 +27,8 @@ public class CampaignDto extends EntityDto {
2327
private Date startDate;
2428
private Date endDate;
2529
private UserReferenceDto creatingUser;
30+
private Set<CampaignFormMetaReferenceDto> campaignFormMetas;
31+
private List<CampaignDashboardElement> campaignDashboardElements;
2632

2733
public static CampaignDto build() {
2834
CampaignDto campaign = new CampaignDto();
@@ -69,4 +75,20 @@ public UserReferenceDto getCreatingUser() {
6975
public void setCreatingUser(UserReferenceDto creatingUser) {
7076
this.creatingUser = creatingUser;
7177
}
78+
79+
public Set<CampaignFormMetaReferenceDto> getCampaignFormMetas() {
80+
return campaignFormMetas;
81+
}
82+
83+
public void setCampaignFormMetas(Set<CampaignFormMetaReferenceDto> campaignFormMetas) {
84+
this.campaignFormMetas = campaignFormMetas;
85+
}
86+
87+
public List<CampaignDashboardElement> getCampaignDashboardElements() {
88+
return campaignDashboardElements;
89+
}
90+
91+
public void setCampaignDashboardElements(List<CampaignDashboardElement> campaignDashboardElements) {
92+
this.campaignDashboardElements = campaignDashboardElements;
93+
}
7294
}

sormas-api/src/main/java/de/symeda/sormas/api/campaign/CampaignFacade.java

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
package de.symeda.sormas.api.campaign;
22

3-
import de.symeda.sormas.api.campaign.diagram.CampaignDashboardElement;
4-
import de.symeda.sormas.api.utils.SortProperty;
3+
import java.util.List;
54

65
import javax.ejb.Remote;
7-
import java.util.List;
6+
7+
import de.symeda.sormas.api.campaign.diagram.CampaignDashboardElement;
8+
import de.symeda.sormas.api.utils.SortProperty;
89

910
@Remote
1011
public interface CampaignFacade {
@@ -28,4 +29,8 @@ public interface CampaignFacade {
2829
void deleteCampaign(String uuid);
2930

3031
void archiveOrDearchiveCampaign(String campaignUuid, boolean archive);
32+
33+
CampaignReferenceDto getReferenceByUuid(String uuid);
34+
35+
boolean exists(String uuid);
3136
}

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

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,17 @@
11
package de.symeda.sormas.api.contact;
22

3+
import de.symeda.sormas.api.CountryHelper;
34
import de.symeda.sormas.api.i18n.I18nProperties;
5+
import de.symeda.sormas.api.utils.HideForCountriesExcept;
46

57
public enum QuarantineType {
68

9+
@HideForCountriesExcept(countries = CountryHelper.COUNTRY_CODE_SWITZERLAND)
10+
HOSPITAL,
11+
@HideForCountriesExcept(countries = CountryHelper.COUNTRY_CODE_SWITZERLAND)
12+
HOTEL,
13+
@HideForCountriesExcept(countries = CountryHelper.COUNTRY_CODE_SWITZERLAND)
14+
ASYLUM_ACCOMMODATION,
715
INSTITUTIONELL,
816
HOME,
917
NONE,

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

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,12 +139,19 @@ public interface Captions {
139139
String Campaign_name = "Campaign.name";
140140
String Campaign_startDate = "Campaign.startDate";
141141
String campaignActiveCampaigns = "campaignActiveCampaigns";
142+
String campaignAdditionalChart = "campaignAdditionalChart";
143+
String campaignAdditionalForm = "campaignAdditionalForm";
142144
String campaignAllCampaigns = "campaignAllCampaigns";
143145
String campaignArchivedCampaigns = "campaignArchivedCampaigns";
144146
String campaignCampaignData = "campaignCampaignData";
145147
String campaignCampaignDataForm = "campaignCampaignDataForm";
146148
String campaignCampaignForm = "campaignCampaignForm";
147149
String CampaignFormData_area = "CampaignFormData.area";
150+
String campaignDashboardChart = "campaignDashboardChart";
151+
String campaignDashboardChartHeight = "campaignDashboardChartHeight";
152+
String campaignDashboardChartWidth = "campaignDashboardChartWidth";
153+
String campaignDashboardOrder = "campaignDashboardOrder";
154+
String campaignDashboardTabName = "campaignDashboardTabName";
148155
String CampaignFormData_campaign = "CampaignFormData.campaign";
149156
String CampaignFormData_campaignFormMeta = "CampaignFormData.campaignFormMeta";
150157
String CampaignFormData_formDate = "CampaignFormData.formDate";
@@ -1185,6 +1192,7 @@ public interface Captions {
11851192
String regionAllRegions = "regionAllRegions";
11861193
String regionArchivedRegions = "regionArchivedRegions";
11871194
String regionName = "regionName";
1195+
String remove = "remove";
11881196
String Sample = "Sample";
11891197
String Sample_additionalTestingRequested = "Sample.additionalTestingRequested";
11901198
String Sample_associatedCase = "Sample.associatedCase";
@@ -1550,6 +1558,7 @@ public interface Captions {
15501558
String symptomsLesionsLocations = "symptomsLesionsLocations";
15511559
String symptomsMaxTemperature = "symptomsMaxTemperature";
15521560
String symptomsSetClearedToNo = "symptomsSetClearedToNo";
1561+
String symptomsSetClearedToUnknown = "symptomsSetClearedToUnknown";
15531562
String system = "system";
15541563
String Task = "Task";
15551564
String Task_assigneeReply = "Task.assigneeReply";

0 commit comments

Comments
 (0)