Skip to content

Commit 87e469e

Browse files
authored
Merge pull request #13308 from SORMAS-Foundation/feature-13265-add-disease-configuration-ui
#13265 Disease configuration from the user interface
2 parents bfee2e2 + 00635e9 commit 87e469e

27 files changed

+1565
-7
lines changed
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
/*
2+
* SORMAS® - Surveillance Outbreak Response Management & Analysis System
3+
* Copyright © 2016-2024 Helmholtz-Zentrum für Infektionsforschung GmbH (HZI)
4+
* This program is free software: you can redistribute it and/or modify
5+
* it under the terms of the GNU General Public License as published by
6+
* the Free Software Foundation, either version 3 of the License, or
7+
* (at your option) any later version.
8+
* This program is distributed in the hope that it will be useful,
9+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
10+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11+
* GNU General Public License for more details.
12+
* You should have received a copy of the GNU General Public License
13+
* along with this program. If not, see <https://www.gnu.org/licenses/>.
14+
*/
15+
16+
package de.symeda.sormas.api;
17+
18+
import de.symeda.sormas.api.i18n.I18nProperties;
19+
20+
public enum ActiveRelevanceStatus {
21+
22+
ALL,
23+
ACTIVE,
24+
INACTIVE;
25+
26+
@Override
27+
public String toString() {
28+
return I18nProperties.getEnumCaption(this);
29+
}
30+
}
Lines changed: 94 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,94 @@
1+
/*
2+
* SORMAS® - Surveillance Outbreak Response Management & Analysis System
3+
* Copyright © 2016-2024 Helmholtz-Zentrum für Infektionsforschung GmbH (HZI)
4+
* This program is free software: you can redistribute it and/or modify
5+
* it under the terms of the GNU General Public License as published by
6+
* the Free Software Foundation, either version 3 of the License, or
7+
* (at your option) any later version.
8+
* This program is distributed in the hope that it will be useful,
9+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
10+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11+
* GNU General Public License for more details.
12+
* You should have received a copy of the GNU General Public License
13+
* along with this program. If not, see <https://www.gnu.org/licenses/>.
14+
*/
15+
16+
package de.symeda.sormas.api.disease;
17+
18+
import java.io.Serializable;
19+
import java.util.Objects;
20+
21+
import javax.validation.constraints.Min;
22+
import javax.validation.constraints.NotBlank;
23+
24+
import de.symeda.sormas.api.i18n.Validations;
25+
import de.symeda.sormas.api.person.ApproximateAgeType;
26+
27+
public class DiseaseConfigurationAgeGroup implements Serializable {
28+
29+
private static final long serialVersionUID = 4603371332829942453L;
30+
31+
@Min(value = 1, message = Validations.numberTooSmall)
32+
private Integer startAge;
33+
@NotBlank(message = Validations.required)
34+
private ApproximateAgeType startAgeType;
35+
@Min(value = 1, message = Validations.numberTooSmall)
36+
private Integer endAge;
37+
@NotBlank(message = Validations.required)
38+
private ApproximateAgeType endAgeType;
39+
40+
public DiseaseConfigurationAgeGroup() {
41+
}
42+
43+
public DiseaseConfigurationAgeGroup(Integer startAge, ApproximateAgeType startAgeType, Integer endAge, ApproximateAgeType endAgeType) {
44+
this.startAge = startAge;
45+
this.startAgeType = startAgeType;
46+
this.endAge = endAge;
47+
this.endAgeType = endAgeType;
48+
}
49+
50+
public Integer getStartAge() {
51+
return startAge;
52+
}
53+
54+
public void setStartAge(Integer startAge) {
55+
this.startAge = startAge;
56+
}
57+
58+
public ApproximateAgeType getStartAgeType() {
59+
return startAgeType;
60+
}
61+
62+
public void setStartAgeType(ApproximateAgeType startAgeType) {
63+
this.startAgeType = startAgeType;
64+
}
65+
66+
public Integer getEndAge() {
67+
return endAge;
68+
}
69+
70+
public void setEndAge(Integer endAge) {
71+
this.endAge = endAge;
72+
}
73+
74+
public ApproximateAgeType getEndAgeType() {
75+
return endAgeType;
76+
}
77+
78+
public void setEndAgeType(ApproximateAgeType endAgeType) {
79+
this.endAgeType = endAgeType;
80+
}
81+
82+
@Override
83+
public boolean equals(Object o) {
84+
if (o == null || getClass() != o.getClass())
85+
return false;
86+
DiseaseConfigurationAgeGroup that = (DiseaseConfigurationAgeGroup) o;
87+
return startAge == that.startAge && endAge == that.endAge && startAgeType == that.startAgeType && endAgeType == that.endAgeType;
88+
}
89+
90+
@Override
91+
public int hashCode() {
92+
return Objects.hash(startAge, startAgeType, endAge, endAgeType);
93+
}
94+
}
Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
/*
2+
* SORMAS® - Surveillance Outbreak Response Management & Analysis System
3+
* Copyright © 2016-2024 Helmholtz-Zentrum für Infektionsforschung GmbH (HZI)
4+
* This program is free software: you can redistribute it and/or modify
5+
* it under the terms of the GNU General Public License as published by
6+
* the Free Software Foundation, either version 3 of the License, or
7+
* (at your option) any later version.
8+
* This program is distributed in the hope that it will be useful,
9+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
10+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11+
* GNU General Public License for more details.
12+
* You should have received a copy of the GNU General Public License
13+
* along with this program. If not, see <https://www.gnu.org/licenses/>.
14+
*/
15+
16+
package de.symeda.sormas.api.disease;
17+
18+
import java.io.Serializable;
19+
20+
import de.symeda.sormas.api.ActiveRelevanceStatus;
21+
import de.symeda.sormas.api.Disease;
22+
import de.symeda.sormas.api.utils.criteria.BaseCriteria;
23+
24+
public class DiseaseConfigurationCriteria extends BaseCriteria implements Serializable, Cloneable {
25+
26+
private static final long serialVersionUID = 7768023450802175817L;
27+
28+
private Disease disease;
29+
private DiseaseConfigurationFilterReportingType reportingType;
30+
private ActiveRelevanceStatus relevanceStatus = ActiveRelevanceStatus.ALL;
31+
32+
public Disease getDisease() {
33+
return disease;
34+
}
35+
36+
public DiseaseConfigurationCriteria disease(Disease disease) {
37+
this.disease = disease;
38+
return this;
39+
}
40+
41+
public DiseaseConfigurationFilterReportingType getReportingType() {
42+
return reportingType;
43+
}
44+
45+
public DiseaseConfigurationCriteria reportingType(DiseaseConfigurationFilterReportingType reportingType) {
46+
this.reportingType = reportingType;
47+
return this;
48+
}
49+
50+
public ActiveRelevanceStatus getRelevanceStatus() {
51+
return relevanceStatus;
52+
}
53+
54+
public DiseaseConfigurationCriteria relevanceStatus(ActiveRelevanceStatus relevanceStatus) {
55+
this.relevanceStatus = relevanceStatus;
56+
return this;
57+
}
58+
}

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

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,22 @@ public class DiseaseConfigurationDto extends EntityDto {
99

1010
private static final long serialVersionUID = -7653585175036656526L;
1111

12+
public static final String I18N_PREFIX = "DiseaseConfiguration";
13+
14+
public static final String DISEASE = "disease";
15+
public static final String ACTIVE = "active";
16+
public static final String PRIMARY_DISEASE = "primaryDisease";
17+
public static final String CASE_SURVEILLANCE_ENABLED = "caseSurveillanceEnabled";
18+
public static final String AGGREGATE_REPORTING_ENABLED = "aggregateReportingEnabled";
19+
public static final String FOLLOW_UP_ENABLED = "followUpEnabled";
20+
public static final String FOLLOW_UP_DURATION = "followUpDuration";
21+
public static final String CASE_FOLLOW_UP_DURATION = "caseFollowUpDuration";
22+
public static final String EVENT_PARTICIPANT_FOLLOW_UP_DURATION = "eventParticipantFollowUpDuration";
23+
public static final String EXTENDED_CLASSIFICATION = "extendedClassification";
24+
public static final String EXTENDED_CLASSIFICATION_MULTI = "extendedClassificationMulti";
25+
public static final String AGE_GROUPS = "ageGroups";
26+
public static final String AUTOMATIC_SAMPLE_ASSIGNMENT_THRESHOLD = "automaticSampleAssignmentThreshold";
27+
1228
private Disease disease;
1329
private Boolean active;
1430
private Boolean primaryDisease;

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

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,15 @@
66
import javax.ejb.Remote;
77

88
import de.symeda.sormas.api.Disease;
9+
import de.symeda.sormas.api.utils.SortProperty;
910

1011
@Remote
1112
public interface DiseaseConfigurationFacade {
1213

1314
List<DiseaseConfigurationDto> getAllAfter(Date date);
1415

16+
DiseaseConfigurationDto getByUuid(String uuid);
17+
1518
List<DiseaseConfigurationDto> getByUuids(List<String> uuids);
1619

1720
List<String> getAllUuids();
@@ -57,4 +60,11 @@ public interface DiseaseConfigurationFacade {
5760

5861
boolean usesExtendedClassificationMulti(Disease disease);
5962

63+
long count(DiseaseConfigurationCriteria criteria);
64+
65+
List<DiseaseConfigurationIndexDto> getIndexList(
66+
DiseaseConfigurationCriteria criteria,
67+
Integer first,
68+
Integer max,
69+
List<SortProperty> sortProperties);
6070
}
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
/*
2+
* SORMAS® - Surveillance Outbreak Response Management & Analysis System
3+
* Copyright © 2016-2024 Helmholtz-Zentrum für Infektionsforschung GmbH (HZI)
4+
* This program is free software: you can redistribute it and/or modify
5+
* it under the terms of the GNU General Public License as published by
6+
* the Free Software Foundation, either version 3 of the License, or
7+
* (at your option) any later version.
8+
* This program is distributed in the hope that it will be useful,
9+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
10+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11+
* GNU General Public License for more details.
12+
* You should have received a copy of the GNU General Public License
13+
* along with this program. If not, see <https://www.gnu.org/licenses/>.
14+
*/
15+
16+
package de.symeda.sormas.api.disease;
17+
18+
import de.symeda.sormas.api.i18n.I18nProperties;
19+
20+
public enum DiseaseConfigurationFilterReportingType {
21+
22+
CASE_BASED_SURVEILLANCE,
23+
AGGREGATE_REPORTING;
24+
25+
@Override
26+
public String toString() {
27+
return I18nProperties.getEnumCaption(this);
28+
}
29+
}

0 commit comments

Comments
 (0)