Skip to content

Commit

Permalink
#12605 - replace Persons involved with Event Participants (#12657)
Browse files Browse the repository at this point in the history
* #12605 - replace Persons involved with Event Participants

* #12605 - rename parameters with EventPerson to EventParticipant

* #12605 - rollback the changes from string values ( besides the default strings.xml)

* #12605 - rollback the action_open_event_participant_case changes from string.xml files ( besides the default strings.xml)
  • Loading branch information
carina29 authored Oct 24, 2023
1 parent e8706e4 commit 7a84a75
Show file tree
Hide file tree
Showing 19 changed files with 49 additions and 53 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ public class EventDto extends SormasToSormasShareableDto {
public static final String SPECIFIC_RISK = "specificRisk";
public static final String EVENT_INVESTIGATION_START_DATE = "eventInvestigationStartDate";
public static final String EVENT_INVESTIGATION_END_DATE = "eventInvestigationEndDate";
public static final String EVENT_PERSONS = "eventPersons";
public static final String EVENT_PARTICIPANTS = "eventParticipants";
public static final String PARTICIPANTS_COUNT = "participantCount";
public static final String EVENT_ACTIONS = "eventActions";
public static final String EVENT_MANAGEMENT_STATUS = "eventManagementStatus";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1146,7 +1146,6 @@ public interface Captions {
String Event_eventLocation = "Event.eventLocation";
String Event_eventManagementStatus = "Event.eventManagementStatus";
String Event_eventParticipants = "Event.eventParticipants";
String Event_eventPersons = "Event.eventPersons";
String Event_eventStatus = "Event.eventStatus";
String Event_eventTitle = "Event.eventTitle";
String Event_eventType = "Event.eventType";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ public enum DatabaseTable {
EVENTS(DatabaseTableType.SORMAS, "events", dependingOnFeature(FeatureType.EVENT_SURVEILLANCE)),
EVENTS_EVENTGROUPS(DatabaseTableType.SORMAS, EVENTS, "events_eventgroups"),
EVENTGROUPS(DatabaseTableType.SORMAS, EVENTS, "eventgroups", dependingOnFeature(FeatureType.EVENT_GROUPS)),
EVENTPARTICIPANTS(DatabaseTableType.SORMAS, EVENTS, "event_persons_involved"),
EVENTPARTICIPANTS(DatabaseTableType.SORMAS, EVENTS, "event_participants"),
ACTIONS(DatabaseTableType.SORMAS, EVENTS, "actions"),

TRAVEL_ENTRIES(DatabaseTableType.SORMAS, "travel_entries", dependingOnFeature(FeatureType.TRAVEL_ENTRIES)),
Expand Down
5 changes: 2 additions & 3 deletions sormas-api/src/main/resources/captions.properties
Original file line number Diff line number Diff line change
Expand Up @@ -1236,8 +1236,7 @@ Event.eventInvestigationEndDate=Investigation end date
Event.eventInvestigationStartDate=Investigation start date
Event.eventInvestigationStatus=Investigation status
Event.eventLocation=Event location
Event.eventParticipants=Persons involved
Event.eventPersons=Persons involved
Event.eventParticipants=Event participants
Event.eventStatus=Event status
Event.eventManagementStatus=Event management status
Event.eventIdentificationSource=Event identification source
Expand Down Expand Up @@ -2877,4 +2876,4 @@ environmentSampleAllActiveAndArchivedSamples=All active and archived environment
environmentSampleDeletedSamples=Deleted environment samples
humanSampleViewType=Human
environmentSampleViewType=Environment
environmentSampleNewSample=New sample
environmentSampleNewSample=New sample
4 changes: 2 additions & 2 deletions sormas-api/src/main/resources/enum.properties
Original file line number Diff line number Diff line change
Expand Up @@ -306,7 +306,7 @@ DatabaseTable.EPIDATA = Epidemiological data
DatabaseTable.EVENTS = Events
DatabaseTable.EVENTS_EVENTGROUPS = Events → Event groups
DatabaseTable.EVENTGROUPS = Event groups
DatabaseTable.EVENTPARTICIPANTS = Persons involved
DatabaseTable.EVENTPARTICIPANTS = Event participants
DatabaseTable.EXPOSURES = Exposures
DatabaseTable.ACTIVITIES_AS_CASE = Activities as case
DatabaseTable.FACILITIES = Facilities
Expand Down Expand Up @@ -2260,4 +2260,4 @@ Pathogen.POLIO_VIRUS = Polio virus 2
Pathogen.REOVIRUS = Reovirus
Pathogen.ROTAVIRUS = Rotavirus
Pathogen.TT_HEPATITIS = TT hepatitis
Pathogen.OTHER = Other
Pathogen.OTHER = Other
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ public class Event extends PseudonymizableAdo {
public static final String EVENT_INVESTIGATION_STATUS = "eventInvestigationStatus";
public static final String EVENT_INVESTIGATION_START_DATE = "eventInvestigationStartDate";
public static final String EVENT_INVESTIGATION_END_DATE = "eventInvestigationEndDate";
public static final String EVENT_PERSONS = "eventPersons";
public static final String EVENT_PARTICIPANTS = "eventParticipants";
public static final String EVENT_TITLE = "eventTitle";
public static final String EVENT_DESC = "eventDesc";
public static final String START_DATE = "startDate";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ public enum EventParticipantSection
implements
StatusElaborator {

EVENT_PARTICIPANT_INFO(R.string.heading_person_involved, R.drawable.ic_alert_24dp),
EVENT_PARTICIPANT_INFO(R.string.heading_event_participant, R.drawable.ic_alert_24dp),
PERSON_INFO(R.string.caption_person_information, R.drawable.ic_person_black_24dp),
IMMUNIZATIONS(R.string.caption_event_participant_immunizations, R.drawable.ic_drawer_immunization_24dp),
VACCINATIONS(R.string.caption_event_participant_vaccinations, R.drawable.ic_drawer_vaccines_24);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
import java.util.List;

import android.view.View;

import de.symeda.sormas.api.caze.VaccinationStatus;
import de.symeda.sormas.api.event.EventDto;
import de.symeda.sormas.api.utils.fieldaccess.UiFieldAccessCheckers;
Expand Down Expand Up @@ -60,25 +59,25 @@ private void setUpFieldVisibilities(FragmentEventParticipantEditLayoutBinding co
setFieldVisibilitiesAndAccesses(EventDto.class, contentBinding.mainContent);

if (record.getResultingCaseUuid() != null) {
contentBinding.createCaseFromEventPerson.setVisibility(GONE);
contentBinding.createCaseFromEventParticipant.setVisibility(GONE);
if (DatabaseHelper.getCaseDao().queryUuidBasic(record.getResultingCaseUuid()) == null) {
contentBinding.eventParticipantButtonsPanel.setVisibility(GONE);
}
} else {
contentBinding.openEventPersonCase.setVisibility(GONE);
contentBinding.openEventParticipantCase.setVisibility(GONE);
}
}

private void setUpControlListeners(FragmentEventParticipantEditLayoutBinding contentBinding) {
contentBinding.openEventPersonCase.setOnClickListener(new View.OnClickListener() {
contentBinding.openEventParticipantCase.setOnClickListener(new View.OnClickListener() {

@Override
public void onClick(View v) {
CaseReadActivity.startActivity(getActivity(), record.getResultingCaseUuid(), true);
}
});

contentBinding.createCaseFromEventPerson.setOnClickListener(new View.OnClickListener() {
contentBinding.createCaseFromEventParticipant.setOnClickListener(new View.OnClickListener() {

@Override
public void onClick(View v) {
Expand All @@ -91,7 +90,7 @@ public void onClick(View v) {

@Override
protected String getSubHeadingTitle() {
return getResources().getString(R.string.caption_person_involved);
return getResources().getString(R.string.caption_event_participant);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@

package de.symeda.sormas.app.event.eventparticipant.edit;

import static de.symeda.sormas.app.core.notification.NotificationType.ERROR;
import static de.symeda.sormas.app.core.notification.NotificationType.WARNING;

import android.content.Context;
import android.os.AsyncTask;
import android.os.Bundle;
Expand All @@ -41,9 +44,6 @@
import de.symeda.sormas.app.util.Bundler;
import de.symeda.sormas.app.util.Consumer;

import static de.symeda.sormas.app.core.notification.NotificationType.ERROR;
import static de.symeda.sormas.app.core.notification.NotificationType.WARNING;

public class EventParticipantNewActivity extends BaseEditActivity<EventParticipant> {

public static final String TAG = EventParticipantNewActivity.class.getSimpleName();
Expand Down Expand Up @@ -103,7 +103,7 @@ protected BaseEditFragment buildEditFragment(PageMenuItem menuItem, EventPartici

@Override
protected int getActivityTitle() {
return R.string.heading_person_involved_new;
return R.string.heading_event_participant_new;
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,14 @@

package de.symeda.sormas.app.event.eventparticipant.read;

import java.util.List;

import android.content.Context;
import android.os.Bundle;
import android.view.MenuItem;

import androidx.annotation.NonNull;

import java.util.List;

import de.symeda.sormas.api.event.EventParticipantReferenceDto;
import de.symeda.sormas.api.feature.FeatureType;
import de.symeda.sormas.api.feature.FeatureTypeProperty;
Expand Down Expand Up @@ -126,7 +126,7 @@ public Enum getPageStatus() {

@Override
protected int getActivityTitle() {
return R.string.heading_person_involved;
return R.string.heading_event_participant;
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@

import android.os.Bundle;
import android.view.View;

import de.symeda.sormas.api.event.EventDto;
import de.symeda.sormas.api.utils.fieldaccess.UiFieldAccessCheckers;
import de.symeda.sormas.api.utils.fieldvisibility.FieldVisibilityCheckers;
Expand Down Expand Up @@ -56,7 +55,7 @@ private void setUpFieldVisibilities(FragmentEventParticipantReadLayoutBinding co
}

private void setUpControlListeners(FragmentEventParticipantReadLayoutBinding contentBinding) {
contentBinding.openEventPersonCase.setOnClickListener(new View.OnClickListener() {
contentBinding.openEventParticipantCase.setOnClickListener(new View.OnClickListener() {

@Override
public void onClick(View v) {
Expand Down Expand Up @@ -86,7 +85,7 @@ public void onAfterLayoutBinding(FragmentEventParticipantReadLayoutBinding conte

@Override
protected String getSubHeadingTitle() {
return getResources().getString(R.string.caption_person_involved);
return getResources().getString(R.string.caption_event_participant);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -116,21 +116,21 @@
app:userViewRight="@{UserRight.CASE_VIEW}">

<de.symeda.sormas.app.component.controls.ControlButton
android:id="@+id/create_case_from_event_person"
android:id="@+id/create_case_from_event_participant"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentStart="true"
app:buttonType="@{ControlButtonType.LINE_PRIMARY}"
app:iconStart="@drawable/ic_create_case_black_24dp"
app:rounded="true"
android:text="@string/action_create_case_from_event_person"
android:text="@string/action_create_case_from_event_participant"
app:userViewRight="@{UserRight.CASE_CREATE}" />

<de.symeda.sormas.app.component.controls.ControlButton
android:id="@+id/open_event_person_case"
android:id="@+id/open_event_participant_case"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/action_open_event_person_case"
android:text="@string/action_open_event_participant_case"
app:buttonType="@{ControlButtonType.LINE_PRIMARY}"
app:rounded="true"
app:iconStart="@drawable/ic_open_case_black_24dp" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,10 +104,10 @@
app:userViewRight="@{UserRight.CASE_VIEW}">

<de.symeda.sormas.app.component.controls.ControlButton
android:id="@+id/open_event_person_case"
android:id="@+id/open_event_participant_case"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/action_open_event_person_case"
android:text="@string/action_open_event_participant_case"
app:buttonType="@{ControlButtonType.LINE_PRIMARY}"
app:rounded="true"
app:iconStart="@drawable/ic_open_case_black_24dp" />
Expand Down
18 changes: 9 additions & 9 deletions sormas-app/app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
<string name="action_confirm">Confirm</string>
<string name="action_create">Create</string>
<string name="action_create_case_from_contact">Create a case for this contact person</string>
<string name="action_create_case_from_event_person">Create a case for this event person</string>
<string name="action_create_case_from_event_participant">Create a case for this event participant</string>
<string name="action_create_treatment">Create treatment</string>
<string name="action_edit_data">Edit data</string>
<string name="action_delete">Delete</string>
Expand Down Expand Up @@ -84,7 +84,7 @@
<string name="action_new_task">New Task</string>
<string name="action_not_executable">Not Executable</string>
<string name="action_ok">OK</string>
<string name="action_open_event_person_case">Open Case of Event Person</string>
<string name="action_open_event_participant_case">Open Case of Event Participant</string>
<string name="action_open_prescription">Open Prescription</string>
<string name="action_open_resulting_case">Open Resulting Case</string>
<string name="action_open_source_case">Open Source Case</string>
Expand Down Expand Up @@ -179,12 +179,13 @@
<string name="caption_environment_tasks">Environment Tasks</string>
<string name="caption_environment_sample_information">Environment Sample Information</string>
<string name="caption_event_description">Description</string>
<string name="caption_event_location">Location</string>
<string name="caption_event_period">Date of event</string>
<string name="caption_event_information">Event Information</string>
<string name="caption_event_participants">Persons Involved</string>
<string name="caption_event_location">Location</string>
<string name="caption_event_participant">Event Participant</string>
<string name="caption_event_participant_immunizations">Event participant Immunizations</string>
<string name="caption_event_participant_vaccinations">Event participant Vaccinations</string>
<string name="caption_event_participants">Event Participants</string>
<string name="caption_event_period">Date of event</string>
<string name="caption_event_tasks">Event Tasks</string>
<string name="caption_executed_by">Executed by</string>
<string name="caption_facility_or_home">Place of stay</string>
Expand All @@ -203,7 +204,7 @@
<string name="caption_negative">Negative</string>
<string name="caption_new_case">New Case</string>
<string name="caption_new_contact">New Contact</string>
<string name="caption_new_event_participant">New Person Involved</string>
<string name="caption_new_event_participant">New Event Participant</string>
<string name="caption_new_sample">New Sample</string>
<string name="caption_new_pathogen_test">New Pathogen Test</string>
<string name="caption_new_task">New Task</string>
Expand All @@ -216,7 +217,6 @@
<string name="caption_period_end">Period End</string>
<string name="caption_period_start">Period Start</string>
<string name="caption_person_information">Person Information</string>
<string name="caption_person_involved">Person Involved</string>
<string name="caption_positive">Positive</string>
<string name="caption_possible_events">Possible Events</string>
<string name="caption_prescribed_by">Prescribed by</string>
Expand Down Expand Up @@ -359,6 +359,8 @@
<string name="heading_error_notification_dialog">Oops, something went wrong.</string>
<string name="heading_event_edit">Edit Event</string>
<string name="heading_event_new">New Event</string>
<string name="heading_event_participant">Event Participant</string>
<string name="heading_event_participant_new">New Event Participant</string>
<string name="heading_event_read">Read Event</string>
<string name="heading_event_summary">Event Summary</string>
<string name="heading_events_list">Event Listing</string>
Expand All @@ -381,8 +383,6 @@
<string name="heading_most_recent_test">Most Recent Pathogen Test</string>
<string name="heading_new_sormas_version">New SORMAS version</string>
<string name="heading_outbreak_response">Outbreak Response</string>
<string name="heading_person_involved">Person Involved</string>
<string name="heading_person_involved_new">New Person Involved</string>
<string name="heading_person_contact_detail">Person contact details</string>
<string name="heading_pick_or_create_person">Pick or Create Person</string>
<string name="heading_pick_or_create_case">Pick or Create a Case</string>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ public class Event extends CoreAdo implements SormasToSormasShareable, HasExtern
public static final String EVENT_INVESTIGATION_START_DATE = "eventInvestigationStartDate";
public static final String EVENT_INVESTIGATION_END_DATE = "eventInvestigationEndDate";
public static final String EVENT_MANAGEMENT_STATUS = "eventManagementStatus";
public static final String EVENT_PERSONS = "eventPersons";
public static final String EVENT_PARTICIPANTS = "eventParticipants";
public static final String EVENT_TITLE = "eventTitle";
public static final String EVENT_DESC = "eventDesc";
public static final String NOSOCOMIAL = "nosocomial";
Expand Down Expand Up @@ -155,7 +155,7 @@ public class Event extends CoreAdo implements SormasToSormasShareable, HasExtern
private EventInvestigationStatus eventInvestigationStatus;
private Date eventInvestigationStartDate;
private Date eventInvestigationEndDate;
private List<EventParticipant> eventPersons;
private List<EventParticipant> eventParticipants;
private String externalId;
private String externalToken;
private String eventTitle;
Expand Down Expand Up @@ -276,12 +276,12 @@ public void setEventInvestigationEndDate(Date eventInvestigationEndDate) {
}

@OneToMany(cascade = {}, mappedBy = EventParticipant.EVENT)
public List<EventParticipant> getEventPersons() {
return eventPersons;
public List<EventParticipant> getEventParticipants() {
return eventParticipants;
}

public void setEventPersons(List<EventParticipant> eventPersons) {
this.eventPersons = eventPersons;
public void setEventParticipants(List<EventParticipant> eventParticipants) {
this.eventParticipants = eventParticipants;
}

@Column(length = CHARACTER_LIMIT_DEFAULT)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ public Predicate createUserFilter(

public Predicate createCaseAndEventParticipantFilter(CriteriaBuilder cb, CriteriaQuery cq, From<?, Event> eventPath) {

Join<Event, EventParticipant> eventParticipantJoin = eventPath.join(Event.EVENT_PERSONS, JoinType.LEFT);
Join<Event, EventParticipant> eventParticipantJoin = eventPath.join(Event.EVENT_PARTICIPANTS, JoinType.LEFT);
Join<EventParticipant, Case> caseJoin = eventParticipantJoin.join(EventParticipant.RESULTING_CASE, JoinType.LEFT);

Subquery<Long> caseSubquery = cq.subquery(Long.class);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ public Join<Location, Facility> getFacility() {
public From<?, EventParticipant> getEventParticipants() {

if (eventParticipants == null) {
setEventParticipants(getRoot().join(Event.EVENT_PERSONS, JoinType.LEFT));
setEventParticipants(getRoot().join(Event.EVENT_PARTICIPANTS, JoinType.LEFT));
}
return eventParticipants;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -351,7 +351,7 @@ public List<EventParticipantSelectionDto> getEventParticipantsWithSameEvent(Stri
CriteriaBuilder cb = em.getCriteriaBuilder();
CriteriaQuery<EventParticipantSelectionDto> cq = cb.createQuery(EventParticipantSelectionDto.class);
Root<Event> eventRoot = cq.from(Event.class);
Join<Event, EventParticipant> eventParticipantJoin = eventRoot.join(Event.EVENT_PERSONS, JoinType.INNER);
Join<Event, EventParticipant> eventParticipantJoin = eventRoot.join(Event.EVENT_PARTICIPANTS, JoinType.INNER);
Join<EventParticipant, Person> personJoin = eventParticipantJoin.join(EventParticipant.PERSON, JoinType.INNER);
Join<EventParticipant, Case> caseJoin = eventParticipantJoin.join(EventParticipant.RESULTING_CASE, JoinType.LEFT);
Join<EventParticipant, District> districtJoin = eventParticipantJoin.join(EventParticipant.DISTRICT, JoinType.LEFT);
Expand Down Expand Up @@ -404,7 +404,7 @@ private Predicate isPersonParticipantInEvent(

final Subquery<Long> personSubquery = cq.subquery(Long.class);
final Root<Event> eventRoot = personSubquery.from(Event.class);
Join<Event, EventParticipant> eventParticipantJoin = eventRoot.join(Event.EVENT_PERSONS, JoinType.INNER);
Join<Event, EventParticipant> eventParticipantJoin = eventRoot.join(Event.EVENT_PARTICIPANTS, JoinType.INNER);
Join<EventParticipant, Person> personJoin = eventParticipantJoin.join(EventParticipant.PERSON, JoinType.INNER);

personSubquery.select(eventRoot.get(Event.UUID));
Expand Down
Loading

0 comments on commit 7a84a75

Please sign in to comment.