Skip to content

Commit

Permalink
[GITFLOW]merging 'release-1.71.0' into 'master'
Browse files Browse the repository at this point in the history
  • Loading branch information
jenkins committed May 6, 2022
2 parents f50e51f + fe8e03a commit 8655c59
Show file tree
Hide file tree
Showing 646 changed files with 40,933 additions and 17,192 deletions.
21 changes: 20 additions & 1 deletion docs/TROUBLESHOOTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,15 @@ Please consult this collection of solutions to common problems if you have any i
**Q:** I don't see a logout option anywhere in the mobile app. How can I change my user?
**A:** The logout option is hidden by default because users in the field often don't know their own passwords, but their devices are instead set up by a supervisor. If you want to change your user, go to the Settings screen and tap the version number five times to bring up additional options, including the logout option.

**Q:** The app crashes. How can I get a log file?
**A:** If you are using a release version of the app and need to get error logs, you can do the following:

1. [Enable developer options in the Android device's settings](https://developer.android.com/studio/debug/dev-options)
2. Use the "Take Bug Report" option. The full report is not needed.
3. The zip file that is created will have a dumpstate-<current date>.txt file that contains the log and some more information
4. Open it and search for de.symeda.sormas to identify the process id. E.g. `de.symeda.sormas.app/de.symeda.sormas.app.login.LoginActivity$_11109#0` -> 11109 is the id
5. Search for all occurences of the process id to filter the file down to lines that contain the actual log of sormas

## Debugging Performance Problems

Performance logging can be used to find out which part of the code or system might be responsible for long-running functions in the application. This helps the developers to identify the source of the problems quicker and find out whether there are several problems at once or performance problems that manifest in Java execution time instead of slow SQL queries.
Expand All @@ -15,10 +24,20 @@ Performance logging can be used to find out which part of the code or system mig

### Switch on Performance Logging in SORMAS

1. Open the logback file located in your domain (default path: `/opt/domains/sormas/config/logback.xml`) and change the log level of `PerformanceLoggingInterceptor` to `DEBUG`. The config change will be recognized during runtime within 30s. After that you will see detailed log entries in the SORMAS log.
1. Open the logback file located in your domain (default path: `/opt/domains/sormas/config/logback.xml`) and change the log level of `PerformanceLoggingInterceptor` to `DEBUG` or `TRACE`. The config change will be recognized during runtime within 30s. After that you will see detailed log entries in the SORMAS log.

2. Set the log level back to its default once the logging has been done since it can reduce the overall performance of SORMAS.

### Analyze Performance Logs

Performance logs can be analyzed in detail using the `PerformanceLogAnalysisGenerator`. To use this tool, set the `PerformanceLoggingInterceptor`'s log level
to `TRACE` as described above and reproduce the scenario you want to investigate on the server instance.

After this, process the debug log file (default path: `/opt/domains/sormas/logs/application.debug`) using the `PerformanceLogAnalysisGenerator`. This will
generate three files (`<logfileName>.csv`, `<logfileName>.txt`, `<logfileName>.html`) to further investigate method runtimes.

`<logfileName>.html` provides a navigable overview of methods along with runtime statistics (total, min, max and average time) and calls to sub methods.

### Log Slow SQL Queries in PostgreSQL

You can enable the logging of slow SQL queries in your PostgreSQL server in `postgresql.conf`:
Expand Down
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.70.4</version>
<version>1.71.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 @@ -19,6 +19,7 @@
import javax.naming.NamingException;

import de.symeda.sormas.api.action.ActionFacade;
import de.symeda.sormas.api.audit.AuditLoggerFacade;
import de.symeda.sormas.api.bagexport.BAGExportFacade;
import de.symeda.sormas.api.campaign.CampaignFacade;
import de.symeda.sormas.api.campaign.data.CampaignFormDataFacade;
Expand Down Expand Up @@ -474,6 +475,10 @@ public static SyncFacade getSyncFacade() {
return get().lookupEjbRemote(SyncFacade.class);
}

public static AuditLoggerFacade getAuditLoggerFacade() {
return get().lookupEjbRemote(AuditLoggerFacade.class);
}

@SuppressWarnings("unchecked")
public <P> P lookupEjbRemote(Class<P> clazz) {
try {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
package de.symeda.sormas.api.audit;

import javax.ejb.Remote;

@Remote
public interface AuditLoggerFacade {

void logRestCall(String path, String method);
void logFailedUiLogin(String caller, String method, String pathInfo);
void logFailedRestLogin(String authorizationHeader, String method, String pathInfo);
}
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ public class Constants {
"revoke",
"reset",
"enable",
"disable")));
"disable",
"log")));

}
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@
import static de.symeda.sormas.api.CountryHelper.COUNTRY_CODE_SWITZERLAND;
import static de.symeda.sormas.api.utils.FieldConstraints.CHARACTER_LIMIT_BIG;

