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

Commit e8aa4b8

Browse files
Change event's surveillanceOfficer to responsibleUser and allow more roles to be it SORMAS-Foundation#3751 (SORMAS-Foundation#4062)
* Change event's surveillanceOfficer to responsibleUser and allow more roles to be it SORMAS-Foundation#3751 * Add a responsibleUserRole filter to the event directory SORMAS-Foundation#3751 * Add the reporting user to event/action directory and exports SORMAS-Foundation#3751 * Add the responsible user to event/action directory and exports SORMAS-Foundation#3751 * Rename a forgotten variable from 'surveillanceOfficer' to 'responsibleUser' SORMAS-Foundation#3751 * Use the same logic for event's responsible users in both edit and filter forms SORMAS-Foundation#3751 * Fix an automatic merge error SORMAS-Foundation#3751 * Allow only the district's surveillance officers as responsible user SORMAS-Foundation#3751 * Remove the responsibleUser column rename on the android app SORMAS-Foundation#3751 * Revert "Add a responsibleUserRole filter to the event directory SORMAS-Foundation#3751" This reverts commit 303fc93. * Fix the generateEventHandoutTest due do the surveillanceOfficer renaming SORMAS-Foundation#3751 * Fix the genericTestCasesTxtTest due do the surveillanceOfficer renaming SORMAS-Foundation#3751 * Fix the EventsFilterForm SORMAS-Foundation#3751
1 parent 3d61a80 commit e8aa4b8

File tree

76 files changed

+332
-211
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

76 files changed

+332
-211
lines changed

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

