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

Commit 840cd1b

Browse files
Add riskLevel to events with cluster status SORMAS-Foundation#3271 (SORMAS-Foundation#3633)
* Add riskLevel to events with cluster status SORMAS-Foundation#3271 * Rename RiskLevel enum values SORMAS-Foundation#3271 * Add riskLevel field to the event read fragment SORMAS-Foundation#3271 * Rename riskLevel enum captions SORMAS-Foundation#3271 * Amend spelling mistake to RiskLevel.MODERATE SORMAS-Foundation#3271 * Remove toShortString method in RiskLevel enum class SORMAS-Foundation#3271 * Add riskLevel import in EventEditFragment
1 parent 39d24a8 commit 840cd1b

16 files changed

Lines changed: 156 additions & 28 deletions

File tree

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

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ public class EventDto extends PseudonymizableDto {
3636

3737
public static final String EVENT_STATUS = "eventStatus";
3838
public static final String EVENT_INVESTIGATION_STATUS = "eventInvestigationStatus";
39+
public static final String RISK_LEVEL = "riskLevel";
3940
public static final String EVENT_INVESTIGATION_START_DATE = "eventInvestigationStartDate";
4041
public static final String EVENT_INVESTIGATION_END_DATE = "eventInvestigationEndDate";
4142
public static final String EVENT_PERSONS = "eventPersons";
@@ -71,6 +72,7 @@ public class EventDto extends PseudonymizableDto {
7172

7273
@Required
7374
private EventStatus eventStatus;
75+
private RiskLevel riskLevel;
7476
private EventInvestigationStatus eventInvestigationStatus;
7577
private Date eventInvestigationStartDate;
7678
private Date eventInvestigationEndDate;
@@ -126,6 +128,14 @@ public void setEventStatus(EventStatus eventStatus) {
126128
this.eventStatus = eventStatus;
127129
}
128130

131+
public RiskLevel getRiskLevel() {
132+
return riskLevel;
133+
}
134+
135+
public void setRiskLevel(RiskLevel riskLevel) {
136+
this.riskLevel = riskLevel;
137+
}
138+
129139
public EventInvestigationStatus getEventInvestigationStatus() {
130140
return eventInvestigationStatus;
131141
}

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

Lines changed: 37 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ public class EventExportDto implements Serializable {
2929
private String uuid;
3030
private String externalId;
3131
private EventStatus eventStatus;
32+
private RiskLevel riskLevel;
3233
private EventInvestigationStatus eventInvestigationStatus;
3334
private long participantsCount;
3435
private Disease disease;
@@ -62,6 +63,7 @@ public EventExportDto(
6263
String uuid,
6364
String externalId,
6465
EventStatus eventStatus,
66+
RiskLevel riskLevel,
6567
EventInvestigationStatus eventInvestigationStatus,
6668
long participantsCount,
6769
Disease disease,
@@ -97,6 +99,7 @@ public EventExportDto(
9799
this.uuid = uuid;
98100
this.externalId = externalId;
99101
this.eventStatus = eventStatus;
102+
this.riskLevel = riskLevel;
100103
this.eventInvestigationStatus = eventInvestigationStatus;
101104
this.participantsCount = participantsCount;
102105
this.disease = disease;
@@ -151,6 +154,15 @@ public void setEventStatus(EventStatus eventStatus) {
151154
}
152155

153156
@Order(3)
157+
public RiskLevel getRiskLevel() {
158+
return riskLevel;
159+
}
160+
161+
public void setRiskLevel(RiskLevel riskLevel) {
162+
this.riskLevel = riskLevel;
163+
}
164+
165+
@Order(4)
154166
public EventInvestigationStatus getEventInvestigationStatus() {
155167
return eventInvestigationStatus;
156168
}
@@ -159,7 +171,7 @@ public void setEventInvestigationStatus(EventInvestigationStatus eventInvestigat
159171
this.eventInvestigationStatus = eventInvestigationStatus;
160172
}
161173

162-
@Order(4)
174+
@Order(5)
163175
public Disease getDisease() {
164176
return disease;
165177
}
@@ -168,7 +180,7 @@ public void setDisease(Disease disease) {
168180
this.disease = disease;
169181
}
170182

171-
@Order(5)
183+
@Order(6)
172184
public String getDiseaseDetails() {
173185
return diseaseDetails;
174186
}
@@ -177,7 +189,7 @@ public void setDiseaseDetails(String diseaseDetails) {
177189
this.diseaseDetails = diseaseDetails;
178190
}
179191

180-
@Order(6)
192+
@Order(7)
181193
public Date getStartDate() {
182194
return startDate;
183195
}
@@ -186,12 +198,12 @@ public void setStartDate(Date startDate) {
186198
this.startDate = startDate;
187199
}
188200

189-
@Order(7)
201+
@Order(8)
190202
public Date getEndDate() {
191203
return endDate;
192204
}
193205

194-
@Order(8)
206+
@Order(9)
195207
public String getEventTitle() {
196208
return eventTitle;
197209
}
@@ -200,7 +212,7 @@ public void setEventTitle(String eventTitle) {
200212
this.eventTitle = eventTitle;
201213
}
202214

203-
@Order(9)
215+
@Order(10)
204216
public String getEventDesc() {
205217
return eventDesc;
206218
}
@@ -209,12 +221,12 @@ public void setEventDesc(String eventDesc) {
209221
this.eventDesc = eventDesc;
210222
}
211223

212-
@Order(10)
224+
@Order(11)
213225
public YesNoUnknown getNosocomial() {
214226
return nosocomial;
215227
}
216228

217-
@Order(11)
229+
@Order(12)
218230
public String getRegion() {
219231
return region;
220232
}
@@ -223,7 +235,7 @@ public void setRegion(String region) {
223235
this.region = region;
224236
}
225237

226-
@Order(12)
238+
@Order(13)
227239
public String getDistrict() {
228240
return district;
229241
}
@@ -232,7 +244,7 @@ public void setDistrict(String district) {
232244
this.district = district;
233245
}
234246

235-
@Order(13)
247+
@Order(14)
236248
public String getCommunity() {
237249
return community;
238250
}
@@ -241,7 +253,7 @@ public void setCommunity(String community) {
241253
this.community = community;
242254
}
243255

244-
@Order(14)
256+
@Order(15)
245257
public String getCity() {
246258
return city;
247259
}
@@ -250,7 +262,7 @@ public void setCity(String city) {
250262
this.city = city;
251263
}
252264

253-
@Order(15)
265+
@Order(16)
254266
public String getStreet() {
255267
return street;
256268
}
@@ -259,7 +271,7 @@ public void setStreet(String street) {
259271
this.street = street;
260272
}
261273

262-
@Order(16)
274+
@Order(17)
263275
public String getHouseNumber() {
264276
return houseNumber;
265277
}
@@ -268,7 +280,7 @@ public void setHouseNumber(String houseNumber) {
268280
this.houseNumber = houseNumber;
269281
}
270282

271-
@Order(17)
283+
@Order(18)
272284
public String getAdditionalInformation() {
273285
return additionalInformation;
274286
}
@@ -277,17 +289,17 @@ public void setAdditionalInformation(String additionalInformation) {
277289
this.additionalInformation = additionalInformation;
278290
}
279291

280-
@Order(18)
292+
@Order(19)
281293
public EventSourceType getSrcType() {
282294
return srcType;
283295
}
284296

285-
@Order(19)
297+
@Order(20)
286298
public String getSrcInstitutionalPartnerType() {
287299
return srcInstitutionalPartnerType;
288300
}
289301

290-
@Order(20)
302+
@Order(21)
291303
public String getSrcFirstName() {
292304
return srcFirstName;
293305
}
@@ -296,7 +308,7 @@ public void setSrcFirstName(String srcFirstName) {
296308
this.srcFirstName = srcFirstName;
297309
}
298310

299-
@Order(21)
311+
@Order(22)
300312
public String getSrcLastName() {
301313
return srcLastName;
302314
}
@@ -305,7 +317,7 @@ public void setSrcLastName(String srcLastName) {
305317
this.srcLastName = srcLastName;
306318
}
307319

308-
@Order(22)
320+
@Order(23)
309321
public String getSrcTelNo() {
310322
return srcTelNo;
311323
}
@@ -314,27 +326,27 @@ public void setSrcTelNo(String srcTelNo) {
314326
this.srcTelNo = srcTelNo;
315327
}
316328

317-
@Order(23)
329+
@Order(24)
318330
public String getSrcEmail() {
319331
return srcEmail;
320332
}
321333

322-
@Order(24)
334+
@Order(25)
323335
public String getSrcMediaWebsite() {
324336
return srcMediaWebsite;
325337
}
326338

327-
@Order(25)
339+
@Order(26)
328340
public String getSrcMediaName() {
329341
return srcMediaName;
330342
}
331343

332-
@Order(26)
344+
@Order(27)
333345
public String getSrcMediaDetails() {
334346
return srcMediaDetails;
335347
}
336348

337-
@Order(27)
349+
@Order(28)
338350
public Date getReportDateTime() {
339351
return reportDateTime;
340352
}
@@ -343,7 +355,7 @@ public void setReportDateTime(Date reportDateTime) {
343355
this.reportDateTime = reportDateTime;
344356
}
345357

346-
@Order(28)
358+
@Order(29)
347359
public long getParticipantsCount() {
348360
return participantsCount;
349361
}
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
/*******************************************************************************
2+
* SORMAS® - Surveillance Outbreak Response Management & Analysis System
3+
* Copyright © 2016-2018 Helmholtz-Zentrum für Infektionsforschung GmbH (HZI)
4+
*
5+
* This program is free software: you can redistribute it and/or modify
6+
* it under the terms of the GNU General Public License as published by
7+
* the Free Software Foundation, either version 3 of the License, or
8+
* (at your option) any later version.
9+
*
10+
* This program is distributed in the hope that it will be useful,
11+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
12+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13+
* GNU General Public License for more details.
14+
*
15+
* You should have received a copy of the GNU General Public License
16+
* along with this program. If not, see <https://www.gnu.org/licenses/>.
17+
*******************************************************************************/
18+
package de.symeda.sormas.api.event;
19+
20+
import de.symeda.sormas.api.i18n.I18nProperties;
21+
22+
public enum RiskLevel {
23+
24+
LOW,
25+
MODERATE,
26+
HIGH,
27+
UNKNOWN;
28+
29+
public String toString() {
30+
return I18nProperties.getEnumCaption(this);
31+
}
32+
}

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
@@ -782,6 +782,7 @@ public interface Captions {
782782
String Event_participantCount = "Event.participantCount";
783783
String Event_reportDateTime = "Event.reportDateTime";
784784
String Event_reportingUser = "Event.reportingUser";
785+
String Event_riskLevel = "Event.riskLevel";
785786
String Event_srcEmail = "Event.srcEmail";
786787
String Event_srcFirstName = "Event.srcFirstName";
787788
String Event_srcInstitutionalPartnerType = "Event.srcInstitutionalPartnerType";

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -881,6 +881,7 @@ Event.informationSource=Source of information
881881
Event.numberOfPendingTasks=Pending tasks
882882
Event.reportDateTime=Date of report
883883
Event.reportingUser=Reporting user
884+
Event.riskLevel=Risk level
884885
Event.srcType=Source type
885886
Event.srcEmail=Email
886887
Event.srcInstitutionalPartnerType=Source institutional partner

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

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -767,6 +767,12 @@ ReportingType.NOT_DETERMINABLE = Not determinable
767767
ReportingType.FORWARDING = Forwarding
768768
ReportingType.COMMUNITY_FACILITY = Community facility
769769

770+
# RiskLevel
771+
RiskLevel.LOW = Low risk
772+
RiskLevel.MODERATE = Moderate risk
773+
RiskLevel.HIGH = High risk
774+
RiskLevel.UNKNOWN = Unknown
775+
770776
# SampleMaterial
771777
SampleMaterial.BLOOD = Blood
772778
SampleMaterial.CEREBROSPINAL_FLUID = Cerebrospinal fluid

sormas-app/app/src/main/java/de/symeda/sormas/app/backend/common/DatabaseHelper.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ public class DatabaseHelper extends OrmLiteSqliteOpenHelper {
151151
public static final String DATABASE_NAME = "sormas.db";
152152
// any time you make changes to your database objects, you may have to increase the database version
153153

154-
public static final int DATABASE_VERSION = 253;
154+
public static final int DATABASE_VERSION = 254;
155155

156156
private static DatabaseHelper instance = null;
157157

@@ -1807,6 +1807,10 @@ public void onUpgrade(SQLiteDatabase db, ConnectionSource connectionSource, int
18071807
getDao(Event.class).executeRaw("ALTER TABLE events ADD COLUMN srcInstitutionalPartnerType varchar(255)");
18081808
getDao(Event.class).executeRaw("ALTER TABLE events ADD COLUMN srcInstitutionalPartnerTypeDetails varchar(512)");
18091809

1810+
case 253:
1811+
currentVersion = 253;
1812+
getDao(Contact.class).executeRaw("ALTER TABLE events ADD column riskLevel varchar(255);");
1813+
18101814
// ATTENTION: break should only be done after last version
18111815
break;
18121816
default:

sormas-app/app/src/main/java/de/symeda/sormas/app/backend/event/Event.java

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@
3535
import de.symeda.sormas.api.event.EventSourceType;
3636
import de.symeda.sormas.api.event.EventStatus;
3737
import de.symeda.sormas.api.event.InstitutionalPartnerType;
38+
import de.symeda.sormas.api.event.RiskLevel;
3839
import de.symeda.sormas.api.event.TypeOfPlace;
3940
import de.symeda.sormas.api.utils.YesNoUnknown;
4041
import de.symeda.sormas.app.backend.common.PseudonymizableAdo;
@@ -51,6 +52,7 @@ public class Event extends PseudonymizableAdo {
5152
public static final String I18N_PREFIX = "Event";
5253

5354
public static final String EVENT_STATUS = "eventStatus";
55+
public static final String RISK_LEVEL = "riskLevel";
5456
public static final String EVENT_INVESTIGATION_STATUS = "eventInvestigationStatus";
5557
public static final String EVENT_INVESTIGATION_START_DATE = "eventInvestigationStartDate";
5658
public static final String EVENT_INVESTIGATION_END_DATE = "eventInvestigationEndDate";
@@ -80,6 +82,9 @@ public class Event extends PseudonymizableAdo {
8082
@Enumerated(EnumType.STRING)
8183
private EventStatus eventStatus;
8284

85+
@Enumerated(EnumType.STRING)
86+
private RiskLevel riskLevel;
87+
8388
@Enumerated(EnumType.STRING)
8489
private EventInvestigationStatus eventInvestigationStatus;
8590

@@ -176,6 +181,14 @@ public void setEventStatus(EventStatus eventStatus) {
176181
this.eventStatus = eventStatus;
177182
}
178183

184+
public RiskLevel getRiskLevel() {
185+
return riskLevel;
186+
}
187+
188+
public void setRiskLevel(RiskLevel riskLevel) {
189+
this.riskLevel = riskLevel;
190+
}
191+
179192
public EventInvestigationStatus getEventInvestigationStatus() {
180193
return eventInvestigationStatus;
181194
}

0 commit comments

Comments
 (0)