import de.symeda.sormas.api.user.UserRight;
import de.symeda.sormas.api.utils.DependingOnUserRight;
import java.util.Date;
import java.util.List;
import java.util.Map;
Expand Down Expand Up @@ -336,6 +338,7 @@ public class CaseDataDto extends SormasToSormasShareableDto {
private String healthFacilityDetails;

@Valid
@Required
private HealthConditionsDto healthConditions;

private YesNoUnknown pregnant;
Expand Down Expand Up @@ -367,12 +370,15 @@ public class CaseDataDto extends SormasToSormasShareableDto {
private UserReferenceDto surveillanceOfficer;
@SensitiveData
@Size(max = FieldConstraints.CHARACTER_LIMIT_DEFAULT, message = Validations.textTooLong)
@DependingOnUserRight(UserRight.CASE_CLINICIAN_VIEW)
private String clinicianName;
@SensitiveData
@Size(max = FieldConstraints.CHARACTER_LIMIT_DEFAULT, message = Validations.textTooLong)
@DependingOnUserRight(UserRight.CASE_CLINICIAN_VIEW)
private String clinicianPhone;
@SensitiveData
@Size(max = FieldConstraints.CHARACTER_LIMIT_DEFAULT, message = Validations.textTooLong)
@DependingOnUserRight(UserRight.CASE_CLINICIAN_VIEW)
private String clinicianEmail;
@Diseases({
Disease.CONGENITAL_RUBELLA })
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,10 @@
import de.symeda.sormas.api.person.Sex;
import de.symeda.sormas.api.sample.PathogenTestResultType;
import de.symeda.sormas.api.symptoms.SymptomsDto;
import de.symeda.sormas.api.user.UserRight;
import de.symeda.sormas.api.user.UserRole;
import de.symeda.sormas.api.utils.DataHelper;
import de.symeda.sormas.api.utils.DependingOnUserRight;
import de.symeda.sormas.api.utils.HideForCountries;
import de.symeda.sormas.api.utils.HideForCountriesExcept;
import de.symeda.sormas.api.utils.Order;
Expand Down Expand Up @@ -323,10 +325,13 @@ public class CaseExportDto implements Serializable {
private String responsibleCommunity;

@SensitiveData
@DependingOnUserRight(UserRight.CASE_CLINICIAN_VIEW)
private String clinicianName;
@SensitiveData
@DependingOnUserRight(UserRight.CASE_CLINICIAN_VIEW)
private String clinicianPhone;
@SensitiveData
@DependingOnUserRight(UserRight.CASE_CLINICIAN_VIEW)
private String clinicianEmail;

private Long reportingUserId;
Expand Down Expand Up @@ -1030,7 +1035,7 @@ public YesNoUnknown getSequelae() {
@ExportTarget(caseExportTypes = {
CaseExportType.CASE_SURVEILLANCE,
CaseExportType.CASE_MANAGEMENT })
@ExportProperty(value = CaseDataDto.SEQUELAE, combined = true)
@ExportProperty(value = CaseDataDto.SEQUELAE_DETAILS, combined = true)
@ExportGroup(ExportGroupType.ADDITIONAL)
public String getSequelaeDetails() {
return sequelaeDetails;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ Long countCasesForMap(

boolean doesExternalTokenExist(String externalToken, String caseUuid);

String generateEpidNumber(CaseDataDto caze);
String getGenerateEpidNumber(CaseDataDto caze);

void mergeCase(String leadUuid, String otherUuid);

Expand Down Expand Up @@ -233,4 +233,6 @@ void saveBulkEditWithFacilities(
void archive(List<String> entityUuids, boolean includeContacts);

void dearchive(List<String> entityUuids, String dearchiveReason, boolean includeContacts);

void setResultingCase(EventParticipantReferenceDto eventParticipantReferenceDto, CaseReferenceDto caseReferenceDto);
}
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ public interface ContactFacade extends CoreFacade<ContactDto, ContactIndexDto, C

List<String> deleteContacts(List<String> contactUuids);

FollowUpPeriodDto calculateFollowUpUntilDate(ContactDto contactDto, boolean ignoreOverwrite);
FollowUpPeriodDto getCalculatedFollowUpUntilDate(ContactDto contactDto, boolean ignoreOverwrite);

List<ContactListEntryDto> getEntriesList(String personUuid, Integer first, Integer max);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
import de.symeda.sormas.api.followup.FollowUpPeriodDto;
import de.symeda.sormas.api.followup.FollowUpStartDateType;
import de.symeda.sormas.api.sample.SampleDto;
import de.symeda.sormas.api.utils.DataHelper;
import de.symeda.sormas.api.visit.VisitDto;

public final class ContactLogic {
Expand Down Expand Up @@ -83,4 +84,10 @@ public static FollowUpPeriodDto calculateFollowUpUntilDate(
Date overwriteUntilDate = !ignoreOverwrite && contact.isOverwriteFollowUpUntil() ? contact.getFollowUpUntil() : null;
return FollowUpLogic.calculateFollowUpUntilDate(followUpPeriod, overwriteUntilDate, visits, followUpDuration, allowFreeOverwrite);
}

public static String extendFollowUpStatusComment(String followUpComment, String extensionComment) {
return extensionComment != null && extensionComment.equals(followUpComment)
? followUpComment
: DataHelper.joinStrings("\n", followUpComment, extensionComment);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,8 @@ public String getCaption() {
contactName.lastName,
caseName != null ? caseName.firstName : null,
caseName != null ? caseName.lastName : null,
getUuid());
getUuid(),
true);
}

@JsonIgnore
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
package de.symeda.sormas.api.dashboard;

import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Map;

import de.symeda.sormas.api.infrastructure.district.DistrictDto;

public class DashboardCaseMeasureDto implements Serializable {

private static final long serialVersionUID = -5705128377788207658L;

private Map<DistrictDto, BigDecimal> caseMeasurePerDistrict;
private BigDecimal districtValuesLowerQuartile;
private BigDecimal districtValuesMedianQuartile;
private BigDecimal districtValuesUpperQuartile;

public DashboardCaseMeasureDto(
Map<DistrictDto, BigDecimal> caseMeasurePerDistrict,
BigDecimal districtValuesLowerQuartile,
BigDecimal districtValuesMedianQuartile,
BigDecimal districtValuesUpperQuartile) {
this.caseMeasurePerDistrict = caseMeasurePerDistrict;
this.districtValuesLowerQuartile = districtValuesLowerQuartile;
this.districtValuesMedianQuartile = districtValuesMedianQuartile;
this.districtValuesUpperQuartile = districtValuesUpperQuartile;
}

public Map<DistrictDto, BigDecimal> getCaseMeasurePerDistrict() {
return caseMeasurePerDistrict;
}

public BigDecimal getDistrictValuesLowerQuartile() {
return districtValuesLowerQuartile;
}

public BigDecimal getDistrictValuesMedianQuartile() {
return districtValuesMedianQuartile;
}

public BigDecimal getDistrictValuesUpperQuartile() {
return districtValuesUpperQuartile;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,103 @@
package de.symeda.sormas.api.dashboard;

import java.io.Serializable;

public class DashboardContactFollowUpDto implements Serializable {

private static final long serialVersionUID = -5705128377788207650L;
private int followUpContactsCount;
private int cooperativeContactsCount;
private int cooperativeContactsPercentage;
private int uncooperativeContactsCount;
private int uncooperativeContactsPercentage;
private int unavailableContactsCount;
private int unavailableContactsPercentage;
private int neverVisitedContactsCount;
private int notVisitedContactsPercentage;

private int missedVisitsOneDay;
private int missedVisitsTwoDays;
private int missedVisitsThreeDays;
private int missedVisitsGtThreeDays;

public DashboardContactFollowUpDto(
int followUpContactsCount,
int cooperativeContactsCount,
int cooperativeContactsPercentage,
int uncooperativeContactsCount,
int uncooperativeContactsPercentage,
int unavailableContactsCount,
int unavailableContactsPercentage,
int neverVisitedContactsCount,
int notVisitedContactsPercentage,
int missedVisitsOneDay,
int missedVisitsTwoDays,
int missedVisitsThreeDays,
int missedVisitsGtThreeDays) {
this.followUpContactsCount = followUpContactsCount;
this.cooperativeContactsCount = cooperativeContactsCount;
this.cooperativeContactsPercentage = cooperativeContactsPercentage;
this.uncooperativeContactsCount = uncooperativeContactsCount;
this.uncooperativeContactsPercentage = uncooperativeContactsPercentage;
this.unavailableContactsCount = unavailableContactsCount;
this.unavailableContactsPercentage = unavailableContactsPercentage;
this.neverVisitedContactsCount = neverVisitedContactsCount;
this.notVisitedContactsPercentage = notVisitedContactsPercentage;
this.missedVisitsOneDay = missedVisitsOneDay;
this.missedVisitsTwoDays = missedVisitsTwoDays;
this.missedVisitsThreeDays = missedVisitsThreeDays;
this.missedVisitsGtThreeDays = missedVisitsGtThreeDays;
}

public int getFollowUpContactsCount() {
return followUpContactsCount;
}

public int getCooperativeContactsCount() {
return cooperativeContactsCount;
}

public int getCooperativeContactsPercentage() {
return cooperativeContactsPercentage;
}

public int getUncooperativeContactsCount() {
return uncooperativeContactsCount;
}

public int getUncooperativeContactsPercentage() {
return uncooperativeContactsPercentage;
}

public int getUnavailableContactsCount() {
return unavailableContactsCount;
}

public int getUnavailableContactsPercentage() {
return unavailableContactsPercentage;
}

public int getNeverVisitedContactsCount() {
return neverVisitedContactsCount;
}

public int getNotVisitedContactsPercentage() {
return notVisitedContactsPercentage;
}

public int getMissedVisitsOneDay() {
return missedVisitsOneDay;
}

public int getMissedVisitsTwoDays() {
return missedVisitsTwoDays;
}

public int getMissedVisitsThreeDays() {
return missedVisitsThreeDays;
}

public int getMissedVisitsGtThreeDays() {
return missedVisitsGtThreeDays;
}
}
Loading

0 comments on commit 8655c59

Please sign in to comment.