+2-2
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ public DashboardEventDto(
5959
Double locationLat,
6060
Double locationLon,
6161
String reportingUserUuid,
62-
String surveillanceOfficerUuid,
62+
String responsibleUserUuid,
6363
String regionUuid,
6464
String districtName,
6565
String districtUuid,
@@ -77,7 +77,7 @@ public DashboardEventDto(
7777
this.locationLon = locationLon;
7878
this.district = new DistrictReferenceDto(districtUuid, districtName);
7979

80-
this.jurisdiction = new EventJurisdictionDto(reportingUserUuid, surveillanceOfficerUuid, regionUuid, districtUuid, communityUuid);
80+
this.jurisdiction = new EventJurisdictionDto(reportingUserUuid, responsibleUserUuid, regionUuid, districtUuid, communityUuid);
8181
}
8282

8383
public String getUuid() {

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

+26-6
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,8 @@ public class EventActionExportDto implements Serializable {
4141
private EventStatus eventStatus;
4242
private RiskLevel eventRiskLevel;
4343
private EventInvestigationStatus eventInvestigationStatus;
44+
private UserReferenceDto eventReportingUser;
45+
private UserReferenceDto eventResponsibleUser;
4446
private ActionMeasure actionMeasure;
4547
private String actionTitle;
4648
private Date actionCreationDate;
@@ -60,6 +62,12 @@ public EventActionExportDto(
6062
EventStatus eventStatus,
6163
RiskLevel eventRiskLevel,
6264
EventInvestigationStatus eventInvestigationStatus,
65+
String eventReportingUserUuid,
66+
String eventReportingUserFirstName,
67+
String eventReportingUserLastName,
68+
String eventResponsibleUserUuid,
69+
String eventResponsibleUserFirstName,
70+
String eventResponsibleUserLastName,
6371
ActionMeasure actionMeasure,
6472
String actionTitle,
6573
Date actionCreationDate,
@@ -82,6 +90,8 @@ public EventActionExportDto(
8290
this.eventStatus = eventStatus;
8391
this.eventRiskLevel = eventRiskLevel;
8492
this.eventInvestigationStatus = eventInvestigationStatus;
93+
this.eventReportingUser = new UserReferenceDto(eventReportingUserUuid, eventReportingUserFirstName, eventReportingUserLastName, null);
94+
this.eventResponsibleUser = new UserReferenceDto(eventResponsibleUserUuid, eventResponsibleUserFirstName, eventResponsibleUserLastName, null);
8595
this.actionMeasure = actionMeasure;
8696
this.actionTitle = actionTitle;
8797
this.actionCreationDate = actionCreationDate;
@@ -139,36 +149,46 @@ public EventInvestigationStatus getEventInvestigationStatus() {
139149
}
140150

141151
@Order(9)
152+
public UserReferenceDto getEventReportingUser() {
153+
return eventReportingUser;
154+
}
155+
156+
@Order(10)
157+
public UserReferenceDto getEventResponsibleUser() {
158+
return eventResponsibleUser;
159+
}
160+
161+
@Order(11)
142162
public ActionMeasure getActionMeasure() {
143163
return actionMeasure;
144164
}
145165

146-
@Order(10)
166+
@Order(12)
147167
public String getActionTitle() {
148168
return actionTitle;
149169
}
150170

151-
@Order(11)
171+
@Order(13)
152172
public Date getActionCreationDate() {
153173
return actionCreationDate;
154174
}
155175

156-
@Order(12)
176+
@Order(14)
157177
public Date getActionChangeDate() {
158178
return actionChangeDate;
159179
}
160180

161-
@Order(13)
181+
@Order(15)
162182
public ActionStatus getActionStatus() {
163183
return actionStatus;
164184
}
165185

166-
@Order(14)
186+
@Order(16)
167187
public ActionPriority getActionPriority() {
168188
return actionPriority;
169189
}
170190

171-
@Order(15)
191+
@Order(17)
172192
public UserReferenceDto getActionLastModifiedBy() {
173193
return actionLastModifiedBy;
174194
}

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

+28
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,8 @@ public class EventActionIndexDto implements Serializable {
3838
public static final String EVENT_STATUS = "eventStatus";
3939
public static final String EVENT_RISK_LEVEL = "eventRiskLevel";
4040
public static final String EVENT_INVESTIGATION_STATUS = "eventInvestigationStatus";
41+
public static final String EVENT_REPORTING_USER = "eventReportingUser";
42+
public static final String EVENT_RESPONSIBLE_USER = "eventResponsibleUser";
4143
public static final String EVENT_EVOLUTION_DATE = "eventEvolutionDate";
4244
public static final String ACTION_TITLE = "actionTitle";
4345
public static final String ACTION_CREATION_DATE = "actionCreationDate";
@@ -54,6 +56,8 @@ public class EventActionIndexDto implements Serializable {
5456
private EventStatus eventStatus;
5557
private RiskLevel eventRiskLevel;
5658
private EventInvestigationStatus eventInvestigationStatus;
59+
private UserReferenceDto eventReportingUser;
60+
private UserReferenceDto eventResponsibleUser;
5761
private Date eventEvolutionDate;
5862
private String actionTitle;
5963
private Date actionCreationDate;
@@ -71,6 +75,12 @@ public EventActionIndexDto(
7175
EventStatus eventStatus,
7276
RiskLevel eventRiskLevel,
7377
EventInvestigationStatus eventInvestigationStatus,
78+
String eventReportingUserUuid,
79+
String eventReportingUserFirstName,
80+
String eventReportingUserLastName,
81+
String eventResponsibleUserUuid,
82+
String eventResponsibleUserFirstName,
83+
String eventResponsibleUserLastName,
7484
ActionMeasure actionMeasure,
7585
Date eventEvolutionDate,
7686
String actionTitle,
@@ -92,6 +102,8 @@ public EventActionIndexDto(
92102
this.eventStatus = eventStatus;
93103
this.eventRiskLevel = eventRiskLevel;
94104
this.eventInvestigationStatus = eventInvestigationStatus;
105+
this.eventReportingUser = new UserReferenceDto(eventReportingUserUuid, eventReportingUserFirstName, eventReportingUserLastName, null);
106+
this.eventResponsibleUser = new UserReferenceDto(eventResponsibleUserUuid, eventResponsibleUserFirstName, eventResponsibleUserLastName, null);
95107
this.actionTitle = EventHelper.buildEventActionTitleString(actionMeasure, actionTitle);
96108
this.eventEvolutionDate = eventEvolutionDate;
97109
this.actionTitle = actionTitle;
@@ -159,6 +171,22 @@ public void setEventInvestigationStatus(EventInvestigationStatus eventInvestigat
159171
this.eventInvestigationStatus = eventInvestigationStatus;
160172
}
161173

174+
public UserReferenceDto getEventReportingUser() {
175+
return eventReportingUser;
176+
}
177+
178+
public void setEventReportingUser(UserReferenceDto eventReportingUser) {
179+
this.eventReportingUser = eventReportingUser;
180+
}
181+
182+
public UserReferenceDto getEventResponsibleUser() {
183+
return eventResponsibleUser;
184+
}
185+
186+
public void setEventResponsibleUser(UserReferenceDto eventResponsibleUser) {
187+
this.eventResponsibleUser = eventResponsibleUser;
188+
}
189+
162190
public Date getEventEvolutionDate() {
163191
return eventEvolutionDate;
164192
}

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

+8-8
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ public class EventCriteria extends BaseCriteria implements Serializable {
4242
private static final long serialVersionUID = 2194071020732246594L;
4343

4444
public static final String REPORTING_USER_ROLE = "reportingUserRole";
45-
public static final String SURVEILLANCE_OFFICER = "surveillanceOfficer";
45+
public static final String RESPONSIBLE_USER = "responsibleUser";
4646
public static final String FREE_TEXT = "freeText";
4747
public static final String EVENT_STATUS = "eventStatus";
4848
public static final String RISK_LEVEL = "riskLevel";
@@ -68,7 +68,7 @@ public class EventCriteria extends BaseCriteria implements Serializable {
6868
private Date eventEvolutionDateFrom;
6969
private Date eventEvolutionDateTo;
7070
private DateFilterOption evolutionDateFilterOption = DateFilterOption.DATE;
71-
private UserReferenceDto surveillanceOfficer;
71+
private UserReferenceDto responsibleUser;
7272
private String freeText;
7373
private EventSourceType srcType;
7474
private CaseReferenceDto caze;
@@ -320,17 +320,17 @@ public DateFilterOption getEvolutionDateFilterOption() {
320320
return evolutionDateFilterOption;
321321
}
322322

323-
public EventCriteria surveillanceOfficer(UserReferenceDto surveillanceOfficer) {
324-
this.surveillanceOfficer = surveillanceOfficer;
323+
public EventCriteria responsibleUser(UserReferenceDto responsibleUser) {
324+
this.responsibleUser = responsibleUser;
325325
return this;
326326
}
327327

328-
public void setSurveillanceOfficer(UserReferenceDto surveillanceOfficer) {
329-
this.surveillanceOfficer = surveillanceOfficer;
328+
public void setResponsibleUser(UserReferenceDto responsibleUser) {
329+
this.responsibleUser = responsibleUser;
330330
}
331331

332-
public UserReferenceDto getSurveillanceOfficer() {
333-
return surveillanceOfficer;
332+
public UserReferenceDto getResponsibleUser() {
333+
return responsibleUser;
334334
}
335335

336336
public EventCriteria freeText(String freeText) {

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

+6-6
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ public class EventDto extends PseudonymizableDto {
7272
public static final String SRC_MEDIA_DETAILS = "srcMediaDetails";
7373
public static final String DISEASE = "disease";
7474
public static final String DISEASE_DETAILS = "diseaseDetails";
75-
public static final String SURVEILLANCE_OFFICER = "surveillanceOfficer";
75+
public static final String RESPONSIBLE_USER = "responsibleUser";
7676
public static final String TYPE_OF_PLACE_TEXT = "typeOfPlaceText";
7777
public static final String REPORT_LAT = "reportLat";
7878
public static final String REPORT_LON = "reportLon";
@@ -123,7 +123,7 @@ public class EventDto extends PseudonymizableDto {
123123
private Disease disease;
124124
private String diseaseDetails;
125125
@SensitiveData
126-
private UserReferenceDto surveillanceOfficer;
126+
private UserReferenceDto responsibleUser;
127127
private String typeOfPlaceText;
128128
private Double reportLat;
129129
private Double reportLon;
@@ -423,12 +423,12 @@ public void setDiseaseDetails(String diseaseDetails) {
423423
this.diseaseDetails = diseaseDetails;
424424
}
425425

426-
public UserReferenceDto getSurveillanceOfficer() {
427-
return surveillanceOfficer;
426+
public UserReferenceDto getResponsibleUser() {
427+
return responsibleUser;
428428
}
429429

430-
public void setSurveillanceOfficer(UserReferenceDto surveillanceOfficer) {
431-
this.surveillanceOfficer = surveillanceOfficer;
430+
public void setResponsibleUser(UserReferenceDto responsibleUser) {
431+
this.responsibleUser = responsibleUser;
432432
}
433433

434434
public String getTypeOfPlaceText() {

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

+36-8
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
import java.util.Date;
2020

2121
import de.symeda.sormas.api.Disease;
22+
import de.symeda.sormas.api.user.UserReferenceDto;
2223
import de.symeda.sormas.api.utils.Order;
2324
import de.symeda.sormas.api.utils.YesNoUnknown;
2425

@@ -66,6 +67,9 @@ public class EventExportDto implements Serializable {
6667
private String srcMediaName;
6768
private String srcMediaDetails;
6869
private Date reportDateTime;
70+
private UserReferenceDto reportingUser;
71+
private UserReferenceDto responsibleUser;
72+
6973
private EventJurisdictionDto jurisdiction;
7074

7175
public EventExportDto(
@@ -109,8 +113,12 @@ public EventExportDto(
109113
String srcMediaName,
110114
String srcMediaDetails,
111115
Date reportDateTime,
112-
String reportingUserUid,
113-
String surveillanceOfficerUuid) {
116+
String reportingUserUuid,
117+
String reportingUserFirstName,
118+
String reportingUserLastName,
119+
String responsibleUserUuid,
120+
String responsibleUserFirstName,
121+
String responsibleUserLastName) {
114122
this.uuid = uuid;
115123
this.externalId = externalId;
116124
this.externalToken = externalToken;
@@ -146,8 +154,10 @@ public EventExportDto(
146154
this.srcMediaName = srcMediaName;
147155
this.srcMediaDetails = srcMediaDetails;
148156
this.reportDateTime = reportDateTime;
157+
this.reportingUser = new UserReferenceDto(reportingUserUuid, reportingUserFirstName, reportingUserLastName, null);
158+
this.responsibleUser = new UserReferenceDto(responsibleUserUuid, responsibleUserFirstName, responsibleUserLastName, null);
149159

150-
this.jurisdiction = new EventJurisdictionDto(reportingUserUid, surveillanceOfficerUuid, regionUuid, districtUuid, communityUuid);
160+
this.jurisdiction = new EventJurisdictionDto(reportingUserUuid, responsibleUserUuid, regionUuid, districtUuid, communityUuid);
151161
}
152162

153163
@Order(0)
@@ -409,6 +419,24 @@ public void setReportDateTime(Date reportDateTime) {
409419
}
410420

411421
@Order(34)
422+
public UserReferenceDto getReportingUser() {
423+
return reportingUser;
424+
}
425+
426+
public void setReportingUser(UserReferenceDto reportingUser) {
427+
this.reportingUser = reportingUser;
428+
}
429+
430+
@Order(35)
431+
public UserReferenceDto getResponsibleUser() {
432+
return responsibleUser;
433+
}
434+
435+
public void setResponsibleUser(UserReferenceDto responsibleUser) {
436+
this.responsibleUser = responsibleUser;
437+
}
438+
439+
@Order(36)
412440
public long getParticipantCount() {
413441
return participantCount;
414442
}
@@ -417,7 +445,7 @@ public void setParticipantCount(long participantCount) {
417445
this.participantCount = participantCount;
418446
}
419447

420-
@Order(35)
448+
@Order(37)
421449
public long getCaseCount() {
422450
return caseCount;
423451
}
@@ -426,7 +454,7 @@ public void setCaseCount(long caseCount) {
426454
this.caseCount = caseCount;
427455
}
428456

429-
@Order(36)
457+
@Order(38)
430458
public long getDeathCount() {
431459
return deathCount;
432460
}
@@ -435,7 +463,7 @@ public void setDeathCount(long deathCount) {
435463
this.deathCount = deathCount;
436464
}
437465

438-
@Order(37)
466+
@Order(39)
439467
public long getContactCount() {
440468
return contactCount;
441469
}
@@ -444,12 +472,12 @@ public void setContactCount(long contactCount) {
444472
this.contactCount = contactCount;
445473
}
446474

447-
@Order(38)
475+
@Order(40)
448476
public long getContactCountSourceInEvent() {
449477
return contactCountSourceInEvent;
450478
}
451479

452-
@Order(39)
480+
@Order(41)
453481
public String getExternalToken() {
454482
return externalToken;
455483
}

0 commit comments

Comments
 (0)