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

Commit c92038c

Browse files
Add risk level column and filters to event and action directories SORMAS-Foundation#3951 (SORMAS-Foundation#4101)
* Add event's riskLevel to event/action directories and exports SORMAS-Foundation#3951 * Add a filter on event's riskLevel to event/action directories SORMAS-Foundation#3951
1 parent 4b684c2 commit c92038c

12 files changed

Lines changed: 66 additions & 7 deletions

File tree

sormas-api/src/main/java/de/symeda/sormas/api/event/EventActionExportDto.java

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ public class EventActionExportDto implements Serializable {
3939
private Date eventEvolutionDate;
4040
private String eventEvolutionComment;
4141
private EventStatus eventStatus;
42+
private RiskLevel eventRiskLevel;
4243
private EventInvestigationStatus eventInvestigationStatus;
4344
private ActionMeasure actionMeasure;
4445
private String actionTitle;
@@ -57,6 +58,7 @@ public EventActionExportDto(
5758
Date eventEvolutionDate,
5859
String eventEvolutionComment,
5960
EventStatus eventStatus,
61+
RiskLevel eventRiskLevel,
6062
EventInvestigationStatus eventInvestigationStatus,
6163
ActionMeasure actionMeasure,
6264
String actionTitle,
@@ -78,6 +80,7 @@ public EventActionExportDto(
7880
this.eventEvolutionDate = eventEvolutionDate;
7981
this.eventEvolutionComment = eventEvolutionComment;
8082
this.eventStatus = eventStatus;
83+
this.eventRiskLevel = eventRiskLevel;
8184
this.eventInvestigationStatus = eventInvestigationStatus;
8285
this.actionMeasure = actionMeasure;
8386
this.actionTitle = actionTitle;
@@ -126,41 +129,46 @@ public EventStatus getEventStatus() {
126129
}
127130

128131
@Order(7)
132+
public RiskLevel getEventRiskLevel() {
133+
return eventRiskLevel;
134+
}
135+
136+
@Order(8)
129137
public EventInvestigationStatus getEventInvestigationStatus() {
130138
return eventInvestigationStatus;
131139
}
132140

133-
@Order(8)
141+
@Order(9)
134142
public ActionMeasure getActionMeasure() {
135143
return actionMeasure;
136144
}
137145

138-
@Order(9)
146+
@Order(10)
139147
public String getActionTitle() {
140148
return actionTitle;
141149
}
142150

143-
@Order(10)
151+
@Order(11)
144152
public Date getActionCreationDate() {
145153
return actionCreationDate;
146154
}
147155

148-
@Order(11)
156+
@Order(12)
149157
public Date getActionChangeDate() {
150158
return actionChangeDate;
151159
}
152160

153-
@Order(12)
161+
@Order(13)
154162
public ActionStatus getActionStatus() {
155163
return actionStatus;
156164
}
157165

158-
@Order(13)
166+
@Order(14)
159167
public ActionPriority getActionPriority() {
160168
return actionPriority;
161169
}
162170

163-
@Order(14)
171+
@Order(15)
164172
public UserReferenceDto getActionLastModifiedBy() {
165173
return actionLastModifiedBy;
166174
}

sormas-api/src/main/java/de/symeda/sormas/api/event/EventActionIndexDto.java

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ public class EventActionIndexDto implements Serializable {
3636
public static final String EVENT_START_DATE = "eventStartDate";
3737
public static final String EVENT_END_DATE = "eventEndDate";
3838
public static final String EVENT_STATUS = "eventStatus";
39+
public static final String EVENT_RISK_LEVEL = "eventRiskLevel";
3940
public static final String EVENT_INVESTIGATION_STATUS = "eventInvestigationStatus";
4041
public static final String EVENT_EVOLUTION_DATE = "eventEvolutionDate";
4142
public static final String ACTION_TITLE = "actionTitle";
@@ -51,6 +52,7 @@ public class EventActionIndexDto implements Serializable {
5152
private Date eventStartDate;
5253
private Date eventEndDate;
5354
private EventStatus eventStatus;
55+
private RiskLevel eventRiskLevel;
5456
private EventInvestigationStatus eventInvestigationStatus;
5557
private Date eventEvolutionDate;
5658
private String actionTitle;
@@ -67,6 +69,7 @@ public EventActionIndexDto(
6769
Date eventStartDate,
6870
Date eventEndDate,
6971
EventStatus eventStatus,
72+
RiskLevel eventRiskLevel,
7073
EventInvestigationStatus eventInvestigationStatus,
7174
ActionMeasure actionMeasure,
7275
Date eventEvolutionDate,
@@ -87,6 +90,7 @@ public EventActionIndexDto(
8790
this.eventStartDate = eventStartDate;
8891
this.eventEndDate = eventEndDate;
8992
this.eventStatus = eventStatus;
93+
this.eventRiskLevel = eventRiskLevel;
9094
this.eventInvestigationStatus = eventInvestigationStatus;
9195
this.actionTitle = EventHelper.buildEventActionTitleString(actionMeasure, actionTitle);
9296
this.eventEvolutionDate = eventEvolutionDate;
@@ -139,6 +143,14 @@ public void setEventStatus(EventStatus eventStatus) {
139143
this.eventStatus = eventStatus;
140144
}
141145

146+
public RiskLevel getEventRiskLevel() {
147+
return eventRiskLevel;
148+
}
149+
150+
public void setEventRiskLevel(RiskLevel eventRiskLevel) {
151+
this.eventRiskLevel = eventRiskLevel;
152+
}
153+
142154
public EventInvestigationStatus getEventInvestigationStatus() {
143155
return eventInvestigationStatus;
144156
}

sormas-api/src/main/java/de/symeda/sormas/api/event/EventCriteria.java

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,11 +45,13 @@ public class EventCriteria extends BaseCriteria implements Serializable {
4545
public static final String SURVEILLANCE_OFFICER = "surveillanceOfficer";
4646
public static final String FREE_TEXT = "freeText";
4747
public static final String EVENT_STATUS = "eventStatus";
48+
public static final String RISK_LEVEL = "riskLevel";
4849
public static final String EVENT_INVESTIGATION_STATUS = "eventInvestigationStatus";
4950
public static final String DISTRICT = "district";
5051
public static final String REGION = "region";
5152

5253
private EventStatus eventStatus;
54+
private RiskLevel riskLevel;
5355
private EventInvestigationStatus eventInvestigationStatus;
5456
private Disease disease;
5557
private UserRole reportingUserRole;
@@ -98,6 +100,19 @@ public void setEventStatus(EventStatus eventStatus) {
98100
this.eventStatus = eventStatus;
99101
}
100102

103+
public RiskLevel getRiskLevel() {
104+
return riskLevel;
105+
}
106+
107+
public EventCriteria riskLevel(RiskLevel riskLevel) {
108+
this.riskLevel = riskLevel;
109+
return this;
110+
}
111+
112+
public void setRiskLevel(RiskLevel riskLevel) {
113+
this.riskLevel = riskLevel;
114+
}
115+
101116
public EventInvestigationStatus getEventInvestigationStatus() {
102117
return eventInvestigationStatus;
103118
}

sormas-api/src/main/java/de/symeda/sormas/api/event/EventIndexDto.java

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ public class EventIndexDto extends PseudonymizableIndexDto implements Serializab
3232

3333
public static final String UUID = "uuid";
3434
public static final String EVENT_STATUS = "eventStatus";
35+
public static final String RISK_LEVEL = "riskLevel";
3536
public static final String EVENT_INVESTIGATION_STATUS = "eventInvestigationStatus";
3637
public static final String PARTICIPANT_COUNT = "participantCount";
3738
public static final String CASE_COUNT = "caseCount";
@@ -55,6 +56,7 @@ public class EventIndexDto extends PseudonymizableIndexDto implements Serializab
5556

5657
private String uuid;
5758
private EventStatus eventStatus;
59+
private RiskLevel riskLevel;
5860
private EventInvestigationStatus eventInvestigationStatus;
5961
private long participantCount;
6062
private long caseCount;
@@ -78,6 +80,7 @@ public class EventIndexDto extends PseudonymizableIndexDto implements Serializab
7880
public EventIndexDto(
7981
String uuid,
8082
EventStatus eventStatus,
83+
RiskLevel riskLevel,
8184
EventInvestigationStatus eventInvestigationStatus,
8285
Disease disease,
8386
String diseaseDetails,
@@ -107,6 +110,7 @@ public EventIndexDto(
107110

108111
this.uuid = uuid;
109112
this.eventStatus = eventStatus;
113+
this.riskLevel = riskLevel;
110114
this.eventInvestigationStatus = eventInvestigationStatus;
111115
this.disease = disease;
112116
this.diseaseDetails = diseaseDetails;
@@ -141,6 +145,14 @@ public void setEventStatus(EventStatus eventStatus) {
141145
this.eventStatus = eventStatus;
142146
}
143147

148+
public RiskLevel getRiskLevel() {
149+
return riskLevel;
150+
}
151+
152+
public void setRiskLevel(RiskLevel riskLevel) {
153+
this.riskLevel = riskLevel;
154+
}
155+
144156
public EventInvestigationStatus getEventInvestigationStatus() {
145157
return eventInvestigationStatus;
146158
}

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -841,6 +841,7 @@ public interface Captions {
841841
String EventAction_eventEvolutionComment = "EventAction.eventEvolutionComment";
842842
String EventAction_eventEvolutionDate = "EventAction.eventEvolutionDate";
843843
String EventAction_eventInvestigationStatus = "EventAction.eventInvestigationStatus";
844+
String EventAction_eventRiskLevel = "EventAction.eventRiskLevel";
844845
String EventAction_eventStatus = "EventAction.eventStatus";
845846
String EventAction_eventTitle = "EventAction.eventTitle";
846847
String EventAction_eventUuid = "EventAction.eventUuid";

sormas-api/src/main/resources/captions.properties

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -948,6 +948,7 @@ Event.diseaseTransmissionMode=Primary mode of transmission
948948
EventAction.eventUuid=Event id
949949
EventAction.eventTitle=Event title
950950
EventAction.eventStatus=Event status
951+
EventAction.eventRiskLevel=Event risk level
951952
EventAction.eventInvestigationStatus=Event investigation status
952953
EventAction.eventEvolutionDate=Event evolution date
953954
EventAction.eventEvolutionComment=Event evolution nature

sormas-backend/src/main/java/de/symeda/sormas/backend/action/ActionService.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -269,6 +269,7 @@ public List<EventActionIndexDto> getEventActionIndexList(EventCriteria criteria,
269269
event.get(Event.START_DATE),
270270
event.get(Event.END_DATE),
271271
event.get(Event.EVENT_STATUS),
272+
event.get(Event.RISK_LEVEL),
272273
event.get(Event.EVENT_INVESTIGATION_STATUS),
273274
action.get(Action.ACTION_MEASURE),
274275
event.get(Event.EVOLUTION_DATE),
@@ -381,6 +382,7 @@ public List<EventActionExportDto> getEventActionExportList(EventCriteria criteri
381382
event.get(Event.EVOLUTION_DATE),
382383
event.get(Event.EVOLUTION_COMMENT),
383384
event.get(Event.EVENT_STATUS),
385+
event.get(Event.RISK_LEVEL),
384386
event.get(Event.EVENT_INVESTIGATION_STATUS),
385387
action.get(Action.ACTION_MEASURE),
386388
action.get(Action.TITLE),

sormas-backend/src/main/java/de/symeda/sormas/backend/event/EventFacadeEjb.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -229,6 +229,7 @@ public List<EventIndexDto> getIndexList(EventCriteria eventCriteria, Integer fir
229229
cq.multiselect(
230230
event.get(Event.UUID),
231231
event.get(Event.EVENT_STATUS),
232+
event.get(Event.RISK_LEVEL),
232233
event.get(Event.EVENT_INVESTIGATION_STATUS),
233234
event.get(Event.DISEASE),
234235
event.get(Event.DISEASE_DETAILS),

sormas-backend/src/main/java/de/symeda/sormas/backend/event/EventService.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -478,6 +478,9 @@ public Predicate buildCriteriaFilter(EventCriteria eventCriteria, CriteriaBuilde
478478
if (eventCriteria.getEventStatus() != null) {
479479
filter = CriteriaBuilderHelper.and(cb, filter, cb.equal(from.get(Event.EVENT_STATUS), eventCriteria.getEventStatus()));
480480
}
481+
if (eventCriteria.getRiskLevel() != null) {
482+
filter = CriteriaBuilderHelper.and(cb, filter, cb.equal(from.get(Event.RISK_LEVEL), eventCriteria.getRiskLevel()));
483+
}
481484
if (eventCriteria.getEventInvestigationStatus() != null) {
482485
filter = CriteriaBuilderHelper
483486
.and(cb, filter, cb.equal(from.get(Event.EVENT_INVESTIGATION_STATUS), eventCriteria.getEventInvestigationStatus()));

sormas-ui/src/main/java/de/symeda/sormas/ui/events/EventActionsGrid.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@ public <V extends View> EventActionsGrid(EventCriteria eventCriteria, Class<V> v
6969
createEventDateColumn(this),
7070
createEventEvolutionDateColumn(this),
7171
EventActionIndexDto.EVENT_STATUS,
72+
EventActionIndexDto.EVENT_RISK_LEVEL,
7273
EventActionIndexDto.EVENT_INVESTIGATION_STATUS,
7374
EventActionIndexDto.ACTION_TITLE,
7475
EventActionIndexDto.ACTION_CREATION_DATE,

0 commit comments

Comments
 (0)