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

Commit ee8c2d3

Browse files
Add a contact component in the event participant data view SORMAS-Foundation#3035 (SORMAS-Foundation#3344)
* Add a contact count column to the event participant list SORMAS-Foundation#3035 * Add contact list and creation in the event participant data view SORMAS-Foundation#3035 * Modify contactList's method contactOnlyWithSourceCaseInEvent SORMAS-Foundation#3035 * Use setEnabled with variable-length argument lists instead of multiple single argument ones SORMAS-Foundation#3035 * Rename contactCountOnlyWithSourceCaseInEvent into onlyCountContactsWithSourceCaseInEvent SORMAS-Foundation#3035 * Add the contact count column to the event participant list export SORMAS-Foundation#3035 * Move event participant's contact count to a dedicated query to avoid issues with Criteria joins SORMAS-Foundation#3035 * Rename ContactCriteria's onlyContactsWithSourceCaseInEvent to onlyContactsWithSourceCaseInGivenEvent SORMAS-Foundation#3035 * Rename contactOnlyWithSourceCaseInEvent into contactOnlyWithSourceCaseInGivenEvent SORMAS-Foundation#3035 * Fix contactList reload when there's no event SORMAS-Foundation#3035 * Fix eventService's method getEventReferenceByEventParticipant SORMAS-Foundation#3035 * Fix ContactList reload method SORMAS-Foundation#3035
1 parent a8139f9 commit ee8c2d3

23 files changed

Lines changed: 675 additions & 34 deletions

sormas-api/src/main/java/de/symeda/sormas/api/contact/ContactCriteria.java

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@
2525
import de.symeda.sormas.api.EntityRelevanceStatus;
2626
import de.symeda.sormas.api.caze.CaseClassification;
2727
import de.symeda.sormas.api.caze.CaseReferenceDto;
28+
import de.symeda.sormas.api.event.EventParticipantReferenceDto;
29+
import de.symeda.sormas.api.event.EventReferenceDto;
2830
import de.symeda.sormas.api.person.PersonReferenceDto;
2931
import de.symeda.sormas.api.person.SymptomJournalStatus;
3032
import de.symeda.sormas.api.region.CommunityReferenceDto;
@@ -112,6 +114,8 @@ public class ContactCriteria extends BaseCriteria implements Serializable {
112114
private String eventUuid;
113115
private Boolean includeContactsFromOtherJurisdictions = Boolean.FALSE;
114116
private Boolean onlyContactsSharingEventWithSourceCase;
117+
private EventParticipantReferenceDto eventParticipant;
118+
private EventReferenceDto onlyContactsWithSourceCaseInGivenEvent;
115119

116120
public UserRole getReportingUserRole() {
117121
return reportingUserRole;
@@ -531,4 +535,32 @@ public Boolean getIncludeContactsFromOtherJurisdictions() {
531535
public void setIncludeContactsFromOtherJurisdictions(Boolean includeContactsFromOtherJurisdictions) {
532536
this.includeContactsFromOtherJurisdictions = includeContactsFromOtherJurisdictions;
533537
}
538+
539+
public void setEventParticipant(EventParticipantReferenceDto eventParticipant) {
540+
this.eventParticipant = eventParticipant;
541+
}
542+
543+
@IgnoreForUrl
544+
public EventParticipantReferenceDto getEventParticipant() {
545+
return eventParticipant;
546+
}
547+
548+
public ContactCriteria eventParticipant(EventParticipantReferenceDto eventParticipant) {
549+
this.eventParticipant = eventParticipant;
550+
return this;
551+
}
552+
553+
public void setOnlyContactsWithSourceCaseInGivenEvent(EventReferenceDto onlyContactsWithSourceCaseInGivenEvent) {
554+
this.onlyContactsWithSourceCaseInGivenEvent = onlyContactsWithSourceCaseInGivenEvent;
555+
}
556+
557+
@IgnoreForUrl
558+
public EventReferenceDto getOnlyContactsWithSourceCaseInGivenEvent() {
559+
return onlyContactsWithSourceCaseInGivenEvent;
560+
}
561+
562+
public ContactCriteria onlyContactsWithSourceCaseInGivenEvent(EventReferenceDto onlyContactsWithSourceCaseInGivenEvent) {
563+
this.onlyContactsWithSourceCaseInGivenEvent = onlyContactsWithSourceCaseInGivenEvent;
564+
return this;
565+
}
534566
}

sormas-api/src/main/java/de/symeda/sormas/api/contact/ContactDto.java

Lines changed: 19 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
import de.symeda.sormas.api.caze.CaseReferenceDto;
2828
import de.symeda.sormas.api.clinicalcourse.HealthConditionsDto;
2929
import de.symeda.sormas.api.epidata.EpiDataDto;
30+
import de.symeda.sormas.api.event.EventParticipantDto;
3031
import de.symeda.sormas.api.person.PersonReferenceDto;
3132
import de.symeda.sormas.api.region.CommunityReferenceDto;
3233
import de.symeda.sormas.api.region.DistrictReferenceDto;
@@ -247,27 +248,32 @@ public class ContactDto extends PseudonymizableDto {
247248
private String endOfQuarantineReasonDetails;
248249

249250
public static ContactDto build() {
250-
return build(null, null, null);
251+
final ContactDto contact = new ContactDto();
252+
contact.setUuid(DataHelper.createUuid());
253+
contact.setPerson(new PersonReferenceDto(DataHelper.createUuid()));
254+
contact.setReportDateTime(new Date());
255+
contact.setContactClassification(ContactClassification.UNCONFIRMED);
256+
contact.setContactStatus(ContactStatus.ACTIVE);
257+
contact.setEpiData(EpiDataDto.build());
258+
contact.setHealthConditions(HealthConditionsDto.build());
259+
260+
return contact;
261+
}
262+
263+
public static ContactDto build(EventParticipantDto eventParticipant) {
264+
final ContactDto contact = build();
265+
contact.setPerson(eventParticipant.getPerson().toReference());
266+
267+
return contact;
251268
}
252269

253270
public static ContactDto build(CaseDataDto caze) {
254271
return build(caze.toReference(), caze.getDisease(), caze.getDiseaseDetails());
255272
}
256273

257274
public static ContactDto build(CaseReferenceDto caze, Disease disease, String diseaseDetails) {
258-
ContactDto contact = new ContactDto();
259-
contact.setUuid(DataHelper.createUuid());
260-
275+
final ContactDto contact = build();
261276
contact.assignCase(caze, disease, diseaseDetails);
262-
contact.setPerson(new PersonReferenceDto(DataHelper.createUuid()));
263-
264-
contact.setReportDateTime(new Date());
265-
contact.setContactClassification(ContactClassification.UNCONFIRMED);
266-
contact.setContactStatus(ContactStatus.ACTIVE);
267-
268-
contact.setEpiData(EpiDataDto.build());
269-
270-
contact.setHealthConditions(HealthConditionsDto.build());
271277

272278
return contact;
273279
}

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,8 @@ public interface EventFacade {
4343

4444
EventReferenceDto getReferenceByUuid(String uuid);
4545

46+
EventReferenceDto getReferenceByEventParticipant(String uuid);
47+
4648
List<String> getAllActiveUuids();
4749

4850
List<EventDto> getByUuids(List<String> uuids);

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

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,15 @@ public class EventParticipantCriteria extends BaseCriteria implements Serializab
1414
public static final String BIRTHDATE_YYYY = "birthdateYYYY";
1515
public static final String BIRTHDATE_MM = "birthdateMM";
1616
public static final String BIRTHDATE_DD = "birthdateDD";
17+
public static final String ONLY_COUNT_CONTACT_WITH_SOURCE_CASE_IN_EVENT = "onlyCountContactsWithSourceCaseInEvent";
1718

1819
private EventReferenceDto event;
1920
private PersonReferenceDto person;
2021
private String freeText;
2122
private Integer birthdateYYYY;
2223
private Integer birthdateMM;
2324
private Integer birthdateDD;
25+
private Boolean onlyCountContactsWithSourceCaseInEvent;
2426

2527
@IgnoreForUrl
2628
public EventReferenceDto getEvent() {
@@ -79,4 +81,12 @@ public Integer getBirthdateDD() {
7981
public void setBirthdateDD(Integer birthdateDD) {
8082
this.birthdateDD = birthdateDD;
8183
}
84+
85+
public Boolean getOnlyCountContactsWithSourceCaseInEvent() {
86+
return onlyCountContactsWithSourceCaseInEvent;
87+
}
88+
89+
public void setOnlyCountContactsWithSourceCaseInEvent(Boolean onlyCountContactsWithSourceCaseInEvent) {
90+
this.onlyCountContactsWithSourceCaseInEvent = onlyCountContactsWithSourceCaseInEvent;
91+
}
8292
}

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

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@ public class EventParticipantExportDto implements Serializable {
6565
public static final String PERSON_NATIONAL_HEALTH_ID = "personNationalHealthId";
6666
public static final String EVENT_PARTICIPANT_INVOLVMENT_DESCRIPTION = "eventParticipantInvolvmentDescription";
6767
public static final String EVENT_PARTICIPANT_UUID = "eventParticipantUuid";
68+
public static final String CONTACT_COUNT = "contactCount";
6869

6970
private long id;
7071
private long personId;
@@ -141,6 +142,8 @@ public class EventParticipantExportDto implements Serializable {
141142

142143
private EventParticipantJurisdictionDto jurisdiction;
143144

145+
private long contactCount;
146+
144147
//@formatter:off
145148
public EventParticipantExportDto(long id, long personId, String personUuid, String eventParticipantUuid, String personNationalHealthId, long personAddressId, String reportingUserUuid, String eventUuid,
146149

@@ -440,6 +443,16 @@ public String getEventHouseNumber() {
440443
return eventHouseNumber;
441444
}
442445

446+
@Order(65)
447+
@ExportProperty(EventParticipantExportDto.CONTACT_COUNT)
448+
public Long getContactCount() {
449+
return contactCount;
450+
}
451+
452+
public void setContactCount(Long contactCount) {
453+
this.contactCount = contactCount;
454+
}
455+
443456
public List<EmbeddedSampleExportDto> getEventParticipantSamples() {
444457
return eventParticipantSamples;
445458
}

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919

2020
import java.util.Date;
2121
import java.util.List;
22+
import java.util.Map;
2223

2324
import javax.ejb.Remote;
2425

@@ -56,6 +57,8 @@ List<EventParticipantIndexDto> getIndexList(
5657

5758
long count(EventParticipantCriteria eventParticipantCriteria);
5859

60+
Map<String, Long> getContactCountPerEventParticipant(List<String> eventParticipantUuids, EventParticipantCriteria eventParticipantCriteria);
61+
5962
boolean exists(String uuid);
6063

6164
EventParticipantReferenceDto getReferenceByUuid(String uuid);

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

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
import java.io.Serializable;
44

55
import de.symeda.sormas.api.person.ApproximateAgeType;
6-
import de.symeda.sormas.api.person.ApproximateAgeType.ApproximateAgeHelper;
76
import de.symeda.sormas.api.person.Sex;
7+
import de.symeda.sormas.api.person.ApproximateAgeType.ApproximateAgeHelper;
88
import de.symeda.sormas.api.utils.PersonalData;
99
import de.symeda.sormas.api.utils.SensitiveData;
1010
import de.symeda.sormas.api.utils.pseudonymization.PseudonymizableIndexDto;
@@ -24,6 +24,7 @@ public class EventParticipantIndexDto extends PseudonymizableIndexDto implements
2424
public static final String SEX = "sex";
2525
public static final String APPROXIMATE_AGE = "approximateAge";
2626
public static final String INVOLVEMENT_DESCRIPTION = "involvementDescription";
27+
public static final String CONTACT_COUNT = "contactCount";
2728

2829
private String uuid;
2930
private String personUuid;
@@ -38,6 +39,7 @@ public class EventParticipantIndexDto extends PseudonymizableIndexDto implements
3839
private String approximateAge;
3940
@SensitiveData
4041
private String involvementDescription;
42+
private long contactCount;
4143

4244
private EventParticipantJurisdictionDto eventJurisdiction;
4345

@@ -139,6 +141,14 @@ public void setInvolvementDescription(String involvementDescription) {
139141
this.involvementDescription = involvementDescription;
140142
}
141143

144+
public long getContactCount() {
145+
return contactCount;
146+
}
147+
148+
public void setContactCount(long contactCount) {
149+
this.contactCount = contactCount;
150+
}
151+
142152
public EventParticipantJurisdictionDto getJurisdiction() {
143153
return eventJurisdiction;
144154
}

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -533,11 +533,13 @@ public interface Captions {
533533
String contactLostToFollowUp = "contactLostToFollowUp";
534534
String contactMinusDays = "contactMinusDays";
535535
String contactNewContact = "contactNewContact";
536+
String contactNoContactsForEventParticipant = "contactNoContactsForEventParticipant";
536537
String contactOnlyHighPriorityContacts = "contactOnlyHighPriorityContacts";
537538
String contactOnlyQuarantineHelpNeeded = "contactOnlyQuarantineHelpNeeded";
538539
String contactOnlyWithExtendedQuarantine = "contactOnlyWithExtendedQuarantine";
539540
String contactOnlyWithReducedQuarantine = "contactOnlyWithReducedQuarantine";
540541
String contactOnlyWithSharedEventWithSourceCase = "contactOnlyWithSharedEventWithSourceCase";
542+
String contactOnlyWithSourceCaseInGivenEvent = "contactOnlyWithSourceCaseInGivenEvent";
541543
String contactOpenContactCase = "contactOpenContactCase";
542544
String contactPersonPhoneNumber = "contactPersonPhoneNumber";
543545
String contactPersonVisits = "contactPersonVisits";
@@ -875,6 +877,7 @@ public interface Captions {
875877
String EventParticipant = "EventParticipant";
876878
String EventParticipant_approximateAge = "EventParticipant.approximateAge";
877879
String EventParticipant_caseUuid = "EventParticipant.caseUuid";
880+
String EventParticipant_contactCount = "EventParticipant.contactCount";
878881
String EventParticipant_event = "EventParticipant.event";
879882
String EventParticipant_involvementDescription = "EventParticipant.involvementDescription";
880883
String EventParticipant_name = "EventParticipant.name";
@@ -883,6 +886,7 @@ public interface Captions {
883886
String EventParticipant_sex = "EventParticipant.sex";
884887
String EventParticipant_uuid = "EventParticipant.uuid";
885888
String eventParticipantAddPerson = "eventParticipantAddPerson";
889+
String eventParticipantContactCountOnlyWithSourceCaseInEvent = "eventParticipantContactCountOnlyWithSourceCaseInEvent";
886890
String EventParticipantExport_addressCommunity = "EventParticipantExport.addressCommunity";
887891
String EventParticipantExport_addressDistrict = "EventParticipantExport.addressDistrict";
888892
String EventParticipantExport_addressGpsCoordinates = "EventParticipantExport.addressGpsCoordinates";

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

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -514,6 +514,7 @@ contactDetailedOverview=Detailed
514514
contactFollowUpVisitsOverview=Follow-up Visits
515515
contactMinusDays=Previous
516516
contactPlusDays=Next
517+
contactNoContactsForEventParticipant=There are no contacts for this event participant
517518
contactOnlyHighPriorityContacts=Only high priority contacts
518519
contactChooseCase=Choose Case
519520
contactRemoveCase=Remove Case
@@ -524,6 +525,7 @@ contactOnlyWithExtendedQuarantine=Only contacts with extended quarantine
524525
contactOnlyWithReducedQuarantine=Only contacts with reduced quarantine
525526
contactInludeContactsFromOtherJurisdictions=Include contacts from other jurisdictions
526527
contactOnlyWithSharedEventWithSourceCase=Only contacts with source case linked to the specified event
528+
contactOnlyWithSourceCaseInGivenEvent=Only contacts whose source case is linked to this event
527529
contactFollowUpDay=Day
528530
contactQuarantineNotOrdered=No quarantine ordered
529531
contactCreatePIAAccount = PIA
@@ -976,8 +978,10 @@ EventAction.actionReplyingUser=Action replying user
976978

977979
# EventParticipant
978980
eventParticipantAddPerson=Add person
981+
eventParticipantContactCountOnlyWithSourceCaseInEvent=Only counts contacts whose source case is related to this event
979982

980983
EventParticipant=Event participant
984+
EventParticipant.contactCount=Contact count
981985
EventParticipant.event=Event
982986
EventParticipant.caseUuid=Case ID
983987
EventParticipant.approximateAge=Age
@@ -1969,4 +1973,4 @@ SurvnetGateway.send=send to own SurvNet instance
19691973
patientDiaryRegistrationError=Could not register person in the patient diary.
19701974
patientDiaryPersonNotExportable=Cannot export the person to the patient diary. The person needs a valid birthdate and either a valid phone number or email address.
19711975

1972-
showPlacesOnMap=Show
1976+
showPlacesOnMap=Show

sormas-api/src/main/resources/captions_fr-FR.properties

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -498,6 +498,7 @@ contactContactsList=Liste de contacts
498498
contactCreateContactCase=Créer un cas pour ce contact
499499
contactLostToFollowUp=Trace perdue
500500
contactNewContact=Nouveau Contact
501+
contactNoContactsForEventParticipant=Il n’y a pas de contact pour ce participant
501502
contactOpenContactCase=Ouvrir le cas correspondant à ce contact
502503
contactPersonVisits=Toutes les visites de ce contact
503504
contactRelated=Contact lié
@@ -522,6 +523,7 @@ contactOnlyWithExtendedQuarantine=Uniquement les contacts avec une quarantaine p
522523
contactOnlyWithReducedQuarantine=Seuls les contact avec une quarantaine réduite
523524
contactInludeContactsFromOtherJurisdictions=Inclure les cas d'autres juridictions
524525
contactOnlyWithSharedEventWithSourceCase=Seulement les contacts avec le cas source lié à l'événement spécifié
526+
contactOnlyWithSourceCaseInGivenEvent=Uniquement les contacts dont le cas source est lié à cet événement
525527
contactFollowUpDay=Jour
526528
contactQuarantineNotOrdered=Quarantaine non prescrite
527529
contactCreatePIAAccount = PIA
@@ -974,8 +976,10 @@ EventAction.actionReplyingUser=Utilisateur répondant de l'action
974976

975977
# EventParticipant
976978
eventParticipantAddPerson=Ajouter une personne
979+
eventParticipantContactCountOnlyWithSourceCaseInEvent=Ne compte que les contacts dont le cas source est lié à cet événement
977980

978981
EventParticipant=Participant à l'événement
982+
EventParticipant.contactCount=Nombre de contact
979983
EventParticipant.event=Événement
980984
EventParticipant.caseUuid=ID du cas
981985
EventParticipant.approximateAge=Âge
@@ -1957,4 +1961,4 @@ SurvnetGateway.send=envoyer à sa propre instance SurvNet
19571961
patientDiaryRegistrationError=Impossible d'enregistrer la personne dans le journal du patient.
19581962
patientDiaryPersonNotExportable=Impossible d'exporter la personne vers le journal du patient. La personne doit avoir une date de naissance valide et un numéro de téléphone ou une adresse électronique valide.
19591963

1960-
showPlacesOnMap=Afficher
1964+
showPlacesOnMap=Afficher

0 commit comments

Comments
 (0)