From cdfdf5ca842e0bc36d3ea8d7e4af195b3892dbc5 Mon Sep 17 00:00:00 2001 From: Bartha Barna Date: Tue, 12 Apr 2022 14:50:24 +0300 Subject: [PATCH 001/167] #8747 - reuse joins within user filter and criteria filter of TaskService --- .../sormas/backend/task/TaskFacadeEjb.java | 15 ++-- .../sormas/backend/task/TaskService.java | 76 ++++++++++--------- 2 files changed, 49 insertions(+), 42 deletions(-) diff --git a/sormas-backend/src/main/java/de/symeda/sormas/backend/task/TaskFacadeEjb.java b/sormas-backend/src/main/java/de/symeda/sormas/backend/task/TaskFacadeEjb.java index 04963eef4db..b72e0e1f794 100644 --- a/sormas-backend/src/main/java/de/symeda/sormas/backend/task/TaskFacadeEjb.java +++ b/sormas-backend/src/main/java/de/symeda/sormas/backend/task/TaskFacadeEjb.java @@ -423,17 +423,18 @@ public long count(TaskCriteria taskCriteria) { CriteriaBuilder cb = em.getCriteriaBuilder(); CriteriaQuery cq = cb.createQuery(Long.class); Root task = cq.from(Task.class); - TaskJoins joins = new TaskJoins(task); + TaskQueryContext taskQueryContext = new TaskQueryContext(cb, cq, task); + TaskJoins joins = taskQueryContext.getJoins(); Predicate filter = null; if (taskCriteria == null || !taskCriteria.hasContextCriteria()) { - filter = taskService.createUserFilterForJoin(new TaskQueryContext(cb, cq, task)); + filter = taskService.createUserFilter(taskQueryContext); } else { filter = CriteriaBuilderHelper.and(cb, filter, taskService.createAssigneeFilter(cb, joins.getAssignee())); } if (taskCriteria != null) { - Predicate criteriaFilter = taskService.buildCriteriaFilter(taskCriteria, cb, task, joins); + Predicate criteriaFilter = taskService.buildCriteriaFilter(taskCriteria, taskQueryContext); filter = CriteriaBuilderHelper.and(cb, filter, criteriaFilter); } @@ -545,13 +546,13 @@ public List getIndexList(TaskCriteria taskCriteria, Integer first, Predicate filter = null; if (taskCriteria == null || !taskCriteria.hasContextCriteria()) { - filter = taskService.createUserFilterForJoin(taskQueryContext); + filter = taskService.createUserFilter(taskQueryContext); } else { filter = CriteriaBuilderHelper.and(cb, filter, taskService.createAssigneeFilter(cb, joins.getAssignee())); } if (taskCriteria != null) { - Predicate criteriaFilter = taskService.buildCriteriaFilter(taskCriteria, cb, task, joins); + Predicate criteriaFilter = taskService.buildCriteriaFilter(taskCriteria, taskQueryContext); filter = CriteriaBuilderHelper.and(cb, filter, criteriaFilter); } @@ -709,13 +710,13 @@ public List getExportList(TaskCriteria criteria, Collection getAllActiveTasksAfter(Date date, User user, Integer batchSize CriteriaBuilder cb = em.getCriteriaBuilder(); CriteriaQuery cq = cb.createQuery(getElementClass()); Root from = cq.from(getElementClass()); + final TaskQueryContext taskQueryContext = new TaskQueryContext(cb, cq, from); - Predicate filter = buildActiveTasksFilter(cb, from); + Predicate filter = buildActiveTasksFilter(taskQueryContext); if (user != null) { - Predicate userFilter = createUserFilter(cb, cq, from); + Predicate userFilter = createUserFilter(taskQueryContext); filter = CriteriaBuilderHelper.and(cb, filter, userFilter); } @@ -119,14 +118,15 @@ public List getAllActiveTasksAfter(Date date, User user, Integer batchSize public List getAllActiveUuids(User user) { - CriteriaBuilder cb = em.getCriteriaBuilder(); - CriteriaQuery cq = cb.createQuery(String.class); - Root from = cq.from(getElementClass()); + final CriteriaBuilder cb = em.getCriteriaBuilder(); + final CriteriaQuery cq = cb.createQuery(String.class); + final Root from = cq.from(getElementClass()); + final TaskQueryContext taskQueryContext = new TaskQueryContext(cb, cq, from); - Predicate filter = buildActiveTasksFilter(cb, from); + Predicate filter = buildActiveTasksFilter(taskQueryContext); if (user != null) { - Predicate userFilter = createUserFilter(cb, cq, from); + Predicate userFilter = createUserFilter(taskQueryContext); filter = CriteriaBuilderHelper.and(cb, filter, userFilter); } @@ -145,13 +145,13 @@ public List getAllActiveUuids(User user) { @Override public Predicate createUserFilter(CriteriaBuilder cb, CriteriaQuery cq, From taskPath) { - return createUserFilterForJoin(new TaskQueryContext(cb, cq, taskPath)); + return createUserFilter(new TaskQueryContext(cb, cq, taskPath)); } @SuppressWarnings({ "rawtypes", "unchecked" }) - public Predicate createUserFilterForJoin(TaskQueryContext taskQueryContext) { + public Predicate createUserFilter(TaskQueryContext taskQueryContext) { User currentUser = getCurrentUser(); if (currentUser == null) { @@ -162,7 +162,7 @@ public Predicate createUserFilterForJoin(TaskQueryContext taskQueryContext) { CriteriaBuilder cb = taskQueryContext.getCriteriaBuilder(); From taskPath = taskQueryContext.getRoot(); - Predicate assigneeFilter = createAssigneeFilter(cb, ((TaskJoins) taskQueryContext.getJoins()).getAssignee()); + Predicate assigneeFilter = createAssigneeFilter(cb, taskQueryContext.getJoins().getAssignee()); final JurisdictionLevel jurisdictionLevel = currentUser.getJurisdictionLevel(); if ((jurisdictionLevel == JurisdictionLevel.NATION && !UserRole.isPortHealthUser(currentUser.getUserRoles())) @@ -173,19 +173,19 @@ public Predicate createUserFilterForJoin(TaskQueryContext taskQueryContext) { Predicate filter = cb.equal(taskPath.get(Task.CREATOR_USER), currentUser); filter = cb.or(filter, cb.equal(taskPath.get(Task.ASSIGNEE_USER), currentUser)); - Predicate caseFilter = caseService.createUserFilter(cb, cq, ((TaskJoins) taskQueryContext.getJoins()).getCaze()); + Predicate caseFilter = caseService.createUserFilter(cb, cq, taskQueryContext.getJoins().getCaze()); if (caseFilter != null) { filter = cb.or(filter, caseFilter); } - Predicate contactFilter = contactService.createUserFilter(cb, cq, ((TaskJoins) taskQueryContext.getJoins()).getContact()); + Predicate contactFilter = contactService.createUserFilter(cb, cq, taskQueryContext.getJoins().getContact()); if (contactFilter != null) { filter = cb.or(filter, contactFilter); } - Predicate eventFilter = eventService.createUserFilter(cb, cq, ((TaskJoins) taskQueryContext.getJoins()).getEvent()); + Predicate eventFilter = eventService.createUserFilter(cb, cq, taskQueryContext.getJoins().getEvent()); if (eventFilter != null) { filter = cb.or(filter, eventFilter); } - Predicate travelEntryFilter = travelEntryService.createUserFilter(cb, cq, ((TaskJoins) taskQueryContext.getJoins()).getTravelEntry()); + Predicate travelEntryFilter = travelEntryService.createUserFilter(cb, cq, taskQueryContext.getJoins().getTravelEntry()); if (travelEntryFilter != null) { filter = cb.or(filter, travelEntryFilter); } @@ -200,11 +200,12 @@ public Predicate createAssigneeFilter(CriteriaBuilder cb, Join assignee public long getCount(TaskCriteria taskCriteria) { - CriteriaBuilder cb = em.getCriteriaBuilder(); - CriteriaQuery cq = cb.createQuery(Long.class); - Root from = cq.from(getElementClass()); + final CriteriaBuilder cb = em.getCriteriaBuilder(); + final CriteriaQuery cq = cb.createQuery(Long.class); + final Root from = cq.from(getElementClass()); + final TaskQueryContext taskQueryContext = new TaskQueryContext(cb, cq, from); - Predicate filter = buildCriteriaFilter(taskCriteria, cb, from); + Predicate filter = buildCriteriaFilter(taskCriteria, taskQueryContext); if (filter != null) { cq.where(filter); } @@ -216,11 +217,12 @@ public long getCount(TaskCriteria taskCriteria) { public List findBy(TaskCriteria taskCriteria, boolean ignoreUserFilter) { - CriteriaBuilder cb = em.getCriteriaBuilder(); - CriteriaQuery cq = cb.createQuery(getElementClass()); - Root from = cq.from(getElementClass()); + final CriteriaBuilder cb = em.getCriteriaBuilder(); + final CriteriaQuery cq = cb.createQuery(getElementClass()); + final Root from = cq.from(getElementClass()); + final TaskQueryContext taskQueryContext = new TaskQueryContext(cb, cq, from); - Predicate filter = buildCriteriaFilter(taskCriteria, cb, from); + Predicate filter = buildCriteriaFilter(taskCriteria, taskQueryContext); if (!ignoreUserFilter) { filter = CriteriaBuilderHelper.and(cb, filter, createUserFilter(cb, cq, from)); } @@ -262,11 +264,11 @@ public List getArchivedUuidsSince(Date since) { return em.createQuery(cq).getResultList(); } - public Predicate buildCriteriaFilter(TaskCriteria taskCriteria, CriteriaBuilder cb, Root from) { - return buildCriteriaFilter(taskCriteria, cb, from, new TaskJoins(from)); - } + public Predicate buildCriteriaFilter(TaskCriteria taskCriteria, TaskQueryContext taskQueryContext) { - public Predicate buildCriteriaFilter(TaskCriteria taskCriteria, CriteriaBuilder cb, Root from, TaskJoins joins) { + final CriteriaBuilder cb = taskQueryContext.getCriteriaBuilder(); + final TaskJoins joins = taskQueryContext.getJoins(); + final From from = taskQueryContext.getRoot(); Predicate filter = null; @@ -315,7 +317,7 @@ public Predicate buildCriteriaFilter(TaskCriteria taskCriteria, CriteriaBuilder } if (taskCriteria.getRelevanceStatus() != null) { if (taskCriteria.getRelevanceStatus() == EntityRelevanceStatus.ACTIVE) { - filter = CriteriaBuilderHelper.and(cb, filter, buildActiveTasksFilter(cb, from)); + filter = CriteriaBuilderHelper.and(cb, filter, buildActiveTasksFilter(taskQueryContext)); } else if (taskCriteria.getRelevanceStatus() == EntityRelevanceStatus.ARCHIVED) { filter = CriteriaBuilderHelper.and( cb, @@ -418,13 +420,17 @@ public Predicate buildCriteriaFilter(TaskCriteria taskCriteria, CriteriaBuilder return filter; } - private Predicate buildActiveTasksFilter(CriteriaBuilder cb, Root from) { + private Predicate buildActiveTasksFilter(TaskQueryContext taskQueryContext) { + + From from = taskQueryContext.getRoot(); + CriteriaBuilder cb = taskQueryContext.getCriteriaBuilder(); + TaskJoins joins = taskQueryContext.getJoins(); - Join caze = from.join(Task.CAZE, JoinType.LEFT); - Join contact = from.join(Task.CONTACT, JoinType.LEFT); - Join contactCaze = contact.join(Contact.CAZE, JoinType.LEFT); - Join event = from.join(Task.EVENT, JoinType.LEFT); - Join travelEntry = from.join(Task.TRAVEL_ENTRY, JoinType.LEFT); + Join caze = joins.getCaze(); + Join contact = joins.getContact(); + Join contactCaze = joins.getContactCase(); + Join event = joins.getEvent(); + Join travelEntry = joins.getTravelEntry(); return cb.and( cb.isFalse(from.get(Task.ARCHIVED)), From e83b83dd41ce6e3a31b399ebff168b7c94fd9b6f Mon Sep 17 00:00:00 2001 From: Bartha Barna Date: Wed, 13 Apr 2022 12:08:18 +0300 Subject: [PATCH 002/167] #8747 - reuse joins within user filter and criteria filter of SampleService --- .../backend/sample/SampleFacadeEjb.java | 21 ++++++++--------- .../sormas/backend/sample/SampleService.java | 23 ++++++++++++------- 2 files changed, 25 insertions(+), 19 deletions(-) diff --git a/sormas-backend/src/main/java/de/symeda/sormas/backend/sample/SampleFacadeEjb.java b/sormas-backend/src/main/java/de/symeda/sormas/backend/sample/SampleFacadeEjb.java index e90f8fc8be8..b5c2b9397f3 100644 --- a/sormas-backend/src/main/java/de/symeda/sormas/backend/sample/SampleFacadeEjb.java +++ b/sormas-backend/src/main/java/de/symeda/sormas/backend/sample/SampleFacadeEjb.java @@ -222,13 +222,13 @@ public List getSimilarSamples(SampleSimilarityCriteria criteria) { final Root root = cq.from(Sample.class); cq.distinct(true); - SampleJoins joins = new SampleJoins(root); + SampleQueryContext sampleQueryContext = new SampleQueryContext(cb, cq, root); SampleCriteria sampleCriteria = new SampleCriteria(); sampleCriteria.caze(criteria.getCaze()).contact(criteria.getContact()).eventParticipant(criteria.getEventParticipant()); - Predicate filter = sampleService.createUserFilter(cq, cb, joins, sampleCriteria); - filter = CriteriaBuilderHelper.and(cb, filter, sampleService.buildCriteriaFilter(sampleCriteria, cb, joins)); + Predicate filter = sampleService.createUserFilter(sampleQueryContext, sampleCriteria); + filter = CriteriaBuilderHelper.and(cb, filter, sampleService.buildCriteriaFilter(sampleCriteria, sampleQueryContext)); Predicate similarityFilter = null; if (criteria.getLabSampleId() != null) { @@ -270,10 +270,10 @@ private List getByCriteria(SampleCriteria criteria) { final CriteriaQuery cq = cb.createQuery(Sample.class); final Root root = cq.from(Sample.class); - SampleJoins joins = new SampleJoins(root); + SampleQueryContext sampleQueryContext = new SampleQueryContext(cb, cq, root); - Predicate filter = sampleService.createUserFilter(cq, cb, joins, criteria); - filter = CriteriaBuilderHelper.and(cb, filter, sampleService.buildCriteriaFilter(criteria, cb, joins)); + Predicate filter = sampleService.createUserFilter(sampleQueryContext, criteria); + filter = CriteriaBuilderHelper.and(cb, filter, sampleService.buildCriteriaFilter(criteria, sampleQueryContext)); if (filter != null) { cq.where(filter); @@ -572,7 +572,7 @@ private List getExportList( Predicate filter = sampleService.createUserFilter(cb, cq, sampleRoot); if (sampleCriteria != null) { - Predicate criteriaFilter = sampleService.buildCriteriaFilter(sampleCriteria, cb, joins); + Predicate criteriaFilter = sampleService.buildCriteriaFilter(sampleCriteria, sampleQueryContext); filter = CriteriaBuilderHelper.and(cb, filter, criteriaFilter); filter = CriteriaBuilderHelper.andInValues(selectedRows, filter, cb, sampleRoot.get(AbstractDomainObject.UUID)); } else if (caseCriteria != null) { @@ -673,11 +673,10 @@ public long count(SampleCriteria sampleCriteria) { final CriteriaQuery cq = cb.createQuery(Long.class); final Root root = cq.from(Sample.class); - SampleJoins joins = new SampleJoins(root); - - Predicate filter = sampleService.createUserFilter(cq, cb, joins, sampleCriteria); + SampleQueryContext sampleQueryContext = new SampleQueryContext(cb, cq, root); + Predicate filter = sampleService.createUserFilter(sampleQueryContext, sampleCriteria); if (sampleCriteria != null) { - Predicate criteriaFilter = sampleService.buildCriteriaFilter(sampleCriteria, cb, joins); + Predicate criteriaFilter = sampleService.buildCriteriaFilter(sampleCriteria,sampleQueryContext); filter = CriteriaBuilderHelper.and(cb, filter, criteriaFilter); } diff --git a/sormas-backend/src/main/java/de/symeda/sormas/backend/sample/SampleService.java b/sormas-backend/src/main/java/de/symeda/sormas/backend/sample/SampleService.java index 132e32fa6eb..d775e1a0dba 100644 --- a/sormas-backend/src/main/java/de/symeda/sormas/backend/sample/SampleService.java +++ b/sormas-backend/src/main/java/de/symeda/sormas/backend/sample/SampleService.java @@ -140,9 +140,10 @@ public List findBy(SampleCriteria criteria, User user, String sortProper CriteriaBuilder cb = em.getCriteriaBuilder(); CriteriaQuery cq = cb.createQuery(getElementClass()); Root from = cq.from(getElementClass()); - SampleJoins joins = new SampleJoins(from); - Predicate filter = buildCriteriaFilter(criteria, cb, joins); + SampleQueryContext sampleQueryContext = new SampleQueryContext(cb, cq, from); + + Predicate filter = buildCriteriaFilter(criteria, sampleQueryContext); if (user != null) { filter = CriteriaBuilderHelper.and(cb, filter, createUserFilter(cb, cq, from)); @@ -245,10 +246,10 @@ public List getIndexList(SampleCriteria sampleCriteria, Integer selections.addAll(getJurisdictionSelections(sampleQueryContext)); cq.multiselect(selections); - Predicate filter = createUserFilter(cq, cb, joins, sampleCriteria); + Predicate filter = createUserFilter(sampleQueryContext, sampleCriteria); if (sampleCriteria != null) { - Predicate criteriaFilter = buildCriteriaFilter(sampleCriteria, cb, joins); + Predicate criteriaFilter = buildCriteriaFilter(sampleCriteria, sampleQueryContext); filter = CriteriaBuilderHelper.and(cb, filter, criteriaFilter); } @@ -425,7 +426,7 @@ public List getEntriesList(SampleCriteria sampleCriteria, In selections.addAll(getJurisdictionSelections(sampleQueryContext)); cq.multiselect(selections); - Predicate filter = CriteriaBuilderHelper.and(cb, createDefaultFilter(cb, sample), createUserFilter(cq, cb, joins, sampleCriteria)); + Predicate filter = CriteriaBuilderHelper.and(cb, createDefaultFilter(cb, sample), createUserFilter(sampleQueryContext, sampleCriteria)); Predicate criteriaFilter = buildSampleListCriteriaFilter(sampleCriteria, cb, joins); filter = CriteriaBuilderHelper.and(cb, filter, criteriaFilter); @@ -603,11 +604,15 @@ public Map getNewTestResultCountByResultType(List< @SuppressWarnings("rawtypes") @Deprecated public Predicate createUserFilter(CriteriaBuilder cb, CriteriaQuery cq, From samplePath) { - return createUserFilter(cq, cb, new SampleJoins(samplePath), new SampleCriteria()); + return createUserFilter(new SampleQueryContext(cb, cq, samplePath), new SampleCriteria()); } @SuppressWarnings("rawtypes") - public Predicate createUserFilter(CriteriaQuery cq, CriteriaBuilder cb, SampleJoins joins, SampleCriteria criteria) { + public Predicate createUserFilter(SampleQueryContext sampleQueryContext, SampleCriteria criteria) { + + final CriteriaQuery cq = sampleQueryContext.getQuery(); + final CriteriaBuilder cb = sampleQueryContext.getCriteriaBuilder(); + final SampleJoins joins = sampleQueryContext.getJoins(); User currentUser = getCurrentUser(); if (currentUser == null) { @@ -729,7 +734,9 @@ public Predicate inJurisdictionOrOwned(SampleQueryContext qc) { return SampleJurisdictionPredicateValidator.of(qc, currentUser).inJurisdictionOrOwned(); } - public Predicate buildCriteriaFilter(SampleCriteria criteria, CriteriaBuilder cb, SampleJoins joins) { + public Predicate buildCriteriaFilter(SampleCriteria criteria, SampleQueryContext sampleQueryContext) { + SampleJoins joins = sampleQueryContext.getJoins(); + CriteriaBuilder cb = sampleQueryContext.getCriteriaBuilder(); final From sample = joins.getRoot(); Predicate filter = null; From 06900b1841b066e3137d0da26deeab8fcbe1cf9c Mon Sep 17 00:00:00 2001 From: Bartha Barna Date: Tue, 19 Apr 2022 09:02:41 +0300 Subject: [PATCH 003/167] #8747 - reuse joins within user filter and criteria filter of SampleService --- .../java/de/symeda/sormas/backend/sample/SampleFacadeEjb.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sormas-backend/src/main/java/de/symeda/sormas/backend/sample/SampleFacadeEjb.java b/sormas-backend/src/main/java/de/symeda/sormas/backend/sample/SampleFacadeEjb.java index b5c2b9397f3..75aced6739f 100644 --- a/sormas-backend/src/main/java/de/symeda/sormas/backend/sample/SampleFacadeEjb.java +++ b/sormas-backend/src/main/java/de/symeda/sormas/backend/sample/SampleFacadeEjb.java @@ -569,7 +569,7 @@ private List getExportList( cq.multiselect(selections); - Predicate filter = sampleService.createUserFilter(cb, cq, sampleRoot); + Predicate filter = sampleService.createUserFilter(sampleQueryContext, sampleCriteria); if (sampleCriteria != null) { Predicate criteriaFilter = sampleService.buildCriteriaFilter(sampleCriteria, sampleQueryContext); From deaedc8044b804e560f9469370b5c0d8aeb5f8a2 Mon Sep 17 00:00:00 2001 From: Bartha Barna Date: Tue, 19 Apr 2022 09:35:30 +0300 Subject: [PATCH 004/167] #8747 - throw exception for old createUserFilter of Sample and Task service --- .../backend/sample/AdditionalTestService.java | 2 +- .../backend/sample/PathogenTestService.java | 18 ++++---- .../backend/sample/SampleFacadeEjb.java | 3 +- .../sormas/backend/sample/SampleService.java | 45 +++++++++++-------- .../sormas/backend/task/TaskService.java | 14 +++--- 5 files changed, 45 insertions(+), 37 deletions(-) diff --git a/sormas-backend/src/main/java/de/symeda/sormas/backend/sample/AdditionalTestService.java b/sormas-backend/src/main/java/de/symeda/sormas/backend/sample/AdditionalTestService.java index fe9d0d4fd10..9af350b20fb 100644 --- a/sormas-backend/src/main/java/de/symeda/sormas/backend/sample/AdditionalTestService.java +++ b/sormas-backend/src/main/java/de/symeda/sormas/backend/sample/AdditionalTestService.java @@ -197,7 +197,7 @@ public Predicate createUserFilter(CriteriaBuilder cb, CriteriaQuery cq, From sampleJoin = additionalTestPath.join(AdditionalTest.SAMPLE); - Predicate filter = sampleService.createUserFilter(cb, cq, sampleJoin); + Predicate filter = sampleService.createUserFilter(new SampleQueryContext(cb, cq, sampleJoin), null); return filter; } diff --git a/sormas-backend/src/main/java/de/symeda/sormas/backend/sample/PathogenTestService.java b/sormas-backend/src/main/java/de/symeda/sormas/backend/sample/PathogenTestService.java index 7e242bb3ba6..8c9526507c5 100644 --- a/sormas-backend/src/main/java/de/symeda/sormas/backend/sample/PathogenTestService.java +++ b/sormas-backend/src/main/java/de/symeda/sormas/backend/sample/PathogenTestService.java @@ -71,7 +71,7 @@ public List getAllActivePathogenTestsAfter(Date date, User user, I CriteriaQuery cq = cb.createQuery(getElementClass()); Root from = cq.from(getElementClass()); - Predicate filter = createActiveTestsFilter(cb, from); + Predicate filter = createActiveTestsFilter(cb, cq, from); if (user != null) { Predicate userFilter = createUserFilter(cb, cq, from); @@ -95,7 +95,7 @@ public List getAllActiveUuids(User user) { CriteriaQuery cq = cb.createQuery(String.class); Root from = cq.from(getElementClass()); - Predicate filter = createActiveTestsFilter(cb, from); + Predicate filter = createActiveTestsFilter(cb, cq, from); if (user != null) { Predicate userFilter = createUserFilter(cb, cq, from); @@ -114,7 +114,7 @@ public List getIndexList(PathogenTestCriteria pathogenTestCriteria Root from = cq.from(getElementClass()); Predicate filter = null; if (pathogenTestCriteria != null) { - filter = buildCriteriaFilter(pathogenTestCriteria, cb, from); + filter = buildCriteriaFilter(pathogenTestCriteria, cb, cq, from); } if (filter != null) { cq.where(filter); @@ -218,7 +218,7 @@ public long count(PathogenTestCriteria pathogenTestCriteria) { Predicate filter = createDefaultFilter(cb, pathogenTestRoot); if (pathogenTestCriteria != null) { - Predicate criteriaFilter = buildCriteriaFilter(pathogenTestCriteria, cb, pathogenTestRoot); + Predicate criteriaFilter = buildCriteriaFilter(pathogenTestCriteria, cb, cq, pathogenTestRoot); filter = CriteriaBuilderHelper.and(cb, filter, criteriaFilter); } @@ -252,8 +252,8 @@ public List getBySampleUuid(String sampleUuid, boolean ordered) { return getBySampleUuids(Collections.singletonList(sampleUuid), ordered); } - public Predicate buildCriteriaFilter(PathogenTestCriteria pathogenTestCriteria, CriteriaBuilder cb, Root from) { - Predicate filter = createActiveTestsFilter(cb, from); + public Predicate buildCriteriaFilter(PathogenTestCriteria pathogenTestCriteria, CriteriaBuilder cb, CriteriaQuery cq, Root from) { + Predicate filter = createActiveTestsFilter(cb, cq, from); if (pathogenTestCriteria.getSample() != null) { filter = CriteriaBuilderHelper @@ -313,7 +313,7 @@ public Predicate createUserFilter(CriteriaBuilder cb, CriteriaQuery cq, From samplePath = sampleTestPath.join(PathogenTest.SAMPLE); - Predicate filter = sampleService.createUserFilter(cb, cq, samplePath); + Predicate filter = sampleService.createUserFilter(new SampleQueryContext(cb, cq, samplePath), null); return filter; } @@ -328,10 +328,10 @@ public void delete(PathogenTest pathogenTest) { * cases that are {@link Case#archived}, contacts that are {@link Contact#deleted}. or event participants that are * {@link EventParticipant#deleted} */ - public Predicate createActiveTestsFilter(CriteriaBuilder cb, Root root) { + public Predicate createActiveTestsFilter(CriteriaBuilder cb, CriteriaQuery cq, Root root) { Join sample = root.join(PathogenTest.SAMPLE, JoinType.LEFT); - return sampleService.createActiveSamplesFilter(cb, sample); + return sampleService.createActiveSamplesFilter(new SampleQueryContext(cb, cq, sample)); } /** diff --git a/sormas-backend/src/main/java/de/symeda/sormas/backend/sample/SampleFacadeEjb.java b/sormas-backend/src/main/java/de/symeda/sormas/backend/sample/SampleFacadeEjb.java index 75aced6739f..89cb56a4e12 100644 --- a/sormas-backend/src/main/java/de/symeda/sormas/backend/sample/SampleFacadeEjb.java +++ b/sormas-backend/src/main/java/de/symeda/sormas/backend/sample/SampleFacadeEjb.java @@ -308,10 +308,11 @@ public List getByLabSampleId(String labSampleId) { final CriteriaBuilder cb = em.getCriteriaBuilder(); final CriteriaQuery cq = cb.createQuery(Sample.class); final Root sampleRoot = cq.from(Sample.class); + final SampleQueryContext sampleQueryContext = new SampleQueryContext(cb, cq, sampleRoot); Predicate filter = CriteriaBuilderHelper.and( cb, - sampleService.createUserFilter(cb, cq, sampleRoot), + sampleService.createUserFilter(sampleQueryContext, null), sampleService.createDefaultFilter(cb, sampleRoot), cb.equal(sampleRoot.get(Sample.LAB_SAMPLE_ID), labSampleId)); cq.where(filter); diff --git a/sormas-backend/src/main/java/de/symeda/sormas/backend/sample/SampleService.java b/sormas-backend/src/main/java/de/symeda/sormas/backend/sample/SampleService.java index d775e1a0dba..cd0d81f85cf 100644 --- a/sormas-backend/src/main/java/de/symeda/sormas/backend/sample/SampleService.java +++ b/sormas-backend/src/main/java/de/symeda/sormas/backend/sample/SampleService.java @@ -146,7 +146,7 @@ public List findBy(SampleCriteria criteria, User user, String sortProper Predicate filter = buildCriteriaFilter(criteria, sampleQueryContext); if (user != null) { - filter = CriteriaBuilderHelper.and(cb, filter, createUserFilter(cb, cq, from)); + filter = CriteriaBuilderHelper.and(cb, filter, createUserFilter(sampleQueryContext, null)); } if (filter != null) { cq.where(filter); @@ -446,11 +446,12 @@ public List getAllActiveSamplesAfter(Date date, User user, Integer batch CriteriaBuilder cb = em.getCriteriaBuilder(); CriteriaQuery cq = cb.createQuery(getElementClass()); Root from = cq.from(getElementClass()); + SampleQueryContext sampleQueryContext = new SampleQueryContext(cb, cq, from); - Predicate filter = createActiveSamplesFilter(cb, from); + Predicate filter = createActiveSamplesFilter(sampleQueryContext); if (user != null) { - Predicate userFilter = createUserFilter(cb, cq, from); + Predicate userFilter = createUserFilter(sampleQueryContext, null); filter = CriteriaBuilderHelper.and(cb, filter, userFilter); } @@ -467,14 +468,15 @@ public List getAllActiveSamplesAfter(Date date, User user, Integer batch public List getAllActiveUuids(User user) { - CriteriaBuilder cb = em.getCriteriaBuilder(); - CriteriaQuery cq = cb.createQuery(String.class); - Root from = cq.from(getElementClass()); + final CriteriaBuilder cb = em.getCriteriaBuilder(); + final CriteriaQuery cq = cb.createQuery(String.class); + final Root from = cq.from(getElementClass()); + final SampleQueryContext sampleQueryContext = new SampleQueryContext(cb, cq, from); - Predicate filter = createActiveSamplesFilter(cb, from); + Predicate filter = createActiveSamplesFilter(sampleQueryContext); if (user != null) { - Predicate userFilter = createUserFilter(cb, cq, from); + Predicate userFilter = createUserFilter(sampleQueryContext, null); filter = CriteriaBuilderHelper.and(cb, filter, userFilter); } @@ -504,11 +506,12 @@ public Sample getReferredFrom(String sampleUuid) { public List getDeletedUuidsSince(User user, Date since) { - CriteriaBuilder cb = em.getCriteriaBuilder(); - CriteriaQuery cq = cb.createQuery(String.class); - Root sample = cq.from(Sample.class); + final CriteriaBuilder cb = em.getCriteriaBuilder(); + final CriteriaQuery cq = cb.createQuery(String.class); + final Root sample = cq.from(Sample.class); + final SampleQueryContext sampleQueryContext = new SampleQueryContext(cb, cq, sample); - Predicate filter = createUserFilter(cb, cq, sample); + Predicate filter = createUserFilter(sampleQueryContext, null); if (since != null) { Predicate dateFilter = cb.greaterThanOrEqualTo(sample.get(Sample.CHANGE_DATE), since); if (filter != null) { @@ -604,7 +607,7 @@ public Map getNewTestResultCountByResultType(List< @SuppressWarnings("rawtypes") @Deprecated public Predicate createUserFilter(CriteriaBuilder cb, CriteriaQuery cq, From samplePath) { - return createUserFilter(new SampleQueryContext(cb, cq, samplePath), new SampleCriteria()); + throw new UnsupportedOperationException("Method should no longer be used!"); } @SuppressWarnings("rawtypes") @@ -1062,13 +1065,17 @@ public void deleteAll(List sampleUuids) { /** * Creates a filter that excludes all samples that are deleted or associated with archived or deleted entities */ - public Predicate createActiveSamplesFilter(CriteriaBuilder cb, From root) { + public Predicate createActiveSamplesFilter(SampleQueryContext sampleQueryContext) { + final From root = sampleQueryContext.getRoot(); + final CriteriaBuilder cb = sampleQueryContext.getCriteriaBuilder(); + final SampleJoins joins = sampleQueryContext.getJoins(); + + final Join caze = joins.getCaze(); + final Join contact = joins.getContact(); + final Join contactCase = joins.getContactCase(); + final Join eventParticipant = joins.getEventParticipant(); + final Join event = joins.getEvent(); - Join caze = root.join(Sample.ASSOCIATED_CASE, JoinType.LEFT); - Join contact = root.join(Sample.ASSOCIATED_CONTACT, JoinType.LEFT); - Join contactCase = contact.join(Contact.CAZE, JoinType.LEFT); - Join eventParticipant = root.join(Sample.ASSOCIATED_EVENT_PARTICIPANT, JoinType.LEFT); - Join event = eventParticipant.join(EventParticipant.EVENT, JoinType.LEFT); Predicate pred = cb.or( cb.and(cb.isFalse(caze.get(Case.ARCHIVED)), cb.isFalse(caze.get(Case.DELETED))), cb.and( diff --git a/sormas-backend/src/main/java/de/symeda/sormas/backend/task/TaskService.java b/sormas-backend/src/main/java/de/symeda/sormas/backend/task/TaskService.java index 951582b6cce..be551eb8450 100644 --- a/sormas-backend/src/main/java/de/symeda/sormas/backend/task/TaskService.java +++ b/sormas-backend/src/main/java/de/symeda/sormas/backend/task/TaskService.java @@ -144,8 +144,7 @@ public List getAllActiveUuids(User user) { "unchecked" }) @Override public Predicate createUserFilter(CriteriaBuilder cb, CriteriaQuery cq, From taskPath) { - - return createUserFilter(new TaskQueryContext(cb, cq, taskPath)); + throw new UnsupportedOperationException("Method should no longer be used!"); } @SuppressWarnings({ @@ -224,7 +223,7 @@ public List findBy(TaskCriteria taskCriteria, boolean ignoreUserFilter) { Predicate filter = buildCriteriaFilter(taskCriteria, taskQueryContext); if (!ignoreUserFilter) { - filter = CriteriaBuilderHelper.and(cb, filter, createUserFilter(cb, cq, from)); + filter = CriteriaBuilderHelper.and(cb, filter, createUserFilter(taskQueryContext)); } if (filter != null) { @@ -237,11 +236,12 @@ public List findBy(TaskCriteria taskCriteria, boolean ignoreUserFilter) { public List getArchivedUuidsSince(Date since) { - CriteriaBuilder cb = em.getCriteriaBuilder(); - CriteriaQuery cq = cb.createQuery(String.class); - Root taskRoot = cq.from(Task.class); + final CriteriaBuilder cb = em.getCriteriaBuilder(); + final CriteriaQuery cq = cb.createQuery(String.class); + final Root taskRoot = cq.from(Task.class); + final TaskQueryContext taskQueryContext = new TaskQueryContext(cb, cq, taskRoot); - Predicate filter = createUserFilter(cb, cq, taskRoot); + Predicate filter = createUserFilter(taskQueryContext); if (since != null) { Predicate dateFilter = cb.greaterThanOrEqualTo(taskRoot.get(Task.CHANGE_DATE), since); if (filter != null) { From e6d94007a6e2561942cd834185c74210fe93ef9a Mon Sep 17 00:00:00 2001 From: Bartha Barna Date: Tue, 19 Apr 2022 10:15:49 +0300 Subject: [PATCH 005/167] #8747 - reuse joins within user filter and criteria filter of ImmunizationService - plus separate jurisdiction predicate from user filter predicate --- .../immunization/BaseImmunizationJoins.java | 11 +++++ .../DirectoryImmunizationService.java | 42 +++++++++-------- .../immunization/ImmunizationService.java | 46 +++++++++++-------- .../sormas/backend/person/PersonService.java | 3 +- 4 files changed, 64 insertions(+), 38 deletions(-) diff --git a/sormas-backend/src/main/java/de/symeda/sormas/backend/immunization/BaseImmunizationJoins.java b/sormas-backend/src/main/java/de/symeda/sormas/backend/immunization/BaseImmunizationJoins.java index 547199a4072..0c41e43e080 100644 --- a/sormas-backend/src/main/java/de/symeda/sormas/backend/immunization/BaseImmunizationJoins.java +++ b/sormas-backend/src/main/java/de/symeda/sormas/backend/immunization/BaseImmunizationJoins.java @@ -12,6 +12,7 @@ import de.symeda.sormas.backend.infrastructure.facility.Facility; import de.symeda.sormas.backend.infrastructure.region.Region; import de.symeda.sormas.backend.person.Person; +import de.symeda.sormas.backend.person.PersonJoins; public class BaseImmunizationJoins extends QueryJoins { @@ -21,6 +22,8 @@ public class BaseImmunizationJoins extends QueryJoin private Join responsibleCommunity; private Join healthFacility; + private PersonJoins personJoins; + public BaseImmunizationJoins(From root) { super(root); } @@ -33,6 +36,14 @@ public void setPerson(Join person) { this.person = person; } + public PersonJoins getPersonJoins() { + return getOrCreate(personJoins, () -> new PersonJoins(getPerson()), this::setPersonJoins); + } + + private void setPersonJoins(PersonJoins personJoins) { + this.personJoins = personJoins; + } + public Join getResponsibleRegion() { return getOrCreate(responsibleRegion, Immunization.RESPONSIBLE_REGION, JoinType.LEFT, this::setResponsibleRegion); } diff --git a/sormas-backend/src/main/java/de/symeda/sormas/backend/immunization/DirectoryImmunizationService.java b/sormas-backend/src/main/java/de/symeda/sormas/backend/immunization/DirectoryImmunizationService.java index 0d3855e6863..192a8444ba6 100644 --- a/sormas-backend/src/main/java/de/symeda/sormas/backend/immunization/DirectoryImmunizationService.java +++ b/sormas-backend/src/main/java/de/symeda/sormas/backend/immunization/DirectoryImmunizationService.java @@ -15,12 +15,12 @@ import javax.persistence.criteria.Expression; import javax.persistence.criteria.From; import javax.persistence.criteria.Join; -import javax.persistence.criteria.JoinType; import javax.persistence.criteria.Order; import javax.persistence.criteria.Path; import javax.persistence.criteria.Predicate; import javax.persistence.criteria.Root; +import de.symeda.sormas.backend.user.UserService; import org.apache.commons.collections4.CollectionUtils; import de.symeda.sormas.api.feature.FeatureType; @@ -47,7 +47,6 @@ import de.symeda.sormas.backend.person.PersonJurisdictionPredicateValidator; import de.symeda.sormas.backend.person.PersonQueryContext; import de.symeda.sormas.backend.user.User; -import de.symeda.sormas.backend.user.UserService; import de.symeda.sormas.backend.util.JurisdictionHelper; import de.symeda.sormas.backend.vaccination.FirstVaccinationDate; import de.symeda.sormas.backend.vaccination.LastVaccinationDate; @@ -68,7 +67,7 @@ public DirectoryImmunizationService() { @Override public Predicate createUserFilter(CriteriaBuilder cb, CriteriaQuery cq, From immunizationDirectoryPath) { - return createUserFilter(new DirectoryImmunizationQueryContext(cb, cq, immunizationDirectoryPath)); + throw new UnsupportedOperationException("Method should no longer be used!"); } public List getIndexList(ImmunizationCriteria criteria, Integer first, Integer max, List sortProperties) { @@ -81,8 +80,7 @@ public List getIndexList(ImmunizationCriteria criteria, In final Join person = joins.getPerson(); - final Join location = person.join(Person.ADDRESS, JoinType.LEFT); - final Join district = location.join(Location.DISTRICT, JoinType.LEFT); + final Join district = joins.getPersonJoins().getAddressJoins().getDistrict(); final Join lastVaccineType = joins.getLastVaccineType(); @@ -106,7 +104,7 @@ public List getIndexList(ImmunizationCriteria criteria, In immunization.get(Immunization.END_DATE), lastVaccineType.get(LastVaccineType.VACCINE_TYPE), immunization.get(Immunization.RECOVERY_DATE), - JurisdictionHelper.booleanSelector(cb, createUserFilter(directoryImmunizationQueryContext)), + JurisdictionHelper.booleanSelector(cb, isInJurisdictionOrOwned(directoryImmunizationQueryContext)), immunization.get(Immunization.CHANGE_DATE)); buildWhereCondition(criteria, cb, cq, directoryImmunizationQueryContext); @@ -197,13 +195,13 @@ private void buildWhereCondition( private Predicate buildCriteriaFilter(ImmunizationCriteria criteria, DirectoryImmunizationQueryContext directoryImmunizationQueryContext) { - final DirectoryImmunizationJoins joins = (DirectoryImmunizationJoins) directoryImmunizationQueryContext.getJoins(); + final DirectoryImmunizationJoins joins = directoryImmunizationQueryContext.getJoins(); final CriteriaBuilder cb = directoryImmunizationQueryContext.getCriteriaBuilder(); final From from = directoryImmunizationQueryContext.getRoot(); final Join person = joins.getPerson(); final Join lastVaccineType = joins.getLastVaccineType(); - final Join location = person.join(Person.ADDRESS, JoinType.LEFT); + final Join location = joins.getPersonJoins().getAddress(); Predicate filter = null; if (criteria.getDisease() != null) { @@ -320,23 +318,29 @@ private Predicate createUserFilter(DirectoryImmunizationQueryContext qc) { } final CriteriaBuilder cb = qc.getCriteriaBuilder(); - Predicate filter; + Predicate filter = isInJurisdictionOrOwned(qc); + + if (currentUser.getLimitedDisease() != null) { + filter = CriteriaBuilderHelper.and(cb, filter, cb.equal(qc.getRoot().get(Contact.DISEASE), currentUser.getLimitedDisease())); + } + + return filter; + } + private Predicate isInJurisdictionOrOwned(DirectoryImmunizationQueryContext qc) { + final User currentUser = userService.getCurrentUser(); + CriteriaBuilder cb = qc.getCriteriaBuilder(); + Predicate filter; if (!featureConfigurationFacade.isPropertyValueTrue(FeatureType.IMMUNIZATION_MANAGEMENT, FeatureTypeProperty.REDUCED)) { filter = DirectoryImmunizationJurisdictionPredicateValidator.of(qc, currentUser).inJurisdictionOrOwned(); } else { filter = CriteriaBuilderHelper.or( - qc.getCriteriaBuilder(), - qc.getCriteriaBuilder().equal(qc.getRoot().get(Immunization.REPORTING_USER), currentUser), - PersonJurisdictionPredicateValidator - .of(qc.getQuery(), qc.getCriteriaBuilder(), new PersonJoins(qc.getJoins().getPerson()), currentUser, false) - .inJurisdictionOrOwned()); - } - - if (currentUser.getLimitedDisease() != null) { - filter = CriteriaBuilderHelper.and(cb, filter, cb.equal(qc.getRoot().get(Contact.DISEASE), currentUser.getLimitedDisease())); + cb, + cb.equal(qc.getRoot().get(Immunization.REPORTING_USER), currentUser), + PersonJurisdictionPredicateValidator + .of(qc.getQuery(), cb, new PersonJoins(qc.getJoins().getPerson()), currentUser, false) + .inJurisdictionOrOwned()); } - return filter; } } diff --git a/sormas-backend/src/main/java/de/symeda/sormas/backend/immunization/ImmunizationService.java b/sormas-backend/src/main/java/de/symeda/sormas/backend/immunization/ImmunizationService.java index 4c016f6edfb..539b561562e 100644 --- a/sormas-backend/src/main/java/de/symeda/sormas/backend/immunization/ImmunizationService.java +++ b/sormas-backend/src/main/java/de/symeda/sormas/backend/immunization/ImmunizationService.java @@ -119,7 +119,7 @@ public List getEntriesList(Long personId, Disease dise immunization.get(Immunization.START_DATE), immunization.get(Immunization.END_DATE), immunization.get(Immunization.CHANGE_DATE), - JurisdictionHelper.booleanSelector(cb, createUserFilter(immunizationQueryContext))); + JurisdictionHelper.booleanSelector(cb, isInJurisdictionOrOwned(immunizationQueryContext))); final Predicate criteriaFilter = buildCriteriaFilter(personId, disease, immunizationQueryContext); if (criteriaFilter != null) { @@ -135,6 +135,23 @@ public List getEntriesList(Long personId, Disease dise .getResultList(); } + private Predicate isInJurisdictionOrOwned(ImmunizationQueryContext qc) { + final User currentUser = userService.getCurrentUser(); + CriteriaBuilder cb = qc.getCriteriaBuilder(); + Predicate filter; + if (!featureConfigurationFacade.isPropertyValueTrue(FeatureType.IMMUNIZATION_MANAGEMENT, FeatureTypeProperty.REDUCED)) { + filter = ImmunizationJurisdictionPredicateValidator.of(qc, currentUser).inJurisdictionOrOwned(); + } else { + filter = CriteriaBuilderHelper.or( + cb, + cb.equal(qc.getRoot().get(Immunization.REPORTING_USER), currentUser), + PersonJurisdictionPredicateValidator + .of(qc.getQuery(), cb, new PersonJoins(qc.getJoins().getPerson()), currentUser, false) + .inJurisdictionOrOwned()); + } + return filter; + } + public boolean inJurisdictionOrOwned(Immunization immunization) { CriteriaBuilder cb = em.getCriteriaBuilder(); @@ -147,7 +164,7 @@ public boolean inJurisdictionOrOwned(Immunization immunization) { @Override public Predicate createUserFilter(CriteriaBuilder cb, CriteriaQuery cq, From immunizationPath) { - return createUserFilter(new ImmunizationQueryContext(cb, cq, immunizationPath)); + throw new UnsupportedOperationException("Method should no longer be used!"); } public Predicate createActiveImmunizationsFilter(CriteriaBuilder cb, From root) { @@ -191,11 +208,12 @@ public List getAllAfter(Date date, Integer batchSize, String lastS CriteriaBuilder cb = em.getCriteriaBuilder(); CriteriaQuery cq = cb.createQuery(getElementClass()); Root from = cq.from(getElementClass()); + ImmunizationQueryContext immunizationQueryContext = new ImmunizationQueryContext(cb, cq, from); Predicate filter = createDefaultFilter(cb, from); if (getCurrentUser() != null) { - Predicate userFilter = createUserFilter(cb, cq, from); + Predicate userFilter = createUserFilter(immunizationQueryContext); if (userFilter != null) { filter = cb.and(filter, userFilter); } @@ -230,8 +248,9 @@ public List getArchivedUuidsSince(Date since) { CriteriaBuilder cb = em.getCriteriaBuilder(); CriteriaQuery cq = cb.createQuery(String.class); Root from = cq.from(getElementClass()); + ImmunizationQueryContext immunizationQueryContext = new ImmunizationQueryContext(cb, cq, from); - Predicate filter = createUserFilter(cb, cq, from); + Predicate filter = createUserFilter(immunizationQueryContext); if (since != null) { Predicate dateFilter = cb.greaterThanOrEqualTo(from.get(Immunization.CHANGE_DATE), since); if (filter != null) { @@ -259,8 +278,9 @@ public List getDeletedUuidsSince(Date since) { CriteriaBuilder cb = em.getCriteriaBuilder(); CriteriaQuery cq = cb.createQuery(String.class); Root from = cq.from(getElementClass()); + ImmunizationQueryContext immunizationQueryContext = new ImmunizationQueryContext(cb, cq, from); - Predicate filter = createUserFilter(cb, cq, from); + Predicate filter = createUserFilter(immunizationQueryContext); if (since != null) { Predicate dateFilter = cb.greaterThanOrEqualTo(from.get(Immunization.CHANGE_DATE), since); if (filter != null) { @@ -466,26 +486,16 @@ public List getByPersonUuids(List personUuids) { return immunizations; } - private Predicate createUserFilter(ImmunizationQueryContext qc) { + public Predicate createUserFilter(ImmunizationQueryContext qc) { User currentUser = getCurrentUser(); if (currentUser == null) { return null; } - final CriteriaBuilder cb = qc.getCriteriaBuilder(); - Predicate filter; - if (!featureConfigurationFacade.isPropertyValueTrue(FeatureType.IMMUNIZATION_MANAGEMENT, FeatureTypeProperty.REDUCED)) { - filter = ImmunizationJurisdictionPredicateValidator.of(qc, currentUser).inJurisdictionOrOwned(); - } else { - filter = CriteriaBuilderHelper.or( - cb, - cb.equal(qc.getRoot().get(Immunization.REPORTING_USER), currentUser), - PersonJurisdictionPredicateValidator - .of(qc.getQuery(), cb, new PersonJoins(qc.getJoins().getPerson()), currentUser, false) - .inJurisdictionOrOwned()); - } + Predicate filter = isInJurisdictionOrOwned(qc); + final CriteriaBuilder cb = qc.getCriteriaBuilder(); if (currentUser.getLimitedDisease() != null) { filter = CriteriaBuilderHelper.and(cb, filter, cb.equal(qc.getRoot().get(Contact.DISEASE), currentUser.getLimitedDisease())); } diff --git a/sormas-backend/src/main/java/de/symeda/sormas/backend/person/PersonService.java b/sormas-backend/src/main/java/de/symeda/sormas/backend/person/PersonService.java index a2ba52a0133..39a6c26700c 100644 --- a/sormas-backend/src/main/java/de/symeda/sormas/backend/person/PersonService.java +++ b/sormas-backend/src/main/java/de/symeda/sormas/backend/person/PersonService.java @@ -55,6 +55,7 @@ import javax.transaction.Transactional; import javax.validation.constraints.NotNull; +import de.symeda.sormas.backend.immunization.ImmunizationQueryContext; import org.apache.commons.lang3.StringUtils; import de.symeda.sormas.api.Disease; @@ -464,7 +465,7 @@ public List getAllAfter(Date date, Integer batchSize, String lastSynchro Join immunizationPersonsSelect = immunizationPersonsRoot.join(Immunization.PERSON); immunizationPersonsSelect.fetch(Person.ADDRESS); immunizationPersonsQuery.select(immunizationPersonsSelect); - Predicate immunizationPersonsFilter = immunizationService.createUserFilter(cb, immunizationPersonsQuery, immunizationPersonsRoot); + Predicate immunizationPersonsFilter = immunizationService.createUserFilter(new ImmunizationQueryContext(cb, immunizationPersonsQuery, immunizationPersonsRoot)); // date range if (date != null) { Predicate dateFilter = createChangeDateFilter(cb, immunizationPersonsSelect, DateHelper.toTimestampUpper(date), lastSynchronizedUuid); From 951dd71695926ff44f752444a5540ba5bdb573df Mon Sep 17 00:00:00 2001 From: Bartha Barna Date: Wed, 20 Apr 2022 10:23:46 +0300 Subject: [PATCH 006/167] #8747 - reuse joins within user filter and criteria filter of ContactService --- .../backend/contact/ContactFacadeEjb.java | 9 +- .../contact/ContactListCriteriaBuilder.java | 2 +- .../backend/contact/ContactService.java | 121 +++++++++--------- .../sormas/backend/person/PersonService.java | 6 +- .../sormas/backend/sample/SampleService.java | 6 +- .../services/BaseTravelEntryService.java | 6 +- 6 files changed, 77 insertions(+), 73 deletions(-) diff --git a/sormas-backend/src/main/java/de/symeda/sormas/backend/contact/ContactFacadeEjb.java b/sormas-backend/src/main/java/de/symeda/sormas/backend/contact/ContactFacadeEjb.java index b606e9b0dbd..d69a6402fc8 100644 --- a/sormas-backend/src/main/java/de/symeda/sormas/backend/contact/ContactFacadeEjb.java +++ b/sormas-backend/src/main/java/de/symeda/sormas/backend/contact/ContactFacadeEjb.java @@ -1475,9 +1475,8 @@ public List getContactsForDashboard( Region region = regionService.getByReferenceDto(regionRef); District district = districtService.getByReferenceDto(districtRef); - User user = userService.getCurrentUser(); - return service.getContactsForDashboard(region, district, disease, from, to, user); + return service.getContactsForDashboard(region, district, disease, from, to); } @Override @@ -1495,15 +1494,13 @@ public Map getNewContactCountPerStatus(ContactCriteria cont @Override public Map getNewContactCountPerClassification(ContactCriteria contactCriteria) { - User user = userService.getCurrentUser(); - return service.getNewContactCountPerClassification(contactCriteria, user); + return service.getNewContactCountPerClassification(contactCriteria); } @Override public Map getNewContactCountPerFollowUpStatus(ContactCriteria contactCriteria) { - User user = userService.getCurrentUser(); - return service.getNewContactCountPerFollowUpStatus(contactCriteria, user); + return service.getNewContactCountPerFollowUpStatus(contactCriteria); } @Override diff --git a/sormas-backend/src/main/java/de/symeda/sormas/backend/contact/ContactListCriteriaBuilder.java b/sormas-backend/src/main/java/de/symeda/sormas/backend/contact/ContactListCriteriaBuilder.java index 7f231827906..922029ebcf9 100644 --- a/sormas-backend/src/main/java/de/symeda/sormas/backend/contact/ContactListCriteriaBuilder.java +++ b/sormas-backend/src/main/java/de/symeda/sormas/backend/contact/ContactListCriteriaBuilder.java @@ -293,7 +293,7 @@ public Predicate buildContactFilter(ContactCriteria contactCriteria, ContactQuer // Only use user filter if no restricting case is specified if (contactCriteria == null || contactCriteria.getCaze() == null) { - filter = contactService.createUserFilterForJoin(contactQueryContext, contactCriteria); + filter = contactService.createUserFilter(contactQueryContext, contactCriteria); } if (contactCriteria != null) { diff --git a/sormas-backend/src/main/java/de/symeda/sormas/backend/contact/ContactService.java b/sormas-backend/src/main/java/de/symeda/sormas/backend/contact/ContactService.java index 7ae981dfc8e..ae1fb095228 100644 --- a/sormas-backend/src/main/java/de/symeda/sormas/backend/contact/ContactService.java +++ b/sormas-backend/src/main/java/de/symeda/sormas/backend/contact/ContactService.java @@ -46,6 +46,7 @@ import javax.transaction.Transactional; import javax.validation.constraints.NotNull; +import de.symeda.sormas.backend.caze.CaseJoins; import org.apache.commons.lang3.StringUtils; import de.symeda.sormas.api.Disease; @@ -167,7 +168,7 @@ public List findBy(ContactCriteria contactCriteria, User user) { Predicate filter = buildCriteriaFilter(contactCriteria, contactQueryContext); if (user != null) { - filter = CriteriaBuilderHelper.and(cb, filter, createUserFilter(cb, cq, from)); + filter = CriteriaBuilderHelper.and(cb, filter, createUserFilter(contactQueryContext, contactCriteria)); } if (filter != null) { cq.where(filter); @@ -183,10 +184,11 @@ public List getAllAfter(Date date, Integer batchSize, String lastSynchr CriteriaQuery cq = cb.createQuery(getElementClass()); Root from = cq.from(getElementClass()); + ContactQueryContext contactQueryContext = new ContactQueryContext(cb, cq, from); Predicate filter = createActiveContactsFilter(cb, from); if (getCurrentUser() != null) { - Predicate userFilter = createUserFilter(cb, cq, from); + Predicate userFilter = createUserFilter(contactQueryContext, null); filter = CriteriaBuilderHelper.and(cb, filter, userFilter); } @@ -244,11 +246,12 @@ public List getAllActiveUuids(User user) { CriteriaBuilder cb = em.getCriteriaBuilder(); CriteriaQuery cq = cb.createQuery(String.class); Root from = cq.from(getElementClass()); + ContactQueryContext contactQueryContext = new ContactQueryContext(cb, cq, from); Predicate filter = createActiveContactsFilter(cb, from); if (user != null) { - Predicate userFilter = createUserFilter(cb, cq, from); + Predicate userFilter = createUserFilter(contactQueryContext, null); filter = CriteriaBuilderHelper.and(cb, filter, userFilter); } @@ -406,7 +409,8 @@ public List getArchivedUuidsSince(Date since) { CriteriaQuery cq = cb.createQuery(String.class); Root contact = cq.from(Contact.class); - Predicate filter = createUserFilter(cb, cq, contact); + ContactQueryContext contactQueryContext = new ContactQueryContext(cb, cq, contact); + Predicate filter = createUserFilter(contactQueryContext, null); if (since != null) { Predicate dateFilter = cb.greaterThanOrEqualTo(contact.get(Contact.CHANGE_DATE), since); if (filter != null) { @@ -434,8 +438,9 @@ public List getDeletedUuidsSince(User user, Date since) { CriteriaBuilder cb = em.getCriteriaBuilder(); CriteriaQuery cq = cb.createQuery(String.class); Root contact = cq.from(Contact.class); + ContactQueryContext contactQueryContext = new ContactQueryContext(cb, cq, contact); - Predicate filter = createUserFilter(cb, cq, contact); + Predicate filter = createUserFilter(contactQueryContext, null); if (since != null) { Predicate dateFilter = cb.greaterThanOrEqualTo(contact.get(Contact.CHANGE_DATE), since); if (filter != null) { @@ -462,11 +467,10 @@ public Long countContactsForMap(Region region, District district, Disease diseas CriteriaBuilder cb = em.getCriteriaBuilder(); CriteriaQuery cq = cb.createQuery(Long.class); Root contact = cq.from(getElementClass()); - Join caze = contact.join(Contact.CAZE, JoinType.LEFT); - Join personJoin = contact.join(Contact.PERSON, JoinType.LEFT); - Join contactPersonAddressJoin = personJoin.join(Person.ADDRESS, JoinType.LEFT); - Predicate filter = createMapContactsFilter(cb, cq, contact, caze, contactPersonAddressJoin, region, district, disease, from, to); + ContactQueryContext contactQueryContext = new ContactQueryContext(cb, cq, contact); + + Predicate filter = createMapContactsFilter(contactQueryContext, region, district, disease, from, to); if (filter != null) { cq.where(filter); @@ -483,13 +487,16 @@ public List getContactsForMap(Region region, District district, D CriteriaBuilder cb = em.getCriteriaBuilder(); CriteriaQuery cq = cb.createQuery(MapContactDto.class); Root contact = cq.from(getElementClass()); - Join person = contact.join(Contact.PERSON, JoinType.LEFT); - Join contactPersonAddress = person.join(Person.ADDRESS, JoinType.LEFT); - Join caze = contact.join(Contact.CAZE, JoinType.LEFT); - Join casePerson = caze.join(Case.PERSON, JoinType.LEFT); - Join symptoms = caze.join(Case.SYMPTOMS, JoinType.LEFT); + ContactQueryContext cqc = new ContactQueryContext(cb, cq, contact); - Predicate filter = createMapContactsFilter(cb, cq, contact, caze, contactPersonAddress, region, district, disease, from, to); + ContactJoins joins = cqc.getJoins(); + Join person = joins.getPerson(); + Join contactPersonAddress = joins.getAddress(); + Join caze = joins.getCaze(); + Join casePerson = joins.getCasePerson(); + Join symptoms = joins.getCaseJoins().getSymptoms(); + + Predicate filter = createMapContactsFilter(cqc, region, district, disease, from, to); List result; if (filter != null) { @@ -528,33 +535,36 @@ public List getContactsForMap(Region region, District district, D } private Predicate createMapContactsFilter( - CriteriaBuilder cb, - CriteriaQuery cq, - Root contactRoot, - Join cazeJoin, - Join contactPersonAddressJoin, + ContactQueryContext cqc, Region region, District district, Disease disease, Date from, Date to) { + + From contactRoot = cqc.getRoot(); + CriteriaBuilder cb = cqc.getCriteriaBuilder(); + ContactJoins joins = cqc.getJoins(); + Predicate filter = createActiveContactsFilter(cb, contactRoot); - filter = CriteriaBuilderHelper.and(cb, filter, createUserFilter(cb, cq, contactRoot)); + filter = CriteriaBuilderHelper.and(cb, filter, createUserFilter(cqc, null)); // Filter contacts by date; only consider contacts with reportdates within the given timeframe Predicate reportDateFilter = cb.between(contactRoot.get(Contact.REPORT_DATE_TIME), DateHelper.getStartOfDay(from), DateHelper.getEndOfDay(to)); filter = CriteriaBuilderHelper.and(cb, filter, reportDateFilter); - filter = CriteriaBuilderHelper.and(cb, filter, getRegionDistrictDiseasePredicate(region, district, disease, cb, contactRoot, cazeJoin)); + filter = CriteriaBuilderHelper.and(cb, filter, getRegionDistrictDiseasePredicate(region, district, disease, cb, contactRoot, joins.getCaze())); // Only retrieve contacts that are currently under follow-up Predicate followUpFilter = cb.equal(contactRoot.get(Contact.FOLLOW_UP_STATUS), FollowUpStatus.FOLLOW_UP); filter = CriteriaBuilderHelper.and(cb, filter, followUpFilter); // only retrieve contacts with given coordinates - Predicate personLatLonNotNull = CriteriaBuilderHelper - .and(cb, cb.isNotNull(contactPersonAddressJoin.get(Location.LONGITUDE)), cb.isNotNull(contactPersonAddressJoin.get(Location.LATITUDE))); + Predicate personLatLonNotNull = CriteriaBuilderHelper.and( + cb, + cb.isNotNull(joins.getPersonJoins().getAddress().get(Location.LONGITUDE)), + cb.isNotNull(joins.getPersonJoins().getAddress().get(Location.LATITUDE))); Predicate reportLatLonNotNull = CriteriaBuilderHelper.and(cb, cb.isNotNull(contactRoot.get(Contact.REPORT_LON)), cb.isNotNull(contactRoot.get(Contact.REPORT_LAT))); Predicate latLonProvided = CriteriaBuilderHelper.or(cb, personLatLonNotNull, reportLatLonNotNull); @@ -563,15 +573,16 @@ private Predicate createMapContactsFilter( return filter; } - public List getContactsForDashboard(Region region, District district, Disease disease, Date from, Date to, User user) { + public List getContactsForDashboard(Region region, District district, Disease disease, Date from, Date to) { CriteriaBuilder cb = em.getCriteriaBuilder(); CriteriaQuery cq = cb.createQuery(DashboardContactDto.class); Root contact = cq.from(getElementClass()); - Join caze = contact.join(Contact.CAZE, JoinType.LEFT); + ContactQueryContext cqc = new ContactQueryContext(cb, cq, contact); + Join caze = cqc.getJoins().getCaze(); Predicate filter = createDefaultFilter(cb, contact); - filter = CriteriaBuilderHelper.and(cb, filter, createUserFilter(cb, cq, contact)); + filter = CriteriaBuilderHelper.and(cb, filter, createUserFilter(cqc, null)); Predicate dateFilter = buildDateFilter(cb, contact, from, to); if (filter != null) { @@ -651,7 +662,7 @@ public Predicate getRegionDistrictDiseasePredicate( District district, Disease disease, CriteriaBuilder cb, - Root contact, + From contact, Join caze) { Predicate filter = null; @@ -687,7 +698,7 @@ public Map getNewContactCountPerStatus(ContactCriteria cont Root contact = cq.from(getElementClass()); final ContactQueryContext contactQueryContext = new ContactQueryContext(cb, cq, contact); - Predicate filter = createUserFilter(cb, cq, contact); + Predicate filter = createUserFilter(contactQueryContext, null); Predicate criteriaFilter = buildCriteriaFilter(contactCriteria, contactQueryContext); Predicate notDeleted = cb.isFalse(contact.get(Contact.DELETED)); if (filter != null) { @@ -707,14 +718,14 @@ public Map getNewContactCountPerStatus(ContactCriteria cont return results.stream().collect(Collectors.toMap(e -> (ContactStatus) e[0], e -> (Long) e[1])); } - public Map getNewContactCountPerClassification(ContactCriteria contactCriteria, User user) { + public Map getNewContactCountPerClassification(ContactCriteria contactCriteria) { CriteriaBuilder cb = em.getCriteriaBuilder(); CriteriaQuery cq = cb.createQuery(Object[].class); Root contact = cq.from(getElementClass()); final ContactQueryContext contactQueryContext = new ContactQueryContext(cb, cq, contact); - Predicate filter = createUserFilter(cb, cq, contact); + Predicate filter = createUserFilter(contactQueryContext, contactCriteria); Predicate criteriaFilter = buildCriteriaFilter(contactCriteria, contactQueryContext); Predicate notDeleted = cb.isFalse(contact.get(Contact.DELETED)); if (filter != null) { @@ -734,14 +745,14 @@ public Map getNewContactCountPerClassification(Cont return results.stream().collect(Collectors.toMap(e -> (ContactClassification) e[0], e -> (Long) e[1])); } - public Map getNewContactCountPerFollowUpStatus(ContactCriteria contactCriteria, User user) { + public Map getNewContactCountPerFollowUpStatus(ContactCriteria contactCriteria) { CriteriaBuilder cb = em.getCriteriaBuilder(); CriteriaQuery cq = cb.createQuery(Object[].class); Root contact = cq.from(getElementClass()); final ContactQueryContext contactQueryContext = new ContactQueryContext(cb, cq, contact); - Predicate filter = createUserFilter(cb, cq, contact); + Predicate filter = createUserFilter(contactQueryContext, null); Predicate criteriaFilter = buildCriteriaFilter(contactCriteria, contactQueryContext); Predicate notDeleted = cb.isFalse(contact.get(Contact.DELETED)); if (filter != null) { @@ -768,7 +779,7 @@ public int getFollowUpUntilCount(ContactCriteria contactCriteria, User user) { Root contact = cq.from(getElementClass()); final ContactQueryContext contactQueryContext = new ContactQueryContext(cb, cq, contact); - Predicate filter = createUserFilter(cb, cq, contact); + Predicate filter = createUserFilter(contactQueryContext, null); Predicate criteriaFilter = buildCriteriaFilter(contactCriteria, contactQueryContext); if (filter != null) { filter = cb.and(filter, criteriaFilter); @@ -944,22 +955,13 @@ public List getAllByVisit(Visit visit) { return em.createQuery(cq).getResultList(); } - /** - * @see /sormas-backend/doc/UserDataAccess.md - */ @SuppressWarnings("rawtypes") - @Override public Predicate createUserFilter(CriteriaBuilder cb, CriteriaQuery cq, From contactPath) { - return createUserFilterForJoin(cb, cq, contactPath); - } - - @SuppressWarnings("rawtypes") - public Predicate createUserFilterForJoin(CriteriaBuilder cb, CriteriaQuery cq, From contactPath) { - return createUserFilterForJoin(new ContactQueryContext(cb, cq, contactPath), null); + return createUserFilter(new ContactQueryContext(cb, cq, contactPath), null); } @SuppressWarnings("rawtypes") - public Predicate createUserFilterForJoin(ContactQueryContext contactQueryContext, ContactCriteria contactCriteria) { + public Predicate createUserFilter(ContactQueryContext contactQueryContext, ContactCriteria contactCriteria) { Predicate userFilter = null; @@ -968,10 +970,10 @@ public Predicate createUserFilterForJoin(ContactQueryContext contactQueryContext From contactPath = contactQueryContext.getRoot(); if (contactCriteria == null || contactCriteria.getIncludeContactsFromOtherJurisdictions()) { - userFilter = caseService.createUserFilter(cb, cq, ((ContactJoins) contactQueryContext.getJoins()).getCaze()); + userFilter = caseService.createUserFilter(cb, cq, contactQueryContext.getJoins().getCaze()); } else { CaseUserFilterCriteria userFilterCriteria = new CaseUserFilterCriteria(); - userFilter = caseService.createUserFilter(cb, cq, ((ContactJoins) contactQueryContext.getJoins()).getCaze(), userFilterCriteria); + userFilter = caseService.createUserFilter(cb, cq, contactQueryContext.getJoins().getCaze(), userFilterCriteria); } Predicate filter; @@ -1057,14 +1059,15 @@ public Predicate createUserFilterWithoutCase(ContactQueryContext qc, ContactCrit return filter; } - public Predicate buildCriteriaFilter(ContactCriteria contactCriteria, ContactQueryContext contactQueryContext) { + public Predicate buildCriteriaFilter(ContactCriteria contactCriteria, ContactQueryContext cqc) { - final ContactJoins joins = (ContactJoins) contactQueryContext.getJoins(); - final CriteriaBuilder cb = contactQueryContext.getCriteriaBuilder(); - final From from = contactQueryContext.getRoot(); + final ContactJoins joins = cqc.getJoins(); + final CriteriaBuilder cb = cqc.getCriteriaBuilder(); + final From from = cqc.getRoot(); Predicate filter = null; Join caze = joins.getCaze(); + CaseJoins caseJoins = joins.getCaseJoins(); Join resultingCase = joins.getResultingCase(); if (contactCriteria.getReportingUserRole() != null) { @@ -1088,7 +1091,7 @@ public Predicate buildCriteriaFilter(ContactCriteria contactCriteria, ContactQue cb.equal(joins.getRegion().get(Region.UUID), contactCriteria.getRegion().getUuid()), cb.and( cb.isNull(from.get(Contact.REGION)), - cb.equal(caze.join(Case.REGION, JoinType.LEFT).get(Region.UUID), contactCriteria.getRegion().getUuid())))); + cb.equal(caseJoins.getRegion().get(Region.UUID), contactCriteria.getRegion().getUuid())))); } if (contactCriteria.getDistrict() != null) { filter = CriteriaBuilderHelper.and( @@ -1098,7 +1101,7 @@ public Predicate buildCriteriaFilter(ContactCriteria contactCriteria, ContactQue cb.equal(joins.getDistrict().get(District.UUID), contactCriteria.getDistrict().getUuid()), cb.and( cb.isNull(from.get(Contact.DISTRICT)), - cb.equal(caze.join(Case.DISTRICT, JoinType.LEFT).get(District.UUID), contactCriteria.getDistrict().getUuid())))); + cb.equal(caseJoins.getDistrict().get(District.UUID), contactCriteria.getDistrict().getUuid())))); } if (contactCriteria.getCommunity() != null) { filter = CriteriaBuilderHelper.and( @@ -1108,7 +1111,7 @@ public Predicate buildCriteriaFilter(ContactCriteria contactCriteria, ContactQue cb.equal(joins.getCommunity().get(Community.UUID), contactCriteria.getCommunity().getUuid()), cb.and( cb.isNull(from.get(Contact.COMMUNITY)), - cb.equal(caze.join(Case.COMMUNITY, JoinType.LEFT).get(Community.UUID), contactCriteria.getCommunity().getUuid())))); + cb.equal(caseJoins.getCommunity().get(Community.UUID), contactCriteria.getCommunity().getUuid())))); } if (contactCriteria.getContactOfficer() != null) { filter = CriteriaBuilderHelper @@ -1243,7 +1246,7 @@ public Predicate buildCriteriaFilter(ContactCriteria contactCriteria, ContactQue CriteriaBuilderHelper.ilikePrecise(cb, person.get(Person.UUID), textFilter + "%"), CriteriaBuilderHelper.unaccentedIlike(cb, person.get(Person.FIRST_NAME), textFilter), CriteriaBuilderHelper.unaccentedIlike(cb, person.get(Person.LAST_NAME), textFilter), - phoneNumberPredicate(cb, contactQueryContext.getSubqueryExpression(ContactQueryContext.PERSON_PHONE_SUBQUERY), textFilter), + phoneNumberPredicate(cb, cqc.getSubqueryExpression(ContactQueryContext.PERSON_PHONE_SUBQUERY), textFilter), CriteriaBuilderHelper.unaccentedIlike(cb, location.get(Location.CITY), textFilter), CriteriaBuilderHelper.ilike(cb, location.get(Location.POSTAL_CODE), textFilter))); @@ -1251,7 +1254,7 @@ public Predicate buildCriteriaFilter(ContactCriteria contactCriteria, ContactQue } if (contactCriteria.getContactOrCaseLike() != null) { - Join casePerson = caze.join(Case.PERSON, JoinType.LEFT); + Join casePerson = joins.getCasePerson(); String[] textFilters = contactCriteria.getContactOrCaseLike().split("\\s+"); for (String textFilter : textFilters) { if (DataHelper.isNullOrEmpty(textFilter)) { @@ -1271,7 +1274,7 @@ public Predicate buildCriteriaFilter(ContactCriteria contactCriteria, ContactQue CriteriaBuilderHelper.ilikePrecise(cb, casePerson.get(Person.UUID), textFilter + "%"), CriteriaBuilderHelper.unaccentedIlike(cb, casePerson.get(Person.FIRST_NAME), textFilter), CriteriaBuilderHelper.unaccentedIlike(cb, casePerson.get(Person.LAST_NAME), textFilter), - phoneNumberPredicate(cb, contactQueryContext.getSubqueryExpression(CaseQueryContext.PERSON_PHONE_SUBQUERY), textFilter)); + phoneNumberPredicate(cb, cqc.getSubqueryExpression(CaseQueryContext.PERSON_PHONE_SUBQUERY), textFilter)); filter = CriteriaBuilderHelper.and(cb, filter, likeFilters); } } @@ -1356,7 +1359,7 @@ public Predicate buildCriteriaFilter(ContactCriteria contactCriteria, ContactQue cb.equal(joins.getCaseEvent().get(Event.UUID), contactCriteria.getOnlyContactsWithSourceCaseInGivenEvent().getUuid())); } if (Boolean.TRUE.equals(contactCriteria.getOnlyContactsFromOtherInstances())) { - Subquery sharesSubQuery = contactQueryContext.getQuery().subquery(Long.class); + Subquery sharesSubQuery = cqc.getQuery().subquery(Long.class); Root sharesRoot = sharesSubQuery.from(SormasToSormasShareInfo.class); sharesSubQuery.where(cb.equal(sharesRoot.get(SormasToSormasShareInfo.CONTACT), from)); sharesSubQuery.select(sharesRoot.get(SormasToSormasShareInfo.ID)); @@ -1467,7 +1470,7 @@ private void deleteContactFromDuplicateOf(Contact contact) { * {@link DeletableAdo#isDeleted()} or associated with cases that are * {@link Case#isArchived()}. */ - public Predicate createActiveContactsFilter(CriteriaBuilder cb, Root root) { + public Predicate createActiveContactsFilter(CriteriaBuilder cb, From root) { return cb.and(cb.isFalse(root.get(Contact.ARCHIVED)), cb.isFalse(root.get(Contact.DELETED))); } diff --git a/sormas-backend/src/main/java/de/symeda/sormas/backend/person/PersonService.java b/sormas-backend/src/main/java/de/symeda/sormas/backend/person/PersonService.java index 39a6c26700c..b89e73b2deb 100644 --- a/sormas-backend/src/main/java/de/symeda/sormas/backend/person/PersonService.java +++ b/sormas-backend/src/main/java/de/symeda/sormas/backend/person/PersonService.java @@ -255,7 +255,7 @@ public Predicate createUserFilter(PersonQueryContext personQueryContext, PersonC caseService.createUserFilter(cb, cq, joins.getCaze(), new CaseUserFilterCriteria()), caseService.createDefaultFilter(cb, joins.getCaze())); final Supplier contactFilter = () -> { - final Predicate contactUserFilter = contactService.createUserFilterForJoin( + final Predicate contactUserFilter = contactService.createUserFilter( new ContactQueryContext(cb, cq, joins.getContactJoins()), new ContactCriteria().includeContactsFromOtherJurisdictions(false)); return CriteriaBuilderHelper.and(cb, contactUserFilter, contactService.createDefaultFilter(cb, joins.getContact())); @@ -561,9 +561,11 @@ public List getSimilarPersonDtos(PersonSimilarityCriteria crit boolean activeEntriesOnly = configFacade.isDuplicateChecksExcludePersonsOfArchivedEntries(); CriteriaBuilder cb = em.getCriteriaBuilder(); - CriteriaQuery personQuery = cb.createQuery(Person.class); Root personRoot = personQuery.from(Person.class); + + // todo continue here + Join personCaseJoin = personRoot.join(Person.CASES, JoinType.LEFT); Join personContactJoin = personRoot.join(Person.CONTACTS, JoinType.LEFT); Join personEventParticipantJoin = personRoot.join(Person.EVENT_PARTICIPANTS, JoinType.LEFT); diff --git a/sormas-backend/src/main/java/de/symeda/sormas/backend/sample/SampleService.java b/sormas-backend/src/main/java/de/symeda/sormas/backend/sample/SampleService.java index cd0d81f85cf..3aeda764ed6 100644 --- a/sormas-backend/src/main/java/de/symeda/sormas/backend/sample/SampleService.java +++ b/sormas-backend/src/main/java/de/symeda/sormas/backend/sample/SampleService.java @@ -634,7 +634,7 @@ public Predicate createUserFilter(SampleQueryContext sampleQueryContext, SampleC if (sampleAssociationType == SampleAssociationType.CASE) { filter = CriteriaBuilderHelper.or(cb, filter, caseService.createUserFilter(cb, cq, joins.getCaze(), null)); } else if (sampleAssociationType == SampleAssociationType.CONTACT) { - filter = CriteriaBuilderHelper.or(cb, filter, contactService.createUserFilterForJoin(cb, cq, joins.getContact())); + filter = CriteriaBuilderHelper.or(cb, filter, contactService.createUserFilter(cb, cq, joins.getContact())); } else if (sampleAssociationType == SampleAssociationType.EVENT_PARTICIPANT) { filter = CriteriaBuilderHelper.or(cb, filter, eventParticipantService.createUserFilterForJoin(cb, cq, joins.getEventParticipant())); } @@ -645,14 +645,14 @@ public Predicate createUserFilter(SampleQueryContext sampleQueryContext, SampleC CriteriaBuilderHelper.or( cb, caseService.createUserFilter(cb, cq, joins.getCaze(), null), - contactService.createUserFilterForJoin(cb, cq, joins.getContact()), + contactService.createUserFilter(cb, cq, joins.getContact()), eventParticipantService.createUserFilterForJoin(cb, cq, joins.getEventParticipant()))); } else { filter = CriteriaBuilderHelper.or( cb, filter, caseService.createUserFilter(cb, cq, joins.getCaze(), null), - contactService.createUserFilterForJoin(cb, cq, joins.getContact()), + contactService.createUserFilter(cb, cq, joins.getContact()), eventParticipantService.createUserFilterForJoin(cb, cq, joins.getEventParticipant())); } diff --git a/sormas-backend/src/main/java/de/symeda/sormas/backend/travelentry/services/BaseTravelEntryService.java b/sormas-backend/src/main/java/de/symeda/sormas/backend/travelentry/services/BaseTravelEntryService.java index 98fec60a283..8648070a441 100644 --- a/sormas-backend/src/main/java/de/symeda/sormas/backend/travelentry/services/BaseTravelEntryService.java +++ b/sormas-backend/src/main/java/de/symeda/sormas/backend/travelentry/services/BaseTravelEntryService.java @@ -36,7 +36,8 @@ public BaseTravelEntryService() { @Override public Predicate createUserFilter(CriteriaBuilder cb, CriteriaQuery cq, From travelEntryPath) { - return createUserFilter(new TravelEntryQueryContext(cb, cq, travelEntryPath)); +// return createUserFilter(new TravelEntryQueryContext(cb, cq, travelEntryPath)); + throw new UnsupportedOperationException("Method should no longer be used!"); } public Predicate inJurisdictionOrOwned(TravelEntryQueryContext qc, User user) { @@ -70,9 +71,10 @@ public List getAllActiveAfter(Date date) { Root from = cq.from(getElementClass()); Predicate filter = createDefaultFilter(cb, from); + TravelEntryQueryContext travelEntryQueryContext = new TravelEntryQueryContext(cb, cq, from); if (getCurrentUser() != null) { - Predicate userFilter = createUserFilter(cb, cq, from); + Predicate userFilter = createUserFilter(travelEntryQueryContext); if (userFilter != null) { filter = cb.and(filter, userFilter); } From 5de3b948b3ed64703d35fb39158b55955c4070b7 Mon Sep 17 00:00:00 2001 From: Stefan Kock Date: Tue, 19 Apr 2022 18:55:23 +0200 Subject: [PATCH 007/167] #8747: Created needed signatures for EventService.createUserFilter --- .../sormas/backend/event/EventFacadeEjb.java | 5 +-- .../sormas/backend/event/EventJoins.java | 23 +++++++++-- .../event/EventParticipantService.java | 12 +++--- .../sormas/backend/event/EventService.java | 40 +++++++------------ 4 files changed, 43 insertions(+), 37 deletions(-) diff --git a/sormas-backend/src/main/java/de/symeda/sormas/backend/event/EventFacadeEjb.java b/sormas-backend/src/main/java/de/symeda/sormas/backend/event/EventFacadeEjb.java index 2b0f07dd958..d99421c8317 100644 --- a/sormas-backend/src/main/java/de/symeda/sormas/backend/event/EventFacadeEjb.java +++ b/sormas-backend/src/main/java/de/symeda/sormas/backend/event/EventFacadeEjb.java @@ -17,8 +17,6 @@ *******************************************************************************/ package de.symeda.sormas.backend.event; -import static de.symeda.sormas.backend.sormastosormas.entities.event.SormasToSormasEventFacadeEjb.SormasToSormasEventFacadeEjbLocal; - import java.sql.Timestamp; import java.time.LocalDate; import java.util.ArrayList; @@ -112,6 +110,7 @@ import de.symeda.sormas.backend.share.ExternalShareInfoCountAndLatestDate; import de.symeda.sormas.backend.share.ExternalShareInfoService; import de.symeda.sormas.backend.sormastosormas.SormasToSormasFacadeEjb.SormasToSormasFacadeEjbLocal; +import de.symeda.sormas.backend.sormastosormas.entities.event.SormasToSormasEventFacadeEjb.SormasToSormasEventFacadeEjbLocal; import de.symeda.sormas.backend.sormastosormas.origin.SormasToSormasOriginInfoFacadeEjb; import de.symeda.sormas.backend.sormastosormas.origin.SormasToSormasOriginInfoFacadeEjb.SormasToSormasOriginInfoFacadeEjbLocal; import de.symeda.sormas.backend.sormastosormas.share.shareinfo.ShareInfoHelper; @@ -418,7 +417,7 @@ public List getIndexList(EventCriteria eventCriteria, Integer fir if (eventCriteria.getUserFilterIncluded()) { EventUserFilterCriteria eventUserFilterCriteria = new EventUserFilterCriteria(); eventUserFilterCriteria.includeUserCaseAndEventParticipantFilter(true); - filter = service.createUserFilter(cb, cq, event, eventUserFilterCriteria); + filter = service.createUserFilter(eventQueryContext, eventUserFilterCriteria); } Predicate criteriaFilter = service.buildCriteriaFilter(eventCriteria, eventQueryContext); diff --git a/sormas-backend/src/main/java/de/symeda/sormas/backend/event/EventJoins.java b/sormas-backend/src/main/java/de/symeda/sormas/backend/event/EventJoins.java index 4d0ff653f60..ce079117f01 100644 --- a/sormas-backend/src/main/java/de/symeda/sormas/backend/event/EventJoins.java +++ b/sormas-backend/src/main/java/de/symeda/sormas/backend/event/EventJoins.java @@ -15,6 +15,8 @@ package de.symeda.sormas.backend.event; +import java.util.Objects; + import javax.persistence.criteria.From; import javax.persistence.criteria.Join; import javax.persistence.criteria.JoinType; @@ -35,7 +37,7 @@ public class EventJoins extends QueryJoins { private Join reportingUser; private Join responsibleUser; private Join location; - private Join eventParticipants; + private From eventParticipants; private Join eventGroup; private Join superordinateEvent; @@ -46,6 +48,15 @@ public EventJoins(From event) { super(event); } + /** + * For use cases where the EventParticipant is the origin for the query + */ + public EventJoins(From eventParticipants, From event) { + this(event); + Objects.requireNonNull(eventParticipants); + this.eventParticipants = eventParticipants; + } + public Join getReportingUser() { return getOrCreate(reportingUser, Event.REPORTING_USER, JoinType.LEFT, this::setReportingUser); } @@ -86,11 +97,15 @@ public Join getFacility() { return getLocationJoins().getFacility(); } - public Join getEventParticipants() { - return getOrCreate(eventParticipants, Event.EVENT_PERSONS, JoinType.LEFT, this::setEventParticipants); + public From getEventParticipants() { + + if (eventParticipants == null) { + setEventParticipants(getRoot().join(Event.EVENT_PERSONS, JoinType.LEFT)); + } + return eventParticipants; } - private void setEventParticipants(Join eventParticipants) { + private void setEventParticipants(From eventParticipants) { this.eventParticipants = eventParticipants; } diff --git a/sormas-backend/src/main/java/de/symeda/sormas/backend/event/EventParticipantService.java b/sormas-backend/src/main/java/de/symeda/sormas/backend/event/EventParticipantService.java index 2cecd9dcd5e..322f0bf36ef 100644 --- a/sormas-backend/src/main/java/de/symeda/sormas/backend/event/EventParticipantService.java +++ b/sormas-backend/src/main/java/de/symeda/sormas/backend/event/EventParticipantService.java @@ -278,7 +278,10 @@ public Predicate createUserFilterForJoin( CriteriaQuery cq, From eventParticipantPath, EventUserFilterCriteria eventUserFilterCriteria) { - return eventService.createUserFilter(cb, cq, null, eventParticipantPath, eventUserFilterCriteria); + + return eventService.createUserFilter( + new EventQueryContext(cb, cq, new EventJoins(eventParticipantPath, eventParticipantPath.join(EventParticipant.EVENT, JoinType.LEFT))), + eventUserFilterCriteria); } public List getAllByPerson(Person person) { @@ -370,14 +373,13 @@ public List getDeletedUuidsSince(Date since, User user) { CriteriaBuilder cb = em.getCriteriaBuilder(); CriteriaQuery cq = cb.createQuery(String.class); Root eventParticipantRoot = cq.from(EventParticipant.class); - Join event = eventParticipantRoot.join(EventParticipant.EVENT, JoinType.LEFT); - EventUserFilterCriteria eventUserFilterCriteria = new EventUserFilterCriteria(); eventUserFilterCriteria.includeUserCaseAndEventParticipantFilter(true); eventUserFilterCriteria.forceRegionJurisdiction(true); - Predicate filter = - eventService.createUserFilter(cb, cq, eventParticipantRoot.join(EventParticipant.EVENT, JoinType.LEFT), eventUserFilterCriteria); + Predicate filter = eventService.createUserFilter( + new EventQueryContext(cb, cq, new EventJoins(eventParticipantRoot, eventParticipantRoot.join(EventParticipant.EVENT, JoinType.LEFT))), + eventUserFilterCriteria); if (since != null) { Predicate dateFilter = createChangeDateFilter(cb, eventParticipantRoot, since); diff --git a/sormas-backend/src/main/java/de/symeda/sormas/backend/event/EventService.java b/sormas-backend/src/main/java/de/symeda/sormas/backend/event/EventService.java index 5bd0166a7a1..ad2b2cc0c0b 100644 --- a/sormas-backend/src/main/java/de/symeda/sormas/backend/event/EventService.java +++ b/sormas-backend/src/main/java/de/symeda/sormas/backend/event/EventService.java @@ -333,25 +333,23 @@ public List getDeletedUuidsSince(Date since) { @SuppressWarnings("rawtypes") @Override public Predicate createUserFilter(CriteriaBuilder cb, CriteriaQuery cq, From eventPath) { - return createUserFilter(cb, cq, eventPath, null); + return createUserFilter(new EventQueryContext(cb, cq, new EventJoins(eventPath))); } @SuppressWarnings("rawtypes") - public Predicate createUserFilter( + private Predicate createUserFilter( final CriteriaBuilder cb, final CriteriaQuery cq, final From eventPath, final EventUserFilterCriteria eventUserFilterCriteria) { - return createUserFilter(cb, cq, eventPath, null, eventUserFilterCriteria); + return createUserFilter(new EventQueryContext(cb, cq, new EventJoins(eventPath)), eventUserFilterCriteria); } - @SuppressWarnings("rawtypes") - public Predicate createUserFilter( - final CriteriaBuilder cb, - final CriteriaQuery cq, - final From eventPath, - final From eventParticipantPath, - final EventUserFilterCriteria eventUserFilterCriteria) { + public Predicate createUserFilter(EventQueryContext queryContext) { + return createUserFilter(queryContext, null); + } + + public Predicate createUserFilter(final EventQueryContext queryContext, final EventUserFilterCriteria eventUserFilterCriteria) { User currentUser = getCurrentUser(); if (currentUser == null) { @@ -360,20 +358,12 @@ public Predicate createUserFilter( final JurisdictionLevel jurisdictionLevel = currentUser.getJurisdictionLevel(); Predicate filter = null; - final EventJoins eventJoins; - final From eventJoin; - final From eventParticipantJoin; - if (eventPath != null && eventParticipantPath != null) { - throw new UnsupportedOperationException("Wrong usage of event service user filter!"); - } else if (eventPath != null) { - eventJoins = new EventJoins(eventPath); - eventJoin = eventPath; - eventParticipantJoin = eventJoins.getEventParticipants(); - } else { - eventJoins = new EventJoins(eventParticipantPath.join(EventParticipant.EVENT, JoinType.LEFT)); - eventJoin = eventJoins.getRoot(); - eventParticipantJoin = eventParticipantPath; - } + @SuppressWarnings("rawtypes") + final CriteriaQuery cq = queryContext.getQuery(); + final CriteriaBuilder cb = queryContext.getCriteriaBuilder(); + final EventJoins eventJoins = queryContext.getJoins(); + final From eventJoin = queryContext.getRoot(); + final From eventParticipantJoin = eventJoins.getEventParticipants(); if (jurisdictionLevel != JurisdictionLevel.NATION && !currentUser.hasUserRole(UserRole.REST_USER)) { switch (jurisdictionLevel) { @@ -636,7 +626,7 @@ public Predicate buildCriteriaFilter(EventCriteria eventCriteria, EventQueryCont } } if (StringUtils.isNotEmpty(eventCriteria.getFreeTextEventParticipants())) { - Join eventParticipantJoin = joins.getEventParticipants(); + From eventParticipantJoin = joins.getEventParticipants(); Join personJoin = joins.getEventParticipantPersons(); final PersonQueryContext personQueryContext = new PersonQueryContext(cb, eventQueryContext.getQuery(), personJoin); From 9851bbdbc240b0b749a5c25724c0092851bc10e0 Mon Sep 17 00:00:00 2001 From: Stefan Kock Date: Tue, 19 Apr 2022 14:30:54 +0200 Subject: [PATCH 008/167] #8747: Refactoring: Internalized JoinType for ActionJoins.getEvent --- .../java/de/symeda/sormas/backend/action/ActionJoins.java | 8 +++++--- .../de/symeda/sormas/backend/action/ActionService.java | 6 +++--- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/sormas-backend/src/main/java/de/symeda/sormas/backend/action/ActionJoins.java b/sormas-backend/src/main/java/de/symeda/sormas/backend/action/ActionJoins.java index eeb8bf04477..f255fe8b7be 100644 --- a/sormas-backend/src/main/java/de/symeda/sormas/backend/action/ActionJoins.java +++ b/sormas-backend/src/main/java/de/symeda/sormas/backend/action/ActionJoins.java @@ -38,8 +38,10 @@ public ActionJoins(From root) { super(root); } - public Join getEvent(JoinType joinType) { - return getOrCreate(event, Action.EVENT, joinType, this::setEvent); + public Join getEvent() { + + // Despite the usual pattern this is intended to be an INNER join (currently Actions only belong to Events) + return getOrCreate(event, Action.EVENT, JoinType.INNER, this::setEvent); } private void setEvent(Join event) { @@ -47,7 +49,7 @@ private void setEvent(Join event) { } public EventJoins getEventJoins() { - return getOrCreate(eventJoins, () -> new EventJoins(getEvent(JoinType.INNER)), this::setEventJoins); + return getOrCreate(eventJoins, () -> new EventJoins(getEvent()), this::setEventJoins); } private void setEventJoins(EventJoins eventJoins) { diff --git a/sormas-backend/src/main/java/de/symeda/sormas/backend/action/ActionService.java b/sormas-backend/src/main/java/de/symeda/sormas/backend/action/ActionService.java index 64d0790a8b4..121bc091459 100644 --- a/sormas-backend/src/main/java/de/symeda/sormas/backend/action/ActionService.java +++ b/sormas-backend/src/main/java/de/symeda/sormas/backend/action/ActionService.java @@ -272,7 +272,7 @@ public List getEventActionIndexList(EventCriteria criteria, Join lastModifiedBy = actionJoins.getLastModifiedBy(); Join creatorUser = actionJoins.getCreator(); - Join event = actionJoins.getEvent(JoinType.INNER); + Join event = actionJoins.getEvent(); Join eventReportingUser = event.join(Event.REPORTING_USER, JoinType.LEFT); Join eventResponsibleUser = event.join(Event.RESPONSIBLE_USER, JoinType.LEFT); @@ -419,7 +419,7 @@ public List getEventActionExportList(EventCriteria criteri ActionJoins actionJoins = (ActionJoins) actionQueryContext.getJoins(); Join lastModifiedBy = actionJoins.getLastModifiedBy(); Join creator = actionJoins.getCreator(); - Join event = actionJoins.getEvent(JoinType.INNER); + Join event = actionJoins.getEvent(); Join eventReportingUser = event.join(Event.REPORTING_USER, JoinType.LEFT); Join eventResponsibleUser = event.join(Event.RESPONSIBLE_USER, JoinType.LEFT); @@ -482,7 +482,7 @@ public long countEventActions(EventCriteria criteria) { final ActionQueryContext actionQueryContext = new ActionQueryContext(cb, cq, action); ActionJoins actionJoins = (ActionJoins) actionQueryContext.getJoins(); - Join event = actionJoins.getEvent(JoinType.INNER); + Join event = actionJoins.getEvent(); // Add filters Predicate filter = eventService.createUserFilter(cb, cq, event); From f39119844c7b4219b8b0f2c88fd021afc4a928c5 Mon Sep 17 00:00:00 2001 From: Stefan Kock Date: Tue, 19 Apr 2022 14:37:16 +0200 Subject: [PATCH 009/167] #8747: Cleanup: Warnings fixed, technical package removed, casts removed --- .../sormas/backend/action/ActionService.java | 21 ++++++++++--------- ...EventActionIndexDtoReasultTransformer.java | 5 ++++- 2 files changed, 15 insertions(+), 11 deletions(-) rename sormas-backend/src/main/java/de/symeda/sormas/backend/action/{transformers => }/EventActionIndexDtoReasultTransformer.java (94%) diff --git a/sormas-backend/src/main/java/de/symeda/sormas/backend/action/ActionService.java b/sormas-backend/src/main/java/de/symeda/sormas/backend/action/ActionService.java index 121bc091459..2bca6840ad8 100644 --- a/sormas-backend/src/main/java/de/symeda/sormas/backend/action/ActionService.java +++ b/sormas-backend/src/main/java/de/symeda/sormas/backend/action/ActionService.java @@ -41,11 +41,9 @@ import de.symeda.sormas.api.user.JurisdictionLevel; import de.symeda.sormas.api.user.UserRole; import de.symeda.sormas.api.utils.SortProperty; -import de.symeda.sormas.backend.action.transformers.EventActionIndexDtoReasultTransformer; import de.symeda.sormas.backend.common.AdoServiceWithUserFilter; import de.symeda.sormas.backend.common.CriteriaBuilderHelper; import de.symeda.sormas.backend.event.Event; -import de.symeda.sormas.backend.event.EventParticipant; import de.symeda.sormas.backend.event.EventQueryContext; import de.symeda.sormas.backend.event.EventService; import de.symeda.sormas.backend.user.User; @@ -89,9 +87,9 @@ public List getAllByEvent(Event event) { CriteriaQuery cq = cb.createQuery(getElementClass()); Root from = cq.from(getElementClass()); - Predicate filter = cb.equal(from.get(EventParticipant.EVENT), event); + Predicate filter = cb.equal(from.get(Action.EVENT), event); cq.where(filter); - cq.orderBy(cb.desc(from.get(EventParticipant.CREATION_DATE))); + cq.orderBy(cb.desc(from.get(Action.CREATION_DATE))); return em.createQuery(cq).getResultList(); } @@ -229,11 +227,12 @@ public Predicate buildCriteriaFilter(ActionCriteria actionCriteria, CriteriaBuil public Predicate buildEventCriteriaFilter(EventCriteria criteria, ActionQueryContext actionQueryContext) { CriteriaBuilder cb = actionQueryContext.getCriteriaBuilder(); - ActionJoins joins = (ActionJoins) actionQueryContext.getJoins(); + ActionJoins joins = actionQueryContext.getJoins(); From action = joins.getRoot(); - Predicate filter = eventService.buildCriteriaFilter(criteria, new EventQueryContext(cb, actionQueryContext.getQuery(), joins.getEventJoins())); + Predicate filter = + eventService.buildCriteriaFilter(criteria, new EventQueryContext(cb, actionQueryContext.getQuery(), joins.getEventJoins())); if (criteria.getActionChangeDateFrom() != null && criteria.getActionChangeDateTo() != null) { filter = CriteriaBuilderHelper @@ -268,7 +267,7 @@ public List getEventActionIndexList(EventCriteria criteria, final Root action = cq.from(getElementClass()); final ActionQueryContext actionQueryContext = new ActionQueryContext(cb, cq, action); - ActionJoins actionJoins = (ActionJoins) actionQueryContext.getJoins(); + ActionJoins actionJoins = actionQueryContext.getJoins(); Join lastModifiedBy = actionJoins.getLastModifiedBy(); Join creatorUser = actionJoins.getCreator(); @@ -405,9 +404,11 @@ public List getEventActionIndexList(EventCriteria criteria, cq.orderBy(cb.desc(event.get(Event.CHANGE_DATE))); } - return createQuery(cq, first, max).unwrap(org.hibernate.query.Query.class) + @SuppressWarnings("unchecked") + List result = createQuery(cq, first, max).unwrap(org.hibernate.query.Query.class) .setResultTransformer(new EventActionIndexDtoReasultTransformer()) .getResultList(); + return result; } public List getEventActionExportList(EventCriteria criteria, Integer first, Integer max) { @@ -416,7 +417,7 @@ public List getEventActionExportList(EventCriteria criteri CriteriaQuery cq = cb.createQuery(EventActionExportDto.class); Root action = cq.from(getElementClass()); final ActionQueryContext actionQueryContext = new ActionQueryContext(cb, cq, action); - ActionJoins actionJoins = (ActionJoins) actionQueryContext.getJoins(); + ActionJoins actionJoins = actionQueryContext.getJoins(); Join lastModifiedBy = actionJoins.getLastModifiedBy(); Join creator = actionJoins.getCreator(); Join event = actionJoins.getEvent(); @@ -480,7 +481,7 @@ public long countEventActions(EventCriteria criteria) { CriteriaQuery cq = cb.createQuery(Long.class); Root action = cq.from(getElementClass()); final ActionQueryContext actionQueryContext = new ActionQueryContext(cb, cq, action); - ActionJoins actionJoins = (ActionJoins) actionQueryContext.getJoins(); + ActionJoins actionJoins = actionQueryContext.getJoins(); Join event = actionJoins.getEvent(); diff --git a/sormas-backend/src/main/java/de/symeda/sormas/backend/action/transformers/EventActionIndexDtoReasultTransformer.java b/sormas-backend/src/main/java/de/symeda/sormas/backend/action/EventActionIndexDtoReasultTransformer.java similarity index 94% rename from sormas-backend/src/main/java/de/symeda/sormas/backend/action/transformers/EventActionIndexDtoReasultTransformer.java rename to sormas-backend/src/main/java/de/symeda/sormas/backend/action/EventActionIndexDtoReasultTransformer.java index 101de385a90..c9a1ba544e9 100644 --- a/sormas-backend/src/main/java/de/symeda/sormas/backend/action/transformers/EventActionIndexDtoReasultTransformer.java +++ b/sormas-backend/src/main/java/de/symeda/sormas/backend/action/EventActionIndexDtoReasultTransformer.java @@ -1,4 +1,4 @@ -package de.symeda.sormas.backend.action.transformers; +package de.symeda.sormas.backend.action; import java.util.Date; import java.util.List; @@ -21,6 +21,8 @@ public class EventActionIndexDtoReasultTransformer implements ResultTransformer { + private static final long serialVersionUID = 1L; + @Override public Object transformTuple(Object[] objects, String[] strings) { UserReferenceDto eventReportingUser = new UserReferenceDto((String) objects[12], (String) objects[13], (String) objects[14], null); @@ -55,6 +57,7 @@ public Object transformTuple(Object[] objects, String[] strings) { } @Override + @SuppressWarnings("rawtypes") public List transformList(List list) { return list; } From 5000ede73a457c465f25b468fc7ada1b9b00b680 Mon Sep 17 00:00:00 2001 From: Stefan Kock Date: Tue, 19 Apr 2022 15:21:25 +0200 Subject: [PATCH 010/167] #8747: Usage of ActionQueryContext, missing handover of EventJoins --- .../backend/action/ActionQueryContext.java | 18 ++-- .../sormas/backend/action/ActionService.java | 94 +++++++++++-------- 2 files changed, 64 insertions(+), 48 deletions(-) diff --git a/sormas-backend/src/main/java/de/symeda/sormas/backend/action/ActionQueryContext.java b/sormas-backend/src/main/java/de/symeda/sormas/backend/action/ActionQueryContext.java index 615b6e08784..e86739663e6 100644 --- a/sormas-backend/src/main/java/de/symeda/sormas/backend/action/ActionQueryContext.java +++ b/sormas-backend/src/main/java/de/symeda/sormas/backend/action/ActionQueryContext.java @@ -9,12 +9,16 @@ public class ActionQueryContext extends QueryContext { - public ActionQueryContext(CriteriaBuilder cb, CriteriaQuery query, From root) { - super(cb, query, root, new ActionJoins(root)); - } + protected ActionQueryContext(CriteriaBuilder cb, CriteriaQuery query, From root) { + this(cb, query, new ActionJoins(root)); + } - @Override - protected Expression createExpression(String name) { - return null; - } + public ActionQueryContext(CriteriaBuilder cb, CriteriaQuery query, ActionJoins joins) { + super(cb, query, joins.getRoot(), joins); + } + + @Override + protected Expression createExpression(String name) { + return null; + } } diff --git a/sormas-backend/src/main/java/de/symeda/sormas/backend/action/ActionService.java b/sormas-backend/src/main/java/de/symeda/sormas/backend/action/ActionService.java index 2bca6840ad8..610ab413834 100644 --- a/sormas-backend/src/main/java/de/symeda/sormas/backend/action/ActionService.java +++ b/sormas-backend/src/main/java/de/symeda/sormas/backend/action/ActionService.java @@ -27,7 +27,6 @@ import javax.persistence.criteria.Expression; import javax.persistence.criteria.From; import javax.persistence.criteria.Join; -import javax.persistence.criteria.JoinType; import javax.persistence.criteria.Order; import javax.persistence.criteria.Predicate; import javax.persistence.criteria.Root; @@ -61,12 +60,15 @@ public ActionService() { } public List getAllActionsAfter(Date date, User user) { + CriteriaBuilder cb = em.getCriteriaBuilder(); CriteriaQuery cq = cb.createQuery(getElementClass()); Root from = cq.from(getElementClass()); + ActionQueryContext queryContext = new ActionQueryContext(cb, cq, from); + Predicate filter = null; if (user != null) { - Predicate userFilter = createUserFilter(cb, cq, from); + Predicate userFilter = createUserFilter(queryContext); filter = CriteriaBuilderHelper.and(cb, filter, userFilter); } if (date != null) { @@ -100,6 +102,14 @@ public List getAllByEvent(Event event) { @SuppressWarnings("rawtypes") @Override public Predicate createUserFilter(CriteriaBuilder cb, CriteriaQuery cq, From actionPath) { + return createUserFilter(new ActionQueryContext(cb, cq, actionPath)); + } + + public Predicate createUserFilter(ActionQueryContext queryContext) { + + CriteriaQuery cq = queryContext.getQuery(); + CriteriaBuilder cb = queryContext.getCriteriaBuilder(); + ActionJoins joins = queryContext.getJoins(); User currentUser = getCurrentUser(); if (currentUser == null) { @@ -111,9 +121,10 @@ public Predicate createUserFilter(CriteriaBuilder cb, CriteriaQuery cq, From getActionStats(ActionCriteria actionCriteria) { + CriteriaBuilder cb = em.getCriteriaBuilder(); CriteriaQuery cq = cb.createQuery(ActionStatEntry.class); Root action = cq.from(getElementClass()); + ActionQueryContext queryContext = new ActionQueryContext(cb, cq, action); cq.multiselect(cb.countDistinct(action.get(Action.ID)).alias("count"), action.get(Action.ACTION_STATUS)); Predicate filter = null; if (actionCriteria == null || !actionCriteria.hasContextCriteria()) { - filter = createUserFilter(cb, cq, action); + filter = createUserFilter(queryContext); } if (actionCriteria != null) { - Predicate criteriaFilter = buildCriteriaFilter(actionCriteria, cb, action); + Predicate criteriaFilter = buildCriteriaFilter(actionCriteria, queryContext); filter = CriteriaBuilderHelper.and(cb, filter, criteriaFilter); } @@ -153,18 +166,20 @@ public List getActionList(ActionCriteria actionCriteria, Integer first, } public List getActionList(ActionCriteria actionCriteria, Integer first, Integer max, List sortProperties) { + CriteriaBuilder cb = em.getCriteriaBuilder(); CriteriaQuery cq = cb.createQuery(getElementClass()); Root action = cq.from(getElementClass()); + ActionQueryContext queryContext = new ActionQueryContext(cb, cq, action); // Add filters Predicate filter = null; if (actionCriteria == null || !actionCriteria.hasContextCriteria()) { - filter = createUserFilter(cb, cq, action); + filter = createUserFilter(queryContext); } if (actionCriteria != null) { - Predicate criteriaFilter = buildCriteriaFilter(actionCriteria, cb, action); + Predicate criteriaFilter = buildCriteriaFilter(actionCriteria, queryContext); filter = CriteriaBuilderHelper.and(cb, filter, criteriaFilter); } @@ -202,25 +217,20 @@ public List getActionList(ActionCriteria actionCriteria, Integer first, return QueryHelper.getResultList(em, cq, first, max); } - /** - * Build a predicate corresponding to an actionCriteria - * - * @param actionCriteria - * @param cb - * @param from - * @return predicate corresponding to the actionCriteria - */ - public Predicate buildCriteriaFilter(ActionCriteria actionCriteria, CriteriaBuilder cb, Root from) { + public Predicate buildCriteriaFilter(ActionCriteria actionCriteria, ActionQueryContext queryContext) { - Predicate filter = null; + final CriteriaBuilder cb = queryContext.getCriteriaBuilder(); + final ActionJoins joins = queryContext.getJoins(); + Predicate filter = null; if (actionCriteria.getActionStatus() != null) { - filter = CriteriaBuilderHelper.and(cb, filter, cb.equal(from.get(Action.ACTION_STATUS), actionCriteria.getActionStatus())); + filter = + CriteriaBuilderHelper.and(cb, filter, cb.equal(queryContext.getRoot().get(Action.ACTION_STATUS), actionCriteria.getActionStatus())); } if (actionCriteria.getEvent() != null) { - filter = CriteriaBuilderHelper - .and(cb, filter, cb.equal(from.join(Action.EVENT, JoinType.LEFT).get(Event.UUID), actionCriteria.getEvent().getUuid())); + filter = CriteriaBuilderHelper.and(cb, filter, cb.equal(joins.getEvent().get(Event.UUID), actionCriteria.getEvent().getUuid())); } + return filter; } @@ -228,7 +238,6 @@ public Predicate buildEventCriteriaFilter(EventCriteria criteria, ActionQueryCon CriteriaBuilder cb = actionQueryContext.getCriteriaBuilder(); ActionJoins joins = actionQueryContext.getJoins(); - From action = joins.getRoot(); Predicate filter = @@ -265,21 +274,21 @@ public List getEventActionIndexList(EventCriteria criteria, final CriteriaBuilder cb = em.getCriteriaBuilder(); final CriteriaQuery cq = cb.createQuery(Object[].class); final Root action = cq.from(getElementClass()); - - final ActionQueryContext actionQueryContext = new ActionQueryContext(cb, cq, action); - ActionJoins actionJoins = actionQueryContext.getJoins(); + final ActionQueryContext queryContext = new ActionQueryContext(cb, cq, action); + final ActionJoins actionJoins = queryContext.getJoins(); Join lastModifiedBy = actionJoins.getLastModifiedBy(); Join creatorUser = actionJoins.getCreator(); Join event = actionJoins.getEvent(); - Join eventReportingUser = event.join(Event.REPORTING_USER, JoinType.LEFT); - Join eventResponsibleUser = event.join(Event.RESPONSIBLE_USER, JoinType.LEFT); + Join eventReportingUser = actionJoins.getEventJoins().getReportingUser(); + Join eventResponsibleUser = actionJoins.getEventJoins().getResponsibleUser(); // Add filters + // TODO #8747: handover of EventJoins Predicate filter = eventService.createUserFilter(cb, cq, event); if (criteria != null) { - Predicate criteriaFilter = buildEventCriteriaFilter(criteria, actionQueryContext); + Predicate criteriaFilter = buildEventCriteriaFilter(criteria, queryContext); filter = CriteriaBuilderHelper.and(cb, filter, criteriaFilter); } @@ -416,19 +425,20 @@ public List getEventActionExportList(EventCriteria criteri CriteriaBuilder cb = em.getCriteriaBuilder(); CriteriaQuery cq = cb.createQuery(EventActionExportDto.class); Root action = cq.from(getElementClass()); - final ActionQueryContext actionQueryContext = new ActionQueryContext(cb, cq, action); - ActionJoins actionJoins = actionQueryContext.getJoins(); + ActionQueryContext queryContext = new ActionQueryContext(cb, cq, action); + ActionJoins actionJoins = queryContext.getJoins(); Join lastModifiedBy = actionJoins.getLastModifiedBy(); Join creator = actionJoins.getCreator(); Join event = actionJoins.getEvent(); - Join eventReportingUser = event.join(Event.REPORTING_USER, JoinType.LEFT); - Join eventResponsibleUser = event.join(Event.RESPONSIBLE_USER, JoinType.LEFT); + Join eventReportingUser = actionJoins.getEventJoins().getReportingUser(); + Join eventResponsibleUser = actionJoins.getEventJoins().getResponsibleUser(); // Add filters + // TODO #8747: handover of EventJoins Predicate filter = eventService.createUserFilter(cb, cq, event); if (criteria != null) { - Predicate criteriaFilter = buildEventCriteriaFilter(criteria, actionQueryContext); + Predicate criteriaFilter = buildEventCriteriaFilter(criteria, queryContext); filter = CriteriaBuilderHelper.and(cb, filter, criteriaFilter); } @@ -477,19 +487,19 @@ public List getEventActionExportList(EventCriteria criteri } public long countEventActions(EventCriteria criteria) { + CriteriaBuilder cb = em.getCriteriaBuilder(); CriteriaQuery cq = cb.createQuery(Long.class); Root action = cq.from(getElementClass()); - final ActionQueryContext actionQueryContext = new ActionQueryContext(cb, cq, action); - ActionJoins actionJoins = actionQueryContext.getJoins(); - - Join event = actionJoins.getEvent(); + ActionQueryContext queryContext = new ActionQueryContext(cb, cq, action); + ActionJoins actionJoins = queryContext.getJoins(); // Add filters - Predicate filter = eventService.createUserFilter(cb, cq, event); + // TODO #8747: handover of EventJoins + Predicate filter = eventService.createUserFilter(cb, cq, actionJoins.getEvent()); if (criteria != null) { - Predicate criteriaFilter = buildEventCriteriaFilter(criteria, actionQueryContext); + Predicate criteriaFilter = buildEventCriteriaFilter(criteria, queryContext); filter = CriteriaBuilderHelper.and(cb, filter, criteriaFilter); } @@ -503,18 +513,20 @@ public long countEventActions(EventCriteria criteria) { } public long countActions(ActionCriteria actionCriteria) { + CriteriaBuilder cb = em.getCriteriaBuilder(); CriteriaQuery cq = cb.createQuery(Long.class); Root action = cq.from(getElementClass()); + ActionQueryContext queryContext = new ActionQueryContext(cb, cq, action); // Add filters Predicate filter = null; if (actionCriteria == null || !actionCriteria.hasContextCriteria()) { - filter = createUserFilter(cb, cq, action); + filter = createUserFilter(queryContext); } if (actionCriteria != null) { - Predicate criteriaFilter = buildCriteriaFilter(actionCriteria, cb, action); + Predicate criteriaFilter = buildCriteriaFilter(actionCriteria, queryContext); filter = CriteriaBuilderHelper.and(cb, filter, criteriaFilter); } From cac1b8c6cf1afaaaf0e80bc48f7243308beb4390 Mon Sep 17 00:00:00 2001 From: Stefan Kock Date: Tue, 19 Apr 2022 17:18:02 +0200 Subject: [PATCH 011/167] #8747: Link Actions to EventService.createUserFilter with queryContext --- .../symeda/sormas/backend/action/ActionService.java | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/sormas-backend/src/main/java/de/symeda/sormas/backend/action/ActionService.java b/sormas-backend/src/main/java/de/symeda/sormas/backend/action/ActionService.java index 610ab413834..14f51c8006c 100644 --- a/sormas-backend/src/main/java/de/symeda/sormas/backend/action/ActionService.java +++ b/sormas-backend/src/main/java/de/symeda/sormas/backend/action/ActionService.java @@ -123,8 +123,7 @@ public Predicate createUserFilter(ActionQueryContext queryContext) { Predicate filter = cb.equal(joins.getCreator(), currentUser); - // TODO #8747: handover of EventJoins - Predicate eventFilter = eventService.createUserFilter(cb, cq, joins.getEvent()); + Predicate eventFilter = eventService.createUserFilter(new EventQueryContext(cb, cq, joins.getEventJoins())); if (eventFilter != null) { filter = cb.or(filter, eventFilter); } @@ -284,8 +283,7 @@ public List getEventActionIndexList(EventCriteria criteria, Join eventResponsibleUser = actionJoins.getEventJoins().getResponsibleUser(); // Add filters - // TODO #8747: handover of EventJoins - Predicate filter = eventService.createUserFilter(cb, cq, event); + Predicate filter = eventService.createUserFilter(new EventQueryContext(cb, cq, actionJoins.getEventJoins())); if (criteria != null) { Predicate criteriaFilter = buildEventCriteriaFilter(criteria, queryContext); @@ -434,8 +432,7 @@ public List getEventActionExportList(EventCriteria criteri Join eventResponsibleUser = actionJoins.getEventJoins().getResponsibleUser(); // Add filters - // TODO #8747: handover of EventJoins - Predicate filter = eventService.createUserFilter(cb, cq, event); + Predicate filter = eventService.createUserFilter(new EventQueryContext(cb, cq, actionJoins.getEventJoins())); if (criteria != null) { Predicate criteriaFilter = buildEventCriteriaFilter(criteria, queryContext); @@ -495,8 +492,7 @@ public long countEventActions(EventCriteria criteria) { ActionJoins actionJoins = queryContext.getJoins(); // Add filters - // TODO #8747: handover of EventJoins - Predicate filter = eventService.createUserFilter(cb, cq, actionJoins.getEvent()); + Predicate filter = eventService.createUserFilter(new EventQueryContext(cb, cq, actionJoins.getEventJoins())); if (criteria != null) { Predicate criteriaFilter = buildEventCriteriaFilter(criteria, queryContext); From e459d7a306c5e3fc17f9fffc265e2225f4bba1a7 Mon Sep 17 00:00:00 2001 From: Bartha Barna Date: Wed, 20 Apr 2022 11:11:04 +0300 Subject: [PATCH 012/167] #8747 - reuse joins within user filter and criteria filter of EventService --- .../backend/dashboard/DashboardService.java | 4 +- .../sormas/backend/event/EventService.java | 71 ++++++++++--------- .../sormas/backend/person/PersonService.java | 46 +++++++----- .../sormas/backend/task/TaskService.java | 2 +- 4 files changed, 69 insertions(+), 54 deletions(-) diff --git a/sormas-backend/src/main/java/de/symeda/sormas/backend/dashboard/DashboardService.java b/sormas-backend/src/main/java/de/symeda/sormas/backend/dashboard/DashboardService.java index 7928f08e9df..1d255209758 100644 --- a/sormas-backend/src/main/java/de/symeda/sormas/backend/dashboard/DashboardService.java +++ b/sormas-backend/src/main/java/de/symeda/sormas/backend/dashboard/DashboardService.java @@ -312,7 +312,7 @@ public List getNewEvents(DashboardCriteria dashboardCriteria) Predicate filter = eventService.createDefaultFilter(cb, event); filter = CriteriaBuilderHelper.and(cb, filter, buildEventCriteriaFilter(dashboardCriteria, eventQueryContext)); - filter = CriteriaBuilderHelper.and(cb, filter, eventService.createUserFilter(cb, cq, event)); + filter = CriteriaBuilderHelper.and(cb, filter, eventService.createUserFilter(eventQueryContext)); List result; @@ -357,7 +357,7 @@ public Map getEventCountByStatus(DashboardCriteria dashboardC Predicate filter = eventService.createDefaultFilter(cb, event); filter = CriteriaBuilderHelper.and(cb, filter, buildEventCriteriaFilter(dashboardCriteria, eventQueryContext)); - filter = CriteriaBuilderHelper.and(cb, filter, eventService.createUserFilter(cb, cq, event)); + filter = CriteriaBuilderHelper.and(cb, filter, eventService.createUserFilter(eventQueryContext)); if (filter != null) cq.where(filter); diff --git a/sormas-backend/src/main/java/de/symeda/sormas/backend/event/EventService.java b/sormas-backend/src/main/java/de/symeda/sormas/backend/event/EventService.java index ad2b2cc0c0b..28450299dcb 100644 --- a/sormas-backend/src/main/java/de/symeda/sormas/backend/event/EventService.java +++ b/sormas-backend/src/main/java/de/symeda/sormas/backend/event/EventService.java @@ -122,6 +122,7 @@ public List getAllAfter(Date date, Integer batchSize, String lastSynchron CriteriaQuery cq = cb.createQuery(getElementClass()); Root from = cq.from(getElementClass()); from.fetch(Event.EVENT_LOCATION); + EventQueryContext eventQueryContext = new EventQueryContext(cb, cq, from); Predicate filter = createActiveEventsFilter(cb, from); @@ -131,7 +132,7 @@ public List getAllAfter(Date date, Integer batchSize, String lastSynchron eventUserFilterCriteria.includeUserCaseAndEventParticipantFilter(true); eventUserFilterCriteria.forceRegionJurisdiction(true); - Predicate userFilter = createUserFilter(cb, cq, from, eventUserFilterCriteria); + Predicate userFilter = createUserFilter(eventQueryContext, eventUserFilterCriteria); filter = CriteriaBuilderHelper.and(cb, filter, userFilter); } @@ -152,6 +153,8 @@ public List getAllActiveUuids() { CriteriaQuery cq = cb.createQuery(String.class); Root from = cq.from(getElementClass()); + EventQueryContext eventQueryContext = new EventQueryContext(cb, cq, from); + Predicate filter = createActiveEventsFilter(cb, from); User user = getCurrentUser(); @@ -160,7 +163,7 @@ public List getAllActiveUuids() { eventUserFilterCriteria.includeUserCaseAndEventParticipantFilter(true); eventUserFilterCriteria.forceRegionJurisdiction(true); - Predicate userFilter = createUserFilter(cb, cq, from, eventUserFilterCriteria); + Predicate userFilter = createUserFilter(eventQueryContext, eventUserFilterCriteria); filter = CriteriaBuilderHelper.and(cb, filter, userFilter); } @@ -233,13 +236,14 @@ public Map getEventCountByDisease(EventCriteria eventCriteria) { CriteriaBuilder cb = em.getCriteriaBuilder(); CriteriaQuery cq = cb.createQuery(Object[].class); Root event = cq.from(Event.class); + EventQueryContext eventQueryContext = new EventQueryContext(cb, cq, event); cq.multiselect(event.get(Event.DISEASE), cb.count(event)); cq.groupBy(event.get(Event.DISEASE)); Predicate filter = createDefaultFilter(cb, event); - filter = CriteriaBuilderHelper.and(cb, filter, buildCriteriaFilter(eventCriteria, new EventQueryContext(cb, cq, event))); - filter = CriteriaBuilderHelper.and(cb, filter, createUserFilter(cb, cq, event)); + filter = CriteriaBuilderHelper.and(cb, filter, buildCriteriaFilter(eventCriteria, eventQueryContext)); + filter = CriteriaBuilderHelper.and(cb, filter, createUserFilter(eventQueryContext)); if (filter != null) cq.where(filter); @@ -251,13 +255,15 @@ public Map getEventCountByDisease(EventCriteria eventCriteria) { public Event getEventReferenceByEventParticipant(String eventParticipantUuid) { - CriteriaBuilder cb = em.getCriteriaBuilder(); - CriteriaQuery cq = cb.createQuery(Event.class); - Root event = cq.from(Event.class); + final CriteriaBuilder cb = em.getCriteriaBuilder(); + final CriteriaQuery cq = cb.createQuery(Event.class); + final Root event = cq.from(Event.class); + final EventQueryContext eventQueryContext = new EventQueryContext(cb, cq, event); + final EventJoins joins = eventQueryContext.getJoins(); Predicate filter = createDefaultFilter(cb, event); - filter = CriteriaBuilderHelper.and(cb, filter, cb.equal(event.join(Event.EVENT_PERSONS).get(EventParticipant.UUID), eventParticipantUuid)); - filter = CriteriaBuilderHelper.and(cb, filter, createUserFilter(cb, cq, event)); + filter = CriteriaBuilderHelper.and(cb, filter, cb.equal(joins.getEventParticipants().get(EventParticipant.UUID), eventParticipantUuid)); + filter = CriteriaBuilderHelper.and(cb, filter, createUserFilter(eventQueryContext)); cq.where(filter); return em.createQuery(cq).getResultList().stream().findFirst().orElse(null); @@ -268,12 +274,13 @@ public List getArchivedUuidsSince(Date since) { CriteriaBuilder cb = em.getCriteriaBuilder(); CriteriaQuery cq = cb.createQuery(String.class); Root event = cq.from(Event.class); + final EventQueryContext eventQueryContext = new EventQueryContext(cb, cq, event); EventUserFilterCriteria eventUserFilterCriteria = new EventUserFilterCriteria(); eventUserFilterCriteria.includeUserCaseAndEventParticipantFilter(true); eventUserFilterCriteria.forceRegionJurisdiction(true); - Predicate filter = createUserFilter(cb, cq, event, eventUserFilterCriteria); + Predicate filter = createUserFilter(eventQueryContext, eventUserFilterCriteria); if (since != null) { Predicate dateFilter = cb.greaterThanOrEqualTo(event.get(Event.CHANGE_DATE), since); if (filter != null) { @@ -299,15 +306,16 @@ public List getArchivedUuidsSince(Date since) { public List getDeletedUuidsSince(Date since) { - CriteriaBuilder cb = em.getCriteriaBuilder(); - CriteriaQuery cq = cb.createQuery(String.class); - Root event = cq.from(Event.class); + final CriteriaBuilder cb = em.getCriteriaBuilder(); + final CriteriaQuery cq = cb.createQuery(String.class); + final Root event = cq.from(Event.class); + final EventQueryContext eventQueryContext = new EventQueryContext(cb, cq, event); EventUserFilterCriteria eventUserFilterCriteria = new EventUserFilterCriteria(); eventUserFilterCriteria.includeUserCaseAndEventParticipantFilter(true); eventUserFilterCriteria.forceRegionJurisdiction(true); - Predicate filter = createUserFilter(cb, cq, event, eventUserFilterCriteria); + Predicate filter = createUserFilter(eventQueryContext, eventUserFilterCriteria); if (since != null) { Predicate dateFilter = cb.greaterThanOrEqualTo(event.get(Event.CHANGE_DATE), since); if (filter != null) { @@ -336,15 +344,6 @@ public Predicate createUserFilter(CriteriaBuilder cb, CriteriaQuery cq, From eventPath, - final EventUserFilterCriteria eventUserFilterCriteria) { - return createUserFilter(new EventQueryContext(cb, cq, new EventJoins(eventPath)), eventUserFilterCriteria); - } - public Predicate createUserFilter(EventQueryContext queryContext) { return createUserFilter(queryContext, null); } @@ -409,7 +408,7 @@ public Predicate createUserFilter(final EventQueryContext queryContext, final Ev filterResponsible = cb.or(filterResponsible, cb.equal(eventJoins.getRoot().get(Event.RESPONSIBLE_USER), currentUser)); if (eventUserFilterCriteria != null && eventUserFilterCriteria.isIncludeUserCaseAndEventParticipantFilter()) { - filter = CriteriaBuilderHelper.or(cb, filter, createCaseAndEventParticipantFilter(cb, cq, eventParticipantJoin)); + filter = CriteriaBuilderHelper.or(cb, filter, createCaseAndEventParticipantFilter(queryContext)); } if (eventUserFilterCriteria != null && eventUserFilterCriteria.isForceRegionJurisdiction()) { @@ -434,11 +433,13 @@ public Predicate createUserFilter(final EventQueryContext queryContext, final Ev } @SuppressWarnings("rawtypes") - public Predicate createCaseAndEventParticipantFilter(CriteriaBuilder cb, CriteriaQuery cq, From eventParticipantPath) { + public Predicate createCaseAndEventParticipantFilter(EventQueryContext eventQueryContext) { + EventJoins joins = eventQueryContext.getJoins(); + From eventParticipants = joins.getEventParticipants(); + Join caseJoin = joins.getEventParticipantCases(); - Join caseJoin = eventParticipantPath.join(EventParticipant.RESULTING_CASE, JoinType.LEFT); - - Predicate filter = caseService.createUserFilter(cb, cq, caseJoin); + CriteriaBuilder cb = eventQueryContext.getCriteriaBuilder(); + Predicate filter = caseService.createUserFilter(cb, eventQueryContext.getQuery(), caseJoin); final User currentUser = getCurrentUser(); final JurisdictionLevel jurisdictionLevel = currentUser.getJurisdictionLevel(); @@ -448,7 +449,7 @@ public Predicate createCaseAndEventParticipantFilter(CriteriaBuilder cb, Criteri case REGION: if (currentUser.getRegion() != null) { filter = CriteriaBuilderHelper - .or(cb, filter, cb.equal(eventParticipantPath.get(EventParticipant.REGION).get(Region.ID), currentUser.getRegion().getId())); + .or(cb, filter, cb.equal(eventParticipants.get(EventParticipant.REGION).get(Region.ID), currentUser.getRegion().getId())); } break; case DISTRICT: @@ -456,7 +457,7 @@ public Predicate createCaseAndEventParticipantFilter(CriteriaBuilder cb, Criteri filter = CriteriaBuilderHelper.or( cb, filter, - cb.equal(eventParticipantPath.get(EventParticipant.DISTRICT).get(District.ID), currentUser.getDistrict().getId())); + cb.equal(eventParticipants.get(EventParticipant.DISTRICT).get(District.ID), currentUser.getDistrict().getId())); } break; //$CASES-OMITTED$ @@ -938,19 +939,19 @@ public List getAllByCase(String caseUuid) { CriteriaQuery cq = cb.createQuery(getElementClass()); Root from = cq.from(getElementClass()); from.fetch(Event.EVENT_LOCATION); + + EventQueryContext eventQueryContext = new EventQueryContext(cb, cq, from); + EventJoins joins = eventQueryContext.getJoins(); Predicate filter = createActiveEventsFilter(cb, from); User user = getCurrentUser(); if (user != null) { - Predicate userFilter = createUserFilter(cb, cq, from); + Predicate userFilter = createUserFilter(eventQueryContext); filter = CriteriaBuilderHelper.and(cb, filter, userFilter); } - filter = CriteriaBuilderHelper.and( - cb, - filter, - cb.equal(from.join(Event.EVENT_PERSONS, JoinType.LEFT).join(EventParticipant.RESULTING_CASE, JoinType.LEFT).get(Case.UUID), caseUuid)); + filter = CriteriaBuilderHelper.and(cb, filter, cb.equal(joins.getEventParticipantCases().get(Case.UUID), caseUuid)); cq.where(filter); cq.distinct(true); diff --git a/sormas-backend/src/main/java/de/symeda/sormas/backend/person/PersonService.java b/sormas-backend/src/main/java/de/symeda/sormas/backend/person/PersonService.java index b89e73b2deb..ef48cf94177 100644 --- a/sormas-backend/src/main/java/de/symeda/sormas/backend/person/PersonService.java +++ b/sormas-backend/src/main/java/de/symeda/sormas/backend/person/PersonService.java @@ -46,7 +46,6 @@ import javax.persistence.criteria.Expression; import javax.persistence.criteria.From; import javax.persistence.criteria.Join; -import javax.persistence.criteria.JoinType; import javax.persistence.criteria.ParameterExpression; import javax.persistence.criteria.Path; import javax.persistence.criteria.Predicate; @@ -370,16 +369,19 @@ public List getAllAfter(Date date, Integer batchSize, String lastSynchro User user = getCurrentUser(); - CriteriaBuilder cb = em.getCriteriaBuilder(); + final CriteriaBuilder cb = em.getCriteriaBuilder(); + final CriteriaQuery personsQuery = cb.createQuery(Person.class); + final Root personsRoot = personsQuery.from(Person.class); + final PersonQueryContext personQueryContext = new PersonQueryContext(cb, personsQuery, personsRoot); + final PersonJoins joins = personQueryContext.getJoins(); // persons by district - CriteriaQuery personsQuery = cb.createQuery(Person.class); - Root personsRoot = personsQuery.from(Person.class); - Join address = personsRoot.join(Person.ADDRESS); + + Join address = joins.getAddress(); Predicate districtFilter = cb.equal(address.get(Location.DISTRICT), user.getDistrict()); // date range if (date != null) { - Predicate dateFilter = createChangeDateFilter(cb, personsRoot, DateHelper.toTimestampUpper(date), lastSynchronizedUuid); + Predicate dateFilter = createChangeDateFilter(personQueryContext, DateHelper.toTimestampUpper(date), lastSynchronizedUuid); districtFilter = cb.and(districtFilter, dateFilter); } personsQuery.where(districtFilter); @@ -560,17 +562,17 @@ public List getSimilarPersonDtos(PersonSimilarityCriteria crit setSimilarityThresholdQuery(); boolean activeEntriesOnly = configFacade.isDuplicateChecksExcludePersonsOfArchivedEntries(); - CriteriaBuilder cb = em.getCriteriaBuilder(); - CriteriaQuery personQuery = cb.createQuery(Person.class); - Root personRoot = personQuery.from(Person.class); - - // todo continue here + final CriteriaBuilder cb = em.getCriteriaBuilder(); + final CriteriaQuery personQuery = cb.createQuery(Person.class); + final Root personRoot = personQuery.from(Person.class); + final PersonQueryContext personQueryContext = new PersonQueryContext(cb, personQuery, personRoot); + final PersonJoins joins = personQueryContext.getJoins(); - Join personCaseJoin = personRoot.join(Person.CASES, JoinType.LEFT); - Join personContactJoin = personRoot.join(Person.CONTACTS, JoinType.LEFT); - Join personEventParticipantJoin = personRoot.join(Person.EVENT_PARTICIPANTS, JoinType.LEFT); - Join personImmunizationJoin = personRoot.join(Person.IMMUNIZATIONS, JoinType.LEFT); - Join personTravelEntryJoin = personRoot.join(Person.TRAVEL_ENTRIES, JoinType.LEFT); + Join personCaseJoin = joins.getCaze(); + Join personContactJoin = joins.getContact(); + Join personEventParticipantJoin = joins.getEventParticipant(); + Join personImmunizationJoin = joins.getImmunization(); + Join personTravelEntryJoin = joins.getTravelEntry(); // Persons of active cases Predicate personSimilarityFilter = buildSimilarityCriteriaFilter(criteria, cb, personRoot); @@ -830,6 +832,18 @@ private Predicate createChangeDateFilter(CriteriaBuilder cb, From per return changeDateFilterBuilder.add(persons).add(address).build(); } + private Predicate createChangeDateFilter(PersonQueryContext personQueryContext, Timestamp date, String lastSynchronizedUuid) { + final From persons = personQueryContext.getRoot(); + final CriteriaBuilder cb = personQueryContext.getCriteriaBuilder(); + final PersonJoins joins = personQueryContext.getJoins(); + final Join address = joins.getAddress(); + + ChangeDateFilterBuilder changeDateFilterBuilder = lastSynchronizedUuid == null + ? new ChangeDateFilterBuilder(cb, date) + : new ChangeDateFilterBuilder(cb, date, persons, lastSynchronizedUuid); + return changeDateFilterBuilder.add(persons).add(address).build(); + } + @TransactionAttribute(TransactionAttributeType.REQUIRES_NEW) public long updateGeoLocation(List personUuids, boolean overwriteExistingCoordinates) { diff --git a/sormas-backend/src/main/java/de/symeda/sormas/backend/task/TaskService.java b/sormas-backend/src/main/java/de/symeda/sormas/backend/task/TaskService.java index 93b8120c212..f443266d146 100644 --- a/sormas-backend/src/main/java/de/symeda/sormas/backend/task/TaskService.java +++ b/sormas-backend/src/main/java/de/symeda/sormas/backend/task/TaskService.java @@ -186,7 +186,7 @@ public Predicate createUserFilter(TaskQueryContext taskQueryContext) { if (contactFilter != null) { filter = cb.or(filter, contactFilter); } - Predicate eventFilter = eventService.createUserFilter(cb, cq, taskQueryContext.getJoins().getEvent()); + Predicate eventFilter = eventService.createUserFilter(new EventQueryContext(cb, cq, taskQueryContext.getJoins().getEventJoins())); if (eventFilter != null) { filter = cb.or(filter, eventFilter); } From ac5bf5b59a84d6250a2b7bc4985004fec2f5238c Mon Sep 17 00:00:00 2001 From: Bartha Barna Date: Wed, 20 Apr 2022 15:26:49 +0300 Subject: [PATCH 013/167] #8747 - reuse joins within user filter and criteria filter of EventParticipantService --- .../backend/contact/ContactService.java | 12 +-- .../event/EventParticipantFacadeEjb.java | 4 +- .../backend/event/EventParticipantJoins.java | 16 +++- .../event/EventParticipantService.java | 83 +++++++++++-------- .../backend/person/PersonQueryContext.java | 6 +- .../sormas/backend/person/PersonService.java | 31 ++++--- .../sormas/backend/sample/SampleJoins.java | 2 +- .../sormas/backend/sample/SampleService.java | 16 ++-- .../services/BaseTravelEntryService.java | 3 +- 9 files changed, 106 insertions(+), 67 deletions(-) diff --git a/sormas-backend/src/main/java/de/symeda/sormas/backend/contact/ContactService.java b/sormas-backend/src/main/java/de/symeda/sormas/backend/contact/ContactService.java index 60681c103a8..64685043097 100644 --- a/sormas-backend/src/main/java/de/symeda/sormas/backend/contact/ContactService.java +++ b/sormas-backend/src/main/java/de/symeda/sormas/backend/contact/ContactService.java @@ -46,8 +46,6 @@ import javax.transaction.Transactional; import javax.validation.constraints.NotNull; -import de.symeda.sormas.backend.caze.CaseJoins; -import de.symeda.sormas.api.utils.FieldConstraints; import org.apache.commons.lang3.StringUtils; import de.symeda.sormas.api.Disease; @@ -79,8 +77,10 @@ import de.symeda.sormas.api.user.UserRole; import de.symeda.sormas.api.utils.DataHelper; import de.symeda.sormas.api.utils.DateHelper; +import de.symeda.sormas.api.utils.FieldConstraints; import de.symeda.sormas.api.visit.VisitStatus; import de.symeda.sormas.backend.caze.Case; +import de.symeda.sormas.backend.caze.CaseJoins; import de.symeda.sormas.backend.caze.CaseQueryContext; import de.symeda.sormas.backend.caze.CaseService; import de.symeda.sormas.backend.caze.CaseUserFilterCriteria; @@ -1476,11 +1476,13 @@ public Predicate createActiveContactsFilter(CriteriaBuilder cb, From return cb.and(cb.isFalse(root.get(Contact.ARCHIVED)), cb.isFalse(root.get(Contact.DELETED))); } - public Predicate createActiveContactsFilter(CriteriaBuilder cb, Join contactJoin) { + public Predicate createActiveContactsFilter(ContactQueryContext contactQueryContext) { - Join caze = contactJoin.join(Contact.CAZE, JoinType.LEFT); + From root = contactQueryContext.getRoot(); + ContactJoins joins = contactQueryContext.getJoins(); + CriteriaBuilder cb = contactQueryContext.getCriteriaBuilder(); return cb - .and(cb.or(cb.isNull(contactJoin.get(Contact.CAZE)), cb.isFalse(caze.get(Case.ARCHIVED))), cb.isFalse(contactJoin.get(Contact.DELETED))); + .and(cb.or(cb.isNull(root.get(Contact.CAZE)), cb.isFalse(joins.getCaze().get(Case.ARCHIVED))), cb.isFalse(root.get(Contact.DELETED))); } /** diff --git a/sormas-backend/src/main/java/de/symeda/sormas/backend/event/EventParticipantFacadeEjb.java b/sormas-backend/src/main/java/de/symeda/sormas/backend/event/EventParticipantFacadeEjb.java index cb2a41acf73..75658bb8397 100644 --- a/sormas-backend/src/main/java/de/symeda/sormas/backend/event/EventParticipantFacadeEjb.java +++ b/sormas-backend/src/main/java/de/symeda/sormas/backend/event/EventParticipantFacadeEjb.java @@ -480,7 +480,7 @@ public List getIndexList( Join person = joins.getPerson(); Join resultingCase = joins.getResultingCase(); - Join event = joins.getEvent(); + Join event = joins.getEvent(JoinType.LEFT); final Join samples = eventParticipant.join(EventParticipant.SAMPLES, JoinType.LEFT); samples.on( cb.and( @@ -643,7 +643,7 @@ public List getExportList( Join birthCountry = person.join(Person.BIRTH_COUNTRY, JoinType.LEFT); Join citizenship = person.join(Person.CITIZENSHIP, JoinType.LEFT); - Join event = joins.getEvent(); + Join event = joins.getEvent(JoinType.LEFT); Join eventLocation = joins.getEventAddress(); Join resultingCase = joins.getResultingCase(); diff --git a/sormas-backend/src/main/java/de/symeda/sormas/backend/event/EventParticipantJoins.java b/sormas-backend/src/main/java/de/symeda/sormas/backend/event/EventParticipantJoins.java index f066a9104ef..20f58d5ee16 100644 --- a/sormas-backend/src/main/java/de/symeda/sormas/backend/event/EventParticipantJoins.java +++ b/sormas-backend/src/main/java/de/symeda/sormas/backend/event/EventParticipantJoins.java @@ -15,6 +15,7 @@ import de.symeda.sormas.backend.location.Location; import de.symeda.sormas.backend.person.Person; import de.symeda.sormas.backend.person.PersonJoins; +import de.symeda.sormas.backend.sample.Sample; import de.symeda.sormas.backend.user.User; public class EventParticipantJoins extends QueryJoins { @@ -25,6 +26,7 @@ public class EventParticipantJoins extends QueryJoins { private Join eventParticipantResponsibleDistrict; private Join resultingCase; private Join event; + private Join samples; private CaseJoins caseJoins; private PersonJoins personJoins; @@ -138,14 +140,22 @@ public Join getCaseAsPointOfEntry() { return getCaseJoins().getPointOfEntry(); } - public Join getEvent() { - return getOrCreate(event, EventParticipant.EVENT, JoinType.LEFT, this::setEvent); + public Join getEvent(JoinType joinType) { + return getOrCreate(event, EventParticipant.EVENT, joinType, this::setEvent); } private void setEvent(Join event) { this.event = event; } + public Join getSamples() { + return getOrCreate(samples, EventParticipant.SAMPLES, JoinType.LEFT, this::setSamples); + } + + public void setSamples(Join samples) { + this.samples = samples; + } + public Join getEventAddress() { return getEventJoins().getLocation(); } @@ -179,7 +189,7 @@ private void setPersonJoins(PersonJoins personJoins) { } public EventJoins getEventJoins() { - return getOrCreate(eventJoins, () -> new EventJoins(getEvent()), this::setEventJoins); + return getOrCreate(eventJoins, () -> new EventJoins(getEvent(JoinType.LEFT)), this::setEventJoins); } private void setEventJoins(EventJoins eventJoins) { diff --git a/sormas-backend/src/main/java/de/symeda/sormas/backend/event/EventParticipantService.java b/sormas-backend/src/main/java/de/symeda/sormas/backend/event/EventParticipantService.java index 322f0bf36ef..6851e830b08 100644 --- a/sormas-backend/src/main/java/de/symeda/sormas/backend/event/EventParticipantService.java +++ b/sormas-backend/src/main/java/de/symeda/sormas/backend/event/EventParticipantService.java @@ -87,7 +87,10 @@ public List getAllAfter(Date date, User user, Integer batchSiz CriteriaBuilder cb = em.getCriteriaBuilder(); CriteriaQuery cq = cb.createQuery(getElementClass()); Root from = cq.from(getElementClass()); - Join event = from.join(EventParticipant.EVENT, JoinType.LEFT); + + EventParticipantQueryContext eventParticipantQueryContext = new EventParticipantQueryContext(cb, cq, from); + + Join event = eventParticipantQueryContext.getJoins().getEvent(JoinType.LEFT); Predicate filter = cb .and(cb.or(cb.isFalse(event.get(Event.ARCHIVED)), cb.isNull(event.get(Event.ARCHIVED))), cb.isFalse(from.get(EventParticipant.ARCHIVED))); @@ -95,7 +98,7 @@ public List getAllAfter(Date date, User user, Integer batchSiz filter = cb.and(filter, createDefaultFilter(cb, from)); if (user != null) { - Predicate userFilter = createUserFilter(cb, cq, from); + Predicate userFilter = createUserFilter(eventParticipantQueryContext); filter = CriteriaBuilderHelper.and(cb, filter, userFilter); } @@ -115,14 +118,16 @@ public List getAllActiveUuids(User user) { CriteriaBuilder cb = em.getCriteriaBuilder(); CriteriaQuery cq = cb.createQuery(String.class); Root from = cq.from(getElementClass()); - Join event = from.join(EventParticipant.EVENT, JoinType.LEFT); + EventParticipantQueryContext eventParticipantQueryContext = new EventParticipantQueryContext(cb, cq, from); + + Join event = eventParticipantQueryContext.getJoins().getEvent(JoinType.LEFT); Predicate filter = cb.or(cb.equal(event.get(Event.ARCHIVED), false), cb.isNull(event.get(Event.ARCHIVED))); filter = cb.and(filter, createDefaultFilter(cb, from)); if (user != null) { - Predicate userFilter = createUserFilter(cb, cq, from); + Predicate userFilter = createUserFilter(eventParticipantQueryContext); filter = CriteriaBuilderHelper.and(cb, filter, userFilter); } @@ -167,12 +172,13 @@ public List getAllActiveByEvent(Event event) { public Predicate buildCriteriaFilter(EventParticipantCriteria criteria, EventParticipantQueryContext eventParticipantQueryContext) { - CriteriaBuilder cb = eventParticipantQueryContext.getCriteriaBuilder(); - From from = eventParticipantQueryContext.getRoot(); - CriteriaQuery cq = eventParticipantQueryContext.getQuery(); - Join event = from.join(EventParticipant.EVENT, JoinType.LEFT); - Join person = from.join(EventParticipant.PERSON, JoinType.LEFT); - PersonQueryContext personQueryContext = new PersonQueryContext(cb, cq, person); + final CriteriaBuilder cb = eventParticipantQueryContext.getCriteriaBuilder(); + final From from = eventParticipantQueryContext.getRoot(); + final CriteriaQuery cq = eventParticipantQueryContext.getQuery(); + final EventParticipantJoins joins = eventParticipantQueryContext.getJoins(); + final Join event = joins.getEvent(JoinType.LEFT); + final Join person = joins.getCasePerson(); + final PersonQueryContext personQueryContext = new PersonQueryContext(cb, cq, joins.getPersonJoins()); Predicate filter = null; if (criteria.getEvent() != null) { @@ -207,7 +213,7 @@ public Predicate buildCriteriaFilter(EventParticipantCriteria criteria, EventPar filter = CriteriaBuilderHelper.and(cb, filter, cb.equal(person.get(Person.BIRTHDATE_DD), criteria.getBirthdateDD())); } if (criteria.getPathogenTestResult() != null) { - Join samples = from.join(EventParticipant.SAMPLES, JoinType.LEFT); + Join samples = joins.getSamples(); filter = CriteriaBuilderHelper.and(cb, filter, cb.equal(samples.get(Sample.PATHOGEN_TEST_RESULT), criteria.getPathogenTestResult())); } if (criteria.getVaccinationStatus() != null) { @@ -236,17 +242,22 @@ public Predicate buildCriteriaFilter(EventParticipantCriteria criteria, EventPar return filter; } - public Predicate createActiveEventParticipantsFilter(CriteriaBuilder cb, Root root) { + public Predicate createActiveEventParticipantsFilter(EventParticipantQueryContext eventParticipantQueryContext) { - Join event = root.join(EventParticipant.EVENT, JoinType.LEFT); + final EventParticipantJoins joins = eventParticipantQueryContext.getJoins(); + final Join event = joins.getEvent(JoinType.LEFT); + final CriteriaBuilder cb = eventParticipantQueryContext.getCriteriaBuilder(); return cb.and(cb.isFalse(event.get(Event.ARCHIVED)), cb.isFalse(event.get(Event.DELETED))); } - public Predicate createActiveEventParticipantsInActiveEventsFilter(CriteriaBuilder cb, Join eventParticipantJoin) { + public Predicate createActiveEventParticipantsInActiveEventsFilter(EventParticipantQueryContext eventParticipantQueryContext) { - Join event = eventParticipantJoin.join(EventParticipant.EVENT, JoinType.LEFT); + final EventParticipantJoins joins = eventParticipantQueryContext.getJoins(); + final From eventParticipant = eventParticipantQueryContext.getRoot(); + final Join event = joins.getEvent(JoinType.LEFT); + final CriteriaBuilder cb = eventParticipantQueryContext.getCriteriaBuilder(); return cb.and( - cb.isFalse(eventParticipantJoin.get(EventParticipant.DELETED)), + cb.isFalse(eventParticipant.get(EventParticipant.DELETED)), cb.isFalse(event.get(Event.ARCHIVED)), cb.isFalse(event.get(Event.DELETED))); } @@ -262,26 +273,25 @@ public Predicate createActiveEventParticipantsFilter(CriteriaBuilder cb, Join eventParticipantPath) { - return createUserFilterForJoin(cb, cq, eventParticipantPath); + throw new UnsupportedOperationException("Method should no longer be used!"); } - public Predicate createUserFilterForJoin(CriteriaBuilder cb, CriteriaQuery cq, From eventParticipantPath) { - EventUserFilterCriteria eventUserFilterCriteria = new EventUserFilterCriteria(); + public Predicate createUserFilter(EventParticipantQueryContext eventParticipantQueryContext) { + + final EventUserFilterCriteria eventUserFilterCriteria = new EventUserFilterCriteria(); eventUserFilterCriteria.includeUserCaseAndEventParticipantFilter(true); eventUserFilterCriteria.forceRegionJurisdiction(true); - return createUserFilterForJoin(cb, cq, eventParticipantPath, eventUserFilterCriteria); + return createUserFilter(eventParticipantQueryContext, eventUserFilterCriteria); } - public Predicate createUserFilterForJoin( - CriteriaBuilder cb, - CriteriaQuery cq, - From eventParticipantPath, - EventUserFilterCriteria eventUserFilterCriteria) { + public Predicate createUserFilter(EventParticipantQueryContext epqc, EventUserFilterCriteria eventUserFilterCriteria) { - return eventService.createUserFilter( - new EventQueryContext(cb, cq, new EventJoins(eventParticipantPath, eventParticipantPath.join(EventParticipant.EVENT, JoinType.LEFT))), - eventUserFilterCriteria); + final CriteriaBuilder cb = epqc.getCriteriaBuilder(); + final CriteriaQuery cq = epqc.getQuery(); + final EventParticipantJoins joins = epqc.getJoins(); + + return eventService.createUserFilter(new EventQueryContext(cb, cq, joins.getEventJoins()), eventUserFilterCriteria); } public List getAllByPerson(Person person) { @@ -289,8 +299,9 @@ public List getAllByPerson(Person person) { CriteriaBuilder cb = em.getCriteriaBuilder(); CriteriaQuery cq = cb.createQuery(getElementClass()); Root from = cq.from(getElementClass()); + EventParticipantQueryContext eventParticipantQueryContext = new EventParticipantQueryContext(cb, cq, from); - Predicate userFilter = eventService.createUserFilter(cb, cq, from.join(EventParticipant.EVENT, JoinType.INNER)); + Predicate userFilter = eventService.createUserFilter(new EventQueryContext(cb, cq, eventParticipantQueryContext.getJoins().getEvent(JoinType.INNER))); Predicate filter = CriteriaBuilderHelper.and(cb, cb.equal(from.get(EventParticipant.PERSON), person), userFilter); @@ -342,8 +353,9 @@ public List getArchivedUuidsSince(Date since) { CriteriaBuilder cb = em.getCriteriaBuilder(); CriteriaQuery cq = cb.createQuery(String.class); Root eventParticipant = cq.from(EventParticipant.class); + EventParticipantQueryContext epqc = new EventParticipantQueryContext(cb, cq, eventParticipant); - Predicate filter = createUserFilter(cb, cq, eventParticipant); + Predicate filter = createUserFilter(epqc); if (since != null) { Predicate dateFilter = cb.greaterThanOrEqualTo(eventParticipant.get(EventParticipant.CHANGE_DATE), since); if (filter != null) { @@ -353,7 +365,7 @@ public List getArchivedUuidsSince(Date since) { } } - Join eventJoin = eventParticipant.join(EventParticipant.EVENT, JoinType.INNER); + Join eventJoin = epqc.getJoins().getEvent(JoinType.INNER); Predicate archivedFilter = cb.or(cb.equal(eventParticipant.get(EventParticipant.ARCHIVED), true), cb.equal(eventJoin.get(Event.ARCHIVED), true)); if (filter != null) { @@ -407,10 +419,13 @@ public Predicate createDefaultFilter(CriteriaBuilder cb, From root) { + public Predicate createDefaultInUndeletedEventsFilter(EventParticipantQueryContext eventParticipantQueryContext) { - Join eventJoin = root.join(EventParticipant.EVENT, JoinType.LEFT); - return CriteriaBuilderHelper.and(cb, createDefaultFilter(cb, root), cb.isFalse(eventJoin.get(Event.DELETED))); + final EventParticipantJoins joins = eventParticipantQueryContext.getJoins(); + final From eventParticipant = eventParticipantQueryContext.getRoot(); + final Join event = joins.getEvent(JoinType.LEFT); + final CriteriaBuilder cb = eventParticipantQueryContext.getCriteriaBuilder(); + return CriteriaBuilderHelper.and(cb, createDefaultFilter(cb, eventParticipant), cb.isFalse(event.get(Event.DELETED))); } public List findBy(EventParticipantCriteria criteria, User user) { diff --git a/sormas-backend/src/main/java/de/symeda/sormas/backend/person/PersonQueryContext.java b/sormas-backend/src/main/java/de/symeda/sormas/backend/person/PersonQueryContext.java index 5f49cd25230..6ef1715a930 100644 --- a/sormas-backend/src/main/java/de/symeda/sormas/backend/person/PersonQueryContext.java +++ b/sormas-backend/src/main/java/de/symeda/sormas/backend/person/PersonQueryContext.java @@ -16,7 +16,11 @@ public class PersonQueryContext extends QueryContext { public static final String PERSON_OTHER_CONTACT_DETAILS_SUBQUERY = "personOtherContactDetailsSubQuery"; public PersonQueryContext(CriteriaBuilder cb, CriteriaQuery query, From root) { - super(cb, query, root, new PersonJoins(root)); + this(cb, query, new PersonJoins(root)); + } + + public PersonQueryContext(CriteriaBuilder cb, CriteriaQuery query, PersonJoins personJoins) { + super(cb, query, personJoins.getRoot(), personJoins); } @Override diff --git a/sormas-backend/src/main/java/de/symeda/sormas/backend/person/PersonService.java b/sormas-backend/src/main/java/de/symeda/sormas/backend/person/PersonService.java index ef48cf94177..aeb4f5fdc0f 100644 --- a/sormas-backend/src/main/java/de/symeda/sormas/backend/person/PersonService.java +++ b/sormas-backend/src/main/java/de/symeda/sormas/backend/person/PersonService.java @@ -54,7 +54,7 @@ import javax.transaction.Transactional; import javax.validation.constraints.NotNull; -import de.symeda.sormas.backend.immunization.ImmunizationQueryContext; +import de.symeda.sormas.backend.travelentry.TravelEntryQueryContext; import org.apache.commons.lang3.StringUtils; import de.symeda.sormas.api.Disease; @@ -88,10 +88,12 @@ import de.symeda.sormas.backend.contact.ContactQueryContext; import de.symeda.sormas.backend.contact.ContactService; import de.symeda.sormas.backend.event.EventParticipant; +import de.symeda.sormas.backend.event.EventParticipantQueryContext; import de.symeda.sormas.backend.event.EventParticipantService; import de.symeda.sormas.backend.event.EventUserFilterCriteria; import de.symeda.sormas.backend.feature.FeatureConfigurationFacadeEjb.FeatureConfigurationFacadeEjbLocal; import de.symeda.sormas.backend.geocoding.GeocodingService; +import de.symeda.sormas.backend.immunization.ImmunizationQueryContext; import de.symeda.sormas.backend.immunization.ImmunizationService; import de.symeda.sormas.backend.immunization.entity.Immunization; import de.symeda.sormas.backend.infrastructure.community.Community; @@ -183,7 +185,7 @@ public List getAllUuids() { Root eventPersonsRoot = eventPersonsQuery.from(EventParticipant.class); Join eventPersonsSelect = eventPersonsRoot.join(EventParticipant.PERSON); eventPersonsQuery.select(eventPersonsSelect.get(Person.UUID)); - Predicate eventPersonsFilter = eventParticipantService.createUserFilter(cb, eventPersonsQuery, eventPersonsRoot); + Predicate eventPersonsFilter = eventParticipantService.createUserFilter(new EventParticipantQueryContext(cb, eventPersonsQuery, eventPersonsRoot)); if (eventPersonsFilter != null) { eventPersonsQuery.where(eventPersonsFilter); } @@ -243,7 +245,7 @@ public Predicate createUserFilter(PersonQueryContext personQueryContext, PersonC final CriteriaBuilder cb = personQueryContext.getCriteriaBuilder(); final CriteriaQuery cq = personQueryContext.getQuery(); - final PersonJoins joins = (PersonJoins) personQueryContext.getJoins(); + final PersonJoins joins = personQueryContext.getJoins(); final boolean fullImmunizationModuleUsed = !featureConfigurationFacade.isPropertyValueTrue(FeatureType.IMMUNIZATION_MANAGEMENT, FeatureTypeProperty.REDUCED); @@ -261,10 +263,10 @@ public Predicate createUserFilter(PersonQueryContext personQueryContext, PersonC }; final Supplier eventParticipantFilter = () -> CriteriaBuilderHelper.and( cb, - eventParticipantService.createUserFilterForJoin( + eventParticipantService.createUserFilter( new EventParticipantQueryContext( cb, cq, - joins.getEventParticipant(), + joins.getEventParticipantJoins()), new EventUserFilterCriteria().includeUserCaseAndEventParticipantFilter(false).forceRegionJurisdiction(true)), eventParticipantService.createDefaultFilter(cb, joins.getEventParticipant())); final Supplier immunizationFilter = fullImmunizationModuleUsed @@ -442,7 +444,7 @@ public List getAllAfter(Date date, Integer batchSize, String lastSynchro Join eventPersonsSelect = eventPersonsRoot.join(EventParticipant.PERSON); eventPersonsSelect.fetch(Person.ADDRESS); eventPersonsQuery.select(eventPersonsSelect); - Predicate eventPersonsFilter = eventParticipantService.createUserFilter(cb, eventPersonsQuery, eventPersonsRoot); + Predicate eventPersonsFilter = eventParticipantService.createUserFilter(new EventParticipantQueryContext(cb, eventPersonsQuery, eventPersonsRoot)); // date range if (date != null) { Predicate dateFilter = createChangeDateFilter(cb, eventPersonsSelect, DateHelper.toTimestampUpper(date), lastSynchronizedUuid); @@ -582,17 +584,20 @@ public List getSimilarPersonDtos(PersonSimilarityCriteria crit Predicate personCasePredicate = and(cb, personCaseJoin.get(Case.ID).isNotNull(), activeCasesFilter, caseUserFilter); // Persons of active contacts + final ContactQueryContext contactQueryContext = new ContactQueryContext(cb, personQuery, joins.getContactJoins()); Predicate activeContactsFilter = activeEntriesOnly - ? contactService.createActiveContactsFilter(cb, personContactJoin) + ? contactService.createActiveContactsFilter(contactQueryContext) : contactService.createDefaultFilter(cb, personContactJoin); - Predicate contactUserFilter = contactService.createUserFilter(cb, personQuery, personContactJoin); + Predicate contactUserFilter = contactService.createUserFilter(contactQueryContext, null); Predicate personContactPredicate = and(cb, personContactJoin.get(Contact.ID).isNotNull(), contactUserFilter, activeContactsFilter); // Persons of event participants in active events + final EventParticipantQueryContext eventParticipantQueryContext = new EventParticipantQueryContext(cb, personQuery, joins.getEventParticipantJoins()); Predicate activeEventParticipantsFilter = activeEntriesOnly - ? eventParticipantService.createActiveEventParticipantsInActiveEventsFilter(cb, personEventParticipantJoin) - : eventParticipantService.createDefaultInUndeletedEventsFilter(cb, personEventParticipantJoin); - Predicate eventParticipantUserFilter = eventParticipantService.createUserFilter(cb, personQuery, personEventParticipantJoin); + ? eventParticipantService.createActiveEventParticipantsInActiveEventsFilter(eventParticipantQueryContext) + : eventParticipantService.createDefaultInUndeletedEventsFilter(eventParticipantQueryContext); + Predicate eventParticipantUserFilter = + eventParticipantService.createUserFilter(eventParticipantQueryContext); Predicate personEventParticipantPredicate = and(cb, personEventParticipantJoin.get(EventParticipant.ID).isNotNull(), activeEventParticipantsFilter, eventParticipantUserFilter); @@ -602,7 +607,7 @@ public List getSimilarPersonDtos(PersonSimilarityCriteria crit Predicate activeImmunizationsFilter = activeEntriesOnly ? immunizationService.createActiveImmunizationsFilter(cb, personImmunizationJoin) : immunizationService.createDefaultFilter(cb, personImmunizationJoin); - Predicate immunizationUserFilter = immunizationService.createUserFilter(cb, personQuery, personImmunizationJoin); + Predicate immunizationUserFilter = immunizationService.createUserFilter(new ImmunizationQueryContext(cb, personQuery, personImmunizationJoin)); personImmunizationPredicate = and(cb, personImmunizationJoin.get(Immunization.ID).isNotNull(), immunizationUserFilter, activeImmunizationsFilter); } @@ -611,7 +616,7 @@ public List getSimilarPersonDtos(PersonSimilarityCriteria crit Predicate activeTravelEntriesFilter = activeEntriesOnly ? travelEntryService.createActiveTravelEntriesFilter(cb, personTravelEntryJoin) : travelEntryService.createDefaultFilter(cb, personTravelEntryJoin); - Predicate travelEntryUserFilter = travelEntryService.createUserFilter(cb, personQuery, personTravelEntryJoin); + Predicate travelEntryUserFilter = travelEntryService.createUserFilter(new TravelEntryQueryContext(cb, personQuery, personTravelEntryJoin)); Predicate personTravelEntryPredicate = and(cb, personTravelEntryJoin.get(TravelEntry.ID).isNotNull(), travelEntryUserFilter, activeTravelEntriesFilter); diff --git a/sormas-backend/src/main/java/de/symeda/sormas/backend/sample/SampleJoins.java b/sormas-backend/src/main/java/de/symeda/sormas/backend/sample/SampleJoins.java index 4e194e0b2e5..40f74d009cf 100644 --- a/sormas-backend/src/main/java/de/symeda/sormas/backend/sample/SampleJoins.java +++ b/sormas-backend/src/main/java/de/symeda/sormas/backend/sample/SampleJoins.java @@ -172,7 +172,7 @@ public Join getEventParticipantPerson() { } public Join getEvent() { - return getEventParticipantJoins().getEvent(); + return getEventParticipantJoins().getEvent(JoinType.LEFT); } public Join getEventLocation() { diff --git a/sormas-backend/src/main/java/de/symeda/sormas/backend/sample/SampleService.java b/sormas-backend/src/main/java/de/symeda/sormas/backend/sample/SampleService.java index 3aeda764ed6..8d1eb18a29a 100644 --- a/sormas-backend/src/main/java/de/symeda/sormas/backend/sample/SampleService.java +++ b/sormas-backend/src/main/java/de/symeda/sormas/backend/sample/SampleService.java @@ -634,9 +634,13 @@ public Predicate createUserFilter(SampleQueryContext sampleQueryContext, SampleC if (sampleAssociationType == SampleAssociationType.CASE) { filter = CriteriaBuilderHelper.or(cb, filter, caseService.createUserFilter(cb, cq, joins.getCaze(), null)); } else if (sampleAssociationType == SampleAssociationType.CONTACT) { - filter = CriteriaBuilderHelper.or(cb, filter, contactService.createUserFilter(cb, cq, joins.getContact())); + filter = CriteriaBuilderHelper + .or(cb, filter, contactService.createUserFilter(new ContactQueryContext(cb, cq, joins.getContactJoins()), null)); } else if (sampleAssociationType == SampleAssociationType.EVENT_PARTICIPANT) { - filter = CriteriaBuilderHelper.or(cb, filter, eventParticipantService.createUserFilterForJoin(cb, cq, joins.getEventParticipant())); + filter = CriteriaBuilderHelper.or( + cb, + filter, + eventParticipantService.createUserFilter(new EventParticipantQueryContext(cb, cq, joins.getEventParticipantJoins()))); } } else if (currentUser.getLimitedDisease() != null) { filter = CriteriaBuilderHelper.and( @@ -645,15 +649,15 @@ public Predicate createUserFilter(SampleQueryContext sampleQueryContext, SampleC CriteriaBuilderHelper.or( cb, caseService.createUserFilter(cb, cq, joins.getCaze(), null), - contactService.createUserFilter(cb, cq, joins.getContact()), - eventParticipantService.createUserFilterForJoin(cb, cq, joins.getEventParticipant()))); + contactService.createUserFilter(new ContactQueryContext(cb, cq, joins.getContactJoins()), null), + eventParticipantService.createUserFilter(new EventParticipantQueryContext(cb, cq, joins.getEventParticipantJoins())))); } else { filter = CriteriaBuilderHelper.or( cb, filter, caseService.createUserFilter(cb, cq, joins.getCaze(), null), - contactService.createUserFilter(cb, cq, joins.getContact()), - eventParticipantService.createUserFilterForJoin(cb, cq, joins.getEventParticipant())); + contactService.createUserFilter(new ContactQueryContext(cb, cq, joins.getContactJoins()), null), + eventParticipantService.createUserFilter(new EventParticipantQueryContext(cb, cq, joins.getEventParticipantJoins()))); } return filter; diff --git a/sormas-backend/src/main/java/de/symeda/sormas/backend/travelentry/services/BaseTravelEntryService.java b/sormas-backend/src/main/java/de/symeda/sormas/backend/travelentry/services/BaseTravelEntryService.java index 8648070a441..56fefbb418a 100644 --- a/sormas-backend/src/main/java/de/symeda/sormas/backend/travelentry/services/BaseTravelEntryService.java +++ b/sormas-backend/src/main/java/de/symeda/sormas/backend/travelentry/services/BaseTravelEntryService.java @@ -36,7 +36,6 @@ public BaseTravelEntryService() { @Override public Predicate createUserFilter(CriteriaBuilder cb, CriteriaQuery cq, From travelEntryPath) { -// return createUserFilter(new TravelEntryQueryContext(cb, cq, travelEntryPath)); throw new UnsupportedOperationException("Method should no longer be used!"); } @@ -52,7 +51,7 @@ public Predicate createDefaultFilter(CriteriaBuilder cb, From ro return cb.isFalse(root.get(TravelEntry.DELETED)); } - protected Predicate createUserFilter(TravelEntryQueryContext qc) { + public Predicate createUserFilter(TravelEntryQueryContext qc) { User currentUser = getCurrentUser(); if (currentUser == null) { return null; From 35556035a02bb17c55f2fbbfa65253450bfd67ba Mon Sep 17 00:00:00 2001 From: Bartha Barna Date: Thu, 21 Apr 2022 11:15:04 +0300 Subject: [PATCH 014/167] #8747 - reuse joins within user filter and criteria filter of CaseService --- .../sormas/backend/caze/CaseFacadeEjb.java | 14 +-- .../symeda/sormas/backend/caze/CaseJoins.java | 20 ++++ .../backend/caze/CaseListCriteriaBuilder.java | 2 +- .../sormas/backend/caze/CaseService.java | 100 +++++++++++------- .../backend/contact/ContactService.java | 5 +- .../backend/dashboard/DashboardService.java | 20 ++-- .../sormas/backend/person/PersonService.java | 3 +- .../sormas/backend/sample/SampleService.java | 6 +- 8 files changed, 106 insertions(+), 64 deletions(-) diff --git a/sormas-backend/src/main/java/de/symeda/sormas/backend/caze/CaseFacadeEjb.java b/sormas-backend/src/main/java/de/symeda/sormas/backend/caze/CaseFacadeEjb.java index 75d2ccd0662..457fe11b957 100644 --- a/sormas-backend/src/main/java/de/symeda/sormas/backend/caze/CaseFacadeEjb.java +++ b/sormas-backend/src/main/java/de/symeda/sormas/backend/caze/CaseFacadeEjb.java @@ -551,7 +551,7 @@ public long count(CaseCriteria caseCriteria, boolean ignoreUserFilter) { if (caseCriteria != null) { caseUserFilterCriteria.setIncludeCasesFromOtherJurisdictions(caseCriteria.getIncludeCasesFromOtherJurisdictions()); } - filter = service.createUserFilter(cb, cq, root, caseUserFilterCriteria); + filter = service.createUserFilter(caseQueryContext, caseUserFilterCriteria); } if (caseCriteria != null) { @@ -1335,7 +1335,7 @@ public List getRandomCaseReferences(CaseCriteria criteria, int final CaseQueryContext caseQueryContext = new CaseQueryContext(cb, cq, caze); - Predicate filter = service.createUserFilter(cb, cq, caze, new CaseUserFilterCriteria().excludeCasesFromContacts(true)); + Predicate filter = service.createUserFilter(caseQueryContext, new CaseUserFilterCriteria().excludeCasesFromContacts(true)); filter = CriteriaBuilderHelper.and(cb, filter, service.createCriteriaFilter(criteria, caseQueryContext)); if (filter != null) { cq.where(filter); @@ -3280,14 +3280,16 @@ public boolean doesExternalTokenExist(String externalToken, String caseUuid) { @Override public List> getCaseMeasurePerDistrict(Date fromDate, Date toDate, Disease disease, CaseMeasure caseMeasure) { - CriteriaBuilder cb = em.getCriteriaBuilder(); - CriteriaQuery cq = cb.createQuery(Object[].class); - Root caseRoot = cq.from(Case.class); + final CriteriaBuilder cb = em.getCriteriaBuilder(); + final CriteriaQuery cq = cb.createQuery(Object[].class); + final Root caseRoot = cq.from(Case.class); + final CaseQueryContext caseQueryContext = new CaseQueryContext(cb, cq, caseRoot); + Root districtRoot = cq.from(District.class); Predicate filter = service.createDefaultFilter(cb, caseRoot); if (fromDate != null || toDate != null) { - filter = service.createCaseRelevanceFilter(cb, caseRoot, fromDate, toDate); + filter = service.createCaseRelevanceFilter(caseQueryContext, fromDate, toDate); } if (disease != null) { diff --git a/sormas-backend/src/main/java/de/symeda/sormas/backend/caze/CaseJoins.java b/sormas-backend/src/main/java/de/symeda/sormas/backend/caze/CaseJoins.java index e2502de21af..3f3da4aa042 100644 --- a/sormas-backend/src/main/java/de/symeda/sormas/backend/caze/CaseJoins.java +++ b/sormas-backend/src/main/java/de/symeda/sormas/backend/caze/CaseJoins.java @@ -24,8 +24,10 @@ import de.symeda.sormas.backend.clinicalcourse.ClinicalCourse; import de.symeda.sormas.backend.clinicalcourse.HealthConditions; import de.symeda.sormas.backend.common.QueryJoins; +import de.symeda.sormas.backend.contact.Contact; import de.symeda.sormas.backend.epidata.EpiData; import de.symeda.sormas.backend.event.EventParticipant; +import de.symeda.sormas.backend.event.EventParticipantJoins; import de.symeda.sormas.backend.hospitalization.Hospitalization; import de.symeda.sormas.backend.infrastructure.community.Community; import de.symeda.sormas.backend.infrastructure.country.Country; @@ -46,6 +48,7 @@ public class CaseJoins extends QueryJoins { private Join person; + private Join contacts; private Join responsibleRegion; private Join responsibleDistrict; private Join responsibleCommunity; @@ -69,6 +72,7 @@ public class CaseJoins extends QueryJoins { private PersonJoins personJoins; private SampleJoins sampleJoins; + private EventParticipantJoins eventParticipantJoins; public CaseJoins(From caze) { super(caze); @@ -82,6 +86,14 @@ private void setPerson(Join person) { this.person = person; } + public Join getContacts() { + return getOrCreate(contacts, Case.CONTACTS, JoinType.LEFT, this::setContacts); + } + + private void setContacts(Join contacts) { + this.contacts = contacts; + } + public Join getResponsibleRegion() { return getOrCreate(responsibleRegion, Case.RESPONSIBLE_REGION, JoinType.LEFT, this::setResponsibleRegion); } @@ -293,4 +305,12 @@ public SampleJoins getSampleJoins() { private void setSampleJoins(SampleJoins sampleJoins) { this.sampleJoins = sampleJoins; } + + public EventParticipantJoins getEventParticipantJoins() { + return getOrCreate(eventParticipantJoins, () -> new EventParticipantJoins(getEventParticipants()), this::setEventParticipantJoins); + } + + private void setEventParticipantJoins(EventParticipantJoins eventParticipantJoins) { + this.eventParticipantJoins = eventParticipantJoins; + } } diff --git a/sormas-backend/src/main/java/de/symeda/sormas/backend/caze/CaseListCriteriaBuilder.java b/sormas-backend/src/main/java/de/symeda/sormas/backend/caze/CaseListCriteriaBuilder.java index c56dc9ddcac..229d7ddaeac 100644 --- a/sormas-backend/src/main/java/de/symeda/sormas/backend/caze/CaseListCriteriaBuilder.java +++ b/sormas-backend/src/main/java/de/symeda/sormas/backend/caze/CaseListCriteriaBuilder.java @@ -160,7 +160,7 @@ private CriteriaQuery buildIndexCriteria( if (caseCriteria != null) { caseUserFilterCriteria.setIncludeCasesFromOtherJurisdictions(caseCriteria.getIncludeCasesFromOtherJurisdictions()); } - Predicate filter = caseService.createUserFilter(cb, cq, caze, caseUserFilterCriteria); + Predicate filter = caseService.createUserFilter(caseQueryContext, caseUserFilterCriteria); if (caseCriteria != null) { Predicate criteriaFilter = caseService.createCriteriaFilter(caseCriteria, caseQueryContext); diff --git a/sormas-backend/src/main/java/de/symeda/sormas/backend/caze/CaseService.java b/sormas-backend/src/main/java/de/symeda/sormas/backend/caze/CaseService.java index 0d80c66215c..b33fbcd03dd 100644 --- a/sormas-backend/src/main/java/de/symeda/sormas/backend/caze/CaseService.java +++ b/sormas-backend/src/main/java/de/symeda/sormas/backend/caze/CaseService.java @@ -289,9 +289,11 @@ public Long countCasesForMap(Region region, District district, Disease disease, CriteriaQuery cq = cb.createQuery(Long.class); Root caze = cq.from(getElementClass()); + CaseQueryContext caseQueryContext = new CaseQueryContext(cb, cq, caze); + CaseJoins joins = new CaseJoins(caze); - Predicate filter = createMapCasesFilter(cb, cq, caze, joins, region, district, disease, from, to, dateType); + Predicate filter = createMapCasesFilter(caseQueryContext, region, district, disease, from, to, dateType); if (filter != null) { cq.where(filter); @@ -312,7 +314,7 @@ public List getCasesForMap(Region region, District district, Disease CaseQueryContext caseQueryContext = new CaseQueryContext(cb, cq, caze); CaseJoins joins = caseQueryContext.getJoins(); - Predicate filter = createMapCasesFilter(cb, cq, caze, joins, region, district, disease, from, to, dateType); + Predicate filter = createMapCasesFilter(caseQueryContext, region, district, disease, from, to, dateType); List result; if (filter != null) { @@ -343,27 +345,30 @@ public List getCasesForMap(Region region, District district, Disease } private Predicate createMapCasesFilter( - CriteriaBuilder cb, - CriteriaQuery cq, - Root root, - CaseJoins joins, + CaseQueryContext caseQueryContext, Region region, District district, Disease disease, Date from, Date to, NewCaseDateType dateType) { + + final CriteriaBuilder cb = caseQueryContext.getCriteriaBuilder(); + final From root = caseQueryContext.getRoot(); + final CriteriaQuery cq = caseQueryContext.getQuery(); + final CaseJoins joins = caseQueryContext.getJoins(); + Predicate filter = createActiveCasesFilter(cb, root); // Userfilter - filter = CriteriaBuilderHelper.and(cb, filter, createUserFilter(cb, cq, root, new CaseUserFilterCriteria().excludeCasesFromContacts(true))); + filter = CriteriaBuilderHelper.and(cb, filter, createUserFilter(caseQueryContext, new CaseUserFilterCriteria().excludeCasesFromContacts(true))); // Filter by date. The relevancefilter uses a special algorithm that should reflect the current situation. if (dateType == null) { - filter = CriteriaBuilderHelper.and(cb, filter, createCaseRelevanceFilter(cb, root, from, to)); + filter = CriteriaBuilderHelper.and(cb, filter, createCaseRelevanceFilter(caseQueryContext, from, to)); } else { filter = CriteriaBuilderHelper - .and(cb, filter, createNewCaseFilter(cq, cb, root, DateHelper.getStartOfDay(from), DateHelper.getEndOfDay(to), dateType)); + .and(cb, filter, createNewCaseFilter(caseQueryContext, DateHelper.getStartOfDay(from), DateHelper.getEndOfDay(to), dateType)); } // only show cases which actually have GPS coordinates provided @@ -454,7 +459,7 @@ public String getUuidByUuidEpidNumberOrExternalId(String searchTerm, CaseCriteri final CaseQueryContext caseQueryContext = new CaseQueryContext(cb, cq, root); filter = createCriteriaFilter(caseCriteria, caseQueryContext); // Userfilter - filter = CriteriaBuilderHelper.and(cb, filter, createUserFilter(cb, cq, root, new CaseUserFilterCriteria())); + filter = CriteriaBuilderHelper.and(cb, filter, createUserFilter(caseQueryContext, new CaseUserFilterCriteria())); } filter = CriteriaBuilderHelper.and( @@ -537,7 +542,9 @@ public List getDeletedUuidsSince(Date since) { * {@code toDate}, i.e. either the {@link Symptoms#onsetDate} or {@link Case#reportDate} OR the {@link Case#outcomeDate} are * within the time frame. Also excludes cases with classification=not a case */ - public Predicate createCaseRelevanceFilter(CriteriaBuilder cb, Root from, Date fromDate, Date toDate) { + public Predicate createCaseRelevanceFilter(CaseQueryContext caseQueryContext, Date fromDate, Date toDate) { + CriteriaBuilder cb = caseQueryContext.getCriteriaBuilder(); + From from = caseQueryContext.getRoot(); Predicate classificationFilter = cb.notEqual(from.get(Case.CASE_CLASSIFICATION), CaseClassification.NO_CASE); Predicate dateFromFilter = null; Predicate dateToFilter = null; @@ -545,7 +552,7 @@ public Predicate createCaseRelevanceFilter(CriteriaBuilder cb, Root from, dateFromFilter = cb.or(cb.isNull(from.get(Case.OUTCOME_DATE)), cb.greaterThanOrEqualTo(from.get(Case.OUTCOME_DATE), fromDate)); } if (toDate != null) { - Join symptoms = from.join(Case.SYMPTOMS, JoinType.LEFT); + Join symptoms = caseQueryContext.getJoins().getSymptoms(); dateToFilter = cb.or( cb.lessThanOrEqualTo(symptoms.get(Symptoms.ONSET_DATE), toDate), cb.and(cb.isNull(symptoms.get(Symptoms.ONSET_DATE)), cb.lessThanOrEqualTo(from.get(Case.REPORT_DATE), toDate))); @@ -572,14 +579,14 @@ public Predicate createCriteriaFilter(CaseCrite Join person = joins.getPerson(); Join reportingUser = joins.getReportingUser(); Join facility = joins.getFacility(); - Join location = person.join(Person.ADDRESS, JoinType.LEFT); + Join location = joins.getPersonAddress(); Predicate filter = null; if (caseCriteria.getReportingUserRole() != null) { filter = CriteriaBuilderHelper.and( cb, filter, - cb.isMember(caseCriteria.getReportingUserRole(), from.join(Case.REPORTING_USER, JoinType.LEFT).get(User.USER_ROLES))); + cb.isMember(caseCriteria.getReportingUserRole(), joins.getReportingUser().get(User.USER_ROLES))); } if (caseCriteria.getDisease() != null) { filter = CriteriaBuilderHelper.and(cb, filter, cb.equal(from.get(Case.DISEASE), caseCriteria.getDisease())); @@ -633,7 +640,7 @@ public Predicate createCriteriaFilter(CaseCrite filter = CriteriaBuilderHelper.and( cb, filter, - cb.equal(from.join(Case.HEALTH_FACILITY, JoinType.LEFT).get(Facility.UUID), caseCriteria.getHealthFacility().getUuid())); + cb.equal(joins.getFacility().get(Facility.UUID), caseCriteria.getHealthFacility().getUuid())); } if (caseCriteria.getFacilityTypeGroup() != null) { filter = @@ -646,13 +653,13 @@ public Predicate createCriteriaFilter(CaseCrite filter = CriteriaBuilderHelper.and( cb, filter, - cb.equal(from.join(Case.POINT_OF_ENTRY, JoinType.LEFT).get(PointOfEntry.UUID), caseCriteria.getPointOfEntry().getUuid())); + cb.equal(joins.getPointOfEntry().get(PointOfEntry.UUID), caseCriteria.getPointOfEntry().getUuid())); } if (caseCriteria.getSurveillanceOfficer() != null) { filter = CriteriaBuilderHelper.and( cb, filter, - cb.equal(from.join(Case.SURVEILLANCE_OFFICER, JoinType.LEFT).get(User.UUID), caseCriteria.getSurveillanceOfficer().getUuid())); + cb.equal(joins.getSurveillanceOfficer().get(User.UUID), caseCriteria.getSurveillanceOfficer().getUuid())); } if (caseCriteria.getCaseClassification() != null) { filter = CriteriaBuilderHelper.and(cb, filter, cb.equal(from.get(Case.CASE_CLASSIFICATION), caseCriteria.getCaseClassification())); @@ -668,9 +675,7 @@ public Predicate createCriteriaFilter(CaseCrite cb, filter, createNewCaseFilter( - cq, - cb, - from, + caseQueryContext, DateHelper.getStartOfDay(caseCriteria.getNewCaseDateFrom()), DateHelper.getEndOfDay(caseCriteria.getNewCaseDateTo()), caseCriteria.getNewCaseDateType())); @@ -699,7 +704,7 @@ public Predicate createCriteriaFilter(CaseCrite filter = CriteriaBuilderHelper.and(cb, filter, cb.equal(person.get(Person.UUID), caseCriteria.getPerson().getUuid())); } if (caseCriteria.getMustHaveNoGeoCoordinates() != null && caseCriteria.getMustHaveNoGeoCoordinates() == true) { - Join personAddress = person.join(Person.ADDRESS, JoinType.LEFT); + Join personAddress = joins.getPersonAddress(); filter = CriteriaBuilderHelper.and( cb, filter, @@ -711,7 +716,7 @@ public Predicate createCriteriaFilter(CaseCrite filter = CriteriaBuilderHelper.and( cb, filter, - cb.and(cb.equal(from.get(Case.CASE_ORIGIN), CaseOrigin.POINT_OF_ENTRY), cb.isNull(from.join(Case.HEALTH_FACILITY, JoinType.LEFT)))); + cb.and(cb.equal(from.get(Case.CASE_ORIGIN), CaseOrigin.POINT_OF_ENTRY), cb.isNull(joins.getFacility()))); } if (caseCriteria.getMustHaveCaseManagementData() != null && caseCriteria.getMustHaveCaseManagementData() == true) { Subquery prescriptionSubquery = cq.subquery(Prescription.class); @@ -785,7 +790,7 @@ public Predicate createCriteriaFilter(CaseCrite boolean hasOnlyCasesWithEventsCriteria = Boolean.TRUE.equals(caseCriteria.getOnlyCasesWithEvents()); if (hasEventLikeCriteria || hasOnlyCasesWithEventsCriteria) { Join eventParticipant = joins.getEventParticipants(); - Join event = eventParticipant.join(EventParticipant.EVENT, JoinType.LEFT); + Join event = joins.getEventParticipantJoins().getEvent(JoinType.LEFT); filter = CriteriaBuilderHelper .and(cb, filter, cb.isFalse(event.get(Event.DELETED)), cb.isFalse(eventParticipant.get(EventParticipant.DELETED))); @@ -859,7 +864,7 @@ public Predicate createCriteriaFilter(CaseCrite /** * Creates a filter that excludes all cases that are either {@link Case#archived} or {@link DeletableAdo#deleted}. */ - public Predicate createActiveCasesFilter(CriteriaBuilder cb, Root root) { + public Predicate createActiveCasesFilter(CriteriaBuilder cb, From root) { return cb.and(cb.isFalse(root.get(Case.ARCHIVED)), cb.isFalse(root.get(Case.DELETED))); } @@ -1072,13 +1077,17 @@ protected > T addChangeDates(T builder, From casePath, CaseUserFilterCriteria userFilterCriteria) { + public Predicate createUserFilter(CaseQueryContext caseQueryContext, CaseUserFilterCriteria userFilterCriteria) { User currentUser = getCurrentUser(); if (currentUser == null) { return null; } + final CriteriaQuery cq = caseQueryContext.getQuery(); + final CriteriaBuilder cb = caseQueryContext.getCriteriaBuilder(); + final From casePath = caseQueryContext.getRoot(); + Predicate filterResponsible = null; Predicate filter = null; @@ -1155,10 +1164,11 @@ public Predicate createUserFilter(CriteriaBuilder cb, CriteriaQuery cq, From casePath) { - return createUserFilter(cb, cq, casePath, null); + return createUserFilter(new CaseQueryContext(cb, cq, casePath)); + } + + public Predicate createUserFilter(CaseQueryContext caseQueryContext) { + return createUserFilter(caseQueryContext, null); } /** @@ -1199,14 +1213,17 @@ public Predicate createUserFilter(CriteriaBuilder cb, CriteriaQuery cq, From cq, - CriteriaBuilder cb, - From caze, + CaseQueryContext caseQueryContext, Date fromDate, Date toDate, CriteriaDateType dateType) { - Join symptoms = caze.join(Case.SYMPTOMS, JoinType.LEFT); + final CriteriaBuilder cb = caseQueryContext.getCriteriaBuilder(); + final From caze = caseQueryContext.getRoot(); + final CriteriaQuery cq = caseQueryContext.getQuery(); + final CaseJoins joins = caseQueryContext.getJoins(); + + Join symptoms = joins.getSymptoms(); Date toDateEndOfDay = DateHelper.getEndOfDay(toDate); @@ -1470,7 +1487,7 @@ public List getCaseSelectionList(CaseCriteria caseCriteria) { cq.orderBy(cb.desc(latestChangedDateFunction)); - Predicate filter = CriteriaBuilderHelper.and(cb, createDefaultFilter(cb, root), createUserFilter(cb, cq, root, new CaseUserFilterCriteria())); + Predicate filter = CriteriaBuilderHelper.and(cb, createDefaultFilter(cb, root), createUserFilter(caseQueryContext, new CaseUserFilterCriteria())); if (caseCriteria != null) { if (caseCriteria.getDisease() != null) { @@ -1624,21 +1641,24 @@ public List getSimilarCases(CaseSimilarityCriteria criteria) { public List getCasesForDuplicateMerging(CaseCriteria criteria, boolean ignoreRegion, double nameSimilarityThreshold) { - CriteriaBuilder cb = em.getCriteriaBuilder(); - CriteriaQuery cq = cb.createQuery(Object[].class); - Root root = cq.from(Case.class); + final CriteriaBuilder cb = em.getCriteriaBuilder(); + final CriteriaQuery cq = cb.createQuery(Object[].class); + final Root root = cq.from(Case.class); final CaseQueryContext caseQueryContext = new CaseQueryContext(cb, cq, root); final CaseJoins joins = caseQueryContext.getJoins(); - Root root2 = cq.from(Case.class); + final Root root2 = cq.from(Case.class); + final CaseQueryContext caseQueryContext2 = new CaseQueryContext(cb, cq, root2); + final CaseJoins joins2 = caseQueryContext2.getJoins(); + Join person = joins.getPerson(); - Join person2 = root2.join(Case.PERSON, JoinType.LEFT); + Join person2 = joins2.getPerson(); Join responsibleRegion = joins.getResponsibleRegion(); - Join responsibleRegion2 = root2.join(Case.RESPONSIBLE_REGION, JoinType.LEFT); + Join responsibleRegion2 = joins2.getResponsibleRegion(); Join region = joins.getRegion(); - Join region2 = root2.join(Case.REGION, JoinType.LEFT); + Join region2 = joins2.getRegion(); Join symptoms = joins.getSymptoms(); - Join symptoms2 = root2.join(Case.SYMPTOMS, JoinType.LEFT); + Join symptoms2 = joins2.getSymptoms(); cq.distinct(true); diff --git a/sormas-backend/src/main/java/de/symeda/sormas/backend/contact/ContactService.java b/sormas-backend/src/main/java/de/symeda/sormas/backend/contact/ContactService.java index 64685043097..c874cf82e9c 100644 --- a/sormas-backend/src/main/java/de/symeda/sormas/backend/contact/ContactService.java +++ b/sormas-backend/src/main/java/de/symeda/sormas/backend/contact/ContactService.java @@ -970,11 +970,12 @@ public Predicate createUserFilter(ContactQueryContext contactQueryContext, Conta CriteriaBuilder cb = contactQueryContext.getCriteriaBuilder(); From contactPath = contactQueryContext.getRoot(); + CaseQueryContext caseQueryContext = new CaseQueryContext(cb, cq, contactQueryContext.getJoins().getCaseJoins()); if (contactCriteria == null || contactCriteria.getIncludeContactsFromOtherJurisdictions()) { - userFilter = caseService.createUserFilter(cb, cq, contactQueryContext.getJoins().getCaze()); + userFilter = caseService.createUserFilter(caseQueryContext); } else { CaseUserFilterCriteria userFilterCriteria = new CaseUserFilterCriteria(); - userFilter = caseService.createUserFilter(cb, cq, contactQueryContext.getJoins().getCaze(), userFilterCriteria); + userFilter = caseService.createUserFilter(caseQueryContext, userFilterCriteria); } Predicate filter; diff --git a/sormas-backend/src/main/java/de/symeda/sormas/backend/dashboard/DashboardService.java b/sormas-backend/src/main/java/de/symeda/sormas/backend/dashboard/DashboardService.java index 1d255209758..248ee18f72d 100644 --- a/sormas-backend/src/main/java/de/symeda/sormas/backend/dashboard/DashboardService.java +++ b/sormas-backend/src/main/java/de/symeda/sormas/backend/dashboard/DashboardService.java @@ -77,7 +77,7 @@ public List getCases(DashboardCriteria dashboardCriteria) { final CaseJoins joins = caseQueryContext.getJoins(); Join person = joins.getPerson(); - Predicate filter = caseService.createUserFilter(cb, cq, caze, new CaseUserFilterCriteria().excludeCasesFromContacts(true)); + Predicate filter = caseService.createUserFilter(caseQueryContext, new CaseUserFilterCriteria().excludeCasesFromContacts(true)); Predicate criteriaFilter = createCaseCriteriaFilter(dashboardCriteria, caseQueryContext); filter = CriteriaBuilderHelper.and(cb, filter, criteriaFilter); @@ -112,7 +112,7 @@ public Map getCasesCountByClassification(DashboardC final CaseQueryContext caseQueryContext = new CaseQueryContext(cb, cq, caze); - Predicate filter = caseService.createUserFilter(cb, cq, caze, new CaseUserFilterCriteria().excludeCasesFromContacts(true)); + Predicate filter = caseService.createUserFilter(caseQueryContext, new CaseUserFilterCriteria().excludeCasesFromContacts(true)); Predicate criteriaFilter = createCaseCriteriaFilter(dashboardCriteria, caseQueryContext); filter = CriteriaBuilderHelper.and(cb, filter, criteriaFilter); @@ -139,7 +139,7 @@ public Map getCaseCountByDisease(DashboardCriteria dashboardCrite Root caze = cq.from(Case.class); final CaseQueryContext caseQueryContext = new CaseQueryContext(cb, cq, caze); - Predicate filter = caseService.createUserFilter(cb, cq, caze, new CaseUserFilterCriteria().excludeCasesFromContacts(true)); + Predicate filter = caseService.createUserFilter(caseQueryContext, new CaseUserFilterCriteria().excludeCasesFromContacts(true)); filter = CriteriaBuilderHelper.and(cb, filter, createCaseCriteriaFilter(dashboardCriteria, caseQueryContext)); @@ -165,7 +165,7 @@ public String getLastReportedDistrictName(DashboardCriteria dashboardCriteria) { final CaseJoins joins = caseQueryContext.getJoins(); Join district = joins.getResponsibleDistrict(); - Predicate filter = caseService.createUserFilter(cb, cq, caze, new CaseUserFilterCriteria().excludeCasesFromContacts(true)); + Predicate filter = caseService.createUserFilter(caseQueryContext, new CaseUserFilterCriteria().excludeCasesFromContacts(true)); filter = CriteriaBuilderHelper.and(cb, filter, createCaseCriteriaFilter(dashboardCriteria, caseQueryContext)); @@ -191,7 +191,7 @@ public Map getLastReportedDistrictByDisease(DashboardCriteria final CaseJoins joins = caseQueryContext.getJoins(); Join districtJoin = joins.getResponsibleDistrict(); - Predicate filter = caseService.createUserFilter(cb, cq, caze, new CaseUserFilterCriteria().excludeCasesFromContacts(true)); + Predicate filter = caseService.createUserFilter(caseQueryContext, new CaseUserFilterCriteria().excludeCasesFromContacts(true)); filter = CriteriaBuilderHelper.and(cb, filter, createCaseCriteriaFilter(dashboardCriteria, caseQueryContext)); @@ -233,7 +233,7 @@ public Map getDeathCountByDisease(DashboardCriteria dashboardCrit CaseJoins joins = caseQueryContext.getJoins(); Join person = joins.getPerson(); - Predicate filter = caseService.createUserFilter(cb, cq, root, new CaseUserFilterCriteria().excludeCasesFromContacts(true)); + Predicate filter = caseService.createUserFilter(caseQueryContext, new CaseUserFilterCriteria().excludeCasesFromContacts(true)); filter = CriteriaBuilderHelper.and(cb, filter, createCaseCriteriaFilter(dashboardCriteria, caseQueryContext)); filter = CriteriaBuilderHelper.and(cb, filter, cb.equal(person.get(Person.CAUSE_OF_DEATH_DISEASE), root.get(Case.DISEASE))); @@ -258,7 +258,7 @@ public long countCasesConvertedFromContacts(DashboardCriteria dashboardCriteria) Root caze = cq.from(Case.class); final CaseQueryContext caseQueryContext = new CaseQueryContext(cb, cq, caze); - Predicate filter = caseService.createUserFilter(cb, cq, caze, new CaseUserFilterCriteria().excludeCasesFromContacts(true)); + Predicate filter = caseService.createUserFilter(caseQueryContext, new CaseUserFilterCriteria().excludeCasesFromContacts(true)); Predicate criteriaFilter = createCaseCriteriaFilter(dashboardCriteria, caseQueryContext); filter = CriteriaBuilderHelper.and(cb, filter, criteriaFilter); @@ -282,7 +282,7 @@ public Map getCasesCountPerPersonCondition(DashboardC Join person = joins.getPerson(); - Predicate filter = caseService.createUserFilter(cb, cq, caze, new CaseUserFilterCriteria().excludeCasesFromContacts(true)); + Predicate filter = caseService.createUserFilter(caseQueryContext, new CaseUserFilterCriteria().excludeCasesFromContacts(true)); Predicate criteriaFilter = createCaseCriteriaFilter(dashboardCriteria, caseQueryContext); filter = CriteriaBuilderHelper.and(cb, filter, criteriaFilter); @@ -395,9 +395,7 @@ private Predicate createCaseCriteriaFilter( cb, filter, caseService.createNewCaseFilter( - cq, - cb, - from, + caseQueryContext, DateHelper.getStartOfDay(dashboardCriteria.getDateFrom()), DateHelper.getEndOfDay(dashboardCriteria.getDateTo()), dashboardCriteria.getNewCaseDateType())); diff --git a/sormas-backend/src/main/java/de/symeda/sormas/backend/person/PersonService.java b/sormas-backend/src/main/java/de/symeda/sormas/backend/person/PersonService.java index aeb4f5fdc0f..a8ae3953b3a 100644 --- a/sormas-backend/src/main/java/de/symeda/sormas/backend/person/PersonService.java +++ b/sormas-backend/src/main/java/de/symeda/sormas/backend/person/PersonService.java @@ -54,6 +54,7 @@ import javax.transaction.Transactional; import javax.validation.constraints.NotNull; +import de.symeda.sormas.backend.caze.CaseQueryContext; import de.symeda.sormas.backend.travelentry.TravelEntryQueryContext; import org.apache.commons.lang3.StringUtils; @@ -253,7 +254,7 @@ public Predicate createUserFilter(PersonQueryContext personQueryContext, PersonC // 1. Define filters per association lazy to avoid superfluous joins final Supplier caseFilter = () -> CriteriaBuilderHelper.and( cb, - caseService.createUserFilter(cb, cq, joins.getCaze(), new CaseUserFilterCriteria()), + caseService.createUserFilter(new CaseQueryContext(cb, cq, joins.getCaseJoins()), new CaseUserFilterCriteria()), caseService.createDefaultFilter(cb, joins.getCaze())); final Supplier contactFilter = () -> { final Predicate contactUserFilter = contactService.createUserFilter( diff --git a/sormas-backend/src/main/java/de/symeda/sormas/backend/sample/SampleService.java b/sormas-backend/src/main/java/de/symeda/sormas/backend/sample/SampleService.java index 8d1eb18a29a..0b2b71b64c7 100644 --- a/sormas-backend/src/main/java/de/symeda/sormas/backend/sample/SampleService.java +++ b/sormas-backend/src/main/java/de/symeda/sormas/backend/sample/SampleService.java @@ -632,7 +632,7 @@ public Predicate createUserFilter(SampleQueryContext sampleQueryContext, SampleC if (criteria != null && criteria.getSampleAssociationType() != null && criteria.getSampleAssociationType() != SampleAssociationType.ALL) { final SampleAssociationType sampleAssociationType = criteria.getSampleAssociationType(); if (sampleAssociationType == SampleAssociationType.CASE) { - filter = CriteriaBuilderHelper.or(cb, filter, caseService.createUserFilter(cb, cq, joins.getCaze(), null)); + filter = CriteriaBuilderHelper.or(cb, filter, caseService.createUserFilter(new CaseQueryContext(cb, cq, joins.getCaseJoins()), null)); } else if (sampleAssociationType == SampleAssociationType.CONTACT) { filter = CriteriaBuilderHelper .or(cb, filter, contactService.createUserFilter(new ContactQueryContext(cb, cq, joins.getContactJoins()), null)); @@ -648,14 +648,14 @@ public Predicate createUserFilter(SampleQueryContext sampleQueryContext, SampleC filter, CriteriaBuilderHelper.or( cb, - caseService.createUserFilter(cb, cq, joins.getCaze(), null), + caseService.createUserFilter(new CaseQueryContext(cb, cq, joins.getCaseJoins()), null), contactService.createUserFilter(new ContactQueryContext(cb, cq, joins.getContactJoins()), null), eventParticipantService.createUserFilter(new EventParticipantQueryContext(cb, cq, joins.getEventParticipantJoins())))); } else { filter = CriteriaBuilderHelper.or( cb, filter, - caseService.createUserFilter(cb, cq, joins.getCaze(), null), + caseService.createUserFilter(new CaseQueryContext(cb, cq, joins.getCaseJoins()), null), contactService.createUserFilter(new ContactQueryContext(cb, cq, joins.getContactJoins()), null), eventParticipantService.createUserFilter(new EventParticipantQueryContext(cb, cq, joins.getEventParticipantJoins()))); } From d2dfe80295d8993db60de0eb66f53b44647ccb49 Mon Sep 17 00:00:00 2001 From: Bartha Barna Date: Thu, 21 Apr 2022 11:46:01 +0300 Subject: [PATCH 015/167] #8747 - log warning on usage of old createUserFilter methods --- .../java/de/symeda/sormas/backend/action/ActionService.java | 1 + .../main/java/de/symeda/sormas/backend/caze/CaseService.java | 1 + .../java/de/symeda/sormas/backend/contact/ContactService.java | 1 + .../symeda/sormas/backend/event/EventParticipantService.java | 3 ++- .../main/java/de/symeda/sormas/backend/event/EventService.java | 1 + .../backend/immunization/DirectoryImmunizationService.java | 3 ++- .../sormas/backend/immunization/ImmunizationService.java | 3 ++- .../java/de/symeda/sormas/backend/sample/SampleService.java | 3 ++- .../main/java/de/symeda/sormas/backend/task/TaskService.java | 3 ++- .../backend/travelentry/services/BaseTravelEntryService.java | 3 ++- 10 files changed, 16 insertions(+), 6 deletions(-) diff --git a/sormas-backend/src/main/java/de/symeda/sormas/backend/action/ActionService.java b/sormas-backend/src/main/java/de/symeda/sormas/backend/action/ActionService.java index 14f51c8006c..04d978866d3 100644 --- a/sormas-backend/src/main/java/de/symeda/sormas/backend/action/ActionService.java +++ b/sormas-backend/src/main/java/de/symeda/sormas/backend/action/ActionService.java @@ -102,6 +102,7 @@ public List getAllByEvent(Event event) { @SuppressWarnings("rawtypes") @Override public Predicate createUserFilter(CriteriaBuilder cb, CriteriaQuery cq, From actionPath) { + logger.warn("Obsolete createUserFilter method called!"); return createUserFilter(new ActionQueryContext(cb, cq, actionPath)); } diff --git a/sormas-backend/src/main/java/de/symeda/sormas/backend/caze/CaseService.java b/sormas-backend/src/main/java/de/symeda/sormas/backend/caze/CaseService.java index b33fbcd03dd..50df2d6f51d 100644 --- a/sormas-backend/src/main/java/de/symeda/sormas/backend/caze/CaseService.java +++ b/sormas-backend/src/main/java/de/symeda/sormas/backend/caze/CaseService.java @@ -1200,6 +1200,7 @@ public Predicate createUserFilter(CaseQueryContext caseQueryContext, CaseUserFil @SuppressWarnings("rawtypes") @Override public Predicate createUserFilter(CriteriaBuilder cb, CriteriaQuery cq, From casePath) { + logger.warn("Obsolete createUserFilter method called!"); return createUserFilter(new CaseQueryContext(cb, cq, casePath)); } diff --git a/sormas-backend/src/main/java/de/symeda/sormas/backend/contact/ContactService.java b/sormas-backend/src/main/java/de/symeda/sormas/backend/contact/ContactService.java index c874cf82e9c..1afe896ff9f 100644 --- a/sormas-backend/src/main/java/de/symeda/sormas/backend/contact/ContactService.java +++ b/sormas-backend/src/main/java/de/symeda/sormas/backend/contact/ContactService.java @@ -958,6 +958,7 @@ public List getAllByVisit(Visit visit) { @SuppressWarnings("rawtypes") public Predicate createUserFilter(CriteriaBuilder cb, CriteriaQuery cq, From contactPath) { + logger.warn("Obsolete createUserFilter method called!"); return createUserFilter(new ContactQueryContext(cb, cq, contactPath), null); } diff --git a/sormas-backend/src/main/java/de/symeda/sormas/backend/event/EventParticipantService.java b/sormas-backend/src/main/java/de/symeda/sormas/backend/event/EventParticipantService.java index 6851e830b08..e944a7d259a 100644 --- a/sormas-backend/src/main/java/de/symeda/sormas/backend/event/EventParticipantService.java +++ b/sormas-backend/src/main/java/de/symeda/sormas/backend/event/EventParticipantService.java @@ -273,7 +273,8 @@ public Predicate createActiveEventParticipantsFilter(CriteriaBuilder cb, Join eventParticipantPath) { - throw new UnsupportedOperationException("Method should no longer be used!"); + logger.warn("Obsolete createUserFilter method called!"); + return createUserFilter(new EventParticipantQueryContext(cb, cq, eventParticipantPath)); } public Predicate createUserFilter(EventParticipantQueryContext eventParticipantQueryContext) { diff --git a/sormas-backend/src/main/java/de/symeda/sormas/backend/event/EventService.java b/sormas-backend/src/main/java/de/symeda/sormas/backend/event/EventService.java index 28450299dcb..d375ca568dc 100644 --- a/sormas-backend/src/main/java/de/symeda/sormas/backend/event/EventService.java +++ b/sormas-backend/src/main/java/de/symeda/sormas/backend/event/EventService.java @@ -341,6 +341,7 @@ public List getDeletedUuidsSince(Date since) { @SuppressWarnings("rawtypes") @Override public Predicate createUserFilter(CriteriaBuilder cb, CriteriaQuery cq, From eventPath) { + logger.warn("Obsolete createUserFilter method called!"); return createUserFilter(new EventQueryContext(cb, cq, new EventJoins(eventPath))); } diff --git a/sormas-backend/src/main/java/de/symeda/sormas/backend/immunization/DirectoryImmunizationService.java b/sormas-backend/src/main/java/de/symeda/sormas/backend/immunization/DirectoryImmunizationService.java index 192a8444ba6..17e1b4ae445 100644 --- a/sormas-backend/src/main/java/de/symeda/sormas/backend/immunization/DirectoryImmunizationService.java +++ b/sormas-backend/src/main/java/de/symeda/sormas/backend/immunization/DirectoryImmunizationService.java @@ -67,7 +67,8 @@ public DirectoryImmunizationService() { @Override public Predicate createUserFilter(CriteriaBuilder cb, CriteriaQuery cq, From immunizationDirectoryPath) { - throw new UnsupportedOperationException("Method should no longer be used!"); + logger.warn("Obsolete createUserFilter method called!"); + return createUserFilter(new DirectoryImmunizationQueryContext(cb, cq, immunizationDirectoryPath)); } public List getIndexList(ImmunizationCriteria criteria, Integer first, Integer max, List sortProperties) { diff --git a/sormas-backend/src/main/java/de/symeda/sormas/backend/immunization/ImmunizationService.java b/sormas-backend/src/main/java/de/symeda/sormas/backend/immunization/ImmunizationService.java index 539b561562e..28d389e8a9a 100644 --- a/sormas-backend/src/main/java/de/symeda/sormas/backend/immunization/ImmunizationService.java +++ b/sormas-backend/src/main/java/de/symeda/sormas/backend/immunization/ImmunizationService.java @@ -164,7 +164,8 @@ public boolean inJurisdictionOrOwned(Immunization immunization) { @Override public Predicate createUserFilter(CriteriaBuilder cb, CriteriaQuery cq, From immunizationPath) { - throw new UnsupportedOperationException("Method should no longer be used!"); + logger.warn("Obsolete createUserFilter method called!"); + return createUserFilter(new ImmunizationQueryContext(cb, cq, immunizationPath)); } public Predicate createActiveImmunizationsFilter(CriteriaBuilder cb, From root) { diff --git a/sormas-backend/src/main/java/de/symeda/sormas/backend/sample/SampleService.java b/sormas-backend/src/main/java/de/symeda/sormas/backend/sample/SampleService.java index 0b2b71b64c7..1d96bb88a01 100644 --- a/sormas-backend/src/main/java/de/symeda/sormas/backend/sample/SampleService.java +++ b/sormas-backend/src/main/java/de/symeda/sormas/backend/sample/SampleService.java @@ -607,7 +607,8 @@ public Map getNewTestResultCountByResultType(List< @SuppressWarnings("rawtypes") @Deprecated public Predicate createUserFilter(CriteriaBuilder cb, CriteriaQuery cq, From samplePath) { - throw new UnsupportedOperationException("Method should no longer be used!"); + logger.warn("Obsolete createUserFilter method called!"); + return createUserFilter(new SampleQueryContext(cb, cq, samplePath), null); } @SuppressWarnings("rawtypes") diff --git a/sormas-backend/src/main/java/de/symeda/sormas/backend/task/TaskService.java b/sormas-backend/src/main/java/de/symeda/sormas/backend/task/TaskService.java index f443266d146..c9c77f4eef7 100644 --- a/sormas-backend/src/main/java/de/symeda/sormas/backend/task/TaskService.java +++ b/sormas-backend/src/main/java/de/symeda/sormas/backend/task/TaskService.java @@ -144,7 +144,8 @@ public List getAllActiveUuids(User user) { "unchecked" }) @Override public Predicate createUserFilter(CriteriaBuilder cb, CriteriaQuery cq, From taskPath) { - throw new UnsupportedOperationException("Method should no longer be used!"); + logger.warn("Obsolete createUserFilter method called!"); + return createUserFilter(new TaskQueryContext(cb, cq, taskPath)); } @SuppressWarnings({ diff --git a/sormas-backend/src/main/java/de/symeda/sormas/backend/travelentry/services/BaseTravelEntryService.java b/sormas-backend/src/main/java/de/symeda/sormas/backend/travelentry/services/BaseTravelEntryService.java index 56fefbb418a..47d02af8b20 100644 --- a/sormas-backend/src/main/java/de/symeda/sormas/backend/travelentry/services/BaseTravelEntryService.java +++ b/sormas-backend/src/main/java/de/symeda/sormas/backend/travelentry/services/BaseTravelEntryService.java @@ -36,7 +36,8 @@ public BaseTravelEntryService() { @Override public Predicate createUserFilter(CriteriaBuilder cb, CriteriaQuery cq, From travelEntryPath) { - throw new UnsupportedOperationException("Method should no longer be used!"); + logger.warn("Obsolete createUserFilter method called!"); + return createUserFilter(new TravelEntryQueryContext(cb, cq, travelEntryPath)); } public Predicate inJurisdictionOrOwned(TravelEntryQueryContext qc, User user) { From d5cc6e673733a19de355ff34302adb75bab1ad24 Mon Sep 17 00:00:00 2001 From: Bartha Barna Date: Thu, 21 Apr 2022 14:10:36 +0300 Subject: [PATCH 016/167] #8747 - fix event participant criteria filter --- .../symeda/sormas/backend/event/EventParticipantService.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sormas-backend/src/main/java/de/symeda/sormas/backend/event/EventParticipantService.java b/sormas-backend/src/main/java/de/symeda/sormas/backend/event/EventParticipantService.java index e944a7d259a..2d354927bcb 100644 --- a/sormas-backend/src/main/java/de/symeda/sormas/backend/event/EventParticipantService.java +++ b/sormas-backend/src/main/java/de/symeda/sormas/backend/event/EventParticipantService.java @@ -177,7 +177,7 @@ public Predicate buildCriteriaFilter(EventParticipantCriteria criteria, EventPar final CriteriaQuery cq = eventParticipantQueryContext.getQuery(); final EventParticipantJoins joins = eventParticipantQueryContext.getJoins(); final Join event = joins.getEvent(JoinType.LEFT); - final Join person = joins.getCasePerson(); + final Join person = joins.getPerson(); final PersonQueryContext personQueryContext = new PersonQueryContext(cb, cq, joins.getPersonJoins()); Predicate filter = null; @@ -213,7 +213,7 @@ public Predicate buildCriteriaFilter(EventParticipantCriteria criteria, EventPar filter = CriteriaBuilderHelper.and(cb, filter, cb.equal(person.get(Person.BIRTHDATE_DD), criteria.getBirthdateDD())); } if (criteria.getPathogenTestResult() != null) { - Join samples = joins.getSamples(); + Join samples = from.join(EventParticipant.SAMPLES, JoinType.LEFT); filter = CriteriaBuilderHelper.and(cb, filter, cb.equal(samples.get(Sample.PATHOGEN_TEST_RESULT), criteria.getPathogenTestResult())); } if (criteria.getVaccinationStatus() != null) { From 95e4f1a2f1164854930046ed7429012b5e7833a9 Mon Sep 17 00:00:00 2001 From: jparzuch Date: Thu, 21 Apr 2022 16:49:11 +0200 Subject: [PATCH 017/167] Added tests for column sorting --- .../steps/web/application/ColumnSteps.java | 232 ++++++++++++++++ .../persons/PersonDetailedTableViewSteps.java | 76 ------ .../features/sanity/web/Columns.feature | 254 ++++++++++++++++++ .../features/sanity/web/Persons.feature | 26 +- 4 files changed, 487 insertions(+), 101 deletions(-) create mode 100644 sormas-e2e-tests/src/test/java/org/sormas/e2etests/steps/web/application/ColumnSteps.java create mode 100644 sormas-e2e-tests/src/test/resources/features/sanity/web/Columns.feature diff --git a/sormas-e2e-tests/src/test/java/org/sormas/e2etests/steps/web/application/ColumnSteps.java b/sormas-e2e-tests/src/test/java/org/sormas/e2etests/steps/web/application/ColumnSteps.java new file mode 100644 index 00000000000..1207e5b8709 --- /dev/null +++ b/sormas-e2e-tests/src/test/java/org/sormas/e2etests/steps/web/application/ColumnSteps.java @@ -0,0 +1,232 @@ +package org.sormas.e2etests.steps.web.application; + +import cucumber.api.java8.En; +import java.nio.charset.StandardCharsets; +import java.time.LocalDate; +import java.time.LocalDateTime; +import java.time.format.DateTimeFormatter; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Comparator; +import java.util.List; +import java.util.concurrent.TimeUnit; +import javax.inject.Inject; +import lombok.extern.slf4j.Slf4j; +import org.openqa.selenium.By; +import org.sormas.e2etests.helpers.WebDriverHelpers; +import org.testng.asserts.SoftAssert; + +@Slf4j +public class ColumnSteps implements En { + + private final WebDriverHelpers webDriverHelpers; + + @Inject + public ColumnSteps(WebDriverHelpers webDriverHelpers, SoftAssert softly) { + this.webDriverHelpers = webDriverHelpers; + + When( + "I click the header of column {int}", + (Integer col) -> { + webDriverHelpers.clickOnWebElementBySelector( + By.xpath("//thead//tr//th[" + col.toString() + "]")); + webDriverHelpers.waitForPageLoadingSpinnerToDisappear(15); + }); + + When( + "I check that column {int} is sorted alphabetically in ascending order", + (Integer col) -> { + TimeUnit.SECONDS.sleep(2); // For preventing premature data collection + List rawColumnData = getTableColumnDataByIndex(col, 10); + rawColumnData.replaceAll(element -> element.toLowerCase()); + rawColumnData.replaceAll(element -> nullifyEmptyString(element)); + List ascColumnData = new ArrayList<>(rawColumnData); + ascColumnData.sort(Comparator.nullsLast(Comparator.naturalOrder())); + softly.assertEquals( + rawColumnData, + ascColumnData, + "Column " + col.toString() + " is not correctly sorted!"); + softly.assertAll(); + }); + + When( + "I check that column {int} is sorted alphabetically in descending order", + (Integer col) -> { + TimeUnit.SECONDS.sleep(2); // For preventing premature data collection + List rawColumnData = getTableColumnDataByIndex(col, 10); + rawColumnData.replaceAll(element -> element.toLowerCase()); + rawColumnData.replaceAll(element -> nullifyEmptyString(element)); + List desColumnData = new ArrayList<>(rawColumnData); + desColumnData.sort(Comparator.nullsFirst(Comparator.reverseOrder())); + softly.assertEquals( + rawColumnData, + desColumnData, + "Column " + col.toString() + " is not correctly sorted!"); + softly.assertAll(); + }); + + When( + "I check that column {int} is sorted by last name in ascending order", + (Integer col) -> { + TimeUnit.SECONDS.sleep(2); // For preventing premature data collection + List rawColumnData = getTableColumnDataByIndex(col, 10); + rawColumnData.replaceAll(element -> nullifyEmptyString(element)); + rawColumnData.replaceAll(element -> getLastName(element)); + List ascColumnData = new ArrayList<>(rawColumnData); + ascColumnData.sort(Comparator.nullsLast(Comparator.naturalOrder())); + softly.assertEquals( + rawColumnData, + ascColumnData, + "Column " + col.toString() + " is not correctly sorted!"); + softly.assertAll(); + }); + + When( + "I check that column {int} is sorted by last name in descending order", + (Integer col) -> { + TimeUnit.SECONDS.sleep(2); // For preventing premature data collection + List rawColumnData = getTableColumnDataByIndex(col, 10); + rawColumnData.replaceAll(element -> nullifyEmptyString(element)); + rawColumnData.replaceAll(element -> getLastName(element)); + List desColumnData = new ArrayList<>(rawColumnData); + desColumnData.sort(Comparator.nullsFirst(Comparator.reverseOrder())); + softly.assertEquals( + rawColumnData, + desColumnData, + "Column " + col.toString() + " is not correctly sorted!"); + softly.assertAll(); + }); + + When( + "I check that column {int} is sorted by date in ascending order", + (Integer col) -> { + TimeUnit.SECONDS.sleep(2); // For preventing premature data collection + List rawColumnData = getTableColumnDataByIndex(col, 10); + rawColumnData.replaceAll(element -> nullifyEmptyString(element)); + rawColumnData.replaceAll(element -> makeDateSortable(element)); + List ascColumnData = new ArrayList<>(rawColumnData); + ascColumnData.sort(Comparator.nullsLast(Comparator.naturalOrder())); + softly.assertEquals( + rawColumnData, + ascColumnData, + "Column " + col.toString() + " is not correctly sorted!"); + softly.assertAll(); + }); + + When( + "I check that column {int} is sorted by date in descending order", + (Integer col) -> { + TimeUnit.SECONDS.sleep(2); // For preventing premature data collection + List rawColumnData = getTableColumnDataByIndex(col, 10); + rawColumnData.replaceAll(element -> nullifyEmptyString(element)); + rawColumnData.replaceAll(element -> makeDateSortable(element)); + List desColumnData = new ArrayList<>(rawColumnData); + desColumnData.sort(Comparator.nullsFirst(Comparator.reverseOrder())); + softly.assertEquals( + rawColumnData, + desColumnData, + "Column " + col.toString() + " is not correctly sorted!"); + softly.assertAll(); + }); + + When( + "I check that column {int} is sorted by date and time in ascending order", + (Integer col) -> { + TimeUnit.SECONDS.sleep(2); // For preventing premature data collection + List rawColumnData = getTableColumnDataByIndex(col, 10); + rawColumnData.replaceAll(element -> nullifyEmptyString(element)); + rawColumnData.replaceAll(element -> makeDateTimeSortable(element)); + List ascColumnData = new ArrayList<>(rawColumnData); + ascColumnData.sort(Comparator.nullsLast(Comparator.naturalOrder())); + softly.assertEquals( + rawColumnData, + ascColumnData, + "Column " + col.toString() + " is not correctly sorted!"); + softly.assertAll(); + }); + + When( + "I check that column {int} is sorted by date and time in descending order", + (Integer col) -> { + TimeUnit.SECONDS.sleep(2); // For preventing premature data collection + List rawColumnData = getTableColumnDataByIndex(col, 10); + rawColumnData.replaceAll(element -> nullifyEmptyString(element)); + rawColumnData.replaceAll(element -> makeDateTimeSortable(element)); + List desColumnData = new ArrayList<>(rawColumnData); + desColumnData.sort(Comparator.nullsFirst(Comparator.reverseOrder())); + softly.assertEquals( + rawColumnData, + desColumnData, + "Column " + col.toString() + " is not correctly sorted!"); + softly.assertAll(); + }); + + When( + "I check that an upwards arrow appears in the header of column {int}", + (Integer col) -> { + String upArrowBytes = "[34, -17, -125, -98, 32, 34]"; + String content = + webDriverHelpers.javascriptGetElementContent( + "'table > thead > tr > th:nth-of-type(" + col + ")'),'::after'"); + byte[] array = content.getBytes(StandardCharsets.UTF_8); + softly.assertEquals( + Arrays.toString(array), upArrowBytes, "The upwards arrow is not displayed!"); + softly.assertAll(); + }); + + When( + "I check that a downwards arrow appears in the header of column {int}", + (Integer col) -> { + String downArrowBytes = "[34, -17, -125, -99, 32, 34]"; + String content = + webDriverHelpers.javascriptGetElementContent( + "'table > thead > tr > th:nth-of-type(" + col + ")'),'::after'"); + byte[] array = content.getBytes(StandardCharsets.UTF_8); + softly.assertEquals( + Arrays.toString(array), downArrowBytes, "The downwards arrow is not displayed!"); + softly.assertAll(); + }); + } + + private List getTableColumnDataByIndex(int col, int maxRows) { + List list = new ArrayList<>(); + for (int i = 1; i < maxRows + 1; i++) { + list.add( + webDriverHelpers.getTextFromWebElement( + By.xpath("//tbody//tr[" + i + "]//td[" + col + "]"))); + } + return list; + } + + private String nullifyEmptyString(String string) { + if (string.isEmpty()) { + string = null; + } + return string; + } + + private String makeDateSortable(String date) { + if (date != null) { + date = + LocalDate.parse(date, DateTimeFormatter.ofPattern("M/d/yyyy")) + .format(DateTimeFormatter.ofPattern("yyyy-MM-dd")); + } + return date; + } + + private String makeDateTimeSortable(String dateTime) { + if (dateTime != null) { + dateTime = + LocalDateTime.parse(dateTime, DateTimeFormatter.ofPattern("M/d/yyyy h:mm a")) + .format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm")); + } + return dateTime; + } + + private String getLastName(String string) { + if (string != null) { + string = string.substring(string.indexOf(" ") + 1, string.indexOf("(") - 1); + } + return string; + } +} diff --git a/sormas-e2e-tests/src/test/java/org/sormas/e2etests/steps/web/application/persons/PersonDetailedTableViewSteps.java b/sormas-e2e-tests/src/test/java/org/sormas/e2etests/steps/web/application/persons/PersonDetailedTableViewSteps.java index 7f224b521f8..34b460780e1 100644 --- a/sormas-e2e-tests/src/test/java/org/sormas/e2etests/steps/web/application/persons/PersonDetailedTableViewSteps.java +++ b/sormas-e2e-tests/src/test/java/org/sormas/e2etests/steps/web/application/persons/PersonDetailedTableViewSteps.java @@ -3,17 +3,11 @@ import static org.sormas.e2etests.pages.application.persons.PersonDirectoryPage.PERSON_DETAILED_COLUMN_HEADERS; import cucumber.api.java8.En; -import java.nio.charset.StandardCharsets; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.Comparator; import java.util.HashMap; -import java.util.List; import java.util.Map; import java.util.concurrent.atomic.AtomicInteger; import javax.inject.Inject; import lombok.extern.slf4j.Slf4j; -import org.openqa.selenium.By; import org.sormas.e2etests.helpers.WebDriverHelpers; import org.sormas.e2etests.steps.BaseSteps; import org.testng.asserts.SoftAssert; @@ -68,66 +62,6 @@ public PersonDetailedTableViewSteps( "The PRIMARY EMAIL ADDRESS column is not correctly displayed!"); softly.assertAll(); }); - - When( - "I click the header of column {int} in Person directory", - (Integer col) -> { - webDriverHelpers.clickOnWebElementBySelector( - By.xpath("//thead//tr//th[" + col.toString() + "]")); - webDriverHelpers.waitForPageLoadingSpinnerToDisappear(5); - }); - - When( - "I check that column {int} is sorted in ascending order", - (Integer col) -> { - List rawColumnData = getTableColumnDataByIndex(col, 10); - List ascColumnData = new ArrayList<>(rawColumnData); - ascColumnData.sort(Comparator.naturalOrder()); - softly.assertEquals( - rawColumnData, - ascColumnData, - "Column " + col.toString() + " is not correctly sorted!"); - softly.assertAll(); - }); - - When( - "I check that column {int} is sorted in descending order", - (Integer col) -> { - List rawColumnData = getTableColumnDataByIndex(col, 10); - List desColumnData = new ArrayList<>(rawColumnData); - desColumnData.sort(Comparator.reverseOrder()); - softly.assertEquals( - rawColumnData, - desColumnData, - "Column " + col.toString() + " is not correctly sorted!"); - softly.assertAll(); - }); - - When( - "I check that an upwards arrow appears in the header of column {int}", - (Integer col) -> { - String upArrowBytes = "[34, -17, -125, -98, 32, 34]"; - String content = - webDriverHelpers.javascriptGetElementContent( - "'table > thead > tr > th:nth-of-type(" + col + ")'),'::after'"); - byte[] array = content.getBytes(StandardCharsets.UTF_8); - softly.assertEquals( - Arrays.toString(array), upArrowBytes, "The upwards arrow is not displayed!"); - softly.assertAll(); - }); - - When( - "I check that a downwards arrow appears in the header of column {int}", - (Integer col) -> { - String downArrowBytes = "[34, -17, -125, -99, 32, 34]"; - String content = - webDriverHelpers.javascriptGetElementContent( - "'table > thead > tr > th:nth-of-type(" + col + ")'),'::after'"); - byte[] array = content.getBytes(StandardCharsets.UTF_8); - softly.assertEquals( - Arrays.toString(array), downArrowBytes, "The downwards arrow is not displayed!"); - softly.assertAll(); - }); } private Map extractColumnHeadersHashMap() { @@ -147,14 +81,4 @@ private Map extractColumnHeadersHashMap() { }); return headerHashmap; } - - private List getTableColumnDataByIndex(int col, int maxRows) { - List list = new ArrayList<>(); - for (int i = 1; i < maxRows + 1; i++) { - list.add( - webDriverHelpers.getTextFromWebElement( - By.xpath("//tbody//tr[" + i + "]//td[" + col + "]"))); - } - return list; - } } diff --git a/sormas-e2e-tests/src/test/resources/features/sanity/web/Columns.feature b/sormas-e2e-tests/src/test/resources/features/sanity/web/Columns.feature new file mode 100644 index 00000000000..f08a38cd411 --- /dev/null +++ b/sormas-e2e-tests/src/test/resources/features/sanity/web/Columns.feature @@ -0,0 +1,254 @@ +@UI @Sanity @Columns +Feature: Test column sorting for different entities + +@env_main @issue=SORDEV-5342 @Task +Scenario Outline: Sort column alphabetically in Tasks directory + Given I log in with National User + And I click on the Tasks button from navbar + When I click the header of column + Then I check that column is sorted alphabetically in ascending order + And I check that an upwards arrow appears in the header of column + When I click the header of column + Then I check that column is sorted alphabetically in descending order + And I check that a downwards arrow appears in the header of column + + Examples: + | col | + |3 | + |4 | + |5 | + |6 | + |7 | + |10 | + |11 | + |12 | + |13 | + |14 | + +@env_main @issue=SORDEV-5342 @Task +Scenario Outline: Sort column by date and time in Tasks directory + Given I log in with National User + And I click on the Tasks button from navbar + When I click the header of column + Then I check that column is sorted by date and time in ascending order + And I check that an upwards arrow appears in the header of column + When I click the header of column + Then I check that column is sorted by date and time in descending order + And I check that a downwards arrow appears in the header of column + + Examples: + | col | + |8 | + |9 | + +@env_main @issue=SORDEV-5342 @Persons +Scenario Outline: Sort column alphabetically in Persons directory + Given I log in with National User + And I click on the Persons button from navbar + When I click the header of column + Then I check that column is sorted alphabetically in ascending order + And I check that an upwards arrow appears in the header of column + When I click the header of column + Then I check that column is sorted alphabetically in descending order + And I check that a downwards arrow appears in the header of column + + Examples: + | col | + |1 | + |2 | + |3 | + |4 | + |5 | + |6 | + |7 | + |8 | + |9 | + |10 | + |11 | + |12 | + +@env_main @issue=SORDEV-5342 @Case +Scenario Outline: Sort column alphabetically in Cases directory + Given I log in with National User + And I click on the Cases button from navbar + When I click the header of column + Then I check that column is sorted alphabetically in ascending order + And I check that an upwards arrow appears in the header of column + When I click the header of column + Then I check that column is sorted alphabetically in descending order + And I check that a downwards arrow appears in the header of column + + Examples: + | col | + |1 | + |2 | + |3 | + |4 | + |5 | + |6 | + |7 | + |8 | + |9 | + |10 | + |11 | + |12 | + |13 | + |14 | + |16 | + |18 | + |20 | + |21 | + |22 | + |23 | + |24 | + +@env_main @issue=SORDEV-5342 @Case +Scenario Outline: Sort column by date and time in Cases directory + Given I log in with National User + And I click on the Cases button from navbar + When I click the header of column + Then I check that column is sorted by date and time in ascending order + And I check that an upwards arrow appears in the header of column + When I click the header of column + Then I check that column is sorted by date and time in descending order + And I check that a downwards arrow appears in the header of column + + Examples: + | col | + |15 | + |17 | + +@env_main @issue=SORDEV-5342 @Case +Scenario Outline: Sort column by date in Cases directory + Given I log in with National User + And I click on the Cases button from navbar + When I click the header of column + Then I check that column is sorted by date in ascending order + And I check that an upwards arrow appears in the header of column + When I click the header of column + Then I check that column is sorted by date in descending order + And I check that a downwards arrow appears in the header of column + + Examples: + | col | + |19 | + +@env_main @issue=SORDEV-5342 @Contacts +Scenario Outline: Sort column alphabetically in Contacts directory + Given I log in with National User + And I click on the Contacts button from navbar + When I click the header of column + Then I check that column is sorted alphabetically in ascending order + And I check that an upwards arrow appears in the header of column + When I click the header of column + Then I check that column is sorted alphabetically in descending order + And I check that a downwards arrow appears in the header of column + + Examples: + | col | + |1 | + |2 | + |3 | + |4 | + |5 | + |6 | + |7 | + |8 | + |9 | + |10 | + |11 | +# |12 | Non-alphabetical sorting order - find out whether it's a bug or a feature +# |13 | Non-alphabetical sorting order - find out whether it's a bug or a feature + |15 | + +@env_main @issue=SORDEV-5342 @Contacts +Scenario Outline: Sort column by date in Contacts directory + Given I log in with National User + And I click on the Contacts button from navbar + When I click the header of column + Then I check that column is sorted by date in ascending order + And I check that an upwards arrow appears in the header of column + When I click the header of column + Then I check that column is sorted by date in descending order + And I check that a downwards arrow appears in the header of column + + Examples: + | col | + |14 | + +@env_main @issue=SORDEV-5342 @issue=SORQA-78 @Event +Scenario Outline: Sort column alphabetically in Events directory + Given I log in with National User + And I click on the Events button from navbar + When I click the header of column + Then I check that column is sorted alphabetically in ascending order + And I check that an upwards arrow appears in the header of column + When I click the header of column + Then I check that column is sorted alphabetically in descending order + And I check that a downwards arrow appears in the header of column + + Examples: + | col | + |1 | + |2 | + |3 | + |4 | + |5 | + |6 | + |7 | + |8 | + |9 | + |10 | + |11 | + |12 | + |13 | + |14 | + |16 | + |17 | + |18 | + |19 | + |20 | + |22 | + |23 | + +@env_main @issue=SORDEV-5342 @Sample +Scenario Outline: Sort column alphabetically in Samples directory + Given I log in with National User + And I click on the Sample button from navbar + When I click the header of column + Then I check that column is sorted alphabetically in ascending order + And I check that an upwards arrow appears in the header of column + When I click the header of column + Then I check that column is sorted alphabetically in descending order + And I check that a downwards arrow appears in the header of column + + Examples: + | col | + |1 | + |2 | + |6 | + |7 | + |8 | + |9 | + |10 | + |11 | + |12 | + |13 | + |14 | + +@env_main @issue=SORDEV-5342 @Sample +Scenario Outline: Sort column by last name in Samples directory + Given I log in with National User + And I click on the Sample button from navbar + When I click the header of column + Then I check that column is sorted by last name in ascending order + And I check that an upwards arrow appears in the header of column + When I click the header of column + Then I check that column is sorted by last name in descending order + And I check that a downwards arrow appears in the header of column + + Examples: + | col | + |3 | + |4 | + |5 | \ No newline at end of file diff --git a/sormas-e2e-tests/src/test/resources/features/sanity/web/Persons.feature b/sormas-e2e-tests/src/test/resources/features/sanity/web/Persons.feature index 7e81da93fbe..2a5c6e25b14 100644 --- a/sormas-e2e-tests/src/test/resources/features/sanity/web/Persons.feature +++ b/sormas-e2e-tests/src/test/resources/features/sanity/web/Persons.feature @@ -140,31 +140,7 @@ Feature: Edit Persons Then I navigate to the last created via api Person page via URL @issue=SORDEV-8467 @env_main - Scenario: Test for columns in Person directory + Scenario: Test column structure in Person directory Given I log in with National User And I click on the Persons button from navbar Then I check that the Person table structure is correct - When I click the header of column 1 in Person directory - Then I check that column 1 is sorted in ascending order - And I check that an upwards arrow appears in the header of column 1 - When I click the header of column 1 in Person directory - And I check that column 1 is sorted in descending order - Then I check that a downwards arrow appears in the header of column 1 - When I click the header of column 2 in Person directory - Then I check that column 2 is sorted in ascending order - And I check that an upwards arrow appears in the header of column 2 - When I click the header of column 2 in Person directory - And I check that column 2 is sorted in descending order - Then I check that a downwards arrow appears in the header of column 2 - When I click the header of column 3 in Person directory - Then I check that column 3 is sorted in ascending order - And I check that an upwards arrow appears in the header of column 3 - When I click the header of column 3 in Person directory - And I check that column 3 is sorted in descending order - Then I check that a downwards arrow appears in the header of column 3 - When I click the header of column 5 in Person directory - Then I check that column 5 is sorted in ascending order - And I check that an upwards arrow appears in the header of column 5 - When I click the header of column 5 in Person directory - And I check that column 5 is sorted in descending order - Then I check that a downwards arrow appears in the header of column 5 From 1653a1a4bc5a5619974e02e11ae442bd05b0c905 Mon Sep 17 00:00:00 2001 From: jparzuch Date: Thu, 21 Apr 2022 18:38:04 +0200 Subject: [PATCH 018/167] Added sorting by age & minor fixes --- .../steps/web/application/ColumnSteps.java | 39 +++++++++++++++++++ .../features/sanity/web/Columns.feature | 23 ++++++++--- 2 files changed, 56 insertions(+), 6 deletions(-) diff --git a/sormas-e2e-tests/src/test/java/org/sormas/e2etests/steps/web/application/ColumnSteps.java b/sormas-e2e-tests/src/test/java/org/sormas/e2etests/steps/web/application/ColumnSteps.java index 1207e5b8709..e72bc601fe9 100644 --- a/sormas-e2e-tests/src/test/java/org/sormas/e2etests/steps/web/application/ColumnSteps.java +++ b/sormas-e2e-tests/src/test/java/org/sormas/e2etests/steps/web/application/ColumnSteps.java @@ -97,6 +97,38 @@ public ColumnSteps(WebDriverHelpers webDriverHelpers, SoftAssert softly) { softly.assertAll(); }); + When( + "I check that column {int} is sorted by age in ascending order", + (Integer col) -> { + TimeUnit.SECONDS.sleep(2); // For preventing premature data collection + List rawColumnData = getTableColumnDataByIndex(col, 10); + rawColumnData.replaceAll(element -> nullifyEmptyString(element)); + rawColumnData.replaceAll(element -> getAge(element)); + List ascColumnData = new ArrayList<>(rawColumnData); + ascColumnData.sort(Comparator.nullsLast(Comparator.naturalOrder())); + softly.assertEquals( + rawColumnData, + ascColumnData, + "Column " + col.toString() + " is not correctly sorted!"); + softly.assertAll(); + }); + + When( + "I check that column {int} is sorted by age in descending order", + (Integer col) -> { + TimeUnit.SECONDS.sleep(2); // For preventing premature data collection + List rawColumnData = getTableColumnDataByIndex(col, 10); + rawColumnData.replaceAll(element -> nullifyEmptyString(element)); + rawColumnData.replaceAll(element -> getAge(element)); + List desColumnData = new ArrayList<>(rawColumnData); + desColumnData.sort(Comparator.nullsFirst(Comparator.reverseOrder())); + softly.assertEquals( + rawColumnData, + desColumnData, + "Column " + col.toString() + " is not correctly sorted!"); + softly.assertAll(); + }); + When( "I check that column {int} is sorted by date in ascending order", (Integer col) -> { @@ -229,4 +261,11 @@ private String getLastName(String string) { } return string; } + + private String getAge(String string) { + if (string != null) { + string = string.substring(0, string.indexOf(" ")); + } + return string; + } } diff --git a/sormas-e2e-tests/src/test/resources/features/sanity/web/Columns.feature b/sormas-e2e-tests/src/test/resources/features/sanity/web/Columns.feature index f08a38cd411..81d43fc62a3 100644 --- a/sormas-e2e-tests/src/test/resources/features/sanity/web/Columns.feature +++ b/sormas-e2e-tests/src/test/resources/features/sanity/web/Columns.feature @@ -57,7 +57,6 @@ Scenario Outline: Sort column alphabetically in Persons directory |1 | |2 | |3 | - |4 | |5 | |6 | |7 | @@ -67,6 +66,21 @@ Scenario Outline: Sort column alphabetically in Persons directory |11 | |12 | +@env_main @issue=SORDEV-5342 @Persons +Scenario Outline: Sort column by age in Persons directory + Given I log in with National User + And I click on the Persons button from navbar + When I click the header of column + Then I check that column is sorted by age in ascending order + And I check that an upwards arrow appears in the header of column + When I click the header of column + Then I check that column is sorted by age in descending order + And I check that a downwards arrow appears in the header of column + + Examples: + | col | + |4 | + @env_main @issue=SORDEV-5342 @Case Scenario Outline: Sort column alphabetically in Cases directory Given I log in with National User @@ -94,13 +108,10 @@ Scenario Outline: Sort column alphabetically in Cases directory |12 | |13 | |14 | - |16 | + |15 | |18 | |20 | - |21 | |22 | - |23 | - |24 | @env_main @issue=SORDEV-5342 @Case Scenario Outline: Sort column by date and time in Cases directory @@ -115,7 +126,7 @@ Scenario Outline: Sort column by date and time in Cases directory Examples: | col | - |15 | + |16 | |17 | @env_main @issue=SORDEV-5342 @Case From a1904f17cf1afb944db32b5784b66a140d76f745 Mon Sep 17 00:00:00 2001 From: jparzuch Date: Thu, 21 Apr 2022 19:48:02 +0200 Subject: [PATCH 019/167] Ignored two columns that need verifying --- .../src/test/resources/features/sanity/web/Columns.feature | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sormas-e2e-tests/src/test/resources/features/sanity/web/Columns.feature b/sormas-e2e-tests/src/test/resources/features/sanity/web/Columns.feature index 81d43fc62a3..f703787755f 100644 --- a/sormas-e2e-tests/src/test/resources/features/sanity/web/Columns.feature +++ b/sormas-e2e-tests/src/test/resources/features/sanity/web/Columns.feature @@ -55,7 +55,7 @@ Scenario Outline: Sort column alphabetically in Persons directory Examples: | col | |1 | - |2 | +# |2 | Non-alphabetical sorting order - find out whether it's a bug or a feature |3 | |5 | |6 | @@ -213,7 +213,7 @@ Scenario Outline: Sort column alphabetically in Events directory |11 | |12 | |13 | - |14 | +# |14 | Non-alphabetical sorting order - find out whether it's a bug or a feature |16 | |17 | |18 | From c7b519d8a9309dd7aef79c9074e99b5f2b833243 Mon Sep 17 00:00:00 2001 From: Stefan Kock Date: Fri, 22 Apr 2022 09:00:36 +0200 Subject: [PATCH 020/167] #8747 Introduced QueryContext for Campaigns --- .../backend/campaign/CampaignFacadeEjb.java | 14 ++++++----- .../backend/campaign/CampaignJoins.java | 12 ++++++++++ .../campaign/CampaignQueryContext.java | 24 +++++++++++++++++++ .../backend/campaign/CampaignService.java | 11 +++++++-- 4 files changed, 53 insertions(+), 8 deletions(-) create mode 100644 sormas-backend/src/main/java/de/symeda/sormas/backend/campaign/CampaignJoins.java create mode 100644 sormas-backend/src/main/java/de/symeda/sormas/backend/campaign/CampaignQueryContext.java diff --git a/sormas-backend/src/main/java/de/symeda/sormas/backend/campaign/CampaignFacadeEjb.java b/sormas-backend/src/main/java/de/symeda/sormas/backend/campaign/CampaignFacadeEjb.java index ed7bee50f60..231f061f25c 100644 --- a/sormas-backend/src/main/java/de/symeda/sormas/backend/campaign/CampaignFacadeEjb.java +++ b/sormas-backend/src/main/java/de/symeda/sormas/backend/campaign/CampaignFacadeEjb.java @@ -25,10 +25,10 @@ import javax.validation.Valid; import javax.validation.constraints.NotNull; -import de.symeda.sormas.api.EditPermissionType; import org.apache.commons.collections.CollectionUtils; import org.apache.commons.lang3.StringUtils; +import de.symeda.sormas.api.EditPermissionType; import de.symeda.sormas.api.campaign.CampaignCriteria; import de.symeda.sormas.api.campaign.CampaignDto; import de.symeda.sormas.api.campaign.CampaignFacade; @@ -36,6 +36,7 @@ import de.symeda.sormas.api.campaign.CampaignReferenceDto; import de.symeda.sormas.api.campaign.diagram.CampaignDashboardElement; import de.symeda.sormas.api.campaign.form.CampaignFormMetaReferenceDto; +import de.symeda.sormas.api.common.CoreEntityType; import de.symeda.sormas.api.deletionconfiguration.AutomaticDeletionInfoDto; import de.symeda.sormas.api.i18n.I18nProperties; import de.symeda.sormas.api.i18n.Strings; @@ -49,7 +50,6 @@ import de.symeda.sormas.backend.campaign.form.CampaignFormMetaService; import de.symeda.sormas.backend.common.AbstractCoreFacadeEjb; import de.symeda.sormas.backend.common.CriteriaBuilderHelper; -import de.symeda.sormas.api.common.CoreEntityType; import de.symeda.sormas.backend.user.User; import de.symeda.sormas.backend.user.UserFacadeEjb; import de.symeda.sormas.backend.user.UserRoleConfigFacadeEjb.UserRoleConfigFacadeEjbLocal; @@ -85,13 +85,14 @@ public List getIndexList(CampaignCriteria campaignCriteria, In CriteriaBuilder cb = em.getCriteriaBuilder(); CriteriaQuery cq = cb.createQuery(CampaignIndexDto.class); Root campaign = cq.from(Campaign.class); + CampaignQueryContext queryContext = new CampaignQueryContext(cb, cq, campaign); cq.multiselect(campaign.get(Campaign.UUID), campaign.get(Campaign.NAME), campaign.get(Campaign.START_DATE), campaign.get(Campaign.END_DATE)); - Predicate filter = service.createUserFilter(cb, cq, campaign); + Predicate filter = service.createUserFilter(queryContext); if (campaignCriteria != null) { - Predicate criteriaFilter = service.buildCriteriaFilter(campaignCriteria, cb, campaign); + Predicate criteriaFilter = service.buildCriteriaFilter(queryContext, campaignCriteria); filter = CriteriaBuilderHelper.and(cb, filter, criteriaFilter); } @@ -152,11 +153,12 @@ public long count(CampaignCriteria campaignCriteria) { CriteriaBuilder cb = em.getCriteriaBuilder(); CriteriaQuery cq = cb.createQuery(Long.class); Root campaign = cq.from(Campaign.class); + CampaignQueryContext queryContext = new CampaignQueryContext(cb, cq, campaign); - Predicate filter = service.createUserFilter(cb, cq, campaign); + Predicate filter = service.createUserFilter(queryContext); if (campaignCriteria != null) { - Predicate criteriaFilter = service.buildCriteriaFilter(campaignCriteria, cb, campaign); + Predicate criteriaFilter = service.buildCriteriaFilter(queryContext, campaignCriteria); filter = CriteriaBuilderHelper.and(cb, filter, criteriaFilter); } diff --git a/sormas-backend/src/main/java/de/symeda/sormas/backend/campaign/CampaignJoins.java b/sormas-backend/src/main/java/de/symeda/sormas/backend/campaign/CampaignJoins.java new file mode 100644 index 00000000000..19eb829891a --- /dev/null +++ b/sormas-backend/src/main/java/de/symeda/sormas/backend/campaign/CampaignJoins.java @@ -0,0 +1,12 @@ +package de.symeda.sormas.backend.campaign; + +import javax.persistence.criteria.From; + +import de.symeda.sormas.backend.common.QueryJoins; + +public class CampaignJoins extends QueryJoins { + + public CampaignJoins(From root) { + super(root); + } +} diff --git a/sormas-backend/src/main/java/de/symeda/sormas/backend/campaign/CampaignQueryContext.java b/sormas-backend/src/main/java/de/symeda/sormas/backend/campaign/CampaignQueryContext.java new file mode 100644 index 00000000000..ab21647a490 --- /dev/null +++ b/sormas-backend/src/main/java/de/symeda/sormas/backend/campaign/CampaignQueryContext.java @@ -0,0 +1,24 @@ +package de.symeda.sormas.backend.campaign; + +import javax.persistence.criteria.CriteriaBuilder; +import javax.persistence.criteria.CriteriaQuery; +import javax.persistence.criteria.Expression; +import javax.persistence.criteria.From; + +import de.symeda.sormas.backend.common.QueryContext; + +public class CampaignQueryContext extends QueryContext { + + protected CampaignQueryContext(CriteriaBuilder cb, CriteriaQuery query, From root) { + this(cb, query, new CampaignJoins(root)); + } + + public CampaignQueryContext(CriteriaBuilder cb, CriteriaQuery query, CampaignJoins joins) { + super(cb, query, joins.getRoot(), joins); + } + + @Override + protected Expression createExpression(String name) { + return null; + } +} diff --git a/sormas-backend/src/main/java/de/symeda/sormas/backend/campaign/CampaignService.java b/sormas-backend/src/main/java/de/symeda/sormas/backend/campaign/CampaignService.java index 635a07b77c6..66c657a9ef3 100644 --- a/sormas-backend/src/main/java/de/symeda/sormas/backend/campaign/CampaignService.java +++ b/sormas-backend/src/main/java/de/symeda/sormas/backend/campaign/CampaignService.java @@ -16,7 +16,6 @@ import de.symeda.sormas.api.utils.DataHelper; import de.symeda.sormas.backend.common.AbstractCoreAdoService; import de.symeda.sormas.backend.common.AbstractDomainObject; -import de.symeda.sormas.backend.common.ChangeDateBuilder; import de.symeda.sormas.backend.common.CriteriaBuilderHelper; @Stateless @@ -33,10 +32,18 @@ public CampaignService() { @SuppressWarnings("rawtypes") @Override public Predicate createUserFilter(CriteriaBuilder cb, CriteriaQuery cq, From from) { + return createUserFilter(new CampaignQueryContext(cb, cq, from)); + } + + public Predicate createUserFilter(CampaignQueryContext queryContext) { + // A user who has access to CampaignView can read all campaigns return null; } - public Predicate buildCriteriaFilter(CampaignCriteria campaignCriteria, CriteriaBuilder cb, Root from) { + public Predicate buildCriteriaFilter(CampaignQueryContext queryContext, CampaignCriteria campaignCriteria) { + + CriteriaBuilder cb = queryContext.getCriteriaBuilder(); + From from = queryContext.getRoot(); Predicate filter = null; if (campaignCriteria.getDeleted() != null) { From 5c4aa26a341aa4fd0cf5a20c4b28fed5e78b6d55 Mon Sep 17 00:00:00 2001 From: Stefan Kock Date: Fri, 22 Apr 2022 11:11:00 +0200 Subject: [PATCH 021/167] #8747 Introduced cascaded TravelEntry and Imm. joins for PersonJoins --- .../ImmunizationQueryContext.java | 6 +++++- .../sormas/backend/person/PersonJoins.java | 20 +++++++++++++++++++ .../PersonJurisdictionPredicateValidator.java | 7 ++++--- .../travelentry/TravelEntryQueryContext.java | 6 +++++- 4 files changed, 34 insertions(+), 5 deletions(-) diff --git a/sormas-backend/src/main/java/de/symeda/sormas/backend/immunization/ImmunizationQueryContext.java b/sormas-backend/src/main/java/de/symeda/sormas/backend/immunization/ImmunizationQueryContext.java index 2e11967430f..6c525137cf5 100644 --- a/sormas-backend/src/main/java/de/symeda/sormas/backend/immunization/ImmunizationQueryContext.java +++ b/sormas-backend/src/main/java/de/symeda/sormas/backend/immunization/ImmunizationQueryContext.java @@ -26,7 +26,11 @@ public class ImmunizationQueryContext extends QueryContext { public ImmunizationQueryContext(CriteriaBuilder cb, CriteriaQuery query, From root) { - super(cb, query, root, new ImmunizationJoins(root)); + this(cb, query, new ImmunizationJoins(root)); + } + + public ImmunizationQueryContext(CriteriaBuilder cb, CriteriaQuery query, ImmunizationJoins joins) { + super(cb, query, joins.getRoot(), joins); } @Override diff --git a/sormas-backend/src/main/java/de/symeda/sormas/backend/person/PersonJoins.java b/sormas-backend/src/main/java/de/symeda/sormas/backend/person/PersonJoins.java index be0cd787160..040d7fcc1a6 100644 --- a/sormas-backend/src/main/java/de/symeda/sormas/backend/person/PersonJoins.java +++ b/sormas-backend/src/main/java/de/symeda/sormas/backend/person/PersonJoins.java @@ -31,11 +31,13 @@ import de.symeda.sormas.backend.contact.ContactJoins; import de.symeda.sormas.backend.event.EventParticipant; import de.symeda.sormas.backend.event.EventParticipantJoins; +import de.symeda.sormas.backend.immunization.ImmunizationJoins; import de.symeda.sormas.backend.immunization.entity.Immunization; import de.symeda.sormas.backend.infrastructure.country.Country; import de.symeda.sormas.backend.location.Location; import de.symeda.sormas.backend.location.LocationJoins; import de.symeda.sormas.backend.travelentry.TravelEntry; +import de.symeda.sormas.backend.travelentry.TravelEntryJoins; public class PersonJoins extends QueryJoins { @@ -55,6 +57,8 @@ public class PersonJoins extends QueryJoins { private CaseJoins caseJoins; private ContactJoins contactJoins; private EventParticipantJoins eventParticipantJoins; + private ImmunizationJoins immunizationJoins; + private TravelEntryJoins travelEntryJoins; public PersonJoins(From root) { super(root); @@ -179,4 +183,20 @@ public LocationJoins getAddressJoins() { private void setAddressJoins(LocationJoins addressJoins) { this.addressJoins = addressJoins; } + + public ImmunizationJoins getImmunizationJoins() { + return getOrCreate(immunizationJoins, () -> new ImmunizationJoins(getImmunization()), this::setImmunizationJoins); + } + + private void setImmunizationJoins(ImmunizationJoins immunizationJoins) { + this.immunizationJoins = immunizationJoins; + } + + public TravelEntryJoins getTravelEntryJoins() { + return getOrCreate(travelEntryJoins, () -> new TravelEntryJoins(getTravelEntry()), this::setTravelEntryJoins); + } + + private void setTravelEntryJoins(TravelEntryJoins travelEntryJoins) { + this.travelEntryJoins = travelEntryJoins; + } } diff --git a/sormas-backend/src/main/java/de/symeda/sormas/backend/person/PersonJurisdictionPredicateValidator.java b/sormas-backend/src/main/java/de/symeda/sormas/backend/person/PersonJurisdictionPredicateValidator.java index 4d8dd4a877d..12e421949c4 100644 --- a/sormas-backend/src/main/java/de/symeda/sormas/backend/person/PersonJurisdictionPredicateValidator.java +++ b/sormas-backend/src/main/java/de/symeda/sormas/backend/person/PersonJurisdictionPredicateValidator.java @@ -57,14 +57,15 @@ public static PersonJurisdictionPredicateValidator of( final List associatedJurisdictionValidators = new ArrayList<>(); associatedJurisdictionValidators.add(CaseJurisdictionPredicateValidator.of(new CaseQueryContext(cb, cq, joins.getCaseJoins()), user)); - associatedJurisdictionValidators.add(ContactJurisdictionPredicateValidator.of(new ContactQueryContext(cb, cq, joins.getContactJoins()), user)); + associatedJurisdictionValidators + .add(ContactJurisdictionPredicateValidator.of(new ContactQueryContext(cb, cq, joins.getContactJoins()), user)); associatedJurisdictionValidators .add(EventParticipantJurisdictionPredicateValidator.of(new EventParticipantQueryContext(cb, cq, joins.getEventParticipantJoins()), user)); associatedJurisdictionValidators - .add(TravelEntryJurisdictionPredicateValidator.of(new TravelEntryQueryContext(cb, cq, joins.getTravelEntry()), user)); + .add(TravelEntryJurisdictionPredicateValidator.of(new TravelEntryQueryContext(cb, cq, joins.getTravelEntryJoins()), user)); if (includeImmunizations) { associatedJurisdictionValidators - .add(ImmunizationJurisdictionPredicateValidator.of(new ImmunizationQueryContext(cb, cq, joins.getImmunization()), user)); + .add(ImmunizationJurisdictionPredicateValidator.of(new ImmunizationQueryContext(cb, cq, joins.getImmunizationJoins()), user)); } return new PersonJurisdictionPredicateValidator(cb, joins, user, associatedJurisdictionValidators); diff --git a/sormas-backend/src/main/java/de/symeda/sormas/backend/travelentry/TravelEntryQueryContext.java b/sormas-backend/src/main/java/de/symeda/sormas/backend/travelentry/TravelEntryQueryContext.java index 2b4a746cf9c..0cba3ee12f4 100644 --- a/sormas-backend/src/main/java/de/symeda/sormas/backend/travelentry/TravelEntryQueryContext.java +++ b/sormas-backend/src/main/java/de/symeda/sormas/backend/travelentry/TravelEntryQueryContext.java @@ -10,7 +10,11 @@ public class TravelEntryQueryContext extends QueryContext { public TravelEntryQueryContext(CriteriaBuilder cb, CriteriaQuery query, From root) { - super(cb, query, root, new TravelEntryJoins(root)); + this(cb, query, new TravelEntryJoins(root)); + } + + public TravelEntryQueryContext(CriteriaBuilder cb, CriteriaQuery query, TravelEntryJoins joins) { + super(cb, query, joins.getRoot(), joins); } @Override From 2e4599baf6f34208d982f770858172ad55b86234 Mon Sep 17 00:00:00 2001 From: Stefan Kock Date: Fri, 22 Apr 2022 15:19:47 +0200 Subject: [PATCH 022/167] #8747 Change to createUserFilter(QueryContext) with shared joins - Removed logger that warns to use createUserFilter --- .../sormas/backend/action/ActionService.java | 1 - .../backend/campaign/CampaignService.java | 8 +- .../sormas/backend/caze/CaseFacadeEjb.java | 4 +- .../sormas/backend/caze/CaseService.java | 80 ++++++++----------- .../clinicalcourse/ClinicalVisitService.java | 4 +- .../common/AbstractCoreAdoService.java | 22 +++++ .../backend/contact/ContactFacadeEjb.java | 8 +- .../backend/contact/ContactService.java | 23 +++--- .../sormas/backend/event/EventFacadeEjb.java | 14 ++-- .../backend/event/EventGroupService.java | 6 +- .../event/EventParticipantFacadeEjb.java | 5 +- .../event/EventParticipantService.java | 16 ++-- .../sormas/backend/event/EventService.java | 19 +++-- .../DirectoryImmunizationService.java | 1 - .../immunization/ImmunizationService.java | 21 +++-- .../backend/person/PersonFacadeEjb.java | 20 +++-- .../sormas/backend/person/PersonService.java | 67 +++++++++------- .../sormas/backend/sample/SampleService.java | 1 - .../sormas/backend/task/TaskService.java | 51 ++++++------ .../backend/therapy/PrescriptionService.java | 4 +- .../backend/therapy/TreatmentService.java | 4 +- .../services/BaseTravelEntryService.java | 16 ++-- .../sormas/backend/visit/VisitService.java | 36 +++++---- .../visualization/VisualizationFacadeEjb.java | 4 +- 24 files changed, 227 insertions(+), 208 deletions(-) diff --git a/sormas-backend/src/main/java/de/symeda/sormas/backend/action/ActionService.java b/sormas-backend/src/main/java/de/symeda/sormas/backend/action/ActionService.java index 04d978866d3..14f51c8006c 100644 --- a/sormas-backend/src/main/java/de/symeda/sormas/backend/action/ActionService.java +++ b/sormas-backend/src/main/java/de/symeda/sormas/backend/action/ActionService.java @@ -102,7 +102,6 @@ public List getAllByEvent(Event event) { @SuppressWarnings("rawtypes") @Override public Predicate createUserFilter(CriteriaBuilder cb, CriteriaQuery cq, From actionPath) { - logger.warn("Obsolete createUserFilter method called!"); return createUserFilter(new ActionQueryContext(cb, cq, actionPath)); } diff --git a/sormas-backend/src/main/java/de/symeda/sormas/backend/campaign/CampaignService.java b/sormas-backend/src/main/java/de/symeda/sormas/backend/campaign/CampaignService.java index 66c657a9ef3..4730de58b7e 100644 --- a/sormas-backend/src/main/java/de/symeda/sormas/backend/campaign/CampaignService.java +++ b/sormas-backend/src/main/java/de/symeda/sormas/backend/campaign/CampaignService.java @@ -26,12 +26,9 @@ public CampaignService() { super(Campaign.class); } - /** - * a user who has access to @CamnpaignView can read all campaigns - */ - @SuppressWarnings("rawtypes") @Override - public Predicate createUserFilter(CriteriaBuilder cb, CriteriaQuery cq, From from) { + @SuppressWarnings("rawtypes") + protected Predicate createUserFilterInternal(CriteriaBuilder cb, CriteriaQuery cq, From from) { return createUserFilter(new CampaignQueryContext(cb, cq, from)); } @@ -138,4 +135,5 @@ public List getAllAfter(Date since) { return em.createQuery(cq).getResultList(); } + } diff --git a/sormas-backend/src/main/java/de/symeda/sormas/backend/caze/CaseFacadeEjb.java b/sormas-backend/src/main/java/de/symeda/sormas/backend/caze/CaseFacadeEjb.java index a87333d027a..0828d99e376 100644 --- a/sormas-backend/src/main/java/de/symeda/sormas/backend/caze/CaseFacadeEjb.java +++ b/sormas-backend/src/main/java/de/symeda/sormas/backend/caze/CaseFacadeEjb.java @@ -822,7 +822,7 @@ public List getExportList( cq.distinct(true); - Predicate filter = service.createUserFilter(cb, cq, caseRoot); + Predicate filter = service.createUserFilter(caseQueryContext); if (caseCriteria != null) { Predicate criteriaFilter = service.createCriteriaFilter(caseCriteria, caseQueryContext); @@ -3712,7 +3712,7 @@ public List getCaseFollowUpList( JurisdictionHelper.booleanSelector(cb, service.inJurisdictionOrOwned(caseQueryContext))); Predicate filter = - CriteriaBuilderHelper.and(cb, service.createUserFilter(cb, cq, caze), service.createCriteriaFilter(caseCriteria, caseQueryContext)); + CriteriaBuilderHelper.and(cb, service.createUserFilter(caseQueryContext), service.createCriteriaFilter(caseCriteria, caseQueryContext)); if (filter != null) { cq.where(filter); diff --git a/sormas-backend/src/main/java/de/symeda/sormas/backend/caze/CaseService.java b/sormas-backend/src/main/java/de/symeda/sormas/backend/caze/CaseService.java index 50df2d6f51d..ff6408385f2 100644 --- a/sormas-backend/src/main/java/de/symeda/sormas/backend/caze/CaseService.java +++ b/sormas-backend/src/main/java/de/symeda/sormas/backend/caze/CaseService.java @@ -218,7 +218,7 @@ public List findBy(CaseCriteria caseCriteria, boolean ignoreUserFilter) { Predicate filter = createCriteriaFilter(caseCriteria, caseQueryContext); if (!ignoreUserFilter) { - filter = CriteriaBuilderHelper.and(cb, filter, createUserFilter(cb, cq, from)); + filter = CriteriaBuilderHelper.and(cb, filter, createUserFilter(caseQueryContext)); } if (filter != null) { @@ -345,7 +345,7 @@ public List getCasesForMap(Region region, District district, Disease } private Predicate createMapCasesFilter( - CaseQueryContext caseQueryContext, + CaseQueryContext caseQueryContext, Region region, District district, Disease disease, @@ -361,7 +361,8 @@ private Predicate createMapCasesFilter( Predicate filter = createActiveCasesFilter(cb, root); // Userfilter - filter = CriteriaBuilderHelper.and(cb, filter, createUserFilter(caseQueryContext, new CaseUserFilterCriteria().excludeCasesFromContacts(true))); + filter = + CriteriaBuilderHelper.and(cb, filter, createUserFilter(caseQueryContext, new CaseUserFilterCriteria().excludeCasesFromContacts(true))); // Filter by date. The relevancefilter uses a special algorithm that should reflect the current situation. if (dateType == null) { @@ -583,10 +584,8 @@ public Predicate createCriteriaFilter(CaseCrite Predicate filter = null; if (caseCriteria.getReportingUserRole() != null) { - filter = CriteriaBuilderHelper.and( - cb, - filter, - cb.isMember(caseCriteria.getReportingUserRole(), joins.getReportingUser().get(User.USER_ROLES))); + filter = CriteriaBuilderHelper + .and(cb, filter, cb.isMember(caseCriteria.getReportingUserRole(), joins.getReportingUser().get(User.USER_ROLES))); } if (caseCriteria.getDisease() != null) { filter = CriteriaBuilderHelper.and(cb, filter, cb.equal(from.get(Case.DISEASE), caseCriteria.getDisease())); @@ -637,10 +636,8 @@ public Predicate createCriteriaFilter(CaseCrite filter = CriteriaBuilderHelper.and(cb, filter, cb.equal(from.get(Case.CASE_ORIGIN), caseCriteria.getCaseOrigin())); } if (caseCriteria.getHealthFacility() != null) { - filter = CriteriaBuilderHelper.and( - cb, - filter, - cb.equal(joins.getFacility().get(Facility.UUID), caseCriteria.getHealthFacility().getUuid())); + filter = + CriteriaBuilderHelper.and(cb, filter, cb.equal(joins.getFacility().get(Facility.UUID), caseCriteria.getHealthFacility().getUuid())); } if (caseCriteria.getFacilityTypeGroup() != null) { filter = @@ -650,16 +647,12 @@ public Predicate createCriteriaFilter(CaseCrite filter = CriteriaBuilderHelper.and(cb, filter, cb.equal(from.get(Case.FACILITY_TYPE), caseCriteria.getFacilityType())); } if (caseCriteria.getPointOfEntry() != null) { - filter = CriteriaBuilderHelper.and( - cb, - filter, - cb.equal(joins.getPointOfEntry().get(PointOfEntry.UUID), caseCriteria.getPointOfEntry().getUuid())); + filter = CriteriaBuilderHelper + .and(cb, filter, cb.equal(joins.getPointOfEntry().get(PointOfEntry.UUID), caseCriteria.getPointOfEntry().getUuid())); } if (caseCriteria.getSurveillanceOfficer() != null) { - filter = CriteriaBuilderHelper.and( - cb, - filter, - cb.equal(joins.getSurveillanceOfficer().get(User.UUID), caseCriteria.getSurveillanceOfficer().getUuid())); + filter = CriteriaBuilderHelper + .and(cb, filter, cb.equal(joins.getSurveillanceOfficer().get(User.UUID), caseCriteria.getSurveillanceOfficer().getUuid())); } if (caseCriteria.getCaseClassification() != null) { filter = CriteriaBuilderHelper.and(cb, filter, cb.equal(from.get(Case.CASE_CLASSIFICATION), caseCriteria.getCaseClassification())); @@ -713,10 +706,8 @@ public Predicate createCriteriaFilter(CaseCrite cb.or(cb.isNull(personAddress.get(Location.LATITUDE)), cb.isNull(personAddress.get(Location.LONGITUDE))))); } if (caseCriteria.getMustBePortHealthCaseWithoutFacility() != null && caseCriteria.getMustBePortHealthCaseWithoutFacility() == true) { - filter = CriteriaBuilderHelper.and( - cb, - filter, - cb.and(cb.equal(from.get(Case.CASE_ORIGIN), CaseOrigin.POINT_OF_ENTRY), cb.isNull(joins.getFacility()))); + filter = CriteriaBuilderHelper + .and(cb, filter, cb.and(cb.equal(from.get(Case.CASE_ORIGIN), CaseOrigin.POINT_OF_ENTRY), cb.isNull(joins.getFacility()))); } if (caseCriteria.getMustHaveCaseManagementData() != null && caseCriteria.getMustHaveCaseManagementData() == true) { Subquery prescriptionSubquery = cq.subquery(Prescription.class); @@ -1076,6 +1067,16 @@ protected > T addChangeDates(T builder, From from) { + return createUserFilter(new CaseQueryContext(cb, cq, from)); + } + + public Predicate createUserFilter(CaseQueryContext caseQueryContext) { + return createUserFilter(caseQueryContext, null); + } + @SuppressWarnings("rawtypes") public Predicate createUserFilter(CaseQueryContext caseQueryContext, CaseUserFilterCriteria userFilterCriteria) { @@ -1165,10 +1166,8 @@ public Predicate createUserFilter(CaseQueryContext caseQueryContext, CaseUserFil || (!userFilterCriteria.isExcludeCasesFromContacts() && Boolean.TRUE.equals(userFilterCriteria.getIncludeCasesFromOtherJurisdictions()))) { CaseJoins caseJoins = caseQueryContext.getJoins(); - filter = CriteriaBuilderHelper.or( - cb, - filter, - contactService.createUserFilterWithoutCase(new ContactQueryContext(cb, cq, caseJoins.getContacts()))); + filter = CriteriaBuilderHelper + .or(cb, filter, contactService.createUserFilterWithoutCase(new ContactQueryContext(cb, cq, caseJoins.getContacts()))); } // users can only be assigned to a task when they have also access to the case @@ -1197,27 +1196,12 @@ public Predicate createUserFilter(CaseQueryContext caseQueryContext, CaseUserFil return filter; } - @SuppressWarnings("rawtypes") - @Override - public Predicate createUserFilter(CriteriaBuilder cb, CriteriaQuery cq, From casePath) { - logger.warn("Obsolete createUserFilter method called!"); - return createUserFilter(new CaseQueryContext(cb, cq, casePath)); - } - - public Predicate createUserFilter(CaseQueryContext caseQueryContext) { - return createUserFilter(caseQueryContext, null); - } - /** * Creates a filter that checks whether the case has "started" within the time frame specified by {@code fromDate} and {@code toDate}. * By default (if {@code dateType} is null), this logic looks at the {@link Symptoms#onsetDate} first or, if this is null, * the {@link Case#reportDate}. */ - public Predicate createNewCaseFilter( - CaseQueryContext caseQueryContext, - Date fromDate, - Date toDate, - CriteriaDateType dateType) { + public Predicate createNewCaseFilter(CaseQueryContext caseQueryContext, Date fromDate, Date toDate, CriteriaDateType dateType) { final CriteriaBuilder cb = caseQueryContext.getCriteriaBuilder(); final From caze = caseQueryContext.getRoot(); @@ -1488,7 +1472,8 @@ public List getCaseSelectionList(CaseCriteria caseCriteria) { cq.orderBy(cb.desc(latestChangedDateFunction)); - Predicate filter = CriteriaBuilderHelper.and(cb, createDefaultFilter(cb, root), createUserFilter(caseQueryContext, new CaseUserFilterCriteria())); + Predicate filter = + CriteriaBuilderHelper.and(cb, createDefaultFilter(cb, root), createUserFilter(caseQueryContext, new CaseUserFilterCriteria())); if (caseCriteria != null) { if (caseCriteria.getDisease() != null) { @@ -1575,7 +1560,8 @@ public List getSimilarCases(CaseSimilarityCriteria criteria) { CriteriaBuilder cb = em.getCriteriaBuilder(); CriteriaQuery cq = cb.createQuery(Object[].class); Root root = cq.from(Case.class); - CaseJoins joins = new CaseJoins(root); + CaseQueryContext queryContext = new CaseQueryContext(cb, cq, root); + CaseJoins joins = queryContext.getJoins(); cq.multiselect( root.get(Case.UUID), @@ -1601,7 +1587,7 @@ public List getSimilarCases(CaseSimilarityCriteria criteria) { root.get(Case.CHANGE_DATE)); cq.distinct(true); - Predicate userFilter = createUserFilter(cb, cq, root); + Predicate userFilter = createUserFilter(queryContext); // In case you wonder: At this point in time the **person** duplicate check has already happen. // Here, we really just check if there is a similar case to the current one, therefore it is allowed to just @@ -1673,7 +1659,7 @@ public List getCasesForDuplicateMerging(CaseCriteria criteria, b // * same birth date (when fully defined) // * onset date within 30 days of each other (when defined) - Predicate userFilter = createUserFilter(cb, cq, root); + Predicate userFilter = createUserFilter(caseQueryContext); Predicate criteriaFilter = criteria != null ? createCriteriaFilter(criteria, caseQueryContext) : null; Expression nameSimilarityExpr = cb.concat(person.get(Person.FIRST_NAME), " "); nameSimilarityExpr = cb.concat(nameSimilarityExpr, person.get(Person.LAST_NAME)); diff --git a/sormas-backend/src/main/java/de/symeda/sormas/backend/clinicalcourse/ClinicalVisitService.java b/sormas-backend/src/main/java/de/symeda/sormas/backend/clinicalcourse/ClinicalVisitService.java index fa3e9fe86c2..71cc7e03e9a 100644 --- a/sormas-backend/src/main/java/de/symeda/sormas/backend/clinicalcourse/ClinicalVisitService.java +++ b/sormas-backend/src/main/java/de/symeda/sormas/backend/clinicalcourse/ClinicalVisitService.java @@ -19,6 +19,8 @@ import de.symeda.sormas.api.clinicalcourse.ClinicalVisitCriteria; import de.symeda.sormas.api.utils.DateHelper; import de.symeda.sormas.backend.caze.Case; +import de.symeda.sormas.backend.caze.CaseJoins; +import de.symeda.sormas.backend.caze.CaseQueryContext; import de.symeda.sormas.backend.caze.CaseService; import de.symeda.sormas.backend.common.AdoServiceWithUserFilter; import de.symeda.sormas.backend.common.ChangeDateFilterBuilder; @@ -153,6 +155,6 @@ private Predicate createChangeDateFilter(CriteriaBuilder cb, From from) { Join clinicalCourse = from.join(ClinicalVisit.CLINICAL_COURSE, JoinType.LEFT); - return caseService.createUserFilter(cb, cq, clinicalCourse.join(ClinicalCourse.CASE, JoinType.LEFT)); + return caseService.createUserFilter(new CaseQueryContext(cb, cq, new CaseJoins(clinicalCourse.join(ClinicalCourse.CASE, JoinType.LEFT)))); } } diff --git a/sormas-backend/src/main/java/de/symeda/sormas/backend/common/AbstractCoreAdoService.java b/sormas-backend/src/main/java/de/symeda/sormas/backend/common/AbstractCoreAdoService.java index 3e27b4e82fa..19e4da33558 100644 --- a/sormas-backend/src/main/java/de/symeda/sormas/backend/common/AbstractCoreAdoService.java +++ b/sormas-backend/src/main/java/de/symeda/sormas/backend/common/AbstractCoreAdoService.java @@ -23,6 +23,7 @@ import java.util.Map; import java.util.stream.Collectors; +import javax.annotation.security.DenyAll; import javax.ejb.EJB; import javax.ejb.TransactionAttribute; import javax.ejb.TransactionAttributeType; @@ -31,6 +32,7 @@ import javax.persistence.criteria.CriteriaUpdate; import javax.persistence.criteria.Expression; import javax.persistence.criteria.From; +import javax.persistence.criteria.Predicate; import javax.persistence.criteria.Root; import de.symeda.sormas.api.EditPermissionType; @@ -50,6 +52,26 @@ protected AbstractCoreAdoService(Class elementClass) { super(elementClass); } + /** + * @deprecated Invocation without a {@link QueryContext} is only allowed interally in the same class. For invocation from other EJBs, + * use {@code createUserFilter(QueryContext)} instead (to be implemented by each subclass). + */ + @Deprecated + @DenyAll + @Override + @SuppressWarnings("rawtypes") + public Predicate createUserFilter(CriteriaBuilder cb, CriteriaQuery cq, From from) { + return createUserFilterInternal(cb, cq, from); + } + + /** + * Delegate this to {@code createUserFilter(QueryContext)}. + */ + @Deprecated + @DenyAll + @SuppressWarnings("rawtypes") + protected abstract Predicate createUserFilterInternal(CriteriaBuilder cb, CriteriaQuery cq, From from); + public boolean isArchived(String uuid) { CriteriaBuilder cb = em.getCriteriaBuilder(); CriteriaQuery cq = cb.createQuery(Long.class); diff --git a/sormas-backend/src/main/java/de/symeda/sormas/backend/contact/ContactFacadeEjb.java b/sormas-backend/src/main/java/de/symeda/sormas/backend/contact/ContactFacadeEjb.java index d69a6402fc8..4373355546a 100644 --- a/sormas-backend/src/main/java/de/symeda/sormas/backend/contact/ContactFacadeEjb.java +++ b/sormas-backend/src/main/java/de/symeda/sormas/backend/contact/ContactFacadeEjb.java @@ -63,7 +63,6 @@ import javax.validation.Valid; import javax.validation.constraints.NotNull; -import de.symeda.sormas.backend.vaccination.VaccinationService; import org.apache.commons.collections.CollectionUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -202,6 +201,7 @@ import de.symeda.sormas.backend.util.QueryHelper; import de.symeda.sormas.backend.vaccination.Vaccination; import de.symeda.sormas.backend.vaccination.VaccinationFacadeEjb; +import de.symeda.sormas.backend.vaccination.VaccinationService; import de.symeda.sormas.backend.visit.Visit; import de.symeda.sormas.backend.visit.VisitFacadeEjb; import de.symeda.sormas.backend.visit.VisitFacadeEjb.VisitFacadeEjbLocal; @@ -1846,7 +1846,7 @@ public List getMatchingContacts(ContactSimilarityCriteria cri cq.multiselect(selections); final Predicate defaultFilter = service.createDefaultFilter(cb, contactRoot); - final Predicate userFilter = service.createUserFilter(cb, cq, contactRoot); + final Predicate userFilter = service.createUserFilter(contactQueryContext); final PersonReferenceDto person = criteria.getPerson(); final Predicate samePersonFilter = person != null ? cb.equal(joins.getPerson().get(Person.UUID), person.getUuid()) : null; @@ -2015,7 +2015,7 @@ public List getContactsForDuplicateMerging(ContactCriter CriteriaQuery cq = cb.createQuery(Object[].class); Root root = cq.from(Contact.class); final ContactQueryContext contactQueryContext = new ContactQueryContext(cb, cq, root); - ContactJoins joins = (ContactJoins) contactQueryContext.getJoins(); + ContactJoins joins = contactQueryContext.getJoins(); Root root2 = cq.from(Contact.class); Join person = joins.getPerson(); Join person2 = root2.join(Contact.PERSON, JoinType.LEFT); @@ -2037,7 +2037,7 @@ public List getContactsForDuplicateMerging(ContactCriter // * same birth date (when fully defined) Predicate sourceCaseFilter = cb.equal(sourceCase, sourceCase2); - Predicate userFilter = service.createUserFilter(cb, cq, root); + Predicate userFilter = service.createUserFilter(contactQueryContext); Predicate criteriaFilter = criteria != null ? service.buildCriteriaFilter(criteria, contactQueryContext) : null; Expression nameSimilarityExpr = cb.concat(person.get(Person.FIRST_NAME), " "); nameSimilarityExpr = cb.concat(nameSimilarityExpr, person.get(Person.LAST_NAME)); diff --git a/sormas-backend/src/main/java/de/symeda/sormas/backend/contact/ContactService.java b/sormas-backend/src/main/java/de/symeda/sormas/backend/contact/ContactService.java index 1afe896ff9f..113ddeb80b8 100644 --- a/sormas-backend/src/main/java/de/symeda/sormas/backend/contact/ContactService.java +++ b/sormas-backend/src/main/java/de/symeda/sormas/backend/contact/ContactService.java @@ -535,13 +535,7 @@ public List getContactsForMap(Region region, District district, D return result; } - private Predicate createMapContactsFilter( - ContactQueryContext cqc, - Region region, - District district, - Disease disease, - Date from, - Date to) { + private Predicate createMapContactsFilter(ContactQueryContext cqc, Region region, District district, Disease disease, Date from, Date to) { From contactRoot = cqc.getRoot(); CriteriaBuilder cb = cqc.getCriteriaBuilder(); @@ -555,7 +549,8 @@ private Predicate createMapContactsFilter( cb.between(contactRoot.get(Contact.REPORT_DATE_TIME), DateHelper.getStartOfDay(from), DateHelper.getEndOfDay(to)); filter = CriteriaBuilderHelper.and(cb, filter, reportDateFilter); - filter = CriteriaBuilderHelper.and(cb, filter, getRegionDistrictDiseasePredicate(region, district, disease, cb, contactRoot, joins.getCaze())); + filter = + CriteriaBuilderHelper.and(cb, filter, getRegionDistrictDiseasePredicate(region, district, disease, cb, contactRoot, joins.getCaze())); // Only retrieve contacts that are currently under follow-up Predicate followUpFilter = cb.equal(contactRoot.get(Contact.FOLLOW_UP_STATUS), FollowUpStatus.FOLLOW_UP); @@ -956,13 +951,16 @@ public List getAllByVisit(Visit visit) { return em.createQuery(cq).getResultList(); } + @Override @SuppressWarnings("rawtypes") - public Predicate createUserFilter(CriteriaBuilder cb, CriteriaQuery cq, From contactPath) { - logger.warn("Obsolete createUserFilter method called!"); - return createUserFilter(new ContactQueryContext(cb, cq, contactPath), null); + protected Predicate createUserFilterInternal(CriteriaBuilder cb, CriteriaQuery cq, From from) { + return createUserFilter(new ContactQueryContext(cb, cq, from)); + } + + public Predicate createUserFilter(ContactQueryContext queryContext) { + return createUserFilter(queryContext, null); } - @SuppressWarnings("rawtypes") public Predicate createUserFilter(ContactQueryContext contactQueryContext, ContactCriteria contactCriteria) { Predicate userFilter = null; @@ -1675,5 +1673,4 @@ public long getContactCount(CaseReferenceDto caze) { return em.createQuery(cq).getSingleResult(); } - } diff --git a/sormas-backend/src/main/java/de/symeda/sormas/backend/event/EventFacadeEjb.java b/sormas-backend/src/main/java/de/symeda/sormas/backend/event/EventFacadeEjb.java index 658b4d6dc76..2077b5e7374 100644 --- a/sormas-backend/src/main/java/de/symeda/sormas/backend/event/EventFacadeEjb.java +++ b/sormas-backend/src/main/java/de/symeda/sormas/backend/event/EventFacadeEjb.java @@ -329,15 +329,16 @@ public long count(EventCriteria eventCriteria) { CriteriaBuilder cb = em.getCriteriaBuilder(); CriteriaQuery cq = cb.createQuery(Long.class); Root event = cq.from(Event.class); + EventQueryContext queryContext = new EventQueryContext(cb, cq, event); Predicate filter = null; if (eventCriteria != null) { if (eventCriteria.getUserFilterIncluded()) { - filter = service.createUserFilter(cb, cq, event); + filter = service.createUserFilter(queryContext); } - Predicate criteriaFilter = service.buildCriteriaFilter(eventCriteria, new EventQueryContext(cb, cq, event)); + Predicate criteriaFilter = service.buildCriteriaFilter(eventCriteria, queryContext); filter = CriteriaBuilderHelper.and(cb, filter, criteriaFilter); } @@ -724,7 +725,7 @@ public List getExportList(EventCriteria eventCriteria, Collectio cq.distinct(true); - Predicate filter = service.createUserFilter(cb, cq, event); + Predicate filter = service.createUserFilter(eventQueryContext); if (eventCriteria != null) { Predicate criteriaFilter = service.buildCriteriaFilter(eventCriteria, eventQueryContext); @@ -1285,14 +1286,13 @@ public List getSubordinateEventUuids(List uuids) { CriteriaBuilder cb = em.getCriteriaBuilder(); CriteriaQuery cq = cb.createQuery(String.class); Root from = cq.from(Event.class); - - EventJoins eventJoins = new EventJoins(from); + EventQueryContext queryContext = new EventQueryContext(cb, cq, from); Predicate filters = CriteriaBuilderHelper.and( cb, - service.createUserFilter(cb, cq, from), + service.createUserFilter(queryContext), service.createActiveEventsFilter(cb, from), - eventJoins.getSuperordinateEvent().get(Event.UUID).in(batchedUuids)); + queryContext.getJoins().getSuperordinateEvent().get(Event.UUID).in(batchedUuids)); cq.where(filters); cq.select(from.get(Event.UUID)); diff --git a/sormas-backend/src/main/java/de/symeda/sormas/backend/event/EventGroupService.java b/sormas-backend/src/main/java/de/symeda/sormas/backend/event/EventGroupService.java index 20dc1be57b8..9eb7a387b88 100644 --- a/sormas-backend/src/main/java/de/symeda/sormas/backend/event/EventGroupService.java +++ b/sormas-backend/src/main/java/de/symeda/sormas/backend/event/EventGroupService.java @@ -29,15 +29,17 @@ import javax.persistence.criteria.Root; import javax.persistence.criteria.Subquery; -import de.symeda.sormas.api.user.UserRole; import org.apache.commons.collections.CollectionUtils; import org.apache.commons.lang3.StringUtils; import de.symeda.sormas.api.EntityRelevanceStatus; import de.symeda.sormas.api.event.EventGroupCriteria; import de.symeda.sormas.api.user.JurisdictionLevel; +import de.symeda.sormas.api.user.UserRole; import de.symeda.sormas.api.utils.DataHelper; import de.symeda.sormas.backend.caze.Case; +import de.symeda.sormas.backend.caze.CaseJoins; +import de.symeda.sormas.backend.caze.CaseQueryContext; import de.symeda.sormas.backend.caze.CaseService; import de.symeda.sormas.backend.common.AbstractDomainObject; import de.symeda.sormas.backend.common.AdoServiceWithUserFilter; @@ -133,7 +135,7 @@ public Predicate createCaseAndEventParticipantFilter(CriteriaBuilder cb, Criteri Subquery caseSubquery = cq.subquery(Long.class); Root caseRoot = caseSubquery.from(Case.class); - caseSubquery.where(caseService.createUserFilter(cb, cq, caseRoot)); + caseSubquery.where(caseService.createUserFilter(new CaseQueryContext(cb, cq, new CaseJoins(caseRoot)))); caseSubquery.select(caseRoot.get(Case.ID)); Predicate filter = cb.in(caseJoin.get(Case.ID)).value(caseSubquery); diff --git a/sormas-backend/src/main/java/de/symeda/sormas/backend/event/EventParticipantFacadeEjb.java b/sormas-backend/src/main/java/de/symeda/sormas/backend/event/EventParticipantFacadeEjb.java index 75658bb8397..d5317d52878 100644 --- a/sormas-backend/src/main/java/de/symeda/sormas/backend/event/EventParticipantFacadeEjb.java +++ b/sormas-backend/src/main/java/de/symeda/sormas/backend/event/EventParticipantFacadeEjb.java @@ -51,7 +51,6 @@ import javax.validation.Valid; import javax.validation.constraints.NotNull; -import de.symeda.sormas.backend.vaccination.VaccinationService; import org.apache.commons.collections.CollectionUtils; import org.apache.commons.lang3.StringUtils; import org.slf4j.Logger; @@ -138,6 +137,7 @@ import de.symeda.sormas.backend.util.QueryHelper; import de.symeda.sormas.backend.vaccination.Vaccination; import de.symeda.sormas.backend.vaccination.VaccinationFacadeEjb; +import de.symeda.sormas.backend.vaccination.VaccinationService; @Stateless(name = "EventParticipantFacade") @RolesAllowed(UserRight._EVENTPARTICIPANT_VIEW) @@ -1053,6 +1053,7 @@ public List getMatchingEventParticipants(EventPartic Join personJoin = eventParticipantRoot.join(EventParticipant.PERSON, JoinType.LEFT); Join eventJoin = eventParticipantRoot.join(EventParticipant.EVENT, JoinType.LEFT); + EventParticipantQueryContext eventParticipantQueryContext = new EventParticipantQueryContext(cb, cq, eventParticipantRoot); Expression jurisdictionSelector = JurisdictionHelper.booleanSelector(cb, service.inJurisdictionOrOwned(new EventParticipantQueryContext(cb, cq, eventParticipantRoot))); @@ -1078,7 +1079,7 @@ public List getMatchingEventParticipants(EventPartic jurisdictionSelector); final Predicate defaultFilter = service.createDefaultFilter(cb, eventParticipantRoot); - final Predicate userFilter = service.createUserFilter(cb, cq, eventParticipantRoot); + final Predicate userFilter = service.createUserFilter(eventParticipantQueryContext); final PersonReferenceDto person = criteria.getPerson(); final Predicate samePersonFilter = person != null ? cb.equal(personJoin.get(Person.UUID), person.getUuid()) : null; diff --git a/sormas-backend/src/main/java/de/symeda/sormas/backend/event/EventParticipantService.java b/sormas-backend/src/main/java/de/symeda/sormas/backend/event/EventParticipantService.java index 2d354927bcb..2ac2057e9b2 100644 --- a/sormas-backend/src/main/java/de/symeda/sormas/backend/event/EventParticipantService.java +++ b/sormas-backend/src/main/java/de/symeda/sormas/backend/event/EventParticipantService.java @@ -44,7 +44,6 @@ import de.symeda.sormas.api.event.EventParticipantCriteria; import de.symeda.sormas.api.utils.DataHelper; import de.symeda.sormas.api.utils.DateHelper; -import de.symeda.sormas.backend.caze.Case; import de.symeda.sormas.backend.common.AbstractCoreAdoService; import de.symeda.sormas.backend.common.AbstractDomainObject; import de.symeda.sormas.backend.common.ChangeDateBuilder; @@ -267,14 +266,10 @@ public Predicate createActiveEventParticipantsFilter(CriteriaBuilder cb, Join eventParticipantPath) { - logger.warn("Obsolete createUserFilter method called!"); - return createUserFilter(new EventParticipantQueryContext(cb, cq, eventParticipantPath)); + @SuppressWarnings("rawtypes") + protected Predicate createUserFilterInternal(CriteriaBuilder cb, CriteriaQuery cq, From from) { + return createUserFilter(new EventParticipantQueryContext(cb, cq, from)); } public Predicate createUserFilter(EventParticipantQueryContext eventParticipantQueryContext) { @@ -302,7 +297,8 @@ public List getAllByPerson(Person person) { Root from = cq.from(getElementClass()); EventParticipantQueryContext eventParticipantQueryContext = new EventParticipantQueryContext(cb, cq, from); - Predicate userFilter = eventService.createUserFilter(new EventQueryContext(cb, cq, eventParticipantQueryContext.getJoins().getEvent(JoinType.INNER))); + Predicate userFilter = + eventService.createUserFilter(new EventQueryContext(cb, cq, eventParticipantQueryContext.getJoins().getEvent(JoinType.INNER))); Predicate filter = CriteriaBuilderHelper.and(cb, cb.equal(from.get(EventParticipant.PERSON), person), userFilter); @@ -439,7 +435,7 @@ public List findBy(EventParticipantCriteria criteria, User use Predicate filter = buildCriteriaFilter(criteria, queryContext); if (user != null) { - filter = CriteriaBuilderHelper.and(cb, filter, createUserFilter(cb, cq, from)); + filter = CriteriaBuilderHelper.and(cb, filter, createUserFilter(queryContext)); } if (filter != null) { cq.where(filter); diff --git a/sormas-backend/src/main/java/de/symeda/sormas/backend/event/EventService.java b/sormas-backend/src/main/java/de/symeda/sormas/backend/event/EventService.java index d375ca568dc..d06431e979a 100644 --- a/sormas-backend/src/main/java/de/symeda/sormas/backend/event/EventService.java +++ b/sormas-backend/src/main/java/de/symeda/sormas/backend/event/EventService.java @@ -61,6 +61,7 @@ import de.symeda.sormas.backend.action.Action; import de.symeda.sormas.backend.action.ActionService; import de.symeda.sormas.backend.caze.Case; +import de.symeda.sormas.backend.caze.CaseQueryContext; import de.symeda.sormas.backend.caze.CaseService; import de.symeda.sormas.backend.common.AbstractCoreAdoService; import de.symeda.sormas.backend.common.AbstractDomainObject; @@ -338,11 +339,10 @@ public List getDeletedUuidsSince(Date since) { return em.createQuery(cq).getResultList(); } - @SuppressWarnings("rawtypes") @Override - public Predicate createUserFilter(CriteriaBuilder cb, CriteriaQuery cq, From eventPath) { - logger.warn("Obsolete createUserFilter method called!"); - return createUserFilter(new EventQueryContext(cb, cq, new EventJoins(eventPath))); + @SuppressWarnings("rawtypes") + protected Predicate createUserFilterInternal(CriteriaBuilder cb, CriteriaQuery cq, From from) { + return createUserFilter(new EventQueryContext(cb, cq, from)); } public Predicate createUserFilter(EventQueryContext queryContext) { @@ -433,14 +433,13 @@ public Predicate createUserFilter(final EventQueryContext queryContext, final Ev return filter; } - @SuppressWarnings("rawtypes") public Predicate createCaseAndEventParticipantFilter(EventQueryContext eventQueryContext) { - EventJoins joins = eventQueryContext.getJoins(); - From eventParticipants = joins.getEventParticipants(); - Join caseJoin = joins.getEventParticipantCases(); + + From eventParticipants = eventQueryContext.getJoins().getEventParticipants(); CriteriaBuilder cb = eventQueryContext.getCriteriaBuilder(); - Predicate filter = caseService.createUserFilter(cb, eventQueryContext.getQuery(), caseJoin); + Predicate filter = caseService.createUserFilter( + new CaseQueryContext(cb, eventQueryContext.getQuery(), eventQueryContext.getJoins().getEventParticipantJoins().getCaseJoins())); final User currentUser = getCurrentUser(); final JurisdictionLevel jurisdictionLevel = currentUser.getJurisdictionLevel(); @@ -940,7 +939,7 @@ public List getAllByCase(String caseUuid) { CriteriaQuery cq = cb.createQuery(getElementClass()); Root from = cq.from(getElementClass()); from.fetch(Event.EVENT_LOCATION); - + EventQueryContext eventQueryContext = new EventQueryContext(cb, cq, from); EventJoins joins = eventQueryContext.getJoins(); diff --git a/sormas-backend/src/main/java/de/symeda/sormas/backend/immunization/DirectoryImmunizationService.java b/sormas-backend/src/main/java/de/symeda/sormas/backend/immunization/DirectoryImmunizationService.java index 17e1b4ae445..ae41b3eed04 100644 --- a/sormas-backend/src/main/java/de/symeda/sormas/backend/immunization/DirectoryImmunizationService.java +++ b/sormas-backend/src/main/java/de/symeda/sormas/backend/immunization/DirectoryImmunizationService.java @@ -67,7 +67,6 @@ public DirectoryImmunizationService() { @Override public Predicate createUserFilter(CriteriaBuilder cb, CriteriaQuery cq, From immunizationDirectoryPath) { - logger.warn("Obsolete createUserFilter method called!"); return createUserFilter(new DirectoryImmunizationQueryContext(cb, cq, immunizationDirectoryPath)); } diff --git a/sormas-backend/src/main/java/de/symeda/sormas/backend/immunization/ImmunizationService.java b/sormas-backend/src/main/java/de/symeda/sormas/backend/immunization/ImmunizationService.java index 28d389e8a9a..980bf9117e9 100644 --- a/sormas-backend/src/main/java/de/symeda/sormas/backend/immunization/ImmunizationService.java +++ b/sormas-backend/src/main/java/de/symeda/sormas/backend/immunization/ImmunizationService.java @@ -143,11 +143,10 @@ private Predicate isInJurisdictionOrOwned(ImmunizationQueryContext qc) { filter = ImmunizationJurisdictionPredicateValidator.of(qc, currentUser).inJurisdictionOrOwned(); } else { filter = CriteriaBuilderHelper.or( - cb, - cb.equal(qc.getRoot().get(Immunization.REPORTING_USER), currentUser), - PersonJurisdictionPredicateValidator - .of(qc.getQuery(), cb, new PersonJoins(qc.getJoins().getPerson()), currentUser, false) - .inJurisdictionOrOwned()); + cb, + cb.equal(qc.getRoot().get(Immunization.REPORTING_USER), currentUser), + PersonJurisdictionPredicateValidator.of(qc.getQuery(), cb, new PersonJoins(qc.getJoins().getPerson()), currentUser, false) + .inJurisdictionOrOwned()); } return filter; } @@ -162,12 +161,6 @@ public boolean inJurisdictionOrOwned(Immunization immunization) { return em.createQuery(cq).getResultStream().anyMatch(isInJurisdiction -> isInJurisdiction); } - @Override - public Predicate createUserFilter(CriteriaBuilder cb, CriteriaQuery cq, From immunizationPath) { - logger.warn("Obsolete createUserFilter method called!"); - return createUserFilter(new ImmunizationQueryContext(cb, cq, immunizationPath)); - } - public Predicate createActiveImmunizationsFilter(CriteriaBuilder cb, From root) { return cb.and(cb.isFalse(root.get(Immunization.ARCHIVED)), cb.isFalse(root.get(Immunization.DELETED))); } @@ -487,6 +480,12 @@ public List getByPersonUuids(List personUuids) { return immunizations; } + @Override + @SuppressWarnings("rawtypes") + protected Predicate createUserFilterInternal(CriteriaBuilder cb, CriteriaQuery cq, From from) { + return createUserFilter(new ImmunizationQueryContext(cb, cq, from)); + } + public Predicate createUserFilter(ImmunizationQueryContext qc) { User currentUser = getCurrentUser(); diff --git a/sormas-backend/src/main/java/de/symeda/sormas/backend/person/PersonFacadeEjb.java b/sormas-backend/src/main/java/de/symeda/sormas/backend/person/PersonFacadeEjb.java index a26855fe2fd..2ca603ff406 100644 --- a/sormas-backend/src/main/java/de/symeda/sormas/backend/person/PersonFacadeEjb.java +++ b/sormas-backend/src/main/java/de/symeda/sormas/backend/person/PersonFacadeEjb.java @@ -18,8 +18,6 @@ import static java.util.stream.Collectors.groupingBy; import static java.util.stream.Collectors.maxBy; -import de.symeda.sormas.backend.event.EventFacadeEjb; -import de.symeda.sormas.backend.event.EventParticipantFacadeEjb; import java.util.ArrayList; import java.util.Arrays; import java.util.Collections; @@ -121,15 +119,21 @@ import de.symeda.sormas.backend.caze.Case; import de.symeda.sormas.backend.caze.CaseFacadeEjb; import de.symeda.sormas.backend.caze.CaseFacadeEjb.CaseFacadeEjbLocal; +import de.symeda.sormas.backend.caze.CaseJoins; +import de.symeda.sormas.backend.caze.CaseQueryContext; import de.symeda.sormas.backend.caze.CaseService; import de.symeda.sormas.backend.common.AbstractDomainObject; import de.symeda.sormas.backend.common.CriteriaBuilderHelper; import de.symeda.sormas.backend.contact.Contact; import de.symeda.sormas.backend.contact.ContactFacadeEjb; import de.symeda.sormas.backend.contact.ContactFacadeEjb.ContactFacadeEjbLocal; +import de.symeda.sormas.backend.contact.ContactJoins; +import de.symeda.sormas.backend.contact.ContactQueryContext; import de.symeda.sormas.backend.contact.ContactService; +import de.symeda.sormas.backend.event.EventFacadeEjb; import de.symeda.sormas.backend.event.EventFacadeEjb.EventFacadeEjbLocal; import de.symeda.sormas.backend.event.EventParticipant; +import de.symeda.sormas.backend.event.EventParticipantFacadeEjb; import de.symeda.sormas.backend.event.EventParticipantFacadeEjb.EventParticipantFacadeEjbLocal; import de.symeda.sormas.backend.event.EventParticipantService; import de.symeda.sormas.backend.externaljournal.ExternalJournalService; @@ -672,7 +676,7 @@ private Stream getContactLatestFollowUpEndDates(Date since Root contactRoot = cq.from(Contact.class); Join personJoin = contactRoot.join(Contact.PERSON, JoinType.LEFT); - Predicate filter = contactService.createUserFilter(cb, cq, contactRoot); + Predicate filter = contactService.createUserFilter(new ContactQueryContext(cb, cq, new ContactJoins(contactRoot))); if (since != null) { filter = CriteriaBuilderHelper.and(cb, filter, contactService.createChangeDateFilter(cb, contactRoot, since)); @@ -702,7 +706,7 @@ private Stream getCaseLatestFollowUpEndDates(Date since, b Root caseRoot = cq.from(Case.class); Join personJoin = caseRoot.join(Case.PERSON, JoinType.LEFT); - Predicate filter = caseService.createUserFilter(cb, cq, caseRoot); + Predicate filter = caseService.createUserFilter(new CaseQueryContext(cb, cq, new CaseJoins(caseRoot))); if (since != null) { filter = CriteriaBuilderHelper.and(cb, filter, caseService.createChangeDateFilter(cb, caseRoot, since)); } @@ -744,7 +748,7 @@ private Date getContactLatestFollowUpEndDate(String uuid) { Root contactRoot = cq.from(Contact.class); Join personJoin = contactRoot.join(Contact.PERSON, JoinType.LEFT); - Predicate filter = contactService.createUserFilter(cb, cq, contactRoot); + Predicate filter = contactService.createUserFilter(new ContactQueryContext(cb, cq, new ContactJoins(contactRoot))); filter = CriteriaBuilderHelper.and(cb, filter, cb.notEqual(contactRoot.get(Contact.FOLLOW_UP_STATUS), FollowUpStatus.CANCELED)); filter = CriteriaBuilderHelper.and(cb, filter, cb.notEqual(contactRoot.get(Contact.FOLLOW_UP_STATUS), FollowUpStatus.NO_FOLLOW_UP)); @@ -775,7 +779,7 @@ private Date getCaseLatestFollowUpEndDate(String uuid) { Root caseRoot = cq.from(Case.class); Join personJoin = caseRoot.join(Case.PERSON, JoinType.LEFT); - Predicate filter = caseService.createUserFilter(cb, cq, caseRoot); + Predicate filter = caseService.createUserFilter(new CaseQueryContext(cb, cq, new CaseJoins(caseRoot))); filter = CriteriaBuilderHelper.and(cb, filter, cb.equal(caseRoot.get(Case.DELETED), false)); @@ -805,7 +809,7 @@ FollowUpStatus getMostRelevantFollowUpStatusByUuid(String uuid) { Root contactRoot = cq.from(Contact.class); Join personContactJoin = contactRoot.join(Contact.PERSON, JoinType.LEFT); - Predicate contactFilter = contactService.createUserFilter(cb, cq, contactRoot); + Predicate contactFilter = contactService.createUserFilter(new ContactQueryContext(cb, cq, new ContactJoins(contactRoot))); contactFilter = CriteriaBuilderHelper.and(cb, contactFilter, cb.equal(contactRoot.get(Contact.DELETED), false)); @@ -821,7 +825,7 @@ FollowUpStatus getMostRelevantFollowUpStatusByUuid(String uuid) { cq = cb.createQuery(FollowUpStatusDto.class); Root caseRoot = cq.from(Case.class); Join personCaseJoin = caseRoot.join(Case.PERSON, JoinType.LEFT); - Predicate caseFilter = caseService.createUserFilter(cb, cq, caseRoot); + Predicate caseFilter = caseService.createUserFilter(new CaseQueryContext(cb, cq, new CaseJoins(caseRoot))); caseFilter = CriteriaBuilderHelper.and(cb, caseFilter, cb.equal(caseRoot.get(Case.DELETED), false)); diff --git a/sormas-backend/src/main/java/de/symeda/sormas/backend/person/PersonService.java b/sormas-backend/src/main/java/de/symeda/sormas/backend/person/PersonService.java index a8ae3953b3a..fbc42ebe7d3 100644 --- a/sormas-backend/src/main/java/de/symeda/sormas/backend/person/PersonService.java +++ b/sormas-backend/src/main/java/de/symeda/sormas/backend/person/PersonService.java @@ -54,8 +54,6 @@ import javax.transaction.Transactional; import javax.validation.constraints.NotNull; -import de.symeda.sormas.backend.caze.CaseQueryContext; -import de.symeda.sormas.backend.travelentry.TravelEntryQueryContext; import org.apache.commons.lang3.StringUtils; import de.symeda.sormas.api.Disease; @@ -76,6 +74,8 @@ import de.symeda.sormas.api.utils.DataHelper; import de.symeda.sormas.api.utils.DateHelper; import de.symeda.sormas.backend.caze.Case; +import de.symeda.sormas.backend.caze.CaseJoins; +import de.symeda.sormas.backend.caze.CaseQueryContext; import de.symeda.sormas.backend.caze.CaseService; import de.symeda.sormas.backend.caze.CaseUserFilterCriteria; import de.symeda.sormas.backend.common.AbstractDomainObject; @@ -86,14 +86,17 @@ import de.symeda.sormas.backend.common.CriteriaBuilderHelper; import de.symeda.sormas.backend.common.messaging.ManualMessageLogService; import de.symeda.sormas.backend.contact.Contact; +import de.symeda.sormas.backend.contact.ContactJoins; import de.symeda.sormas.backend.contact.ContactQueryContext; import de.symeda.sormas.backend.contact.ContactService; import de.symeda.sormas.backend.event.EventParticipant; +import de.symeda.sormas.backend.event.EventParticipantJoins; import de.symeda.sormas.backend.event.EventParticipantQueryContext; import de.symeda.sormas.backend.event.EventParticipantService; import de.symeda.sormas.backend.event.EventUserFilterCriteria; import de.symeda.sormas.backend.feature.FeatureConfigurationFacadeEjb.FeatureConfigurationFacadeEjbLocal; import de.symeda.sormas.backend.geocoding.GeocodingService; +import de.symeda.sormas.backend.immunization.ImmunizationJoins; import de.symeda.sormas.backend.immunization.ImmunizationQueryContext; import de.symeda.sormas.backend.immunization.ImmunizationService; import de.symeda.sormas.backend.immunization.entity.Immunization; @@ -102,6 +105,8 @@ import de.symeda.sormas.backend.infrastructure.region.Region; import de.symeda.sormas.backend.location.Location; import de.symeda.sormas.backend.travelentry.TravelEntry; +import de.symeda.sormas.backend.travelentry.TravelEntryJoins; +import de.symeda.sormas.backend.travelentry.TravelEntryQueryContext; import de.symeda.sormas.backend.travelentry.services.TravelEntryService; import de.symeda.sormas.backend.user.User; import de.symeda.sormas.backend.user.UserService; @@ -162,7 +167,7 @@ public List getAllUuids() { Root casePersonsRoot = casePersonsQuery.from(Case.class); Join casePersonsSelect = casePersonsRoot.join(Case.PERSON); casePersonsQuery.select(casePersonsSelect.get(Person.UUID)); - Predicate casePersonsFilter = caseService.createUserFilter(cb, casePersonsQuery, casePersonsRoot); + Predicate casePersonsFilter = caseService.createUserFilter(new CaseQueryContext(cb, casePersonsQuery, new CaseJoins(casePersonsRoot))); if (casePersonsFilter != null) { casePersonsQuery.where(casePersonsFilter); } @@ -174,7 +179,8 @@ public List getAllUuids() { Root contactPersonsRoot = contactPersonsQuery.from(Contact.class); Join contactPersonsSelect = contactPersonsRoot.join(Contact.PERSON); contactPersonsQuery.select(contactPersonsSelect.get(Person.UUID)); - Predicate contactPersonsFilter = contactService.createUserFilter(cb, contactPersonsQuery, contactPersonsRoot); + Predicate contactPersonsFilter = + contactService.createUserFilter(new ContactQueryContext(cb, contactPersonsQuery, new ContactJoins(contactPersonsRoot))); if (contactPersonsFilter != null) { contactPersonsQuery.where(contactPersonsFilter); } @@ -186,7 +192,8 @@ public List getAllUuids() { Root eventPersonsRoot = eventPersonsQuery.from(EventParticipant.class); Join eventPersonsSelect = eventPersonsRoot.join(EventParticipant.PERSON); eventPersonsQuery.select(eventPersonsSelect.get(Person.UUID)); - Predicate eventPersonsFilter = eventParticipantService.createUserFilter(new EventParticipantQueryContext(cb, eventPersonsQuery, eventPersonsRoot)); + Predicate eventPersonsFilter = eventParticipantService + .createUserFilter(new EventParticipantQueryContext(cb, eventPersonsQuery, new EventParticipantJoins(eventPersonsRoot))); if (eventPersonsFilter != null) { eventPersonsQuery.where(eventPersonsFilter); } @@ -200,7 +207,8 @@ public List getAllUuids() { Root immunizationPersonsRoot = immunizationPersonsQuery.from(Immunization.class); Join immunizationPersonsSelect = immunizationPersonsRoot.join(Immunization.PERSON); immunizationPersonsQuery.select(immunizationPersonsSelect.get(Person.UUID)); - Predicate immunizationPersonsFilter = immunizationService.createUserFilter(cb, immunizationPersonsQuery, immunizationPersonsRoot); + Predicate immunizationPersonsFilter = immunizationService + .createUserFilter(new ImmunizationQueryContext(cb, immunizationPersonsQuery, new ImmunizationJoins(immunizationPersonsRoot))); if (immunizationPersonsFilter != null) { immunizationPersonsQuery.where(immunizationPersonsFilter); } @@ -213,7 +221,8 @@ public List getAllUuids() { Root travelEntryPersonsRoot = travelEntryPersonsQuery.from(TravelEntry.class); Join travelEntryPersonsSelect = travelEntryPersonsRoot.join(TravelEntry.PERSON); travelEntryPersonsQuery.select(travelEntryPersonsSelect.get(Person.UUID)); - Predicate travelEntryPersonsFilter = travelEntryService.createUserFilter(cb, travelEntryPersonsQuery, travelEntryPersonsRoot); + Predicate travelEntryPersonsFilter = travelEntryService + .createUserFilter(new TravelEntryQueryContext(cb, travelEntryPersonsQuery, new TravelEntryJoins(travelEntryPersonsRoot))); if (travelEntryPersonsFilter != null) { travelEntryPersonsQuery.where(travelEntryPersonsFilter); } @@ -235,13 +244,12 @@ public List getAllUuids() { @Override @Deprecated + @SuppressWarnings("rawtypes") public Predicate createUserFilter(CriteriaBuilder cb, CriteriaQuery cq, From from) { throw new UnsupportedOperationException("Should not be called -> obsolete!"); } - @SuppressWarnings({ - "rawtypes", - "unchecked" }) + @SuppressWarnings("rawtypes") public Predicate createUserFilter(PersonQueryContext personQueryContext, PersonCriteria personCriteria) { final CriteriaBuilder cb = personQueryContext.getCriteriaBuilder(); @@ -264,21 +272,19 @@ public Predicate createUserFilter(PersonQueryContext personQueryContext, PersonC }; final Supplier eventParticipantFilter = () -> CriteriaBuilderHelper.and( cb, - eventParticipantService.createUserFilter( new EventParticipantQueryContext( - cb, - cq, - joins.getEventParticipantJoins()), + eventParticipantService.createUserFilter( + new EventParticipantQueryContext(cb, cq, joins.getEventParticipantJoins()), new EventUserFilterCriteria().includeUserCaseAndEventParticipantFilter(false).forceRegionJurisdiction(true)), eventParticipantService.createDefaultFilter(cb, joins.getEventParticipant())); final Supplier immunizationFilter = fullImmunizationModuleUsed ? () -> CriteriaBuilderHelper.and( cb, - immunizationService.createUserFilter(cb, cq, joins.getImmunization()), + immunizationService.createUserFilter(new ImmunizationQueryContext(cb, cq, joins.getImmunizationJoins())), immunizationService.createDefaultFilter(cb, joins.getImmunization())) : () -> null; final Supplier travelEntryFilter = () -> CriteriaBuilderHelper.and( cb, - travelEntryService.createUserFilter(cb, cq, joins.getTravelEntry()), + travelEntryService.createUserFilter(new TravelEntryQueryContext(cb, cq, joins.getTravelEntryJoins())), travelEntryService.createDefaultFilter(cb, joins.getTravelEntry())); // 2. Define the Joins on associations where needed @@ -396,7 +402,7 @@ public List getAllAfter(Date date, Integer batchSize, String lastSynchro Join casePersonsSelect = casePersonsRoot.join(Case.PERSON); casePersonsSelect.fetch(Person.ADDRESS); casePersonsQuery.select(casePersonsSelect); - Predicate casePersonsFilter = caseService.createUserFilter(cb, casePersonsQuery, casePersonsRoot); + Predicate casePersonsFilter = caseService.createUserFilter(new CaseQueryContext(cb, casePersonsQuery, new CaseJoins(casePersonsRoot))); // date range if (date != null) { Predicate dateFilter = createChangeDateFilter(cb, casePersonsSelect, DateHelper.toTimestampUpper(date), lastSynchronizedUuid); @@ -423,7 +429,8 @@ public List getAllAfter(Date date, Integer batchSize, String lastSynchro Join contactPersonsSelect = contactPersonsRoot.join(Contact.PERSON); contactPersonsSelect.fetch(Person.ADDRESS); contactPersonsQuery.select(contactPersonsSelect); - Predicate contactPersonsFilter = contactService.createUserFilter(cb, contactPersonsQuery, contactPersonsRoot); + Predicate contactPersonsFilter = + contactService.createUserFilter(new ContactQueryContext(cb, contactPersonsQuery, new ContactJoins(contactPersonsRoot))); // date range if (date != null) { Predicate dateFilter = createChangeDateFilter(cb, contactPersonsSelect, DateHelper.toTimestampUpper(date), lastSynchronizedUuid); @@ -445,7 +452,8 @@ public List getAllAfter(Date date, Integer batchSize, String lastSynchro Join eventPersonsSelect = eventPersonsRoot.join(EventParticipant.PERSON); eventPersonsSelect.fetch(Person.ADDRESS); eventPersonsQuery.select(eventPersonsSelect); - Predicate eventPersonsFilter = eventParticipantService.createUserFilter(new EventParticipantQueryContext(cb, eventPersonsQuery, eventPersonsRoot)); + Predicate eventPersonsFilter = eventParticipantService + .createUserFilter(new EventParticipantQueryContext(cb, eventPersonsQuery, new EventParticipantJoins(eventPersonsRoot))); // date range if (date != null) { Predicate dateFilter = createChangeDateFilter(cb, eventPersonsSelect, DateHelper.toTimestampUpper(date), lastSynchronizedUuid); @@ -470,7 +478,8 @@ public List getAllAfter(Date date, Integer batchSize, String lastSynchro Join immunizationPersonsSelect = immunizationPersonsRoot.join(Immunization.PERSON); immunizationPersonsSelect.fetch(Person.ADDRESS); immunizationPersonsQuery.select(immunizationPersonsSelect); - Predicate immunizationPersonsFilter = immunizationService.createUserFilter(new ImmunizationQueryContext(cb, immunizationPersonsQuery, immunizationPersonsRoot)); + Predicate immunizationPersonsFilter = immunizationService + .createUserFilter(new ImmunizationQueryContext(cb, immunizationPersonsQuery, new ImmunizationJoins(immunizationPersonsRoot))); // date range if (date != null) { Predicate dateFilter = createChangeDateFilter(cb, immunizationPersonsSelect, DateHelper.toTimestampUpper(date), lastSynchronizedUuid); @@ -497,7 +506,7 @@ public List getAllAfter(Date date, Integer batchSize, String lastSynchro Join tepSelect = tepRoot.join(TravelEntry.PERSON); tepSelect.fetch(Person.ADDRESS); tepQuery.select(tepSelect); - Predicate tepFilter = travelEntryService.createUserFilter(cb, tepQuery, tepRoot); + Predicate tepFilter = travelEntryService.createUserFilter(new TravelEntryQueryContext(cb, tepQuery, new TravelEntryJoins(tepRoot))); // date range if (date != null) { Predicate dateFilter = createChangeDateFilter(cb, tepSelect, DateHelper.toTimestampUpper(date)); @@ -581,7 +590,7 @@ public List getSimilarPersonDtos(PersonSimilarityCriteria crit Predicate personSimilarityFilter = buildSimilarityCriteriaFilter(criteria, cb, personRoot); Predicate activeCasesFilter = activeEntriesOnly ? caseService.createActiveCasesFilter(cb, personCaseJoin) : caseService.createDefaultFilter(cb, personCaseJoin); - Predicate caseUserFilter = caseService.createUserFilter(cb, personQuery, personCaseJoin); + Predicate caseUserFilter = caseService.createUserFilter(new CaseQueryContext(cb, personQuery, personQueryContext.getJoins().getCaseJoins())); Predicate personCasePredicate = and(cb, personCaseJoin.get(Case.ID).isNotNull(), activeCasesFilter, caseUserFilter); // Persons of active contacts @@ -593,12 +602,12 @@ public List getSimilarPersonDtos(PersonSimilarityCriteria crit Predicate personContactPredicate = and(cb, personContactJoin.get(Contact.ID).isNotNull(), contactUserFilter, activeContactsFilter); // Persons of event participants in active events - final EventParticipantQueryContext eventParticipantQueryContext = new EventParticipantQueryContext(cb, personQuery, joins.getEventParticipantJoins()); + final EventParticipantQueryContext eventParticipantQueryContext = + new EventParticipantQueryContext(cb, personQuery, joins.getEventParticipantJoins()); Predicate activeEventParticipantsFilter = activeEntriesOnly ? eventParticipantService.createActiveEventParticipantsInActiveEventsFilter(eventParticipantQueryContext) : eventParticipantService.createDefaultInUndeletedEventsFilter(eventParticipantQueryContext); - Predicate eventParticipantUserFilter = - eventParticipantService.createUserFilter(eventParticipantQueryContext); + Predicate eventParticipantUserFilter = eventParticipantService.createUserFilter(eventParticipantQueryContext); Predicate personEventParticipantPredicate = and(cb, personEventParticipantJoin.get(EventParticipant.ID).isNotNull(), activeEventParticipantsFilter, eventParticipantUserFilter); @@ -608,7 +617,8 @@ public List getSimilarPersonDtos(PersonSimilarityCriteria crit Predicate activeImmunizationsFilter = activeEntriesOnly ? immunizationService.createActiveImmunizationsFilter(cb, personImmunizationJoin) : immunizationService.createDefaultFilter(cb, personImmunizationJoin); - Predicate immunizationUserFilter = immunizationService.createUserFilter(new ImmunizationQueryContext(cb, personQuery, personImmunizationJoin)); + Predicate immunizationUserFilter = + immunizationService.createUserFilter(new ImmunizationQueryContext(cb, personQuery, joins.getImmunizationJoins())); personImmunizationPredicate = and(cb, personImmunizationJoin.get(Immunization.ID).isNotNull(), immunizationUserFilter, activeImmunizationsFilter); } @@ -617,7 +627,8 @@ public List getSimilarPersonDtos(PersonSimilarityCriteria crit Predicate activeTravelEntriesFilter = activeEntriesOnly ? travelEntryService.createActiveTravelEntriesFilter(cb, personTravelEntryJoin) : travelEntryService.createDefaultFilter(cb, personTravelEntryJoin); - Predicate travelEntryUserFilter = travelEntryService.createUserFilter(new TravelEntryQueryContext(cb, personQuery, personTravelEntryJoin)); + Predicate travelEntryUserFilter = + travelEntryService.createUserFilter(new TravelEntryQueryContext(cb, personQuery, joins.getTravelEntryJoins())); Predicate personTravelEntryPredicate = and(cb, personTravelEntryJoin.get(TravelEntry.ID).isNotNull(), travelEntryUserFilter, activeTravelEntriesFilter); @@ -694,7 +705,7 @@ public List getDeathsBetween(Date fromDate, Date toDate, District distri Root casePersonsRoot = casePersonsQuery.from(Case.class); Path casePersonsSelect = casePersonsRoot.get(Case.PERSON); casePersonsQuery.select(casePersonsSelect); - Predicate casePersonsFilter = caseService.createUserFilter(cb, casePersonsQuery, casePersonsRoot); + Predicate casePersonsFilter = caseService.createUserFilter(new CaseQueryContext(cb, casePersonsQuery, new CaseJoins(casePersonsRoot))); // only probable and confirmed cases are of interest Predicate classificationFilter = cb.equal(casePersonsRoot.get(Case.CASE_CLASSIFICATION), CaseClassification.CONFIRMED); diff --git a/sormas-backend/src/main/java/de/symeda/sormas/backend/sample/SampleService.java b/sormas-backend/src/main/java/de/symeda/sormas/backend/sample/SampleService.java index 1d96bb88a01..b61d040c41c 100644 --- a/sormas-backend/src/main/java/de/symeda/sormas/backend/sample/SampleService.java +++ b/sormas-backend/src/main/java/de/symeda/sormas/backend/sample/SampleService.java @@ -607,7 +607,6 @@ public Map getNewTestResultCountByResultType(List< @SuppressWarnings("rawtypes") @Deprecated public Predicate createUserFilter(CriteriaBuilder cb, CriteriaQuery cq, From samplePath) { - logger.warn("Obsolete createUserFilter method called!"); return createUserFilter(new SampleQueryContext(cb, cq, samplePath), null); } diff --git a/sormas-backend/src/main/java/de/symeda/sormas/backend/task/TaskService.java b/sormas-backend/src/main/java/de/symeda/sormas/backend/task/TaskService.java index c9c77f4eef7..d16ad0c4cf0 100644 --- a/sormas-backend/src/main/java/de/symeda/sormas/backend/task/TaskService.java +++ b/sormas-backend/src/main/java/de/symeda/sormas/backend/task/TaskService.java @@ -139,18 +139,12 @@ public List getAllActiveUuids(User user) { /** * @see /sormas-backend/doc/UserDataAccess.md */ - @SuppressWarnings({ - "rawtypes", - "unchecked" }) @Override + @SuppressWarnings("rawtypes") public Predicate createUserFilter(CriteriaBuilder cb, CriteriaQuery cq, From taskPath) { - logger.warn("Obsolete createUserFilter method called!"); return createUserFilter(new TaskQueryContext(cb, cq, taskPath)); } - @SuppressWarnings({ - "rawtypes", - "unchecked" }) public Predicate createUserFilter(TaskQueryContext taskQueryContext) { User currentUser = getCurrentUser(); @@ -164,9 +158,13 @@ public Predicate createUserFilter(TaskQueryContext taskQueryContext) { Predicate assigneeFilter = createAssigneeFilter(cb, taskQueryContext.getJoins().getAssignee()); - Predicate contactRightsPredicate = this.createContactFilter(cb ,taskQueryContext.getRoot(), (taskQueryContext.getJoins()).getAssignee(), - (taskQueryContext.getJoins()).getTaskObservers(), currentUser); - if(contactRightsPredicate != null){ + Predicate contactRightsPredicate = this.createContactFilter( + cb, + taskQueryContext.getRoot(), + (taskQueryContext.getJoins()).getAssignee(), + (taskQueryContext.getJoins()).getTaskObservers(), + currentUser); + if (contactRightsPredicate != null) { assigneeFilter = cb.and(assigneeFilter, contactRightsPredicate); } @@ -179,11 +177,11 @@ public Predicate createUserFilter(TaskQueryContext taskQueryContext) { Predicate filter = cb.equal(taskPath.get(Task.CREATOR_USER), currentUser); filter = cb.or(filter, cb.equal(taskPath.get(Task.ASSIGNEE_USER), currentUser)); - Predicate caseFilter = caseService.createUserFilter(cb, cq, taskQueryContext.getJoins().getCaze()); + Predicate caseFilter = caseService.createUserFilter(new CaseQueryContext(cb, cq, taskQueryContext.getJoins().getCaseJoins())); if (caseFilter != null) { filter = cb.or(filter, caseFilter); } - Predicate contactFilter = contactService.createUserFilter(cb, cq, taskQueryContext.getJoins().getContact()); + Predicate contactFilter = contactService.createUserFilter(new ContactQueryContext(cb, cq, taskQueryContext.getJoins().getContactJoins())); if (contactFilter != null) { filter = cb.or(filter, contactFilter); } @@ -191,7 +189,8 @@ public Predicate createUserFilter(TaskQueryContext taskQueryContext) { if (eventFilter != null) { filter = cb.or(filter, eventFilter); } - Predicate travelEntryFilter = travelEntryService.createUserFilter(cb, cq, taskQueryContext.getJoins().getTravelEntry()); + Predicate travelEntryFilter = + travelEntryService.createUserFilter(new TravelEntryQueryContext(cb, cq, taskQueryContext.getJoins().getTravelEntryJoins())); if (travelEntryFilter != null) { filter = cb.or(filter, travelEntryFilter); } @@ -205,21 +204,21 @@ public Predicate createAssigneeFilter(CriteriaBuilder cb, Join assignee } /* - A user that not have CONTACT_VIEW or CONTACT_EDIT rights is allowed to see the tasks assign to it or where it is - set as an observer. This restriction should be applied only for tasks of type CONTACT. + * A user that not have CONTACT_VIEW or CONTACT_EDIT rights is allowed to see the tasks assign to it or where it is + * set as an observer. This restriction should be applied only for tasks of type CONTACT. */ private Predicate createContactFilter( - CriteriaBuilder cb, - From task, - Join assigneeUserJoin, - Join observersJoin, - User user) { + CriteriaBuilder cb, + From task, + Join assigneeUserJoin, + Join observersJoin, + User user) { Predicate predicate = null; if (!userService.hasRight(UserRight.CONTACT_VIEW) && !userService.hasRight(UserRight.CONTACT_EDIT)) { predicate = cb.or( - cb.notEqual(task.get(Task.TASK_CONTEXT), TaskContext.CONTACT), - cb.equal(assigneeUserJoin.get(User.UUID), user.getUuid()), - cb.equal(observersJoin.get(User.UUID), user.getUuid())); + cb.notEqual(task.get(Task.TASK_CONTEXT), TaskContext.CONTACT), + cb.equal(assigneeUserJoin.get(User.UUID), user.getUuid()), + cb.equal(observersJoin.get(User.UUID), user.getUuid())); } return predicate; @@ -593,7 +592,9 @@ public List> getJurisdictionSelections(TaskQueryContext qc) { JurisdictionHelper.booleanSelector(cb, inJurisdictionOrOwned(qc)), JurisdictionHelper.booleanSelector( cb, - cb.and(cb.isNotNull(joins.getCaze()), caseService.inJurisdictionOrOwned(new CaseQueryContext(cb, qc.getQuery(), joins.getCaseJoins())))), + cb.and( + cb.isNotNull(joins.getCaze()), + caseService.inJurisdictionOrOwned(new CaseQueryContext(cb, qc.getQuery(), joins.getCaseJoins())))), JurisdictionHelper.booleanSelector( cb, cb.and( @@ -614,7 +615,7 @@ public List> getJurisdictionSelections(TaskQueryContext qc) { cb, cb.and( cb.isNotNull(joins.getTravelEntry()), - travelEntryService.inJurisdictionOrOwned(new TravelEntryQueryContext(cb, qc.getQuery(), joins.getTravelEntry()))))); + travelEntryService.inJurisdictionOrOwned(new TravelEntryQueryContext(cb, qc.getQuery(), joins.getTravelEntryJoins()))))); } public Predicate inJurisdictionOrOwned(TaskQueryContext qc) { diff --git a/sormas-backend/src/main/java/de/symeda/sormas/backend/therapy/PrescriptionService.java b/sormas-backend/src/main/java/de/symeda/sormas/backend/therapy/PrescriptionService.java index 3914f7c3dda..01ca5cd7203 100644 --- a/sormas-backend/src/main/java/de/symeda/sormas/backend/therapy/PrescriptionService.java +++ b/sormas-backend/src/main/java/de/symeda/sormas/backend/therapy/PrescriptionService.java @@ -20,6 +20,8 @@ import de.symeda.sormas.api.therapy.PrescriptionCriteria; import de.symeda.sormas.api.utils.DataHelper; import de.symeda.sormas.backend.caze.Case; +import de.symeda.sormas.backend.caze.CaseJoins; +import de.symeda.sormas.backend.caze.CaseQueryContext; import de.symeda.sormas.backend.caze.CaseService; import de.symeda.sormas.backend.common.AdoServiceWithUserFilter; import de.symeda.sormas.backend.common.CriteriaBuilderHelper; @@ -153,6 +155,6 @@ public Predicate buildCriteriaFilter(PrescriptionCriteria criteria, CriteriaBuil public Predicate createUserFilter(CriteriaBuilder cb, CriteriaQuery cq, From from) { Join therapy = from.join(Prescription.THERAPY, JoinType.LEFT); - return caseService.createUserFilter(cb, cq, therapy.join(Therapy.CASE, JoinType.LEFT)); + return caseService.createUserFilter(new CaseQueryContext(cb, cq, new CaseJoins(therapy.join(Therapy.CASE, JoinType.LEFT)))); } } diff --git a/sormas-backend/src/main/java/de/symeda/sormas/backend/therapy/TreatmentService.java b/sormas-backend/src/main/java/de/symeda/sormas/backend/therapy/TreatmentService.java index c02650c6419..de77e806239 100644 --- a/sormas-backend/src/main/java/de/symeda/sormas/backend/therapy/TreatmentService.java +++ b/sormas-backend/src/main/java/de/symeda/sormas/backend/therapy/TreatmentService.java @@ -20,6 +20,8 @@ import de.symeda.sormas.api.therapy.TreatmentCriteria; import de.symeda.sormas.api.utils.DataHelper; import de.symeda.sormas.backend.caze.Case; +import de.symeda.sormas.backend.caze.CaseJoins; +import de.symeda.sormas.backend.caze.CaseQueryContext; import de.symeda.sormas.backend.caze.CaseService; import de.symeda.sormas.backend.common.AdoServiceWithUserFilter; import de.symeda.sormas.backend.common.CriteriaBuilderHelper; @@ -151,6 +153,6 @@ public Predicate buildCriteriaFilter(TreatmentCriteria criteria, CriteriaBuilder @Override public Predicate createUserFilter(CriteriaBuilder cb, CriteriaQuery cq, From from) { Join therapy = from.join(Treatment.THERAPY, JoinType.LEFT); - return caseService.createUserFilter(cb, cq, therapy.join(Therapy.CASE, JoinType.LEFT)); + return caseService.createUserFilter(new CaseQueryContext(cb, cq, new CaseJoins(therapy.join(Therapy.CASE, JoinType.LEFT)))); } } diff --git a/sormas-backend/src/main/java/de/symeda/sormas/backend/travelentry/services/BaseTravelEntryService.java b/sormas-backend/src/main/java/de/symeda/sormas/backend/travelentry/services/BaseTravelEntryService.java index 47d02af8b20..7b3cd49e4ce 100644 --- a/sormas-backend/src/main/java/de/symeda/sormas/backend/travelentry/services/BaseTravelEntryService.java +++ b/sormas-backend/src/main/java/de/symeda/sormas/backend/travelentry/services/BaseTravelEntryService.java @@ -7,18 +7,14 @@ import javax.persistence.criteria.CriteriaBuilder; import javax.persistence.criteria.CriteriaQuery; import javax.persistence.criteria.From; -import javax.persistence.criteria.Join; -import javax.persistence.criteria.JoinType; import javax.persistence.criteria.Predicate; import javax.persistence.criteria.Root; import de.symeda.sormas.api.utils.DateHelper; -import de.symeda.sormas.backend.caze.Case; import de.symeda.sormas.backend.common.AbstractCoreAdoService; import de.symeda.sormas.backend.common.ChangeDateBuilder; import de.symeda.sormas.backend.common.CriteriaBuilderHelper; import de.symeda.sormas.backend.contact.Contact; -import de.symeda.sormas.backend.person.Person; import de.symeda.sormas.backend.travelentry.TravelEntry; import de.symeda.sormas.backend.travelentry.TravelEntryJurisdictionPredicateValidator; import de.symeda.sormas.backend.travelentry.TravelEntryQueryContext; @@ -34,12 +30,6 @@ public BaseTravelEntryService() { super(TravelEntry.class); } - @Override - public Predicate createUserFilter(CriteriaBuilder cb, CriteriaQuery cq, From travelEntryPath) { - logger.warn("Obsolete createUserFilter method called!"); - return createUserFilter(new TravelEntryQueryContext(cb, cq, travelEntryPath)); - } - public Predicate inJurisdictionOrOwned(TravelEntryQueryContext qc, User user) { return TravelEntryJurisdictionPredicateValidator.of(qc, user).inJurisdictionOrOwned(); } @@ -52,6 +42,12 @@ public Predicate createDefaultFilter(CriteriaBuilder cb, From ro return cb.isFalse(root.get(TravelEntry.DELETED)); } + @Override + @SuppressWarnings("rawtypes") + protected Predicate createUserFilterInternal(CriteriaBuilder cb, CriteriaQuery cq, From from) { + return createUserFilter(new TravelEntryQueryContext(cb, cq, from)); + } + public Predicate createUserFilter(TravelEntryQueryContext qc) { User currentUser = getCurrentUser(); if (currentUser == null) { diff --git a/sormas-backend/src/main/java/de/symeda/sormas/backend/visit/VisitService.java b/sormas-backend/src/main/java/de/symeda/sormas/backend/visit/VisitService.java index c79bb22043b..a03a410ffea 100644 --- a/sormas-backend/src/main/java/de/symeda/sormas/backend/visit/VisitService.java +++ b/sormas-backend/src/main/java/de/symeda/sormas/backend/visit/VisitService.java @@ -38,7 +38,6 @@ import javax.persistence.criteria.JoinType; import javax.persistence.criteria.Predicate; import javax.persistence.criteria.Root; -import javax.persistence.criteria.Subquery; import de.symeda.sormas.api.Disease; import de.symeda.sormas.api.caze.CaseLogic; @@ -47,20 +46,20 @@ import de.symeda.sormas.api.utils.DateHelper; import de.symeda.sormas.api.visit.VisitCriteria; import de.symeda.sormas.backend.caze.Case; +import de.symeda.sormas.backend.caze.CaseJoins; import de.symeda.sormas.backend.caze.CaseQueryContext; import de.symeda.sormas.backend.caze.CaseService; import de.symeda.sormas.backend.common.AbstractDomainObject; import de.symeda.sormas.backend.common.BaseAdoService; import de.symeda.sormas.backend.common.ChangeDateFilterBuilder; -import de.symeda.sormas.backend.common.CoreAdo; import de.symeda.sormas.backend.common.CriteriaBuilderHelper; import de.symeda.sormas.backend.contact.Contact; +import de.symeda.sormas.backend.contact.ContactJoins; import de.symeda.sormas.backend.contact.ContactQueryContext; import de.symeda.sormas.backend.contact.ContactService; import de.symeda.sormas.backend.person.Person; import de.symeda.sormas.backend.symptoms.Symptoms; import de.symeda.sormas.backend.user.User; -import de.symeda.sormas.backend.util.IterableHelper; import de.symeda.sormas.backend.util.JurisdictionHelper; @Stateless @@ -82,11 +81,8 @@ public boolean inJurisdiction(Visit visit) { CriteriaQuery cq = cb.createQuery(Boolean.class); Root root = cq.from(Visit.class); VisitJoins visitJoins = new VisitJoins(root, JoinType.LEFT); - Expression objectExpression = JurisdictionHelper.booleanSelector( - cb, - cb.and( - cb.equal(root.get(AbstractDomainObject.ID), visit.getId()), - inJurisdiction(cq, cb, visitJoins))); + Expression objectExpression = JurisdictionHelper + .booleanSelector(cb, cb.and(cb.equal(root.get(AbstractDomainObject.ID), visit.getId()), inJurisdiction(cq, cb, visitJoins))); cq.multiselect(objectExpression); cq.where(cb.equal(root.get(Visit.UUID), visit.getUuid())); return em.createQuery(cq).getResultList().stream().findFirst().orElse(null); @@ -115,7 +111,7 @@ private List getAllActiveInContactsUuids() { visitsQuery.where( CriteriaBuilderHelper.and( cb, - contactService.createUserFilter(cb, visitsQuery, contactRoot), + contactService.createUserFilter(new ContactQueryContext(cb, visitsQuery, new ContactJoins(contactRoot))), contactService.createActiveContactsFilter(cb, contactRoot), cb.isNotEmpty(contactRoot.get(Contact.VISITS)))); visitsQuery.select(visitJoin.get(Visit.UUID)); @@ -134,7 +130,7 @@ private List getAllActiveInCasesUuids() { visitsQuery.where( CriteriaBuilderHelper.and( cb, - caseService.createUserFilter(cb, visitsQuery, caseRoot), + caseService.createUserFilter(new CaseQueryContext(cb, visitsQuery, new CaseJoins(caseRoot))), caseService.createActiveCasesFilter(cb, caseRoot), cb.isNotEmpty(caseRoot.get(Case.VISITS)))); visitsQuery.select(visitJoin.get(Visit.UUID)); @@ -165,11 +161,14 @@ private List getAllActiveVisitsInContactsAfter(Date date, Integer batchSi Fetch personFetch = visitJoin.fetch(Visit.PERSON); personFetch.fetch(Person.ADDRESS); - Predicate filter = CriteriaBuilderHelper - .and(cb, contactService.createUserFilter(cb, visitsQuery, contactRoot), contactService.createActiveContactsFilter(cb, contactRoot)); + Predicate filter = CriteriaBuilderHelper.and( + cb, + contactService.createUserFilter(new ContactQueryContext(cb, visitsQuery, new ContactJoins(contactRoot))), + contactService.createActiveContactsFilter(cb, contactRoot)); if (date != null) { - filter = CriteriaBuilderHelper.and(cb, filter, createChangeDateFilter(cb, visitJoin, DateHelper.toTimestampUpper(date), lastSynchronizedUuid)); + filter = + CriteriaBuilderHelper.and(cb, filter, createChangeDateFilter(cb, visitJoin, DateHelper.toTimestampUpper(date), lastSynchronizedUuid)); } visitsQuery.select(visitJoin); @@ -189,8 +188,10 @@ private List getAllActiveVisitsInCasesAfter(Date date) { Fetch personFetch = visitJoin.fetch(Visit.PERSON); personFetch.fetch(Person.ADDRESS); - Predicate filter = - CriteriaBuilderHelper.and(cb, caseService.createUserFilter(cb, visitsQuery, caseRoot), caseService.createActiveCasesFilter(cb, caseRoot)); + Predicate filter = CriteriaBuilderHelper.and( + cb, + caseService.createUserFilter(new CaseQueryContext(cb, visitsQuery, new CaseJoins(caseRoot))), + caseService.createActiveCasesFilter(cb, caseRoot)); if (date != null) { filter = CriteriaBuilderHelper.and(cb, filter, createChangeDateFilter(cb, visitJoin, DateHelper.toTimestampUpper(date))); @@ -290,8 +291,9 @@ private Predicate createChangeDateFilter(CriteriaBuilder cb, From visi Join symptoms = visitPath.join(Visit.SYMPTOMS, JoinType.LEFT); - ChangeDateFilterBuilder changeDateFilterBuilder = - lastSynchronizedUuid == null ? new ChangeDateFilterBuilder(cb, date) : new ChangeDateFilterBuilder(cb, date, visitPath, lastSynchronizedUuid); + ChangeDateFilterBuilder changeDateFilterBuilder = lastSynchronizedUuid == null + ? new ChangeDateFilterBuilder(cb, date) + : new ChangeDateFilterBuilder(cb, date, visitPath, lastSynchronizedUuid); return changeDateFilterBuilder.add(visitPath).add(symptoms).build(); } } diff --git a/sormas-backend/src/main/java/de/symeda/sormas/backend/visualization/VisualizationFacadeEjb.java b/sormas-backend/src/main/java/de/symeda/sormas/backend/visualization/VisualizationFacadeEjb.java index 19c69b4bfb0..56d43214704 100644 --- a/sormas-backend/src/main/java/de/symeda/sormas/backend/visualization/VisualizationFacadeEjb.java +++ b/sormas-backend/src/main/java/de/symeda/sormas/backend/visualization/VisualizationFacadeEjb.java @@ -72,6 +72,8 @@ import de.symeda.sormas.backend.common.ConfigFacadeEjb.ConfigFacadeEjbLocal; import de.symeda.sormas.backend.common.CriteriaBuilderHelper; import de.symeda.sormas.backend.contact.Contact; +import de.symeda.sormas.backend.contact.ContactJoins; +import de.symeda.sormas.backend.contact.ContactQueryContext; import de.symeda.sormas.backend.contact.ContactService; import de.symeda.sormas.backend.infrastructure.district.District; import de.symeda.sormas.backend.infrastructure.region.Region; @@ -170,7 +172,7 @@ private Predicate buildContactFilters( return CriteriaBuilderHelper.and( cb, - contactService.createUserFilter(cb, cq, root), + contactService.createUserFilter(new ContactQueryContext(cb, cq, new ContactJoins(root))), contactService.createActiveContactsFilter(cb, root), contactService.createDefaultFilter(cb, root), cb.notEqual(root.get(Contact.CONTACT_CLASSIFICATION), ContactClassification.NO_CONTACT), From dd82962f44d21730812b510faa31418c8ca97658 Mon Sep 17 00:00:00 2001 From: Stefan Kock Date: Fri, 22 Apr 2022 15:37:33 +0200 Subject: [PATCH 023/167] #8747 Reduced QueryContext constructor with From, more shared joins --- .../backend/bagexport/BAGExportFacadeEjb.java | 6 +-- .../event/EventParticipantFacadeEjb.java | 2 +- .../event/EventParticipantQueryContext.java | 2 +- .../sormas/backend/event/EventService.java | 3 +- .../DirectoryImmunizationQueryContext.java | 2 +- .../DirectoryImmunizationService.java | 13 +++---- .../ImmunizationQueryContext.java | 2 +- .../backend/person/PersonQueryContext.java | 2 +- .../backend/sample/SampleQueryContext.java | 39 +++++++++---------- .../sormas/backend/task/TaskQueryContext.java | 2 +- 10 files changed, 36 insertions(+), 37 deletions(-) diff --git a/sormas-backend/src/main/java/de/symeda/sormas/backend/bagexport/BAGExportFacadeEjb.java b/sormas-backend/src/main/java/de/symeda/sormas/backend/bagexport/BAGExportFacadeEjb.java index 219a5dcc429..309ccbca8f2 100644 --- a/sormas-backend/src/main/java/de/symeda/sormas/backend/bagexport/BAGExportFacadeEjb.java +++ b/sormas-backend/src/main/java/de/symeda/sormas/backend/bagexport/BAGExportFacadeEjb.java @@ -15,7 +15,6 @@ package de.symeda.sormas.backend.bagexport; -import de.symeda.sormas.api.user.UserRight; import java.util.ArrayList; import java.util.Collection; import java.util.Collections; @@ -47,6 +46,7 @@ import de.symeda.sormas.api.bagexport.BAGExportFacade; import de.symeda.sormas.api.person.PersonAddressType; import de.symeda.sormas.api.sample.PathogenTestResultType; +import de.symeda.sormas.api.user.UserRight; import de.symeda.sormas.api.utils.YesNoUnknown; import de.symeda.sormas.backend.caze.Case; import de.symeda.sormas.backend.caze.CaseJoins; @@ -80,7 +80,7 @@ public List getCaseExportList(Collection selectedRows, CaseJoins caseJoins = new CaseJoins(caseRoot); Join person = caseJoins.getPerson(); - PersonQueryContext personQueryContext = new PersonQueryContext(cb, cq, person); + PersonQueryContext personQueryContext = new PersonQueryContext(cb, cq, caseJoins.getPersonJoins()); Join homeAddress = caseJoins.getPersonAddress(); @@ -244,7 +244,7 @@ public List getContactExportList(Collection selecte Join homeAddress = contactJoins.getAddress(); Join caze = contactJoins.getCaze(); - PersonQueryContext personQueryContext = new PersonQueryContext(cb, cq, person); + PersonQueryContext personQueryContext = new PersonQueryContext(cb, cq, contactJoins.getPersonJoins()); Expression mobileNumber = cb.literal(TODO_VALUE); Expression caseLinkContactDate = cb.nullLiteral(Date.class); diff --git a/sormas-backend/src/main/java/de/symeda/sormas/backend/event/EventParticipantFacadeEjb.java b/sormas-backend/src/main/java/de/symeda/sormas/backend/event/EventParticipantFacadeEjb.java index d5317d52878..f32962827cf 100644 --- a/sormas-backend/src/main/java/de/symeda/sormas/backend/event/EventParticipantFacadeEjb.java +++ b/sormas-backend/src/main/java/de/symeda/sormas/backend/event/EventParticipantFacadeEjb.java @@ -637,7 +637,7 @@ public List getExportList( Join person = joins.getPerson(); - PersonQueryContext personQueryContext = new PersonQueryContext(cb, cq, person); + PersonQueryContext personQueryContext = new PersonQueryContext(cb, cq, joins.getPersonJoins()); Join address = joins.getAddress(); Join birthCountry = person.join(Person.BIRTH_COUNTRY, JoinType.LEFT); diff --git a/sormas-backend/src/main/java/de/symeda/sormas/backend/event/EventParticipantQueryContext.java b/sormas-backend/src/main/java/de/symeda/sormas/backend/event/EventParticipantQueryContext.java index 4982504a513..e05f38f5e76 100644 --- a/sormas-backend/src/main/java/de/symeda/sormas/backend/event/EventParticipantQueryContext.java +++ b/sormas-backend/src/main/java/de/symeda/sormas/backend/event/EventParticipantQueryContext.java @@ -9,7 +9,7 @@ public class EventParticipantQueryContext extends QueryContext { - public EventParticipantQueryContext(CriteriaBuilder cb, CriteriaQuery query, From root) { + protected EventParticipantQueryContext(CriteriaBuilder cb, CriteriaQuery query, From root) { this(cb, query, new EventParticipantJoins(root)); } diff --git a/sormas-backend/src/main/java/de/symeda/sormas/backend/event/EventService.java b/sormas-backend/src/main/java/de/symeda/sormas/backend/event/EventService.java index d06431e979a..453c1b8d04e 100644 --- a/sormas-backend/src/main/java/de/symeda/sormas/backend/event/EventService.java +++ b/sormas-backend/src/main/java/de/symeda/sormas/backend/event/EventService.java @@ -630,7 +630,8 @@ public Predicate buildCriteriaFilter(EventCriteria eventCriteria, EventQueryCont From eventParticipantJoin = joins.getEventParticipants(); Join personJoin = joins.getEventParticipantPersons(); - final PersonQueryContext personQueryContext = new PersonQueryContext(cb, eventQueryContext.getQuery(), personJoin); + final PersonQueryContext personQueryContext = + new PersonQueryContext(cb, eventQueryContext.getQuery(), joins.getEventParticipantJoins().getPersonJoins()); String[] textFilters = eventCriteria.getFreeTextEventParticipants().split("\\s+"); diff --git a/sormas-backend/src/main/java/de/symeda/sormas/backend/immunization/DirectoryImmunizationQueryContext.java b/sormas-backend/src/main/java/de/symeda/sormas/backend/immunization/DirectoryImmunizationQueryContext.java index 227d38ead4b..6675321fffc 100644 --- a/sormas-backend/src/main/java/de/symeda/sormas/backend/immunization/DirectoryImmunizationQueryContext.java +++ b/sormas-backend/src/main/java/de/symeda/sormas/backend/immunization/DirectoryImmunizationQueryContext.java @@ -10,7 +10,7 @@ public class DirectoryImmunizationQueryContext extends QueryContext { - public DirectoryImmunizationQueryContext(CriteriaBuilder cb, CriteriaQuery query, From root) { + protected DirectoryImmunizationQueryContext(CriteriaBuilder cb, CriteriaQuery query, From root) { super(cb, query, root, new DirectoryImmunizationJoins(root)); } diff --git a/sormas-backend/src/main/java/de/symeda/sormas/backend/immunization/DirectoryImmunizationService.java b/sormas-backend/src/main/java/de/symeda/sormas/backend/immunization/DirectoryImmunizationService.java index ae41b3eed04..5a1bda2987b 100644 --- a/sormas-backend/src/main/java/de/symeda/sormas/backend/immunization/DirectoryImmunizationService.java +++ b/sormas-backend/src/main/java/de/symeda/sormas/backend/immunization/DirectoryImmunizationService.java @@ -20,7 +20,6 @@ import javax.persistence.criteria.Predicate; import javax.persistence.criteria.Root; -import de.symeda.sormas.backend.user.UserService; import org.apache.commons.collections4.CollectionUtils; import de.symeda.sormas.api.feature.FeatureType; @@ -47,6 +46,7 @@ import de.symeda.sormas.backend.person.PersonJurisdictionPredicateValidator; import de.symeda.sormas.backend.person.PersonQueryContext; import de.symeda.sormas.backend.user.User; +import de.symeda.sormas.backend.user.UserService; import de.symeda.sormas.backend.util.JurisdictionHelper; import de.symeda.sormas.backend.vaccination.FirstVaccinationDate; import de.symeda.sormas.backend.vaccination.LastVaccinationDate; @@ -210,7 +210,7 @@ private Predicate buildCriteriaFilter(ImmunizationCriteria criteria, DirectoryIm if (!DataHelper.isNullOrEmpty(criteria.getNameAddressPhoneEmailLike())) { final CriteriaQuery cq = cb.createQuery(PersonIndexDto.class); - final PersonQueryContext personQueryContext = new PersonQueryContext(cb, cq, person); + final PersonQueryContext personQueryContext = new PersonQueryContext(cb, cq, joins.getPersonJoins()); String[] textFilters = criteria.getNameAddressPhoneEmailLike().split("\\s+"); @@ -335,11 +335,10 @@ private Predicate isInJurisdictionOrOwned(DirectoryImmunizationQueryContext qc) filter = DirectoryImmunizationJurisdictionPredicateValidator.of(qc, currentUser).inJurisdictionOrOwned(); } else { filter = CriteriaBuilderHelper.or( - cb, - cb.equal(qc.getRoot().get(Immunization.REPORTING_USER), currentUser), - PersonJurisdictionPredicateValidator - .of(qc.getQuery(), cb, new PersonJoins(qc.getJoins().getPerson()), currentUser, false) - .inJurisdictionOrOwned()); + cb, + cb.equal(qc.getRoot().get(Immunization.REPORTING_USER), currentUser), + PersonJurisdictionPredicateValidator.of(qc.getQuery(), cb, new PersonJoins(qc.getJoins().getPerson()), currentUser, false) + .inJurisdictionOrOwned()); } return filter; } diff --git a/sormas-backend/src/main/java/de/symeda/sormas/backend/immunization/ImmunizationQueryContext.java b/sormas-backend/src/main/java/de/symeda/sormas/backend/immunization/ImmunizationQueryContext.java index 6c525137cf5..b1a9010ddb2 100644 --- a/sormas-backend/src/main/java/de/symeda/sormas/backend/immunization/ImmunizationQueryContext.java +++ b/sormas-backend/src/main/java/de/symeda/sormas/backend/immunization/ImmunizationQueryContext.java @@ -25,7 +25,7 @@ public class ImmunizationQueryContext extends QueryContext { - public ImmunizationQueryContext(CriteriaBuilder cb, CriteriaQuery query, From root) { + protected ImmunizationQueryContext(CriteriaBuilder cb, CriteriaQuery query, From root) { this(cb, query, new ImmunizationJoins(root)); } diff --git a/sormas-backend/src/main/java/de/symeda/sormas/backend/person/PersonQueryContext.java b/sormas-backend/src/main/java/de/symeda/sormas/backend/person/PersonQueryContext.java index 6ef1715a930..35b6395c7c2 100644 --- a/sormas-backend/src/main/java/de/symeda/sormas/backend/person/PersonQueryContext.java +++ b/sormas-backend/src/main/java/de/symeda/sormas/backend/person/PersonQueryContext.java @@ -15,7 +15,7 @@ public class PersonQueryContext extends QueryContext { public static final String PERSON_PHONE_OWNER_SUBQUERY = "personPhoneOwnerSubquery"; public static final String PERSON_OTHER_CONTACT_DETAILS_SUBQUERY = "personOtherContactDetailsSubQuery"; - public PersonQueryContext(CriteriaBuilder cb, CriteriaQuery query, From root) { + protected PersonQueryContext(CriteriaBuilder cb, CriteriaQuery query, From root) { this(cb, query, new PersonJoins(root)); } diff --git a/sormas-backend/src/main/java/de/symeda/sormas/backend/sample/SampleQueryContext.java b/sormas-backend/src/main/java/de/symeda/sormas/backend/sample/SampleQueryContext.java index 4f6f5b5e96d..81776eab2d8 100644 --- a/sormas-backend/src/main/java/de/symeda/sormas/backend/sample/SampleQueryContext.java +++ b/sormas-backend/src/main/java/de/symeda/sormas/backend/sample/SampleQueryContext.java @@ -1,17 +1,16 @@ /* - * SORMAS® - Surveillance Outbreak Response Management & Analysis System - * Copyright © 2016-2021 Helmholtz-Zentrum für Infektionsforschung GmbH (HZI) - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * + * SORMAS® - Surveillance Outbreak Response Management & Analysis System + * Copyright © 2016-2021 Helmholtz-Zentrum für Infektionsforschung GmbH (HZI) + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . */ package de.symeda.sormas.backend.sample; @@ -25,12 +24,12 @@ public class SampleQueryContext extends QueryContext { - public SampleQueryContext(CriteriaBuilder cb, CriteriaQuery query, From root) { - super(cb, query, root, new SampleJoins(root)); - } + protected SampleQueryContext(CriteriaBuilder cb, CriteriaQuery query, From root) { + super(cb, query, root, new SampleJoins(root)); + } - @Override - protected Expression createExpression(String name) { - return null; - } + @Override + protected Expression createExpression(String name) { + return null; + } } diff --git a/sormas-backend/src/main/java/de/symeda/sormas/backend/task/TaskQueryContext.java b/sormas-backend/src/main/java/de/symeda/sormas/backend/task/TaskQueryContext.java index 74a91ea0bdf..abd7f7ef9a8 100644 --- a/sormas-backend/src/main/java/de/symeda/sormas/backend/task/TaskQueryContext.java +++ b/sormas-backend/src/main/java/de/symeda/sormas/backend/task/TaskQueryContext.java @@ -24,7 +24,7 @@ public class TaskQueryContext extends QueryContext { - public TaskQueryContext(CriteriaBuilder cb, CriteriaQuery query, From root) { + protected TaskQueryContext(CriteriaBuilder cb, CriteriaQuery query, From root) { super(cb, query, root, new TaskJoins(root)); } From 09949ec37d044fcf572c8e04fbbc30b64dc87553 Mon Sep 17 00:00:00 2001 From: dinua Date: Wed, 27 Apr 2022 17:51:38 +0300 Subject: [PATCH 024/167] #8899 fix bug --- .../java/de/symeda/sormas/backend/event/EventFacadeEjb.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sormas-backend/src/main/java/de/symeda/sormas/backend/event/EventFacadeEjb.java b/sormas-backend/src/main/java/de/symeda/sormas/backend/event/EventFacadeEjb.java index e63d69cdda5..6d71d814ff2 100644 --- a/sormas-backend/src/main/java/de/symeda/sormas/backend/event/EventFacadeEjb.java +++ b/sormas-backend/src/main/java/de/symeda/sormas/backend/event/EventFacadeEjb.java @@ -335,7 +335,9 @@ public long count(EventCriteria eventCriteria) { if (eventCriteria != null) { if (eventCriteria.getUserFilterIncluded()) { - filter = service.createUserFilter(cb, cq, event); + EventUserFilterCriteria eventUserFilterCriteria = new EventUserFilterCriteria(); + eventUserFilterCriteria.includeUserCaseAndEventParticipantFilter(true); + filter = service.createUserFilter(cb, cq, event, eventUserFilterCriteria); } Predicate criteriaFilter = service.buildCriteriaFilter(eventCriteria, new EventQueryContext(cb, cq, event)); From 398c4bc6f409b145fbce17aaa3b822c7984620a3 Mon Sep 17 00:00:00 2001 From: dinua Date: Fri, 29 Apr 2022 13:46:54 +0300 Subject: [PATCH 025/167] #8978 add modal view --- .../de/symeda/sormas/api/i18n/Captions.java | 3 ++ .../de/symeda/sormas/api/i18n/Strings.java | 1 + .../sormas/api/therapy/TreatmentFacade.java | 2 + .../src/main/resources/captions.properties | 3 ++ .../src/main/resources/strings.properties | 1 + .../backend/therapy/TreatmentFacadeEjb.java | 39 +++++++++++++++++ .../backend/therapy/TreatmentJoins.java | 9 ++++ .../sormas/ui/therapy/TherapyController.java | 42 +++++++++++++++++-- 8 files changed, 96 insertions(+), 4 deletions(-) diff --git a/sormas-api/src/main/java/de/symeda/sormas/api/i18n/Captions.java b/sormas-api/src/main/java/de/symeda/sormas/api/i18n/Captions.java index 3e5868665d1..ae3d468a392 100644 --- a/sormas-api/src/main/java/de/symeda/sormas/api/i18n/Captions.java +++ b/sormas-api/src/main/java/de/symeda/sormas/api/i18n/Captions.java @@ -1753,6 +1753,9 @@ public interface Captions { String PrescriptionExport_caseName = "PrescriptionExport.caseName"; String PrescriptionExport_caseUuid = "PrescriptionExport.caseUuid"; String prescriptionNewPrescription = "prescriptionNewPrescription"; + String titleDeletePrescriptionWithTreatment = "titleDeletePrescriptionWithTreatment"; + String prescriptionAlone = "prescriptionAlone"; + String prescriptionWithTreatment = "prescriptionWithTreatment"; String Region = "Region"; String Region_archived = "Region.archived"; String Region_country = "Region.country"; diff --git a/sormas-api/src/main/java/de/symeda/sormas/api/i18n/Strings.java b/sormas-api/src/main/java/de/symeda/sormas/api/i18n/Strings.java index e3fdbe40c52..de664b51544 100644 --- a/sormas-api/src/main/java/de/symeda/sormas/api/i18n/Strings.java +++ b/sormas-api/src/main/java/de/symeda/sormas/api/i18n/Strings.java @@ -134,6 +134,7 @@ public interface Strings { String confirmationDeleteTasks = "confirmationDeleteTasks"; String confirmationDeleteTravelEntries = "confirmationDeleteTravelEntries"; String confirmationDeleteTreatments = "confirmationDeleteTreatments"; + String confirmationDeletePrescriptionWithTreatment = "confirmationDeletePrescriptionWithTreatment"; String confirmationDeleteVisits = "confirmationDeleteVisits"; String confirmationDisableAllLineListingNational = "confirmationDisableAllLineListingNational"; String confirmationDisableAllLineListingRegion = "confirmationDisableAllLineListingRegion"; diff --git a/sormas-api/src/main/java/de/symeda/sormas/api/therapy/TreatmentFacade.java b/sormas-api/src/main/java/de/symeda/sormas/api/therapy/TreatmentFacade.java index 65170c4b6e2..f57bed5fd8e 100644 --- a/sormas-api/src/main/java/de/symeda/sormas/api/therapy/TreatmentFacade.java +++ b/sormas-api/src/main/java/de/symeda/sormas/api/therapy/TreatmentFacade.java @@ -14,6 +14,8 @@ public interface TreatmentFacade { List getIndexList(TreatmentCriteria criteria); + List getTreatmentForPrescription(String prescriptionUuid); + TreatmentDto getTreatmentByUuid(String uuid); TreatmentDto saveTreatment(@Valid TreatmentDto treatment); diff --git a/sormas-api/src/main/resources/captions.properties b/sormas-api/src/main/resources/captions.properties index f547b5b137e..c2a62f0737f 100644 --- a/sormas-api/src/main/resources/captions.properties +++ b/sormas-api/src/main/resources/captions.properties @@ -1729,6 +1729,9 @@ Prescription.routeDetails=Route specification Prescription.typeOfDrug=Type of drug PrescriptionExport.caseUuid=Case ID PrescriptionExport.caseName=Case name +titleDeletePrescriptionWithTreatment=Delete Prescription With Treatments +prescriptionAlone=Just Prescription +prescriptionWithTreatment=Prescription With Treatments # Continent continentActiveContinents=Active continents continentArchivedContinents=Archived continents diff --git a/sormas-api/src/main/resources/strings.properties b/sormas-api/src/main/resources/strings.properties index 751c2764b84..715ef7870b6 100644 --- a/sormas-api/src/main/resources/strings.properties +++ b/sormas-api/src/main/resources/strings.properties @@ -153,6 +153,7 @@ confirmationDeleteSamples = Are you sure you want to delete all %d selected samp confirmationDeleteTasks = Are you sure you want to delete all %d selected tasks? confirmationDeleteTreatments = Are you sure you want to delete all %d selected treatments? confirmationDeleteVisits = Are you sure you want to delete all %d selected visits? +confirmationDeletePrescriptionWithTreatment = This prescription is assign to treatment. Do you want to delete this prescription alone or also the treatments with ? confirmationLostToFollowUp = Are you sure you want to set the follow-up of all %d selected contacts to lost to follow-up? confirmationPickCaseAndDeleteOther = Are you sure that the case you did not select is a duplicate of this case? The case you did not select and all contacts, samples, tasks and other data linked to it will be deleted. confirmationPickContactAndDeleteOther = Are you sure that the contact you did not select is a duplicate of this contact? The contact you did not select and all samples, tasks and other data linked to it will be deleted. diff --git a/sormas-backend/src/main/java/de/symeda/sormas/backend/therapy/TreatmentFacadeEjb.java b/sormas-backend/src/main/java/de/symeda/sormas/backend/therapy/TreatmentFacadeEjb.java index ebcc2970ef7..85c7a72e468 100644 --- a/sormas-backend/src/main/java/de/symeda/sormas/backend/therapy/TreatmentFacadeEjb.java +++ b/sormas-backend/src/main/java/de/symeda/sormas/backend/therapy/TreatmentFacadeEjb.java @@ -96,6 +96,45 @@ public List getIndexList(TreatmentCriteria criteria) { return indexList; } + @Override + public List getTreatmentForPrescription(String prescriptionUuid) { + CriteriaBuilder cb = em.getCriteriaBuilder(); + CriteriaQuery cq = cb.createQuery(TreatmentIndexDto.class); + Root treatment = cq.from(Treatment.class); + TreatmentJoins joins = new TreatmentJoins(treatment); + + cq.multiselect( + treatment.get(Treatment.UUID), + treatment.get(Treatment.TREATMENT_TYPE), + treatment.get(Treatment.TREATMENT_DETAILS), + treatment.get(Treatment.TYPE_OF_DRUG), + treatment.get(Treatment.TREATMENT_DATE_TIME), + treatment.get(Treatment.DOSE), + treatment.get(Treatment.ROUTE), + treatment.get(Treatment.ROUTE_DETAILS), + treatment.get(Treatment.EXECUTING_CLINICIAN), + JurisdictionHelper.booleanSelector(cb, caseService.inJurisdictionOrOwned(new CaseQueryContext(cb, cq, joins.getCaseJoins())))); + + Predicate filter = null; + filter = cb.equal(joins.getPrescription().get(Prescription.UUID), prescriptionUuid); + + if(filter != null) { + cq.where(filter); + } + + cq.orderBy(cb.desc(treatment.get(Treatment.TREATMENT_DATE_TIME))); + + List treatmentIndexDtos = em.createQuery(cq).getResultList(); + + Pseudonymizer pseudonymizer = Pseudonymizer.getDefault(userService::hasRight, I18nProperties.getCaption(Captions.inaccessibleValue)); + pseudonymizer.pseudonymizeDtoCollection(TreatmentIndexDto.class, treatmentIndexDtos, t -> t.getInJurisdiction(), (t, inJurisdiction) -> { + pseudonymizer.pseudonymizeDto(TreatmentIndexDto.TreatmentIndexType.class, t.getTreatmentIndexType(), inJurisdiction, null); + pseudonymizer.pseudonymizeDto(TreatmentIndexDto.TreatmentIndexRoute.class, t.getTreatmentIndexRoute(), inJurisdiction, null); + }); + + return treatmentIndexDtos; + } + @Override public TreatmentDto getTreatmentByUuid(String uuid) { return convertToDto(service.getByUuid(uuid), Pseudonymizer.getDefault(userService::hasRight)); diff --git a/sormas-backend/src/main/java/de/symeda/sormas/backend/therapy/TreatmentJoins.java b/sormas-backend/src/main/java/de/symeda/sormas/backend/therapy/TreatmentJoins.java index ccd8de30407..c26230b2e00 100644 --- a/sormas-backend/src/main/java/de/symeda/sormas/backend/therapy/TreatmentJoins.java +++ b/sormas-backend/src/main/java/de/symeda/sormas/backend/therapy/TreatmentJoins.java @@ -33,6 +33,7 @@ public class TreatmentJoins extends QueryJoins { private Join therapy; + private Join prescription; private Join caze; private CaseJoins caseJoins; @@ -48,6 +49,14 @@ private void setTherapy(Join therapy) { this.therapy = therapy; } + public Join getPrescription() { + return getOrCreate(prescription, Treatment.PRESCRIPTION, JoinType.LEFT, this::setPrescription); + } + + public void setPrescription(Join prescription) { + this.prescription = prescription; + } + public Join getCaze() { return getOrCreate(caze, Therapy.CASE, JoinType.LEFT, getTherapy(), this::setCaze); } diff --git a/sormas-ui/src/main/java/de/symeda/sormas/ui/therapy/TherapyController.java b/sormas-ui/src/main/java/de/symeda/sormas/ui/therapy/TherapyController.java index d8772dccfd8..0c0dbcb2c68 100644 --- a/sormas-ui/src/main/java/de/symeda/sormas/ui/therapy/TherapyController.java +++ b/sormas-ui/src/main/java/de/symeda/sormas/ui/therapy/TherapyController.java @@ -1,10 +1,13 @@ package de.symeda.sormas.ui.therapy; import java.util.Collection; +import java.util.List; +import java.util.function.Consumer; import com.vaadin.server.Page; import com.vaadin.ui.Alignment; import com.vaadin.ui.Button; +import com.vaadin.ui.Label; import com.vaadin.ui.Notification; import com.vaadin.ui.Notification.Type; import com.vaadin.ui.Window; @@ -88,10 +91,41 @@ public void onCommit() { @Override public void onDelete() { - FacadeProvider.getPrescriptionFacade().deletePrescription(prescription.getUuid()); - popupWindow.close(); - if (callback != null) { - callback.run(); + List treatmentDtos = FacadeProvider.getTreatmentFacade().getTreatmentForPrescription(prescription.getUuid()); + if(treatmentDtos.size() > 0 ){ + Consumer resultConsumer = new Consumer() { + + @Override + public void accept(Boolean option) { + if (option) { + //delete just prescription and leave the treatments standalone + System.out.println(); + } + else { + //delete the prescription and all the treatments assign with + System.out.println(); + } + + popupWindow.close(); + if (callback != null) { + callback.run(); + } + } + }; + VaadinUiUtil.showChooseOptionPopup( + I18nProperties.getCaption(Captions.titleDeletePrescriptionWithTreatment), + new Label(I18nProperties.getString(Strings.confirmationDeletePrescriptionWithTreatment)), + I18nProperties.getCaption(Captions.prescriptionAlone), + I18nProperties.getCaption(Captions.prescriptionWithTreatment), + 500, + resultConsumer); + } + else { + FacadeProvider.getPrescriptionFacade().deletePrescription(prescription.getUuid()); + popupWindow.close(); + if (callback != null) { + callback.run(); + } } } }, I18nProperties.getString(Strings.entityPrescription)); From 39302d2d7a08dff6a3d8f82616d7918a008b1290 Mon Sep 17 00:00:00 2001 From: dinua Date: Fri, 29 Apr 2022 15:06:58 +0300 Subject: [PATCH 026/167] #8978 unlink treatments and delete by ids --- .../sormas/api/therapy/TreatmentFacade.java | 4 + .../backend/therapy/TreatmentFacadeEjb.java | 12 +++ .../backend/therapy/TreatmentService.java | 19 ++++ .../therapy/TreatmentFacadeEjbTest.java | 92 +++++++++++++++++++ .../sormas/ui/therapy/TherapyController.java | 1 + 5 files changed, 128 insertions(+) diff --git a/sormas-api/src/main/java/de/symeda/sormas/api/therapy/TreatmentFacade.java b/sormas-api/src/main/java/de/symeda/sormas/api/therapy/TreatmentFacade.java index f57bed5fd8e..8c412f11f51 100644 --- a/sormas-api/src/main/java/de/symeda/sormas/api/therapy/TreatmentFacade.java +++ b/sormas-api/src/main/java/de/symeda/sormas/api/therapy/TreatmentFacade.java @@ -22,6 +22,10 @@ public interface TreatmentFacade { void deleteTreatment(String treatmentUuid); + void deleteTreatments(List treatmentUuids); + + void unlinkPrescriptionFromTreatments(List treatmentUuids); + List getAllActiveTreatmentsAfter(Date date); List getAllActiveTreatmentsAfter(Date date, Integer batchSize, String lastSynchronizedUuid); diff --git a/sormas-backend/src/main/java/de/symeda/sormas/backend/therapy/TreatmentFacadeEjb.java b/sormas-backend/src/main/java/de/symeda/sormas/backend/therapy/TreatmentFacadeEjb.java index 85c7a72e468..bd52d3e6743 100644 --- a/sormas-backend/src/main/java/de/symeda/sormas/backend/therapy/TreatmentFacadeEjb.java +++ b/sormas-backend/src/main/java/de/symeda/sormas/backend/therapy/TreatmentFacadeEjb.java @@ -153,6 +153,12 @@ public TreatmentDto saveTreatment(@Valid TreatmentDto source) { return toDto(entity); } + @Override + @RolesAllowed({UserRight._TREATMENT_EDIT}) + public void unlinkPrescriptionFromTreatments(List treatmentUuids){ + service.unlinkPrescriptionFromTreatments(treatmentUuids); + } + @Override @RolesAllowed(UserRight._TREATMENT_DELETE) public void deleteTreatment(String treatmentUuid) { @@ -160,6 +166,12 @@ public void deleteTreatment(String treatmentUuid) { service.deletePermanent(treatment); } + @Override + @RolesAllowed(UserRight._TREATMENT_DELETE) + public void deleteTreatments(List treatmentUuids) { + service.deletePermanentByUuids(treatmentUuids); + } + @Override public List getAllActiveTreatmentsAfter(Date date) { return getAllActiveTreatmentsAfter(date, null, null); diff --git a/sormas-backend/src/main/java/de/symeda/sormas/backend/therapy/TreatmentService.java b/sormas-backend/src/main/java/de/symeda/sormas/backend/therapy/TreatmentService.java index c02650c6419..df872c3cf28 100644 --- a/sormas-backend/src/main/java/de/symeda/sormas/backend/therapy/TreatmentService.java +++ b/sormas-backend/src/main/java/de/symeda/sormas/backend/therapy/TreatmentService.java @@ -8,6 +8,7 @@ import javax.ejb.Stateless; import javax.persistence.criteria.CriteriaBuilder; import javax.persistence.criteria.CriteriaQuery; +import javax.persistence.criteria.CriteriaUpdate; import javax.persistence.criteria.Expression; import javax.persistence.criteria.From; import javax.persistence.criteria.Join; @@ -153,4 +154,22 @@ public Predicate createUserFilter(CriteriaBuilder cb, CriteriaQuery cq, From therapy = from.join(Treatment.THERAPY, JoinType.LEFT); return caseService.createUserFilter(cb, cq, therapy.join(Therapy.CASE, JoinType.LEFT)); } + + public void unlinkPrescriptionFromTreatments(List treatmentUuids){ + CriteriaBuilder cb = em.getCriteriaBuilder(); + CriteriaUpdate criteriaUpdate = cb.createCriteriaUpdate(getElementClass()); + Root from = criteriaUpdate.from(getElementClass()); +// Join prescriptionJoin = from.join(Treatment.THERAPY, JoinType.LEFT); + + criteriaUpdate.set(Treatment.PRESCRIPTION, null); + +// Predicate filter = cb.and(from.get(Treatment.UUID).in(treatmentUuids), +// cb.equal(prescriptionJoin.get(Prescription.UUID), prescriptionUuid)); + +// if(filter != null){ + criteriaUpdate.where(from.get(Treatment.UUID).in(treatmentUuids)); +// } + + this.em.createQuery(criteriaUpdate).executeUpdate(); + } } diff --git a/sormas-backend/src/test/java/de/symeda/sormas/backend/therapy/TreatmentFacadeEjbTest.java b/sormas-backend/src/test/java/de/symeda/sormas/backend/therapy/TreatmentFacadeEjbTest.java index f2116856b62..99e73f18eb4 100644 --- a/sormas-backend/src/test/java/de/symeda/sormas/backend/therapy/TreatmentFacadeEjbTest.java +++ b/sormas-backend/src/test/java/de/symeda/sormas/backend/therapy/TreatmentFacadeEjbTest.java @@ -1,11 +1,17 @@ package de.symeda.sormas.backend.therapy; import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertNotNull; import static org.junit.Assert.assertNull; +import static org.junit.Assert.assertTrue; +import java.util.ArrayList; import java.util.List; +import java.util.stream.Collectors; +import de.symeda.sormas.api.therapy.PrescriptionDto; +import de.symeda.sormas.api.therapy.TreatmentRoute; import org.junit.Test; import de.symeda.sormas.api.caze.CaseDataDto; @@ -51,4 +57,90 @@ public void testTreatmentIndexListGeneration() { assertEquals(1, results.size()); } + + @Test + public void testTreatmentForPrescription() { + + RDCFEntities rdcf = creator.createRDCFEntities(); + UserDto user = creator.createUser(rdcf, UserRole.SURVEILLANCE_SUPERVISOR, UserRole.CASE_SUPERVISOR); + PersonDto casePerson = creator.createPerson("Case", "Person"); + CaseDataDto caze = creator.createCase(user.toReference(), casePerson.toReference(), rdcf); + PrescriptionDto prescription = creator.createPrescription(caze); + + TreatmentDto standaloneTreatment = creator.createTreatment(caze); + TreatmentDto prescriptionTreatment1 = creator.createTreatment(caze, t -> { + t.setPrescription(prescription.toReference()); + }); + TreatmentDto prescriptionTreatment2 = creator.createTreatment(caze, t -> { + t.setPrescription(prescription.toReference()); + }); + + List results = getTreatmentFacade().getTreatmentForPrescription(prescription.getUuid()); + assertEquals(2, results.size()); + List treatmentUuids = results.stream().map(t->t.getUuid()).collect(Collectors.toList()); + assertTrue(treatmentUuids.contains(prescriptionTreatment1.getUuid())); + assertTrue(treatmentUuids.contains(prescriptionTreatment2.getUuid())); + assertFalse(treatmentUuids.contains(standaloneTreatment.getUuid())); + + } + + @Test + public void testDeleteTreatmentsByUuids() { + RDCFEntities rdcf = creator.createRDCFEntities(); + UserDto user = creator.createUser(rdcf, UserRole.SURVEILLANCE_SUPERVISOR, UserRole.CASE_SUPERVISOR); + PersonDto casePerson = creator.createPerson("Case", "Person"); + CaseDataDto caze = creator.createCase(user.toReference(), casePerson.toReference(), rdcf); + + TreatmentDto treatment1 = creator.createTreatment(caze); + TreatmentDto treatment2 = creator.createTreatment(caze); + TreatmentDto treatment3 = creator.createTreatment(caze); + + List results = getTreatmentFacade().getIndexList(null); + assertEquals(3, results.size()); + + List uuidToDelete = new ArrayList<>(); + uuidToDelete.add(treatment2.getUuid()); + uuidToDelete.add(treatment3.getUuid()); + + getTreatmentFacade().deleteTreatments(uuidToDelete); + + results = getTreatmentFacade().getIndexList(null); + assertEquals(1, results.size()); + assertEquals(treatment1.getUuid(), results.get(0).getUuid()); + } + + @Test + public void testUnbindTreatmentsFromPrescription() { + + RDCFEntities rdcf = creator.createRDCFEntities(); + UserDto user = creator.createUser(rdcf, UserRole.SURVEILLANCE_SUPERVISOR, UserRole.CASE_SUPERVISOR); + PersonDto casePerson = creator.createPerson("Case", "Person"); + CaseDataDto caze = creator.createCase(user.toReference(), casePerson.toReference(), rdcf); + PrescriptionDto prescription = creator.createPrescription(caze); + + TreatmentDto prescriptionTreatment1 = creator.createTreatment(caze, t -> { + t.setPrescription(prescription.toReference()); + }); + TreatmentDto prescriptionTreatment2 = creator.createTreatment(caze, t -> { + t.setPrescription(prescription.toReference()); + }); + + List treatmentUuids = new ArrayList<>(); + treatmentUuids.add(prescriptionTreatment1.getUuid()); + treatmentUuids.add(prescriptionTreatment2.getUuid()); + + List treatmentDtos = getTreatmentFacade().getByUuids(treatmentUuids); + for(TreatmentDto treatmentDto:treatmentDtos){ + assertNotNull(treatmentDto.getPrescription()); + assertEquals(prescription.getUuid(), treatmentDto.getPrescription().getUuid()); + } + + getTreatmentFacade().unlinkPrescriptionFromTreatments(treatmentUuids); + + treatmentDtos = getTreatmentFacade().getByUuids(treatmentUuids); + for(TreatmentDto treatmentDto:treatmentDtos){ + assertNull(treatmentDto.getPrescription()); + } + } + } diff --git a/sormas-ui/src/main/java/de/symeda/sormas/ui/therapy/TherapyController.java b/sormas-ui/src/main/java/de/symeda/sormas/ui/therapy/TherapyController.java index 0c0dbcb2c68..de6697a6f45 100644 --- a/sormas-ui/src/main/java/de/symeda/sormas/ui/therapy/TherapyController.java +++ b/sormas-ui/src/main/java/de/symeda/sormas/ui/therapy/TherapyController.java @@ -100,6 +100,7 @@ public void accept(Boolean option) { if (option) { //delete just prescription and leave the treatments standalone System.out.println(); + } else { //delete the prescription and all the treatments assign with From 923f1e83c1b3b892940eb67cb352d58cbb9967f0 Mon Sep 17 00:00:00 2001 From: dinua Date: Fri, 29 Apr 2022 15:57:00 +0300 Subject: [PATCH 027/167] #8978 handel treatments with prescription --- .../sormas/ui/therapy/TherapyController.java | 66 ++++++++++--------- 1 file changed, 35 insertions(+), 31 deletions(-) diff --git a/sormas-ui/src/main/java/de/symeda/sormas/ui/therapy/TherapyController.java b/sormas-ui/src/main/java/de/symeda/sormas/ui/therapy/TherapyController.java index de6697a6f45..94e66ff86d7 100644 --- a/sormas-ui/src/main/java/de/symeda/sormas/ui/therapy/TherapyController.java +++ b/sormas-ui/src/main/java/de/symeda/sormas/ui/therapy/TherapyController.java @@ -3,6 +3,7 @@ import java.util.Collection; import java.util.List; import java.util.function.Consumer; +import java.util.stream.Collectors; import com.vaadin.server.Page; import com.vaadin.ui.Alignment; @@ -23,6 +24,7 @@ import de.symeda.sormas.api.therapy.TreatmentDto; import de.symeda.sormas.api.therapy.TreatmentIndexDto; import de.symeda.sormas.api.user.UserRight; +import de.symeda.sormas.ui.SormasUI; import de.symeda.sormas.ui.UserProvider; import de.symeda.sormas.ui.utils.ButtonHelper; import de.symeda.sormas.ui.utils.CommitDiscardWrapperComponent; @@ -93,46 +95,48 @@ public void onCommit() { public void onDelete() { List treatmentDtos = FacadeProvider.getTreatmentFacade().getTreatmentForPrescription(prescription.getUuid()); if(treatmentDtos.size() > 0 ){ - Consumer resultConsumer = new Consumer() { - - @Override - public void accept(Boolean option) { - if (option) { - //delete just prescription and leave the treatments standalone - System.out.println(); - - } - else { - //delete the prescription and all the treatments assign with - System.out.println(); - } - - popupWindow.close(); - if (callback != null) { - callback.run(); - } - } - }; - VaadinUiUtil.showChooseOptionPopup( - I18nProperties.getCaption(Captions.titleDeletePrescriptionWithTreatment), - new Label(I18nProperties.getString(Strings.confirmationDeletePrescriptionWithTreatment)), - I18nProperties.getCaption(Captions.prescriptionAlone), - I18nProperties.getCaption(Captions.prescriptionWithTreatment), - 500, - resultConsumer); + handleDeletePrescriptionWithTreatments(treatmentDtos, prescription.getUuid()); } else { FacadeProvider.getPrescriptionFacade().deletePrescription(prescription.getUuid()); - popupWindow.close(); - if (callback != null) { - callback.run(); - } + } + popupWindow.close(); + if (callback != null) { + callback.run(); } } }, I18nProperties.getString(Strings.entityPrescription)); } } + private void handleDeletePrescriptionWithTreatments(List treatmentIndexDtos , String prescriptionUuid){ + Consumer resultConsumer = new Consumer() { + + @Override + public void accept(Boolean option) { + List treatmentUuids = treatmentIndexDtos.stream().map(t->t.getUuid()).collect(Collectors.toList()); + if (option) { + //delete just prescription and leave the treatments standalone + FacadeProvider.getTreatmentFacade().unlinkPrescriptionFromTreatments(treatmentUuids); + + } + else { + //delete the prescription and all the treatments assign with + FacadeProvider.getTreatmentFacade().deleteTreatments(treatmentUuids); + } + FacadeProvider.getPrescriptionFacade().deletePrescription(prescriptionUuid); + SormasUI.refreshView(); + } + }; + VaadinUiUtil.showChooseOptionPopup( + I18nProperties.getCaption(Captions.titleDeletePrescriptionWithTreatment), + new Label(I18nProperties.getString(Strings.confirmationDeletePrescriptionWithTreatment)), + I18nProperties.getCaption(Captions.prescriptionAlone), + I18nProperties.getCaption(Captions.prescriptionWithTreatment), + 500, + resultConsumer); + } + public void openPrescriptionEditForm(PrescriptionIndexDto prescriptionIndex, Runnable callback, boolean readOnly) { openPrescriptionEditForm(new PrescriptionReferenceDto(prescriptionIndex.getUuid()), callback, readOnly); } From beb8c6ac2e6db11f4e3ef4f6eccd4fa899a79f68 Mon Sep 17 00:00:00 2001 From: dinua Date: Mon, 2 May 2022 12:19:29 +0300 Subject: [PATCH 028/167] #8978 fix tests --- .../src/main/java/de/symeda/sormas/api/i18n/Captions.java | 4 ++-- .../src/main/java/de/symeda/sormas/api/i18n/Strings.java | 2 +- sormas-api/src/main/resources/captions.properties | 2 +- .../symeda/sormas/backend/therapy/TreatmentService.java | 8 +------- .../de/symeda/sormas/ui/therapy/TherapyController.java | 2 +- 5 files changed, 6 insertions(+), 12 deletions(-) diff --git a/sormas-api/src/main/java/de/symeda/sormas/api/i18n/Captions.java b/sormas-api/src/main/java/de/symeda/sormas/api/i18n/Captions.java index ae3d468a392..f34a523fb01 100644 --- a/sormas-api/src/main/java/de/symeda/sormas/api/i18n/Captions.java +++ b/sormas-api/src/main/java/de/symeda/sormas/api/i18n/Captions.java @@ -1750,12 +1750,12 @@ public interface Captions { String Prescription_route = "Prescription.route"; String Prescription_routeDetails = "Prescription.routeDetails"; String Prescription_typeOfDrug = "Prescription.typeOfDrug"; + String prescriptionAlone = "prescriptionAlone"; String PrescriptionExport_caseName = "PrescriptionExport.caseName"; String PrescriptionExport_caseUuid = "PrescriptionExport.caseUuid"; String prescriptionNewPrescription = "prescriptionNewPrescription"; - String titleDeletePrescriptionWithTreatment = "titleDeletePrescriptionWithTreatment"; - String prescriptionAlone = "prescriptionAlone"; String prescriptionWithTreatment = "prescriptionWithTreatment"; + String prescriptionWithTreatmentTitleDelete = "prescriptionWithTreatmentTitleDelete"; String Region = "Region"; String Region_archived = "Region.archived"; String Region_country = "Region.country"; diff --git a/sormas-api/src/main/java/de/symeda/sormas/api/i18n/Strings.java b/sormas-api/src/main/java/de/symeda/sormas/api/i18n/Strings.java index de664b51544..e90233d6799 100644 --- a/sormas-api/src/main/java/de/symeda/sormas/api/i18n/Strings.java +++ b/sormas-api/src/main/java/de/symeda/sormas/api/i18n/Strings.java @@ -130,11 +130,11 @@ public interface Strings { String confirmationDeleteLabMessages = "confirmationDeleteLabMessages"; String confirmationDeletePathogenTests = "confirmationDeletePathogenTests"; String confirmationDeletePrescriptions = "confirmationDeletePrescriptions"; + String confirmationDeletePrescriptionWithTreatment = "confirmationDeletePrescriptionWithTreatment"; String confirmationDeleteSamples = "confirmationDeleteSamples"; String confirmationDeleteTasks = "confirmationDeleteTasks"; String confirmationDeleteTravelEntries = "confirmationDeleteTravelEntries"; String confirmationDeleteTreatments = "confirmationDeleteTreatments"; - String confirmationDeletePrescriptionWithTreatment = "confirmationDeletePrescriptionWithTreatment"; String confirmationDeleteVisits = "confirmationDeleteVisits"; String confirmationDisableAllLineListingNational = "confirmationDisableAllLineListingNational"; String confirmationDisableAllLineListingRegion = "confirmationDisableAllLineListingRegion"; diff --git a/sormas-api/src/main/resources/captions.properties b/sormas-api/src/main/resources/captions.properties index c2a62f0737f..c489154cd49 100644 --- a/sormas-api/src/main/resources/captions.properties +++ b/sormas-api/src/main/resources/captions.properties @@ -1729,7 +1729,7 @@ Prescription.routeDetails=Route specification Prescription.typeOfDrug=Type of drug PrescriptionExport.caseUuid=Case ID PrescriptionExport.caseName=Case name -titleDeletePrescriptionWithTreatment=Delete Prescription With Treatments +prescriptionWithTreatmentTitleDelete=Delete Prescription With Treatments prescriptionAlone=Just Prescription prescriptionWithTreatment=Prescription With Treatments # Continent diff --git a/sormas-backend/src/main/java/de/symeda/sormas/backend/therapy/TreatmentService.java b/sormas-backend/src/main/java/de/symeda/sormas/backend/therapy/TreatmentService.java index df872c3cf28..3a7753e3247 100644 --- a/sormas-backend/src/main/java/de/symeda/sormas/backend/therapy/TreatmentService.java +++ b/sormas-backend/src/main/java/de/symeda/sormas/backend/therapy/TreatmentService.java @@ -159,16 +159,10 @@ public void unlinkPrescriptionFromTreatments(List treatmentUuids){ CriteriaBuilder cb = em.getCriteriaBuilder(); CriteriaUpdate criteriaUpdate = cb.createCriteriaUpdate(getElementClass()); Root from = criteriaUpdate.from(getElementClass()); -// Join prescriptionJoin = from.join(Treatment.THERAPY, JoinType.LEFT); criteriaUpdate.set(Treatment.PRESCRIPTION, null); -// Predicate filter = cb.and(from.get(Treatment.UUID).in(treatmentUuids), -// cb.equal(prescriptionJoin.get(Prescription.UUID), prescriptionUuid)); - -// if(filter != null){ - criteriaUpdate.where(from.get(Treatment.UUID).in(treatmentUuids)); -// } + criteriaUpdate.where(from.get(Treatment.UUID).in(treatmentUuids)); this.em.createQuery(criteriaUpdate).executeUpdate(); } diff --git a/sormas-ui/src/main/java/de/symeda/sormas/ui/therapy/TherapyController.java b/sormas-ui/src/main/java/de/symeda/sormas/ui/therapy/TherapyController.java index 94e66ff86d7..ca451e14e5b 100644 --- a/sormas-ui/src/main/java/de/symeda/sormas/ui/therapy/TherapyController.java +++ b/sormas-ui/src/main/java/de/symeda/sormas/ui/therapy/TherapyController.java @@ -129,7 +129,7 @@ public void accept(Boolean option) { } }; VaadinUiUtil.showChooseOptionPopup( - I18nProperties.getCaption(Captions.titleDeletePrescriptionWithTreatment), + I18nProperties.getCaption(Captions.prescriptionWithTreatmentTitleDelete), new Label(I18nProperties.getString(Strings.confirmationDeletePrescriptionWithTreatment)), I18nProperties.getCaption(Captions.prescriptionAlone), I18nProperties.getCaption(Captions.prescriptionWithTreatment), From 6571a216d734b9a9d8abdee16c345ea61f385631 Mon Sep 17 00:00:00 2001 From: dinua Date: Mon, 2 May 2022 12:31:40 +0300 Subject: [PATCH 029/167] #8978 close popup --- .../java/de/symeda/sormas/ui/therapy/TherapyController.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sormas-ui/src/main/java/de/symeda/sormas/ui/therapy/TherapyController.java b/sormas-ui/src/main/java/de/symeda/sormas/ui/therapy/TherapyController.java index ca451e14e5b..c125cddda41 100644 --- a/sormas-ui/src/main/java/de/symeda/sormas/ui/therapy/TherapyController.java +++ b/sormas-ui/src/main/java/de/symeda/sormas/ui/therapy/TherapyController.java @@ -217,6 +217,8 @@ public void openTreatmentEditForm(TreatmentIndexDto treatmentIndex, Runnable cal if (treatment.getPrescription() != null) { Button openPrescriptionButton = ButtonHelper.createButton(Captions.treatmentOpenPrescription, e -> { openPrescriptionEditForm(treatment.getPrescription(), null, true); + popupWindow.close(); + callback.run(); }); view.getButtonsPanel().addComponent(openPrescriptionButton, view.getButtonsPanel().getComponentIndex(view.getDiscardButton())); From 02ba60aa1319ee9c7480ade76fb52c6e04d5feca Mon Sep 17 00:00:00 2001 From: dinua Date: Fri, 6 May 2022 11:01:20 +0300 Subject: [PATCH 030/167] #8998 fix bug --- .../symeda/sormas/ui/caze/CaseController.java | 25 +++++++++++-------- 1 file changed, 14 insertions(+), 11 deletions(-) diff --git a/sormas-ui/src/main/java/de/symeda/sormas/ui/caze/CaseController.java b/sormas-ui/src/main/java/de/symeda/sormas/ui/caze/CaseController.java index 42b672085d6..67eb36a6508 100644 --- a/sormas-ui/src/main/java/de/symeda/sormas/ui/caze/CaseController.java +++ b/sormas-ui/src/main/java/de/symeda/sormas/ui/caze/CaseController.java @@ -676,18 +676,21 @@ public CommitDiscardWrapperComponent getCaseCreateComponent( FacadeProvider.getPersonFacade().savePerson(person); saveCase(dto); - // retrieve the contact just in case it has been changed during case saving - ContactDto updatedContact = FacadeProvider.getContactFacade().getByUuid(convertedContact.getUuid()); - // automatically change the contact status to "converted" - updatedContact.setContactStatus(ContactStatus.CONVERTED); - // automatically change the contact classification to "confirmed" - updatedContact.setContactClassification(ContactClassification.CONFIRMED); - // set resulting case on contact and save it - if (updatedContact.getResultingCase() == null && updatedContact.getDisease() == dto.getDisease()) { - updatedContact.setResultingCase(dto.toReference()); + + if(convertedContact.getDisease().equals(dto.getDisease())) { + // retrieve the contact just in case it has been changed during case saving + ContactDto updatedContact = FacadeProvider.getContactFacade().getByUuid(convertedContact.getUuid()); + // automatically change the contact status to "converted" + updatedContact.setContactStatus(ContactStatus.CONVERTED); + // automatically change the contact classification to "confirmed" + updatedContact.setContactClassification(ContactClassification.CONFIRMED); + // set resulting case on contact and save it + if (updatedContact.getResultingCase() == null && updatedContact.getDisease() == dto.getDisease()) { + updatedContact.setResultingCase(dto.toReference()); + } + FacadeProvider.getContactFacade().save(updatedContact); } - FacadeProvider.getContactFacade().save(updatedContact); - FacadeProvider.getCaseFacade().setSampleAssociations(updatedContact.toReference(), dto.toReference()); + FacadeProvider.getCaseFacade().setSampleAssociations(convertedContact.toReference(), dto.toReference()); Notification.show(I18nProperties.getString(Strings.messageCaseCreated), Type.ASSISTIVE_NOTIFICATION); if (!createdFromLabMessage) { navigateToView(CaseDataView.VIEW_NAME, dto.getUuid(), null); From 2ba732392e79de09ba3808e299e79a9041586e2f Mon Sep 17 00:00:00 2001 From: Michal Kozakiewicz Date: Fri, 6 May 2022 10:16:33 +0200 Subject: [PATCH 031/167] Added scenario [SORQA-219] on About directory page --- .../org/sormas/e2etests/pages/application/AboutPage.java | 2 ++ .../pages/application/cases/CreateNewCasePage.java | 3 ++- .../steps/web/application/AboutDirectorySteps.java | 7 +++++++ .../src/test/resources/features/sanity/web/About.feature | 8 +++++++- 4 files changed, 18 insertions(+), 2 deletions(-) diff --git a/sormas-e2e-tests/src/main/java/org/sormas/e2etests/pages/application/AboutPage.java b/sormas-e2e-tests/src/main/java/org/sormas/e2etests/pages/application/AboutPage.java index 64986d76abc..b48fcd31c4c 100644 --- a/sormas-e2e-tests/src/main/java/org/sormas/e2etests/pages/application/AboutPage.java +++ b/sormas-e2e-tests/src/main/java/org/sormas/e2etests/pages/application/AboutPage.java @@ -4,4 +4,6 @@ public class AboutPage { public static final By DATA_DICTIONARY_BUTTON = By.id("aboutDataDictionary"); + public static final By SORMAS_VERSION_HYPERLINK = + By.xpath("//div[@class='v-link v-widget vspace-3 v-link-vspace-3']//span"); } diff --git a/sormas-e2e-tests/src/main/java/org/sormas/e2etests/pages/application/cases/CreateNewCasePage.java b/sormas-e2e-tests/src/main/java/org/sormas/e2etests/pages/application/cases/CreateNewCasePage.java index 683141a34a7..11546030d0f 100644 --- a/sormas-e2e-tests/src/main/java/org/sormas/e2etests/pages/application/cases/CreateNewCasePage.java +++ b/sormas-e2e-tests/src/main/java/org/sormas/e2etests/pages/application/cases/CreateNewCasePage.java @@ -75,7 +75,8 @@ public class CreateNewCasePage { public static final By LAST_NAME_LIKE_INPUT = By.xpath("//div[@class= 'filters-container']//div[contains(@location, 'lastName')]//input"); public static final By PERSON_CASE_WINDOW_SEARCH_CASE_BUTTON = By.id("actionSearch"); - public static final By CREATE_A_NEW_CASE_CONFIRMATION_BUTTON = By.xpath("//*[text()='Create a new case']"); + public static final By CREATE_A_NEW_CASE_CONFIRMATION_BUTTON = + By.xpath("//*[text()='Create a new case']"); public static final By SELECT_PERSON_WINDOW_CONFIRM_BUTTON = By.xpath( "//div[contains(@class, 'popupContent')]//span[contains(text(), 'Confirm')]//ancestor::div[@id='commit']"); diff --git a/sormas-e2e-tests/src/test/java/org/sormas/e2etests/steps/web/application/AboutDirectorySteps.java b/sormas-e2e-tests/src/test/java/org/sormas/e2etests/steps/web/application/AboutDirectorySteps.java index 3899e64c824..20cde4db4fa 100644 --- a/sormas-e2e-tests/src/test/java/org/sormas/e2etests/steps/web/application/AboutDirectorySteps.java +++ b/sormas-e2e-tests/src/test/java/org/sormas/e2etests/steps/web/application/AboutDirectorySteps.java @@ -1,6 +1,7 @@ package org.sormas.e2etests.steps.web.application; import static org.sormas.e2etests.pages.application.AboutPage.DATA_DICTIONARY_BUTTON; +import static org.sormas.e2etests.pages.application.AboutPage.SORMAS_VERSION_HYPERLINK; import static org.sormas.e2etests.pages.application.users.CreateNewUserPage.LANGUAGE_COMBOBOX; import static org.sormas.e2etests.pages.application.users.CreateNewUserPage.SAVE_BUTTON; @@ -36,6 +37,12 @@ public class AboutDirectorySteps implements En { @Inject public AboutDirectorySteps(WebDriverHelpers webDriverHelpers, SoftAssert softly) { + When( + "I check that current Sormas version is shown on About directory page", + () -> { + webDriverHelpers.waitUntilElementIsVisibleAndClickable(SORMAS_VERSION_HYPERLINK); + }); + When( "I select {string} language from Combobox in User settings", (String chosenLanguage) -> { diff --git a/sormas-e2e-tests/src/test/resources/features/sanity/web/About.feature b/sormas-e2e-tests/src/test/resources/features/sanity/web/About.feature index fd73590797e..7511768eefb 100644 --- a/sormas-e2e-tests/src/test/resources/features/sanity/web/About.feature +++ b/sormas-e2e-tests/src/test/resources/features/sanity/web/About.feature @@ -12,4 +12,10 @@ Feature: About end to end tests And I detect and check language that was defined in User Settings for XLSX file content And I delete exported xlsx file from user downloads directory Then I click on the User Settings button from navbar - And I set on default language as English in User settings \ No newline at end of file + And I set on default language as English in User settings + + @issue=SORQA-219 @env_main + Scenario: Check current Sormas version is show + Given I log in with National User + And I click on the About button from navbar + Then I check that current Sormas version is shown on About directory page \ No newline at end of file From 05c6a72325b1522361e57acb1cc1dea596430a66 Mon Sep 17 00:00:00 2001 From: dinua Date: Fri, 6 May 2022 11:38:02 +0300 Subject: [PATCH 032/167] #8649 fix bug --- .../de/symeda/sormas/api/person/PersonDto.java | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/sormas-api/src/main/java/de/symeda/sormas/api/person/PersonDto.java b/sormas-api/src/main/java/de/symeda/sormas/api/person/PersonDto.java index d3e85f15b9c..9fecb819615 100644 --- a/sormas-api/src/main/java/de/symeda/sormas/api/person/PersonDto.java +++ b/sormas-api/src/main/java/de/symeda/sormas/api/person/PersonDto.java @@ -22,6 +22,7 @@ import javax.validation.Valid; import javax.validation.constraints.Size; +import com.google.common.base.Strings; import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.lang3.StringUtils; @@ -377,7 +378,20 @@ public SeveralNonPrimaryContactDetailsException(String message) { } public static String buildCaption(String firstName, String lastName) { - return DataHelper.toStringNullable(firstName) + " " + DataHelper.toStringNullable(lastName).toUpperCase(); + return DataHelper.toStringNullable(firstName) + " " + DataHelper.toStringNullable(replaceGermanChars(lastName)).toUpperCase(); + } + + /* + Since there is a common problem in jdk when we call 'ß'.toUpperCase() => 'SS' , the simple workaround is to + replace all 'ß' (lower-case) with the 'ẞ' (upper-case) using chars unicodes. + - ß (lowercase) 00DF + - ẞ (capital) 1E9E + */ + private static String replaceGermanChars(String value){ + if(Strings.isNullOrEmpty(value)){ + return value; + } + return value.replaceAll("\u00DF", "\u1E9E"); } public static PersonDto build() { From 37f146e8efc3d51eaaf5f11a24cf89fdcd4b5bb3 Mon Sep 17 00:00:00 2001 From: jenkins Date: Fri, 6 May 2022 10:52:34 +0200 Subject: [PATCH 033/167] [GITFLOW]updating poms for 1.72.0-SNAPSHOT development --- sormas-api/pom.xml | 2 +- sormas-app/pom.xml | 2 +- sormas-backend/pom.xml | 2 +- sormas-base/dependencies/serverlibs.pom | 2 +- sormas-base/pom.xml | 2 +- sormas-cargoserver/pom.xml | 2 +- sormas-ear/pom.xml | 2 +- sormas-keycloak-service-provider/pom.xml | 2 +- sormas-rest/pom.xml | 2 +- sormas-ui/pom.xml | 2 +- sormas-widgetset/pom.xml | 2 +- 11 files changed, 11 insertions(+), 11 deletions(-) diff --git a/sormas-api/pom.xml b/sormas-api/pom.xml index efcdab138e0..7641a12e5e2 100644 --- a/sormas-api/pom.xml +++ b/sormas-api/pom.xml @@ -2,7 +2,7 @@ de.symeda.sormas sormas-base - 1.71.0-SNAPSHOT + 1.72.0-SNAPSHOT ../sormas-base 4.0.0 diff --git a/sormas-app/pom.xml b/sormas-app/pom.xml index bb6b11e0e52..4762ea22fb4 100644 --- a/sormas-app/pom.xml +++ b/sormas-app/pom.xml @@ -3,7 +3,7 @@ sormas-base de.symeda.sormas - 1.71.0-SNAPSHOT + 1.72.0-SNAPSHOT ../sormas-base 4.0.0 diff --git a/sormas-backend/pom.xml b/sormas-backend/pom.xml index beca2a87906..ce380acdb72 100644 --- a/sormas-backend/pom.xml +++ b/sormas-backend/pom.xml @@ -3,7 +3,7 @@ sormas-base de.symeda.sormas - 1.71.0-SNAPSHOT + 1.72.0-SNAPSHOT ../sormas-base 4.0.0 diff --git a/sormas-base/dependencies/serverlibs.pom b/sormas-base/dependencies/serverlibs.pom index fa5d7c6c80c..8bca8d6f213 100644 --- a/sormas-base/dependencies/serverlibs.pom +++ b/sormas-base/dependencies/serverlibs.pom @@ -8,7 +8,7 @@ sormas-base de.symeda.sormas - 1.71.0-SNAPSHOT + 1.72.0-SNAPSHOT ../ diff --git a/sormas-base/pom.xml b/sormas-base/pom.xml index 2ef6635526f..e875ab1b03b 100644 --- a/sormas-base/pom.xml +++ b/sormas-base/pom.xml @@ -5,7 +5,7 @@ de.symeda.sormas sormas-base pom - 1.71.0-SNAPSHOT + 1.72.0-SNAPSHOT 1.8 diff --git a/sormas-cargoserver/pom.xml b/sormas-cargoserver/pom.xml index 08c224148f0..7f37df612df 100644 --- a/sormas-cargoserver/pom.xml +++ b/sormas-cargoserver/pom.xml @@ -3,7 +3,7 @@ de.symeda.sormas sormas-base - 1.71.0-SNAPSHOT + 1.72.0-SNAPSHOT ../sormas-base diff --git a/sormas-ear/pom.xml b/sormas-ear/pom.xml index aa17037a740..53d10639d92 100644 --- a/sormas-ear/pom.xml +++ b/sormas-ear/pom.xml @@ -3,7 +3,7 @@ de.symeda.sormas sormas-base - 1.71.0-SNAPSHOT + 1.72.0-SNAPSHOT ../sormas-base diff --git a/sormas-keycloak-service-provider/pom.xml b/sormas-keycloak-service-provider/pom.xml index 722f22dac1b..47beacc2757 100644 --- a/sormas-keycloak-service-provider/pom.xml +++ b/sormas-keycloak-service-provider/pom.xml @@ -3,7 +3,7 @@ sormas-base de.symeda.sormas - 1.71.0-SNAPSHOT + 1.72.0-SNAPSHOT ../sormas-base 4.0.0 diff --git a/sormas-rest/pom.xml b/sormas-rest/pom.xml index 49b2e84ea36..d9b1d0fc25b 100644 --- a/sormas-rest/pom.xml +++ b/sormas-rest/pom.xml @@ -3,7 +3,7 @@ de.symeda.sormas sormas-base - 1.71.0-SNAPSHOT + 1.72.0-SNAPSHOT ../sormas-base diff --git a/sormas-ui/pom.xml b/sormas-ui/pom.xml index b9bd0a9e992..0442d42d697 100644 --- a/sormas-ui/pom.xml +++ b/sormas-ui/pom.xml @@ -3,7 +3,7 @@ sormas-base de.symeda.sormas - 1.71.0-SNAPSHOT + 1.72.0-SNAPSHOT ../sormas-base 4.0.0 diff --git a/sormas-widgetset/pom.xml b/sormas-widgetset/pom.xml index 8e5fd900a3f..5e152f2c34c 100644 --- a/sormas-widgetset/pom.xml +++ b/sormas-widgetset/pom.xml @@ -3,7 +3,7 @@ sormas-base de.symeda.sormas - 1.71.0-SNAPSHOT + 1.72.0-SNAPSHOT ../sormas-base 4.0.0 From b827a08ecd2ba518668832a4f35aa054571f68c9 Mon Sep 17 00:00:00 2001 From: jenkins Date: Fri, 6 May 2022 11:33:23 +0200 Subject: [PATCH 034/167] [GITFLOW]updating develop poms to master versions to avoid merge conflicts --- sormas-api/pom.xml | 2 +- sormas-app/pom.xml | 2 +- sormas-backend/pom.xml | 2 +- sormas-base/dependencies/serverlibs.pom | 2 +- sormas-base/pom.xml | 2 +- sormas-cargoserver/pom.xml | 2 +- sormas-ear/pom.xml | 2 +- sormas-keycloak-service-provider/pom.xml | 2 +- sormas-rest/pom.xml | 2 +- sormas-ui/pom.xml | 2 +- sormas-widgetset/pom.xml | 2 +- 11 files changed, 11 insertions(+), 11 deletions(-) diff --git a/sormas-api/pom.xml b/sormas-api/pom.xml index 7641a12e5e2..b1878a5c4cd 100644 --- a/sormas-api/pom.xml +++ b/sormas-api/pom.xml @@ -2,7 +2,7 @@ de.symeda.sormas sormas-base - 1.72.0-SNAPSHOT + 1.71.0 ../sormas-base 4.0.0 diff --git a/sormas-app/pom.xml b/sormas-app/pom.xml index 4762ea22fb4..6fae3650263 100644 --- a/sormas-app/pom.xml +++ b/sormas-app/pom.xml @@ -3,7 +3,7 @@ sormas-base de.symeda.sormas - 1.72.0-SNAPSHOT + 1.71.0 ../sormas-base 4.0.0 diff --git a/sormas-backend/pom.xml b/sormas-backend/pom.xml index ce380acdb72..01d0954089c 100644 --- a/sormas-backend/pom.xml +++ b/sormas-backend/pom.xml @@ -3,7 +3,7 @@ sormas-base de.symeda.sormas - 1.72.0-SNAPSHOT + 1.71.0 ../sormas-base 4.0.0 diff --git a/sormas-base/dependencies/serverlibs.pom b/sormas-base/dependencies/serverlibs.pom index 8bca8d6f213..6a4c5285357 100644 --- a/sormas-base/dependencies/serverlibs.pom +++ b/sormas-base/dependencies/serverlibs.pom @@ -8,7 +8,7 @@ sormas-base de.symeda.sormas - 1.72.0-SNAPSHOT + 1.71.0 ../ diff --git a/sormas-base/pom.xml b/sormas-base/pom.xml index e875ab1b03b..fae94450ad3 100644 --- a/sormas-base/pom.xml +++ b/sormas-base/pom.xml @@ -5,7 +5,7 @@ de.symeda.sormas sormas-base pom - 1.72.0-SNAPSHOT + 1.71.0 1.8 diff --git a/sormas-cargoserver/pom.xml b/sormas-cargoserver/pom.xml index 7f37df612df..66938bd1fba 100644 --- a/sormas-cargoserver/pom.xml +++ b/sormas-cargoserver/pom.xml @@ -3,7 +3,7 @@ de.symeda.sormas sormas-base - 1.72.0-SNAPSHOT + 1.71.0 ../sormas-base diff --git a/sormas-ear/pom.xml b/sormas-ear/pom.xml index 53d10639d92..8ef71652f9c 100644 --- a/sormas-ear/pom.xml +++ b/sormas-ear/pom.xml @@ -3,7 +3,7 @@ de.symeda.sormas sormas-base - 1.72.0-SNAPSHOT + 1.71.0 ../sormas-base diff --git a/sormas-keycloak-service-provider/pom.xml b/sormas-keycloak-service-provider/pom.xml index 47beacc2757..1fc40ca3c16 100644 --- a/sormas-keycloak-service-provider/pom.xml +++ b/sormas-keycloak-service-provider/pom.xml @@ -3,7 +3,7 @@ sormas-base de.symeda.sormas - 1.72.0-SNAPSHOT + 1.71.0 ../sormas-base 4.0.0 diff --git a/sormas-rest/pom.xml b/sormas-rest/pom.xml index d9b1d0fc25b..b56006a688b 100644 --- a/sormas-rest/pom.xml +++ b/sormas-rest/pom.xml @@ -3,7 +3,7 @@ de.symeda.sormas sormas-base - 1.72.0-SNAPSHOT + 1.71.0 ../sormas-base diff --git a/sormas-ui/pom.xml b/sormas-ui/pom.xml index 0442d42d697..a4476e878d0 100644 --- a/sormas-ui/pom.xml +++ b/sormas-ui/pom.xml @@ -3,7 +3,7 @@ sormas-base de.symeda.sormas - 1.72.0-SNAPSHOT + 1.71.0 ../sormas-base 4.0.0 diff --git a/sormas-widgetset/pom.xml b/sormas-widgetset/pom.xml index 5e152f2c34c..3c3bb3f0821 100644 --- a/sormas-widgetset/pom.xml +++ b/sormas-widgetset/pom.xml @@ -3,7 +3,7 @@ sormas-base de.symeda.sormas - 1.72.0-SNAPSHOT + 1.71.0 ../sormas-base 4.0.0 From 6771e74872391a6be9e1320ad6771a20cf49dc62 Mon Sep 17 00:00:00 2001 From: jenkins Date: Fri, 6 May 2022 11:33:26 +0200 Subject: [PATCH 035/167] [GITFLOW]Updating develop poms back to pre merge state --- sormas-api/pom.xml | 2 +- sormas-app/pom.xml | 2 +- sormas-backend/pom.xml | 2 +- sormas-base/dependencies/serverlibs.pom | 2 +- sormas-base/pom.xml | 2 +- sormas-cargoserver/pom.xml | 2 +- sormas-ear/pom.xml | 2 +- sormas-keycloak-service-provider/pom.xml | 2 +- sormas-rest/pom.xml | 2 +- sormas-ui/pom.xml | 2 +- sormas-widgetset/pom.xml | 2 +- 11 files changed, 11 insertions(+), 11 deletions(-) diff --git a/sormas-api/pom.xml b/sormas-api/pom.xml index b1878a5c4cd..7641a12e5e2 100644 --- a/sormas-api/pom.xml +++ b/sormas-api/pom.xml @@ -2,7 +2,7 @@ de.symeda.sormas sormas-base - 1.71.0 + 1.72.0-SNAPSHOT ../sormas-base 4.0.0 diff --git a/sormas-app/pom.xml b/sormas-app/pom.xml index 6fae3650263..4762ea22fb4 100644 --- a/sormas-app/pom.xml +++ b/sormas-app/pom.xml @@ -3,7 +3,7 @@ sormas-base de.symeda.sormas - 1.71.0 + 1.72.0-SNAPSHOT ../sormas-base 4.0.0 diff --git a/sormas-backend/pom.xml b/sormas-backend/pom.xml index 01d0954089c..ce380acdb72 100644 --- a/sormas-backend/pom.xml +++ b/sormas-backend/pom.xml @@ -3,7 +3,7 @@ sormas-base de.symeda.sormas - 1.71.0 + 1.72.0-SNAPSHOT ../sormas-base 4.0.0 diff --git a/sormas-base/dependencies/serverlibs.pom b/sormas-base/dependencies/serverlibs.pom index 6a4c5285357..8bca8d6f213 100644 --- a/sormas-base/dependencies/serverlibs.pom +++ b/sormas-base/dependencies/serverlibs.pom @@ -8,7 +8,7 @@ sormas-base de.symeda.sormas - 1.71.0 + 1.72.0-SNAPSHOT ../ diff --git a/sormas-base/pom.xml b/sormas-base/pom.xml index fae94450ad3..e875ab1b03b 100644 --- a/sormas-base/pom.xml +++ b/sormas-base/pom.xml @@ -5,7 +5,7 @@ de.symeda.sormas sormas-base pom - 1.71.0 + 1.72.0-SNAPSHOT 1.8 diff --git a/sormas-cargoserver/pom.xml b/sormas-cargoserver/pom.xml index 66938bd1fba..7f37df612df 100644 --- a/sormas-cargoserver/pom.xml +++ b/sormas-cargoserver/pom.xml @@ -3,7 +3,7 @@ de.symeda.sormas sormas-base - 1.71.0 + 1.72.0-SNAPSHOT ../sormas-base diff --git a/sormas-ear/pom.xml b/sormas-ear/pom.xml index 8ef71652f9c..53d10639d92 100644 --- a/sormas-ear/pom.xml +++ b/sormas-ear/pom.xml @@ -3,7 +3,7 @@ de.symeda.sormas sormas-base - 1.71.0 + 1.72.0-SNAPSHOT ../sormas-base diff --git a/sormas-keycloak-service-provider/pom.xml b/sormas-keycloak-service-provider/pom.xml index 1fc40ca3c16..47beacc2757 100644 --- a/sormas-keycloak-service-provider/pom.xml +++ b/sormas-keycloak-service-provider/pom.xml @@ -3,7 +3,7 @@ sormas-base de.symeda.sormas - 1.71.0 + 1.72.0-SNAPSHOT ../sormas-base 4.0.0 diff --git a/sormas-rest/pom.xml b/sormas-rest/pom.xml index b56006a688b..d9b1d0fc25b 100644 --- a/sormas-rest/pom.xml +++ b/sormas-rest/pom.xml @@ -3,7 +3,7 @@ de.symeda.sormas sormas-base - 1.71.0 + 1.72.0-SNAPSHOT ../sormas-base diff --git a/sormas-ui/pom.xml b/sormas-ui/pom.xml index a4476e878d0..0442d42d697 100644 --- a/sormas-ui/pom.xml +++ b/sormas-ui/pom.xml @@ -3,7 +3,7 @@ sormas-base de.symeda.sormas - 1.71.0 + 1.72.0-SNAPSHOT ../sormas-base 4.0.0 diff --git a/sormas-widgetset/pom.xml b/sormas-widgetset/pom.xml index 3c3bb3f0821..5e152f2c34c 100644 --- a/sormas-widgetset/pom.xml +++ b/sormas-widgetset/pom.xml @@ -3,7 +3,7 @@ sormas-base de.symeda.sormas - 1.71.0 + 1.72.0-SNAPSHOT ../sormas-base 4.0.0 From 1ad8b08c132db4c69b2e2f45d829e661637672dd Mon Sep 17 00:00:00 2001 From: Carina Paul <47103965+carina29@users.noreply.github.com> Date: Fri, 6 May 2022 13:35:04 +0300 Subject: [PATCH 036/167] #9012 - measure are displayed in Action Title column (#9085) --- .../symeda/sormas/api/event/EventHelper.java | 5 ----- .../EventActionIndexDtoReasultTransformer.java | 4 +--- .../sormas/ui/action/ActionListEntry.java | 18 +++--------------- 3 files changed, 4 insertions(+), 23 deletions(-) diff --git a/sormas-api/src/main/java/de/symeda/sormas/api/event/EventHelper.java b/sormas-api/src/main/java/de/symeda/sormas/api/event/EventHelper.java index bc1d78b7ce2..a67115d2a5c 100644 --- a/sormas-api/src/main/java/de/symeda/sormas/api/event/EventHelper.java +++ b/sormas-api/src/main/java/de/symeda/sormas/api/event/EventHelper.java @@ -19,7 +19,6 @@ import java.util.Date; -import de.symeda.sormas.api.action.ActionMeasure; import de.symeda.sormas.api.utils.DataHelper; import de.symeda.sormas.api.utils.DateFormatHelper; @@ -60,10 +59,6 @@ public static String buildMeansOfTransportString(MeansOfTransport meansOfTranspo return DataHelper.toStringNullable(meansOfTransport); } - public static String buildEventActionTitleString(ActionMeasure actionMeasure, String actionTitle) { - return actionMeasure == null || actionMeasure == ActionMeasure.OTHER ? actionTitle : actionMeasure.toString(); - } - public static Date getStartOrEndDate(Date eventStartDate, Date eventEndDate) { return eventStartDate != null ? eventStartDate : eventEndDate; } diff --git a/sormas-backend/src/main/java/de/symeda/sormas/backend/action/transformers/EventActionIndexDtoReasultTransformer.java b/sormas-backend/src/main/java/de/symeda/sormas/backend/action/transformers/EventActionIndexDtoReasultTransformer.java index 101de385a90..8340760c0bb 100644 --- a/sormas-backend/src/main/java/de/symeda/sormas/backend/action/transformers/EventActionIndexDtoReasultTransformer.java +++ b/sormas-backend/src/main/java/de/symeda/sormas/backend/action/transformers/EventActionIndexDtoReasultTransformer.java @@ -11,7 +11,6 @@ import de.symeda.sormas.api.action.ActionStatus; import de.symeda.sormas.api.disease.DiseaseVariant; import de.symeda.sormas.api.event.EventActionIndexDto; -import de.symeda.sormas.api.event.EventHelper; import de.symeda.sormas.api.event.EventIdentificationSource; import de.symeda.sormas.api.event.EventInvestigationStatus; import de.symeda.sormas.api.event.EventManagementStatus; @@ -25,7 +24,6 @@ public class EventActionIndexDtoReasultTransformer implements ResultTransformer public Object transformTuple(Object[] objects, String[] strings) { UserReferenceDto eventReportingUser = new UserReferenceDto((String) objects[12], (String) objects[13], (String) objects[14], null); UserReferenceDto eventResponsibleUser = new UserReferenceDto((String) objects[15], (String) objects[16], (String) objects[17], null); - String actionTitle = EventHelper.buildEventActionTitleString((ActionMeasure) objects[18], (String) objects[20]); UserReferenceDto actionLastModifiedBy = new UserReferenceDto((String) objects[26], (String) objects[27], (String) objects[28], null); UserReferenceDto actionCreatorUser = new UserReferenceDto((String) objects[29], (String) objects[30], (String) objects[31], null); return new EventActionIndexDto( @@ -43,7 +41,7 @@ public Object transformTuple(Object[] objects, String[] strings) { (EventManagementStatus) objects[11], eventReportingUser, eventResponsibleUser, - actionTitle, + (String) objects[20], (Date) objects[19], (Date) objects[21], (Date) objects[22], diff --git a/sormas-ui/src/main/java/de/symeda/sormas/ui/action/ActionListEntry.java b/sormas-ui/src/main/java/de/symeda/sormas/ui/action/ActionListEntry.java index ce13c077901..b1fa74d703b 100644 --- a/sormas-ui/src/main/java/de/symeda/sormas/ui/action/ActionListEntry.java +++ b/sormas-ui/src/main/java/de/symeda/sormas/ui/action/ActionListEntry.java @@ -16,8 +16,6 @@ import static de.symeda.sormas.api.utils.HtmlHelper.cleanHtml; -import org.apache.commons.lang3.StringUtils; - import com.google.common.base.MoreObjects; import com.google.common.base.Strings; import com.vaadin.icons.VaadinIcons; @@ -32,11 +30,9 @@ import de.symeda.sormas.api.FacadeProvider; import de.symeda.sormas.api.action.ActionDto; -import de.symeda.sormas.api.action.ActionMeasure; import de.symeda.sormas.api.action.ActionPriority; import de.symeda.sormas.api.action.ActionStatus; import de.symeda.sormas.api.document.DocumentRelatedEntityType; -import de.symeda.sormas.api.event.EventHelper; import de.symeda.sormas.api.feature.FeatureType; import de.symeda.sormas.api.i18n.Captions; import de.symeda.sormas.api.i18n.I18nProperties; @@ -70,17 +66,9 @@ public ActionListEntry(ActionDto action) { addComponent(withContentLayout); setExpandRatio(withContentLayout, 3); - Label measureOrTitle = new Label( - MoreObjects - .firstNonNull(Strings.emptyToNull(EventHelper.buildEventActionTitleString(action.getActionMeasure(), action.getTitle())), "-")); - measureOrTitle.addStyleName(CssStyles.H3); - withContentLayout.addComponent(measureOrTitle); - - if (action.getActionMeasure() != null && action.getActionMeasure() != ActionMeasure.OTHER && StringUtils.isNotBlank(action.getTitle())) { - Label title = new Label(MoreObjects.firstNonNull(Strings.emptyToNull(action.getTitle()), "-")); - title.addStyleName(CssStyles.H4); - withContentLayout.addComponent(title); - } + Label title = new Label(MoreObjects.firstNonNull(Strings.emptyToNull(action.getTitle()), "-")); + title.addStyleName(CssStyles.H3); + withContentLayout.addComponent(title); HorizontalLayout topLayout = new HorizontalLayout(); topLayout.setMargin(false); From 5a83104e15f514709a62a31841ff123a897e7872 Mon Sep 17 00:00:00 2001 From: Maciej Paszylka Date: Fri, 6 May 2022 14:29:53 +0200 Subject: [PATCH 037/167] SORDEV-9818 tests --- .../entries/EditTravelEntryPage.java | 1 + .../application/entries/TravelEntryPage.java | 5 ++ .../application/persons/EditPersonPage.java | 1 + .../entries/CreateNewTravelEntrySteps.java | 10 ++++ .../entries/TravelEntryDirectorySteps.java | 55 ++++++++++++++++++- .../application/persons/EditPersonSteps.java | 7 +++ .../persons/PersonDirectorySteps.java | 9 +++ .../features/sanity/web/TravelEntry.feature | 36 +++++++++++- 8 files changed, 122 insertions(+), 2 deletions(-) diff --git a/sormas-e2e-tests/src/main/java/org/sormas/e2etests/pages/application/entries/EditTravelEntryPage.java b/sormas-e2e-tests/src/main/java/org/sormas/e2etests/pages/application/entries/EditTravelEntryPage.java index d356736470a..e7cd4e14c71 100644 --- a/sormas-e2e-tests/src/main/java/org/sormas/e2etests/pages/application/entries/EditTravelEntryPage.java +++ b/sormas-e2e-tests/src/main/java/org/sormas/e2etests/pages/application/entries/EditTravelEntryPage.java @@ -35,6 +35,7 @@ public class EditTravelEntryPage { public static final By POINT_OF_ENTRY_COMBOBOX = By.cssSelector("#pointOfEntry div"); public static final By POINT_OF_ENTRY_DETAILS_INPUT = By.cssSelector("#pointOfEntryDetails"); public static final By TRAVEL_ENTRY_PERSON_TAB = By.id("tab-travelEntries-person"); + public static final By PERSON_ID_LABEL = By.xpath("//div[contains(@location,'personInformationHeadingLoc')]"); public static final By CREATE_CASE_FROM_TRAVEL_ENTRY = By.id("travelEntryCreateCase"); public static final By SAVE_NEW_CASE_FOR_TRAVEL_ENTRY_POPUP = By.cssSelector(".popupContent #commit"); diff --git a/sormas-e2e-tests/src/main/java/org/sormas/e2etests/pages/application/entries/TravelEntryPage.java b/sormas-e2e-tests/src/main/java/org/sormas/e2etests/pages/application/entries/TravelEntryPage.java index 5ce14ec4b43..9a489fd7466 100644 --- a/sormas-e2e-tests/src/main/java/org/sormas/e2etests/pages/application/entries/TravelEntryPage.java +++ b/sormas-e2e-tests/src/main/java/org/sormas/e2etests/pages/application/entries/TravelEntryPage.java @@ -42,4 +42,9 @@ public class TravelEntryPage { public static final By TRAVEL_ENTRY_AGGREGATION_COMBOBOX = By.cssSelector("[id='relevanceStatus'] [class='v-filterselect-button']"); public static final By TRAVEL_ENTRY_FIRST_RECORD_IN_TABLE = By.cssSelector("[role='gridcell'] a"); + public static final By DELETE_BULK = By.id("bulkActions-3"); + + public static By getCheckboxByIndex(String idx) { + return By.xpath(String.format("(//td//input[@type=\"checkbox\"])[%s]", idx)); + } } diff --git a/sormas-e2e-tests/src/main/java/org/sormas/e2etests/pages/application/persons/EditPersonPage.java b/sormas-e2e-tests/src/main/java/org/sormas/e2etests/pages/application/persons/EditPersonPage.java index f5380f0abab..51208f69436 100644 --- a/sormas-e2e-tests/src/main/java/org/sormas/e2etests/pages/application/persons/EditPersonPage.java +++ b/sormas-e2e-tests/src/main/java/org/sormas/e2etests/pages/application/persons/EditPersonPage.java @@ -115,6 +115,7 @@ public class EditPersonPage { By.cssSelector("[location='personInformationHeadingLoc']"); public static final By EVENT_PARTICIPANTS_DATA_TAB = By.cssSelector("#tab-events-eventparticipants"); + public static final By NO_TRAVEL_ENTRY_LABEL_DE = By.xpath("//div[text()=\"Es gibt keine Einreisen f\u00FCr diese Person\"]"); public static By getByPersonUuid(String personUuid) { return By.cssSelector("a[title='" + personUuid + "']"); diff --git a/sormas-e2e-tests/src/test/java/org/sormas/e2etests/steps/web/application/entries/CreateNewTravelEntrySteps.java b/sormas-e2e-tests/src/test/java/org/sormas/e2etests/steps/web/application/entries/CreateNewTravelEntrySteps.java index 2fc5c4ecd4e..1c3e867c059 100644 --- a/sormas-e2e-tests/src/test/java/org/sormas/e2etests/steps/web/application/entries/CreateNewTravelEntrySteps.java +++ b/sormas-e2e-tests/src/test/java/org/sormas/e2etests/steps/web/application/entries/CreateNewTravelEntrySteps.java @@ -41,6 +41,7 @@ import static org.sormas.e2etests.pages.application.entries.EditTravelEntryPage.FIRST_NAME_INPUT; import static org.sormas.e2etests.pages.application.entries.EditTravelEntryPage.INFO_BUTTON; import static org.sormas.e2etests.pages.application.entries.EditTravelEntryPage.LAST_NAME_INPUT; +import static org.sormas.e2etests.pages.application.entries.EditTravelEntryPage.PERSON_ID_LABEL; import static org.sormas.e2etests.pages.application.entries.EditTravelEntryPage.POINT_OF_ENTRY_CASE; import static org.sormas.e2etests.pages.application.entries.EditTravelEntryPage.SAVE_NEW_CASE_FOR_TRAVEL_ENTRY_POPUP; import static org.sormas.e2etests.pages.application.entries.EditTravelEntryPage.TRAVEL_ENTRY_PERSON_TAB; @@ -72,6 +73,7 @@ public class CreateNewTravelEntrySteps implements En { public static TravelEntry TravelEntryUuid; public static TravelEntry newCaseFromTravelEntryData; public static Case aCase; + public static String collectTravelEntryPersonUuid; String firstName; String lastName; String sex; @@ -172,7 +174,11 @@ public CreateNewTravelEntrySteps( "^I navigate to person tab in Edit travel entry page$", () -> { webDriverHelpers.clickOnWebElementBySelector(TRAVEL_ENTRY_PERSON_TAB); + webDriverHelpers.waitUntilElementIsVisibleAndClickable(PERSON_ID_LABEL); }); + When( + "I collect the Travel Entry person UUID displayed on Travel Entry Person page", + () -> collectTravelEntryPersonUuid = collectTravelEntryPersonUuid()); When( "I check the created data is correctly displayed on Edit travel entry page for DE version", @@ -406,6 +412,10 @@ private TravelEntry collectTravelEntryUuid() { return TravelEntry.builder().uuid(webDriverHelpers.getValueFromWebElement(UUID_INPUT)).build(); } + private String collectTravelEntryPersonUuid() { + return webDriverHelpers.getValueFromWebElement(UUID_INPUT); + } + private TravelEntry collectTravelEntryPersonData() { return TravelEntry.builder() .firstName(webDriverHelpers.getValueFromWebElement(FIRST_NAME_INPUT)) diff --git a/sormas-e2e-tests/src/test/java/org/sormas/e2etests/steps/web/application/entries/TravelEntryDirectorySteps.java b/sormas-e2e-tests/src/test/java/org/sormas/e2etests/steps/web/application/entries/TravelEntryDirectorySteps.java index 51b87624b27..6ba244ffc71 100644 --- a/sormas-e2e-tests/src/test/java/org/sormas/e2etests/steps/web/application/entries/TravelEntryDirectorySteps.java +++ b/sormas-e2e-tests/src/test/java/org/sormas/e2etests/steps/web/application/entries/TravelEntryDirectorySteps.java @@ -21,8 +21,10 @@ import static org.sormas.e2etests.pages.application.cases.CaseDirectoryPage.DATE_FROM_COMBOBOX; import static org.sormas.e2etests.pages.application.cases.CaseDirectoryPage.DATE_TO_COMBOBOX; import static org.sormas.e2etests.pages.application.configuration.DocumentTemplatesPage.FILE_PICKER; +import static org.sormas.e2etests.pages.application.contacts.ContactDirectoryPage.getCheckboxByUUID; import static org.sormas.e2etests.pages.application.entries.TravelEntryPage.COMMIT_BUTTON; import static org.sormas.e2etests.pages.application.entries.TravelEntryPage.CONVERTE_TO_CASE_ENTRIES; +import static org.sormas.e2etests.pages.application.entries.TravelEntryPage.DELETE_BULK; import static org.sormas.e2etests.pages.application.entries.TravelEntryPage.IMPORT_BUTTON; import static org.sormas.e2etests.pages.application.entries.TravelEntryPage.IMPORT_SUCCESS_DE; import static org.sormas.e2etests.pages.application.entries.TravelEntryPage.NEGATIVE_TESTES_ENTRIES; @@ -37,26 +39,34 @@ import static org.sormas.e2etests.pages.application.entries.TravelEntryPage.TRAVEL_ENTRY_FIRST_RECORD_IN_TABLE; import static org.sormas.e2etests.pages.application.entries.TravelEntryPage.TRAVEL_ENTRY_GRID_RESULTS_ROWS; import static org.sormas.e2etests.pages.application.entries.TravelEntryPage.VACCINATED_ENTRIES; +import static org.sormas.e2etests.pages.application.entries.TravelEntryPage.getCheckboxByIndex; +import static org.sormas.e2etests.pages.application.events.EventDirectoryPage.BULK_ACTIONS_EVENT_DIRECTORY; +import static org.sormas.e2etests.pages.application.tasks.TaskManagementPage.BULK_EDIT_BUTTON; import cucumber.api.java8.En; import java.time.format.DateTimeFormatter; import java.util.concurrent.TimeUnit; import javax.inject.Inject; +import org.openqa.selenium.By; import org.sormas.e2etests.envconfig.manager.EnvironmentManager; import org.sormas.e2etests.helpers.AssertHelpers; import org.sormas.e2etests.helpers.WebDriverHelpers; import org.sormas.e2etests.state.ApiState; import org.testng.Assert; +import org.testng.asserts.SoftAssert; public class TravelEntryDirectorySteps implements En { public static final String userDirPath = System.getProperty("user.dir"); + private final WebDriverHelpers webDriverHelpers; @Inject public TravelEntryDirectorySteps( WebDriverHelpers webDriverHelpers, EnvironmentManager environmentManager, ApiState apiState, - AssertHelpers assertHelpers) { + AssertHelpers assertHelpers, + SoftAssert softly) { + this.webDriverHelpers = webDriverHelpers; When( "I click on the Import button from Travel Entries directory", @@ -95,17 +105,60 @@ public TravelEntryDirectorySteps( webDriverHelpers.waitUntilIdentifiedElementIsPresent(IMPORT_SUCCESS_DE); }); + When( + "^I select chosen Travel Entry result", + () -> { + webDriverHelpers.waitForPageLoadingSpinnerToDisappear(40); + webDriverHelpers.scrollToElement( + getCheckboxByUUID(CreateNewTravelEntrySteps.TravelEntryUuid.getUuid())); + webDriverHelpers.clickOnWebElementBySelector( + getCheckboxByUUID(CreateNewTravelEntrySteps.TravelEntryUuid.getUuid())); + webDriverHelpers.waitForPageLoadingSpinnerToDisappear(40); + }); When( "I click on the New Travel Entry button from Travel Entries directory", () -> { webDriverHelpers.clickOnWebElementBySelector(NEW_TRAVEL_ENTRY_BUTTON); }); + When( + "^I select first (\\d+) results in grid in Travel Entry Directory$", + (Integer number) -> { + webDriverHelpers.waitForPageLoadingSpinnerToDisappear(40); + for (int i = 1; i <= number; i++) { + webDriverHelpers.scrollToElement(getCheckboxByIndex(String.valueOf(i))); + webDriverHelpers.clickOnWebElementBySelector(getCheckboxByIndex(String.valueOf(i))); + } + webDriverHelpers.waitForPageLoadingSpinnerToDisappear(40); + }); + When( + "I click on Enter Bulk Edit Mode from Travel Entry Directory", + () -> { + webDriverHelpers.clickOnWebElementBySelector(BULK_EDIT_BUTTON); + webDriverHelpers.waitForPageLoadingSpinnerToDisappear(40); + }); + And( + "I click on Bulk Actions combobox in Travel Entry Directory", + () -> webDriverHelpers.clickOnWebElementBySelector(BULK_ACTIONS_EVENT_DIRECTORY)); + And( + "I click on Delete button from Bulk Actions Combobox in Travel Entry Directory", + () -> webDriverHelpers.clickOnWebElementBySelector(DELETE_BULK)); When( "I filter by Person ID on Travel Entry directory page", () -> { webDriverHelpers.fillAndSubmitInWebElement( PERSON_FILTER_INPUT, CreateNewTravelEntrySteps.aTravelEntry.getUuid()); }); + When( + "I check if popup deletion message appeared", + () -> { + String expectedText = "Alle ausgew\u00E4hlten Einreisen wurden gel\u00F6scht"; + softly.assertEquals( + webDriverHelpers.getTextFromPresentWebElement( + By.cssSelector(".v-Notification-description")), + expectedText, + "Bulk action went wrong"); + softly.assertAll(); + }); And( "I click {string} checkbox on Travel Entry directory page", (String checkboxDescription) -> { diff --git a/sormas-e2e-tests/src/test/java/org/sormas/e2etests/steps/web/application/persons/EditPersonSteps.java b/sormas-e2e-tests/src/test/java/org/sormas/e2etests/steps/web/application/persons/EditPersonSteps.java index ca937675927..73faf61fd29 100644 --- a/sormas-e2e-tests/src/test/java/org/sormas/e2etests/steps/web/application/persons/EditPersonSteps.java +++ b/sormas-e2e-tests/src/test/java/org/sormas/e2etests/steps/web/application/persons/EditPersonSteps.java @@ -85,6 +85,7 @@ import java.util.Locale; import java.util.concurrent.TimeUnit; import javax.inject.Inject; +import org.openqa.selenium.By; import org.openqa.selenium.ElementClickInterceptedException; import org.sormas.e2etests.entities.pojo.helpers.ComparisonHelper; import org.sormas.e2etests.entities.pojo.web.Person; @@ -249,6 +250,12 @@ public EditPersonSteps( previousCreatedPerson = collectedPerson; }); + When( + "I check if there is no travel entry assigned to Person", + () -> { + webDriverHelpers.waitUntilElementIsVisibleAndClickable( + NO_TRAVEL_ENTRY_LABEL_DE); + }); When( "I check if event is available at person information", () -> { diff --git a/sormas-e2e-tests/src/test/java/org/sormas/e2etests/steps/web/application/persons/PersonDirectorySteps.java b/sormas-e2e-tests/src/test/java/org/sormas/e2etests/steps/web/application/persons/PersonDirectorySteps.java index 110423d2285..75302292aab 100644 --- a/sormas-e2e-tests/src/test/java/org/sormas/e2etests/steps/web/application/persons/PersonDirectorySteps.java +++ b/sormas-e2e-tests/src/test/java/org/sormas/e2etests/steps/web/application/persons/PersonDirectorySteps.java @@ -48,6 +48,7 @@ import org.sormas.e2etests.state.ApiState; import org.sormas.e2etests.steps.web.application.cases.EditCaseSteps; import org.sormas.e2etests.steps.web.application.contacts.EditContactPersonSteps; +import org.sormas.e2etests.steps.web.application.entries.CreateNewTravelEntrySteps; import org.sormas.e2etests.steps.web.application.events.EditEventSteps; import org.testng.Assert; import org.testng.asserts.SoftAssert; @@ -177,6 +178,14 @@ public PersonDirectorySteps( apiState.getLastCreatedPerson().getUuid()); webDriverHelpers.fillInWebElement(MULTIPLE_OPTIONS_SEARCH_INPUT, personUUID); }); + Then( + "I fill UUID of the collected person from Travel Entry", + () -> { + String personUUID = + dataOperations.getPartialUuidFromAssociatedLink( + CreateNewTravelEntrySteps.collectTravelEntryPersonUuid); + webDriverHelpers.fillInWebElement(MULTIPLE_OPTIONS_SEARCH_INPUT, personUUID); + }); Then( "I select present condition field with condition of the last created person via API", diff --git a/sormas-e2e-tests/src/test/resources/features/sanity/web/TravelEntry.feature b/sormas-e2e-tests/src/test/resources/features/sanity/web/TravelEntry.feature index 72d678ea5fd..953d6ecf36a 100644 --- a/sormas-e2e-tests/src/test/resources/features/sanity/web/TravelEntry.feature +++ b/sormas-e2e-tests/src/test/resources/features/sanity/web/TravelEntry.feature @@ -113,4 +113,38 @@ Feature: Create travel entries And I check the created data is correctly displayed on Edit travel entry page for DE version When I click on the Persons button from navbar And I open the last created person linked with Case - And I check that EDIT TRAVEL ENTRY button appears on Edit Person page \ No newline at end of file + And I check that EDIT TRAVEL ENTRY button appears on Edit Person page + + @issue=SORDEV-9818 @env_de + Scenario: Bulk deleting entries in Travel Entry Directory + Given I log in as a Admin User + And I click on the Entries button from navbar + And I click on Enter Bulk Edit Mode from Travel Entry Directory + And I select first 3 results in grid in Travel Entry Directory + And I click on Bulk Actions combobox in Travel Entry Directory + And I click on Delete button from Bulk Actions Combobox in Travel Entry Directory + And I click yes on the CONFIRM REMOVAL popup from Task Directory page + And I check if popup deletion message appeared + + @issue=SORDEV-9818 @env_de + Scenario: Deleting entry assigned to a person in Travel Entry Directory + Given I log in as a Admin User + And I click on the Entries button from navbar + And I click on Enter Bulk Edit Mode from Travel Entry Directory + And I click "Nur in Fälle konvertierte Einreisen" checkbox on Travel Entry directory page + And I click APPLY BUTTON in Travel Entry Directory Page + And I click on first filtered record in Travel Entry + And I collect travel UUID from travel entry + And I navigate to person tab in Edit travel entry page + And I collect the Travel Entry person UUID displayed on Travel Entry Person page + And I click on the Entries button from navbar + And I select chosen Travel Entry result + And I click on Bulk Actions combobox in Travel Entry Directory + And I click on Delete button from Bulk Actions Combobox in Travel Entry Directory + And I click yes on the CONFIRM REMOVAL popup from Task Directory page + And I check if popup deletion message appeared + When I click on the Persons button from navbar + And I fill UUID of the collected person from Travel Entry + Then I apply on the APPLY FILTERS button + And I click on first person in person directory + Then I check if there is no travel entry assigned to Person From adab87335293bb3f775688511cb4c595359415ae Mon Sep 17 00:00:00 2001 From: Michal Kozakiewicz Date: Fri, 6 May 2022 15:37:29 +0200 Subject: [PATCH 038/167] Added scenario [SORDEV-9787] --- .../application/cases/CreateNewCasePage.java | 3 +- .../entries/CreateNewTravelEntryPage.java | 2 ++ .../application/entries/TravelEntryPage.java | 2 ++ .../entries/CreateNewTravelEntrySteps.java | 15 +++++++++ .../entries/TravelEntryDirectorySteps.java | 16 ++++++++++ .../sanity/web/TravelEntryFilters.feature | 31 ++++++++++++++++++- 6 files changed, 67 insertions(+), 2 deletions(-) diff --git a/sormas-e2e-tests/src/main/java/org/sormas/e2etests/pages/application/cases/CreateNewCasePage.java b/sormas-e2e-tests/src/main/java/org/sormas/e2etests/pages/application/cases/CreateNewCasePage.java index 683141a34a7..11546030d0f 100644 --- a/sormas-e2e-tests/src/main/java/org/sormas/e2etests/pages/application/cases/CreateNewCasePage.java +++ b/sormas-e2e-tests/src/main/java/org/sormas/e2etests/pages/application/cases/CreateNewCasePage.java @@ -75,7 +75,8 @@ public class CreateNewCasePage { public static final By LAST_NAME_LIKE_INPUT = By.xpath("//div[@class= 'filters-container']//div[contains(@location, 'lastName')]//input"); public static final By PERSON_CASE_WINDOW_SEARCH_CASE_BUTTON = By.id("actionSearch"); - public static final By CREATE_A_NEW_CASE_CONFIRMATION_BUTTON = By.xpath("//*[text()='Create a new case']"); + public static final By CREATE_A_NEW_CASE_CONFIRMATION_BUTTON = + By.xpath("//*[text()='Create a new case']"); public static final By SELECT_PERSON_WINDOW_CONFIRM_BUTTON = By.xpath( "//div[contains(@class, 'popupContent')]//span[contains(text(), 'Confirm')]//ancestor::div[@id='commit']"); diff --git a/sormas-e2e-tests/src/main/java/org/sormas/e2etests/pages/application/entries/CreateNewTravelEntryPage.java b/sormas-e2e-tests/src/main/java/org/sormas/e2etests/pages/application/entries/CreateNewTravelEntryPage.java index 6d413c6c9cd..4e5479163c9 100644 --- a/sormas-e2e-tests/src/main/java/org/sormas/e2etests/pages/application/entries/CreateNewTravelEntryPage.java +++ b/sormas-e2e-tests/src/main/java/org/sormas/e2etests/pages/application/entries/CreateNewTravelEntryPage.java @@ -47,4 +47,6 @@ public class CreateNewTravelEntryPage { public static final By PICK_A_EXISTING_CASE_LABEL_DE = By.xpath("//*[text()='Einen vorhandenen Fall w\u00E4hlen']"); public static final By ARRIVAL_DATE = By.cssSelector("#dateOfArrival input"); + public static final By FIRST_TRAVEL_ENTRY_ID_BUTTON = + By.cssSelector(".v-grid-row-has-data a[title]"); } diff --git a/sormas-e2e-tests/src/main/java/org/sormas/e2etests/pages/application/entries/TravelEntryPage.java b/sormas-e2e-tests/src/main/java/org/sormas/e2etests/pages/application/entries/TravelEntryPage.java index 5ce14ec4b43..1913d65b2e4 100644 --- a/sormas-e2e-tests/src/main/java/org/sormas/e2etests/pages/application/entries/TravelEntryPage.java +++ b/sormas-e2e-tests/src/main/java/org/sormas/e2etests/pages/application/entries/TravelEntryPage.java @@ -42,4 +42,6 @@ public class TravelEntryPage { public static final By TRAVEL_ENTRY_AGGREGATION_COMBOBOX = By.cssSelector("[id='relevanceStatus'] [class='v-filterselect-button']"); public static final By TRAVEL_ENTRY_FIRST_RECORD_IN_TABLE = By.cssSelector("[role='gridcell'] a"); + public static final By TRAVEL_ENTRY_DATA_FILTER_OPTION_COMBOBOX = + By.cssSelector("[id='dateFilterOption'] [class='v-filterselect-button']"); } diff --git a/sormas-e2e-tests/src/test/java/org/sormas/e2etests/steps/web/application/entries/CreateNewTravelEntrySteps.java b/sormas-e2e-tests/src/test/java/org/sormas/e2etests/steps/web/application/entries/CreateNewTravelEntrySteps.java index 2fc5c4ecd4e..6d0ba1243aa 100644 --- a/sormas-e2e-tests/src/test/java/org/sormas/e2etests/steps/web/application/entries/CreateNewTravelEntrySteps.java +++ b/sormas-e2e-tests/src/test/java/org/sormas/e2etests/steps/web/application/entries/CreateNewTravelEntrySteps.java @@ -29,6 +29,7 @@ import static org.sormas.e2etests.pages.application.contacts.EditContactPage.UUID_INPUT; import static org.sormas.e2etests.pages.application.entries.CreateNewTravelEntryPage.ARRIVAL_DATE; import static org.sormas.e2etests.pages.application.entries.CreateNewTravelEntryPage.FIRST_NAME_OF_CONTACT_PERSON_INPUT; +import static org.sormas.e2etests.pages.application.entries.CreateNewTravelEntryPage.FIRST_TRAVEL_ENTRY_ID_BUTTON; import static org.sormas.e2etests.pages.application.entries.CreateNewTravelEntryPage.LAST_NAME_OF_CONTACT_PERSON_INPUT; import static org.sormas.e2etests.pages.application.entries.CreateNewTravelEntryPage.PICK_A_EXISTING_CASE_LABEL_DE; import static org.sormas.e2etests.pages.application.entries.CreateNewTravelEntryPage.PICK_A_EXISTING_PERSON_LABEL_DE; @@ -109,6 +110,20 @@ public CreateNewTravelEntrySteps( fillPointOfEntryDetails(travelEntry.getPointOfEntryDetails()); }); + When( + "^I change a Report Date for previous week date$", + () -> { + travelEntry.getReportDate().minusDays(7); + }); + + When( + "^I open last created Travel Entry", + () -> { + webDriverHelpers.waitForPageLoadingSpinnerToDisappear(40); + webDriverHelpers.waitUntilElementIsVisibleAndClickable(FIRST_TRAVEL_ENTRY_ID_BUTTON); + webDriverHelpers.clickOnWebElementBySelector(FIRST_TRAVEL_ENTRY_ID_BUTTON); + }); + When( "^I fill the required fields in a new travel entry form without personal data$", () -> { diff --git a/sormas-e2e-tests/src/test/java/org/sormas/e2etests/steps/web/application/entries/TravelEntryDirectorySteps.java b/sormas-e2e-tests/src/test/java/org/sormas/e2etests/steps/web/application/entries/TravelEntryDirectorySteps.java index 51b87624b27..c0cbab7ba22 100644 --- a/sormas-e2e-tests/src/test/java/org/sormas/e2etests/steps/web/application/entries/TravelEntryDirectorySteps.java +++ b/sormas-e2e-tests/src/test/java/org/sormas/e2etests/steps/web/application/entries/TravelEntryDirectorySteps.java @@ -32,6 +32,7 @@ import static org.sormas.e2etests.pages.application.entries.TravelEntryPage.RECOVERED_ENTRIES; import static org.sormas.e2etests.pages.application.entries.TravelEntryPage.START_DATA_IMPORT_BUTTON; import static org.sormas.e2etests.pages.application.entries.TravelEntryPage.TRAVEL_ENTRY_AGGREGATION_COMBOBOX; +import static org.sormas.e2etests.pages.application.entries.TravelEntryPage.TRAVEL_ENTRY_DATA_FILTER_OPTION_COMBOBOX; import static org.sormas.e2etests.pages.application.entries.TravelEntryPage.TRAVEL_ENTRY_DIRECTORY_PAGE_APPLY_FILTER_BUTTON; import static org.sormas.e2etests.pages.application.entries.TravelEntryPage.TRAVEL_ENTRY_DIRECTORY_PAGE_SHOW_MORE_FILTERS_BUTTON; import static org.sormas.e2etests.pages.application.entries.TravelEntryPage.TRAVEL_ENTRY_FIRST_RECORD_IN_TABLE; @@ -105,6 +106,7 @@ public TravelEntryDirectorySteps( () -> { webDriverHelpers.fillAndSubmitInWebElement( PERSON_FILTER_INPUT, CreateNewTravelEntrySteps.aTravelEntry.getUuid()); + System.out.println("UUID: " + CreateNewTravelEntrySteps.aTravelEntry.getUuid()); }); And( "I click {string} checkbox on Travel Entry directory page", @@ -167,6 +169,16 @@ public TravelEntryDirectorySteps( formatter.format( CreateNewTravelEntrySteps.travelEntry.getReportDate().plusDays(number))); }); + + And( + "I fill Travel Entry to input to {int} days before UI Travel Entry created on Travel Entry directory page", + (Integer number) -> { + DateTimeFormatter formatter = DateTimeFormatter.ofPattern("MM/dd/yyyy"); + webDriverHelpers.fillInWebElement( + DATE_TO_COMBOBOX, + formatter.format( + CreateNewTravelEntrySteps.travelEntry.getReportDate().minusDays(number))); + }); And( "I fill Travel Entry from input to {int} days after before UI Travel Entry created on Travel Entry directory page", (Integer number) -> { @@ -180,6 +192,10 @@ public TravelEntryDirectorySteps( "I apply {string} to aggregation combobox on Travel Entry directory page", (String value) -> webDriverHelpers.selectFromCombobox(TRAVEL_ENTRY_AGGREGATION_COMBOBOX, value)); + Then( + "I apply {string} to data filter option combobox on Travel Entry directory page", + (String value) -> + webDriverHelpers.selectFromCombobox(TRAVEL_ENTRY_DATA_FILTER_OPTION_COMBOBOX, value)); When( "I click on first filtered record in Travel Entry", () -> { diff --git a/sormas-e2e-tests/src/test/resources/features/sanity/web/TravelEntryFilters.feature b/sormas-e2e-tests/src/test/resources/features/sanity/web/TravelEntryFilters.feature index f6eaf687376..449936f3b92 100644 --- a/sormas-e2e-tests/src/test/resources/features/sanity/web/TravelEntryFilters.feature +++ b/sormas-e2e-tests/src/test/resources/features/sanity/web/TravelEntryFilters.feature @@ -44,4 +44,33 @@ Scenario: Check Travel Entry filters And I check that number of displayed Travel Entry results is 1 And I fill Travel Entry from input to 3 days after before UI Travel Entry created on Travel Entry directory page And I click APPLY BUTTON in Travel Entry Directory Page - And I check that number of displayed Travel Entry results is 0 \ No newline at end of file + And I check that number of displayed Travel Entry results is 0 + + @issue=SORDEV-9787 @env_de + Scenario: Check that Add reporting period filter for Travel Entry work properly + Given I log in as a National User + And I click on the Entries button from navbar + And I click on the New Travel Entry button from Travel Entries directory + When I fill the required fields in a new travel entry form +# And I change a Report Date for previous week date + And I click on Save button from the new travel entry form + Then I check the created data is correctly displayed on Edit travel entry page for DE version + And I navigate to person tab in Edit travel entry page + And I check the created data is correctly displayed on Edit travel entry person page for DE version + And I click on the Entries button from navbar + And I filter by Person ID on Travel Entry directory page + And I open last created Travel Entry +# And I change a Report Date for previous week date -> zminic date raportu i jedzemy !!! + And I click on SHOW MORE FILTERS BUTTON Travel Entry directory page + And I fill Travel Entry from input to 2 days before UI Travel Entry created on Travel Entry directory page + And I fill Travel Entry to input to 5 days after UI Travel Entry created on Travel Entry directory page + And I click APPLY BUTTON in Travel Entry Directory Page + And I check that number of displayed Travel Entry results is 1 + And I fill Travel Entry to input to 3 days before UI Travel Entry created on Travel Entry directory page + And I click APPLY BUTTON in Travel Entry Directory Page + And I check that number of displayed Travel Entry results is 0 + And I apply "Nach Epi Woche" to data filter option combobox on Travel Entry directory page + + + + And I check the edited data is correctly displayed on Edit case page \ No newline at end of file From cc11efe928c6500545443324e9af5dfedc07896c Mon Sep 17 00:00:00 2001 From: Maciej Paszylka Date: Fri, 6 May 2022 16:04:24 +0200 Subject: [PATCH 039/167] SORDEV-9818 tests --- .../e2etests/pages/application/cases/CreateNewCasePage.java | 3 ++- .../pages/application/entries/EditTravelEntryPage.java | 3 ++- .../e2etests/pages/application/persons/EditPersonPage.java | 3 ++- .../steps/web/application/persons/EditPersonSteps.java | 5 ++--- 4 files changed, 8 insertions(+), 6 deletions(-) diff --git a/sormas-e2e-tests/src/main/java/org/sormas/e2etests/pages/application/cases/CreateNewCasePage.java b/sormas-e2e-tests/src/main/java/org/sormas/e2etests/pages/application/cases/CreateNewCasePage.java index 683141a34a7..11546030d0f 100644 --- a/sormas-e2e-tests/src/main/java/org/sormas/e2etests/pages/application/cases/CreateNewCasePage.java +++ b/sormas-e2e-tests/src/main/java/org/sormas/e2etests/pages/application/cases/CreateNewCasePage.java @@ -75,7 +75,8 @@ public class CreateNewCasePage { public static final By LAST_NAME_LIKE_INPUT = By.xpath("//div[@class= 'filters-container']//div[contains(@location, 'lastName')]//input"); public static final By PERSON_CASE_WINDOW_SEARCH_CASE_BUTTON = By.id("actionSearch"); - public static final By CREATE_A_NEW_CASE_CONFIRMATION_BUTTON = By.xpath("//*[text()='Create a new case']"); + public static final By CREATE_A_NEW_CASE_CONFIRMATION_BUTTON = + By.xpath("//*[text()='Create a new case']"); public static final By SELECT_PERSON_WINDOW_CONFIRM_BUTTON = By.xpath( "//div[contains(@class, 'popupContent')]//span[contains(text(), 'Confirm')]//ancestor::div[@id='commit']"); diff --git a/sormas-e2e-tests/src/main/java/org/sormas/e2etests/pages/application/entries/EditTravelEntryPage.java b/sormas-e2e-tests/src/main/java/org/sormas/e2etests/pages/application/entries/EditTravelEntryPage.java index e7cd4e14c71..e1f71bc8c51 100644 --- a/sormas-e2e-tests/src/main/java/org/sormas/e2etests/pages/application/entries/EditTravelEntryPage.java +++ b/sormas-e2e-tests/src/main/java/org/sormas/e2etests/pages/application/entries/EditTravelEntryPage.java @@ -35,7 +35,8 @@ public class EditTravelEntryPage { public static final By POINT_OF_ENTRY_COMBOBOX = By.cssSelector("#pointOfEntry div"); public static final By POINT_OF_ENTRY_DETAILS_INPUT = By.cssSelector("#pointOfEntryDetails"); public static final By TRAVEL_ENTRY_PERSON_TAB = By.id("tab-travelEntries-person"); - public static final By PERSON_ID_LABEL = By.xpath("//div[contains(@location,'personInformationHeadingLoc')]"); + public static final By PERSON_ID_LABEL = + By.xpath("//div[contains(@location,'personInformationHeadingLoc')]"); public static final By CREATE_CASE_FROM_TRAVEL_ENTRY = By.id("travelEntryCreateCase"); public static final By SAVE_NEW_CASE_FOR_TRAVEL_ENTRY_POPUP = By.cssSelector(".popupContent #commit"); diff --git a/sormas-e2e-tests/src/main/java/org/sormas/e2etests/pages/application/persons/EditPersonPage.java b/sormas-e2e-tests/src/main/java/org/sormas/e2etests/pages/application/persons/EditPersonPage.java index 51208f69436..5e3f94770b8 100644 --- a/sormas-e2e-tests/src/main/java/org/sormas/e2etests/pages/application/persons/EditPersonPage.java +++ b/sormas-e2e-tests/src/main/java/org/sormas/e2etests/pages/application/persons/EditPersonPage.java @@ -115,7 +115,8 @@ public class EditPersonPage { By.cssSelector("[location='personInformationHeadingLoc']"); public static final By EVENT_PARTICIPANTS_DATA_TAB = By.cssSelector("#tab-events-eventparticipants"); - public static final By NO_TRAVEL_ENTRY_LABEL_DE = By.xpath("//div[text()=\"Es gibt keine Einreisen f\u00FCr diese Person\"]"); + public static final By NO_TRAVEL_ENTRY_LABEL_DE = + By.xpath("//div[text()=\"Es gibt keine Einreisen f\u00FCr diese Person\"]"); public static By getByPersonUuid(String personUuid) { return By.cssSelector("a[title='" + personUuid + "']"); diff --git a/sormas-e2e-tests/src/test/java/org/sormas/e2etests/steps/web/application/persons/EditPersonSteps.java b/sormas-e2e-tests/src/test/java/org/sormas/e2etests/steps/web/application/persons/EditPersonSteps.java index 73faf61fd29..355e56f8bb4 100644 --- a/sormas-e2e-tests/src/test/java/org/sormas/e2etests/steps/web/application/persons/EditPersonSteps.java +++ b/sormas-e2e-tests/src/test/java/org/sormas/e2etests/steps/web/application/persons/EditPersonSteps.java @@ -53,6 +53,7 @@ import static org.sormas.e2etests.pages.application.persons.EditPersonPage.INVALID_DATA_ERROR; import static org.sormas.e2etests.pages.application.persons.EditPersonPage.LAST_NAME_INPUT; import static org.sormas.e2etests.pages.application.persons.EditPersonPage.NAMES_OF_GUARDIANS_INPUT; +import static org.sormas.e2etests.pages.application.persons.EditPersonPage.NO_TRAVEL_ENTRY_LABEL_DE; import static org.sormas.e2etests.pages.application.persons.EditPersonPage.PERSON_CONTACT_DETAILS_CONTACT_INFORMATION_INPUT; import static org.sormas.e2etests.pages.application.persons.EditPersonPage.PERSON_CONTACT_DETAILS_TYPE_OF_DETAILS_INPUT; import static org.sormas.e2etests.pages.application.persons.EditPersonPage.PHONE_FIELD; @@ -85,7 +86,6 @@ import java.util.Locale; import java.util.concurrent.TimeUnit; import javax.inject.Inject; -import org.openqa.selenium.By; import org.openqa.selenium.ElementClickInterceptedException; import org.sormas.e2etests.entities.pojo.helpers.ComparisonHelper; import org.sormas.e2etests.entities.pojo.web.Person; @@ -253,8 +253,7 @@ public EditPersonSteps( When( "I check if there is no travel entry assigned to Person", () -> { - webDriverHelpers.waitUntilElementIsVisibleAndClickable( - NO_TRAVEL_ENTRY_LABEL_DE); + webDriverHelpers.waitUntilElementIsVisibleAndClickable(NO_TRAVEL_ENTRY_LABEL_DE); }); When( "I check if event is available at person information", From 8a77b2de90f3c586fd70e34bf40e6688954b7dfc Mon Sep 17 00:00:00 2001 From: Richard <83635257+richardbartha@users.noreply.github.com> Date: Fri, 6 May 2022 16:14:53 +0200 Subject: [PATCH 040/167] #8555 add back a deleted event participant (#9087) Create automated test to verify that user can add back a deleted event participant --- .../application/events/EditEventPage.java | 1 - .../events/EventParticipantsPage.java | 22 +++ .../application/events/EditEventSteps.java | 131 +++++++++++++----- .../events/EventDirectorySteps.java | 127 ++++++++--------- .../features/sanity/web/Event.feature | 21 ++- 5 files changed, 201 insertions(+), 101 deletions(-) diff --git a/sormas-e2e-tests/src/main/java/org/sormas/e2etests/pages/application/events/EditEventPage.java b/sormas-e2e-tests/src/main/java/org/sormas/e2etests/pages/application/events/EditEventPage.java index 63003d2abd7..9bb1a9b2ea9 100644 --- a/sormas-e2e-tests/src/main/java/org/sormas/e2etests/pages/application/events/EditEventPage.java +++ b/sormas-e2e-tests/src/main/java/org/sormas/e2etests/pages/application/events/EditEventPage.java @@ -82,7 +82,6 @@ public class EditEventPage { public static final By CREATE_CONTACTS_BULK_EDIT_BUTTON = By.id("bulkActions-3"); public static final By EVENT_MANAGEMENT_STATUS_CHECK = By.cssSelector("#eventManagementStatus input:checked[type='checkbox'] ~ label"); - public static final By EVENT_CLUSTER_EDIT = By.xpath("//span[.='Cluster']"); public static final By PRIMARY_MODE_OF_TRANSMISSION_COMBOBOX = By.cssSelector("[id='diseaseTransmissionMode'] [class='v-filterselect-button']"); diff --git a/sormas-e2e-tests/src/main/java/org/sormas/e2etests/pages/application/events/EventParticipantsPage.java b/sormas-e2e-tests/src/main/java/org/sormas/e2etests/pages/application/events/EventParticipantsPage.java index 43487824cdf..fbf2010772e 100644 --- a/sormas-e2e-tests/src/main/java/org/sormas/e2etests/pages/application/events/EventParticipantsPage.java +++ b/sormas-e2e-tests/src/main/java/org/sormas/e2etests/pages/application/events/EventParticipantsPage.java @@ -43,4 +43,26 @@ public class EventParticipantsPage { public static final By EXPORT_EVENT_PARTICIPANT_CONFIGURATION_DATA_REGION_CHECKBOX = By.xpath("//label[text()='Region']"); public static final By CONFIRM_NAVIGATION_POPUP = By.id("actionConfirm"); + public static final By SEARCH_FOR_PERSON_BUTTON_IN_ADD_PARTICIPANT_POPUP_WINDOW = + By.id("personSearchLoc"); + public static final By SELECT_PERSON_ID_INPUT_AT_ADD_PARTICIPANT = + By.cssSelector("input#uuidExternalIdExternalTokenLike"); + public static final By SELECT_PERSON_SEARCH_BUTTON_AT_ADD_PARTICIPANT = By.id("actionSearch"); + public static final By SELECT_FIRST_PERSON_IN_SEARCHED_LIST_FROM_ADD_PARTICIPANT = + By.cssSelector("[scroll] [aria-live] .v-grid-body tr:nth-of-type(1)"); + public static final By PERSON_ID_IN_EVENT_PARTICIPANTS_COLUMN_HEADER = + By.cssSelector( + "th:nth-of-type(2) > .v-grid-column-default-header-content.v-grid-column-header-content"); + public static final By CASE_GRID_RESULTS_ROWS = By.cssSelector("[role=rowgroup] tr a"); + public static final By PERSON_ID_IN_EVENT_PARTICIPANTS_RESULTS_ROWS = + By.cssSelector("tr[role='row'] > td:nth-of-type(2) a"); + public static final By CONFIRM_BUTTON_FOR_SELECT_PERSON_FROM_ADD_PARTICIPANTS_WINDOW = + By.cssSelector("[scroll] [role='dialog']:nth-of-type(5) #commit"); + public static final By DELETE_EVENT_PARTICIPANT_BUTTTON = By.cssSelector("div#delete"); + public static final By CONFIRM_DELETION_OF_EVENT_PARTICIPANT = By.id("actionConfirm"); + public static final By POPUP_DISCARD_CHANGES_BUTTON = By.id("actionCancel"); + + public static final By getEventsByCaseUuid(String uuid) { + return By.cssSelector(String.format("[title = '%s']", uuid)); + } } diff --git a/sormas-e2e-tests/src/test/java/org/sormas/e2etests/steps/web/application/events/EditEventSteps.java b/sormas-e2e-tests/src/test/java/org/sormas/e2etests/steps/web/application/events/EditEventSteps.java index 87892dbcb9a..8f42ee1a431 100644 --- a/sormas-e2e-tests/src/test/java/org/sormas/e2etests/steps/web/application/events/EditEventSteps.java +++ b/sormas-e2e-tests/src/test/java/org/sormas/e2etests/steps/web/application/events/EditEventSteps.java @@ -18,6 +18,40 @@ package org.sormas.e2etests.steps.web.application.events; +import com.github.javafaker.Faker; +import cucumber.api.java8.En; +import org.sormas.e2etests.entities.pojo.helpers.ComparisonHelper; +import org.sormas.e2etests.entities.pojo.web.Event; +import org.sormas.e2etests.entities.pojo.web.EventGroup; +import org.sormas.e2etests.entities.pojo.web.EventHandout; +import org.sormas.e2etests.entities.pojo.web.EventParticipant; +import org.sormas.e2etests.entities.pojo.web.Person; +import org.sormas.e2etests.entities.services.EventDocumentService; +import org.sormas.e2etests.entities.services.EventGroupService; +import org.sormas.e2etests.entities.services.EventParticipantService; +import org.sormas.e2etests.entities.services.EventService; +import org.sormas.e2etests.enums.DistrictsValues; +import org.sormas.e2etests.enums.GenderValues; +import org.sormas.e2etests.enums.RegionsValues; +import org.sormas.e2etests.envconfig.manager.EnvironmentManager; +import org.sormas.e2etests.helpers.AssertHelpers; +import org.sormas.e2etests.helpers.WebDriverHelpers; +import org.sormas.e2etests.pages.application.events.EditEventPage; +import org.sormas.e2etests.state.ApiState; +import org.testng.Assert; +import org.testng.asserts.SoftAssert; + +import javax.inject.Inject; +import java.nio.file.Files; +import java.nio.file.Path; +import java.nio.file.Paths; +import java.time.LocalDate; +import java.time.format.DateTimeFormatter; +import java.time.format.TextStyle; +import java.util.List; +import java.util.Locale; +import java.util.concurrent.TimeUnit; + import static org.sormas.e2etests.pages.application.actions.CreateNewActionPage.NEW_ACTION_POPUP; import static org.sormas.e2etests.pages.application.cases.CaseDirectoryPage.ALL_RESULTS_CHECKBOX; import static org.sormas.e2etests.pages.application.cases.CreateNewCasePage.PERSON_SEARCH_LOCATOR_BUTTON; @@ -93,8 +127,11 @@ import static org.sormas.e2etests.pages.application.events.EventDirectoryPage.getByEventUuid; import static org.sormas.e2etests.pages.application.events.EventParticipantsPage.ADD_PARTICIPANT_BUTTON; import static org.sormas.e2etests.pages.application.events.EventParticipantsPage.APPLY_FILTERS_BUTTON; +import static org.sormas.e2etests.pages.application.events.EventParticipantsPage.CONFIRM_BUTTON_FOR_SELECT_PERSON_FROM_ADD_PARTICIPANTS_WINDOW; +import static org.sormas.e2etests.pages.application.events.EventParticipantsPage.CONFIRM_DELETION_OF_EVENT_PARTICIPANT; import static org.sormas.e2etests.pages.application.events.EventParticipantsPage.CONFIRM_NAVIGATION_POPUP; import static org.sormas.e2etests.pages.application.events.EventParticipantsPage.CREATE_NEW_PERSON_RADIO_BUTTON; +import static org.sormas.e2etests.pages.application.events.EventParticipantsPage.DELETE_EVENT_PARTICIPANT_BUTTTON; import static org.sormas.e2etests.pages.application.events.EventParticipantsPage.DISCARD_BUTTON; import static org.sormas.e2etests.pages.application.events.EventParticipantsPage.ERROR_MESSAGE_TEXT; import static org.sormas.e2etests.pages.application.events.EventParticipantsPage.EVENT_PARTICIPANTS_TAB; @@ -104,7 +141,13 @@ import static org.sormas.e2etests.pages.application.events.EventParticipantsPage.PARTICIPANT_REGION_COMBOBOX; import static org.sormas.e2etests.pages.application.events.EventParticipantsPage.PICK_OR_CREATE_PERSON_POPUP; import static org.sormas.e2etests.pages.application.events.EventParticipantsPage.PICK_OR_CREATE_POPUP_SAVE_BUTTON; +import static org.sormas.e2etests.pages.application.events.EventParticipantsPage.POPUP_DISCARD_CHANGES_BUTTON; +import static org.sormas.e2etests.pages.application.events.EventParticipantsPage.SEARCH_FOR_PERSON_BUTTON_IN_ADD_PARTICIPANT_POPUP_WINDOW; +import static org.sormas.e2etests.pages.application.events.EventParticipantsPage.SELECT_FIRST_PERSON_IN_SEARCHED_LIST_FROM_ADD_PARTICIPANT; +import static org.sormas.e2etests.pages.application.events.EventParticipantsPage.SELECT_PERSON_ID_INPUT_AT_ADD_PARTICIPANT; +import static org.sormas.e2etests.pages.application.events.EventParticipantsPage.SELECT_PERSON_SEARCH_BUTTON_AT_ADD_PARTICIPANT; import static org.sormas.e2etests.pages.application.events.EventParticipantsPage.SEX_COMBOBOX; +import static org.sormas.e2etests.pages.application.events.EventParticipantsPage.getEventsByCaseUuid; import static org.sormas.e2etests.pages.application.persons.EditPersonPage.DATE_OF_BIRTH_DAY_COMBOBOX; import static org.sormas.e2etests.pages.application.persons.EditPersonPage.DATE_OF_BIRTH_MONTH_COMBOBOX; import static org.sormas.e2etests.pages.application.persons.EditPersonPage.DATE_OF_BIRTH_YEAR_COMBOBOX; @@ -117,39 +160,6 @@ import static org.sormas.e2etests.pages.application.persons.EditPersonPage.SEE_EVENTS_FOR_PERSON; import static org.sormas.e2etests.steps.BaseSteps.locale; -import com.github.javafaker.Faker; -import cucumber.api.java8.En; -import java.nio.file.Files; -import java.nio.file.Path; -import java.nio.file.Paths; -import java.time.LocalDate; -import java.time.format.DateTimeFormatter; -import java.time.format.TextStyle; -import java.util.List; -import java.util.Locale; -import java.util.concurrent.TimeUnit; -import javax.inject.Inject; -import org.sormas.e2etests.entities.pojo.helpers.ComparisonHelper; -import org.sormas.e2etests.entities.pojo.web.Event; -import org.sormas.e2etests.entities.pojo.web.EventGroup; -import org.sormas.e2etests.entities.pojo.web.EventHandout; -import org.sormas.e2etests.entities.pojo.web.EventParticipant; -import org.sormas.e2etests.entities.pojo.web.Person; -import org.sormas.e2etests.entities.services.EventDocumentService; -import org.sormas.e2etests.entities.services.EventGroupService; -import org.sormas.e2etests.entities.services.EventParticipantService; -import org.sormas.e2etests.entities.services.EventService; -import org.sormas.e2etests.enums.DistrictsValues; -import org.sormas.e2etests.enums.GenderValues; -import org.sormas.e2etests.enums.RegionsValues; -import org.sormas.e2etests.envconfig.manager.EnvironmentManager; -import org.sormas.e2etests.helpers.AssertHelpers; -import org.sormas.e2etests.helpers.WebDriverHelpers; -import org.sormas.e2etests.pages.application.events.EditEventPage; -import org.sormas.e2etests.state.ApiState; -import org.testng.Assert; -import org.testng.asserts.SoftAssert; - public class EditEventSteps implements En { private final WebDriverHelpers webDriverHelpers; @@ -809,6 +819,61 @@ public EditEventSteps( webDriverHelpers.clickOnWebElementBySelector(SAVE_BUTTON); webDriverHelpers.waitUntilElementIsVisibleAndClickable(EVENT_DATA_SAVED_MESSAGE); }); + + When( + "^I add a participant created by API create person$", + () -> { + webDriverHelpers.clickOnWebElementBySelector(EditEventPage.EVENT_PARTICIPANTS_TAB); + webDriverHelpers.clickOnWebElementBySelector(ADD_PARTICIPANT_BUTTON); + webDriverHelpers.clickOnWebElementBySelector( + SEARCH_FOR_PERSON_BUTTON_IN_ADD_PARTICIPANT_POPUP_WINDOW); + webDriverHelpers.fillInWebElement( + SELECT_PERSON_ID_INPUT_AT_ADD_PARTICIPANT, apiState.getLastCreatedPerson().getUuid()); + webDriverHelpers.clickOnWebElementBySelector( + SELECT_PERSON_SEARCH_BUTTON_AT_ADD_PARTICIPANT); + webDriverHelpers.clickOnWebElementBySelector( + SELECT_FIRST_PERSON_IN_SEARCHED_LIST_FROM_ADD_PARTICIPANT); + webDriverHelpers.clickOnWebElementBySelector( + CONFIRM_BUTTON_FOR_SELECT_PERSON_FROM_ADD_PARTICIPANTS_WINDOW); + TimeUnit.SECONDS.sleep(1); + webDriverHelpers.clickOnWebElementBySelector(SAVE_BUTTON); + TimeUnit.SECONDS.sleep(3); + webDriverHelpers.waitForPageLoadingSpinnerToDisappear(30); + if (webDriverHelpers.isElementVisibleWithTimeout(POPUP_DISCARD_CHANGES_BUTTON, 30)) { + webDriverHelpers.clickOnWebElementBySelector(POPUP_DISCARD_CHANGES_BUTTON); + } + webDriverHelpers.waitForPageLoadingSpinnerToDisappear(30); + webDriverHelpers.clickOnWebElementBySelector(EVENT_PARTICIPANTS_TAB); + TimeUnit.SECONDS.sleep(2); + if (webDriverHelpers.isElementVisibleWithTimeout(POPUP_DISCARD_CHANGES_BUTTON, 30)) { + webDriverHelpers.clickOnWebElementBySelector(POPUP_DISCARD_CHANGES_BUTTON); + } + }); + + When( + "^I delete an event participant created by API create person$", + () -> { + webDriverHelpers.waitUntilIdentifiedElementIsVisibleAndClickable( + getEventsByCaseUuid(apiState.getLastCreatedPerson().getUuid())); + webDriverHelpers.doubleClickOnWebElementBySelector( + getEventsByCaseUuid(apiState.getLastCreatedPerson().getUuid())); + TimeUnit.SECONDS.sleep(2); + webDriverHelpers.waitForPageLoadingSpinnerToDisappear(30); + webDriverHelpers.clickOnWebElementBySelector(DELETE_EVENT_PARTICIPANT_BUTTTON); + TimeUnit.SECONDS.sleep(2); + webDriverHelpers.clickOnWebElementBySelector(CONFIRM_DELETION_OF_EVENT_PARTICIPANT); + if (webDriverHelpers.isElementVisibleWithTimeout(POPUP_DISCARD_CHANGES_BUTTON, 30)) { + webDriverHelpers.clickOnWebElementBySelector(POPUP_DISCARD_CHANGES_BUTTON); + } + }); + + When( + "^I check if participant appears in the participants list of event created with API$", + () -> { + final String personUuid = apiState.getLastCreatedPerson().getUuid(); + webDriverHelpers.clickOnWebElementBySelector(EVENT_PARTICIPANTS_TAB); + webDriverHelpers.waitUntilElementIsVisibleAndClickable(getByEventUuid(personUuid)); + }); } private Person collectPersonUuid() { diff --git a/sormas-e2e-tests/src/test/java/org/sormas/e2etests/steps/web/application/events/EventDirectorySteps.java b/sormas-e2e-tests/src/test/java/org/sormas/e2etests/steps/web/application/events/EventDirectorySteps.java index 3ba832969cd..6e3a4d728cb 100644 --- a/sormas-e2e-tests/src/test/java/org/sormas/e2etests/steps/web/application/events/EventDirectorySteps.java +++ b/sormas-e2e-tests/src/test/java/org/sormas/e2etests/steps/web/application/events/EventDirectorySteps.java @@ -18,6 +18,46 @@ package org.sormas.e2etests.steps.web.application.events; +import cucumber.api.java8.En; +import org.openqa.selenium.WebDriverException; +import org.openqa.selenium.WebElement; +import org.sormas.e2etests.common.DataOperations; +import org.sormas.e2etests.entities.pojo.helpers.ComparisonHelper; +import org.sormas.e2etests.entities.pojo.web.EventGroup; +import org.sormas.e2etests.entities.services.EventGroupService; +import org.sormas.e2etests.entities.services.EventService; +import org.sormas.e2etests.enums.CommunityValues; +import org.sormas.e2etests.enums.DiseasesValues; +import org.sormas.e2etests.enums.DistrictsValues; +import org.sormas.e2etests.enums.EventReferenceDateOptions; +import org.sormas.e2etests.enums.RegionsValues; +import org.sormas.e2etests.enums.RiskLevelValues; +import org.sormas.e2etests.enums.SourceTypeValues; +import org.sormas.e2etests.enums.cases.epidemiologicalData.TypeOfPlace; +import org.sormas.e2etests.envconfig.manager.EnvironmentManager; +import org.sormas.e2etests.helpers.AssertHelpers; +import org.sormas.e2etests.helpers.WebDriverHelpers; +import org.sormas.e2etests.pages.application.NavBarPage; +import org.sormas.e2etests.pages.application.events.EventDirectoryPage; +import org.sormas.e2etests.state.ApiState; +import org.sormas.e2etests.steps.BaseSteps; +import org.testng.Assert; +import org.testng.asserts.SoftAssert; + +import javax.inject.Inject; +import java.io.File; +import java.time.LocalDate; +import java.time.ZoneId; +import java.time.format.DateTimeFormatter; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.concurrent.ConcurrentHashMap; +import java.util.concurrent.TimeUnit; +import java.util.concurrent.atomic.AtomicInteger; + import static org.sormas.e2etests.pages.application.cases.CaseDirectoryPage.CASE_COMMUNITY_FILTER_COMBOBOX; import static org.sormas.e2etests.pages.application.cases.CaseDirectoryPage.CASE_DATA_TYPE_FILTER_COMBOBOX; import static org.sormas.e2etests.pages.application.cases.CaseDirectoryPage.CASE_DISTRICT_FILTER_COMBOBOX; @@ -99,50 +139,10 @@ import static org.sormas.e2etests.pages.application.events.EventDirectoryPage.UNLINK_EVENT_BUTTON; import static org.sormas.e2etests.pages.application.events.EventDirectoryPage.getByEventUuid; import static org.sormas.e2etests.pages.application.events.EventDirectoryPage.getCheckboxByIndex; -import static org.sormas.e2etests.pages.application.events.EventDirectoryPage.getCheckboxByUUID; import static org.sormas.e2etests.pages.application.persons.PersonDirectoryPage.APPLY_FILTERS_BUTTON; import static org.sormas.e2etests.pages.application.persons.PersonDirectoryPage.RESET_FILTERS_BUTTON; import static org.sormas.e2etests.steps.BaseSteps.locale; -import cucumber.api.java8.En; -import java.io.File; -import java.time.LocalDate; -import java.time.ZoneId; -import java.time.format.DateTimeFormatter; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.concurrent.ConcurrentHashMap; -import java.util.concurrent.TimeUnit; -import java.util.concurrent.atomic.AtomicInteger; -import javax.inject.Inject; -import org.openqa.selenium.WebDriverException; -import org.openqa.selenium.WebElement; -import org.sormas.e2etests.common.DataOperations; -import org.sormas.e2etests.entities.pojo.helpers.ComparisonHelper; -import org.sormas.e2etests.entities.pojo.web.EventGroup; -import org.sormas.e2etests.entities.services.EventGroupService; -import org.sormas.e2etests.entities.services.EventService; -import org.sormas.e2etests.enums.CommunityValues; -import org.sormas.e2etests.enums.DiseasesValues; -import org.sormas.e2etests.enums.DistrictsValues; -import org.sormas.e2etests.enums.EventReferenceDateOptions; -import org.sormas.e2etests.enums.RegionsValues; -import org.sormas.e2etests.enums.RiskLevelValues; -import org.sormas.e2etests.enums.SourceTypeValues; -import org.sormas.e2etests.enums.cases.epidemiologicalData.TypeOfPlace; -import org.sormas.e2etests.envconfig.manager.EnvironmentManager; -import org.sormas.e2etests.helpers.AssertHelpers; -import org.sormas.e2etests.helpers.WebDriverHelpers; -import org.sormas.e2etests.pages.application.NavBarPage; -import org.sormas.e2etests.pages.application.events.EventDirectoryPage; -import org.sormas.e2etests.state.ApiState; -import org.sormas.e2etests.steps.BaseSteps; -import org.testng.Assert; -import org.testng.asserts.SoftAssert; - public class EventDirectorySteps implements En { private final WebDriverHelpers webDriverHelpers; private final BaseSteps baseSteps; @@ -197,6 +197,7 @@ public EventDirectorySteps( "I click checkbox to choose all Event results on Event Directory Page", () -> { webDriverHelpers.clickOnWebElementBySelector(FIRST_CHECKBOX_EVENT_DIRECTORY); + webDriverHelpers.waitForPageLoaded(); }); When( @@ -231,6 +232,7 @@ public EventDirectorySteps( When( "I chose District option in Event Group Directory", () -> { + webDriverHelpers.waitForPageLoaded(); String district = apiState.getCreatedEvent().getEventLocation().getDistrict().getUuid(); webDriverHelpers.selectFromCombobox( EVENT_DISTRICT_COMBOBOX_INPUT, DistrictsValues.getNameValueForUuid(district)); @@ -239,6 +241,7 @@ public EventDirectorySteps( When( "I chose Community option in Event Group Directory", () -> { + webDriverHelpers.waitForPageLoaded(); String community = apiState.getCreatedEvent().getEventLocation().getCommunity().getUuid(); webDriverHelpers.selectFromCombobox( EVENT_COMMUNITY_COMBOBOX_INPUT, CommunityValues.getNameValueForUuid(community)); @@ -247,17 +250,20 @@ public EventDirectorySteps( When( "I chose Region {string} option in Event Group Directory", (String regionOption) -> { + webDriverHelpers.waitForPageLoaded(); webDriverHelpers.selectFromCombobox(EVENT_REGION_COMBOBOX_INPUT, regionOption); }); When( "I chose District {string} option in Event Group Directory", (String districtOption) -> { + webDriverHelpers.waitForPageLoaded(); webDriverHelpers.selectFromCombobox(EVENT_DISTRICT_COMBOBOX_INPUT, districtOption); }); When( "I chose Community {string} option in Event Group Directory", (String communityOption) -> { + webDriverHelpers.waitForPageLoaded(); webDriverHelpers.selectFromCombobox(EVENT_COMMUNITY_COMBOBOX_INPUT, communityOption); }); @@ -276,6 +282,7 @@ public EventDirectorySteps( searchText = "All groups"; break; } + webDriverHelpers.waitForPageLoaded(); webDriverHelpers.selectFromCombobox(EVENT_STATUS_FILTER_COMBOBOX, searchText); }); @@ -346,12 +353,14 @@ public EventDirectorySteps( .build(); ComparisonHelper.compareEqualFieldsOfEntities( collectedGroup, createdGroup, List.of("name")); + webDriverHelpers.waitForPageLoaded(); }); When( "^I click on ([^\"]*) Radiobutton on Event Directory Page$", (String buttonName) -> { webDriverHelpers.clickWebElementByText(EVENTS_RADIO_BUTTON, buttonName); + webDriverHelpers.waitForPageLoaded(); }); When( @@ -398,6 +407,7 @@ public EventDirectorySteps( "I apply {string} to combobox on Event Directory Page", (String eventParameter) -> { webDriverHelpers.selectFromCombobox(EVENT_DISPLAY_COMBOBOX, eventParameter); + webDriverHelpers.waitForPageLoaded(); }); And( "I apply Date type filter to {string} on Event directory page", @@ -469,6 +479,7 @@ public EventDirectorySteps( When( "I fill Reporting User filter to {string} on Event Directory Page", (String reportingUser) -> { + webDriverHelpers.waitForPageLoaded(); webDriverHelpers.selectFromCombobox(FILTER_BY_REPORTING_USER, reportingUser); }); And( @@ -528,6 +539,7 @@ public EventDirectorySteps( When( "I filter by last created group in Event Directory Page", () -> { + webDriverHelpers.waitForPageLoaded(); webDriverHelpers.fillInWebElement(EVENT_GROUP_INPUT, EditEventSteps.groupEvent.getUuid()); }); @@ -540,6 +552,7 @@ public EventDirectorySteps( When( "I select Signal filter from quick filter", () -> { + webDriverHelpers.waitForPageLoaded(); TimeUnit.SECONDS.sleep(5); webDriverHelpers.clickOnWebElementBySelector(EventDirectoryPage.EVENT_SIGNAL); }); @@ -547,6 +560,7 @@ public EventDirectorySteps( When( "I select Event filter from quick filter", () -> { + webDriverHelpers.waitForPageLoaded(); TimeUnit.SECONDS.sleep(5); webDriverHelpers.clickOnWebElementBySelector(EventDirectoryPage.EVENT_EVENT); }); @@ -554,6 +568,7 @@ public EventDirectorySteps( When( "I select Screening filter from quick filter", () -> { + webDriverHelpers.waitForPageLoaded(); TimeUnit.SECONDS.sleep(5); webDriverHelpers.clickOnWebElementBySelector(EventDirectoryPage.EVENT_SCREENING); }); @@ -561,6 +576,7 @@ public EventDirectorySteps( When( "I select Cluster filter from quick filter", () -> { + webDriverHelpers.waitForPageLoaded(); TimeUnit.SECONDS.sleep(5); webDriverHelpers.clickOnWebElementBySelector(EventDirectoryPage.EVENT_CLUSTER); }); @@ -568,6 +584,7 @@ public EventDirectorySteps( When( "I select Dropped filter from quick filter", () -> { + webDriverHelpers.waitForPageLoaded(); TimeUnit.SECONDS.sleep(5); webDriverHelpers.clickOnWebElementBySelector(EventDirectoryPage.EVENT_DROPPED); }); @@ -643,6 +660,7 @@ public EventDirectorySteps( When( "I select Report Date among Event Reference Date options", () -> { + webDriverHelpers.waitForPageLoaded(); webDriverHelpers.selectFromCombobox( DATE_TYPE_COMBOBOX, EventReferenceDateOptions.REPORT_DATE.toString()); }); @@ -650,6 +668,7 @@ public EventDirectorySteps( When( "I fill in a date range in Date of Event From Epi Week and ...To fields", () -> { + webDriverHelpers.waitForPageLoaded(); eventService.timeRange = buildTimeRange(); webDriverHelpers.fillInWebElement( DATE_FROM_COMBOBOX, @@ -668,6 +687,7 @@ public EventDirectorySteps( When( "I check that the dates of displayed Event results are correct", () -> { + webDriverHelpers.waitForPageLoaded(); List> tableRowsData = getTableRowsData(); for (int i = 0; i < tableRowsData.size(); i++) { String dateCell = @@ -734,13 +754,6 @@ public EventDirectorySteps( webDriverHelpers.waitUntilElementIsVisibleAndClickable(getByEventUuid(personUuid)); }); - When( - "I check if filtered participant for existing person appears in the event participants list", - () -> { - final String personUuid = apiState.getLastCreatedPerson().getUuid(); - webDriverHelpers.waitUntilElementIsVisibleAndClickable(getByEventUuid(personUuid)); - }); - When( "I click on the first row from event participant", () -> { @@ -800,25 +813,6 @@ public EventDirectorySteps( eventManagementStatus, "Event Management status is not correct")); }); - When( - "^I select last created API result in grid in Event Directory for Bulk Action$", - () -> { - webDriverHelpers.waitForPageLoadingSpinnerToDisappear(40); - webDriverHelpers.scrollToElement(getCheckboxByUUID(apiState.getCreatedEvent().getUuid())); - webDriverHelpers.clickOnWebElementBySelector( - getCheckboxByUUID(apiState.getCreatedEvent().getUuid())); - webDriverHelpers.waitForPageLoadingSpinnerToDisappear(40); - }); - When( - "^I select last created UI result in grid in Event Directory for Bulk Action$", - () -> { - webDriverHelpers.waitForPageLoadingSpinnerToDisappear(40); - webDriverHelpers.scrollToElement( - getCheckboxByUUID(CreateNewEventSteps.newEvent.getUuid())); - webDriverHelpers.clickOnWebElementBySelector( - getCheckboxByUUID(CreateNewEventSteps.newEvent.getUuid())); - webDriverHelpers.waitForPageLoadingSpinnerToDisappear(40); - }); When( "I click on the More button on Event directory page", @@ -827,6 +821,7 @@ public EventDirectorySteps( "I click Enter Bulk Edit Mode on Event directory page", () -> { webDriverHelpers.clickOnWebElementBySelector(ENTER_BULK_EDIT_MODE_EVENT_DIRECTORY); + webDriverHelpers.waitForPageLoaded(); }); When( "I click on the created event participant from the list", diff --git a/sormas-e2e-tests/src/test/resources/features/sanity/web/Event.feature b/sormas-e2e-tests/src/test/resources/features/sanity/web/Event.feature index 1cbd39974ae..510694280de 100644 --- a/sormas-e2e-tests/src/test/resources/features/sanity/web/Event.feature +++ b/sormas-e2e-tests/src/test/resources/features/sanity/web/Event.feature @@ -581,4 +581,23 @@ Feature: Create events Then I check if filtered participant for existing person appears in the event participants list When I click on the Persons button from navbar And I open the last created Person via API - And I check that SEE EVENTS FOR THIS PERSON button appears on Edit Person page \ No newline at end of file + And I check that SEE EVENTS FOR THIS PERSON button appears on Edit Person page + + @env_main @#8555 + Scenario: Add back a person to an event who was previously deleted as event participant + Given API: I create a new person + And API: I check that POST call body is "OK" + And API: I check that POST call status code is 200 + Given API: I create a new case + Then API: I check that POST call body is "OK" + And API: I check that POST call status code is 200 + Given API: I create a new event + Then API: I check that POST call body is "OK" + And API: I check that POST call status code is 200 + Given I log in with National User + When I am accessing the event tab using the created event via api + Then I add a participant created by API create person + Then I check if participant appears in the participants list of event created with API + Then I delete an event participant created by API create person + Then I add a participant created by API create person + Then I check if participant appears in the participants list of event created with API \ No newline at end of file From c48109348f738db95bca7b713eda0cc8ed920321 Mon Sep 17 00:00:00 2001 From: Richard <83635257+richardbartha@users.noreply.github.com> Date: Fri, 6 May 2022 16:53:47 +0200 Subject: [PATCH 041/167] =?UTF-8?q?#8399=20Create=20automated=20tests=20to?= =?UTF-8?q?=20cover=20About=20section=20and=20all=20main=20impo=E2=80=A6?= =?UTF-8?q?=20(#9033)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit #8399 Create automated tests to cover About section and all main important redirects --- .../e2etests/pages/application/AboutPage.java | 14 ++ .../e2etests/helpers/WebDriverHelpers.java | 57 ++++++-- .../web/application/AboutDirectorySteps.java | 126 ++++++++++++++++-- .../features/sanity/web/About.feature | 15 ++- 4 files changed, 186 insertions(+), 26 deletions(-) diff --git a/sormas-e2e-tests/src/main/java/org/sormas/e2etests/pages/application/AboutPage.java b/sormas-e2e-tests/src/main/java/org/sormas/e2etests/pages/application/AboutPage.java index b48fcd31c4c..d50a4fa88fb 100644 --- a/sormas-e2e-tests/src/main/java/org/sormas/e2etests/pages/application/AboutPage.java +++ b/sormas-e2e-tests/src/main/java/org/sormas/e2etests/pages/application/AboutPage.java @@ -6,4 +6,18 @@ public class AboutPage { public static final By DATA_DICTIONARY_BUTTON = By.id("aboutDataDictionary"); public static final By SORMAS_VERSION_HYPERLINK = By.xpath("//div[@class='v-link v-widget vspace-3 v-link-vspace-3']//span"); + public static final By CASE_CLASSIFICATION_RULES_HYPERLINK = + By.id("aboutCaseClassificationRules"); + public static final By SORMAS_VERSION_LINK = + By.cssSelector("[class='v-link v-widget vspace-3 v-link-vspace-3'] span"); + public static final By SORMAS_VERSION_HYPERLINK_TARGET = + By.cssSelector("[class='v-link v-widget vspace-3 v-link-vspace-3'] a"); + public static final By WHATS_NEW_HYPERLINK = + By.cssSelector(".v-vertical .v-slot:nth-of-type(4) span"); + public static final By OFFICIAL_SORMAS_WEBSITE_HYPERLINK = + By.cssSelector(".v-vertical .v-slot:nth-of-type(5) span"); + public static final By SORMAS_GITHUB_HYPERLINK = + By.cssSelector(".v-vertical .v-slot:nth-of-type(6) span"); + public static final By FULL_CHANGELOG_HYPERLINK = + By.cssSelector(".v-vertical .v-slot:nth-of-type(7) span"); } diff --git a/sormas-e2e-tests/src/test/java/org/sormas/e2etests/helpers/WebDriverHelpers.java b/sormas-e2e-tests/src/test/java/org/sormas/e2etests/helpers/WebDriverHelpers.java index 6217fe18a75..6b88cd2e3b3 100755 --- a/sormas-e2e-tests/src/test/java/org/sormas/e2etests/helpers/WebDriverHelpers.java +++ b/sormas-e2e-tests/src/test/java/org/sormas/e2etests/helpers/WebDriverHelpers.java @@ -15,18 +15,6 @@ package org.sormas.e2etests.helpers; -import static com.google.common.truth.Truth.assertWithMessage; -import static java.time.Duration.ofSeconds; -import static org.awaitility.Awaitility.await; -import static org.awaitility.Durations.ONE_HUNDRED_MILLISECONDS; - -import java.time.Instant; -import java.time.temporal.ChronoUnit; -import java.util.List; -import java.util.concurrent.TimeUnit; -import java.util.function.Predicate; -import java.util.stream.Collectors; -import javax.inject.Inject; import lombok.SneakyThrows; import lombok.extern.slf4j.Slf4j; import org.awaitility.core.ConditionTimeoutException; @@ -44,6 +32,21 @@ import org.sormas.e2etests.steps.BaseSteps; import org.testng.Assert; +import javax.inject.Inject; +import java.time.Instant; +import java.time.temporal.ChronoUnit; +import java.util.ArrayList; +import java.util.List; +import java.util.Set; +import java.util.concurrent.TimeUnit; +import java.util.function.Predicate; +import java.util.stream.Collectors; + +import static com.google.common.truth.Truth.assertWithMessage; +import static java.time.Duration.ofSeconds; +import static org.awaitility.Awaitility.await; +import static org.awaitility.Durations.ONE_HUNDRED_MILLISECONDS; + @Slf4j public class WebDriverHelpers { @@ -917,4 +920,34 @@ public String javascriptGetElementContent(String selector) { String content = javascriptExecutor.executeScript(script).toString(); return content; } + + public String returnURL() { + return baseSteps.getDriver().getCurrentUrl(); + } + + public void switchToOtherWindow() { + String parent = baseSteps.getDriver().getWindowHandle(); + Set S = baseSteps.getDriver().getWindowHandles(); + if (S.size() > 1) { + for (String actual : S) { + if (!actual.equalsIgnoreCase(parent)) { + baseSteps.getDriver().switchTo().window(actual); + break; + } + } + } else { + throw new NotFoundException("Cannot switch window because only one is available!"); + } + } + + public void closeActiveWindow() { + var tabs = new ArrayList<>(baseSteps.getDriver().getWindowHandles()); + if (tabs.size() > 1) { + baseSteps.getDriver().close(); + baseSteps.getDriver().switchTo().window(tabs.get(0)); + } else { + throw new NotFoundException( + "Cannot close active window and switch to parent window because only one is available!"); + } + } } diff --git a/sormas-e2e-tests/src/test/java/org/sormas/e2etests/steps/web/application/AboutDirectorySteps.java b/sormas-e2e-tests/src/test/java/org/sormas/e2etests/steps/web/application/AboutDirectorySteps.java index 20cde4db4fa..ad1d67bc37c 100644 --- a/sormas-e2e-tests/src/test/java/org/sormas/e2etests/steps/web/application/AboutDirectorySteps.java +++ b/sormas-e2e-tests/src/test/java/org/sormas/e2etests/steps/web/application/AboutDirectorySteps.java @@ -1,21 +1,8 @@ package org.sormas.e2etests.steps.web.application; -import static org.sormas.e2etests.pages.application.AboutPage.DATA_DICTIONARY_BUTTON; -import static org.sormas.e2etests.pages.application.AboutPage.SORMAS_VERSION_HYPERLINK; -import static org.sormas.e2etests.pages.application.users.CreateNewUserPage.LANGUAGE_COMBOBOX; -import static org.sormas.e2etests.pages.application.users.CreateNewUserPage.SAVE_BUTTON; - import com.detectlanguage.DetectLanguage; import com.google.inject.Inject; import cucumber.api.java8.En; -import java.io.File; -import java.io.FileInputStream; -import java.io.IOException; -import java.time.LocalDate; -import java.util.ArrayList; -import java.util.Iterator; -import java.util.List; -import java.util.concurrent.TimeUnit; import org.apache.poi.ss.usermodel.Cell; import org.apache.poi.ss.usermodel.CellType; import org.apache.poi.ss.usermodel.Row; @@ -28,6 +15,27 @@ import org.sormas.e2etests.helpers.WebDriverHelpers; import org.testng.asserts.SoftAssert; +import java.io.File; +import java.io.FileInputStream; +import java.io.IOException; +import java.time.LocalDate; +import java.util.ArrayList; +import java.util.Iterator; +import java.util.List; +import java.util.concurrent.TimeUnit; + +import static org.sormas.e2etests.pages.application.AboutPage.CASE_CLASSIFICATION_RULES_HYPERLINK; +import static org.sormas.e2etests.pages.application.AboutPage.DATA_DICTIONARY_BUTTON; +import static org.sormas.e2etests.pages.application.AboutPage.FULL_CHANGELOG_HYPERLINK; +import static org.sormas.e2etests.pages.application.AboutPage.OFFICIAL_SORMAS_WEBSITE_HYPERLINK; +import static org.sormas.e2etests.pages.application.AboutPage.SORMAS_GITHUB_HYPERLINK; +import static org.sormas.e2etests.pages.application.AboutPage.SORMAS_VERSION_HYPERLINK; +import static org.sormas.e2etests.pages.application.AboutPage.SORMAS_VERSION_HYPERLINK_TARGET; +import static org.sormas.e2etests.pages.application.AboutPage.SORMAS_VERSION_LINK; +import static org.sormas.e2etests.pages.application.AboutPage.WHATS_NEW_HYPERLINK; +import static org.sormas.e2etests.pages.application.users.CreateNewUserPage.LANGUAGE_COMBOBOX; +import static org.sormas.e2etests.pages.application.users.CreateNewUserPage.SAVE_BUTTON; + public class AboutDirectorySteps implements En { public static final String userDirPath = System.getProperty("user.dir"); public static final List xlsxFileContentList = new ArrayList<>(); @@ -131,6 +139,98 @@ public AboutDirectorySteps(WebDriverHelpers webDriverHelpers, SoftAssert softly) + "_.xlsx"); toDelete.deleteOnExit(); }); + When( + "^I click on Sormas version in About directory and i get redirected to github$", + () -> { + webDriverHelpers.waitUntilElementIsVisibleAndClickable(SORMAS_VERSION_LINK); + webDriverHelpers.clickOnWebElementBySelector(SORMAS_VERSION_LINK); + TimeUnit.SECONDS.sleep(1); + String link = + webDriverHelpers.getAttributeFromWebElement(SORMAS_VERSION_HYPERLINK_TARGET, "href"); + webDriverHelpers.switchToOtherWindow(); + softly.assertEquals( + link, webDriverHelpers.returnURL(), "Sormas version link is not the correct"); + softly.assertAll(); + webDriverHelpers.closeActiveWindow(); + }); + + When( + "^I click on What's new in About directory and i get redirected to Sormas what's new page$", + () -> { + webDriverHelpers.waitUntilElementIsVisibleAndClickable(WHATS_NEW_HYPERLINK); + webDriverHelpers.clickOnWebElementBySelector(WHATS_NEW_HYPERLINK); + TimeUnit.SECONDS.sleep(1); + webDriverHelpers.switchToOtherWindow(); + softly.assertTrue( + webDriverHelpers + .returnURL() + .contains("https://github.com/hzi-braunschweig/SORMAS-Project/releases/tag"), + "What's new link is not the correct"); + softly.assertAll(); + webDriverHelpers.closeActiveWindow(); + }); + When( + "^I click on Official SORMAS Website in About directory and i get redirected to the offical Sormas website$", + () -> { + webDriverHelpers.waitUntilElementIsVisibleAndClickable(OFFICIAL_SORMAS_WEBSITE_HYPERLINK); + webDriverHelpers.clickOnWebElementBySelector(OFFICIAL_SORMAS_WEBSITE_HYPERLINK); + TimeUnit.SECONDS.sleep(1); + webDriverHelpers.switchToOtherWindow(); + softly.assertEquals( + "https://sormas.org/", + webDriverHelpers.returnURL(), + "Official sormas website link is not correct"); + softly.assertAll(); + webDriverHelpers.closeActiveWindow(); + }); + When( + "^I click on SORMAS Github in About directory and i get redirected to github page of sormas$", + () -> { + webDriverHelpers.waitUntilElementIsVisibleAndClickable(SORMAS_GITHUB_HYPERLINK); + webDriverHelpers.clickOnWebElementBySelector(SORMAS_GITHUB_HYPERLINK); + TimeUnit.SECONDS.sleep(1); + webDriverHelpers.switchToOtherWindow(); + softly.assertEquals( + "https://github.com/hzi-braunschweig/SORMAS-Project", + webDriverHelpers.returnURL(), + "Sormas github link is not correct"); + softly.assertAll(); + webDriverHelpers.closeActiveWindow(); + }); + When( + "^I click on Full Changelog in About directory and i get redirected to github project release page of sormas$", + () -> { + webDriverHelpers.waitUntilElementIsVisibleAndClickable(FULL_CHANGELOG_HYPERLINK); + webDriverHelpers.clickOnWebElementBySelector(FULL_CHANGELOG_HYPERLINK); + TimeUnit.SECONDS.sleep(1); + webDriverHelpers.switchToOtherWindow(); + softly.assertEquals( + "https://github.com/hzi-braunschweig/SORMAS-Project/releases", + webDriverHelpers.returnURL(), + "Sormas full changelog link is not correct"); + softly.assertAll(); + webDriverHelpers.closeActiveWindow(); + }); + When( + "^I click on Case Classification Rules hyperlink and download HTML file in About directory$", + () -> { + webDriverHelpers.clickOnWebElementBySelector(CASE_CLASSIFICATION_RULES_HYPERLINK); + webDriverHelpers.waitUntilIdentifiedElementIsVisibleAndClickable( + CASE_CLASSIFICATION_RULES_HYPERLINK, 50); + }); + When( + "^I delete the downloaded Case Classification Rules html and Data Dictionary xlsx file from download directory$", + () -> { + File html = new File(userDirPath + "//downloads//classification_rules.html"); + File xlsx = + new File( + userDirPath + + "//downloads//sormas_data_dictionary_" + + LocalDate.now() + + "_.xlsx"); + html.deleteOnExit(); + xlsx.deleteOnExit(); + }); } private static void readXlsxFile() { diff --git a/sormas-e2e-tests/src/test/resources/features/sanity/web/About.feature b/sormas-e2e-tests/src/test/resources/features/sanity/web/About.feature index 7511768eefb..e6642d81e56 100644 --- a/sormas-e2e-tests/src/test/resources/features/sanity/web/About.feature +++ b/sormas-e2e-tests/src/test/resources/features/sanity/web/About.feature @@ -18,4 +18,17 @@ Feature: About end to end tests Scenario: Check current Sormas version is show Given I log in with National User And I click on the About button from navbar - Then I check that current Sormas version is shown on About directory page \ No newline at end of file + Then I check that current Sormas version is shown on About directory page + + @env_main @#8399 + Scenario: Check all main important redirects in About section + Given I log in with National User + Then I click on the About button from navbar + Then I click on Sormas version in About directory and i get redirected to github + Then I click on What's new in About directory and i get redirected to Sormas what's new page + Then I click on Official SORMAS Website in About directory and i get redirected to the offical Sormas website + Then I click on SORMAS Github in About directory and i get redirected to github page of sormas + Then I click on Full Changelog in About directory and i get redirected to github project release page of sormas + Then I click on Case Classification Rules hyperlink and download HTML file in About directory + Then I click on Data Dictionary hyperlink and download XLSX file in About directory + Then I delete the downloaded Case Classification Rules html and Data Dictionary xlsx file from download directory \ No newline at end of file From 94b92bbff8c7cb9506e9b2ddc72138e9acc6e722 Mon Sep 17 00:00:00 2001 From: Razvan Date: Fri, 6 May 2022 19:28:42 +0300 Subject: [PATCH 042/167] #9043-RefactorEnvironmentUUIDsUsage : refactored environment manager --- .../org/sormas/e2etests/common/CommonModule.java | 6 +++--- ...nmentManager.java => RunningConfiguration.java} | 4 ++-- .../entities/services/api/CaseApiService.java | 12 ++++++------ .../entities/services/api/ContactApiService.java | 12 ++++++------ .../entities/services/api/EventApiService.java | 10 +++++----- .../services/api/ImmunizationApiService.java | 10 +++++----- .../entities/services/api/SampleApiService.java | 10 +++++----- .../sormas/e2etests/helpers/RestAssuredClient.java | 14 +++++++------- .../e2etests/steps/web/application/LoginSteps.java | 14 +++++++------- .../cases/CaseDetailedTableViewSteps.java | 6 +++--- .../web/application/cases/CaseDirectorySteps.java | 6 +++--- .../steps/web/application/cases/EditCaseSteps.java | 8 ++++---- .../web/application/cases/EditContactsSteps.java | 6 +++--- .../cases/EpidemiologicalDataCaseSteps.java | 6 +++--- .../application/cases/HospitalizationTabSteps.java | 6 +++--- .../web/application/cases/SymptomsTabSteps.java | 6 +++--- .../contacts/ContactDirectorySteps.java | 8 ++++---- .../contacts/ContactsDetailedTableViewSteps.java | 6 +++--- .../contacts/ExposureInContactEpiDataSteps.java | 6 +++--- .../contacts/FollowUpVisitsTabSteps.java | 6 +++--- .../entries/TravelEntryDirectorySteps.java | 4 ++-- .../web/application/events/EditEventSteps.java | 8 ++++---- .../application/events/EventDirectorySteps.java | 10 +++++----- .../web/application/persons/EditPersonSteps.java | 6 +++--- .../application/persons/PersonDirectorySteps.java | 8 ++++---- .../web/application/samples/EditSampleSteps.java | 6 +++--- .../application/samples/SamplesDirectorySteps.java | 6 +++--- 27 files changed, 105 insertions(+), 105 deletions(-) rename sormas-e2e-tests/src/main/java/org/sormas/e2etests/envconfig/manager/{EnvironmentManager.java => RunningConfiguration.java} (98%) diff --git a/sormas-e2e-tests/src/main/java/org/sormas/e2etests/common/CommonModule.java b/sormas-e2e-tests/src/main/java/org/sormas/e2etests/common/CommonModule.java index 0a96eca1317..ad42e90a87d 100644 --- a/sormas-e2e-tests/src/main/java/org/sormas/e2etests/common/CommonModule.java +++ b/sormas-e2e-tests/src/main/java/org/sormas/e2etests/common/CommonModule.java @@ -31,7 +31,7 @@ import java.util.Properties; import javax.inject.Singleton; import lombok.SneakyThrows; -import org.sormas.e2etests.envconfig.manager.EnvironmentManager; +import org.sormas.e2etests.envconfig.manager.RunningConfiguration; import org.sormas.e2etests.webdriver.DriverManager; import org.testng.asserts.SoftAssert; @@ -53,8 +53,8 @@ Faker provideFaker() { @Provides @Singleton @Exposed - EnvironmentManager provideEnvManager() { - return new EnvironmentManager(); + RunningConfiguration provideEnvManager() { + return new RunningConfiguration(); } @Provides diff --git a/sormas-e2e-tests/src/main/java/org/sormas/e2etests/envconfig/manager/EnvironmentManager.java b/sormas-e2e-tests/src/main/java/org/sormas/e2etests/envconfig/manager/RunningConfiguration.java similarity index 98% rename from sormas-e2e-tests/src/main/java/org/sormas/e2etests/envconfig/manager/EnvironmentManager.java rename to sormas-e2e-tests/src/main/java/org/sormas/e2etests/envconfig/manager/RunningConfiguration.java index 76a6cc13ffe..c0664445671 100644 --- a/sormas-e2e-tests/src/main/java/org/sormas/e2etests/envconfig/manager/EnvironmentManager.java +++ b/sormas-e2e-tests/src/main/java/org/sormas/e2etests/envconfig/manager/RunningConfiguration.java @@ -28,14 +28,14 @@ import org.testng.Assert; @Slf4j -public class EnvironmentManager { +public class RunningConfiguration { private ObjectMapper objectMapper; private static Environments environments; private static boolean wasJsonChecked; @SneakyThrows - public EnvironmentManager() { + public RunningConfiguration() { objectMapper = new ObjectMapper(); environments = objectMapper.readValue(ConfigFileReader.getConfigurationFile(), Environments.class); diff --git a/sormas-e2e-tests/src/test/java/org/sormas/e2etests/entities/services/api/CaseApiService.java b/sormas-e2e-tests/src/test/java/org/sormas/e2etests/entities/services/api/CaseApiService.java index 0cef1a9f362..72415711f47 100644 --- a/sormas-e2e-tests/src/test/java/org/sormas/e2etests/entities/services/api/CaseApiService.java +++ b/sormas-e2e-tests/src/test/java/org/sormas/e2etests/entities/services/api/CaseApiService.java @@ -31,15 +31,15 @@ import org.sormas.e2etests.enums.DistrictsValues; import org.sormas.e2etests.enums.RegionsValues; import org.sormas.e2etests.enums.UserRoles; -import org.sormas.e2etests.envconfig.manager.EnvironmentManager; +import org.sormas.e2etests.envconfig.manager.RunningConfiguration; public class CaseApiService { - private static EnvironmentManager environmentManager; + private static RunningConfiguration runningConfiguration; @Inject - public CaseApiService(EnvironmentManager environmentManager) { - this.environmentManager = environmentManager; + public CaseApiService(RunningConfiguration runningConfiguration) { + this.runningConfiguration = runningConfiguration; } public Case buildGeneratedCase(Person person) { @@ -52,7 +52,7 @@ public Case buildGeneratedCase(Person person) { .reportingUser( ReportingUser.builder() .uuid( - environmentManager + runningConfiguration .getUserByRole(locale, UserRoles.RestUser.getRole()) .getUuid()) .build()) @@ -117,7 +117,7 @@ public Case buildGeneratedCase(Person person) { .surveillanceOfficer( SurveillanceOfficer.builder() .uuid( - environmentManager + runningConfiguration .getUserByRole(locale, UserRoles.SurveillanceOfficer.getRole()) .getUuid()) .build()) diff --git a/sormas-e2e-tests/src/test/java/org/sormas/e2etests/entities/services/api/ContactApiService.java b/sormas-e2e-tests/src/test/java/org/sormas/e2etests/entities/services/api/ContactApiService.java index 767942c83d1..ed060a5e915 100644 --- a/sormas-e2e-tests/src/test/java/org/sormas/e2etests/entities/services/api/ContactApiService.java +++ b/sormas-e2e-tests/src/test/java/org/sormas/e2etests/entities/services/api/ContactApiService.java @@ -35,18 +35,18 @@ import org.sormas.e2etests.enums.DistrictsValues; import org.sormas.e2etests.enums.RegionsValues; import org.sormas.e2etests.enums.UserRoles; -import org.sormas.e2etests.envconfig.manager.EnvironmentManager; +import org.sormas.e2etests.envconfig.manager.RunningConfiguration; public class ContactApiService { private static PersonApiService personApiService; - private static EnvironmentManager environmentManager; + private static RunningConfiguration runningConfiguration; @Inject public ContactApiService( - PersonApiService personApiService, EnvironmentManager environmentManager) { + PersonApiService personApiService, RunningConfiguration runningConfiguration) { this.personApiService = personApiService; - this.environmentManager = environmentManager; + this.runningConfiguration = runningConfiguration; } public Contact buildGeneratedContact(Person person) { @@ -57,7 +57,7 @@ public Contact buildGeneratedContact(Person person) { .reportingUser( ReportingUser.builder() .uuid( - environmentManager + runningConfiguration .getUserByRole(locale, UserRoles.RestUser.getRole()) .getUuid()) .build()) @@ -98,7 +98,7 @@ public Contact buildGeneratedContactWithLinkedCase(Person person, Case caze) { .reportingUser( ReportingUser.builder() .uuid( - environmentManager + runningConfiguration .getUserByRole(locale, UserRoles.RestUser.getRole()) .getUuid()) .build()) diff --git a/sormas-e2e-tests/src/test/java/org/sormas/e2etests/entities/services/api/EventApiService.java b/sormas-e2e-tests/src/test/java/org/sormas/e2etests/entities/services/api/EventApiService.java index 9b7695ba456..c104516217c 100644 --- a/sormas-e2e-tests/src/test/java/org/sormas/e2etests/entities/services/api/EventApiService.java +++ b/sormas-e2e-tests/src/test/java/org/sormas/e2etests/entities/services/api/EventApiService.java @@ -37,15 +37,15 @@ import org.sormas.e2etests.enums.RegionsValues; import org.sormas.e2etests.enums.SourceTypeValues; import org.sormas.e2etests.enums.UserRoles; -import org.sormas.e2etests.envconfig.manager.EnvironmentManager; +import org.sormas.e2etests.envconfig.manager.RunningConfiguration; public class EventApiService { - EnvironmentManager environmentManager; + RunningConfiguration runningConfiguration; private final Faker faker; @Inject - public EventApiService(EnvironmentManager environmentManager, Faker faker) { - this.environmentManager = environmentManager; + public EventApiService(RunningConfiguration runningConfiguration, Faker faker) { + this.runningConfiguration = runningConfiguration; this.faker = faker; } @@ -60,7 +60,7 @@ public Event buildGeneratedEvent() { .reportingUser( ReportingUser.builder() .uuid( - environmentManager + runningConfiguration .getUserByRole(locale, UserRoles.RestUser.getRole()) .getUuid()) .build()) diff --git a/sormas-e2e-tests/src/test/java/org/sormas/e2etests/entities/services/api/ImmunizationApiService.java b/sormas-e2e-tests/src/test/java/org/sormas/e2etests/entities/services/api/ImmunizationApiService.java index 0f7092ae4c4..60fdd9451cc 100644 --- a/sormas-e2e-tests/src/test/java/org/sormas/e2etests/entities/services/api/ImmunizationApiService.java +++ b/sormas-e2e-tests/src/test/java/org/sormas/e2etests/entities/services/api/ImmunizationApiService.java @@ -34,18 +34,18 @@ import org.sormas.e2etests.enums.immunizations.ImmunizationManagementStatusValues; import org.sormas.e2etests.enums.immunizations.MeansOfImmunizationValues; import org.sormas.e2etests.enums.immunizations.StatusValues; -import org.sormas.e2etests.envconfig.manager.EnvironmentManager; +import org.sormas.e2etests.envconfig.manager.RunningConfiguration; import org.sormas.e2etests.steps.BaseSteps; public class ImmunizationApiService { private final Faker faker; - private static EnvironmentManager environmentManager; + private static RunningConfiguration runningConfiguration; @Inject public ImmunizationApiService( - Faker faker, BaseSteps baseSteps, EnvironmentManager environmentManager) { + Faker faker, BaseSteps baseSteps, RunningConfiguration runningConfiguration) { this.faker = faker; - this.environmentManager = environmentManager; + this.runningConfiguration = runningConfiguration; } public Immunization buildGeneratedImmunizationForPerson(Person person) { @@ -61,7 +61,7 @@ public Immunization buildGeneratedImmunizationForPerson(Person person) { .endDate(Calendar.getInstance().getTimeInMillis()) .externalId(faker.number().digits(9)) .reportingUser( - environmentManager.getUserByRole(locale, UserRoles.NationalUser.getRole()).getUuid()) + runningConfiguration.getUserByRole(locale, UserRoles.NationalUser.getRole()).getUuid()) .archived(false) .disease(DiseasesValues.getRandomDiseaseName()) .immunizationStatus(StatusValues.getRandomImmunizationStatus()) diff --git a/sormas-e2e-tests/src/test/java/org/sormas/e2etests/entities/services/api/SampleApiService.java b/sormas-e2e-tests/src/test/java/org/sormas/e2etests/entities/services/api/SampleApiService.java index 08601f5ba83..43f7a716a3b 100644 --- a/sormas-e2e-tests/src/test/java/org/sormas/e2etests/entities/services/api/SampleApiService.java +++ b/sormas-e2e-tests/src/test/java/org/sormas/e2etests/entities/services/api/SampleApiService.java @@ -29,14 +29,14 @@ import org.sormas.e2etests.entities.pojo.api.ReportingUser; import org.sormas.e2etests.entities.pojo.api.Sample; import org.sormas.e2etests.enums.UserRoles; -import org.sormas.e2etests.envconfig.manager.EnvironmentManager; +import org.sormas.e2etests.envconfig.manager.RunningConfiguration; public class SampleApiService { - EnvironmentManager environmentManager; + RunningConfiguration runningConfiguration; @Inject - public SampleApiService(EnvironmentManager environmentManager) { - this.environmentManager = environmentManager; + public SampleApiService(RunningConfiguration runningConfiguration) { + this.runningConfiguration = runningConfiguration; } public Sample buildGeneratedSample(Case caze) { @@ -45,7 +45,7 @@ public Sample buildGeneratedSample(Case caze) { .reportingUser( ReportingUser.builder() .uuid( - environmentManager + runningConfiguration .getUserByRole(locale, UserRoles.RestUser.getRole()) .getUuid()) .build()) diff --git a/sormas-e2e-tests/src/test/java/org/sormas/e2etests/helpers/RestAssuredClient.java b/sormas-e2e-tests/src/test/java/org/sormas/e2etests/helpers/RestAssuredClient.java index 1dbe4e5aca5..749920941d3 100644 --- a/sormas-e2e-tests/src/test/java/org/sormas/e2etests/helpers/RestAssuredClient.java +++ b/sormas-e2e-tests/src/test/java/org/sormas/e2etests/helpers/RestAssuredClient.java @@ -36,30 +36,30 @@ import lombok.extern.slf4j.Slf4j; import org.sormas.e2etests.entities.pojo.api.Request; import org.sormas.e2etests.enums.UserRoles; -import org.sormas.e2etests.envconfig.manager.EnvironmentManager; +import org.sormas.e2etests.envconfig.manager.RunningConfiguration; import org.sormas.e2etests.state.ApiState; @Slf4j public class RestAssuredClient { private RequestSpecification requestSpecification; private final ApiState apiState; - private final EnvironmentManager environmentManager; + private final RunningConfiguration runningConfiguration; private final boolean logRestAssuredInfo; @Inject public RestAssuredClient( - EnvironmentManager environmentManager, + RunningConfiguration runningConfiguration, @Named("LOG_RESTASSURED") boolean logRestAssuredInfo, ApiState apiState) { this.logRestAssuredInfo = logRestAssuredInfo; this.apiState = apiState; - this.environmentManager = environmentManager; + this.runningConfiguration = runningConfiguration; } private RequestSpecification request() { RestAssured.enableLoggingOfRequestAndResponseIfValidationFails(); final String restEndpoint = "/sormas-rest"; - RestAssured.baseURI = environmentManager.getEnvironmentUrlForMarket(locale) + restEndpoint; + RestAssured.baseURI = runningConfiguration.getEnvironmentUrlForMarket(locale) + restEndpoint; Filter filters[]; if (logRestAssuredInfo) { filters = @@ -74,10 +74,10 @@ private RequestSpecification request() { .auth() .preemptive() .basic( - environmentManager + runningConfiguration .getUserByRole(locale, UserRoles.RestUser.getRole()) .getUsername(), - environmentManager + runningConfiguration .getUserByRole(locale, UserRoles.RestUser.getRole()) .getPassword()); diff --git a/sormas-e2e-tests/src/test/java/org/sormas/e2etests/steps/web/application/LoginSteps.java b/sormas-e2e-tests/src/test/java/org/sormas/e2etests/steps/web/application/LoginSteps.java index 4c014360de5..e89a3742d7d 100755 --- a/sormas-e2e-tests/src/test/java/org/sormas/e2etests/steps/web/application/LoginSteps.java +++ b/sormas-e2e-tests/src/test/java/org/sormas/e2etests/steps/web/application/LoginSteps.java @@ -26,7 +26,7 @@ import lombok.extern.slf4j.Slf4j; import org.sormas.e2etests.enums.UserRoles; import org.sormas.e2etests.envconfig.dto.EnvUser; -import org.sormas.e2etests.envconfig.manager.EnvironmentManager; +import org.sormas.e2etests.envconfig.manager.RunningConfiguration; import org.sormas.e2etests.helpers.WebDriverHelpers; import org.sormas.e2etests.pages.application.LoginPage; import org.sormas.e2etests.pages.application.NavBarPage; @@ -36,7 +36,7 @@ public class LoginSteps implements En { @Inject - public LoginSteps(WebDriverHelpers webDriverHelpers, EnvironmentManager environmentManager) { + public LoginSteps(WebDriverHelpers webDriverHelpers, RunningConfiguration runningConfiguration) { Given( "^I am logged in with name ([^\"]*)$", @@ -48,7 +48,7 @@ public LoginSteps(WebDriverHelpers webDriverHelpers, EnvironmentManager environm Given( "^I navigate to SORMAS login page$", () -> { - webDriverHelpers.accessWebSite(environmentManager.getEnvironmentUrlForMarket(locale)); + webDriverHelpers.accessWebSite(runningConfiguration.getEnvironmentUrlForMarket(locale)); }); Given( @@ -58,8 +58,8 @@ public LoginSteps(WebDriverHelpers webDriverHelpers, EnvironmentManager environm And( "I log in with National User", () -> { - EnvUser user = environmentManager.getUserByRole(locale, UserRoles.NationalUser.getRole()); - webDriverHelpers.accessWebSite(environmentManager.getEnvironmentUrlForMarket(locale)); + EnvUser user = runningConfiguration.getUserByRole(locale, UserRoles.NationalUser.getRole()); + webDriverHelpers.accessWebSite(runningConfiguration.getEnvironmentUrlForMarket(locale)); webDriverHelpers.waitForPageLoaded(); webDriverHelpers.waitUntilIdentifiedElementIsVisibleAndClickable( LoginPage.USER_NAME_INPUT, 100); @@ -77,9 +77,9 @@ public LoginSteps(WebDriverHelpers webDriverHelpers, EnvironmentManager environm Given( "^I log in as a ([^\"]*)$", (String userRole) -> { - webDriverHelpers.accessWebSite(environmentManager.getEnvironmentUrlForMarket(locale)); + webDriverHelpers.accessWebSite(runningConfiguration.getEnvironmentUrlForMarket(locale)); webDriverHelpers.waitUntilIdentifiedElementIsPresent(LoginPage.USER_NAME_INPUT); - EnvUser user = environmentManager.getUserByRole(locale, userRole); + EnvUser user = runningConfiguration.getUserByRole(locale, userRole); log.info("Filling username"); webDriverHelpers.fillInWebElement(LoginPage.USER_NAME_INPUT, user.getUsername()); log.info("Filling password"); diff --git a/sormas-e2e-tests/src/test/java/org/sormas/e2etests/steps/web/application/cases/CaseDetailedTableViewSteps.java b/sormas-e2e-tests/src/test/java/org/sormas/e2etests/steps/web/application/cases/CaseDetailedTableViewSteps.java index 94667cdfca2..0f7e05a1df0 100644 --- a/sormas-e2e-tests/src/test/java/org/sormas/e2etests/steps/web/application/cases/CaseDetailedTableViewSteps.java +++ b/sormas-e2e-tests/src/test/java/org/sormas/e2etests/steps/web/application/cases/CaseDetailedTableViewSteps.java @@ -26,7 +26,7 @@ import org.sormas.e2etests.enums.DistrictsValues; import org.sormas.e2etests.enums.RegionsValues; import org.sormas.e2etests.enums.UserRoles; -import org.sormas.e2etests.envconfig.manager.EnvironmentManager; +import org.sormas.e2etests.envconfig.manager.RunningConfiguration; import org.sormas.e2etests.helpers.WebDriverHelpers; import org.sormas.e2etests.state.ApiState; import org.sormas.e2etests.steps.BaseSteps; @@ -46,7 +46,7 @@ public CaseDetailedTableViewSteps( BaseSteps baseSteps, ApiState apiState, SoftAssert softly, - EnvironmentManager environmentManager) { + RunningConfiguration runningConfiguration) { this.webDriverHelpers = webDriverHelpers; this.baseSteps = baseSteps; @@ -146,7 +146,7 @@ public CaseDetailedTableViewSteps( } softly.assertEquals( detailedCaseDTableRow.get(CaseDetailedTableViewHeaders.REPORTING_USER.toString()), - environmentManager.getUserByRole(locale, UserRoles.RestUser.getRole()).getUserRole(), + runningConfiguration.getUserByRole(locale, UserRoles.RestUser.getRole()).getUserRole(), "Reporting user is not correct"); softly.assertAll(); }); diff --git a/sormas-e2e-tests/src/test/java/org/sormas/e2etests/steps/web/application/cases/CaseDirectorySteps.java b/sormas-e2e-tests/src/test/java/org/sormas/e2etests/steps/web/application/cases/CaseDirectorySteps.java index bd8e8dcf2c1..0165f5f5c9b 100644 --- a/sormas-e2e-tests/src/test/java/org/sormas/e2etests/steps/web/application/cases/CaseDirectorySteps.java +++ b/sormas-e2e-tests/src/test/java/org/sormas/e2etests/steps/web/application/cases/CaseDirectorySteps.java @@ -126,7 +126,7 @@ import org.sormas.e2etests.enums.FacilityCategory; import org.sormas.e2etests.enums.FollowUpStatus; import org.sormas.e2etests.enums.PresentCondition; -import org.sormas.e2etests.envconfig.manager.EnvironmentManager; +import org.sormas.e2etests.envconfig.manager.RunningConfiguration; import org.sormas.e2etests.helpers.AssertHelpers; import org.sormas.e2etests.helpers.WebDriverHelpers; import org.sormas.e2etests.state.ApiState; @@ -151,7 +151,7 @@ public CaseDirectorySteps( AssertHelpers assertHelpers, SoftAssert softly, Faker faker, - EnvironmentManager environmentManager) { + RunningConfiguration runningConfiguration) { this.webDriverHelpers = webDriverHelpers; this.baseSteps = baseSteps; @@ -347,7 +347,7 @@ public CaseDirectorySteps( "^I navigate to the last created case via the url$", () -> { String LAST_CREATED_CASE_URL = - environmentManager.getEnvironmentUrlForMarket(locale) + runningConfiguration.getEnvironmentUrlForMarket(locale) + "/sormas-webdriver/#!cases/data/" + apiState.getCreatedCase().getUuid(); webDriverHelpers.accessWebSite(LAST_CREATED_CASE_URL); diff --git a/sormas-e2e-tests/src/test/java/org/sormas/e2etests/steps/web/application/cases/EditCaseSteps.java b/sormas-e2e-tests/src/test/java/org/sormas/e2etests/steps/web/application/cases/EditCaseSteps.java index 063fb8f76be..1e0c7e000fe 100644 --- a/sormas-e2e-tests/src/test/java/org/sormas/e2etests/steps/web/application/cases/EditCaseSteps.java +++ b/sormas-e2e-tests/src/test/java/org/sormas/e2etests/steps/web/application/cases/EditCaseSteps.java @@ -204,7 +204,7 @@ import org.sormas.e2etests.enums.cases.epidemiologicalData.ExposureDetailsRole; import org.sormas.e2etests.enums.cases.epidemiologicalData.TypeOfActivityExposure; import org.sormas.e2etests.enums.cases.epidemiologicalData.TypeOfPlace; -import org.sormas.e2etests.envconfig.manager.EnvironmentManager; +import org.sormas.e2etests.envconfig.manager.RunningConfiguration; import org.sormas.e2etests.helpers.AssertHelpers; import org.sormas.e2etests.helpers.WebDriverHelpers; import org.sormas.e2etests.pages.application.NavBarPage; @@ -237,7 +237,7 @@ public EditCaseSteps( AssertHelpers assertHelpers, ApiState apiState, DataOperations dataOperations, - EnvironmentManager environmentManager) { + RunningConfiguration runningConfiguration) { this.webDriverHelpers = webDriverHelpers; When( @@ -1115,7 +1115,7 @@ public EditCaseSteps( String caseLinkPath = "/sormas-ui/#!cases/data/"; String uuid = aCase.getUuid(); webDriverHelpers.accessWebSite( - environmentManager.getEnvironmentUrlForMarket(locale) + caseLinkPath + uuid); + runningConfiguration.getEnvironmentUrlForMarket(locale) + caseLinkPath + uuid); webDriverHelpers.waitUntilElementIsVisibleAndClickable(REPORT_DATE_INPUT); }); @@ -1125,7 +1125,7 @@ public EditCaseSteps( String caseLinkPath = "/sormas-ui/#!cases/data/"; String uuid = apiState.getCreatedCase().getUuid(); webDriverHelpers.accessWebSite( - environmentManager.getEnvironmentUrlForMarket(locale) + caseLinkPath + uuid); + runningConfiguration.getEnvironmentUrlForMarket(locale) + caseLinkPath + uuid); webDriverHelpers.waitUntilElementIsVisibleAndClickable(UUID_INPUT); }); diff --git a/sormas-e2e-tests/src/test/java/org/sormas/e2etests/steps/web/application/cases/EditContactsSteps.java b/sormas-e2e-tests/src/test/java/org/sormas/e2etests/steps/web/application/cases/EditContactsSteps.java index cfa9e051b8b..38036dc9e34 100644 --- a/sormas-e2e-tests/src/test/java/org/sormas/e2etests/steps/web/application/cases/EditContactsSteps.java +++ b/sormas-e2e-tests/src/test/java/org/sormas/e2etests/steps/web/application/cases/EditContactsSteps.java @@ -53,7 +53,7 @@ import org.sormas.e2etests.entities.pojo.helpers.ComparisonHelper; import org.sormas.e2etests.entities.pojo.web.Contact; import org.sormas.e2etests.entities.services.ContactService; -import org.sormas.e2etests.envconfig.manager.EnvironmentManager; +import org.sormas.e2etests.envconfig.manager.RunningConfiguration; import org.sormas.e2etests.helpers.WebDriverHelpers; import org.sormas.e2etests.state.ApiState; import org.testng.asserts.SoftAssert; @@ -76,14 +76,14 @@ public EditContactsSteps( ApiState apiState, ContactService contactService, SoftAssert softly, - EnvironmentManager environmentManager) { + RunningConfiguration runningConfiguration) { this.webDriverHelpers = webDriverHelpers; When( "I open the Case Contacts tab of the created case via api", () -> { LAST_CREATED_CASE_CONTACTS_TAB_URL = - environmentManager.getEnvironmentUrlForMarket(locale) + runningConfiguration.getEnvironmentUrlForMarket(locale) + "/sormas-webdriver/#!cases/contacts/" + apiState.getCreatedCase().getUuid(); webDriverHelpers.accessWebSite(LAST_CREATED_CASE_CONTACTS_TAB_URL); diff --git a/sormas-e2e-tests/src/test/java/org/sormas/e2etests/steps/web/application/cases/EpidemiologicalDataCaseSteps.java b/sormas-e2e-tests/src/test/java/org/sormas/e2etests/steps/web/application/cases/EpidemiologicalDataCaseSteps.java index b3d0cf6a06b..df2063293c6 100644 --- a/sormas-e2e-tests/src/test/java/org/sormas/e2etests/steps/web/application/cases/EpidemiologicalDataCaseSteps.java +++ b/sormas-e2e-tests/src/test/java/org/sormas/e2etests/steps/web/application/cases/EpidemiologicalDataCaseSteps.java @@ -85,7 +85,7 @@ import org.sormas.e2etests.enums.cases.epidemiologicalData.TypeOfActivityExposure; import org.sormas.e2etests.enums.cases.epidemiologicalData.TypeOfGathering; import org.sormas.e2etests.enums.cases.epidemiologicalData.TypeOfPlace; -import org.sormas.e2etests.envconfig.manager.EnvironmentManager; +import org.sormas.e2etests.envconfig.manager.RunningConfiguration; import org.sormas.e2etests.helpers.WebDriverHelpers; import org.sormas.e2etests.state.ApiState; import org.testng.asserts.SoftAssert; @@ -103,7 +103,7 @@ public EpidemiologicalDataCaseSteps( WebDriverHelpers webDriverHelpers, ApiState apiState, EpidemiologicalDataService epidemiologicalDataService, - EnvironmentManager environmentManager, + RunningConfiguration runningConfiguration, SoftAssert softly) { this.webDriverHelpers = webDriverHelpers; @@ -160,7 +160,7 @@ public EpidemiologicalDataCaseSteps( () -> { String uuid = apiState.getCreatedCase().getUuid(); webDriverHelpers.accessWebSite( - environmentManager.getEnvironmentUrlForMarket(locale) + runningConfiguration.getEnvironmentUrlForMarket(locale) + "/sormas-webdriver/#!cases/epidata/" + uuid); }); diff --git a/sormas-e2e-tests/src/test/java/org/sormas/e2etests/steps/web/application/cases/HospitalizationTabSteps.java b/sormas-e2e-tests/src/test/java/org/sormas/e2etests/steps/web/application/cases/HospitalizationTabSteps.java index c50f12fcfc9..d250548586b 100644 --- a/sormas-e2e-tests/src/test/java/org/sormas/e2etests/steps/web/application/cases/HospitalizationTabSteps.java +++ b/sormas-e2e-tests/src/test/java/org/sormas/e2etests/steps/web/application/cases/HospitalizationTabSteps.java @@ -17,7 +17,7 @@ import org.sormas.e2etests.entities.pojo.web.Case; import org.sormas.e2etests.entities.pojo.web.Hospitalization; import org.sormas.e2etests.entities.services.HospitalizationService; -import org.sormas.e2etests.envconfig.manager.EnvironmentManager; +import org.sormas.e2etests.envconfig.manager.RunningConfiguration; import org.sormas.e2etests.helpers.WebDriverHelpers; import org.sormas.e2etests.pages.application.NavBarPage; import org.sormas.e2etests.state.ApiState; @@ -34,7 +34,7 @@ public HospitalizationTabSteps( HospitalizationService hospitalizationService, ApiState apiState, SoftAssert softly, - EnvironmentManager environmentManager) { + RunningConfiguration runningConfiguration) { this.webDriverHelpers = webDriverHelpers; @@ -46,7 +46,7 @@ public HospitalizationTabSteps( String caseHospitalizationPath = "/sormas-webdriver/#!cases/hospitalization/"; String uuid = apiState.getCreatedCase().getUuid(); webDriverHelpers.accessWebSite( - environmentManager.getEnvironmentUrlForMarket(locale) + runningConfiguration.getEnvironmentUrlForMarket(locale) + caseHospitalizationPath + uuid); }); diff --git a/sormas-e2e-tests/src/test/java/org/sormas/e2etests/steps/web/application/cases/SymptomsTabSteps.java b/sormas-e2e-tests/src/test/java/org/sormas/e2etests/steps/web/application/cases/SymptomsTabSteps.java index d576f4bb9db..d7743b6aa0b 100644 --- a/sormas-e2e-tests/src/test/java/org/sormas/e2etests/steps/web/application/cases/SymptomsTabSteps.java +++ b/sormas-e2e-tests/src/test/java/org/sormas/e2etests/steps/web/application/cases/SymptomsTabSteps.java @@ -33,7 +33,7 @@ import org.sormas.e2etests.entities.pojo.helpers.ComparisonHelper; import org.sormas.e2etests.entities.pojo.web.Symptoms; import org.sormas.e2etests.entities.services.SymptomService; -import org.sormas.e2etests.envconfig.manager.EnvironmentManager; +import org.sormas.e2etests.envconfig.manager.RunningConfiguration; import org.sormas.e2etests.helpers.WebDriverHelpers; import org.sormas.e2etests.pages.application.NavBarPage; import org.sormas.e2etests.state.ApiState; @@ -49,7 +49,7 @@ public SymptomsTabSteps( WebDriverHelpers webDriverHelpers, SymptomService symptomService, ApiState apiState, - EnvironmentManager environmentManager) { + RunningConfiguration runningConfiguration) { this.webDriverHelpers = webDriverHelpers; String firstSymptom = "Sore throat/pharyngitis"; @@ -75,7 +75,7 @@ public SymptomsTabSteps( String caseLinkPath = "/sormas-webdriver/#!cases/symptoms/"; String uuid = apiState.getCreatedCase().getUuid(); webDriverHelpers.accessWebSite( - environmentManager.getEnvironmentUrlForMarket(locale) + caseLinkPath + uuid); + runningConfiguration.getEnvironmentUrlForMarket(locale) + caseLinkPath + uuid); }); When( diff --git a/sormas-e2e-tests/src/test/java/org/sormas/e2etests/steps/web/application/contacts/ContactDirectorySteps.java b/sormas-e2e-tests/src/test/java/org/sormas/e2etests/steps/web/application/contacts/ContactDirectorySteps.java index d8f3251b062..d889b0d243f 100644 --- a/sormas-e2e-tests/src/test/java/org/sormas/e2etests/steps/web/application/contacts/ContactDirectorySteps.java +++ b/sormas-e2e-tests/src/test/java/org/sormas/e2etests/steps/web/application/contacts/ContactDirectorySteps.java @@ -144,7 +144,7 @@ import org.sormas.e2etests.enums.cases.epidemiologicalData.TypeOfActivityExposure; import org.sormas.e2etests.enums.cases.epidemiologicalData.TypeOfGathering; import org.sormas.e2etests.enums.cases.epidemiologicalData.TypeOfPlace; -import org.sormas.e2etests.envconfig.manager.EnvironmentManager; +import org.sormas.e2etests.envconfig.manager.RunningConfiguration; import org.sormas.e2etests.helpers.AssertHelpers; import org.sormas.e2etests.helpers.WebDriverHelpers; import org.sormas.e2etests.state.ApiState; @@ -168,14 +168,14 @@ public ContactDirectorySteps( ContactService contactService, DataOperations dataOperations, Faker faker, - EnvironmentManager environmentManager) { + RunningConfiguration runningConfiguration) { this.webDriverHelpers = webDriverHelpers; When( "^I navigate to the last created contact via the url$", () -> { String LAST_CREATED_CONTACT_URL = - environmentManager.getEnvironmentUrlForMarket(locale) + runningConfiguration.getEnvironmentUrlForMarket(locale) + "/sormas-webdriver/#!contacts/data/" + apiState.getCreatedContact().getUuid(); webDriverHelpers.accessWebSite(LAST_CREATED_CONTACT_URL); @@ -185,7 +185,7 @@ public ContactDirectorySteps( "^I navigate to the last created UI contact via the url$", () -> { String LAST_CREATED_CONTACT_URL = - environmentManager.getEnvironmentUrlForMarket(locale) + runningConfiguration.getEnvironmentUrlForMarket(locale) + "/sormas-webdriver/#!contacts/data/" + collectedContact.getUuid(); webDriverHelpers.accessWebSite(LAST_CREATED_CONTACT_URL); diff --git a/sormas-e2e-tests/src/test/java/org/sormas/e2etests/steps/web/application/contacts/ContactsDetailedTableViewSteps.java b/sormas-e2e-tests/src/test/java/org/sormas/e2etests/steps/web/application/contacts/ContactsDetailedTableViewSteps.java index 9ca4bb216e6..28c8f75e2ec 100644 --- a/sormas-e2e-tests/src/test/java/org/sormas/e2etests/steps/web/application/contacts/ContactsDetailedTableViewSteps.java +++ b/sormas-e2e-tests/src/test/java/org/sormas/e2etests/steps/web/application/contacts/ContactsDetailedTableViewSteps.java @@ -17,7 +17,7 @@ import org.sormas.e2etests.common.DataOperations; import org.sormas.e2etests.enums.ContactOutcome; import org.sormas.e2etests.enums.UserRoles; -import org.sormas.e2etests.envconfig.manager.EnvironmentManager; +import org.sormas.e2etests.envconfig.manager.RunningConfiguration; import org.sormas.e2etests.helpers.WebDriverHelpers; import org.sormas.e2etests.state.ApiState; import org.sormas.e2etests.steps.BaseSteps; @@ -35,7 +35,7 @@ public ContactsDetailedTableViewSteps( ApiState apiState, DataOperations dataOperations, SoftAssert softly, - EnvironmentManager environmentManager) { + RunningConfiguration runningConfiguration) { this.webDriverHelpers = webDriverHelpers; this.baseSteps = baseSteps; @@ -105,7 +105,7 @@ public ContactsDetailedTableViewSteps( softly.assertEquals( detailedContactDTableRow.get( ContactsDetailedTableViewHeaders.REPORTING_USER.toString()), - environmentManager.getUserByRole(locale, UserRoles.RestUser.getRole()).getUserRole(), + runningConfiguration.getUserByRole(locale, UserRoles.RestUser.getRole()).getUserRole(), "Reporting user is not correct"); softly.assertAll(); }); diff --git a/sormas-e2e-tests/src/test/java/org/sormas/e2etests/steps/web/application/contacts/ExposureInContactEpiDataSteps.java b/sormas-e2e-tests/src/test/java/org/sormas/e2etests/steps/web/application/contacts/ExposureInContactEpiDataSteps.java index a022a821a20..299640ffe33 100644 --- a/sormas-e2e-tests/src/test/java/org/sormas/e2etests/steps/web/application/contacts/ExposureInContactEpiDataSteps.java +++ b/sormas-e2e-tests/src/test/java/org/sormas/e2etests/steps/web/application/contacts/ExposureInContactEpiDataSteps.java @@ -14,7 +14,7 @@ import org.sormas.e2etests.entities.pojo.web.ExposureInvestigation; import org.sormas.e2etests.entities.services.ExposureDetailsService; import org.sormas.e2etests.entities.services.ExposureInvestigationService; -import org.sormas.e2etests.envconfig.manager.EnvironmentManager; +import org.sormas.e2etests.envconfig.manager.RunningConfiguration; import org.sormas.e2etests.helpers.WebDriverHelpers; import org.sormas.e2etests.state.ApiState; @@ -32,14 +32,14 @@ public ExposureInContactEpiDataSteps( ExposureInvestigationService exposureInvestigationService, ExposureDetailsService exposureDetailsService, ApiState apiState, - EnvironmentManager environmentManager) { + RunningConfiguration runningConfiguration) { this.webDriverHelpers = webDriverHelpers; When( "I am accessing the Epidemiological tab using of created contact via api", () -> { EPIDATA_FOR_LAST_CREATED_CONTACT_URL = - environmentManager.getEnvironmentUrlForMarket(locale) + runningConfiguration.getEnvironmentUrlForMarket(locale) + "/sormas-webdriver/#!contacts/epidata/" + apiState.getCreatedContact().getUuid(); webDriverHelpers.accessWebSite(EPIDATA_FOR_LAST_CREATED_CONTACT_URL); diff --git a/sormas-e2e-tests/src/test/java/org/sormas/e2etests/steps/web/application/contacts/FollowUpVisitsTabSteps.java b/sormas-e2e-tests/src/test/java/org/sormas/e2etests/steps/web/application/contacts/FollowUpVisitsTabSteps.java index 2e823052dad..07a1a1c8465 100644 --- a/sormas-e2e-tests/src/test/java/org/sormas/e2etests/steps/web/application/contacts/FollowUpVisitsTabSteps.java +++ b/sormas-e2e-tests/src/test/java/org/sormas/e2etests/steps/web/application/contacts/FollowUpVisitsTabSteps.java @@ -24,7 +24,7 @@ import cucumber.api.java8.En; import java.time.format.DateTimeFormatter; import javax.inject.Inject; -import org.sormas.e2etests.envconfig.manager.EnvironmentManager; +import org.sormas.e2etests.envconfig.manager.RunningConfiguration; import org.sormas.e2etests.helpers.WebDriverHelpers; import org.sormas.e2etests.pages.application.NavBarPage; import org.sormas.e2etests.state.ApiState; @@ -35,7 +35,7 @@ public class FollowUpVisitsTabSteps implements En { @Inject public FollowUpVisitsTabSteps( - WebDriverHelpers webDriverHelpers, ApiState apiState, EnvironmentManager environmentManager) { + WebDriverHelpers webDriverHelpers, ApiState apiState, RunningConfiguration runningConfiguration) { When( "^I am accessing the Follow-up visits tab using of created contact via api$", @@ -44,7 +44,7 @@ public FollowUpVisitsTabSteps( NavBarPage.CONTACTS_BUTTON); String visitLinkPath = "/sormas-webdriver/#!contacts/visits/"; String uuid = apiState.getCreatedContact().getUuid(); - String URL = environmentManager.getEnvironmentUrlForMarket(locale) + visitLinkPath + uuid; + String URL = runningConfiguration.getEnvironmentUrlForMarket(locale) + visitLinkPath + uuid; webDriverHelpers.accessWebSite(URL); }); diff --git a/sormas-e2e-tests/src/test/java/org/sormas/e2etests/steps/web/application/entries/TravelEntryDirectorySteps.java b/sormas-e2e-tests/src/test/java/org/sormas/e2etests/steps/web/application/entries/TravelEntryDirectorySteps.java index 51b87624b27..2f65931a281 100644 --- a/sormas-e2e-tests/src/test/java/org/sormas/e2etests/steps/web/application/entries/TravelEntryDirectorySteps.java +++ b/sormas-e2e-tests/src/test/java/org/sormas/e2etests/steps/web/application/entries/TravelEntryDirectorySteps.java @@ -42,7 +42,7 @@ import java.time.format.DateTimeFormatter; import java.util.concurrent.TimeUnit; import javax.inject.Inject; -import org.sormas.e2etests.envconfig.manager.EnvironmentManager; +import org.sormas.e2etests.envconfig.manager.RunningConfiguration; import org.sormas.e2etests.helpers.AssertHelpers; import org.sormas.e2etests.helpers.WebDriverHelpers; import org.sormas.e2etests.state.ApiState; @@ -54,7 +54,7 @@ public class TravelEntryDirectorySteps implements En { @Inject public TravelEntryDirectorySteps( WebDriverHelpers webDriverHelpers, - EnvironmentManager environmentManager, + RunningConfiguration runningConfiguration, ApiState apiState, AssertHelpers assertHelpers) { diff --git a/sormas-e2e-tests/src/test/java/org/sormas/e2etests/steps/web/application/events/EditEventSteps.java b/sormas-e2e-tests/src/test/java/org/sormas/e2etests/steps/web/application/events/EditEventSteps.java index 8f42ee1a431..2edc99124d4 100644 --- a/sormas-e2e-tests/src/test/java/org/sormas/e2etests/steps/web/application/events/EditEventSteps.java +++ b/sormas-e2e-tests/src/test/java/org/sormas/e2etests/steps/web/application/events/EditEventSteps.java @@ -33,7 +33,7 @@ import org.sormas.e2etests.enums.DistrictsValues; import org.sormas.e2etests.enums.GenderValues; import org.sormas.e2etests.enums.RegionsValues; -import org.sormas.e2etests.envconfig.manager.EnvironmentManager; +import org.sormas.e2etests.envconfig.manager.RunningConfiguration; import org.sormas.e2etests.helpers.AssertHelpers; import org.sormas.e2etests.helpers.WebDriverHelpers; import org.sormas.e2etests.pages.application.events.EditEventPage; @@ -184,7 +184,7 @@ public EditEventSteps( SoftAssert softly, EventParticipantService eventParticipant, AssertHelpers assertHelpers, - EnvironmentManager environmentManager, + RunningConfiguration runningConfiguration, ApiState apiState) { this.webDriverHelpers = webDriverHelpers; @@ -690,7 +690,7 @@ public EditEventSteps( "I open the last created event via api", () -> { String LAST_CREATED_EVENT_URL = - environmentManager.getEnvironmentUrlForMarket(locale) + runningConfiguration.getEnvironmentUrlForMarket(locale) + "/sormas-webdriver/#!events/data/" + apiState.getCreatedEvent().getUuid(); webDriverHelpers.accessWebSite(LAST_CREATED_EVENT_URL); @@ -707,7 +707,7 @@ public EditEventSteps( "I navigate to Event Action tab for created Event", () -> { String LAST_CREATED_EVENT_ACTIONS_URL = - environmentManager.getEnvironmentUrlForMarket(locale) + runningConfiguration.getEnvironmentUrlForMarket(locale) + "/sormas-webdriver/#!events/eventactions/" + apiState.getCreatedEvent().getUuid(); webDriverHelpers.accessWebSite(LAST_CREATED_EVENT_ACTIONS_URL); diff --git a/sormas-e2e-tests/src/test/java/org/sormas/e2etests/steps/web/application/events/EventDirectorySteps.java b/sormas-e2e-tests/src/test/java/org/sormas/e2etests/steps/web/application/events/EventDirectorySteps.java index 6e3a4d728cb..34a17932e41 100644 --- a/sormas-e2e-tests/src/test/java/org/sormas/e2etests/steps/web/application/events/EventDirectorySteps.java +++ b/sormas-e2e-tests/src/test/java/org/sormas/e2etests/steps/web/application/events/EventDirectorySteps.java @@ -34,7 +34,7 @@ import org.sormas.e2etests.enums.RiskLevelValues; import org.sormas.e2etests.enums.SourceTypeValues; import org.sormas.e2etests.enums.cases.epidemiologicalData.TypeOfPlace; -import org.sormas.e2etests.envconfig.manager.EnvironmentManager; +import org.sormas.e2etests.envconfig.manager.RunningConfiguration; import org.sormas.e2etests.helpers.AssertHelpers; import org.sormas.e2etests.helpers.WebDriverHelpers; import org.sormas.e2etests.pages.application.NavBarPage; @@ -159,7 +159,7 @@ public EventDirectorySteps( EventGroupService eventGroupService, EventService eventService, SoftAssert softly, - EnvironmentManager environmentManager) { + RunningConfiguration runningConfiguration) { this.webDriverHelpers = webDriverHelpers; this.baseSteps = baseSteps; @@ -178,7 +178,7 @@ public EventDirectorySteps( String eventLinkPath = "/sormas-ui/#!events/data/"; String createdEventUUID = apiState.getCreatedEvent().getUuid(); webDriverHelpers.accessWebSite( - environmentManager.getEnvironmentUrlForMarket(locale) + runningConfiguration.getEnvironmentUrlForMarket(locale) + eventLinkPath + createdEventUUID); webDriverHelpers.waitForPageLoaded(); @@ -336,7 +336,7 @@ public EventDirectorySteps( String eventLinkPath = "/sormas-ui/#!events/data/"; String createdEventUUID = CreateNewEventSteps.newEvent.getUuid(); webDriverHelpers.accessWebSite( - environmentManager.getEnvironmentUrlForMarket(locale) + runningConfiguration.getEnvironmentUrlForMarket(locale) + eventLinkPath + createdEventUUID); webDriverHelpers.waitForPageLoaded(); @@ -767,7 +767,7 @@ public EventDirectorySteps( final String eventUuid = apiState.getCreatedEvent().getUuid(); final String eventLinkPath = "/sormas-webdriver/#!events/data/"; webDriverHelpers.accessWebSite( - environmentManager.getEnvironmentUrlForMarket(locale) + eventLinkPath + eventUuid); + runningConfiguration.getEnvironmentUrlForMarket(locale) + eventLinkPath + eventUuid); }); When( diff --git a/sormas-e2e-tests/src/test/java/org/sormas/e2etests/steps/web/application/persons/EditPersonSteps.java b/sormas-e2e-tests/src/test/java/org/sormas/e2etests/steps/web/application/persons/EditPersonSteps.java index ca937675927..36f61ba1918 100644 --- a/sormas-e2e-tests/src/test/java/org/sormas/e2etests/steps/web/application/persons/EditPersonSteps.java +++ b/sormas-e2e-tests/src/test/java/org/sormas/e2etests/steps/web/application/persons/EditPersonSteps.java @@ -89,7 +89,7 @@ import org.sormas.e2etests.entities.pojo.helpers.ComparisonHelper; import org.sormas.e2etests.entities.pojo.web.Person; import org.sormas.e2etests.entities.services.PersonService; -import org.sormas.e2etests.envconfig.manager.EnvironmentManager; +import org.sormas.e2etests.envconfig.manager.RunningConfiguration; import org.sormas.e2etests.helpers.AssertHelpers; import org.sormas.e2etests.helpers.WebDriverHelpers; import org.sormas.e2etests.state.ApiState; @@ -112,7 +112,7 @@ public EditPersonSteps( BaseSteps baseSteps, AssertHelpers assertHelpers, ApiState apiState, - EnvironmentManager environmentManager) { + RunningConfiguration runningConfiguration) { this.webDriverHelpers = webDriverHelpers; When( @@ -263,7 +263,7 @@ public EditPersonSteps( () -> { final String personUuid = EditEventSteps.person.getUuid(); webDriverHelpers.accessWebSite( - environmentManager.getEnvironmentUrlForMarket(locale) + runningConfiguration.getEnvironmentUrlForMarket(locale) + "/sormas-webdriver/#!persons/data/" + personUuid); }); diff --git a/sormas-e2e-tests/src/test/java/org/sormas/e2etests/steps/web/application/persons/PersonDirectorySteps.java b/sormas-e2e-tests/src/test/java/org/sormas/e2etests/steps/web/application/persons/PersonDirectorySteps.java index 110423d2285..ededffb1c18 100644 --- a/sormas-e2e-tests/src/test/java/org/sormas/e2etests/steps/web/application/persons/PersonDirectorySteps.java +++ b/sormas-e2e-tests/src/test/java/org/sormas/e2etests/steps/web/application/persons/PersonDirectorySteps.java @@ -42,7 +42,7 @@ import org.sormas.e2etests.enums.DistrictsValues; import org.sormas.e2etests.enums.PresentCondition; import org.sormas.e2etests.enums.RegionsValues; -import org.sormas.e2etests.envconfig.manager.EnvironmentManager; +import org.sormas.e2etests.envconfig.manager.RunningConfiguration; import org.sormas.e2etests.helpers.AssertHelpers; import org.sormas.e2etests.helpers.WebDriverHelpers; import org.sormas.e2etests.state.ApiState; @@ -64,7 +64,7 @@ public PersonDirectorySteps( DataOperations dataOperations, Faker faker, AssertHelpers assertHelpers, - EnvironmentManager environmentManager, + RunningConfiguration runningConfiguration, SoftAssert softly) { this.webDriverHelpers = webDriverHelpers; @@ -277,7 +277,7 @@ public PersonDirectorySteps( () -> { String createdPersonUUID = EditContactPersonSteps.fullyDetailedPerson.getUuid(); String LAST_CREATED_PERSON_PAGE_URL = - environmentManager.getEnvironmentUrlForMarket(locale) + runningConfiguration.getEnvironmentUrlForMarket(locale) + "/sormas-webdriver/#!persons/data/" + createdPersonUUID; webDriverHelpers.accessWebSite(LAST_CREATED_PERSON_PAGE_URL); @@ -290,7 +290,7 @@ public PersonDirectorySteps( String personLinkPath = "/sormas-ui/#!persons/data/"; String uuid = apiState.getLastCreatedPerson().getUuid(); webDriverHelpers.accessWebSite( - environmentManager.getEnvironmentUrlForMarket(locale) + personLinkPath + uuid); + runningConfiguration.getEnvironmentUrlForMarket(locale) + personLinkPath + uuid); webDriverHelpers.waitForPageLoaded(); webDriverHelpers.waitUntilIdentifiedElementIsVisibleAndClickable(UUID_INPUT, 50); }); diff --git a/sormas-e2e-tests/src/test/java/org/sormas/e2etests/steps/web/application/samples/EditSampleSteps.java b/sormas-e2e-tests/src/test/java/org/sormas/e2etests/steps/web/application/samples/EditSampleSteps.java index bcbefd016db..52b0f6cedbd 100644 --- a/sormas-e2e-tests/src/test/java/org/sormas/e2etests/steps/web/application/samples/EditSampleSteps.java +++ b/sormas-e2e-tests/src/test/java/org/sormas/e2etests/steps/web/application/samples/EditSampleSteps.java @@ -31,7 +31,7 @@ import org.sormas.e2etests.entities.pojo.helpers.ComparisonHelper; import org.sormas.e2etests.entities.pojo.web.Sample; import org.sormas.e2etests.entities.services.SampleService; -import org.sormas.e2etests.envconfig.manager.EnvironmentManager; +import org.sormas.e2etests.envconfig.manager.RunningConfiguration; import org.sormas.e2etests.helpers.WebDriverHelpers; import org.sormas.e2etests.state.ApiState; @@ -45,7 +45,7 @@ public class EditSampleSteps implements En { @Inject public EditSampleSteps( WebDriverHelpers webDriverHelpers, - EnvironmentManager environmentManager, + RunningConfiguration runningConfiguration, SampleService sampleService, ApiState apiState) { this.webDriverHelpers = webDriverHelpers; @@ -54,7 +54,7 @@ public EditSampleSteps( "I open the last created sample via API", () -> { String LAST_CREATED_SAMPLE_URL = - environmentManager.getEnvironmentUrlForMarket(locale) + runningConfiguration.getEnvironmentUrlForMarket(locale) + "/sormas-webdriver/#!samples/data/" + apiState.getCreatedSample().getUuid(); webDriverHelpers.accessWebSite(LAST_CREATED_SAMPLE_URL); diff --git a/sormas-e2e-tests/src/test/java/org/sormas/e2etests/steps/web/application/samples/SamplesDirectorySteps.java b/sormas-e2e-tests/src/test/java/org/sormas/e2etests/steps/web/application/samples/SamplesDirectorySteps.java index f233f90634e..968d772f84a 100644 --- a/sormas-e2e-tests/src/test/java/org/sormas/e2etests/steps/web/application/samples/SamplesDirectorySteps.java +++ b/sormas-e2e-tests/src/test/java/org/sormas/e2etests/steps/web/application/samples/SamplesDirectorySteps.java @@ -69,7 +69,7 @@ import org.sormas.e2etests.enums.PathogenTestResults; import org.sormas.e2etests.enums.RegionsValues; import org.sormas.e2etests.enums.SpecimenConditions; -import org.sormas.e2etests.envconfig.manager.EnvironmentManager; +import org.sormas.e2etests.envconfig.manager.RunningConfiguration; import org.sormas.e2etests.helpers.AssertHelpers; import org.sormas.e2etests.helpers.WebDriverHelpers; import org.sormas.e2etests.state.ApiState; @@ -83,7 +83,7 @@ public class SamplesDirectorySteps implements En { @Inject public SamplesDirectorySteps( WebDriverHelpers webDriverHelpers, - EnvironmentManager environmentManager, + RunningConfiguration runningConfiguration, ApiState apiState, AssertHelpers assertHelpers, SoftAssert softly) { @@ -247,7 +247,7 @@ public SamplesDirectorySteps( "I am opening the last created via API Sample by url navigation", () -> { String CREATED_SAMPLE_VIA_API_URL = - environmentManager.getEnvironmentUrlForMarket(locale) + runningConfiguration.getEnvironmentUrlForMarket(locale) + "/sormas-webdriver/#!samples/data/" + apiState.getCreatedSample().getUuid(); webDriverHelpers.accessWebSite(CREATED_SAMPLE_VIA_API_URL); From 05bd2fa39900841276a2cf302205e402eb936dc2 Mon Sep 17 00:00:00 2001 From: Stefan Kock Date: Sat, 7 May 2022 08:32:27 +0200 Subject: [PATCH 043/167] #8747: Cleaner constant use, removed unused variable --- .../main/java/de/symeda/sormas/backend/caze/CaseService.java | 5 ++--- .../java/de/symeda/sormas/backend/user/UserFacadeEjb.java | 3 +-- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/sormas-backend/src/main/java/de/symeda/sormas/backend/caze/CaseService.java b/sormas-backend/src/main/java/de/symeda/sormas/backend/caze/CaseService.java index 32fe941c7ab..fe94d1d7341 100644 --- a/sormas-backend/src/main/java/de/symeda/sormas/backend/caze/CaseService.java +++ b/sormas-backend/src/main/java/de/symeda/sormas/backend/caze/CaseService.java @@ -285,14 +285,13 @@ public List getAllActiveUuids() { } public Long countCasesForMap(Region region, District district, Disease disease, Date from, Date to, NewCaseDateType dateType) { + CriteriaBuilder cb = em.getCriteriaBuilder(); CriteriaQuery cq = cb.createQuery(Long.class); Root caze = cq.from(getElementClass()); CaseQueryContext caseQueryContext = new CaseQueryContext(cb, cq, caze); - CaseJoins joins = new CaseJoins(caze); - Predicate filter = createMapCasesFilter(caseQueryContext, region, district, disease, from, to, dateType); if (filter != null) { @@ -1386,7 +1385,7 @@ public boolean inJurisdiction(Case caze, User user) { cq.multiselect( JurisdictionHelper .booleanSelector(cb, CaseJurisdictionPredicateValidator.of(new CaseQueryContext(cb, cq, root), user).isInJurisdiction())); - cq.where(cb.equal(root.get(Event.UUID), caze.getUuid())); + cq.where(cb.equal(root.get(Case.UUID), caze.getUuid())); return em.createQuery(cq).getResultList().stream().anyMatch(aBoolean -> aBoolean); } diff --git a/sormas-backend/src/main/java/de/symeda/sormas/backend/user/UserFacadeEjb.java b/sormas-backend/src/main/java/de/symeda/sormas/backend/user/UserFacadeEjb.java index 8bf485d8e09..851b0477334 100644 --- a/sormas-backend/src/main/java/de/symeda/sormas/backend/user/UserFacadeEjb.java +++ b/sormas-backend/src/main/java/de/symeda/sormas/backend/user/UserFacadeEjb.java @@ -47,7 +47,6 @@ import de.symeda.sormas.api.Disease; import de.symeda.sormas.api.EntityDto; -import de.symeda.sormas.api.HasUuid; import de.symeda.sormas.api.caze.CaseReferenceDto; import de.symeda.sormas.api.common.Page; import de.symeda.sormas.api.contact.ContactReferenceDto; @@ -391,7 +390,7 @@ public List getUsersHavingCaseInJurisdiction(CaseReferenceDto caseJurisdictionSubquery.select(caseRoot) .where( cb.and( - cb.equal(caseRoot.get(AbstractDomainObject.UUID), caseReferenceDto.getUuid()), + cb.equal(caseRoot.get(Case.UUID), caseReferenceDto.getUuid()), cb.isTrue(caseJurisdictionPredicateValidator.inJurisdictionOrOwned()), cb.or( cb.isNull(userRoot.get(User.LIMITED_DISEASE)), From f4dc9cf503eb05aba4994ed1b6313bee7d2d5fa2 Mon Sep 17 00:00:00 2001 From: Stefan Kock Date: Sat, 7 May 2022 08:36:09 +0200 Subject: [PATCH 044/167] #8747: Restricted ContactQueryContext constructor with From to protected --- .../java/de/symeda/sormas/backend/caze/CaseService.java | 7 ++++--- .../symeda/sormas/backend/contact/ContactQueryContext.java | 2 +- .../java/de/symeda/sormas/backend/user/UserFacadeEjb.java | 3 ++- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/sormas-backend/src/main/java/de/symeda/sormas/backend/caze/CaseService.java b/sormas-backend/src/main/java/de/symeda/sormas/backend/caze/CaseService.java index fe94d1d7341..bc9f0d99f1f 100644 --- a/sormas-backend/src/main/java/de/symeda/sormas/backend/caze/CaseService.java +++ b/sormas-backend/src/main/java/de/symeda/sormas/backend/caze/CaseService.java @@ -107,6 +107,7 @@ import de.symeda.sormas.backend.common.CriteriaBuilderHelper; import de.symeda.sormas.backend.common.DeletableAdo; import de.symeda.sormas.backend.contact.Contact; +import de.symeda.sormas.backend.contact.ContactJoins; import de.symeda.sormas.backend.contact.ContactQueryContext; import de.symeda.sormas.backend.contact.ContactService; import de.symeda.sormas.backend.disease.DiseaseConfigurationFacadeEjb; @@ -1172,9 +1173,9 @@ public Predicate createUserFilter(CaseQueryContext caseQueryContext, CaseUserFil if (userFilterCriteria == null || (!userFilterCriteria.isExcludeCasesFromContacts() && Boolean.TRUE.equals(userFilterCriteria.getIncludeCasesFromOtherJurisdictions()))) { - CaseJoins caseJoins = caseQueryContext.getJoins(); - filter = CriteriaBuilderHelper - .or(cb, filter, contactService.createUserFilterWithoutCase(new ContactQueryContext(cb, cq, caseJoins.getContacts()))); + ContactQueryContext contactQueryContext = + new ContactQueryContext(cb, cq, new ContactJoins(caseQueryContext.getJoins().getContacts())); + filter = CriteriaBuilderHelper.or(cb, filter, contactService.createUserFilterWithoutCase(contactQueryContext)); } // users can only be assigned to a task when they have also access to the case diff --git a/sormas-backend/src/main/java/de/symeda/sormas/backend/contact/ContactQueryContext.java b/sormas-backend/src/main/java/de/symeda/sormas/backend/contact/ContactQueryContext.java index 45218e36a10..e78aeed7a6e 100644 --- a/sormas-backend/src/main/java/de/symeda/sormas/backend/contact/ContactQueryContext.java +++ b/sormas-backend/src/main/java/de/symeda/sormas/backend/contact/ContactQueryContext.java @@ -17,7 +17,7 @@ public class ContactQueryContext extends QueryContext { public static final String PERSON_EMAIL_SUBQUERY = "personEmailSubquery"; public static final String PERSON_OTHER_CONTACT_DETAILS_SUBQUERY = "personOtherContactDetailsSubQuery"; - public ContactQueryContext(CriteriaBuilder cb, CriteriaQuery query, From root) { + protected ContactQueryContext(CriteriaBuilder cb, CriteriaQuery query, From root) { this(cb, query, new ContactJoins(root)); } diff --git a/sormas-backend/src/main/java/de/symeda/sormas/backend/user/UserFacadeEjb.java b/sormas-backend/src/main/java/de/symeda/sormas/backend/user/UserFacadeEjb.java index 851b0477334..65d30916142 100644 --- a/sormas-backend/src/main/java/de/symeda/sormas/backend/user/UserFacadeEjb.java +++ b/sormas-backend/src/main/java/de/symeda/sormas/backend/user/UserFacadeEjb.java @@ -80,6 +80,7 @@ import de.symeda.sormas.backend.common.AbstractDomainObject; import de.symeda.sormas.backend.common.CriteriaBuilderHelper; import de.symeda.sormas.backend.contact.Contact; +import de.symeda.sormas.backend.contact.ContactJoins; import de.symeda.sormas.backend.contact.ContactJurisdictionPredicateValidator; import de.symeda.sormas.backend.contact.ContactQueryContext; import de.symeda.sormas.backend.contact.ContactService; @@ -406,7 +407,7 @@ public List getUsersHavingContactInJurisdiction(ContactReferen final Subquery contactJurisdictionSubquery = cq.subquery(Contact.class); final Root contactRoot = contactJurisdictionSubquery.from(Contact.class); final ContactJurisdictionPredicateValidator contactJurisdictionPredicateValidator = - ContactJurisdictionPredicateValidator.of(new ContactQueryContext(cb, cq, contactRoot), userRoot); + ContactJurisdictionPredicateValidator.of(new ContactQueryContext(cb, cq, new ContactJoins(contactRoot)), userRoot); contactJurisdictionSubquery.select(contactRoot) .where( From 1952039877ed968e28e59851cfd4568cae08d823 Mon Sep 17 00:00:00 2001 From: Stefan Kock Date: Sat, 7 May 2022 08:40:25 +0200 Subject: [PATCH 045/167] #8747: Fix: Reuse QueryJoins from Event to EventParticipant --- .../backend/event/EventJurisdictionPredicateValidator.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sormas-backend/src/main/java/de/symeda/sormas/backend/event/EventJurisdictionPredicateValidator.java b/sormas-backend/src/main/java/de/symeda/sormas/backend/event/EventJurisdictionPredicateValidator.java index 0304494fd29..c2e6454154e 100644 --- a/sormas-backend/src/main/java/de/symeda/sormas/backend/event/EventJurisdictionPredicateValidator.java +++ b/sormas-backend/src/main/java/de/symeda/sormas/backend/event/EventJurisdictionPredicateValidator.java @@ -118,10 +118,10 @@ protected Predicate whenPointOfEntryLevel() { @Override protected Predicate whenLaboratoryLevel() { if (user != null) { - return EventParticipantJurisdictionPredicateValidator.of(new EventParticipantQueryContext(cb, cq, joins.getEventParticipants()), user) + return EventParticipantJurisdictionPredicateValidator.of(new EventParticipantQueryContext(cb, cq, joins.getEventParticipantJoins()), user) .whenLaboratoryLevel(); } else { - return EventParticipantJurisdictionPredicateValidator.of(new EventParticipantQueryContext(cb, cq, joins.getEventParticipants()), userPath) + return EventParticipantJurisdictionPredicateValidator.of(new EventParticipantQueryContext(cb, cq, joins.getEventParticipantJoins()), userPath) .whenLaboratoryLevel(); } } From e8a1626efc5db95c695ecbdaca0372a603fe511b Mon Sep 17 00:00:00 2001 From: Stefan Kock Date: Sat, 7 May 2022 08:44:29 +0200 Subject: [PATCH 046/167] #8747: Removed superfluous @SuppressWarnings and casts --- .../sormas/backend/person/PersonFacadeEjb.java | 13 +++---------- .../symeda/sormas/backend/person/PersonService.java | 4 ++-- 2 files changed, 5 insertions(+), 12 deletions(-) diff --git a/sormas-backend/src/main/java/de/symeda/sormas/backend/person/PersonFacadeEjb.java b/sormas-backend/src/main/java/de/symeda/sormas/backend/person/PersonFacadeEjb.java index 2ca603ff406..67e73653603 100644 --- a/sormas-backend/src/main/java/de/symeda/sormas/backend/person/PersonFacadeEjb.java +++ b/sormas-backend/src/main/java/de/symeda/sormas/backend/person/PersonFacadeEjb.java @@ -1026,9 +1026,6 @@ public long count(PersonCriteria criteria) { return count; } - @SuppressWarnings({ - "rawtypes", - "unchecked" }) private List getPersonIds(PersonCriteria criteria) { final CriteriaBuilder cb = em.getCriteriaBuilder(); @@ -1036,7 +1033,7 @@ private List getPersonIds(PersonCriteria criteria) { final Root person = cq.from(Person.class); final PersonQueryContext personQueryContext = new PersonQueryContext(cb, cq, person); - ((PersonJoins) personQueryContext.getJoins()).configure(criteria); + personQueryContext.getJoins().configure(criteria); Predicate filter = createIndexListFilter(criteria, personQueryContext); if (filter != null) { @@ -1287,9 +1284,6 @@ private List getAllUuidsBatched(Integer batchSize, boolean allowPersonsW } @Override - @SuppressWarnings({ - "rawtypes", - "unchecked" }) public List getIndexList(PersonCriteria criteria, Integer first, Integer max, List sortProperties) { long startTime = DateHelper.startTime(); @@ -1298,7 +1292,7 @@ public List getIndexList(PersonCriteria criteria, Integer first, final Root person = cq.from(Person.class); final PersonQueryContext personQueryContext = new PersonQueryContext(cb, cq, person); - final PersonJoins personJoins = (PersonJoins) personQueryContext.getJoins(); + final PersonJoins personJoins = personQueryContext.getJoins(); personJoins.configure(criteria); final Join location = personJoins.getAddress(); @@ -1414,7 +1408,7 @@ public List getExportList(PersonCriteria criteria, int first, i final Root person = cq.from(Person.class); final PersonQueryContext personQueryContext = new PersonQueryContext(cb, cq, person); - PersonJoins joins = (PersonJoins) personQueryContext.getJoins(); + PersonJoins joins = personQueryContext.getJoins(); joins.configure(criteria); cq.multiselect( @@ -1510,7 +1504,6 @@ public List getExportList(PersonCriteria criteria, int first, i return persons; } - @SuppressWarnings("rawtypes") private Predicate createIndexListFilter(PersonCriteria criteria, PersonQueryContext personQueryContext) { CriteriaBuilder cb = personQueryContext.getCriteriaBuilder(); diff --git a/sormas-backend/src/main/java/de/symeda/sormas/backend/person/PersonService.java b/sormas-backend/src/main/java/de/symeda/sormas/backend/person/PersonService.java index 818dee39efa..6bd1f9663f6 100644 --- a/sormas-backend/src/main/java/de/symeda/sormas/backend/person/PersonService.java +++ b/sormas-backend/src/main/java/de/symeda/sormas/backend/person/PersonService.java @@ -325,7 +325,7 @@ public Predicate buildCriteriaFilter(PersonCriteria personCriteria, PersonQueryC final CriteriaBuilder cb = personQueryContext.getCriteriaBuilder(); final From personFrom = personQueryContext.getRoot(); - final PersonJoins personJoins = (PersonJoins) personQueryContext.getJoins(); + final PersonJoins personJoins = personQueryContext.getJoins(); final Join location = personJoins.getAddress(); final Join region = personJoins.getAddressJoins().getRegion(); final Join district = personJoins.getAddressJoins().getDistrict(); @@ -563,7 +563,7 @@ public Predicate inJurisdictionOrOwned(PersonQueryContext personQueryContext) { .of( personQueryContext.getQuery(), personQueryContext.getCriteriaBuilder(), - (PersonJoins) personQueryContext.getJoins(), + personQueryContext.getJoins(), currentUser, !featureConfigurationFacade.isPropertyValueTrue(FeatureType.IMMUNIZATION_MANAGEMENT, FeatureTypeProperty.REDUCED)) .inJurisdictionOrOwned(); From 9dc47b13286120eed38fba6aaa061ab2cc070fd0 Mon Sep 17 00:00:00 2001 From: Stefan Kock Date: Sat, 7 May 2022 08:50:17 +0200 Subject: [PATCH 047/167] #8747: Avoid TE QueryContext init directly with From outside own package --- .../main/java/de/symeda/sormas/backend/user/UserFacadeEjb.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sormas-backend/src/main/java/de/symeda/sormas/backend/user/UserFacadeEjb.java b/sormas-backend/src/main/java/de/symeda/sormas/backend/user/UserFacadeEjb.java index 65d30916142..a09fd4764d7 100644 --- a/sormas-backend/src/main/java/de/symeda/sormas/backend/user/UserFacadeEjb.java +++ b/sormas-backend/src/main/java/de/symeda/sormas/backend/user/UserFacadeEjb.java @@ -104,6 +104,7 @@ import de.symeda.sormas.backend.location.LocationFacadeEjb.LocationFacadeEjbLocal; import de.symeda.sormas.backend.task.TaskFacadeEjb; import de.symeda.sormas.backend.travelentry.TravelEntry; +import de.symeda.sormas.backend.travelentry.TravelEntryJoins; import de.symeda.sormas.backend.travelentry.TravelEntryJurisdictionPredicateValidator; import de.symeda.sormas.backend.travelentry.TravelEntryQueryContext; import de.symeda.sormas.backend.user.UserRoleConfigFacadeEjb.UserRoleConfigFacadeEjbLocal; @@ -451,7 +452,7 @@ public List getUsersHavingTravelEntryInJurisdiction(TravelEntr final Subquery travelEntrySubquery = cq.subquery(TravelEntry.class); final Root travelEntryRoot = travelEntrySubquery.from(TravelEntry.class); final TravelEntryJurisdictionPredicateValidator travelEntryJurisdictionPredicateValidator = - TravelEntryJurisdictionPredicateValidator.of(new TravelEntryQueryContext(cb, cq, travelEntryRoot), userRoot); + TravelEntryJurisdictionPredicateValidator.of(new TravelEntryQueryContext(cb, cq, new TravelEntryJoins(travelEntryRoot)), userRoot); travelEntrySubquery.select(travelEntryRoot) .where( From 31ffc30507927f6500bb7d1b02d977126595e5ab Mon Sep 17 00:00:00 2001 From: Stefan Kock Date: Sat, 7 May 2022 09:15:07 +0200 Subject: [PATCH 048/167] #8610: Code Formatting before changes --- .../SampleJurisdictionPredicateValidator.java | 105 +++++++++--------- 1 file changed, 52 insertions(+), 53 deletions(-) diff --git a/sormas-backend/src/main/java/de/symeda/sormas/backend/sample/SampleJurisdictionPredicateValidator.java b/sormas-backend/src/main/java/de/symeda/sormas/backend/sample/SampleJurisdictionPredicateValidator.java index 8c032e1fcbb..a4eef146a02 100644 --- a/sormas-backend/src/main/java/de/symeda/sormas/backend/sample/SampleJurisdictionPredicateValidator.java +++ b/sormas-backend/src/main/java/de/symeda/sormas/backend/sample/SampleJurisdictionPredicateValidator.java @@ -1,17 +1,16 @@ /* - * SORMAS® - Surveillance Outbreak Response Management & Analysis System - * Copyright © 2016-2021 Helmholtz-Zentrum für Infektionsforschung GmbH (HZI) - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * + * SORMAS® - Surveillance Outbreak Response Management & Analysis System + * Copyright © 2016-2021 Helmholtz-Zentrum für Infektionsforschung GmbH (HZI) + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . */ package de.symeda.sormas.backend.sample; @@ -42,18 +41,18 @@ private SampleJurisdictionPredicateValidator( SampleJoins joins, User user, List associatedJurisdictionValidators) { - super(cb, user, null, associatedJurisdictionValidators); - this.joins = joins; - } + super(cb, user, null, associatedJurisdictionValidators); + this.joins = joins; + } private SampleJurisdictionPredicateValidator( CriteriaBuilder cb, SampleJoins joins, Path userPath, List associatedJurisdictionValidators) { - super(cb, null, userPath, associatedJurisdictionValidators); - this.joins = joins; - } + super(cb, null, userPath, associatedJurisdictionValidators); + this.joins = joins; + } public static SampleJurisdictionPredicateValidator of(SampleQueryContext qc, User user) { final List associatedJurisdictionValidators = new ArrayList<>(); @@ -90,40 +89,40 @@ protected Predicate isInJurisdictionOrOwned() { return cb.or(reportedByCurrentUser, isInJurisdiction()); } - @Override - protected Predicate whenNotAllowed() { - return cb.disjunction(); - } - - @Override - protected Predicate whenNationalLevel() { - return cb.conjunction(); - } - - @Override - protected Predicate whenRegionalLevel() { - return cb.disjunction(); - } - - @Override - protected Predicate whenDistrictLevel() { - return cb.disjunction(); - } - - @Override - protected Predicate whenCommunityLevel() { - return cb.disjunction(); - } - - @Override - protected Predicate whenFacilityLevel() { - return cb.disjunction(); - } - - @Override - protected Predicate whenPointOfEntryLevel() { - return cb.disjunction(); - } + @Override + protected Predicate whenNotAllowed() { + return cb.disjunction(); + } + + @Override + protected Predicate whenNationalLevel() { + return cb.conjunction(); + } + + @Override + protected Predicate whenRegionalLevel() { + return cb.disjunction(); + } + + @Override + protected Predicate whenDistrictLevel() { + return cb.disjunction(); + } + + @Override + protected Predicate whenCommunityLevel() { + return cb.disjunction(); + } + + @Override + protected Predicate whenFacilityLevel() { + return cb.disjunction(); + } + + @Override + protected Predicate whenPointOfEntryLevel() { + return cb.disjunction(); + } @Override protected Predicate whenLaboratoryLevel() { From 99d0625578777cc50a1718ffffbe19afab75f364 Mon Sep 17 00:00:00 2001 From: Stefan Kock Date: Sat, 7 May 2022 09:16:33 +0200 Subject: [PATCH 049/167] #8610: Avoid joins only for id comparison --- .../sample/SampleJurisdictionPredicateValidator.java | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/sormas-backend/src/main/java/de/symeda/sormas/backend/sample/SampleJurisdictionPredicateValidator.java b/sormas-backend/src/main/java/de/symeda/sormas/backend/sample/SampleJurisdictionPredicateValidator.java index a4eef146a02..c2ddb8b01c5 100644 --- a/sormas-backend/src/main/java/de/symeda/sormas/backend/sample/SampleJurisdictionPredicateValidator.java +++ b/sormas-backend/src/main/java/de/symeda/sormas/backend/sample/SampleJurisdictionPredicateValidator.java @@ -82,10 +82,10 @@ public static SampleJurisdictionPredicateValidator withoutAssociations(CriteriaB @Override protected Predicate isInJurisdictionOrOwned() { final Predicate reportedByCurrentUser = cb.and( - cb.isNotNull(joins.getReportingUser()), + cb.isNotNull(joins.getRoot().get(Sample.REPORTING_USER)), user != null - ? cb.equal(joins.getReportingUser().get(User.ID), user.getId()) - : cb.equal(joins.getReportingUser().get(User.ID), userPath.get(User.ID))); + ? cb.equal(joins.getRoot().get(Sample.REPORTING_USER).get(User.ID), user.getId()) + : cb.equal(joins.getRoot().get(Sample.REPORTING_USER).get(User.ID), userPath.get(User.ID))); return cb.or(reportedByCurrentUser, isInJurisdiction()); } @@ -127,7 +127,7 @@ protected Predicate whenPointOfEntryLevel() { @Override protected Predicate whenLaboratoryLevel() { return user != null - ? cb.equal(joins.getLab().get(Facility.ID), user.getLaboratory().getId()) - : cb.equal(joins.getLab().get(Facility.ID), userPath.get(User.LABORATORY).get(Facility.ID)); + ? cb.equal(joins.getRoot().get(Sample.LAB).get(Facility.ID), user.getLaboratory().getId()) + : cb.equal(joins.getRoot().get(Sample.LAB).get(Facility.ID), userPath.get(User.LABORATORY).get(Facility.ID)); } } From b7650cf8e527cec24216cb264cb1ae54097ab933 Mon Sep 17 00:00:00 2001 From: Maciej Paszylka Date: Mon, 9 May 2022 10:33:47 +0200 Subject: [PATCH 050/167] fix --- .../events/EventDirectorySteps.java | 127 +++++++++--------- 1 file changed, 65 insertions(+), 62 deletions(-) diff --git a/sormas-e2e-tests/src/test/java/org/sormas/e2etests/steps/web/application/events/EventDirectorySteps.java b/sormas-e2e-tests/src/test/java/org/sormas/e2etests/steps/web/application/events/EventDirectorySteps.java index 6e3a4d728cb..1dbe7daa144 100644 --- a/sormas-e2e-tests/src/test/java/org/sormas/e2etests/steps/web/application/events/EventDirectorySteps.java +++ b/sormas-e2e-tests/src/test/java/org/sormas/e2etests/steps/web/application/events/EventDirectorySteps.java @@ -18,46 +18,6 @@ package org.sormas.e2etests.steps.web.application.events; -import cucumber.api.java8.En; -import org.openqa.selenium.WebDriverException; -import org.openqa.selenium.WebElement; -import org.sormas.e2etests.common.DataOperations; -import org.sormas.e2etests.entities.pojo.helpers.ComparisonHelper; -import org.sormas.e2etests.entities.pojo.web.EventGroup; -import org.sormas.e2etests.entities.services.EventGroupService; -import org.sormas.e2etests.entities.services.EventService; -import org.sormas.e2etests.enums.CommunityValues; -import org.sormas.e2etests.enums.DiseasesValues; -import org.sormas.e2etests.enums.DistrictsValues; -import org.sormas.e2etests.enums.EventReferenceDateOptions; -import org.sormas.e2etests.enums.RegionsValues; -import org.sormas.e2etests.enums.RiskLevelValues; -import org.sormas.e2etests.enums.SourceTypeValues; -import org.sormas.e2etests.enums.cases.epidemiologicalData.TypeOfPlace; -import org.sormas.e2etests.envconfig.manager.EnvironmentManager; -import org.sormas.e2etests.helpers.AssertHelpers; -import org.sormas.e2etests.helpers.WebDriverHelpers; -import org.sormas.e2etests.pages.application.NavBarPage; -import org.sormas.e2etests.pages.application.events.EventDirectoryPage; -import org.sormas.e2etests.state.ApiState; -import org.sormas.e2etests.steps.BaseSteps; -import org.testng.Assert; -import org.testng.asserts.SoftAssert; - -import javax.inject.Inject; -import java.io.File; -import java.time.LocalDate; -import java.time.ZoneId; -import java.time.format.DateTimeFormatter; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.concurrent.ConcurrentHashMap; -import java.util.concurrent.TimeUnit; -import java.util.concurrent.atomic.AtomicInteger; - import static org.sormas.e2etests.pages.application.cases.CaseDirectoryPage.CASE_COMMUNITY_FILTER_COMBOBOX; import static org.sormas.e2etests.pages.application.cases.CaseDirectoryPage.CASE_DATA_TYPE_FILTER_COMBOBOX; import static org.sormas.e2etests.pages.application.cases.CaseDirectoryPage.CASE_DISTRICT_FILTER_COMBOBOX; @@ -139,10 +99,50 @@ import static org.sormas.e2etests.pages.application.events.EventDirectoryPage.UNLINK_EVENT_BUTTON; import static org.sormas.e2etests.pages.application.events.EventDirectoryPage.getByEventUuid; import static org.sormas.e2etests.pages.application.events.EventDirectoryPage.getCheckboxByIndex; +import static org.sormas.e2etests.pages.application.events.EventDirectoryPage.getCheckboxByUUID; import static org.sormas.e2etests.pages.application.persons.PersonDirectoryPage.APPLY_FILTERS_BUTTON; import static org.sormas.e2etests.pages.application.persons.PersonDirectoryPage.RESET_FILTERS_BUTTON; import static org.sormas.e2etests.steps.BaseSteps.locale; +import cucumber.api.java8.En; +import java.io.File; +import java.time.LocalDate; +import java.time.ZoneId; +import java.time.format.DateTimeFormatter; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.concurrent.ConcurrentHashMap; +import java.util.concurrent.TimeUnit; +import java.util.concurrent.atomic.AtomicInteger; +import javax.inject.Inject; +import org.openqa.selenium.WebDriverException; +import org.openqa.selenium.WebElement; +import org.sormas.e2etests.common.DataOperations; +import org.sormas.e2etests.entities.pojo.helpers.ComparisonHelper; +import org.sormas.e2etests.entities.pojo.web.EventGroup; +import org.sormas.e2etests.entities.services.EventGroupService; +import org.sormas.e2etests.entities.services.EventService; +import org.sormas.e2etests.enums.CommunityValues; +import org.sormas.e2etests.enums.DiseasesValues; +import org.sormas.e2etests.enums.DistrictsValues; +import org.sormas.e2etests.enums.EventReferenceDateOptions; +import org.sormas.e2etests.enums.RegionsValues; +import org.sormas.e2etests.enums.RiskLevelValues; +import org.sormas.e2etests.enums.SourceTypeValues; +import org.sormas.e2etests.enums.cases.epidemiologicalData.TypeOfPlace; +import org.sormas.e2etests.envconfig.manager.EnvironmentManager; +import org.sormas.e2etests.helpers.AssertHelpers; +import org.sormas.e2etests.helpers.WebDriverHelpers; +import org.sormas.e2etests.pages.application.NavBarPage; +import org.sormas.e2etests.pages.application.events.EventDirectoryPage; +import org.sormas.e2etests.state.ApiState; +import org.sormas.e2etests.steps.BaseSteps; +import org.testng.Assert; +import org.testng.asserts.SoftAssert; + public class EventDirectorySteps implements En { private final WebDriverHelpers webDriverHelpers; private final BaseSteps baseSteps; @@ -197,7 +197,6 @@ public EventDirectorySteps( "I click checkbox to choose all Event results on Event Directory Page", () -> { webDriverHelpers.clickOnWebElementBySelector(FIRST_CHECKBOX_EVENT_DIRECTORY); - webDriverHelpers.waitForPageLoaded(); }); When( @@ -232,7 +231,6 @@ public EventDirectorySteps( When( "I chose District option in Event Group Directory", () -> { - webDriverHelpers.waitForPageLoaded(); String district = apiState.getCreatedEvent().getEventLocation().getDistrict().getUuid(); webDriverHelpers.selectFromCombobox( EVENT_DISTRICT_COMBOBOX_INPUT, DistrictsValues.getNameValueForUuid(district)); @@ -241,7 +239,6 @@ public EventDirectorySteps( When( "I chose Community option in Event Group Directory", () -> { - webDriverHelpers.waitForPageLoaded(); String community = apiState.getCreatedEvent().getEventLocation().getCommunity().getUuid(); webDriverHelpers.selectFromCombobox( EVENT_COMMUNITY_COMBOBOX_INPUT, CommunityValues.getNameValueForUuid(community)); @@ -250,20 +247,17 @@ public EventDirectorySteps( When( "I chose Region {string} option in Event Group Directory", (String regionOption) -> { - webDriverHelpers.waitForPageLoaded(); webDriverHelpers.selectFromCombobox(EVENT_REGION_COMBOBOX_INPUT, regionOption); }); When( "I chose District {string} option in Event Group Directory", (String districtOption) -> { - webDriverHelpers.waitForPageLoaded(); webDriverHelpers.selectFromCombobox(EVENT_DISTRICT_COMBOBOX_INPUT, districtOption); }); When( "I chose Community {string} option in Event Group Directory", (String communityOption) -> { - webDriverHelpers.waitForPageLoaded(); webDriverHelpers.selectFromCombobox(EVENT_COMMUNITY_COMBOBOX_INPUT, communityOption); }); @@ -282,7 +276,6 @@ public EventDirectorySteps( searchText = "All groups"; break; } - webDriverHelpers.waitForPageLoaded(); webDriverHelpers.selectFromCombobox(EVENT_STATUS_FILTER_COMBOBOX, searchText); }); @@ -353,14 +346,12 @@ public EventDirectorySteps( .build(); ComparisonHelper.compareEqualFieldsOfEntities( collectedGroup, createdGroup, List.of("name")); - webDriverHelpers.waitForPageLoaded(); }); When( "^I click on ([^\"]*) Radiobutton on Event Directory Page$", (String buttonName) -> { webDriverHelpers.clickWebElementByText(EVENTS_RADIO_BUTTON, buttonName); - webDriverHelpers.waitForPageLoaded(); }); When( @@ -407,7 +398,6 @@ public EventDirectorySteps( "I apply {string} to combobox on Event Directory Page", (String eventParameter) -> { webDriverHelpers.selectFromCombobox(EVENT_DISPLAY_COMBOBOX, eventParameter); - webDriverHelpers.waitForPageLoaded(); }); And( "I apply Date type filter to {string} on Event directory page", @@ -479,7 +469,6 @@ public EventDirectorySteps( When( "I fill Reporting User filter to {string} on Event Directory Page", (String reportingUser) -> { - webDriverHelpers.waitForPageLoaded(); webDriverHelpers.selectFromCombobox(FILTER_BY_REPORTING_USER, reportingUser); }); And( @@ -539,7 +528,6 @@ public EventDirectorySteps( When( "I filter by last created group in Event Directory Page", () -> { - webDriverHelpers.waitForPageLoaded(); webDriverHelpers.fillInWebElement(EVENT_GROUP_INPUT, EditEventSteps.groupEvent.getUuid()); }); @@ -552,7 +540,6 @@ public EventDirectorySteps( When( "I select Signal filter from quick filter", () -> { - webDriverHelpers.waitForPageLoaded(); TimeUnit.SECONDS.sleep(5); webDriverHelpers.clickOnWebElementBySelector(EventDirectoryPage.EVENT_SIGNAL); }); @@ -560,7 +547,6 @@ public EventDirectorySteps( When( "I select Event filter from quick filter", () -> { - webDriverHelpers.waitForPageLoaded(); TimeUnit.SECONDS.sleep(5); webDriverHelpers.clickOnWebElementBySelector(EventDirectoryPage.EVENT_EVENT); }); @@ -568,7 +554,6 @@ public EventDirectorySteps( When( "I select Screening filter from quick filter", () -> { - webDriverHelpers.waitForPageLoaded(); TimeUnit.SECONDS.sleep(5); webDriverHelpers.clickOnWebElementBySelector(EventDirectoryPage.EVENT_SCREENING); }); @@ -576,7 +561,6 @@ public EventDirectorySteps( When( "I select Cluster filter from quick filter", () -> { - webDriverHelpers.waitForPageLoaded(); TimeUnit.SECONDS.sleep(5); webDriverHelpers.clickOnWebElementBySelector(EventDirectoryPage.EVENT_CLUSTER); }); @@ -584,7 +568,6 @@ public EventDirectorySteps( When( "I select Dropped filter from quick filter", () -> { - webDriverHelpers.waitForPageLoaded(); TimeUnit.SECONDS.sleep(5); webDriverHelpers.clickOnWebElementBySelector(EventDirectoryPage.EVENT_DROPPED); }); @@ -660,7 +643,6 @@ public EventDirectorySteps( When( "I select Report Date among Event Reference Date options", () -> { - webDriverHelpers.waitForPageLoaded(); webDriverHelpers.selectFromCombobox( DATE_TYPE_COMBOBOX, EventReferenceDateOptions.REPORT_DATE.toString()); }); @@ -668,7 +650,6 @@ public EventDirectorySteps( When( "I fill in a date range in Date of Event From Epi Week and ...To fields", () -> { - webDriverHelpers.waitForPageLoaded(); eventService.timeRange = buildTimeRange(); webDriverHelpers.fillInWebElement( DATE_FROM_COMBOBOX, @@ -687,7 +668,6 @@ public EventDirectorySteps( When( "I check that the dates of displayed Event results are correct", () -> { - webDriverHelpers.waitForPageLoaded(); List> tableRowsData = getTableRowsData(); for (int i = 0; i < tableRowsData.size(); i++) { String dateCell = @@ -760,6 +740,12 @@ public EventDirectorySteps( webDriverHelpers.clickOnWebElementBySelector(FIRST_EVENT_PARTICIPANT); }); + When( + "I check if filtered participant for existing person appears in the event participants list", + () -> { + final String personUuid = apiState.getLastCreatedPerson().getUuid(); + webDriverHelpers.waitUntilElementIsVisibleAndClickable(getByEventUuid(personUuid)); + }); When( "I am accessing the event tab using the created event via api", () -> { @@ -813,7 +799,25 @@ public EventDirectorySteps( eventManagementStatus, "Event Management status is not correct")); }); - + When( + "^I select last created API result in grid in Event Directory for Bulk Action$", + () -> { + webDriverHelpers.waitForPageLoadingSpinnerToDisappear(40); + webDriverHelpers.scrollToElement(getCheckboxByUUID(apiState.getCreatedEvent().getUuid())); + webDriverHelpers.clickOnWebElementBySelector( + getCheckboxByUUID(apiState.getCreatedEvent().getUuid())); + webDriverHelpers.waitForPageLoadingSpinnerToDisappear(40); + }); + When( + "^I select last created UI result in grid in Event Directory for Bulk Action$", + () -> { + webDriverHelpers.waitForPageLoadingSpinnerToDisappear(40); + webDriverHelpers.scrollToElement( + getCheckboxByUUID(CreateNewEventSteps.newEvent.getUuid())); + webDriverHelpers.clickOnWebElementBySelector( + getCheckboxByUUID(CreateNewEventSteps.newEvent.getUuid())); + webDriverHelpers.waitForPageLoadingSpinnerToDisappear(40); + }); When( "I click on the More button on Event directory page", () -> webDriverHelpers.clickOnWebElementBySelector(MORE_BUTTON_EVENT_DIRECTORY)); @@ -821,7 +825,6 @@ public EventDirectorySteps( "I click Enter Bulk Edit Mode on Event directory page", () -> { webDriverHelpers.clickOnWebElementBySelector(ENTER_BULK_EDIT_MODE_EVENT_DIRECTORY); - webDriverHelpers.waitForPageLoaded(); }); When( "I click on the created event participant from the list", From 3851d45832657fd668480d6c0b7d96cc5c45dfad Mon Sep 17 00:00:00 2001 From: Michal Kozakiewicz Date: Mon, 9 May 2022 10:42:01 +0200 Subject: [PATCH 051/167] Added first version of scenario [SORDEV-9787] --- .../entries/CreateNewTravelEntryPage.java | 1 + .../entries/EditTravelEntryPage.java | 1 + .../entries/CreateNewTravelEntrySteps.java | 23 ++++++++++++++++- .../sanity/web/TravelEntryFilters.feature | 25 ++++++++++++------- 4 files changed, 40 insertions(+), 10 deletions(-) diff --git a/sormas-e2e-tests/src/main/java/org/sormas/e2etests/pages/application/entries/CreateNewTravelEntryPage.java b/sormas-e2e-tests/src/main/java/org/sormas/e2etests/pages/application/entries/CreateNewTravelEntryPage.java index 4e5479163c9..7ccf5cbb41b 100644 --- a/sormas-e2e-tests/src/main/java/org/sormas/e2etests/pages/application/entries/CreateNewTravelEntryPage.java +++ b/sormas-e2e-tests/src/main/java/org/sormas/e2etests/pages/application/entries/CreateNewTravelEntryPage.java @@ -47,6 +47,7 @@ public class CreateNewTravelEntryPage { public static final By PICK_A_EXISTING_CASE_LABEL_DE = By.xpath("//*[text()='Einen vorhandenen Fall w\u00E4hlen']"); public static final By ARRIVAL_DATE = By.cssSelector("#dateOfArrival input"); + public static final By REPORT_DATE = By.cssSelector("#reportDate input"); public static final By FIRST_TRAVEL_ENTRY_ID_BUTTON = By.cssSelector(".v-grid-row-has-data a[title]"); } diff --git a/sormas-e2e-tests/src/main/java/org/sormas/e2etests/pages/application/entries/EditTravelEntryPage.java b/sormas-e2e-tests/src/main/java/org/sormas/e2etests/pages/application/entries/EditTravelEntryPage.java index d356736470a..504df184961 100644 --- a/sormas-e2e-tests/src/main/java/org/sormas/e2etests/pages/application/entries/EditTravelEntryPage.java +++ b/sormas-e2e-tests/src/main/java/org/sormas/e2etests/pages/application/entries/EditTravelEntryPage.java @@ -38,6 +38,7 @@ public class EditTravelEntryPage { public static final By CREATE_CASE_FROM_TRAVEL_ENTRY = By.id("travelEntryCreateCase"); public static final By SAVE_NEW_CASE_FOR_TRAVEL_ENTRY_POPUP = By.cssSelector(".popupContent #commit"); + public static final By SAVE_EDIT_TRAVEL_PAGE = By.id("commit"); public static final By POINT_OF_ENTRY_CASE = By.xpath("//*[@id='pointOfEntry']/input"); public static final By DISEASE_NAME_INPUT = By.cssSelector(".popupContent #diseaseDetails"); public static final By TRAVEL_ENTRY_CASE_UUID = By.cssSelector("#caseIdLabel"); diff --git a/sormas-e2e-tests/src/test/java/org/sormas/e2etests/steps/web/application/entries/CreateNewTravelEntrySteps.java b/sormas-e2e-tests/src/test/java/org/sormas/e2etests/steps/web/application/entries/CreateNewTravelEntrySteps.java index 6d0ba1243aa..3ce7369a55e 100644 --- a/sormas-e2e-tests/src/test/java/org/sormas/e2etests/steps/web/application/entries/CreateNewTravelEntrySteps.java +++ b/sormas-e2e-tests/src/test/java/org/sormas/e2etests/steps/web/application/entries/CreateNewTravelEntrySteps.java @@ -34,6 +34,7 @@ import static org.sormas.e2etests.pages.application.entries.CreateNewTravelEntryPage.PICK_A_EXISTING_CASE_LABEL_DE; import static org.sormas.e2etests.pages.application.entries.CreateNewTravelEntryPage.PICK_A_EXISTING_PERSON_LABEL_DE; import static org.sormas.e2etests.pages.application.entries.CreateNewTravelEntryPage.PICK_OR_CREATE_PERSON_TITLE_DE; +import static org.sormas.e2etests.pages.application.entries.CreateNewTravelEntryPage.REPORT_DATE; import static org.sormas.e2etests.pages.application.entries.CreateNewTravelEntryPage.SAVE_BUTTON; import static org.sormas.e2etests.pages.application.entries.CreateNewTravelEntryPage.SAVE_POPUP_CONTENT; import static org.sormas.e2etests.pages.application.entries.EditTravelEntryPage.CASE_PERSON_NAME; @@ -43,12 +44,14 @@ import static org.sormas.e2etests.pages.application.entries.EditTravelEntryPage.INFO_BUTTON; import static org.sormas.e2etests.pages.application.entries.EditTravelEntryPage.LAST_NAME_INPUT; import static org.sormas.e2etests.pages.application.entries.EditTravelEntryPage.POINT_OF_ENTRY_CASE; +import static org.sormas.e2etests.pages.application.entries.EditTravelEntryPage.SAVE_EDIT_TRAVEL_PAGE; import static org.sormas.e2etests.pages.application.entries.EditTravelEntryPage.SAVE_NEW_CASE_FOR_TRAVEL_ENTRY_POPUP; import static org.sormas.e2etests.pages.application.entries.EditTravelEntryPage.TRAVEL_ENTRY_PERSON_TAB; import cucumber.api.java8.En; import java.time.LocalDate; import java.time.format.DateTimeFormatter; +import java.time.temporal.IsoFields; import java.util.List; import java.util.Locale; import java.util.concurrent.TimeUnit; @@ -113,7 +116,12 @@ public CreateNewTravelEntrySteps( When( "^I change a Report Date for previous week date$", () -> { - travelEntry.getReportDate().minusDays(7); + fillReportDate(travelEntry.getReportDate().minusDays(7), Locale.GERMAN); + LocalDate dateReport = + LocalDate.parse( + webDriverHelpers.getValueFromWebElement(REPORT_DATE), DATE_FORMATTER_DE); + int week = dateReport.get(IsoFields.WEEK_OF_WEEK_BASED_YEAR); + System.out.println("Week of year: " + week); }); When( @@ -183,6 +191,13 @@ public CreateNewTravelEntrySteps( webDriverHelpers.clickOnWebElementBySelector(SAVE_BUTTON); }); + When( + "I click on Save button from the edit travel entry form", + () -> { + webDriverHelpers.scrollToElement(SAVE_EDIT_TRAVEL_PAGE); + webDriverHelpers.clickOnWebElementBySelector(SAVE_EDIT_TRAVEL_PAGE); + }); + When( "^I navigate to person tab in Edit travel entry page$", () -> { @@ -361,6 +376,12 @@ private void fillDateOfArrival(LocalDate dateOfArrival, Locale locale) { else webDriverHelpers.clearAndFillInWebElement(ARRIVAL_DATE, formatter.format(dateOfArrival)); } + private void fillReportDate(LocalDate reportDate, Locale locale) { + if (locale.equals(Locale.GERMAN)) + webDriverHelpers.clearAndFillInWebElement(REPORT_DATE, DATE_FORMATTER_DE.format(reportDate)); + else webDriverHelpers.clearAndFillInWebElement(REPORT_DATE, formatter.format(reportDate)); + } + private void selectSex(String sex) { webDriverHelpers.selectFromCombobox(CreateNewTravelEntryPage.SEX_COMBOBOX, sex); } diff --git a/sormas-e2e-tests/src/test/resources/features/sanity/web/TravelEntryFilters.feature b/sormas-e2e-tests/src/test/resources/features/sanity/web/TravelEntryFilters.feature index 449936f3b92..c8940ae4b4d 100644 --- a/sormas-e2e-tests/src/test/resources/features/sanity/web/TravelEntryFilters.feature +++ b/sormas-e2e-tests/src/test/resources/features/sanity/web/TravelEntryFilters.feature @@ -52,25 +52,32 @@ Scenario: Check Travel Entry filters And I click on the Entries button from navbar And I click on the New Travel Entry button from Travel Entries directory When I fill the required fields in a new travel entry form -# And I change a Report Date for previous week date And I click on Save button from the new travel entry form Then I check the created data is correctly displayed on Edit travel entry page for DE version And I navigate to person tab in Edit travel entry page And I check the created data is correctly displayed on Edit travel entry person page for DE version + +# ToDO(DELETE!!!): +# Ponizsze Stepy sa najprawdopodobniej do usuniecia !!!-> był to swoisty workaround, który po naprawieniu buga jest bez sensu +# And I click on the Entries button from navbar +# And I filter by Person ID on Travel Entry directory page + +# And I open last created Travel Entry +# And I change a Report Date for previous week date +# And I click on Save button from the edit travel entry form + And I click on the Entries button from navbar And I filter by Person ID on Travel Entry directory page - And I open last created Travel Entry -# And I change a Report Date for previous week date -> zminic date raportu i jedzemy !!! And I click on SHOW MORE FILTERS BUTTON Travel Entry directory page - And I fill Travel Entry from input to 2 days before UI Travel Entry created on Travel Entry directory page - And I fill Travel Entry to input to 5 days after UI Travel Entry created on Travel Entry directory page + And I fill Travel Entry from input to 5 days before UI Travel Entry created on Travel Entry directory page + And I fill Travel Entry to input to 3 days after UI Travel Entry created on Travel Entry directory page And I click APPLY BUTTON in Travel Entry Directory Page And I check that number of displayed Travel Entry results is 1 - And I fill Travel Entry to input to 3 days before UI Travel Entry created on Travel Entry directory page + And I fill Travel Entry to input to 2 days before UI Travel Entry created on Travel Entry directory page And I click APPLY BUTTON in Travel Entry Directory Page And I check that number of displayed Travel Entry results is 0 And I apply "Nach Epi Woche" to data filter option combobox on Travel Entry directory page - - - And I check the edited data is correctly displayed on Edit case page \ No newline at end of file +# ToDO -> przykladowo weekend roku pozyskiwany jest w "I change a Report Date for previous week date" +# uzupelnic weekd roku i po nim wyszukac ostatni weekend w comboboxie +# I zrobic filtracje danych i bedzie git!!! \ No newline at end of file From 88e66a89a4e327637bfa16bbd9f85eda7c4e9342 Mon Sep 17 00:00:00 2001 From: dinua Date: Mon, 9 May 2022 12:04:08 +0300 Subject: [PATCH 052/167] #8899 fix bug --- .../java/de/symeda/sormas/backend/event/EventFacadeEjb.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sormas-backend/src/main/java/de/symeda/sormas/backend/event/EventFacadeEjb.java b/sormas-backend/src/main/java/de/symeda/sormas/backend/event/EventFacadeEjb.java index 2077b5e7374..452dcf365da 100644 --- a/sormas-backend/src/main/java/de/symeda/sormas/backend/event/EventFacadeEjb.java +++ b/sormas-backend/src/main/java/de/symeda/sormas/backend/event/EventFacadeEjb.java @@ -335,7 +335,9 @@ public long count(EventCriteria eventCriteria) { if (eventCriteria != null) { if (eventCriteria.getUserFilterIncluded()) { - filter = service.createUserFilter(queryContext); + EventUserFilterCriteria eventUserFilterCriteria = new EventUserFilterCriteria(); + eventUserFilterCriteria.includeUserCaseAndEventParticipantFilter(true); + filter = service.createUserFilter(queryContext, eventUserFilterCriteria); } Predicate criteriaFilter = service.buildCriteriaFilter(eventCriteria, queryContext); From e73c100cbde62cd5a89032e55227e4ff6fc6246e Mon Sep 17 00:00:00 2001 From: Maciej Paszylka Date: Mon, 9 May 2022 12:33:08 +0200 Subject: [PATCH 053/167] fix --- .../web/application/entries/TravelEntryDirectorySteps.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sormas-e2e-tests/src/test/java/org/sormas/e2etests/steps/web/application/entries/TravelEntryDirectorySteps.java b/sormas-e2e-tests/src/test/java/org/sormas/e2etests/steps/web/application/entries/TravelEntryDirectorySteps.java index 6ba244ffc71..e1bc42748f7 100644 --- a/sormas-e2e-tests/src/test/java/org/sormas/e2etests/steps/web/application/entries/TravelEntryDirectorySteps.java +++ b/sormas-e2e-tests/src/test/java/org/sormas/e2etests/steps/web/application/entries/TravelEntryDirectorySteps.java @@ -121,10 +121,10 @@ public TravelEntryDirectorySteps( webDriverHelpers.clickOnWebElementBySelector(NEW_TRAVEL_ENTRY_BUTTON); }); When( - "^I select first (\\d+) results in grid in Travel Entry Directory$", + "^I select last (\\d+) results in grid in Travel Entry Directory$", (Integer number) -> { webDriverHelpers.waitForPageLoadingSpinnerToDisappear(40); - for (int i = 1; i <= number; i++) { + for (int i = 10; i <= number+10; i++) { webDriverHelpers.scrollToElement(getCheckboxByIndex(String.valueOf(i))); webDriverHelpers.clickOnWebElementBySelector(getCheckboxByIndex(String.valueOf(i))); } From 1c8272b4b1d869029b302ad20d6e58aa2fce844b Mon Sep 17 00:00:00 2001 From: Maciej Paszylka Date: Mon, 9 May 2022 13:57:32 +0200 Subject: [PATCH 054/167] fix --- .../entries/EditTravelEntryPage.java | 1 + .../entries/CreateNewTravelEntrySteps.java | 6 +++++ .../entries/TravelEntryDirectorySteps.java | 14 +++++++++-- .../persons/PersonDirectorySteps.java | 4 ++-- .../features/sanity/web/TravelEntry.feature | 23 ++++++++++++------- 5 files changed, 36 insertions(+), 12 deletions(-) diff --git a/sormas-e2e-tests/src/main/java/org/sormas/e2etests/pages/application/entries/EditTravelEntryPage.java b/sormas-e2e-tests/src/main/java/org/sormas/e2etests/pages/application/entries/EditTravelEntryPage.java index e1f71bc8c51..b306869ae6a 100644 --- a/sormas-e2e-tests/src/main/java/org/sormas/e2etests/pages/application/entries/EditTravelEntryPage.java +++ b/sormas-e2e-tests/src/main/java/org/sormas/e2etests/pages/application/entries/EditTravelEntryPage.java @@ -35,6 +35,7 @@ public class EditTravelEntryPage { public static final By POINT_OF_ENTRY_COMBOBOX = By.cssSelector("#pointOfEntry div"); public static final By POINT_OF_ENTRY_DETAILS_INPUT = By.cssSelector("#pointOfEntryDetails"); public static final By TRAVEL_ENTRY_PERSON_TAB = By.id("tab-travelEntries-person"); + public static final By TRAVEL_ENTRY_TAB = By.id("tab-travelEntries-data"); public static final By PERSON_ID_LABEL = By.xpath("//div[contains(@location,'personInformationHeadingLoc')]"); public static final By CREATE_CASE_FROM_TRAVEL_ENTRY = By.id("travelEntryCreateCase"); diff --git a/sormas-e2e-tests/src/test/java/org/sormas/e2etests/steps/web/application/entries/CreateNewTravelEntrySteps.java b/sormas-e2e-tests/src/test/java/org/sormas/e2etests/steps/web/application/entries/CreateNewTravelEntrySteps.java index 1c3e867c059..388c46879c8 100644 --- a/sormas-e2e-tests/src/test/java/org/sormas/e2etests/steps/web/application/entries/CreateNewTravelEntrySteps.java +++ b/sormas-e2e-tests/src/test/java/org/sormas/e2etests/steps/web/application/entries/CreateNewTravelEntrySteps.java @@ -45,6 +45,7 @@ import static org.sormas.e2etests.pages.application.entries.EditTravelEntryPage.POINT_OF_ENTRY_CASE; import static org.sormas.e2etests.pages.application.entries.EditTravelEntryPage.SAVE_NEW_CASE_FOR_TRAVEL_ENTRY_POPUP; import static org.sormas.e2etests.pages.application.entries.EditTravelEntryPage.TRAVEL_ENTRY_PERSON_TAB; +import static org.sormas.e2etests.pages.application.entries.EditTravelEntryPage.TRAVEL_ENTRY_TAB; import cucumber.api.java8.En; import java.time.LocalDate; @@ -176,6 +177,11 @@ public CreateNewTravelEntrySteps( webDriverHelpers.clickOnWebElementBySelector(TRAVEL_ENTRY_PERSON_TAB); webDriverHelpers.waitUntilElementIsVisibleAndClickable(PERSON_ID_LABEL); }); + When( + "^I navigate to Edit travel entry page$", + () -> { + webDriverHelpers.clickOnWebElementBySelector(TRAVEL_ENTRY_TAB); + }); When( "I collect the Travel Entry person UUID displayed on Travel Entry Person page", () -> collectTravelEntryPersonUuid = collectTravelEntryPersonUuid()); diff --git a/sormas-e2e-tests/src/test/java/org/sormas/e2etests/steps/web/application/entries/TravelEntryDirectorySteps.java b/sormas-e2e-tests/src/test/java/org/sormas/e2etests/steps/web/application/entries/TravelEntryDirectorySteps.java index e1bc42748f7..168fe067bf8 100644 --- a/sormas-e2e-tests/src/test/java/org/sormas/e2etests/steps/web/application/entries/TravelEntryDirectorySteps.java +++ b/sormas-e2e-tests/src/test/java/org/sormas/e2etests/steps/web/application/entries/TravelEntryDirectorySteps.java @@ -121,10 +121,20 @@ public TravelEntryDirectorySteps( webDriverHelpers.clickOnWebElementBySelector(NEW_TRAVEL_ENTRY_BUTTON); }); When( - "^I select last (\\d+) results in grid in Travel Entry Directory$", + "^I select last created UI result in grid in Travel Entry Directory for Bulk Action$", + () -> { + webDriverHelpers.waitForPageLoadingSpinnerToDisappear(40); + webDriverHelpers.scrollToElement( + getCheckboxByUUID(CreateNewTravelEntrySteps.TravelEntryUuid.getUuid())); + webDriverHelpers.clickOnWebElementBySelector( + getCheckboxByUUID(CreateNewTravelEntrySteps.TravelEntryUuid.getUuid())); + webDriverHelpers.waitForPageLoadingSpinnerToDisappear(40); + }); + When( + "^I select (\\d+) results in grid in Travel Entry Directory$", (Integer number) -> { webDriverHelpers.waitForPageLoadingSpinnerToDisappear(40); - for (int i = 10; i <= number+10; i++) { + for (int i = 10; i < number + 10; i++) { webDriverHelpers.scrollToElement(getCheckboxByIndex(String.valueOf(i))); webDriverHelpers.clickOnWebElementBySelector(getCheckboxByIndex(String.valueOf(i))); } diff --git a/sormas-e2e-tests/src/test/java/org/sormas/e2etests/steps/web/application/persons/PersonDirectorySteps.java b/sormas-e2e-tests/src/test/java/org/sormas/e2etests/steps/web/application/persons/PersonDirectorySteps.java index 75302292aab..c55ede59ff7 100644 --- a/sormas-e2e-tests/src/test/java/org/sormas/e2etests/steps/web/application/persons/PersonDirectorySteps.java +++ b/sormas-e2e-tests/src/test/java/org/sormas/e2etests/steps/web/application/persons/PersonDirectorySteps.java @@ -179,11 +179,11 @@ public PersonDirectorySteps( webDriverHelpers.fillInWebElement(MULTIPLE_OPTIONS_SEARCH_INPUT, personUUID); }); Then( - "I fill UUID of the collected person from Travel Entry", + "I fill UUID of the collected person from last created Travel Entry", () -> { String personUUID = dataOperations.getPartialUuidFromAssociatedLink( - CreateNewTravelEntrySteps.collectTravelEntryPersonUuid); + CreateNewTravelEntrySteps.aTravelEntry.getUuid()); webDriverHelpers.fillInWebElement(MULTIPLE_OPTIONS_SEARCH_INPUT, personUUID); }); diff --git a/sormas-e2e-tests/src/test/resources/features/sanity/web/TravelEntry.feature b/sormas-e2e-tests/src/test/resources/features/sanity/web/TravelEntry.feature index 953d6ecf36a..a3b98549559 100644 --- a/sormas-e2e-tests/src/test/resources/features/sanity/web/TravelEntry.feature +++ b/sormas-e2e-tests/src/test/resources/features/sanity/web/TravelEntry.feature @@ -120,7 +120,7 @@ Feature: Create travel entries Given I log in as a Admin User And I click on the Entries button from navbar And I click on Enter Bulk Edit Mode from Travel Entry Directory - And I select first 3 results in grid in Travel Entry Directory + And I select 3 results in grid in Travel Entry Directory And I click on Bulk Actions combobox in Travel Entry Directory And I click on Delete button from Bulk Actions Combobox in Travel Entry Directory And I click yes on the CONFIRM REMOVAL popup from Task Directory page @@ -130,21 +130,28 @@ Feature: Create travel entries Scenario: Deleting entry assigned to a person in Travel Entry Directory Given I log in as a Admin User And I click on the Entries button from navbar - And I click on Enter Bulk Edit Mode from Travel Entry Directory - And I click "Nur in Fälle konvertierte Einreisen" checkbox on Travel Entry directory page - And I click APPLY BUTTON in Travel Entry Directory Page - And I click on first filtered record in Travel Entry + And I click on the New Travel Entry button from Travel Entries directory + When I fill the required fields in a new travel entry form + And I click on Save button from the new travel entry form + Then I check the created data is correctly displayed on Edit travel entry page for DE version And I collect travel UUID from travel entry And I navigate to person tab in Edit travel entry page - And I collect the Travel Entry person UUID displayed on Travel Entry Person page + And I check the created data is correctly displayed on Edit travel entry person page for DE version + And I navigate to Edit travel entry page + When I click on new case button for travel entry + Then I check if data from travel entry for new case is correct + And I save the new case for travel entry And I click on the Entries button from navbar - And I select chosen Travel Entry result + And I click on Enter Bulk Edit Mode from Travel Entry Directory + And I click "Nur in Fälle konvertierte Einreisen" checkbox on Travel Entry directory page + And I click APPLY BUTTON in Travel Entry Directory Page + And I select last created UI result in grid in Travel Entry Directory for Bulk Action And I click on Bulk Actions combobox in Travel Entry Directory And I click on Delete button from Bulk Actions Combobox in Travel Entry Directory And I click yes on the CONFIRM REMOVAL popup from Task Directory page And I check if popup deletion message appeared When I click on the Persons button from navbar - And I fill UUID of the collected person from Travel Entry + And I fill UUID of the collected person from last created Travel Entry Then I apply on the APPLY FILTERS button And I click on first person in person directory Then I check if there is no travel entry assigned to Person From 99730e6efd01385955b7696f8da3d93952bb9e44 Mon Sep 17 00:00:00 2001 From: Maciej Paszylka Date: Tue, 10 May 2022 08:27:12 +0200 Subject: [PATCH 055/167] fix --- .../steps/web/application/entries/CreateNewTravelEntrySteps.java | 1 + 1 file changed, 1 insertion(+) diff --git a/sormas-e2e-tests/src/test/java/org/sormas/e2etests/steps/web/application/entries/CreateNewTravelEntrySteps.java b/sormas-e2e-tests/src/test/java/org/sormas/e2etests/steps/web/application/entries/CreateNewTravelEntrySteps.java index 388c46879c8..60d7bc35723 100644 --- a/sormas-e2e-tests/src/test/java/org/sormas/e2etests/steps/web/application/entries/CreateNewTravelEntrySteps.java +++ b/sormas-e2e-tests/src/test/java/org/sormas/e2etests/steps/web/application/entries/CreateNewTravelEntrySteps.java @@ -169,6 +169,7 @@ public CreateNewTravelEntrySteps( "^I click on Save button from the new travel entry form$", () -> { webDriverHelpers.clickOnWebElementBySelector(SAVE_BUTTON); + webDriverHelpers.waitUntilElementIsVisibleAndClickable(UUID_INPUT); }); When( From e7976f03c83e13bf881d948d76382f18a9c7b686 Mon Sep 17 00:00:00 2001 From: Stefan Kock Date: Tue, 10 May 2022 10:19:14 +0200 Subject: [PATCH 056/167] #8747 Only do event participant join when needed for jurisd. level --- .../main/java/de/symeda/sormas/backend/event/EventService.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sormas-backend/src/main/java/de/symeda/sormas/backend/event/EventService.java b/sormas-backend/src/main/java/de/symeda/sormas/backend/event/EventService.java index 453c1b8d04e..71089c2b2b9 100644 --- a/sormas-backend/src/main/java/de/symeda/sormas/backend/event/EventService.java +++ b/sormas-backend/src/main/java/de/symeda/sormas/backend/event/EventService.java @@ -363,7 +363,6 @@ public Predicate createUserFilter(final EventQueryContext queryContext, final Ev final CriteriaBuilder cb = queryContext.getCriteriaBuilder(); final EventJoins eventJoins = queryContext.getJoins(); final From eventJoin = queryContext.getRoot(); - final From eventParticipantJoin = eventJoins.getEventParticipants(); if (jurisdictionLevel != JurisdictionLevel.NATION && !currentUser.hasUserRole(UserRole.REST_USER)) { switch (jurisdictionLevel) { @@ -395,6 +394,7 @@ public Predicate createUserFilter(final EventQueryContext queryContext, final Ev final Root sampleRoot = sampleSubQuery.from(Sample.class); final SampleJoins sampleJoins = new SampleJoins(sampleRoot); final Join eventParticipant = sampleJoins.getEventParticipant(); + final From eventParticipantJoin = eventJoins.getEventParticipants(); SampleJurisdictionPredicateValidator sampleJurisdictionPredicateValidator = SampleJurisdictionPredicateValidator.withoutAssociations(cb, sampleJoins, currentUser); sampleSubQuery From 70931c0f8ef50a1999e9e278c5d6fdd461f6762d Mon Sep 17 00:00:00 2001 From: Christopher Riedel Date: Mon, 9 May 2022 09:55:04 +0200 Subject: [PATCH 057/167] fixed #8838 --- .../de/symeda/sormas/api/i18n/Captions.java | 28 +++++++++++++++++ .../src/main/resources/captions.properties | 30 +++++++++++++++++++ 2 files changed, 58 insertions(+) diff --git a/sormas-api/src/main/java/de/symeda/sormas/api/i18n/Captions.java b/sormas-api/src/main/java/de/symeda/sormas/api/i18n/Captions.java index aea5bb285fb..b7af2fbed6b 100644 --- a/sormas-api/src/main/java/de/symeda/sormas/api/i18n/Captions.java +++ b/sormas-api/src/main/java/de/symeda/sormas/api/i18n/Captions.java @@ -267,6 +267,7 @@ public interface Captions { String caseCreateNew = "caseCreateNew"; String CaseData = "CaseData"; String CaseData_additionalDetails = "CaseData.additionalDetails"; + String CaseData_ageAndBirthDate = "CaseData.ageAndBirthDate"; String CaseData_bloodOrganOrTissueDonated = "CaseData.bloodOrganOrTissueDonated"; String CaseData_caseClassification = "CaseData.caseClassification"; String CaseData_caseConfirmationBasis = "CaseData.caseConfirmationBasis"; @@ -566,7 +567,9 @@ public interface Captions { String columnVaccineName = "columnVaccineName"; String Community = "Community"; String Community_archived = "Community.archived"; + String Community_district = "Community.district"; String Community_externalID = "Community.externalID"; + String Community_region = "Community.region"; String communityActiveCommunities = "communityActiveCommunities"; String communityAllCommunities = "communityAllCommunities"; String communityArchivedCommunities = "communityArchivedCommunities"; @@ -577,6 +580,7 @@ public interface Captions { String Configuration_PointsOfEntry = "Configuration.PointsOfEntry"; String Contact = "Contact"; String Contact_additionalDetails = "Contact.additionalDetails"; + String Contact_ageAndBirthDate = "Contact.ageAndBirthDate"; String Contact_careForPeopleOver60 = "Contact.careForPeopleOver60"; String Contact_caseClassification = "Contact.caseClassification"; String Contact_caseIdExternalSystem = "Contact.caseIdExternalSystem"; @@ -592,6 +596,7 @@ public interface Captions { String Contact_cazeDistrict = "Contact.cazeDistrict"; String Contact_community = "Contact.community"; String Contact_communityUuid = "Contact.communityUuid"; + String Contact_completeness = "Contact.completeness"; String Contact_contactCategory = "Contact.contactCategory"; String Contact_contactClassification = "Contact.contactClassification"; String Contact_contactIdentificationSource = "Contact.contactIdentificationSource"; @@ -958,6 +963,7 @@ public interface Captions { String District_externalID = "District.externalID"; String District_growthRate = "District.growthRate"; String District_population = "District.population"; + String District_region = "District.region"; String districtActiveDistricts = "districtActiveDistricts"; String districtAllDistricts = "districtAllDistricts"; String districtArchivedDistricts = "districtArchivedDistricts"; @@ -1001,6 +1007,7 @@ public interface Captions { String epiWeekTo = "epiWeekTo"; String Event = "Event"; String Event_caseCount = "Event.caseCount"; + String Event_community = "Event.community"; String Event_connectionNumber = "Event.connectionNumber"; String Event_contactCount = "Event.contactCount"; String Event_contactCountMethod = "Event.contactCountMethod"; @@ -1010,6 +1017,7 @@ public interface Captions { String Event_diseaseShort = "Event.diseaseShort"; String Event_diseaseTransmissionMode = "Event.diseaseTransmissionMode"; String Event_diseaseVariant = "Event.diseaseVariant"; + String Event_district = "Event.district"; String Event_endDate = "Event.endDate"; String Event_epidemiologicalEvidence = "Event.epidemiologicalEvidence"; String Event_eventActions = "Event.eventActions"; @@ -1045,6 +1053,7 @@ public interface Captions { String Event_numberOfPendingTasks = "Event.numberOfPendingTasks"; String Event_parenteralTransmissionMode = "Event.parenteralTransmissionMode"; String Event_participantCount = "Event.participantCount"; + String Event_region = "Event.region"; String Event_reportDateTime = "Event.reportDateTime"; String Event_reportingUser = "Event.reportingUser"; String Event_responsibleUser = "Event.responsibleUser"; @@ -1330,9 +1339,11 @@ public interface Captions { String Immunization = "Immunization"; String Immunization_additionalDetails = "Immunization.additionalDetails"; String Immunization_ageAndBirthDate = "Immunization.ageAndBirthDate"; + String Immunization_community = "Immunization.community"; String Immunization_country = "Immunization.country"; String Immunization_disease = "Immunization.disease"; String Immunization_diseaseDetails = "Immunization.diseaseDetails"; + String Immunization_district = "Immunization.district"; String Immunization_endDate = "Immunization.endDate"; String Immunization_externalId = "Immunization.externalId"; String Immunization_firstVaccinationDate = "Immunization.firstVaccinationDate"; @@ -1355,6 +1366,7 @@ public interface Captions { String Immunization_positiveTestResultDate = "Immunization.positiveTestResultDate"; String Immunization_previousInfection = "Immunization.previousInfection"; String Immunization_recoveryDate = "Immunization.recoveryDate"; + String Immunization_region = "Immunization.region"; String Immunization_reportDate = "Immunization.reportDate"; String Immunization_responsibleCommunity = "Immunization.responsibleCommunity"; String Immunization_responsibleDistrict = "Immunization.responsibleDistrict"; @@ -1697,6 +1709,7 @@ public interface Captions { String PointOfEntry = "PointOfEntry"; String PointOfEntry_active = "PointOfEntry.active"; String PointOfEntry_archived = "PointOfEntry.archived"; + String PointOfEntry_district = "PointOfEntry.district"; String PointOfEntry_externalID = "PointOfEntry.externalID"; String PointOfEntry_latitude = "PointOfEntry.latitude"; String PointOfEntry_longitude = "PointOfEntry.longitude"; @@ -1705,6 +1718,7 @@ public interface Captions { String PointOfEntry_OTHER_POE = "PointOfEntry.OTHER_POE"; String PointOfEntry_OTHER_SEAPORT = "PointOfEntry.OTHER_SEAPORT"; String PointOfEntry_pointOfEntryType = "PointOfEntry.pointOfEntryType"; + String PointOfEntry_region = "PointOfEntry.region"; String pointOfEntryActivePointsOfEntry = "pointOfEntryActivePointsOfEntry"; String pointOfEntryAllPointsOfEntry = "pointOfEntryAllPointsOfEntry"; String pointOfEntryArchivedPointsOfEntry = "pointOfEntryArchivedPointsOfEntry"; @@ -1778,7 +1792,9 @@ public interface Captions { String Sample_casePersonName = "Sample.casePersonName"; String Sample_caseRegion = "Sample.caseRegion"; String Sample_comment = "Sample.comment"; + String Sample_community = "Sample.community"; String Sample_diseaseShort = "Sample.diseaseShort"; + String Sample_district = "Sample.district"; String Sample_fieldSampleID = "Sample.fieldSampleID"; String Sample_lab = "Sample.lab"; String Sample_labDetails = "Sample.labDetails"; @@ -1792,6 +1808,7 @@ public interface Captions { String Sample_received = "Sample.received"; String Sample_receivedDate = "Sample.receivedDate"; String Sample_referredToUuid = "Sample.referredToUuid"; + String Sample_region = "Sample.region"; String Sample_reportDateTime = "Sample.reportDateTime"; String Sample_reportInfo = "Sample.reportInfo"; String Sample_reportingUser = "Sample.reportingUser"; @@ -2209,11 +2226,13 @@ public interface Captions { String Task_contextReference = "Task.contextReference"; String Task_creatorComment = "Task.creatorComment"; String Task_creatorUser = "Task.creatorUser"; + String Task_district = "Task.district"; String Task_dueDate = "Task.dueDate"; String Task_event = "Task.event"; String Task_observerUsers = "Task.observerUsers"; String Task_perceivedStart = "Task.perceivedStart"; String Task_priority = "Task.priority"; + String Task_region = "Task.region"; String Task_statusChangeDate = "Task.statusChangeDate"; String Task_suggestedStart = "Task.suggestedStart"; String Task_taskAssignee = "Task.taskAssignee"; @@ -2266,6 +2285,7 @@ public interface Captions { String TravelEntry_person = "TravelEntry.person"; String TravelEntry_personFirstName = "TravelEntry.personFirstName"; String TravelEntry_personLastName = "TravelEntry.personLastName"; + String TravelEntry_pointOfEntry = "TravelEntry.pointOfEntry"; String TravelEntry_pointOfEntryDetails = "TravelEntry.pointOfEntryDetails"; String TravelEntry_pointOfEntryDistrict = "TravelEntry.pointOfEntryDistrict"; String TravelEntry_pointOfEntryName = "TravelEntry.pointOfEntryName"; @@ -2332,12 +2352,15 @@ public interface Captions { String User_active = "User.active"; String User_address = "User.address"; String User_associatedOfficer = "User.associatedOfficer"; + String User_community = "User.community"; + String User_district = "User.district"; String User_hasConsentedToGdpr = "User.hasConsentedToGdpr"; String User_healthFacility = "User.healthFacility"; String User_laboratory = "User.laboratory"; String User_limitedDisease = "User.limitedDisease"; String User_phone = "User.phone"; String User_pointOfEntry = "User.pointOfEntry"; + String User_region = "User.region"; String User_userEmail = "User.userEmail"; String User_userName = "User.userName"; String User_userRoles = "User.userRoles"; @@ -2485,10 +2508,14 @@ public interface Captions { String WeeklyReport_epiWeek = "WeeklyReport.epiWeek"; String WeeklyReport_year = "WeeklyReport.year"; String WeeklyReportEntry_numberOfCases = "WeeklyReportEntry.numberOfCases"; + String WeeklyReportInformantSummary_community = "WeeklyReportInformantSummary.community"; + String WeeklyReportInformantSummary_facility = "WeeklyReportInformantSummary.facility"; + String WeeklyReportInformantSummary_informant = "WeeklyReportInformantSummary.informant"; String WeeklyReportInformantSummary_informantReportDate = "WeeklyReportInformantSummary.informantReportDate"; String WeeklyReportInformantSummary_totalCaseCount = "WeeklyReportInformantSummary.totalCaseCount"; String weeklyReportNoReport = "weeklyReportNoReport"; String weeklyReportOfficerInformants = "weeklyReportOfficerInformants"; + String WeeklyReportOfficerSummary_district = "WeeklyReportOfficerSummary.district"; String WeeklyReportOfficerSummary_informantReportPercentage = "WeeklyReportOfficerSummary.informantReportPercentage"; String WeeklyReportOfficerSummary_informantReports = "WeeklyReportOfficerSummary.informantReports"; String WeeklyReportOfficerSummary_informants = "WeeklyReportOfficerSummary.informants"; @@ -2506,5 +2533,6 @@ public interface Captions { String WeeklyReportRegionSummary_officerReports = "WeeklyReportRegionSummary.officerReports"; String WeeklyReportRegionSummary_officers = "WeeklyReportRegionSummary.officers"; String WeeklyReportRegionSummary_officerZeroReports = "WeeklyReportRegionSummary.officerZeroReports"; + String WeeklyReportRegionSummary_region = "WeeklyReportRegionSummary.region"; String weeklyReportsInDistrict = "weeklyReportsInDistrict"; } diff --git a/sormas-api/src/main/resources/captions.properties b/sormas-api/src/main/resources/captions.properties index 50c98a814f7..4352fee28be 100644 --- a/sormas-api/src/main/resources/captions.properties +++ b/sormas-api/src/main/resources/captions.properties @@ -362,6 +362,7 @@ caseCreateNew=Create new case caseDataEnterHomeAddressNow=Enter home address of the case person now caseCancelDeletion=Cancel case deletion CaseData=Case +CaseData.ageAndBirthDate=Age and birth date CaseData.additionalDetails=General comment CaseData.caseClassification=Case classification CaseData.caseIdentificationSource=Case identification source @@ -622,6 +623,8 @@ columnVaccineManufacturer=Vaccine manufacturer Community=Community Community.archived=Archived Community.externalID=External ID +Community.region=Region +Community.district=District communityActiveCommunities=Active communities communityArchivedCommunities=Archived communities communityAllCommunities=All communities @@ -677,6 +680,7 @@ contactNumberOfDuplicatesDetected=%d potential duplicates detected contactFilterWithDifferentRegion=Show duplicates with differing regions Contact=Contact Contact.additionalDetails=General comment +Contact.ageAndBirthDate=Age and birth date Contact.caseClassification=Classification of the source case Contact.caze=Source case Contact.caze.ageSex=Age, sex @@ -688,6 +692,7 @@ Contact.cazeDisease=Disease of source case Contact.cazeDiseaseVariant=Disease variant of source case Contact.cazeDistrict=District of source case Contact.community=Responsible community +Contact.completeness=Completeness Contact.contactClassification=Contact classification Contact.contactOfficer=Responsible contact officer Contact.contactOfficerUuid=Responsible contact officer @@ -992,6 +997,7 @@ District.epidCode=Epid code District.growthRate=Growth rate District.population=Population District.externalID=External ID +District.region=Region epiDataNoSourceContacts=No source contacts have been created for this case EpiData=Epidemiological data EpiData.areaInfectedAnimals=Residing, working or travelling to an area where infected animals have been confirmed @@ -1142,6 +1148,9 @@ Event.internalToken=Internal Token Event.eventGroups=Groups Event.latestEventGroup=Latest Event Group Event.eventGroupCount=Event Group Count +Event.region=Region +Event.district=District +Event.community=Community # Event action EventAction.eventUuid=Event id EventAction.eventTitle=Event title @@ -1589,6 +1598,7 @@ Person.approximateAge=Age Person.approximateAgeReferenceDate=Last updated Person.approximateAgeType=Unit Person.birthdate=Date of birth (year / month / day) +Person.birthDate=Date of birth (year / month / day) Person.birthdateDD=Day of birth Person.birthdateMM=Month of birth Person.birthdateYYYY=Year of birth @@ -1684,6 +1694,8 @@ PointOfEntry.latitude=Latitude PointOfEntry.longitude=Longitude PointOfEntry.externalID=External ID PointOfEntry.archived=Archived +PointOfEntry.region=Region +PointOfEntry.district=District populationDataMaleTotal=Male total populationDataFemaleTotal=Female total PortHealthInfo=Port health information @@ -1849,6 +1861,10 @@ Sample.uuid=Sample ID Sample.samplePurpose=Purpose of the Sample Sample.samplingReason=Reason for sampling/testing Sample.samplingReasonDetails=Sampling reason details +Sample.region=Region +Sample.district=District +Sample.community=Community +# Sample Export SampleExport.additionalTestingRequested=Have additional tests been requested? SampleExport.personAddressCaption=Address of case/contact/event participant person SampleExport.personAge=Age of case/contact/event participant person @@ -1954,6 +1970,9 @@ Immunization.responsibleRegion=Responsible region Immunization.responsibleDistrict=Responsible district Immunization.responsibleCommunity=Responsible community Immunization.immunizationPeriod=Immunization period +Immunization.region=Region +Immunization.district=District +Immunization.community=Community immunizationImmunizationsList=Immunizations list linkImmunizationToCaseButton=Link case openLinkedCaseToImmunizationButton=Open case @@ -2207,6 +2226,8 @@ Task.taskType=Task type Task.taskAssignee=Task assignee Task.taskPriority=Task priority Task.travelEntry=Travel entry +Task.region=Region +Task.district=District # TestReport TestReport=Test report TestReport.testDateTime=Date and time of result @@ -2246,6 +2267,7 @@ TravelEntry.responsibleRegion=Responsible region TravelEntry.responsibleDistrict=Responsible district TravelEntry.responsibleCommunity=Responsible community TravelEntry.differentPointOfEntryJurisdiction=Point of entry jurisdiction differs from responsible jurisdiction +TravelEntry.pointOfEntry=Point of entry TravelEntry.pointOfEntryRegion=Region TravelEntry.pointOfEntryDistrict=District TravelEntry.pointOfEntryDetails=Point of entry details @@ -2311,6 +2333,9 @@ User.userName=User name User.userRoles=User roles User.address=Address User.uuid=UUID +User.region=Region +User.district=District +User.community=Community # Vaccination vaccinationNewVaccination=New vaccination vaccinationNoVaccinationsForPerson=There are no vaccinations for this person @@ -2458,6 +2483,9 @@ WeeklyReportEntry.numberOfCases=Cases reported # WeeklyReportInformantSummary WeeklyReportInformantSummary.informantReportDate=Informant report submission WeeklyReportInformantSummary.totalCaseCount=Cases reported by informant +WeeklyReportInformantSummary.informant=Informant +WeeklyReportInformantSummary.community=Community +WeeklyReportInformantSummary.facility=Facility # WeeklyReportOfficerSummary WeeklyReportOfficerSummary.informants=Number of informants WeeklyReportOfficerSummary.informantReports=Number of informant reports @@ -2466,6 +2494,7 @@ WeeklyReportOfficerSummary.informantZeroReports=Number of informant zero reports WeeklyReportOfficerSummary.officer=Officer WeeklyReportOfficerSummary.officerReportDate=Officer report submission WeeklyReportOfficerSummary.totalCaseCount=Cases reported by officer +WeeklyReportOfficerSummary.district=District # WeeklyReportRegionSummary WeeklyReportRegionSummary.informants=Number of informants WeeklyReportRegionSummary.informantReports=Number of informant reports @@ -2475,6 +2504,7 @@ WeeklyReportRegionSummary.officers=Number of officers WeeklyReportRegionSummary.officerReports=Number of officers reports WeeklyReportRegionSummary.officerReportPercentage=Percentage WeeklyReportRegionSummary.officerZeroReports=Number of officer zero reports +WeeklyReportRegionSummary.region=Region # SORMAS to SORMAS SormasToSormasOptions.organization=Organization SormasToSormasOptions.withAssociatedContacts=Share associated contacts From 329593dcc0c669846a0ae3cb1db719a1100fba1b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mat=C3=A9=20Strysewske?= Date: Tue, 10 May 2022 13:20:19 +0200 Subject: [PATCH 058/167] Update SERVER_CUSTOMIZATION.md --- docs/SERVER_CUSTOMIZATION.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/docs/SERVER_CUSTOMIZATION.md b/docs/SERVER_CUSTOMIZATION.md index 33dc2af491a..8b3267a8f33 100644 --- a/docs/SERVER_CUSTOMIZATION.md +++ b/docs/SERVER_CUSTOMIZATION.md @@ -58,7 +58,7 @@ It is possible to adjust the following properties that define how the diseases a * **`extendedClassificationMulti`:** Whether the three confirmation properties used for extended classification can be specified individually, i.e. users can enter multiple sources of confirmation. ## Deletion Configuration -SORMAS can be set up to automatically delete entities after a specific time period. There are seven core entities for which automatic deletion can be enabled and configured: *Case, Contact, Event, Event Participant, Immunization, Travel Entry, and Campaign.* This configuration is currently only possible directly in the database via the `deleteconfiguration` table, which already contains a row for each of these entities. The table consists of the following columns: +SORMAS can be set up to automatically delete entities after a specific time period. There are seven core entities for which automatic deletion can be enabled and configured: *Case, Contact, Event, Event Participant, Immunization, Travel Entry, and Campaign.* This configuration is currently only possible directly in the database via the `deleteconfiguration` table, which already contains rows for each of these entities. The table consists of the following columns: * **`entityType`:** The name of the entity that supports automatic deletion. * **`deletionReference`:** The reference date for the calculation of the date on which deletion takes place (see below). @@ -67,11 +67,12 @@ SORMAS can be set up to automatically delete entities after a specific time peri Both `deletionReference` and `deletionPeriod` need to be filled in order for the automatic deletion to take place. Entities for which at least one of these fields is left empty will not be automatically deleted. Deletion is executed via a nightly cron job and might therefore not happen immediately when the deletion date has been reached. ### Deletion Reference -The `deletionReference` field has three possible values which define the date that is used to calculate whether an entity needs to be deleted (i.e., when the date calculated by subtracting the deletion period from the current date is before the deletion reference date, the entity is deleted). +The `deletionReference` field has four possible values which define the date that is used to calculate whether an entity needs to be deleted (i.e., when the date calculated by subtracting the deletion period from the current date is before the deletion reference date, the entity is deleted). A `MANUAL_DELETION` entry can exist in parallel to one of the other entries, and if both entries are configured, deletion is executed as soon as the threshold of one of these entries is met. * **`CREATION`**: The creation date of the entity will be used. * **`END`**: The latest change date of the entity itself and any of its depending entities will be used. E.g. for cases, this includes but is not limited to its epi data, symptoms, or hospitalization. * **`ORIGIN`**: This is currently only implemented for travel entries and means that the report date of the entity will be used. If this is specified for any other entity, the deletion job will be stopped and throw an error. +* **`MANUAL_DELETION`**: The date on which the entity was manually deleted by a user. ## Infrastructure Data When you start a SORMAS server for the first time and the `createDefaultEntities` property is enabled, some default infrastructure data is generated to ensure that the server is usable and the default users can be created. From 1e00be9ba0ad814e0b2f6a33c9ab41f74843166c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mat=C3=A9=20Strysewske?= Date: Tue, 10 May 2022 13:47:24 +0200 Subject: [PATCH 059/167] Update DEVELOPMENT_ENVIRONMENT.md --- docs/DEVELOPMENT_ENVIRONMENT.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/DEVELOPMENT_ENVIRONMENT.md b/docs/DEVELOPMENT_ENVIRONMENT.md index 2d336860674..6c26fb5fa3c 100644 --- a/docs/DEVELOPMENT_ENVIRONMENT.md +++ b/docs/DEVELOPMENT_ENVIRONMENT.md @@ -73,7 +73,7 @@ If you plan to work on the Android App as well, you will also need the **Java 8 - Ensure that the Android SDK installation path does not contain whitespaces; you can also change this later via `Tools -> SDK Manager -> Android SDK Location` - Open Android Studio and import the `sormas-app` module from the SORMAS-Project repository - Make a copy of `keystore.properties.example` and rename it to `keystore.properties` -- Make sure to use the JDK version 8 (`File -> Project Structure -> SDK Location -> JDK Location`) +- Make sure to use the JDK version 11 (`File -> Project Structure -> SDK Location -> JDK Location`) - Build the Android Studio project by executing the Gradle build (this may be done automatically) - Add an emulator and set the SDK version to the `minSdkVersion` or `targetSdkVersion` from `build.gradle`; we suggest to test your code on both, but `minSdkVersion` should be preferred to ensure compatibility to the minimum supported SDK - Click on `Run 'app'` to install and run the app on your emulator; enter `http://10.0.2.2:6080/sormas-rest` as the server URL when you start the newly installed app for the first time From 6057e0d09c778c7c8525a28cf3850a511cd87a84 Mon Sep 17 00:00:00 2001 From: cazacmarin Date: Tue, 10 May 2022 15:23:38 +0300 Subject: [PATCH 060/167] #8303 - About page doesn't work (#9115) * #8303 - About page doesn't work * #8303 - About page doesn't work Co-authored-by: Marin --- .../main/java/de/symeda/sormas/api/i18n/Captions.java | 1 + sormas-api/src/main/resources/captions.properties | 1 + .../sormas/backend/labmessage/LabMessageFacadeEjb.java | 10 ++++++++-- 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/sormas-api/src/main/java/de/symeda/sormas/api/i18n/Captions.java b/sormas-api/src/main/java/de/symeda/sormas/api/i18n/Captions.java index aea5bb285fb..6ce5130e31e 100644 --- a/sormas-api/src/main/java/de/symeda/sormas/api/i18n/Captions.java +++ b/sormas-api/src/main/java/de/symeda/sormas/api/i18n/Captions.java @@ -2372,6 +2372,7 @@ public interface Captions { String vaccinationNewVaccination = "vaccinationNewVaccination"; String vaccinationNoVaccinationsForPerson = "vaccinationNoVaccinationsForPerson"; String vaccinationNoVaccinationsForPersonAndDisease = "vaccinationNoVaccinationsForPersonAndDisease"; + String versionIsMissing = "versionIsMissing"; String View_actions = "View.actions"; String View_aggregatereports = "View.aggregatereports"; String View_aggregatereports_sub = "View.aggregatereports.sub"; diff --git a/sormas-api/src/main/resources/captions.properties b/sormas-api/src/main/resources/captions.properties index 50c98a814f7..54c08ce05fb 100644 --- a/sormas-api/src/main/resources/captions.properties +++ b/sormas-api/src/main/resources/captions.properties @@ -67,6 +67,7 @@ aboutAdditionalInfo=Additional Info aboutCopyright=Copyright aboutDocuments=Documents aboutVersion=Version +versionIsMissing=Version is missing aboutBrandedSormasVersion=%s powered by SORMAS aboutCaseClassificationRules=Case Classification Rules (HTML) aboutChangelog=Full Changelog diff --git a/sormas-backend/src/main/java/de/symeda/sormas/backend/labmessage/LabMessageFacadeEjb.java b/sormas-backend/src/main/java/de/symeda/sormas/backend/labmessage/LabMessageFacadeEjb.java index 319389e7328..018c9fe5453 100644 --- a/sormas-backend/src/main/java/de/symeda/sormas/backend/labmessage/LabMessageFacadeEjb.java +++ b/sormas-backend/src/main/java/de/symeda/sormas/backend/labmessage/LabMessageFacadeEjb.java @@ -30,7 +30,6 @@ import javax.validation.Valid; import javax.validation.constraints.NotNull; -import de.symeda.sormas.api.user.UserRight; import org.apache.commons.collections4.CollectionUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -40,6 +39,7 @@ import de.symeda.sormas.api.common.Page; import de.symeda.sormas.api.contact.ContactReferenceDto; import de.symeda.sormas.api.event.EventParticipantReferenceDto; +import de.symeda.sormas.api.i18n.Captions; import de.symeda.sormas.api.i18n.I18nProperties; import de.symeda.sormas.api.i18n.Strings; import de.symeda.sormas.api.i18n.Validations; @@ -58,6 +58,7 @@ import de.symeda.sormas.api.systemevents.SystemEventDto; import de.symeda.sormas.api.systemevents.SystemEventType; import de.symeda.sormas.api.user.UserReferenceDto; +import de.symeda.sormas.api.user.UserRight; import de.symeda.sormas.api.utils.SortProperty; import de.symeda.sormas.backend.common.ConfigFacadeEjb; import de.symeda.sormas.backend.sample.SampleService; @@ -422,7 +423,12 @@ private ExternalLabResultsFacade getExternalLabResultsFacade() throws NamingExce @PermitAll public String getLabMessagesAdapterVersion() throws NamingException { ExternalLabResultsFacade labResultsFacade = getExternalLabResultsFacade(); - return labResultsFacade.getVersion(); + String version = I18nProperties.getCaption(Captions.versionIsMissing); + try { + version = labResultsFacade.getVersion(); + } finally { + return version; + } } private LabMessageFetchResult getSuccessfulFetchResult(ExternalMessageResult> externalMessageResult) { From 8cb3953d283996c07b79dffcba0ba79a6b3568c9 Mon Sep 17 00:00:00 2001 From: Michal Kozakiewicz Date: Tue, 10 May 2022 16:10:09 +0200 Subject: [PATCH 061/167] Added scenario [SORDEV-10360] --- .../entries/CreateNewTravelEntryPage.java | 6 ++ .../application/entries/TravelEntryPage.java | 9 +++ .../e2etests/helpers/WebDriverHelpers.java | 29 ++++---- .../web/application/AboutDirectorySteps.java | 41 ++++++------ .../entries/CreateNewTravelEntrySteps.java | 46 ++++++++++++- .../entries/TravelEntryDirectorySteps.java | 52 ++++++++++++++ .../application/events/EditEventSteps.java | 67 +++++++++---------- .../events/EventDirectorySteps.java | 52 +++++++------- .../features/sanity/web/TravelEntry.feature | 27 ++++++++ 9 files changed, 232 insertions(+), 97 deletions(-) diff --git a/sormas-e2e-tests/src/main/java/org/sormas/e2etests/pages/application/entries/CreateNewTravelEntryPage.java b/sormas-e2e-tests/src/main/java/org/sormas/e2etests/pages/application/entries/CreateNewTravelEntryPage.java index 6d413c6c9cd..ddaa4dfcc01 100644 --- a/sormas-e2e-tests/src/main/java/org/sormas/e2etests/pages/application/entries/CreateNewTravelEntryPage.java +++ b/sormas-e2e-tests/src/main/java/org/sormas/e2etests/pages/application/entries/CreateNewTravelEntryPage.java @@ -47,4 +47,10 @@ public class CreateNewTravelEntryPage { public static final By PICK_A_EXISTING_CASE_LABEL_DE = By.xpath("//*[text()='Einen vorhandenen Fall w\u00E4hlen']"); public static final By ARRIVAL_DATE = By.cssSelector("#dateOfArrival input"); + public static final By REPORT_DATE = By.cssSelector("#reportDate input"); + public static final By DATE_OF_ARRIVAL_POPUP_CLOSE = + By.xpath( + "//div[@class='v-Notification error v-Notification-error']//div[@class='popupContent']"); + public static final By DATE_OF_ARRIVAL_LABEL_DE = + By.xpath("//div[@location='dateOfArrival']//div/div/div[@class='v-captiontext']"); } diff --git a/sormas-e2e-tests/src/main/java/org/sormas/e2etests/pages/application/entries/TravelEntryPage.java b/sormas-e2e-tests/src/main/java/org/sormas/e2etests/pages/application/entries/TravelEntryPage.java index 9a489fd7466..c3f723d04cd 100644 --- a/sormas-e2e-tests/src/main/java/org/sormas/e2etests/pages/application/entries/TravelEntryPage.java +++ b/sormas-e2e-tests/src/main/java/org/sormas/e2etests/pages/application/entries/TravelEntryPage.java @@ -47,4 +47,13 @@ public class TravelEntryPage { public static By getCheckboxByIndex(String idx) { return By.xpath(String.format("(//td//input[@type=\"checkbox\"])[%s]", idx)); } + + public static final By CLOSE_DATA_IMPORT_POPUP_BUTTON = By.id("actionCancel"); + public static final By CLOSE_IMPORT_TRAVEL_ENTRY_BUTTON = + By.xpath("//div[@class='v-window-closebox']"); + public static final By FIRST_NAME_IMPORTED_PERSON = + By.xpath("//span[text()='Vorname']/../following-sibling::div"); + public static final By LAST_NAME_IMPORTED_PERSON = + By.xpath("//span[text()='Nachname']/../following-sibling::div"); + public static final By FIRST_RESULT_ID = By.xpath("//table/tbody/tr[2]/td[1]"); } diff --git a/sormas-e2e-tests/src/test/java/org/sormas/e2etests/helpers/WebDriverHelpers.java b/sormas-e2e-tests/src/test/java/org/sormas/e2etests/helpers/WebDriverHelpers.java index 6b88cd2e3b3..7f20e82b8e7 100755 --- a/sormas-e2e-tests/src/test/java/org/sormas/e2etests/helpers/WebDriverHelpers.java +++ b/sormas-e2e-tests/src/test/java/org/sormas/e2etests/helpers/WebDriverHelpers.java @@ -15,6 +15,20 @@ package org.sormas.e2etests.helpers; +import static com.google.common.truth.Truth.assertWithMessage; +import static java.time.Duration.ofSeconds; +import static org.awaitility.Awaitility.await; +import static org.awaitility.Durations.ONE_HUNDRED_MILLISECONDS; + +import java.time.Instant; +import java.time.temporal.ChronoUnit; +import java.util.ArrayList; +import java.util.List; +import java.util.Set; +import java.util.concurrent.TimeUnit; +import java.util.function.Predicate; +import java.util.stream.Collectors; +import javax.inject.Inject; import lombok.SneakyThrows; import lombok.extern.slf4j.Slf4j; import org.awaitility.core.ConditionTimeoutException; @@ -32,21 +46,6 @@ import org.sormas.e2etests.steps.BaseSteps; import org.testng.Assert; -import javax.inject.Inject; -import java.time.Instant; -import java.time.temporal.ChronoUnit; -import java.util.ArrayList; -import java.util.List; -import java.util.Set; -import java.util.concurrent.TimeUnit; -import java.util.function.Predicate; -import java.util.stream.Collectors; - -import static com.google.common.truth.Truth.assertWithMessage; -import static java.time.Duration.ofSeconds; -import static org.awaitility.Awaitility.await; -import static org.awaitility.Durations.ONE_HUNDRED_MILLISECONDS; - @Slf4j public class WebDriverHelpers { diff --git a/sormas-e2e-tests/src/test/java/org/sormas/e2etests/steps/web/application/AboutDirectorySteps.java b/sormas-e2e-tests/src/test/java/org/sormas/e2etests/steps/web/application/AboutDirectorySteps.java index ad1d67bc37c..cc0a88b2edb 100644 --- a/sormas-e2e-tests/src/test/java/org/sormas/e2etests/steps/web/application/AboutDirectorySteps.java +++ b/sormas-e2e-tests/src/test/java/org/sormas/e2etests/steps/web/application/AboutDirectorySteps.java @@ -1,8 +1,28 @@ package org.sormas.e2etests.steps.web.application; +import static org.sormas.e2etests.pages.application.AboutPage.CASE_CLASSIFICATION_RULES_HYPERLINK; +import static org.sormas.e2etests.pages.application.AboutPage.DATA_DICTIONARY_BUTTON; +import static org.sormas.e2etests.pages.application.AboutPage.FULL_CHANGELOG_HYPERLINK; +import static org.sormas.e2etests.pages.application.AboutPage.OFFICIAL_SORMAS_WEBSITE_HYPERLINK; +import static org.sormas.e2etests.pages.application.AboutPage.SORMAS_GITHUB_HYPERLINK; +import static org.sormas.e2etests.pages.application.AboutPage.SORMAS_VERSION_HYPERLINK; +import static org.sormas.e2etests.pages.application.AboutPage.SORMAS_VERSION_HYPERLINK_TARGET; +import static org.sormas.e2etests.pages.application.AboutPage.SORMAS_VERSION_LINK; +import static org.sormas.e2etests.pages.application.AboutPage.WHATS_NEW_HYPERLINK; +import static org.sormas.e2etests.pages.application.users.CreateNewUserPage.LANGUAGE_COMBOBOX; +import static org.sormas.e2etests.pages.application.users.CreateNewUserPage.SAVE_BUTTON; + import com.detectlanguage.DetectLanguage; import com.google.inject.Inject; import cucumber.api.java8.En; +import java.io.File; +import java.io.FileInputStream; +import java.io.IOException; +import java.time.LocalDate; +import java.util.ArrayList; +import java.util.Iterator; +import java.util.List; +import java.util.concurrent.TimeUnit; import org.apache.poi.ss.usermodel.Cell; import org.apache.poi.ss.usermodel.CellType; import org.apache.poi.ss.usermodel.Row; @@ -15,27 +35,6 @@ import org.sormas.e2etests.helpers.WebDriverHelpers; import org.testng.asserts.SoftAssert; -import java.io.File; -import java.io.FileInputStream; -import java.io.IOException; -import java.time.LocalDate; -import java.util.ArrayList; -import java.util.Iterator; -import java.util.List; -import java.util.concurrent.TimeUnit; - -import static org.sormas.e2etests.pages.application.AboutPage.CASE_CLASSIFICATION_RULES_HYPERLINK; -import static org.sormas.e2etests.pages.application.AboutPage.DATA_DICTIONARY_BUTTON; -import static org.sormas.e2etests.pages.application.AboutPage.FULL_CHANGELOG_HYPERLINK; -import static org.sormas.e2etests.pages.application.AboutPage.OFFICIAL_SORMAS_WEBSITE_HYPERLINK; -import static org.sormas.e2etests.pages.application.AboutPage.SORMAS_GITHUB_HYPERLINK; -import static org.sormas.e2etests.pages.application.AboutPage.SORMAS_VERSION_HYPERLINK; -import static org.sormas.e2etests.pages.application.AboutPage.SORMAS_VERSION_HYPERLINK_TARGET; -import static org.sormas.e2etests.pages.application.AboutPage.SORMAS_VERSION_LINK; -import static org.sormas.e2etests.pages.application.AboutPage.WHATS_NEW_HYPERLINK; -import static org.sormas.e2etests.pages.application.users.CreateNewUserPage.LANGUAGE_COMBOBOX; -import static org.sormas.e2etests.pages.application.users.CreateNewUserPage.SAVE_BUTTON; - public class AboutDirectorySteps implements En { public static final String userDirPath = System.getProperty("user.dir"); public static final List xlsxFileContentList = new ArrayList<>(); diff --git a/sormas-e2e-tests/src/test/java/org/sormas/e2etests/steps/web/application/entries/CreateNewTravelEntrySteps.java b/sormas-e2e-tests/src/test/java/org/sormas/e2etests/steps/web/application/entries/CreateNewTravelEntrySteps.java index 60d7bc35723..96ce88adf29 100644 --- a/sormas-e2e-tests/src/test/java/org/sormas/e2etests/steps/web/application/entries/CreateNewTravelEntrySteps.java +++ b/sormas-e2e-tests/src/test/java/org/sormas/e2etests/steps/web/application/entries/CreateNewTravelEntrySteps.java @@ -28,11 +28,14 @@ import static org.sormas.e2etests.pages.application.cases.EditCasePage.USER_INFORMATION; import static org.sormas.e2etests.pages.application.contacts.EditContactPage.UUID_INPUT; import static org.sormas.e2etests.pages.application.entries.CreateNewTravelEntryPage.ARRIVAL_DATE; +import static org.sormas.e2etests.pages.application.entries.CreateNewTravelEntryPage.DATE_OF_ARRIVAL_LABEL_DE; +import static org.sormas.e2etests.pages.application.entries.CreateNewTravelEntryPage.DATE_OF_ARRIVAL_POPUP_CLOSE; import static org.sormas.e2etests.pages.application.entries.CreateNewTravelEntryPage.FIRST_NAME_OF_CONTACT_PERSON_INPUT; import static org.sormas.e2etests.pages.application.entries.CreateNewTravelEntryPage.LAST_NAME_OF_CONTACT_PERSON_INPUT; import static org.sormas.e2etests.pages.application.entries.CreateNewTravelEntryPage.PICK_A_EXISTING_CASE_LABEL_DE; import static org.sormas.e2etests.pages.application.entries.CreateNewTravelEntryPage.PICK_A_EXISTING_PERSON_LABEL_DE; import static org.sormas.e2etests.pages.application.entries.CreateNewTravelEntryPage.PICK_OR_CREATE_PERSON_TITLE_DE; +import static org.sormas.e2etests.pages.application.entries.CreateNewTravelEntryPage.REPORT_DATE; import static org.sormas.e2etests.pages.application.entries.CreateNewTravelEntryPage.SAVE_BUTTON; import static org.sormas.e2etests.pages.application.entries.CreateNewTravelEntryPage.SAVE_POPUP_CONTENT; import static org.sormas.e2etests.pages.application.entries.EditTravelEntryPage.CASE_PERSON_NAME; @@ -164,12 +167,53 @@ public CreateNewTravelEntrySteps( () -> { webDriverHelpers.clickOnWebElementBySelector(PERSON_SEARCH_LOCATOR_BUTTON); }); + When( + "^I change a Date of Arrival for wrong date from next day", + () -> { + fillDateOfArrival(travelEntry.getDateOfArrival().plusDays(1), Locale.GERMAN); + }); + + When( + "^I change a Date of Arrival for correct date", + () -> { + fillDateOfArrival(travelEntry.getDateOfArrival(), Locale.GERMAN); + }); + + When( + "I check that word Date of arrival is appropriate translated to German language", + () -> { + String expectedWordToTranslateInGerman = "EINREISEDATUM"; + String wordGettingFromLabel = + webDriverHelpers.getTextFromWebElement(DATE_OF_ARRIVAL_LABEL_DE); + softly.assertEquals( + wordGettingFromLabel, + expectedWordToTranslateInGerman, + "The translation is not proper"); + softly.assertAll(); + }); + + When( + "I check the information about Dates for imported travel entry on Edit Travel entry page", + () -> { + String reportDate = webDriverHelpers.getValueFromWebElement(REPORT_DATE); + String arrivalDate = webDriverHelpers.getValueFromWebElement(ARRIVAL_DATE); + + softly.assertEquals(reportDate, "03.10.2021"); + softly.assertEquals(arrivalDate, "02.10.2021"); + softly.assertAll(); + }); + + When( + "^I check that Date of Arrival validation popup is appear", + () -> { + webDriverHelpers.waitUntilElementIsVisibleAndClickable(DATE_OF_ARRIVAL_POPUP_CLOSE); + webDriverHelpers.clickOnWebElementBySelector(DATE_OF_ARRIVAL_POPUP_CLOSE); + }); When( "^I click on Save button from the new travel entry form$", () -> { webDriverHelpers.clickOnWebElementBySelector(SAVE_BUTTON); - webDriverHelpers.waitUntilElementIsVisibleAndClickable(UUID_INPUT); }); When( diff --git a/sormas-e2e-tests/src/test/java/org/sormas/e2etests/steps/web/application/entries/TravelEntryDirectorySteps.java b/sormas-e2e-tests/src/test/java/org/sormas/e2etests/steps/web/application/entries/TravelEntryDirectorySteps.java index 168fe067bf8..fcaa9d4af1f 100644 --- a/sormas-e2e-tests/src/test/java/org/sormas/e2etests/steps/web/application/entries/TravelEntryDirectorySteps.java +++ b/sormas-e2e-tests/src/test/java/org/sormas/e2etests/steps/web/application/entries/TravelEntryDirectorySteps.java @@ -22,11 +22,16 @@ import static org.sormas.e2etests.pages.application.cases.CaseDirectoryPage.DATE_TO_COMBOBOX; import static org.sormas.e2etests.pages.application.configuration.DocumentTemplatesPage.FILE_PICKER; import static org.sormas.e2etests.pages.application.contacts.ContactDirectoryPage.getCheckboxByUUID; +import static org.sormas.e2etests.pages.application.entries.TravelEntryPage.CLOSE_DATA_IMPORT_POPUP_BUTTON; +import static org.sormas.e2etests.pages.application.entries.TravelEntryPage.CLOSE_IMPORT_TRAVEL_ENTRY_BUTTON; import static org.sormas.e2etests.pages.application.entries.TravelEntryPage.COMMIT_BUTTON; import static org.sormas.e2etests.pages.application.entries.TravelEntryPage.CONVERTE_TO_CASE_ENTRIES; import static org.sormas.e2etests.pages.application.entries.TravelEntryPage.DELETE_BULK; +import static org.sormas.e2etests.pages.application.entries.TravelEntryPage.FIRST_NAME_IMPORTED_PERSON; +import static org.sormas.e2etests.pages.application.entries.TravelEntryPage.FIRST_RESULT_ID; import static org.sormas.e2etests.pages.application.entries.TravelEntryPage.IMPORT_BUTTON; import static org.sormas.e2etests.pages.application.entries.TravelEntryPage.IMPORT_SUCCESS_DE; +import static org.sormas.e2etests.pages.application.entries.TravelEntryPage.LAST_NAME_IMPORTED_PERSON; import static org.sormas.e2etests.pages.application.entries.TravelEntryPage.NEGATIVE_TESTES_ENTRIES; import static org.sormas.e2etests.pages.application.entries.TravelEntryPage.NEW_PERSON_RADIOBUTTON_DE; import static org.sormas.e2etests.pages.application.entries.TravelEntryPage.NEW_TRAVEL_ENTRY_BUTTON; @@ -58,6 +63,7 @@ public class TravelEntryDirectorySteps implements En { public static final String userDirPath = System.getProperty("user.dir"); private final WebDriverHelpers webDriverHelpers; + public static String fullName; @Inject public TravelEntryDirectorySteps( @@ -74,6 +80,29 @@ public TravelEntryDirectorySteps( webDriverHelpers.clickOnWebElementBySelector(IMPORT_BUTTON); }); + When( + "I close Import Travel Entries form", + () -> { + // TimeUnit.SECONDS.sleep(5); // waiting for close Data import popup + webDriverHelpers.waitUntilElementIsVisibleAndClickable(CLOSE_IMPORT_TRAVEL_ENTRY_BUTTON); + webDriverHelpers.clickOnWebElementBySelector(CLOSE_IMPORT_TRAVEL_ENTRY_BUTTON); + }); + + When( + "I close Data import popup for Travel Entries", + () -> { + TimeUnit.SECONDS.sleep(4); + webDriverHelpers.waitUntilElementIsVisibleAndClickable(CLOSE_DATA_IMPORT_POPUP_BUTTON); + webDriverHelpers.clickOnWebElementBySelector(CLOSE_DATA_IMPORT_POPUP_BUTTON); + }); + + When( + "I select the attached CSV file in the file picker from Travel Entries directory", + () -> { + TimeUnit.SECONDS.sleep(5); + webDriverHelpers.sendFile(FILE_PICKER, userDirPath + "\\uploads\\DEA_TestImport.csv"); + }); + When( "I select the German travel entry CSV file in the file picker", () -> { @@ -87,6 +116,14 @@ public TravelEntryDirectorySteps( webDriverHelpers.clickOnWebElementBySelector(START_DATA_IMPORT_BUTTON); }); + When( + "I acquires the first name and last name imported person", + () -> { + String firstName = webDriverHelpers.getTextFromWebElement(FIRST_NAME_IMPORTED_PERSON); + String lastName = webDriverHelpers.getTextFromWebElement(LAST_NAME_IMPORTED_PERSON); + fullName = firstName + " " + lastName; + }); + When( "I select to create new person from the Import Travel Entries popup", () -> { @@ -169,6 +206,21 @@ public TravelEntryDirectorySteps( "Bulk action went wrong"); softly.assertAll(); }); + When( + "I filter by Person full name on Travel Entry directory page", + () -> { + TimeUnit.SECONDS.sleep(3); // waiting for grid refresh + webDriverHelpers.fillAndSubmitInWebElement(PERSON_FILTER_INPUT, fullName); + webDriverHelpers.clickOnWebElementBySelector( + TRAVEL_ENTRY_DIRECTORY_PAGE_APPLY_FILTER_BUTTON); + }); + When( + "I open the imported person on Travel entry directory page", + () -> { + TimeUnit.SECONDS.sleep(3); // waiting for grid refresh + webDriverHelpers.waitUntilElementIsVisibleAndClickable(FIRST_RESULT_ID); + webDriverHelpers.clickOnWebElementBySelector(FIRST_RESULT_ID); + }); And( "I click {string} checkbox on Travel Entry directory page", (String checkboxDescription) -> { diff --git a/sormas-e2e-tests/src/test/java/org/sormas/e2etests/steps/web/application/events/EditEventSteps.java b/sormas-e2e-tests/src/test/java/org/sormas/e2etests/steps/web/application/events/EditEventSteps.java index 8f42ee1a431..b1237e6bc70 100644 --- a/sormas-e2e-tests/src/test/java/org/sormas/e2etests/steps/web/application/events/EditEventSteps.java +++ b/sormas-e2e-tests/src/test/java/org/sormas/e2etests/steps/web/application/events/EditEventSteps.java @@ -18,40 +18,6 @@ package org.sormas.e2etests.steps.web.application.events; -import com.github.javafaker.Faker; -import cucumber.api.java8.En; -import org.sormas.e2etests.entities.pojo.helpers.ComparisonHelper; -import org.sormas.e2etests.entities.pojo.web.Event; -import org.sormas.e2etests.entities.pojo.web.EventGroup; -import org.sormas.e2etests.entities.pojo.web.EventHandout; -import org.sormas.e2etests.entities.pojo.web.EventParticipant; -import org.sormas.e2etests.entities.pojo.web.Person; -import org.sormas.e2etests.entities.services.EventDocumentService; -import org.sormas.e2etests.entities.services.EventGroupService; -import org.sormas.e2etests.entities.services.EventParticipantService; -import org.sormas.e2etests.entities.services.EventService; -import org.sormas.e2etests.enums.DistrictsValues; -import org.sormas.e2etests.enums.GenderValues; -import org.sormas.e2etests.enums.RegionsValues; -import org.sormas.e2etests.envconfig.manager.EnvironmentManager; -import org.sormas.e2etests.helpers.AssertHelpers; -import org.sormas.e2etests.helpers.WebDriverHelpers; -import org.sormas.e2etests.pages.application.events.EditEventPage; -import org.sormas.e2etests.state.ApiState; -import org.testng.Assert; -import org.testng.asserts.SoftAssert; - -import javax.inject.Inject; -import java.nio.file.Files; -import java.nio.file.Path; -import java.nio.file.Paths; -import java.time.LocalDate; -import java.time.format.DateTimeFormatter; -import java.time.format.TextStyle; -import java.util.List; -import java.util.Locale; -import java.util.concurrent.TimeUnit; - import static org.sormas.e2etests.pages.application.actions.CreateNewActionPage.NEW_ACTION_POPUP; import static org.sormas.e2etests.pages.application.cases.CaseDirectoryPage.ALL_RESULTS_CHECKBOX; import static org.sormas.e2etests.pages.application.cases.CreateNewCasePage.PERSON_SEARCH_LOCATOR_BUTTON; @@ -160,6 +126,39 @@ import static org.sormas.e2etests.pages.application.persons.EditPersonPage.SEE_EVENTS_FOR_PERSON; import static org.sormas.e2etests.steps.BaseSteps.locale; +import com.github.javafaker.Faker; +import cucumber.api.java8.En; +import java.nio.file.Files; +import java.nio.file.Path; +import java.nio.file.Paths; +import java.time.LocalDate; +import java.time.format.DateTimeFormatter; +import java.time.format.TextStyle; +import java.util.List; +import java.util.Locale; +import java.util.concurrent.TimeUnit; +import javax.inject.Inject; +import org.sormas.e2etests.entities.pojo.helpers.ComparisonHelper; +import org.sormas.e2etests.entities.pojo.web.Event; +import org.sormas.e2etests.entities.pojo.web.EventGroup; +import org.sormas.e2etests.entities.pojo.web.EventHandout; +import org.sormas.e2etests.entities.pojo.web.EventParticipant; +import org.sormas.e2etests.entities.pojo.web.Person; +import org.sormas.e2etests.entities.services.EventDocumentService; +import org.sormas.e2etests.entities.services.EventGroupService; +import org.sormas.e2etests.entities.services.EventParticipantService; +import org.sormas.e2etests.entities.services.EventService; +import org.sormas.e2etests.enums.DistrictsValues; +import org.sormas.e2etests.enums.GenderValues; +import org.sormas.e2etests.enums.RegionsValues; +import org.sormas.e2etests.envconfig.manager.EnvironmentManager; +import org.sormas.e2etests.helpers.AssertHelpers; +import org.sormas.e2etests.helpers.WebDriverHelpers; +import org.sormas.e2etests.pages.application.events.EditEventPage; +import org.sormas.e2etests.state.ApiState; +import org.testng.Assert; +import org.testng.asserts.SoftAssert; + public class EditEventSteps implements En { private final WebDriverHelpers webDriverHelpers; diff --git a/sormas-e2e-tests/src/test/java/org/sormas/e2etests/steps/web/application/events/EventDirectorySteps.java b/sormas-e2e-tests/src/test/java/org/sormas/e2etests/steps/web/application/events/EventDirectorySteps.java index 1dbe7daa144..1def1adf9c5 100644 --- a/sormas-e2e-tests/src/test/java/org/sormas/e2etests/steps/web/application/events/EventDirectorySteps.java +++ b/sormas-e2e-tests/src/test/java/org/sormas/e2etests/steps/web/application/events/EventDirectorySteps.java @@ -740,12 +740,12 @@ public EventDirectorySteps( webDriverHelpers.clickOnWebElementBySelector(FIRST_EVENT_PARTICIPANT); }); - When( - "I check if filtered participant for existing person appears in the event participants list", - () -> { - final String personUuid = apiState.getLastCreatedPerson().getUuid(); - webDriverHelpers.waitUntilElementIsVisibleAndClickable(getByEventUuid(personUuid)); - }); + When( + "I check if filtered participant for existing person appears in the event participants list", + () -> { + final String personUuid = apiState.getLastCreatedPerson().getUuid(); + webDriverHelpers.waitUntilElementIsVisibleAndClickable(getByEventUuid(personUuid)); + }); When( "I am accessing the event tab using the created event via api", () -> { @@ -799,25 +799,25 @@ public EventDirectorySteps( eventManagementStatus, "Event Management status is not correct")); }); - When( - "^I select last created API result in grid in Event Directory for Bulk Action$", - () -> { - webDriverHelpers.waitForPageLoadingSpinnerToDisappear(40); - webDriverHelpers.scrollToElement(getCheckboxByUUID(apiState.getCreatedEvent().getUuid())); - webDriverHelpers.clickOnWebElementBySelector( - getCheckboxByUUID(apiState.getCreatedEvent().getUuid())); - webDriverHelpers.waitForPageLoadingSpinnerToDisappear(40); - }); - When( - "^I select last created UI result in grid in Event Directory for Bulk Action$", - () -> { - webDriverHelpers.waitForPageLoadingSpinnerToDisappear(40); - webDriverHelpers.scrollToElement( - getCheckboxByUUID(CreateNewEventSteps.newEvent.getUuid())); - webDriverHelpers.clickOnWebElementBySelector( - getCheckboxByUUID(CreateNewEventSteps.newEvent.getUuid())); - webDriverHelpers.waitForPageLoadingSpinnerToDisappear(40); - }); + When( + "^I select last created API result in grid in Event Directory for Bulk Action$", + () -> { + webDriverHelpers.waitForPageLoadingSpinnerToDisappear(40); + webDriverHelpers.scrollToElement(getCheckboxByUUID(apiState.getCreatedEvent().getUuid())); + webDriverHelpers.clickOnWebElementBySelector( + getCheckboxByUUID(apiState.getCreatedEvent().getUuid())); + webDriverHelpers.waitForPageLoadingSpinnerToDisappear(40); + }); + When( + "^I select last created UI result in grid in Event Directory for Bulk Action$", + () -> { + webDriverHelpers.waitForPageLoadingSpinnerToDisappear(40); + webDriverHelpers.scrollToElement( + getCheckboxByUUID(CreateNewEventSteps.newEvent.getUuid())); + webDriverHelpers.clickOnWebElementBySelector( + getCheckboxByUUID(CreateNewEventSteps.newEvent.getUuid())); + webDriverHelpers.waitForPageLoadingSpinnerToDisappear(40); + }); When( "I click on the More button on Event directory page", () -> webDriverHelpers.clickOnWebElementBySelector(MORE_BUTTON_EVENT_DIRECTORY)); @@ -975,7 +975,7 @@ public EventDirectorySteps( "I select the Event CSV file in the file picker", () -> { webDriverHelpers.sendFile( - FILE_PICKER, userDirPath + "/uploads/ImportTestData_Events_INT.csv"); + FILE_PICKER, userDirPath + "uploads/ImportTestData_Events_INT.csv"); }); When( diff --git a/sormas-e2e-tests/src/test/resources/features/sanity/web/TravelEntry.feature b/sormas-e2e-tests/src/test/resources/features/sanity/web/TravelEntry.feature index a3b98549559..fc30f4f63f0 100644 --- a/sormas-e2e-tests/src/test/resources/features/sanity/web/TravelEntry.feature +++ b/sormas-e2e-tests/src/test/resources/features/sanity/web/TravelEntry.feature @@ -115,6 +115,33 @@ Feature: Create travel entries And I open the last created person linked with Case And I check that EDIT TRAVEL ENTRY button appears on Edit Person page + @issue=SORDEV-10360 @env_de + Scenario: Test add Date of arrival to Travel Entry and fill it when importing DEA information + Given I log in as a National User + And I click on the Entries button from navbar + And I click on the New Travel Entry button from Travel Entries directory + When I fill the required fields in a new travel entry form + And I change a Date of Arrival for wrong date from next day + And I click on Save button from the new travel entry form + And I check that Date of Arrival validation popup is appear + And I change a Date of Arrival for correct date + Then I check that word Date of arrival is appropriate translated to German language + And I click on Save button from the new travel entry form + Then I check the created data is correctly displayed on Edit travel entry page for DE version + And I click on the Entries button from navbar + Then I click on the Import button from Travel Entries directory + And I select the attached CSV file in the file picker from Travel Entries directory + And I click on the START DATA IMPORT button from the Import Travel Entries popup + And I acquires the first name and last name imported person + And I select to create new person from the Import Travel Entries popup + And I confirm the save Travel Entries Import popup + Then I check that an import success notification appears in the Import Travel Entries popup + And I close Data import popup for Travel Entries + And I close Import Travel Entries form + Then I filter by Person full name on Travel Entry directory page + And I open the imported person on Travel entry directory page + And I check the information about Dates for imported travel entry on Edit Travel entry page + @issue=SORDEV-9818 @env_de Scenario: Bulk deleting entries in Travel Entry Directory Given I log in as a Admin User From abd58c414c610a471e10c23e8b68e0bc44ff9529 Mon Sep 17 00:00:00 2001 From: Carina Paul Date: Tue, 10 May 2022 17:37:07 +0300 Subject: [PATCH 062/167] #8981 - Fix Create Treatment button --- .../main/java/de/symeda/sormas/ui/therapy/PrescriptionGrid.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sormas-ui/src/main/java/de/symeda/sormas/ui/therapy/PrescriptionGrid.java b/sormas-ui/src/main/java/de/symeda/sormas/ui/therapy/PrescriptionGrid.java index cc0abe5e887..b20d0be3ad6 100644 --- a/sormas-ui/src/main/java/de/symeda/sormas/ui/therapy/PrescriptionGrid.java +++ b/sormas-ui/src/main/java/de/symeda/sormas/ui/therapy/PrescriptionGrid.java @@ -79,7 +79,7 @@ public Class getType() { VaadinUiUtil.setupEditColumn(getColumn(EDIT_BTN_ID)); if (!isPseudonymized) { - getColumn(DOCUMENT_TREATMENT_BTN_ID).setRenderer(new GridButtonRenderer()); + getColumn(DOCUMENT_TREATMENT_BTN_ID).setRenderer(new GridButtonRenderer()).setMinimumWidth(180); getColumn(DOCUMENT_TREATMENT_BTN_ID).setHeaderCaption(""); } else { getColumn(DOCUMENT_TREATMENT_BTN_ID).setHidden(true); From b44168dbb6d8722136690abd9da311785150cdc5 Mon Sep 17 00:00:00 2001 From: Michal Kozakiewicz Date: Tue, 10 May 2022 16:52:29 +0200 Subject: [PATCH 063/167] Fix for method "I click on Save button from the new travel entry form" in CreateNewTravelEntrySteps --- .../steps/web/application/entries/CreateNewTravelEntrySteps.java | 1 - 1 file changed, 1 deletion(-) diff --git a/sormas-e2e-tests/src/test/java/org/sormas/e2etests/steps/web/application/entries/CreateNewTravelEntrySteps.java b/sormas-e2e-tests/src/test/java/org/sormas/e2etests/steps/web/application/entries/CreateNewTravelEntrySteps.java index 60d7bc35723..388c46879c8 100644 --- a/sormas-e2e-tests/src/test/java/org/sormas/e2etests/steps/web/application/entries/CreateNewTravelEntrySteps.java +++ b/sormas-e2e-tests/src/test/java/org/sormas/e2etests/steps/web/application/entries/CreateNewTravelEntrySteps.java @@ -169,7 +169,6 @@ public CreateNewTravelEntrySteps( "^I click on Save button from the new travel entry form$", () -> { webDriverHelpers.clickOnWebElementBySelector(SAVE_BUTTON); - webDriverHelpers.waitUntilElementIsVisibleAndClickable(UUID_INPUT); }); When( From 6644754affde9537f07ece639aca223080f973f5 Mon Sep 17 00:00:00 2001 From: Michal Kozakiewicz Date: Tue, 10 May 2022 17:16:58 +0200 Subject: [PATCH 064/167] Fixes on scenario [SORDEV-10360] --- .../web/application/entries/TravelEntryDirectorySteps.java | 6 ++---- .../steps/web/application/events/EventDirectorySteps.java | 2 +- .../test/resources/features/sanity/web/TravelEntry.feature | 2 +- 3 files changed, 4 insertions(+), 6 deletions(-) diff --git a/sormas-e2e-tests/src/test/java/org/sormas/e2etests/steps/web/application/entries/TravelEntryDirectorySteps.java b/sormas-e2e-tests/src/test/java/org/sormas/e2etests/steps/web/application/entries/TravelEntryDirectorySteps.java index fcaa9d4af1f..f96d663102d 100644 --- a/sormas-e2e-tests/src/test/java/org/sormas/e2etests/steps/web/application/entries/TravelEntryDirectorySteps.java +++ b/sormas-e2e-tests/src/test/java/org/sormas/e2etests/steps/web/application/entries/TravelEntryDirectorySteps.java @@ -83,7 +83,6 @@ public TravelEntryDirectorySteps( When( "I close Import Travel Entries form", () -> { - // TimeUnit.SECONDS.sleep(5); // waiting for close Data import popup webDriverHelpers.waitUntilElementIsVisibleAndClickable(CLOSE_IMPORT_TRAVEL_ENTRY_BUTTON); webDriverHelpers.clickOnWebElementBySelector(CLOSE_IMPORT_TRAVEL_ENTRY_BUTTON); }); @@ -99,8 +98,7 @@ public TravelEntryDirectorySteps( When( "I select the attached CSV file in the file picker from Travel Entries directory", () -> { - TimeUnit.SECONDS.sleep(5); - webDriverHelpers.sendFile(FILE_PICKER, userDirPath + "\\uploads\\DEA_TestImport.csv"); + webDriverHelpers.sendFile(FILE_PICKER, userDirPath + "/uploads/DEA_TestImport.csv"); }); When( @@ -117,7 +115,7 @@ public TravelEntryDirectorySteps( }); When( - "I acquires the first name and last name imported person", + "I acquire the first name and last name imported person", () -> { String firstName = webDriverHelpers.getTextFromWebElement(FIRST_NAME_IMPORTED_PERSON); String lastName = webDriverHelpers.getTextFromWebElement(LAST_NAME_IMPORTED_PERSON); diff --git a/sormas-e2e-tests/src/test/java/org/sormas/e2etests/steps/web/application/events/EventDirectorySteps.java b/sormas-e2e-tests/src/test/java/org/sormas/e2etests/steps/web/application/events/EventDirectorySteps.java index 1def1adf9c5..d0309615af5 100644 --- a/sormas-e2e-tests/src/test/java/org/sormas/e2etests/steps/web/application/events/EventDirectorySteps.java +++ b/sormas-e2e-tests/src/test/java/org/sormas/e2etests/steps/web/application/events/EventDirectorySteps.java @@ -975,7 +975,7 @@ public EventDirectorySteps( "I select the Event CSV file in the file picker", () -> { webDriverHelpers.sendFile( - FILE_PICKER, userDirPath + "uploads/ImportTestData_Events_INT.csv"); + FILE_PICKER, userDirPath + "/uploads/ImportTestData_Events_INT.csv"); }); When( diff --git a/sormas-e2e-tests/src/test/resources/features/sanity/web/TravelEntry.feature b/sormas-e2e-tests/src/test/resources/features/sanity/web/TravelEntry.feature index fc30f4f63f0..0db4cdeb7b5 100644 --- a/sormas-e2e-tests/src/test/resources/features/sanity/web/TravelEntry.feature +++ b/sormas-e2e-tests/src/test/resources/features/sanity/web/TravelEntry.feature @@ -132,7 +132,7 @@ Feature: Create travel entries Then I click on the Import button from Travel Entries directory And I select the attached CSV file in the file picker from Travel Entries directory And I click on the START DATA IMPORT button from the Import Travel Entries popup - And I acquires the first name and last name imported person + And I acquire the first name and last name imported person And I select to create new person from the Import Travel Entries popup And I confirm the save Travel Entries Import popup Then I check that an import success notification appears in the Import Travel Entries popup From 285d0ab7e4ff4ae94c72ef25fa723e8c965b5e6e Mon Sep 17 00:00:00 2001 From: Michal Kozakiewicz Date: Tue, 10 May 2022 17:26:56 +0200 Subject: [PATCH 065/167] Added DEA_TestImport.csv file --- sormas-e2e-tests/uploads/DEA_TestImport.csv | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 sormas-e2e-tests/uploads/DEA_TestImport.csv diff --git a/sormas-e2e-tests/uploads/DEA_TestImport.csv b/sormas-e2e-tests/uploads/DEA_TestImport.csv new file mode 100644 index 00000000000..5067b81b708 --- /dev/null +++ b/sormas-e2e-tests/uploads/DEA_TestImport.csv @@ -0,0 +1,4 @@ +externalId;disease;diseaseVariant;responsibleRegion;responsibleDistrict;responsibleCommunity;pointOfEntryRegion;pointOfEntryDistrict;pointOfEntry;pointOfEntryDetails;reportDate;Nachname;Vorname;Geschlecht;Geburtsdatum;Tel. persönlich;Tel. weitere;E-Mail Adresse;recovered;vaccinated;testedNegative;quarantine;quarantineHomePossible;quarantineTypeDetails;quarantineFrom;quarantineTo;quarantineHelpNeeded;quarantineOrderedVerbally;quarantineOrderedVerballyDate;quarantineOrderedOfficialDocument;quarantineOrderedOfficialDocumentDate;quarantineHomeSupplyEnsured;dateOfArrival +##Externe ID;Krankheit;Krankheitsvariante;Zuständiges Bundesland;Zuständige/r Landkreis/Kreisfreie Stadt;Zuständige Gemeinde;Einreiseort Bundesland;Einreiseort Landkreis/kreisfreie Stadt;Einreiseort;Einreiseort Details;Meldedatum;;;;;Primäre Telefonnummer;weitere Telefonnummer;Primäre E-Mail Adresse;Genesen;Geimpft;Negativ getestet;;Häusliche Quarantäne möglich?;Quarantäne Details;Quarantäne Beginn;Quarantäne Ende;Maßnahmen zur Gewährleistung der Versorgung?;Quarantäne mündlich verordnet?;Datum der mündlichen Anordnung;Quarantäne schriftlich verordnet?;Datum der schriftlichen Anordnung;Versorgung sichergestellt?;Tag der Einreise +##ID;Coronavirus ;;;;;;;OTHER_AIRPORT,OTHER_SEAPORT,OTHER_GROUND_CROSSING,OTHER_POINT_OF_ENTRY;;Datum ;;;Male,Female,Other,Unknown;Datum;;;;TRUE,FALSE;TRUE,FALSE;TRUE,FALSE;Home,Institutional,None,Unknown,Other;Yes,No,Unknown;Text;Datum;Datum;Text;TRUE,FALSE;Datum;TRUE,FALSE;Datum;Yes,No,Unknown;Datum +1234-1234-123;CORONAVIRUS;B.1.427;Berlin;SK Berlin Mitte;Gesundbrunnen;Berlin;SK Berlin Mitte;OTHER_AIRPORT;Test;03.10.2021;Becker;Theresa;Female;23.04.1993;123456789;6765434567;email@adresse.de;TRUE;TRUE;FALSE;Home;Yes;Details;03.10.2021;12.10.2021;Familie bringt Essen;TRUE;03.10.2021;FALSE;03.10.2021;Yes;02.10.2021 From bae469f15746ace0b12b276c55d1642a0282b022 Mon Sep 17 00:00:00 2001 From: Stefan Kock Date: Wed, 11 May 2022 09:49:13 +0200 Subject: [PATCH 066/167] #8610 Removed superfluous query hint (query does not fetch entities) --- .../java/de/symeda/sormas/backend/sample/SampleService.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/sormas-backend/src/main/java/de/symeda/sormas/backend/sample/SampleService.java b/sormas-backend/src/main/java/de/symeda/sormas/backend/sample/SampleService.java index c9e7e6f274a..615b17a173c 100644 --- a/sormas-backend/src/main/java/de/symeda/sormas/backend/sample/SampleService.java +++ b/sormas-backend/src/main/java/de/symeda/sormas/backend/sample/SampleService.java @@ -102,7 +102,6 @@ import de.symeda.sormas.backend.user.UserService; import de.symeda.sormas.backend.util.IterableHelper; import de.symeda.sormas.backend.util.JurisdictionHelper; -import de.symeda.sormas.backend.util.ModelConstants; import de.symeda.sormas.backend.util.Pseudonymizer; import de.symeda.sormas.backend.util.QueryHelper; @@ -329,7 +328,7 @@ public List getIndexList(SampleCriteria sampleCriteria, Integer sampleIdExpr.in(samples.stream().map(SampleIndexDto::getUuid).collect(Collectors.toList()))); testCq.orderBy(cb.desc(testRoot.get(PathogenTest.CHANGE_DATE))); - List testList = em.createQuery(testCq).setHint(ModelConstants.HINT_HIBERNATE_READ_ONLY, true).getResultList(); + List testList = em.createQuery(testCq).getResultList(); Map tests = testList.stream() .filter(distinctByKey(pathogenTest -> pathogenTest[2])) From d4da5469d86cea62ffabb8716e1491f8259bcd1c Mon Sep 17 00:00:00 2001 From: FredrikSchaeferVitagroup <67001822+FredrikSchaeferVitagroup@users.noreply.github.com> Date: Wed, 11 May 2022 10:41:55 +0200 Subject: [PATCH 067/167] #9025 fix type filter values (#9126) --- .../java/de/symeda/sormas/api/labmessage/LabMessageDto.java | 1 + .../sormas/ui/labmessage/LabMessageGridFilterForm.java | 5 ++--- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/sormas-api/src/main/java/de/symeda/sormas/api/labmessage/LabMessageDto.java b/sormas-api/src/main/java/de/symeda/sormas/api/labmessage/LabMessageDto.java index 6fcbc9ae7e4..7414a2c7656 100644 --- a/sormas-api/src/main/java/de/symeda/sormas/api/labmessage/LabMessageDto.java +++ b/sormas-api/src/main/java/de/symeda/sormas/api/labmessage/LabMessageDto.java @@ -24,6 +24,7 @@ public class LabMessageDto extends SormasToSormasShareableDto { public static final String I18N_PREFIX = "LabMessage"; + public static final String TYPE = "type"; public static final String MESSAGE_DATE_TIME = "messageDateTime"; public static final String SAMPLE_DATE_TIME = "sampleDateTime"; public static final String SAMPLE_RECEIVED_DATE = "sampleReceivedDate"; diff --git a/sormas-ui/src/main/java/de/symeda/sormas/ui/labmessage/LabMessageGridFilterForm.java b/sormas-ui/src/main/java/de/symeda/sormas/ui/labmessage/LabMessageGridFilterForm.java index c0d5b1b05fa..7f32049e432 100644 --- a/sormas-ui/src/main/java/de/symeda/sormas/ui/labmessage/LabMessageGridFilterForm.java +++ b/sormas-ui/src/main/java/de/symeda/sormas/ui/labmessage/LabMessageGridFilterForm.java @@ -28,8 +28,8 @@ import de.symeda.sormas.api.i18n.Captions; import de.symeda.sormas.api.i18n.I18nProperties; import de.symeda.sormas.api.i18n.Strings; -import de.symeda.sormas.api.labmessage.ExternalMessageType; import de.symeda.sormas.api.labmessage.LabMessageCriteria; +import de.symeda.sormas.api.labmessage.LabMessageDto; import de.symeda.sormas.api.labmessage.LabMessageIndexDto; import de.symeda.sormas.api.user.UserDto; import de.symeda.sormas.api.user.UserReferenceDto; @@ -75,8 +75,7 @@ protected void addFields() { assignee.addItems(FacadeProvider.getUserFacade().getUsersByRegionAndRights(user.getRegion(), null, UserRight.LAB_MESSAGES)); assignee.setNullSelectionAllowed(true); - ComboBox type = addField(LabMessageCriteria.TYPE, ComboBox.class); - type.addItems((Object) ExternalMessageType.values()); + addField(LabMessageDto.TYPE, ComboBox.class); DateTimeField messageDateFrom = addField(LabMessageCriteria.MESSAGE_DATE_FROM, DateTimeField.class); messageDateFrom.setCaption(I18nProperties.getPrefixCaption(LabMessageCriteria.I18N_PREFIX, LabMessageCriteria.MESSAGE_DATE_FROM)); From dacb78ba12b9620dd685aabb4146b34057f8c1f0 Mon Sep 17 00:00:00 2001 From: Michal Kozakiewicz Date: Wed, 11 May 2022 11:24:49 +0200 Subject: [PATCH 068/167] Added next step to [SORDEV-9787] scenario --- .../entries/CreateNewTravelEntryPage.java | 1 - .../application/entries/TravelEntryPage.java | 5 +++ .../entries/CreateNewTravelEntrySteps.java | 10 ++---- .../entries/TravelEntryDirectorySteps.java | 30 +++++++++++++++++ .../sanity/web/TravelEntryFilters.feature | 32 +++++++++---------- 5 files changed, 53 insertions(+), 25 deletions(-) diff --git a/sormas-e2e-tests/src/main/java/org/sormas/e2etests/pages/application/entries/CreateNewTravelEntryPage.java b/sormas-e2e-tests/src/main/java/org/sormas/e2etests/pages/application/entries/CreateNewTravelEntryPage.java index 4f3ac041a03..56824e50671 100644 --- a/sormas-e2e-tests/src/main/java/org/sormas/e2etests/pages/application/entries/CreateNewTravelEntryPage.java +++ b/sormas-e2e-tests/src/main/java/org/sormas/e2etests/pages/application/entries/CreateNewTravelEntryPage.java @@ -53,7 +53,6 @@ public class CreateNewTravelEntryPage { "//div[@class='v-Notification error v-Notification-error']//div[@class='popupContent']"); public static final By DATE_OF_ARRIVAL_LABEL_DE = By.xpath("//div[@location='dateOfArrival']//div/div/div[@class='v-captiontext']"); - public static final By REPORT_DATE = By.cssSelector("#reportDate input"); public static final By FIRST_TRAVEL_ENTRY_ID_BUTTON = By.cssSelector(".v-grid-row-has-data a[title]"); } diff --git a/sormas-e2e-tests/src/main/java/org/sormas/e2etests/pages/application/entries/TravelEntryPage.java b/sormas-e2e-tests/src/main/java/org/sormas/e2etests/pages/application/entries/TravelEntryPage.java index 3d157eaa1d2..4d8a0b0c487 100644 --- a/sormas-e2e-tests/src/main/java/org/sormas/e2etests/pages/application/entries/TravelEntryPage.java +++ b/sormas-e2e-tests/src/main/java/org/sormas/e2etests/pages/application/entries/TravelEntryPage.java @@ -56,6 +56,11 @@ public static By getCheckboxByIndex(String idx) { public static final By LAST_NAME_IMPORTED_PERSON = By.xpath("//span[text()='Nachname']/../following-sibling::div"); public static final By FIRST_RESULT_ID = By.xpath("//table/tbody/tr[2]/td[1]"); + public static final By TRAVEL_ENTRY_DATA_FILTER_OPTION_COMBOBOX = By.cssSelector("[id='dateFilterOption'] [class='v-filterselect-button']"); + public static final By WEEK_FROM_OPTION_COMBOBOX = + By.cssSelector("[id='weekFrom'] [class='v-filterselect-button']"); + public static final By WEEK_TO_OPTION_COMBOBOX = + By.cssSelector("[id='weekTo'] [class='v-filterselect-button']"); } diff --git a/sormas-e2e-tests/src/test/java/org/sormas/e2etests/steps/web/application/entries/CreateNewTravelEntrySteps.java b/sormas-e2e-tests/src/test/java/org/sormas/e2etests/steps/web/application/entries/CreateNewTravelEntrySteps.java index 374f825de6b..147815b3ff0 100644 --- a/sormas-e2e-tests/src/test/java/org/sormas/e2etests/steps/web/application/entries/CreateNewTravelEntrySteps.java +++ b/sormas-e2e-tests/src/test/java/org/sormas/e2etests/steps/web/application/entries/CreateNewTravelEntrySteps.java @@ -55,7 +55,6 @@ import cucumber.api.java8.En; import java.time.LocalDate; import java.time.format.DateTimeFormatter; -import java.time.temporal.IsoFields; import java.util.List; import java.util.Locale; import java.util.concurrent.TimeUnit; @@ -81,6 +80,7 @@ public class CreateNewTravelEntrySteps implements En { public static TravelEntry newCaseFromTravelEntryData; public static Case aCase; public static String collectTravelEntryPersonUuid; + public static LocalDate previousWeekDate; String firstName; String lastName; String sex; @@ -121,12 +121,8 @@ public CreateNewTravelEntrySteps( When( "^I change a Report Date for previous week date$", () -> { - fillReportDate(travelEntry.getReportDate().minusDays(7), Locale.GERMAN); - LocalDate dateReport = - LocalDate.parse( - webDriverHelpers.getValueFromWebElement(REPORT_DATE), DATE_FORMATTER_DE); - int week = dateReport.get(IsoFields.WEEK_OF_WEEK_BASED_YEAR); - System.out.println("Week of year: " + week); + previousWeekDate = travelEntry.getReportDate().minusDays(7); + fillReportDate(previousWeekDate, Locale.GERMAN); }); When( diff --git a/sormas-e2e-tests/src/test/java/org/sormas/e2etests/steps/web/application/entries/TravelEntryDirectorySteps.java b/sormas-e2e-tests/src/test/java/org/sormas/e2etests/steps/web/application/entries/TravelEntryDirectorySteps.java index 44b27b70154..bebe483ab89 100644 --- a/sormas-e2e-tests/src/test/java/org/sormas/e2etests/steps/web/application/entries/TravelEntryDirectorySteps.java +++ b/sormas-e2e-tests/src/test/java/org/sormas/e2etests/steps/web/application/entries/TravelEntryDirectorySteps.java @@ -45,12 +45,16 @@ import static org.sormas.e2etests.pages.application.entries.TravelEntryPage.TRAVEL_ENTRY_FIRST_RECORD_IN_TABLE; import static org.sormas.e2etests.pages.application.entries.TravelEntryPage.TRAVEL_ENTRY_GRID_RESULTS_ROWS; import static org.sormas.e2etests.pages.application.entries.TravelEntryPage.VACCINATED_ENTRIES; +import static org.sormas.e2etests.pages.application.entries.TravelEntryPage.WEEK_FROM_OPTION_COMBOBOX; +import static org.sormas.e2etests.pages.application.entries.TravelEntryPage.WEEK_TO_OPTION_COMBOBOX; import static org.sormas.e2etests.pages.application.entries.TravelEntryPage.getCheckboxByIndex; import static org.sormas.e2etests.pages.application.events.EventDirectoryPage.BULK_ACTIONS_EVENT_DIRECTORY; import static org.sormas.e2etests.pages.application.tasks.TaskManagementPage.BULK_EDIT_BUTTON; import cucumber.api.java8.En; +import java.time.LocalDate; import java.time.format.DateTimeFormatter; +import java.time.temporal.IsoFields; import java.util.concurrent.TimeUnit; import javax.inject.Inject; import org.openqa.selenium.By; @@ -309,6 +313,32 @@ public TravelEntryDirectorySteps( "I apply {string} to data filter option combobox on Travel Entry directory page", (String value) -> webDriverHelpers.selectFromCombobox(TRAVEL_ENTRY_DATA_FILTER_OPTION_COMBOBOX, value)); + Then( + "I apply the last epi week for week from combobox on Travel Entry directory page", + () -> { + int week = + CreateNewTravelEntrySteps.previousWeekDate.get(IsoFields.WEEK_OF_WEEK_BASED_YEAR) + 1; //because weeks are counting since end of december previous year + String lastEpiWeek = "Wo " + week + "-" + LocalDate.now().getYear(); + webDriverHelpers.selectFromCombobox(WEEK_FROM_OPTION_COMBOBOX, lastEpiWeek); + }); + + Then( + "I apply the last epi week for week to combobox on Travel Entry directory page", + () -> { + int week = + CreateNewTravelEntrySteps.previousWeekDate.get(IsoFields.WEEK_OF_WEEK_BASED_YEAR) + 1; //because weeks are counting since end of december previous year + String lastEpiWeek = "Wo " + week + "-" + LocalDate.now().getYear(); + webDriverHelpers.selectFromCombobox(WEEK_TO_OPTION_COMBOBOX, lastEpiWeek); + }); + Then( + "I apply the week before the last epi week for week to combobox on Travel Entry directory page", + () -> { + int week = + CreateNewTravelEntrySteps.previousWeekDate.get(IsoFields.WEEK_OF_WEEK_BASED_YEAR); + String lastEpiWeek = "Wo " + week + "-" + LocalDate.now().getYear(); + webDriverHelpers.selectFromCombobox(WEEK_TO_OPTION_COMBOBOX, lastEpiWeek); + }); + When( "I click on first filtered record in Travel Entry", () -> { diff --git a/sormas-e2e-tests/src/test/resources/features/sanity/web/TravelEntryFilters.feature b/sormas-e2e-tests/src/test/resources/features/sanity/web/TravelEntryFilters.feature index c8940ae4b4d..61da836f474 100644 --- a/sormas-e2e-tests/src/test/resources/features/sanity/web/TravelEntryFilters.feature +++ b/sormas-e2e-tests/src/test/resources/features/sanity/web/TravelEntryFilters.feature @@ -56,28 +56,26 @@ Scenario: Check Travel Entry filters Then I check the created data is correctly displayed on Edit travel entry page for DE version And I navigate to person tab in Edit travel entry page And I check the created data is correctly displayed on Edit travel entry person page for DE version - -# ToDO(DELETE!!!): -# Ponizsze Stepy sa najprawdopodobniej do usuniecia !!!-> był to swoisty workaround, który po naprawieniu buga jest bez sensu -# And I click on the Entries button from navbar -# And I filter by Person ID on Travel Entry directory page - -# And I open last created Travel Entry -# And I change a Report Date for previous week date -# And I click on Save button from the edit travel entry form - + And I click on the Entries button from navbar + And I filter by Person ID on Travel Entry directory page + And I open last created Travel Entry + And I change a Report Date for previous week date + And I click on Save button from the edit travel entry form And I click on the Entries button from navbar And I filter by Person ID on Travel Entry directory page And I click on SHOW MORE FILTERS BUTTON Travel Entry directory page - And I fill Travel Entry from input to 5 days before UI Travel Entry created on Travel Entry directory page - And I fill Travel Entry to input to 3 days after UI Travel Entry created on Travel Entry directory page + And I fill Travel Entry from input to 9 days before UI Travel Entry created on Travel Entry directory page + And I fill Travel Entry to input to 1 days after UI Travel Entry created on Travel Entry directory page And I click APPLY BUTTON in Travel Entry Directory Page And I check that number of displayed Travel Entry results is 1 - And I fill Travel Entry to input to 2 days before UI Travel Entry created on Travel Entry directory page + And I fill Travel Entry to input to 10 days before UI Travel Entry created on Travel Entry directory page And I click APPLY BUTTON in Travel Entry Directory Page And I check that number of displayed Travel Entry results is 0 And I apply "Nach Epi Woche" to data filter option combobox on Travel Entry directory page - -# ToDO -> przykladowo weekend roku pozyskiwany jest w "I change a Report Date for previous week date" -# uzupelnic weekd roku i po nim wyszukac ostatni weekend w comboboxie -# I zrobic filtracje danych i bedzie git!!! \ No newline at end of file + And I apply the last epi week for week from combobox on Travel Entry directory page + And I apply the last epi week for week to combobox on Travel Entry directory page + And I click APPLY BUTTON in Travel Entry Directory Page + And I check that number of displayed Travel Entry results is 1 + Then I apply the week before the last epi week for week to combobox on Travel Entry directory page + And I click APPLY BUTTON in Travel Entry Directory Page + And I check that number of displayed Travel Entry results is 0 \ No newline at end of file From 8d53e1187d4b111a0ebbab111ab1269582ca660c Mon Sep 17 00:00:00 2001 From: Michal Kozakiewicz Date: Wed, 11 May 2022 11:30:48 +0200 Subject: [PATCH 069/167] Remove print method from [SORDEV-9787] scenario --- .../web/application/entries/TravelEntryDirectorySteps.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/sormas-e2e-tests/src/test/java/org/sormas/e2etests/steps/web/application/entries/TravelEntryDirectorySteps.java b/sormas-e2e-tests/src/test/java/org/sormas/e2etests/steps/web/application/entries/TravelEntryDirectorySteps.java index bebe483ab89..6bfcee53a52 100644 --- a/sormas-e2e-tests/src/test/java/org/sormas/e2etests/steps/web/application/entries/TravelEntryDirectorySteps.java +++ b/sormas-e2e-tests/src/test/java/org/sormas/e2etests/steps/web/application/entries/TravelEntryDirectorySteps.java @@ -197,7 +197,6 @@ public TravelEntryDirectorySteps( () -> { webDriverHelpers.fillAndSubmitInWebElement( PERSON_FILTER_INPUT, CreateNewTravelEntrySteps.aTravelEntry.getUuid()); - System.out.println("UUID: " + CreateNewTravelEntrySteps.aTravelEntry.getUuid()); }); When( "I check if popup deletion message appeared", @@ -317,7 +316,8 @@ public TravelEntryDirectorySteps( "I apply the last epi week for week from combobox on Travel Entry directory page", () -> { int week = - CreateNewTravelEntrySteps.previousWeekDate.get(IsoFields.WEEK_OF_WEEK_BASED_YEAR) + 1; //because weeks are counting since end of december previous year + CreateNewTravelEntrySteps.previousWeekDate.get(IsoFields.WEEK_OF_WEEK_BASED_YEAR) + + 1; // because weeks are counting since end of december previous year String lastEpiWeek = "Wo " + week + "-" + LocalDate.now().getYear(); webDriverHelpers.selectFromCombobox(WEEK_FROM_OPTION_COMBOBOX, lastEpiWeek); }); @@ -326,7 +326,8 @@ public TravelEntryDirectorySteps( "I apply the last epi week for week to combobox on Travel Entry directory page", () -> { int week = - CreateNewTravelEntrySteps.previousWeekDate.get(IsoFields.WEEK_OF_WEEK_BASED_YEAR) + 1; //because weeks are counting since end of december previous year + CreateNewTravelEntrySteps.previousWeekDate.get(IsoFields.WEEK_OF_WEEK_BASED_YEAR) + + 1; // because weeks are counting since end of december previous year String lastEpiWeek = "Wo " + week + "-" + LocalDate.now().getYear(); webDriverHelpers.selectFromCombobox(WEEK_TO_OPTION_COMBOBOX, lastEpiWeek); }); From 804091241bb5ff7a4d1dbd59ec204808c0950684 Mon Sep 17 00:00:00 2001 From: Razvan Date: Wed, 11 May 2022 12:32:17 +0300 Subject: [PATCH 070/167] #9043-RefactorEnvironmentUUIDsUsage : implemented new approach to collect uuids from environments --- .../sormas/e2etests/common/CommonModule.java | 2 +- .../e2etests/constants/api/Endpoints.java | 7 + .../e2etests/enums/APITestData/Disease.java | 80 -------- .../enums/APITestData/FacilityType.java | 82 -------- .../APITestData/POSTCase_ErrorMessages.java | 27 --- .../sormas/e2etests/enums/FacilityUUIDs.java | 1 + .../e2etests/enums/HealthFacilityValues.java | 31 +++ .../e2etests/enums/SubcontinentUUIDs.java | 6 +- .../entities/services/api/CaseApiService.java | 43 ++-- .../services/api/ContactApiService.java | 27 ++- .../services/api/EventApiService.java | 26 ++- .../services/api/ImmunizationApiService.java | 22 +- .../services/api/PersonApiService.java | 45 ++--- .../services/api/SampleApiService.java | 18 +- .../entities/services/api/TaskApiService.java | 12 +- .../e2etests/helpers/WebDriverHelpers.java | 29 ++- .../environmentdata/dto/Community.java | 30 +++ .../environmentdata/dto/Continent.java | 30 +++ .../helpers/environmentdata/dto/Country.java | 32 +++ .../helpers/environmentdata/dto/District.java | 30 +++ .../environmentdata/dto/HealthFacility.java | 30 +++ .../helpers/environmentdata/dto/Region.java | 30 +++ .../environmentdata/dto/Subcontinent.java | 13 ++ .../helpers/environmentdata/dto/User.java | 31 +++ .../manager/EnvironmentManager.java | 188 ++++++++++++++++++ .../api/commonSteps/ResponseChecksSteps.java | 3 +- .../web/application/AboutDirectorySteps.java | 41 ++-- .../steps/web/application/LoginSteps.java | 3 +- .../cases/CaseDetailedTableViewSteps.java | 4 +- .../ContactsDetailedTableViewSteps.java | 4 +- .../contacts/FollowUpVisitsTabSteps.java | 7 +- .../application/events/EditEventSteps.java | 67 +++---- .../events/EventDirectorySteps.java | 79 ++++---- 33 files changed, 688 insertions(+), 392 deletions(-) delete mode 100644 sormas-e2e-tests/src/main/java/org/sormas/e2etests/enums/APITestData/Disease.java delete mode 100644 sormas-e2e-tests/src/main/java/org/sormas/e2etests/enums/APITestData/FacilityType.java delete mode 100644 sormas-e2e-tests/src/main/java/org/sormas/e2etests/enums/APITestData/POSTCase_ErrorMessages.java create mode 100644 sormas-e2e-tests/src/main/java/org/sormas/e2etests/enums/HealthFacilityValues.java create mode 100644 sormas-e2e-tests/src/test/java/org/sormas/e2etests/helpers/environmentdata/dto/Community.java create mode 100644 sormas-e2e-tests/src/test/java/org/sormas/e2etests/helpers/environmentdata/dto/Continent.java create mode 100644 sormas-e2e-tests/src/test/java/org/sormas/e2etests/helpers/environmentdata/dto/Country.java create mode 100644 sormas-e2e-tests/src/test/java/org/sormas/e2etests/helpers/environmentdata/dto/District.java create mode 100644 sormas-e2e-tests/src/test/java/org/sormas/e2etests/helpers/environmentdata/dto/HealthFacility.java create mode 100644 sormas-e2e-tests/src/test/java/org/sormas/e2etests/helpers/environmentdata/dto/Region.java create mode 100644 sormas-e2e-tests/src/test/java/org/sormas/e2etests/helpers/environmentdata/dto/Subcontinent.java create mode 100644 sormas-e2e-tests/src/test/java/org/sormas/e2etests/helpers/environmentdata/dto/User.java create mode 100644 sormas-e2e-tests/src/test/java/org/sormas/e2etests/helpers/environmentdata/manager/EnvironmentManager.java diff --git a/sormas-e2e-tests/src/main/java/org/sormas/e2etests/common/CommonModule.java b/sormas-e2e-tests/src/main/java/org/sormas/e2etests/common/CommonModule.java index ad42e90a87d..42e06bf2a3f 100644 --- a/sormas-e2e-tests/src/main/java/org/sormas/e2etests/common/CommonModule.java +++ b/sormas-e2e-tests/src/main/java/org/sormas/e2etests/common/CommonModule.java @@ -53,7 +53,7 @@ Faker provideFaker() { @Provides @Singleton @Exposed - RunningConfiguration provideEnvManager() { + RunningConfiguration provideRunningConfiguration() { return new RunningConfiguration(); } diff --git a/sormas-e2e-tests/src/main/java/org/sormas/e2etests/constants/api/Endpoints.java b/sormas-e2e-tests/src/main/java/org/sormas/e2etests/constants/api/Endpoints.java index 3ee759aebae..21fb14e6eae 100644 --- a/sormas-e2e-tests/src/main/java/org/sormas/e2etests/constants/api/Endpoints.java +++ b/sormas-e2e-tests/src/main/java/org/sormas/e2etests/constants/api/Endpoints.java @@ -22,16 +22,23 @@ public interface Endpoints { /** Main paths */ String PERSONS_PATH = "persons/"; + String USERS_PATH = "users/"; String IMMUNIZATIONS_PATH = "immunizations/"; String CASES_PATH = "cases/"; String COMMUNITIES_PATH = "communities/"; String COUNTRIES_PATH = "countries/"; + String CONTINENTS_PATH = "continents/"; + String SUBCONTINENTS_PATH = "subcontinents/"; + String REGIONS_PATH = "regions/"; + String DISTRICTS_PATH = "districts/"; String FACILITIES_PATH = "facilities/"; String CONTACTS_PATH = "contacts/"; String EVENTS_PATH = "events/"; String SAMPLES_PATH = "samples/"; String TASKS_PATH = "tasks/"; + String ALL_FROM_0 = "all/0"; + /** End points actions */ String POST_PATH = "push"; diff --git a/sormas-e2e-tests/src/main/java/org/sormas/e2etests/enums/APITestData/Disease.java b/sormas-e2e-tests/src/main/java/org/sormas/e2etests/enums/APITestData/Disease.java deleted file mode 100644 index 037a9a46956..00000000000 --- a/sormas-e2e-tests/src/main/java/org/sormas/e2etests/enums/APITestData/Disease.java +++ /dev/null @@ -1,80 +0,0 @@ -/* - * SORMAS® - Surveillance Outbreak Response Management & Analysis System - * Copyright © 2016-2022 Helmholtz-Zentrum für Infektionsforschung GmbH (HZI) - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -package org.sormas.e2etests.enums.APITestData; - -public enum Disease { - MONKEYPOX, - ONCHOCERCIASIS, - ANTHRAX, - RHINOVIRUS, - DENGUE, - POLIO, - NON_NEONATAL_TETANUS, - PNEUMONIA, - TUBERCULOSIS, - NEW_INFLUENZA, - PERINATAL_DEATHS, - CONGENITAL_RUBELLA, - M_PNEUMONIAE, - DIARRHEA_BLOOD, - LYMPHATIC_FILARIASIS, - ENTEROVIRUS, - UNSPECIFIED_VHF, - UNDEFINED, - MATERNAL_DEATHS, - EVD, - SNAKE_BITE, - RUBELLA, - DIPHTERIA, - CORONAVIRUS, - NEONATAL_TETANUS, - PERTUSSIS, - ACUTE_VIRAL_HEPATITIS, - LASSA, - BURULI_ULCER, - YELLOW_FEVER, - LEPROSY, - INFLUENZA_A, - INFLUENZA_B, - SOIL_TRANSMITTED_HELMINTHS, - TRYPANOSOMIASIS, - GUINEA_WORM, - RABIES, - YAWS_ENDEMIC_SYPHILIS, - WEST_NILE_FEVER, - C_PNEUMONIAE, - MEASLES, - H_METAPNEUMOVIRUS, - TYPHOID_FEVER, - HIV, - ADENOVIRUS, - TRACHOMA, - DIARRHEA_DEHYDRATION, - RESPIRATORY_SYNCYTIAL_VIRUS, - PARAINFLUENZA_1_4, - PLAGUE, - MALARIA, - AFP, - CSM, - SCHISTOSOMIASIS, - CHOLERA, - OTHER - - // TODO check usage and refactor/delete... -} diff --git a/sormas-e2e-tests/src/main/java/org/sormas/e2etests/enums/APITestData/FacilityType.java b/sormas-e2e-tests/src/main/java/org/sormas/e2etests/enums/APITestData/FacilityType.java deleted file mode 100644 index 35a64cb6162..00000000000 --- a/sormas-e2e-tests/src/main/java/org/sormas/e2etests/enums/APITestData/FacilityType.java +++ /dev/null @@ -1,82 +0,0 @@ -/* - * SORMAS® - Surveillance Outbreak Response Management & Analysis System - * Copyright © 2016-2022 Helmholtz-Zentrum für Infektionsforschung GmbH (HZI) - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -package org.sormas.e2etests.enums.APITestData; - -public enum FacilityType { - OTHER_CARE_FACILITY, - RETAIL, - CHILDRENS_HOME, - OTHER_LEISURE_FACILITY, - DIAGNOSTIC_PREVENTATIVE_THERAPEUTIC_FACILITY, - PUBLIC_PLACE, - HOTEL, - REFUGEE_ACCOMMODATION, - CORRECTIONAL_FACILITY, - VISITING_AMBULATORY_AID, - CANTINE, - DAY_HOSPITAL, - OTHER_EDUCATIONAL_FACILITY, - CHILDRENS_DAY_CARE, - OTHER_MEDICAL_FACILITY, - OTHER_ACCOMMODATION, - PLACE_OF_WORSHIP, - MASS_ACCOMMODATION, - HOLIDAY_CAMP, - OTHER_WORKING_PLACE, - MOBILE_NURSING_SERVICE, - MATERNITY_FACILITY, - AMBULATORY_SURGERY_FACILITY, - OTHER_MEDICAL_PRACTICE, - HOSPITAL, - MILITARY_BARRACKS, - ELDERLY_DAY_CARE, - RESTAURANT, - SWIMMING_POOL, - BUSINESS, - KINDERGARTEN, - CAMPSITE, - MEDICAL_PRACTICE, - EVENT_VENUE, - DIALYSIS_FACILITY, - HOSTEL, - OTHER_RESIDENCE, - WHOLESALE, - FOOD_STALL, - ASSOCIATION, - RETIREMENT_HOME, - CRUISE_SHIP, - DENTAL_PRACTICE, - REHAB_FACILITY, - THEATER, - OUTPATIENT_TREATMENT_FACILITY, - BAR, - SCHOOL, - CARE_RECIPIENT_HABITATION, - EMERGENCY_MEDICAL_SERVICES, - OTHER_CATERING_OUTLET, - UNIVERSITY, - NIGHT_CLUB, - DISABLED_PERSON_HABITATION, - LABORATORY, - ZOO, - ELDERLY_CARE_FACILITY, - OTHER_COMMERCE, - AFTER_SCHOOL, - HOMELESS_SHELTER -} diff --git a/sormas-e2e-tests/src/main/java/org/sormas/e2etests/enums/APITestData/POSTCase_ErrorMessages.java b/sormas-e2e-tests/src/main/java/org/sormas/e2etests/enums/APITestData/POSTCase_ErrorMessages.java deleted file mode 100644 index 54b2eb18269..00000000000 --- a/sormas-e2e-tests/src/main/java/org/sormas/e2etests/enums/APITestData/POSTCase_ErrorMessages.java +++ /dev/null @@ -1,27 +0,0 @@ -/* - * SORMAS® - Surveillance Outbreak Response Management & Analysis System - * Copyright © 2016-2022 Helmholtz-Zentrum für Infektionsforschung GmbH (HZI) - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -package org.sormas.e2etests.enums.APITestData; - -public enum POSTCase_ErrorMessages { - TOO_OLD, - ERROR, - ; - public static final String UNKNOWN_DISEASE = - "Cannot deserialize value of type `de.symeda.sormas.api.Disease` from String \"coronavirus\": not one of the values accepted for Enum class: [MONKEYPOX, ONCHOCERCIASIS, ANTHRAX, RHINOVIRUS, DENGUE, POLIO, NON_NEONATAL_TETANUS, PNEUMONIA, TUBERCULOSIS, NEW_INFLUENZA, PERINATAL_DEATHS, CONGENITAL_RUBELLA, M_PNEUMONIAE, DIARRHEA_BLOOD, LYMPHATIC_FILARIASIS, ENTEROVIRUS, UNSPECIFIED_VHF, UNDEFINED, MATERNAL_DEATHS, EVD, SNAKE_BITE, RUBELLA, DIPHTERIA, CORONAVIRUS, NEONATAL_TETANUS, PERTUSSIS, ACUTE_VIRAL_HEPATITIS, LASSA, BURULI_ULCER, YELLOW_FEVER, LEPROSY, INFLUENZA_A, INFLUENZA_B, SOIL_TRANSMITTED_HELMINTHS, TRYPANOSOMIASIS, GUINEA_WORM, RABIES, YAWS_ENDEMIC_SYPHILIS, WEST_NILE_FEVER, C_PNEUMONIAE, MEASLES, H_METAPNEUMOVIRUS, TYPHOID_FEVER, HIV, ADENOVIRUS, TRACHOMA, DIARRHEA_DEHYDRATION, RESPIRATORY_SYNCYTIAL_VIRUS, PARAINFLUENZA_1_4, PLAGUE, MALARIA, AFP, CSM, SCHISTOSOMIASIS, CHOLERA, OTHER]"; -} diff --git a/sormas-e2e-tests/src/main/java/org/sormas/e2etests/enums/FacilityUUIDs.java b/sormas-e2e-tests/src/main/java/org/sormas/e2etests/enums/FacilityUUIDs.java index fd65bfc13f7..8850a36516e 100644 --- a/sormas-e2e-tests/src/main/java/org/sormas/e2etests/enums/FacilityUUIDs.java +++ b/sormas-e2e-tests/src/main/java/org/sormas/e2etests/enums/FacilityUUIDs.java @@ -19,6 +19,7 @@ import lombok.Getter; +// TODO refactor class usage @Getter public enum FacilityUUIDs { OtherFacility("SORMAS-CONSTID-OTHERS-FACILITY"), diff --git a/sormas-e2e-tests/src/main/java/org/sormas/e2etests/enums/HealthFacilityValues.java b/sormas-e2e-tests/src/main/java/org/sormas/e2etests/enums/HealthFacilityValues.java new file mode 100644 index 00000000000..c0faea707ee --- /dev/null +++ b/sormas-e2e-tests/src/main/java/org/sormas/e2etests/enums/HealthFacilityValues.java @@ -0,0 +1,31 @@ +/* + * SORMAS® - Surveillance Outbreak Response Management & Analysis System + * Copyright © 2016-2022 Helmholtz-Zentrum für Infektionsforschung GmbH (HZI) + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +package org.sormas.e2etests.enums; + +import lombok.Getter; + +@Getter +public enum HealthFacilityValues { + StandardEinrichtung("Standard Einrichtung"); + + private final String name; + + HealthFacilityValues(String name) { + this.name = name; + } +} diff --git a/sormas-e2e-tests/src/main/java/org/sormas/e2etests/enums/SubcontinentUUIDs.java b/sormas-e2e-tests/src/main/java/org/sormas/e2etests/enums/SubcontinentUUIDs.java index 3bbd07f476f..363b75f62dc 100644 --- a/sormas-e2e-tests/src/main/java/org/sormas/e2etests/enums/SubcontinentUUIDs.java +++ b/sormas-e2e-tests/src/main/java/org/sormas/e2etests/enums/SubcontinentUUIDs.java @@ -22,12 +22,14 @@ @Getter public enum SubcontinentUUIDs { - WesternEurope("VMRXWX-EAGV7L-JFKP26-F3DBSBFU", "ST63QN-LZAE3C-L5QMQJ-LCTEKGIA"); + WesternEurope("Western Europe", "VMRXWX-EAGV7L-JFKP26-F3DBSBFU", "ST63QN-LZAE3C-L5QMQJ-LCTEKGIA"); + private final String name; private final String uuidMain; private final String uuidDe; - SubcontinentUUIDs(String uuidMain, String uuidDe) { + SubcontinentUUIDs(String name, String uuidMain, String uuidDe) { + this.name = name; this.uuidMain = uuidMain; this.uuidDe = uuidDe; } diff --git a/sormas-e2e-tests/src/test/java/org/sormas/e2etests/entities/services/api/CaseApiService.java b/sormas-e2e-tests/src/test/java/org/sormas/e2etests/entities/services/api/CaseApiService.java index 72415711f47..c64a8e73bfa 100644 --- a/sormas-e2e-tests/src/test/java/org/sormas/e2etests/entities/services/api/CaseApiService.java +++ b/sormas-e2e-tests/src/test/java/org/sormas/e2etests/entities/services/api/CaseApiService.java @@ -25,24 +25,25 @@ import java.util.LinkedHashMap; import java.util.UUID; import org.sormas.e2etests.entities.pojo.api.*; -import org.sormas.e2etests.enums.CaseClassification; -import org.sormas.e2etests.enums.CommunityValues; -import org.sormas.e2etests.enums.DiseasesValues; -import org.sormas.e2etests.enums.DistrictsValues; -import org.sormas.e2etests.enums.RegionsValues; -import org.sormas.e2etests.enums.UserRoles; +import org.sormas.e2etests.enums.*; import org.sormas.e2etests.envconfig.manager.RunningConfiguration; +import org.sormas.e2etests.helpers.RestAssuredClient; +import org.sormas.e2etests.helpers.environmentdata.manager.EnvironmentManager; public class CaseApiService { private static RunningConfiguration runningConfiguration; + private RestAssuredClient restAssuredClient; @Inject - public CaseApiService(RunningConfiguration runningConfiguration) { + public CaseApiService( + RunningConfiguration runningConfiguration, RestAssuredClient restAssuredClient) { + this.restAssuredClient = restAssuredClient; this.runningConfiguration = runningConfiguration; } public Case buildGeneratedCase(Person person) { + EnvironmentManager environmentManager = new EnvironmentManager(restAssuredClient); return Case.builder() .disease(DiseasesValues.CORONAVIRUS.getDiseaseName()) .diseaseDetails("Test Disease") @@ -59,32 +60,32 @@ public Case buildGeneratedCase(Person person) { .district( District.builder() .uuid( - DistrictsValues.getUuidValueForLocale( - DistrictsValues.VoreingestellterLandkreis.name(), locale)) + environmentManager.getDistrictUUID( + DistrictsValues.VoreingestellterLandkreis.getName())) .build()) .region( Region.builder() .uuid( - RegionsValues.getUuidValueForLocale( - RegionsValues.VoreingestellteBundeslander.getName(), locale)) + environmentManager.getRegionUUID( + RegionsValues.VoreingestellteBundeslander.getName())) .build()) .responsibleDistrict( District.builder() .uuid( - DistrictsValues.getUuidValueForLocale( - DistrictsValues.VoreingestellterLandkreis.name(), locale)) + environmentManager.getDistrictUUID( + DistrictsValues.VoreingestellterLandkreis.getName())) .build()) .responsibleRegion( Region.builder() .uuid( - RegionsValues.getUuidValueForLocale( - RegionsValues.VoreingestellteBundeslander.getName(), locale)) + environmentManager.getRegionUUID( + RegionsValues.VoreingestellteBundeslander.getName())) .build()) .community( Community.builder() .uuid( - CommunityValues.getUuidValueForLocale( - CommunityValues.VoreingestellteGemeinde.name(), locale)) + environmentManager.getCommunityUUID( + CommunityValues.VoreingestellteGemeinde.getName())) .build()) .followUpStatus("FOLLOW_UP") .person( @@ -105,7 +106,13 @@ public Case buildGeneratedCase(Person person) { .symptomatic(false) .build()) .therapy(Therapy.builder().uuid(UUID.randomUUID().toString()).build()) - .healthFacility(HealthFacility.builder().uuid("WYPOCQ-IWVWGQ-XU7YCF-OSQJSAD4").build()) + .healthFacility( + HealthFacility.builder() + .uuid( + environmentManager.getHealthFacilityUUID( + RegionsValues.VoreingestellteBundeslander.getName(), + HealthFacilityValues.StandardEinrichtung.getName())) + .build()) .maternalHistory( MaternalHistory.builder() .uuid(UUID.randomUUID().toString()) diff --git a/sormas-e2e-tests/src/test/java/org/sormas/e2etests/entities/services/api/ContactApiService.java b/sormas-e2e-tests/src/test/java/org/sormas/e2etests/entities/services/api/ContactApiService.java index ed060a5e915..49108543bed 100644 --- a/sormas-e2e-tests/src/test/java/org/sormas/e2etests/entities/services/api/ContactApiService.java +++ b/sormas-e2e-tests/src/test/java/org/sormas/e2etests/entities/services/api/ContactApiService.java @@ -36,20 +36,28 @@ import org.sormas.e2etests.enums.RegionsValues; import org.sormas.e2etests.enums.UserRoles; import org.sormas.e2etests.envconfig.manager.RunningConfiguration; +import org.sormas.e2etests.helpers.RestAssuredClient; +import org.sormas.e2etests.helpers.environmentdata.manager.EnvironmentManager; public class ContactApiService { private static PersonApiService personApiService; private static RunningConfiguration runningConfiguration; + private RestAssuredClient restAssuredClient; + private EnvironmentManager environmentManager; @Inject public ContactApiService( - PersonApiService personApiService, RunningConfiguration runningConfiguration) { + PersonApiService personApiService, + RunningConfiguration runningConfiguration, + RestAssuredClient restAssuredClient) { + this.restAssuredClient = restAssuredClient; this.personApiService = personApiService; this.runningConfiguration = runningConfiguration; } public Contact buildGeneratedContact(Person person) { + environmentManager = new EnvironmentManager(restAssuredClient); return Contact.builder() .disease(DiseasesValues.CORONAVIRUS.getDiseaseName()) .uuid(UUID.randomUUID().toString()) @@ -65,15 +73,15 @@ public Contact buildGeneratedContact(Person person) { District.builder() .caption(DistrictsValues.VoreingestellterLandkreis.getName()) .uuid( - DistrictsValues.getUuidValueForLocale( - DistrictsValues.VoreingestellterLandkreis.name(), locale)) + environmentManager.getDistrictUUID( + DistrictsValues.VoreingestellterLandkreis.getName())) .build()) .region( Region.builder() .caption(RegionsValues.VoreingestellteBundeslander.getName()) .uuid( - RegionsValues.getUuidValueForLocale( - RegionsValues.VoreingestellteBundeslander.getName(), locale)) + environmentManager.getRegionUUID( + RegionsValues.VoreingestellteBundeslander.getName())) .build()) .relationToCase("") .contactClassification("UNCONFIRMED") @@ -91,6 +99,7 @@ public Contact buildGeneratedContact(Person person) { } public Contact buildGeneratedContactWithLinkedCase(Person person, Case caze) { + environmentManager = new EnvironmentManager(restAssuredClient); return Contact.builder() .uuid(UUID.randomUUID().toString()) .disease(DiseasesValues.CORONAVIRUS.getDiseaseName()) @@ -106,15 +115,15 @@ public Contact buildGeneratedContactWithLinkedCase(Person person, Case caze) { District.builder() .caption(DistrictsValues.VoreingestellterLandkreis.getName()) .uuid( - DistrictsValues.getUuidValueForLocale( - DistrictsValues.VoreingestellterLandkreis.name(), locale)) + environmentManager.getDistrictUUID( + DistrictsValues.VoreingestellterLandkreis.getName())) .build()) .region( Region.builder() .caption(RegionsValues.VoreingestellteBundeslander.getName()) .uuid( - RegionsValues.getUuidValueForLocale( - RegionsValues.VoreingestellteBundeslander.getName(), locale)) + environmentManager.getRegionUUID( + RegionsValues.VoreingestellteBundeslander.getName())) .build()) .relationToCase("") .contactClassification("UNCONFIRMED") diff --git a/sormas-e2e-tests/src/test/java/org/sormas/e2etests/entities/services/api/EventApiService.java b/sormas-e2e-tests/src/test/java/org/sormas/e2etests/entities/services/api/EventApiService.java index c104516217c..fb788a3cde9 100644 --- a/sormas-e2e-tests/src/test/java/org/sormas/e2etests/entities/services/api/EventApiService.java +++ b/sormas-e2e-tests/src/test/java/org/sormas/e2etests/entities/services/api/EventApiService.java @@ -38,22 +38,28 @@ import org.sormas.e2etests.enums.SourceTypeValues; import org.sormas.e2etests.enums.UserRoles; import org.sormas.e2etests.envconfig.manager.RunningConfiguration; +import org.sormas.e2etests.helpers.RestAssuredClient; +import org.sormas.e2etests.helpers.environmentdata.manager.EnvironmentManager; public class EventApiService { RunningConfiguration runningConfiguration; private final Faker faker; + private RestAssuredClient restAssuredClient; @Inject - public EventApiService(RunningConfiguration runningConfiguration, Faker faker) { + public EventApiService( + RunningConfiguration runningConfiguration, Faker faker, RestAssuredClient restAssuredClient) { + this.restAssuredClient = restAssuredClient; this.runningConfiguration = runningConfiguration; this.faker = faker; } - public EventApiService(Faker faker) { - this.faker = faker; - } + // public EventApiService(Faker faker) { + // this.faker = faker; + // } public Event buildGeneratedEvent() { + EnvironmentManager environmentManager = new EnvironmentManager(restAssuredClient); return Event.builder() .uuid(UUID.randomUUID().toString()) .disease(DiseasesValues.CORONAVIRUS.getDiseaseName()) @@ -80,20 +86,20 @@ public Event buildGeneratedEvent() { .community( Community.builder() .uuid( - CommunityValues.getUuidValueForLocale( - CommunityValues.VoreingestellteGemeinde.name(), locale)) + environmentManager.getCommunityUUID( + CommunityValues.VoreingestellteGemeinde.getName())) .build()) .region( Region.builder() .uuid( - RegionsValues.getUuidValueForLocale( - RegionsValues.VoreingestellteBundeslander.getName(), locale)) + environmentManager.getRegionUUID( + RegionsValues.VoreingestellteBundeslander.getName())) .build()) .district( District.builder() .uuid( - DistrictsValues.getUuidValueForLocale( - DistrictsValues.VoreingestellterLandkreis.name(), locale)) + environmentManager.getDistrictUUID( + DistrictsValues.VoreingestellterLandkreis.getName())) .build()) .build()) .build(); diff --git a/sormas-e2e-tests/src/test/java/org/sormas/e2etests/entities/services/api/ImmunizationApiService.java b/sormas-e2e-tests/src/test/java/org/sormas/e2etests/entities/services/api/ImmunizationApiService.java index 60fdd9451cc..7e16ad55da6 100644 --- a/sormas-e2e-tests/src/test/java/org/sormas/e2etests/entities/services/api/ImmunizationApiService.java +++ b/sormas-e2e-tests/src/test/java/org/sormas/e2etests/entities/services/api/ImmunizationApiService.java @@ -35,23 +35,30 @@ import org.sormas.e2etests.enums.immunizations.MeansOfImmunizationValues; import org.sormas.e2etests.enums.immunizations.StatusValues; import org.sormas.e2etests.envconfig.manager.RunningConfiguration; +import org.sormas.e2etests.helpers.RestAssuredClient; +import org.sormas.e2etests.helpers.environmentdata.manager.EnvironmentManager; import org.sormas.e2etests.steps.BaseSteps; public class ImmunizationApiService { private final Faker faker; private static RunningConfiguration runningConfiguration; + private RestAssuredClient restAssuredClient; @Inject public ImmunizationApiService( - Faker faker, BaseSteps baseSteps, RunningConfiguration runningConfiguration) { + Faker faker, + BaseSteps baseSteps, + RunningConfiguration runningConfiguration, + RestAssuredClient restAssuredClient) { + this.restAssuredClient = restAssuredClient; this.faker = faker; this.runningConfiguration = runningConfiguration; } public Immunization buildGeneratedImmunizationForPerson(Person person) { - String immunizationUUID = UUID.randomUUID().toString(); + EnvironmentManager environmentManager = new EnvironmentManager(restAssuredClient); return Immunization.builder() - .uuid(immunizationUUID) + .uuid(UUID.randomUUID().toString()) .pseudonymized(false) .person(person) .reportDate(Calendar.getInstance().getTimeInMillis()) @@ -69,14 +76,11 @@ public Immunization buildGeneratedImmunizationForPerson(Person person) { .immunizationManagementStatus( ImmunizationManagementStatusValues.getRandomImmunizationManagementStatus()) .responsibleRegion( - RegionsValues.getUuidValueForLocale( - RegionsValues.VoreingestellteBundeslander.getName(), locale)) + environmentManager.getRegionUUID(RegionsValues.VoreingestellteBundeslander.getName())) .responsibleDistrict( - DistrictsValues.getUuidValueForLocale( - DistrictsValues.VoreingestellterLandkreis.name(), locale)) + environmentManager.getDistrictUUID(DistrictsValues.VoreingestellterLandkreis.getName())) .responsibleCommunity( - CommunityValues.getUuidValueForLocale( - CommunityValues.VoreingestellteGemeinde.name(), locale)) + environmentManager.getCommunityUUID(CommunityValues.VoreingestellteGemeinde.getName())) .build(); } } diff --git a/sormas-e2e-tests/src/test/java/org/sormas/e2etests/entities/services/api/PersonApiService.java b/sormas-e2e-tests/src/test/java/org/sormas/e2etests/entities/services/api/PersonApiService.java index 14b190f9391..2e7aa968db9 100644 --- a/sormas-e2e-tests/src/test/java/org/sormas/e2etests/entities/services/api/PersonApiService.java +++ b/sormas-e2e-tests/src/test/java/org/sormas/e2etests/entities/services/api/PersonApiService.java @@ -18,8 +18,6 @@ package org.sormas.e2etests.entities.services.api; -import static org.sormas.e2etests.steps.BaseSteps.locale; - import com.github.javafaker.Faker; import com.google.inject.Inject; import java.util.Collections; @@ -30,21 +28,15 @@ import org.sormas.e2etests.entities.pojo.api.chunks.Address; import org.sormas.e2etests.entities.pojo.api.chunks.Country; import org.sormas.e2etests.entities.pojo.api.chunks.PersonContactDetails; -import org.sormas.e2etests.enums.AreaTypeValues; -import org.sormas.e2etests.enums.CommunityValues; -import org.sormas.e2etests.enums.ContinentUUIDs; -import org.sormas.e2etests.enums.CountryUUIDs; -import org.sormas.e2etests.enums.DistrictsValues; -import org.sormas.e2etests.enums.FacilityUUIDs; -import org.sormas.e2etests.enums.GenderValues; -import org.sormas.e2etests.enums.PresentCondition; -import org.sormas.e2etests.enums.RegionsValues; -import org.sormas.e2etests.enums.SubcontinentUUIDs; +import org.sormas.e2etests.enums.*; +import org.sormas.e2etests.helpers.RestAssuredClient; +import org.sormas.e2etests.helpers.environmentdata.manager.EnvironmentManager; import org.sormas.e2etests.helpers.strings.ASCIIHelper; public class PersonApiService { private final Faker faker; private final Random random = new Random(); + private RestAssuredClient restAssuredClient; private String firstName; private String lastName; @@ -55,11 +47,13 @@ public class PersonApiService { private final String contactEmailDomain = "@PERSON-API-CONTACT.com"; @Inject - public PersonApiService(Faker faker) { + public PersonApiService(Faker faker, RestAssuredClient restAssuredClient) { + this.restAssuredClient = restAssuredClient; this.faker = faker; } public Person buildGeneratedPerson() { + EnvironmentManager environmentManager = new EnvironmentManager(restAssuredClient); String personUUID = UUID.randomUUID().toString(); firstName = faker.name().firstName(); lastName = faker.name().lastName(); @@ -70,26 +64,19 @@ public Person buildGeneratedPerson() { Address.builder() .latitude(48 + (random.nextInt(6)) + ThreadLocalRandom.current().nextDouble(0, 1)) .longitude(8 + (random.nextInt(5)) + ThreadLocalRandom.current().nextDouble(0, 1)) - .country( - Country.builder() - .uuid(CountryUUIDs.getUuidValueForLocale(CountryUUIDs.Germany.name(), locale)) - .caption("Deutschland") - .externalId(null) - .isoCode("DEU") - .build()) + .country(Country.builder().uuid(environmentManager.getCountryUUID("Germany")).build()) .region( - RegionsValues.getUuidValueForLocale( - RegionsValues.VoreingestellteBundeslander.getName(), locale)) - .continent(ContinentUUIDs.getUuidValueForLocale(ContinentUUIDs.Europe.name(), locale)) + environmentManager.getRegionUUID( + RegionsValues.VoreingestellteBundeslander.getName())) + .continent(environmentManager.getContinentUUID(ContinentUUIDs.Europe.name())) .subcontinent( - SubcontinentUUIDs.getUuidValueForLocale( - SubcontinentUUIDs.WesternEurope.name(), locale)) + environmentManager.geSubcontinentUUID(SubcontinentUUIDs.WesternEurope.getName())) .district( - DistrictsValues.getUuidValueForLocale( - DistrictsValues.VoreingestellterLandkreis.name(), locale)) + environmentManager.getDistrictUUID( + DistrictsValues.VoreingestellterLandkreis.getName())) .community( - CommunityValues.getUuidValueForLocale( - CommunityValues.VoreingestellteGemeinde.name(), locale)) + environmentManager.getCommunityUUID( + CommunityValues.VoreingestellteGemeinde.getName())) .city(faker.address().cityName()) .areaType(AreaTypeValues.getRandomAreaType()) .postalCode(faker.address().zipCode()) diff --git a/sormas-e2e-tests/src/test/java/org/sormas/e2etests/entities/services/api/SampleApiService.java b/sormas-e2e-tests/src/test/java/org/sormas/e2etests/entities/services/api/SampleApiService.java index 43f7a716a3b..bf14260cfdc 100644 --- a/sormas-e2e-tests/src/test/java/org/sormas/e2etests/entities/services/api/SampleApiService.java +++ b/sormas-e2e-tests/src/test/java/org/sormas/e2etests/entities/services/api/SampleApiService.java @@ -28,18 +28,26 @@ import org.sormas.e2etests.entities.pojo.api.Lab; import org.sormas.e2etests.entities.pojo.api.ReportingUser; import org.sormas.e2etests.entities.pojo.api.Sample; +import org.sormas.e2etests.enums.RegionsValues; import org.sormas.e2etests.enums.UserRoles; import org.sormas.e2etests.envconfig.manager.RunningConfiguration; +import org.sormas.e2etests.helpers.RestAssuredClient; +import org.sormas.e2etests.helpers.environmentdata.manager.EnvironmentManager; public class SampleApiService { RunningConfiguration runningConfiguration; + private RestAssuredClient restAssuredClient; + @Inject - public SampleApiService(RunningConfiguration runningConfiguration) { + public SampleApiService( + RunningConfiguration runningConfiguration, RestAssuredClient restAssuredClient) { + this.restAssuredClient = restAssuredClient; this.runningConfiguration = runningConfiguration; } public Sample buildGeneratedSample(Case caze) { + EnvironmentManager environmentManager = new EnvironmentManager(restAssuredClient); return Sample.builder() .uuid(UUID.randomUUID().toString()) .reportingUser( @@ -58,10 +66,12 @@ public Sample buildGeneratedSample(Case caze) { .pathogenTestResult("PENDING") .lab( Lab.builder() - .uuid("VQL6NJ-HPJY24-56F2R5-T5UV2HUI") - .caption("Voreingestelltes Labor") + .uuid( + environmentManager.getLaboratoryUUID( + RegionsValues.VoreingestellteBundeslander.getName(), + "Voreingestelltes Labor")) .build()) - .labDetails("Dexter laboratory") + .labDetails("Dexter's laboratory") .build(); } } diff --git a/sormas-e2e-tests/src/test/java/org/sormas/e2etests/entities/services/api/TaskApiService.java b/sormas-e2e-tests/src/test/java/org/sormas/e2etests/entities/services/api/TaskApiService.java index 5b090f3f240..95b4bcd57a9 100644 --- a/sormas-e2e-tests/src/test/java/org/sormas/e2etests/entities/services/api/TaskApiService.java +++ b/sormas-e2e-tests/src/test/java/org/sormas/e2etests/entities/services/api/TaskApiService.java @@ -24,17 +24,22 @@ import java.util.UUID; import org.sormas.e2etests.entities.pojo.api.AssigneeUser; import org.sormas.e2etests.entities.pojo.api.Task; +import org.sormas.e2etests.helpers.RestAssuredClient; +import org.sormas.e2etests.helpers.environmentdata.manager.EnvironmentManager; public class TaskApiService { private final Faker faker; + private RestAssuredClient restAssuredClient; @Inject - public TaskApiService(Faker faker) { + public TaskApiService(Faker faker, RestAssuredClient restAssuredClient) { + this.restAssuredClient = restAssuredClient; this.faker = faker; } public Task buildGeneratedTask() { + EnvironmentManager environmentManager = new EnvironmentManager(restAssuredClient); return Task.builder() .uuid(UUID.randomUUID().toString()) .taskContext("CONTACT") @@ -45,10 +50,7 @@ public Task buildGeneratedTask() { .taskStatus("PENDING") .assigneeUser( AssigneeUser.builder() - .caption("Contact OFFICER - Kontaktbeauftragte*r") - .firstName("Contact") - .lastName("Officer") - .uuid("TWJCUP-I3VN2G-QL5UG3-WXX6SOPA") + .uuid(environmentManager.getUserUUIDByFullName("Contact Officer")) .build()) .assigneeReply(faker.music().instrument()) .creatorComment(faker.book().title()) diff --git a/sormas-e2e-tests/src/test/java/org/sormas/e2etests/helpers/WebDriverHelpers.java b/sormas-e2e-tests/src/test/java/org/sormas/e2etests/helpers/WebDriverHelpers.java index 6b88cd2e3b3..7f20e82b8e7 100755 --- a/sormas-e2e-tests/src/test/java/org/sormas/e2etests/helpers/WebDriverHelpers.java +++ b/sormas-e2e-tests/src/test/java/org/sormas/e2etests/helpers/WebDriverHelpers.java @@ -15,6 +15,20 @@ package org.sormas.e2etests.helpers; +import static com.google.common.truth.Truth.assertWithMessage; +import static java.time.Duration.ofSeconds; +import static org.awaitility.Awaitility.await; +import static org.awaitility.Durations.ONE_HUNDRED_MILLISECONDS; + +import java.time.Instant; +import java.time.temporal.ChronoUnit; +import java.util.ArrayList; +import java.util.List; +import java.util.Set; +import java.util.concurrent.TimeUnit; +import java.util.function.Predicate; +import java.util.stream.Collectors; +import javax.inject.Inject; import lombok.SneakyThrows; import lombok.extern.slf4j.Slf4j; import org.awaitility.core.ConditionTimeoutException; @@ -32,21 +46,6 @@ import org.sormas.e2etests.steps.BaseSteps; import org.testng.Assert; -import javax.inject.Inject; -import java.time.Instant; -import java.time.temporal.ChronoUnit; -import java.util.ArrayList; -import java.util.List; -import java.util.Set; -import java.util.concurrent.TimeUnit; -import java.util.function.Predicate; -import java.util.stream.Collectors; - -import static com.google.common.truth.Truth.assertWithMessage; -import static java.time.Duration.ofSeconds; -import static org.awaitility.Awaitility.await; -import static org.awaitility.Durations.ONE_HUNDRED_MILLISECONDS; - @Slf4j public class WebDriverHelpers { diff --git a/sormas-e2e-tests/src/test/java/org/sormas/e2etests/helpers/environmentdata/dto/Community.java b/sormas-e2e-tests/src/test/java/org/sormas/e2etests/helpers/environmentdata/dto/Community.java new file mode 100644 index 00000000000..e669601d307 --- /dev/null +++ b/sormas-e2e-tests/src/test/java/org/sormas/e2etests/helpers/environmentdata/dto/Community.java @@ -0,0 +1,30 @@ +/* + * SORMAS® - Surveillance Outbreak Response Management & Analysis System + * Copyright © 2016-2022 Helmholtz-Zentrum für Infektionsforschung GmbH (HZI) + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +package org.sormas.e2etests.helpers.environmentdata.dto; + +import lombok.*; + +@Value +@AllArgsConstructor +@NoArgsConstructor(force = true, access = AccessLevel.PRIVATE) +@Builder(toBuilder = true, builderClassName = "builder") +public class Community { + + String uuid; + String name; +} diff --git a/sormas-e2e-tests/src/test/java/org/sormas/e2etests/helpers/environmentdata/dto/Continent.java b/sormas-e2e-tests/src/test/java/org/sormas/e2etests/helpers/environmentdata/dto/Continent.java new file mode 100644 index 00000000000..158df561b4a --- /dev/null +++ b/sormas-e2e-tests/src/test/java/org/sormas/e2etests/helpers/environmentdata/dto/Continent.java @@ -0,0 +1,30 @@ +/* + * SORMAS® - Surveillance Outbreak Response Management & Analysis System + * Copyright © 2016-2022 Helmholtz-Zentrum für Infektionsforschung GmbH (HZI) + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +package org.sormas.e2etests.helpers.environmentdata.dto; + +import lombok.*; + +@Value +@AllArgsConstructor +@NoArgsConstructor(force = true, access = AccessLevel.PRIVATE) +@Builder(toBuilder = true, builderClassName = "builder") +public class Continent { + + String uuid; + String defaultName; +} diff --git a/sormas-e2e-tests/src/test/java/org/sormas/e2etests/helpers/environmentdata/dto/Country.java b/sormas-e2e-tests/src/test/java/org/sormas/e2etests/helpers/environmentdata/dto/Country.java new file mode 100644 index 00000000000..692b6aa68a2 --- /dev/null +++ b/sormas-e2e-tests/src/test/java/org/sormas/e2etests/helpers/environmentdata/dto/Country.java @@ -0,0 +1,32 @@ +/* + * SORMAS® - Surveillance Outbreak Response Management & Analysis System + * Copyright © 2016-2022 Helmholtz-Zentrum für Infektionsforschung GmbH (HZI) + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +package org.sormas.e2etests.helpers.environmentdata.dto; + +import lombok.*; + +@Value +@AllArgsConstructor +@NoArgsConstructor(force = true, access = AccessLevel.PRIVATE) +@Builder(toBuilder = true, builderClassName = "builder") +public class Country { + + String uuid; + String defaultName; + String isoCode; + Subcontinent subcontinent; +} diff --git a/sormas-e2e-tests/src/test/java/org/sormas/e2etests/helpers/environmentdata/dto/District.java b/sormas-e2e-tests/src/test/java/org/sormas/e2etests/helpers/environmentdata/dto/District.java new file mode 100644 index 00000000000..3a694f2823b --- /dev/null +++ b/sormas-e2e-tests/src/test/java/org/sormas/e2etests/helpers/environmentdata/dto/District.java @@ -0,0 +1,30 @@ +/* + * SORMAS® - Surveillance Outbreak Response Management & Analysis System + * Copyright © 2016-2022 Helmholtz-Zentrum für Infektionsforschung GmbH (HZI) + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +package org.sormas.e2etests.helpers.environmentdata.dto; + +import lombok.*; + +@Value +@AllArgsConstructor +@NoArgsConstructor(force = true, access = AccessLevel.PRIVATE) +@Builder(toBuilder = true, builderClassName = "builder") +public class District { + + String uuid; + String name; +} diff --git a/sormas-e2e-tests/src/test/java/org/sormas/e2etests/helpers/environmentdata/dto/HealthFacility.java b/sormas-e2e-tests/src/test/java/org/sormas/e2etests/helpers/environmentdata/dto/HealthFacility.java new file mode 100644 index 00000000000..9629cfb1607 --- /dev/null +++ b/sormas-e2e-tests/src/test/java/org/sormas/e2etests/helpers/environmentdata/dto/HealthFacility.java @@ -0,0 +1,30 @@ +/* + * SORMAS® - Surveillance Outbreak Response Management & Analysis System + * Copyright © 2016-2022 Helmholtz-Zentrum für Infektionsforschung GmbH (HZI) + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +package org.sormas.e2etests.helpers.environmentdata.dto; + +import lombok.*; + +@Value +@AllArgsConstructor +@NoArgsConstructor(force = true, access = AccessLevel.PRIVATE) +@Builder(toBuilder = true, builderClassName = "builder") +public class HealthFacility { + + String uuid; + String name; +} diff --git a/sormas-e2e-tests/src/test/java/org/sormas/e2etests/helpers/environmentdata/dto/Region.java b/sormas-e2e-tests/src/test/java/org/sormas/e2etests/helpers/environmentdata/dto/Region.java new file mode 100644 index 00000000000..50e30e00d9b --- /dev/null +++ b/sormas-e2e-tests/src/test/java/org/sormas/e2etests/helpers/environmentdata/dto/Region.java @@ -0,0 +1,30 @@ +/* + * SORMAS® - Surveillance Outbreak Response Management & Analysis System + * Copyright © 2016-2022 Helmholtz-Zentrum für Infektionsforschung GmbH (HZI) + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +package org.sormas.e2etests.helpers.environmentdata.dto; + +import lombok.*; + +@Value +@AllArgsConstructor +@NoArgsConstructor(force = true, access = AccessLevel.PRIVATE) +@Builder(toBuilder = true, builderClassName = "builder") +public class Region { + + String uuid; + String name; +} diff --git a/sormas-e2e-tests/src/test/java/org/sormas/e2etests/helpers/environmentdata/dto/Subcontinent.java b/sormas-e2e-tests/src/test/java/org/sormas/e2etests/helpers/environmentdata/dto/Subcontinent.java new file mode 100644 index 00000000000..76240497998 --- /dev/null +++ b/sormas-e2e-tests/src/test/java/org/sormas/e2etests/helpers/environmentdata/dto/Subcontinent.java @@ -0,0 +1,13 @@ +package org.sormas.e2etests.helpers.environmentdata.dto; + +import lombok.*; + +@Value +@AllArgsConstructor +@NoArgsConstructor(force = true, access = AccessLevel.PRIVATE) +@Builder(toBuilder = true, builderClassName = "builder") +public class Subcontinent { + + String uuid; + String defaultName; +} diff --git a/sormas-e2e-tests/src/test/java/org/sormas/e2etests/helpers/environmentdata/dto/User.java b/sormas-e2e-tests/src/test/java/org/sormas/e2etests/helpers/environmentdata/dto/User.java new file mode 100644 index 00000000000..d80c4a0491b --- /dev/null +++ b/sormas-e2e-tests/src/test/java/org/sormas/e2etests/helpers/environmentdata/dto/User.java @@ -0,0 +1,31 @@ +/* + * SORMAS® - Surveillance Outbreak Response Management & Analysis System + * Copyright © 2016-2022 Helmholtz-Zentrum für Infektionsforschung GmbH (HZI) + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +package org.sormas.e2etests.helpers.environmentdata.dto; + +import lombok.*; + +@Value +@AllArgsConstructor +@NoArgsConstructor(force = true, access = AccessLevel.PRIVATE) +@Builder(toBuilder = true, builderClassName = "builder") +public class User { + + String uuid; + String firstName; + String lastName; +} diff --git a/sormas-e2e-tests/src/test/java/org/sormas/e2etests/helpers/environmentdata/manager/EnvironmentManager.java b/sormas-e2e-tests/src/test/java/org/sormas/e2etests/helpers/environmentdata/manager/EnvironmentManager.java new file mode 100644 index 00000000000..775f6fc7184 --- /dev/null +++ b/sormas-e2e-tests/src/test/java/org/sormas/e2etests/helpers/environmentdata/manager/EnvironmentManager.java @@ -0,0 +1,188 @@ +/* + * SORMAS® - Surveillance Outbreak Response Management & Analysis System + * Copyright © 2016-2022 Helmholtz-Zentrum für Infektionsforschung GmbH (HZI) + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +package org.sormas.e2etests.helpers.environmentdata.manager; + +import static org.sormas.e2etests.constants.api.Endpoints.*; + +import com.fasterxml.jackson.databind.DeserializationFeature; +import com.fasterxml.jackson.databind.ObjectMapper; +import io.restassured.http.Method; +import io.restassured.response.Response; +import java.util.List; +import javax.inject.Inject; +import lombok.SneakyThrows; +import lombok.extern.slf4j.Slf4j; +import org.sormas.e2etests.entities.pojo.api.Request; +import org.sormas.e2etests.helpers.RestAssuredClient; +import org.sormas.e2etests.helpers.environmentdata.dto.*; + +@Slf4j +public class EnvironmentManager { + + private RestAssuredClient restAssuredClient; + private ObjectMapper objectMapper; + private Response response; + + @Inject + public EnvironmentManager(RestAssuredClient restAssuredClient) { + this.restAssuredClient = restAssuredClient; + } + + @SneakyThrows + public String getCountryUUID(String countryName) { + response = + restAssuredClient.sendRequestAndGetResponse( + Request.builder().method(Method.GET).path(COUNTRIES_PATH + ALL_FROM_0).build()); + objectMapper = getNewObjMapper(); + List countries = + List.of(objectMapper.readValue(response.getBody().asInputStream(), Country[].class)); + return countries.stream() + .filter(country -> country.getDefaultName().equalsIgnoreCase(countryName)) + .findFirst() + .get() + .getUuid(); + } + + @SneakyThrows + public String getRegionUUID(String regionName) { + response = + restAssuredClient.sendRequestAndGetResponse( + Request.builder().method(Method.GET).path(REGIONS_PATH + ALL_FROM_0).build()); + objectMapper = getNewObjMapper(); + List regions = + List.of(objectMapper.readValue(response.getBody().asInputStream(), Region[].class)); + return regions.stream() + .filter(region -> region.getName().equalsIgnoreCase(regionName)) + .findFirst() + .get() + .getUuid(); + } + + @SneakyThrows + public String getDistrictUUID(String districtName) { + response = + restAssuredClient.sendRequestAndGetResponse( + Request.builder().method(Method.GET).path(DISTRICTS_PATH + ALL_FROM_0).build()); + objectMapper = getNewObjMapper(); + List districts = + List.of(objectMapper.readValue(response.getBody().asInputStream(), District[].class)); + return districts.stream() + .filter(district -> district.getName().equalsIgnoreCase(districtName)) + .findFirst() + .get() + .getUuid(); + } + + @SneakyThrows + public String getContinentUUID(String continentName) { + response = + restAssuredClient.sendRequestAndGetResponse( + Request.builder().method(Method.GET).path(CONTINENTS_PATH + ALL_FROM_0).build()); + objectMapper = getNewObjMapper(); + List continents = + List.of(objectMapper.readValue(response.getBody().asInputStream(), Continent[].class)); + return continents.stream() + .filter(continent -> continent.getDefaultName().equalsIgnoreCase(continentName)) + .findFirst() + .get() + .getUuid(); + } + + @SneakyThrows + public String geSubcontinentUUID(String subcontinentName) { + response = + restAssuredClient.sendRequestAndGetResponse( + Request.builder().method(Method.GET).path(SUBCONTINENTS_PATH + ALL_FROM_0).build()); + objectMapper = getNewObjMapper(); + List subcontinents = + List.of(objectMapper.readValue(response.getBody().asInputStream(), Subcontinent[].class)); + return subcontinents.stream() + .filter(subcontinent -> subcontinent.getDefaultName().equalsIgnoreCase(subcontinentName)) + .findFirst() + .get() + .getUuid(); + } + + @SneakyThrows + public String getCommunityUUID(String communityName) { + response = + restAssuredClient.sendRequestAndGetResponse( + Request.builder().method(Method.GET).path(COMMUNITIES_PATH + ALL_FROM_0).build()); + objectMapper = getNewObjMapper(); + List communities = + List.of(objectMapper.readValue(response.getBody().asInputStream(), Community[].class)); + return communities.stream() + .filter(community -> community.getName().equalsIgnoreCase(communityName)) + .findFirst() + .get() + .getUuid(); + } + + @SneakyThrows + public String getHealthFacilityUUID(String regionName, String healthFacilityName) { + String path = FACILITIES_PATH + "/region/" + getRegionUUID(regionName) + "/0"; + response = + restAssuredClient.sendRequestAndGetResponse( + Request.builder().method(Method.GET).path(path).build()); + objectMapper = getNewObjMapper(); + List healthFacilities = + List.of(objectMapper.readValue(response.getBody().asInputStream(), HealthFacility[].class)); + return healthFacilities.stream() + .filter(healthFacility -> healthFacility.getName().equalsIgnoreCase(healthFacilityName)) + .findFirst() + .get() + .getUuid(); + } + + @SneakyThrows + public String getLaboratoryUUID(String regionName, String laboratoryName) { + String path = FACILITIES_PATH + "/region/" + getRegionUUID(regionName) + "/0"; + response = + restAssuredClient.sendRequestAndGetResponse( + Request.builder().method(Method.GET).path(path).build()); + objectMapper = getNewObjMapper(); + List healthFacilities = + List.of(objectMapper.readValue(response.getBody().asInputStream(), HealthFacility[].class)); + return healthFacilities.stream() + .filter(laboratory -> laboratory.getName().equalsIgnoreCase(laboratoryName)) + .findFirst() + .get() + .getUuid(); + } + + @SneakyThrows + public String getUserUUIDByFullName(String fullName) { + response = + restAssuredClient.sendRequestAndGetResponse( + Request.builder().method(Method.GET).path(USERS_PATH + ALL_FROM_0).build()); + objectMapper = getNewObjMapper(); + List users = + List.of(objectMapper.readValue(response.getBody().asInputStream(), User[].class)); + return users.stream() + .filter(user -> (user.getFirstName() + " " + user.getLastName()).equalsIgnoreCase(fullName)) + .findFirst() + .get() + .getUuid(); + } + + private ObjectMapper getNewObjMapper() { + ObjectMapper objMapper = new ObjectMapper(); + objMapper.disable(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES); + return objMapper; + } +} diff --git a/sormas-e2e-tests/src/test/java/org/sormas/e2etests/steps/api/commonSteps/ResponseChecksSteps.java b/sormas-e2e-tests/src/test/java/org/sormas/e2etests/steps/api/commonSteps/ResponseChecksSteps.java index aa70c97bdfd..83b51fa2d57 100644 --- a/sormas-e2e-tests/src/test/java/org/sormas/e2etests/steps/api/commonSteps/ResponseChecksSteps.java +++ b/sormas-e2e-tests/src/test/java/org/sormas/e2etests/steps/api/commonSteps/ResponseChecksSteps.java @@ -19,13 +19,14 @@ import cucumber.api.java8.En; import javax.inject.Inject; +import org.sormas.e2etests.helpers.RestAssuredClient; import org.sormas.e2etests.state.ApiState; import org.testng.Assert; public class ResponseChecksSteps implements En { @Inject - public ResponseChecksSteps(ApiState apiState) { + public ResponseChecksSteps(ApiState apiState, RestAssuredClient restAssuredClient) { Then( "API: I check that POST call body is {string}", diff --git a/sormas-e2e-tests/src/test/java/org/sormas/e2etests/steps/web/application/AboutDirectorySteps.java b/sormas-e2e-tests/src/test/java/org/sormas/e2etests/steps/web/application/AboutDirectorySteps.java index ad1d67bc37c..cc0a88b2edb 100644 --- a/sormas-e2e-tests/src/test/java/org/sormas/e2etests/steps/web/application/AboutDirectorySteps.java +++ b/sormas-e2e-tests/src/test/java/org/sormas/e2etests/steps/web/application/AboutDirectorySteps.java @@ -1,8 +1,28 @@ package org.sormas.e2etests.steps.web.application; +import static org.sormas.e2etests.pages.application.AboutPage.CASE_CLASSIFICATION_RULES_HYPERLINK; +import static org.sormas.e2etests.pages.application.AboutPage.DATA_DICTIONARY_BUTTON; +import static org.sormas.e2etests.pages.application.AboutPage.FULL_CHANGELOG_HYPERLINK; +import static org.sormas.e2etests.pages.application.AboutPage.OFFICIAL_SORMAS_WEBSITE_HYPERLINK; +import static org.sormas.e2etests.pages.application.AboutPage.SORMAS_GITHUB_HYPERLINK; +import static org.sormas.e2etests.pages.application.AboutPage.SORMAS_VERSION_HYPERLINK; +import static org.sormas.e2etests.pages.application.AboutPage.SORMAS_VERSION_HYPERLINK_TARGET; +import static org.sormas.e2etests.pages.application.AboutPage.SORMAS_VERSION_LINK; +import static org.sormas.e2etests.pages.application.AboutPage.WHATS_NEW_HYPERLINK; +import static org.sormas.e2etests.pages.application.users.CreateNewUserPage.LANGUAGE_COMBOBOX; +import static org.sormas.e2etests.pages.application.users.CreateNewUserPage.SAVE_BUTTON; + import com.detectlanguage.DetectLanguage; import com.google.inject.Inject; import cucumber.api.java8.En; +import java.io.File; +import java.io.FileInputStream; +import java.io.IOException; +import java.time.LocalDate; +import java.util.ArrayList; +import java.util.Iterator; +import java.util.List; +import java.util.concurrent.TimeUnit; import org.apache.poi.ss.usermodel.Cell; import org.apache.poi.ss.usermodel.CellType; import org.apache.poi.ss.usermodel.Row; @@ -15,27 +35,6 @@ import org.sormas.e2etests.helpers.WebDriverHelpers; import org.testng.asserts.SoftAssert; -import java.io.File; -import java.io.FileInputStream; -import java.io.IOException; -import java.time.LocalDate; -import java.util.ArrayList; -import java.util.Iterator; -import java.util.List; -import java.util.concurrent.TimeUnit; - -import static org.sormas.e2etests.pages.application.AboutPage.CASE_CLASSIFICATION_RULES_HYPERLINK; -import static org.sormas.e2etests.pages.application.AboutPage.DATA_DICTIONARY_BUTTON; -import static org.sormas.e2etests.pages.application.AboutPage.FULL_CHANGELOG_HYPERLINK; -import static org.sormas.e2etests.pages.application.AboutPage.OFFICIAL_SORMAS_WEBSITE_HYPERLINK; -import static org.sormas.e2etests.pages.application.AboutPage.SORMAS_GITHUB_HYPERLINK; -import static org.sormas.e2etests.pages.application.AboutPage.SORMAS_VERSION_HYPERLINK; -import static org.sormas.e2etests.pages.application.AboutPage.SORMAS_VERSION_HYPERLINK_TARGET; -import static org.sormas.e2etests.pages.application.AboutPage.SORMAS_VERSION_LINK; -import static org.sormas.e2etests.pages.application.AboutPage.WHATS_NEW_HYPERLINK; -import static org.sormas.e2etests.pages.application.users.CreateNewUserPage.LANGUAGE_COMBOBOX; -import static org.sormas.e2etests.pages.application.users.CreateNewUserPage.SAVE_BUTTON; - public class AboutDirectorySteps implements En { public static final String userDirPath = System.getProperty("user.dir"); public static final List xlsxFileContentList = new ArrayList<>(); diff --git a/sormas-e2e-tests/src/test/java/org/sormas/e2etests/steps/web/application/LoginSteps.java b/sormas-e2e-tests/src/test/java/org/sormas/e2etests/steps/web/application/LoginSteps.java index e89a3742d7d..4f717e18584 100755 --- a/sormas-e2e-tests/src/test/java/org/sormas/e2etests/steps/web/application/LoginSteps.java +++ b/sormas-e2e-tests/src/test/java/org/sormas/e2etests/steps/web/application/LoginSteps.java @@ -58,7 +58,8 @@ public LoginSteps(WebDriverHelpers webDriverHelpers, RunningConfiguration runnin And( "I log in with National User", () -> { - EnvUser user = runningConfiguration.getUserByRole(locale, UserRoles.NationalUser.getRole()); + EnvUser user = + runningConfiguration.getUserByRole(locale, UserRoles.NationalUser.getRole()); webDriverHelpers.accessWebSite(runningConfiguration.getEnvironmentUrlForMarket(locale)); webDriverHelpers.waitForPageLoaded(); webDriverHelpers.waitUntilIdentifiedElementIsVisibleAndClickable( diff --git a/sormas-e2e-tests/src/test/java/org/sormas/e2etests/steps/web/application/cases/CaseDetailedTableViewSteps.java b/sormas-e2e-tests/src/test/java/org/sormas/e2etests/steps/web/application/cases/CaseDetailedTableViewSteps.java index 0f7e05a1df0..7560243f52c 100644 --- a/sormas-e2e-tests/src/test/java/org/sormas/e2etests/steps/web/application/cases/CaseDetailedTableViewSteps.java +++ b/sormas-e2e-tests/src/test/java/org/sormas/e2etests/steps/web/application/cases/CaseDetailedTableViewSteps.java @@ -146,7 +146,9 @@ public CaseDetailedTableViewSteps( } softly.assertEquals( detailedCaseDTableRow.get(CaseDetailedTableViewHeaders.REPORTING_USER.toString()), - runningConfiguration.getUserByRole(locale, UserRoles.RestUser.getRole()).getUserRole(), + runningConfiguration + .getUserByRole(locale, UserRoles.RestUser.getRole()) + .getUserRole(), "Reporting user is not correct"); softly.assertAll(); }); diff --git a/sormas-e2e-tests/src/test/java/org/sormas/e2etests/steps/web/application/contacts/ContactsDetailedTableViewSteps.java b/sormas-e2e-tests/src/test/java/org/sormas/e2etests/steps/web/application/contacts/ContactsDetailedTableViewSteps.java index 28c8f75e2ec..8a3dc924784 100644 --- a/sormas-e2e-tests/src/test/java/org/sormas/e2etests/steps/web/application/contacts/ContactsDetailedTableViewSteps.java +++ b/sormas-e2e-tests/src/test/java/org/sormas/e2etests/steps/web/application/contacts/ContactsDetailedTableViewSteps.java @@ -105,7 +105,9 @@ public ContactsDetailedTableViewSteps( softly.assertEquals( detailedContactDTableRow.get( ContactsDetailedTableViewHeaders.REPORTING_USER.toString()), - runningConfiguration.getUserByRole(locale, UserRoles.RestUser.getRole()).getUserRole(), + runningConfiguration + .getUserByRole(locale, UserRoles.RestUser.getRole()) + .getUserRole(), "Reporting user is not correct"); softly.assertAll(); }); diff --git a/sormas-e2e-tests/src/test/java/org/sormas/e2etests/steps/web/application/contacts/FollowUpVisitsTabSteps.java b/sormas-e2e-tests/src/test/java/org/sormas/e2etests/steps/web/application/contacts/FollowUpVisitsTabSteps.java index 07a1a1c8465..686b4c1929d 100644 --- a/sormas-e2e-tests/src/test/java/org/sormas/e2etests/steps/web/application/contacts/FollowUpVisitsTabSteps.java +++ b/sormas-e2e-tests/src/test/java/org/sormas/e2etests/steps/web/application/contacts/FollowUpVisitsTabSteps.java @@ -35,7 +35,9 @@ public class FollowUpVisitsTabSteps implements En { @Inject public FollowUpVisitsTabSteps( - WebDriverHelpers webDriverHelpers, ApiState apiState, RunningConfiguration runningConfiguration) { + WebDriverHelpers webDriverHelpers, + ApiState apiState, + RunningConfiguration runningConfiguration) { When( "^I am accessing the Follow-up visits tab using of created contact via api$", @@ -44,7 +46,8 @@ public FollowUpVisitsTabSteps( NavBarPage.CONTACTS_BUTTON); String visitLinkPath = "/sormas-webdriver/#!contacts/visits/"; String uuid = apiState.getCreatedContact().getUuid(); - String URL = runningConfiguration.getEnvironmentUrlForMarket(locale) + visitLinkPath + uuid; + String URL = + runningConfiguration.getEnvironmentUrlForMarket(locale) + visitLinkPath + uuid; webDriverHelpers.accessWebSite(URL); }); diff --git a/sormas-e2e-tests/src/test/java/org/sormas/e2etests/steps/web/application/events/EditEventSteps.java b/sormas-e2e-tests/src/test/java/org/sormas/e2etests/steps/web/application/events/EditEventSteps.java index 2edc99124d4..b7721a91339 100644 --- a/sormas-e2e-tests/src/test/java/org/sormas/e2etests/steps/web/application/events/EditEventSteps.java +++ b/sormas-e2e-tests/src/test/java/org/sormas/e2etests/steps/web/application/events/EditEventSteps.java @@ -18,40 +18,6 @@ package org.sormas.e2etests.steps.web.application.events; -import com.github.javafaker.Faker; -import cucumber.api.java8.En; -import org.sormas.e2etests.entities.pojo.helpers.ComparisonHelper; -import org.sormas.e2etests.entities.pojo.web.Event; -import org.sormas.e2etests.entities.pojo.web.EventGroup; -import org.sormas.e2etests.entities.pojo.web.EventHandout; -import org.sormas.e2etests.entities.pojo.web.EventParticipant; -import org.sormas.e2etests.entities.pojo.web.Person; -import org.sormas.e2etests.entities.services.EventDocumentService; -import org.sormas.e2etests.entities.services.EventGroupService; -import org.sormas.e2etests.entities.services.EventParticipantService; -import org.sormas.e2etests.entities.services.EventService; -import org.sormas.e2etests.enums.DistrictsValues; -import org.sormas.e2etests.enums.GenderValues; -import org.sormas.e2etests.enums.RegionsValues; -import org.sormas.e2etests.envconfig.manager.RunningConfiguration; -import org.sormas.e2etests.helpers.AssertHelpers; -import org.sormas.e2etests.helpers.WebDriverHelpers; -import org.sormas.e2etests.pages.application.events.EditEventPage; -import org.sormas.e2etests.state.ApiState; -import org.testng.Assert; -import org.testng.asserts.SoftAssert; - -import javax.inject.Inject; -import java.nio.file.Files; -import java.nio.file.Path; -import java.nio.file.Paths; -import java.time.LocalDate; -import java.time.format.DateTimeFormatter; -import java.time.format.TextStyle; -import java.util.List; -import java.util.Locale; -import java.util.concurrent.TimeUnit; - import static org.sormas.e2etests.pages.application.actions.CreateNewActionPage.NEW_ACTION_POPUP; import static org.sormas.e2etests.pages.application.cases.CaseDirectoryPage.ALL_RESULTS_CHECKBOX; import static org.sormas.e2etests.pages.application.cases.CreateNewCasePage.PERSON_SEARCH_LOCATOR_BUTTON; @@ -160,6 +126,39 @@ import static org.sormas.e2etests.pages.application.persons.EditPersonPage.SEE_EVENTS_FOR_PERSON; import static org.sormas.e2etests.steps.BaseSteps.locale; +import com.github.javafaker.Faker; +import cucumber.api.java8.En; +import java.nio.file.Files; +import java.nio.file.Path; +import java.nio.file.Paths; +import java.time.LocalDate; +import java.time.format.DateTimeFormatter; +import java.time.format.TextStyle; +import java.util.List; +import java.util.Locale; +import java.util.concurrent.TimeUnit; +import javax.inject.Inject; +import org.sormas.e2etests.entities.pojo.helpers.ComparisonHelper; +import org.sormas.e2etests.entities.pojo.web.Event; +import org.sormas.e2etests.entities.pojo.web.EventGroup; +import org.sormas.e2etests.entities.pojo.web.EventHandout; +import org.sormas.e2etests.entities.pojo.web.EventParticipant; +import org.sormas.e2etests.entities.pojo.web.Person; +import org.sormas.e2etests.entities.services.EventDocumentService; +import org.sormas.e2etests.entities.services.EventGroupService; +import org.sormas.e2etests.entities.services.EventParticipantService; +import org.sormas.e2etests.entities.services.EventService; +import org.sormas.e2etests.enums.DistrictsValues; +import org.sormas.e2etests.enums.GenderValues; +import org.sormas.e2etests.enums.RegionsValues; +import org.sormas.e2etests.envconfig.manager.RunningConfiguration; +import org.sormas.e2etests.helpers.AssertHelpers; +import org.sormas.e2etests.helpers.WebDriverHelpers; +import org.sormas.e2etests.pages.application.events.EditEventPage; +import org.sormas.e2etests.state.ApiState; +import org.testng.Assert; +import org.testng.asserts.SoftAssert; + public class EditEventSteps implements En { private final WebDriverHelpers webDriverHelpers; diff --git a/sormas-e2e-tests/src/test/java/org/sormas/e2etests/steps/web/application/events/EventDirectorySteps.java b/sormas-e2e-tests/src/test/java/org/sormas/e2etests/steps/web/application/events/EventDirectorySteps.java index 34a17932e41..f7e6ff49b7a 100644 --- a/sormas-e2e-tests/src/test/java/org/sormas/e2etests/steps/web/application/events/EventDirectorySteps.java +++ b/sormas-e2e-tests/src/test/java/org/sormas/e2etests/steps/web/application/events/EventDirectorySteps.java @@ -18,46 +18,6 @@ package org.sormas.e2etests.steps.web.application.events; -import cucumber.api.java8.En; -import org.openqa.selenium.WebDriverException; -import org.openqa.selenium.WebElement; -import org.sormas.e2etests.common.DataOperations; -import org.sormas.e2etests.entities.pojo.helpers.ComparisonHelper; -import org.sormas.e2etests.entities.pojo.web.EventGroup; -import org.sormas.e2etests.entities.services.EventGroupService; -import org.sormas.e2etests.entities.services.EventService; -import org.sormas.e2etests.enums.CommunityValues; -import org.sormas.e2etests.enums.DiseasesValues; -import org.sormas.e2etests.enums.DistrictsValues; -import org.sormas.e2etests.enums.EventReferenceDateOptions; -import org.sormas.e2etests.enums.RegionsValues; -import org.sormas.e2etests.enums.RiskLevelValues; -import org.sormas.e2etests.enums.SourceTypeValues; -import org.sormas.e2etests.enums.cases.epidemiologicalData.TypeOfPlace; -import org.sormas.e2etests.envconfig.manager.RunningConfiguration; -import org.sormas.e2etests.helpers.AssertHelpers; -import org.sormas.e2etests.helpers.WebDriverHelpers; -import org.sormas.e2etests.pages.application.NavBarPage; -import org.sormas.e2etests.pages.application.events.EventDirectoryPage; -import org.sormas.e2etests.state.ApiState; -import org.sormas.e2etests.steps.BaseSteps; -import org.testng.Assert; -import org.testng.asserts.SoftAssert; - -import javax.inject.Inject; -import java.io.File; -import java.time.LocalDate; -import java.time.ZoneId; -import java.time.format.DateTimeFormatter; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.concurrent.ConcurrentHashMap; -import java.util.concurrent.TimeUnit; -import java.util.concurrent.atomic.AtomicInteger; - import static org.sormas.e2etests.pages.application.cases.CaseDirectoryPage.CASE_COMMUNITY_FILTER_COMBOBOX; import static org.sormas.e2etests.pages.application.cases.CaseDirectoryPage.CASE_DATA_TYPE_FILTER_COMBOBOX; import static org.sormas.e2etests.pages.application.cases.CaseDirectoryPage.CASE_DISTRICT_FILTER_COMBOBOX; @@ -143,6 +103,45 @@ import static org.sormas.e2etests.pages.application.persons.PersonDirectoryPage.RESET_FILTERS_BUTTON; import static org.sormas.e2etests.steps.BaseSteps.locale; +import cucumber.api.java8.En; +import java.io.File; +import java.time.LocalDate; +import java.time.ZoneId; +import java.time.format.DateTimeFormatter; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.concurrent.ConcurrentHashMap; +import java.util.concurrent.TimeUnit; +import java.util.concurrent.atomic.AtomicInteger; +import javax.inject.Inject; +import org.openqa.selenium.WebDriverException; +import org.openqa.selenium.WebElement; +import org.sormas.e2etests.common.DataOperations; +import org.sormas.e2etests.entities.pojo.helpers.ComparisonHelper; +import org.sormas.e2etests.entities.pojo.web.EventGroup; +import org.sormas.e2etests.entities.services.EventGroupService; +import org.sormas.e2etests.entities.services.EventService; +import org.sormas.e2etests.enums.CommunityValues; +import org.sormas.e2etests.enums.DiseasesValues; +import org.sormas.e2etests.enums.DistrictsValues; +import org.sormas.e2etests.enums.EventReferenceDateOptions; +import org.sormas.e2etests.enums.RegionsValues; +import org.sormas.e2etests.enums.RiskLevelValues; +import org.sormas.e2etests.enums.SourceTypeValues; +import org.sormas.e2etests.enums.cases.epidemiologicalData.TypeOfPlace; +import org.sormas.e2etests.envconfig.manager.RunningConfiguration; +import org.sormas.e2etests.helpers.AssertHelpers; +import org.sormas.e2etests.helpers.WebDriverHelpers; +import org.sormas.e2etests.pages.application.NavBarPage; +import org.sormas.e2etests.pages.application.events.EventDirectoryPage; +import org.sormas.e2etests.state.ApiState; +import org.sormas.e2etests.steps.BaseSteps; +import org.testng.Assert; +import org.testng.asserts.SoftAssert; + public class EventDirectorySteps implements En { private final WebDriverHelpers webDriverHelpers; private final BaseSteps baseSteps; From 0866879865828f0fc44be057435b49e79e0b7023 Mon Sep 17 00:00:00 2001 From: Frank Hautpmann Date: Wed, 11 May 2022 11:50:07 +0200 Subject: [PATCH 071/167] New Crowdin updates (#9128) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * New translations enum.properties (Spanish, Cuba) * New translations enum.properties (English, Afghanistan) * New translations enum.properties (English, Nigeria) * New translations enum.properties (English, Ghana) * New translations strings.properties (Czech) * New translations strings.properties (Spanish, Cuba) * New translations enum.properties (Croatian) * New translations enum.properties (Urdu (Pakistan)) * New translations enum.properties (French) * New translations enum.properties (Japanese) * New translations enum.properties (Romanian) * New translations enum.properties (Spanish) * New translations enum.properties (Czech) * New translations enum.properties (Finnish) * New translations enum.properties (Italian) * New translations enum.properties (Dutch) * New translations enum.properties (Chinese Simplified) * New translations enum.properties (Norwegian) * New translations enum.properties (Polish) * New translations enum.properties (Portuguese) * New translations enum.properties (Russian) * New translations enum.properties (Swedish) * New translations enum.properties (Turkish) * New translations enum.properties (Ukrainian) * New translations enum.properties (Arabic) * New translations enum.properties (French) * New translations enum.properties (Dutch) * New translations enum.properties (German) * New translations enum.properties (Russian) * New translations enum.properties (Portuguese) * New translations enum.properties (Polish) * New translations enum.properties (Norwegian) * New translations enum.properties (Arabic) * New translations enum.properties (Japanese) * New translations enum.properties (Finnish) * New translations enum.properties (Czech) * New translations enum.properties (Spanish) * New translations enum.properties (Romanian) * New translations enum.properties (Italian) * New translations enum.properties (German, Switzerland) * New translations enum.properties (English, Ghana) * New translations enum.properties (English, Nigeria) * New translations enum.properties (English, Afghanistan) * New translations enum.properties (Spanish, Cuba) * New translations enum.properties (Pashto) * New translations enum.properties (Dari) * New translations enum.properties (Italian, Switzerland) * New translations enum.properties (French, Switzerland) * New translations enum.properties (Filipino) * New translations enum.properties (Swahili) * New translations enum.properties (Fijian) * New translations enum.properties (Hindi) * New translations enum.properties (Croatian) * New translations enum.properties (Spanish, Ecuador) * New translations enum.properties (Chinese Simplified) * New translations enum.properties (Ukrainian) * New translations enum.properties (Turkish) * New translations enum.properties (Swedish) * New translations enum.properties (Urdu (Pakistan)) * New translations strings.properties (French) * New translations strings.properties (Swahili) * New translations strings.properties (Chinese Simplified) * New translations strings.properties (Urdu (Pakistan)) * New translations strings.properties (Spanish, Ecuador) * New translations strings.properties (Croatian) * New translations strings.properties (Hindi) * New translations strings.properties (Filipino) * New translations strings.properties (Fijian) * New translations strings.properties (French, Switzerland) * New translations strings.properties (Turkish) * New translations strings.properties (Italian, Switzerland) * New translations strings.properties (Dari) * New translations strings.properties (Pashto) * New translations strings.properties (Spanish, Cuba) * New translations strings.properties (English, Afghanistan) * New translations strings.properties (English, Nigeria) * New translations strings.properties (English, Ghana) * New translations strings.properties (Ukrainian) * New translations strings.properties (Swedish) * New translations strings.properties (German) * New translations strings.properties (Spanish) * New translations enum.properties (German) * New translations strings.properties (German, Switzerland) * New translations captions.properties (German, Switzerland) * New translations enum.properties (Czech) * New translations enum.properties (Urdu (Pakistan)) * New translations enum.properties (German, Switzerland) * New translations strings.properties (Romanian) * New translations captions.properties (Czech) * New translations strings.properties (Russian) * New translations strings.properties (Czech) * New translations strings.properties (Finnish) * New translations strings.properties (Italian) * New translations strings.properties (Japanese) * New translations strings.properties (Dutch) * New translations strings.properties (Norwegian) * New translations strings.properties (Polish) * New translations strings.properties (Portuguese) * New translations strings.properties (Arabic) * New translations captions.properties (German, Switzerland) * New translations captions.properties (Italian, Switzerland) * New translations captions.properties (Croatian) * New translations captions.properties (Hindi) * New translations captions.properties (Filipino) * New translations captions.properties (Fijian) * New translations captions.properties (Swahili) * New translations captions.properties (French, Switzerland) * New translations captions.properties (Dari) * New translations captions.properties (Urdu (Pakistan)) * New translations captions.properties (Pashto) * New translations captions.properties (Spanish, Cuba) * New translations strings.properties (Spanish, Cuba) * New translations captions.properties (English, Afghanistan) * New translations captions.properties (English, Nigeria) * New translations captions.properties (English, Ghana) * New translations captions.properties (Spanish, Ecuador) * New translations captions.properties (Chinese Simplified) * New translations enum.properties (Spanish, Cuba) * New translations captions.properties (Italian) * New translations captions.properties (French) * New translations captions.properties (German) * New translations captions.properties (Romanian) * New translations captions.properties (Spanish) * New translations captions.properties (Czech) * New translations captions.properties (Finnish) * New translations captions.properties (Japanese) * New translations captions.properties (Ukrainian) * New translations captions.properties (Dutch) * New translations captions.properties (Norwegian) * New translations captions.properties (Polish) * New translations captions.properties (Portuguese) * New translations captions.properties (Russian) * New translations captions.properties (Swedish) * New translations captions.properties (Turkish) * New translations captions.properties (Arabic) * New translations captions.properties (German, Switzerland) * New translations strings.properties (French) * New translations strings.properties (French) * New translations strings.properties (French, Switzerland) * New translations strings.properties (Urdu (Pakistan)) * New translations strings.properties (Spanish, Ecuador) * New translations strings.properties (Croatian) * New translations strings.properties (Hindi) * New translations strings.properties (Filipino) * New translations strings.properties (Fijian) * New translations strings.properties (Swahili) * New translations strings.properties (Italian, Switzerland) * New translations strings.properties (Ukrainian) * New translations strings.properties (Dari) * New translations strings.properties (Pashto) * New translations strings.properties (Spanish, Cuba) * New translations strings.properties (English, Afghanistan) * New translations strings.properties (English, Nigeria) * New translations strings.properties (English, Ghana) * New translations strings.properties (Arabic) * New translations strings.properties (Chinese Simplified) * New translations strings.properties (Turkish) * New translations strings.properties (German) * New translations strings.properties (Czech) * New translations enum.properties (French) * New translations strings.properties (German, Switzerland) * New translations enum.properties (Czech) * New translations captions.properties (German) * New translations strings.properties (Romanian) * New translations strings.properties (Spanish) * New translations captions.properties (Czech) * New translations strings.properties (Finnish) * New translations strings.properties (Swedish) * New translations strings.properties (Italian) * New translations strings.properties (Japanese) * New translations strings.properties (Dutch) * New translations strings.properties (Norwegian) * New translations strings.properties (Polish) * New translations strings.properties (Portuguese) * New translations strings.properties (Russian) * New translations validations.properties (German) * New translations strings.properties (German, Switzerland) * New translations strings.properties (Spanish, Cuba) * New translations captions.properties (German, Switzerland) * New translations captions.properties (Urdu (Pakistan)) * New translations captions.properties (English, Ghana) * New translations captions.properties (English, Nigeria) * New translations captions.properties (English, Afghanistan) * New translations captions.properties (Spanish, Cuba) * New translations captions.properties (Pashto) * New translations captions.properties (Dari) * New translations captions.properties (Italian, Switzerland) * New translations captions.properties (French, Switzerland) * New translations captions.properties (Swahili) * New translations captions.properties (Fijian) * New translations captions.properties (Filipino) * New translations captions.properties (Hindi) * New translations captions.properties (Croatian) * New translations captions.properties (Spanish, Ecuador) * New translations captions.properties (Chinese Simplified) * New translations captions.properties (French) * New translations captions.properties (Japanese) * New translations captions.properties (German) * New translations captions.properties (Romanian) * New translations captions.properties (Spanish) * New translations captions.properties (Czech) * New translations captions.properties (Finnish) * New translations captions.properties (Italian) * New translations captions.properties (Dutch) * New translations captions.properties (Ukrainian) * New translations captions.properties (Norwegian) * New translations captions.properties (Polish) * New translations captions.properties (Portuguese) * New translations captions.properties (Russian) * New translations captions.properties (Swedish) * New translations captions.properties (Turkish) * New translations captions.properties (Arabic) * New translations captions.properties (German, Switzerland) * New translations captions.properties (Urdu (Pakistan)) * New translations captions.properties (English, Ghana) * New translations captions.properties (English, Nigeria) * New translations captions.properties (English, Afghanistan) * New translations captions.properties (Spanish, Cuba) * New translations captions.properties (Pashto) * New translations captions.properties (Dari) * New translations captions.properties (Italian, Switzerland) * New translations captions.properties (French, Switzerland) * New translations captions.properties (Swahili) * New translations captions.properties (Fijian) * New translations captions.properties (Filipino) * New translations captions.properties (Hindi) * New translations captions.properties (Croatian) * New translations captions.properties (Spanish, Ecuador) * New translations captions.properties (Chinese Simplified) * New translations captions.properties (French) * New translations captions.properties (Japanese) * New translations captions.properties (German) * New translations captions.properties (Romanian) * New translations captions.properties (Spanish) * New translations captions.properties (Czech) * New translations captions.properties (Finnish) * New translations captions.properties (Italian) * New translations captions.properties (Dutch) * New translations captions.properties (Ukrainian) * New translations captions.properties (Norwegian) * New translations captions.properties (Polish) * New translations captions.properties (Portuguese) * New translations captions.properties (Russian) * New translations captions.properties (Swedish) * New translations captions.properties (Turkish) * New translations captions.properties (Arabic) Co-authored-by: Maté Strysewske Co-authored-by: Alex Vidrean --- .../main/resources/captions_ar-SA.properties | 31 +++++++++++++++++++ .../main/resources/captions_cs-CZ.properties | 31 +++++++++++++++++++ .../main/resources/captions_de-CH.properties | 31 +++++++++++++++++++ .../main/resources/captions_de-DE.properties | 31 +++++++++++++++++++ .../main/resources/captions_en-AF.properties | 31 +++++++++++++++++++ .../main/resources/captions_en-GH.properties | 31 +++++++++++++++++++ .../main/resources/captions_en-NG.properties | 31 +++++++++++++++++++ .../main/resources/captions_es-CU.properties | 31 +++++++++++++++++++ .../main/resources/captions_es-EC.properties | 31 +++++++++++++++++++ .../main/resources/captions_es-ES.properties | 31 +++++++++++++++++++ .../main/resources/captions_fa-AF.properties | 31 +++++++++++++++++++ .../main/resources/captions_fi-FI.properties | 31 +++++++++++++++++++ .../main/resources/captions_fil-PH.properties | 31 +++++++++++++++++++ .../main/resources/captions_fj-FJ.properties | 31 +++++++++++++++++++ .../main/resources/captions_fr-CH.properties | 31 +++++++++++++++++++ .../main/resources/captions_fr-FR.properties | 31 +++++++++++++++++++ .../main/resources/captions_hi-IN.properties | 31 +++++++++++++++++++ .../main/resources/captions_hr-HR.properties | 31 +++++++++++++++++++ .../main/resources/captions_it-CH.properties | 31 +++++++++++++++++++ .../main/resources/captions_it-IT.properties | 31 +++++++++++++++++++ .../main/resources/captions_ja-JP.properties | 31 +++++++++++++++++++ .../main/resources/captions_nl-NL.properties | 31 +++++++++++++++++++ .../main/resources/captions_no-NO.properties | 31 +++++++++++++++++++ .../main/resources/captions_pl-PL.properties | 31 +++++++++++++++++++ .../main/resources/captions_ps-AF.properties | 31 +++++++++++++++++++ .../main/resources/captions_pt-PT.properties | 31 +++++++++++++++++++ .../main/resources/captions_ro-RO.properties | 31 +++++++++++++++++++ .../main/resources/captions_ru-RU.properties | 31 +++++++++++++++++++ .../main/resources/captions_sv-SE.properties | 31 +++++++++++++++++++ .../main/resources/captions_sw-KE.properties | 31 +++++++++++++++++++ .../main/resources/captions_tr-TR.properties | 31 +++++++++++++++++++ .../main/resources/captions_uk-UA.properties | 31 +++++++++++++++++++ .../main/resources/captions_ur-PK.properties | 31 +++++++++++++++++++ .../main/resources/captions_zh-CN.properties | 31 +++++++++++++++++++ 34 files changed, 1054 insertions(+) diff --git a/sormas-api/src/main/resources/captions_ar-SA.properties b/sormas-api/src/main/resources/captions_ar-SA.properties index 9cdba232bc5..fd86024316d 100644 --- a/sormas-api/src/main/resources/captions_ar-SA.properties +++ b/sormas-api/src/main/resources/captions_ar-SA.properties @@ -67,6 +67,7 @@ aboutAdditionalInfo=Additional Info aboutCopyright=Copyright aboutDocuments=Documents aboutVersion=Version +versionIsMissing=Version is missing aboutBrandedSormasVersion=%s powered by SORMAS aboutCaseClassificationRules=Case Classification Rules (HTML) aboutChangelog=Full Changelog @@ -362,6 +363,7 @@ caseCreateNew=Create new case caseDataEnterHomeAddressNow=Enter home address of the case person now caseCancelDeletion=Cancel case deletion CaseData=Case +CaseData.ageAndBirthDate=Age and birth date CaseData.additionalDetails=General comment CaseData.caseClassification=Case classification CaseData.caseIdentificationSource=Case identification source @@ -622,6 +624,8 @@ columnVaccineManufacturer=Vaccine manufacturer Community=Community Community.archived=Archived Community.externalID=External ID +Community.region=Region +Community.district=District communityActiveCommunities=Active communities communityArchivedCommunities=Archived communities communityAllCommunities=All communities @@ -677,6 +681,7 @@ contactNumberOfDuplicatesDetected=%d potential duplicates detected contactFilterWithDifferentRegion=Show duplicates with differing regions Contact=Contact Contact.additionalDetails=General comment +Contact.ageAndBirthDate=Age and birth date Contact.caseClassification=Classification of the source case Contact.caze=Source case Contact.caze.ageSex=Age, sex @@ -688,6 +693,7 @@ Contact.cazeDisease=Disease of source case Contact.cazeDiseaseVariant=Disease variant of source case Contact.cazeDistrict=District of source case Contact.community=Responsible community +Contact.completeness=Completeness Contact.contactClassification=Contact classification Contact.contactOfficer=Responsible contact officer Contact.contactOfficerUuid=Responsible contact officer @@ -992,6 +998,7 @@ District.epidCode=Epid code District.growthRate=Growth rate District.population=Population District.externalID=External ID +District.region=Region epiDataNoSourceContacts=No source contacts have been created for this case EpiData=Epidemiological data EpiData.areaInfectedAnimals=Residing, working or travelling to an area where infected animals have been confirmed @@ -1142,6 +1149,9 @@ Event.internalToken=Internal Token Event.eventGroups=Groups Event.latestEventGroup=Latest Event Group Event.eventGroupCount=Event Group Count +Event.region=Region +Event.district=District +Event.community=Community # Event action EventAction.eventUuid=Event id EventAction.eventTitle=Event title @@ -1589,6 +1599,7 @@ Person.approximateAge=Age Person.approximateAgeReferenceDate=Last updated Person.approximateAgeType=Unit Person.birthdate=Date of birth (year / month / day) +Person.birthDate=Date of birth (year / month / day) Person.birthdateDD=Day of birth Person.birthdateMM=Month of birth Person.birthdateYYYY=Year of birth @@ -1684,6 +1695,8 @@ PointOfEntry.latitude=Latitude PointOfEntry.longitude=Longitude PointOfEntry.externalID=External ID PointOfEntry.archived=Archived +PointOfEntry.region=Region +PointOfEntry.district=District populationDataMaleTotal=Male total populationDataFemaleTotal=Female total PortHealthInfo=Port health information @@ -1849,6 +1862,10 @@ Sample.uuid=Sample ID Sample.samplePurpose=Purpose of the Sample Sample.samplingReason=Reason for sampling/testing Sample.samplingReasonDetails=Sampling reason details +Sample.region=Region +Sample.district=District +Sample.community=Community +# Sample Export SampleExport.additionalTestingRequested=Have additional tests been requested? SampleExport.personAddressCaption=Address of case/contact/event participant person SampleExport.personAge=Age of case/contact/event participant person @@ -1954,6 +1971,9 @@ Immunization.responsibleRegion=Responsible region Immunization.responsibleDistrict=Responsible district Immunization.responsibleCommunity=Responsible community Immunization.immunizationPeriod=Immunization period +Immunization.region=Region +Immunization.district=District +Immunization.community=Community immunizationImmunizationsList=Immunizations list linkImmunizationToCaseButton=Link case openLinkedCaseToImmunizationButton=Open case @@ -2207,6 +2227,8 @@ Task.taskType=Task type Task.taskAssignee=Task assignee Task.taskPriority=Task priority Task.travelEntry=Travel entry +Task.region=Region +Task.district=District # TestReport TestReport=Test report TestReport.testDateTime=Date and time of result @@ -2246,6 +2268,7 @@ TravelEntry.responsibleRegion=Responsible region TravelEntry.responsibleDistrict=Responsible district TravelEntry.responsibleCommunity=Responsible community TravelEntry.differentPointOfEntryJurisdiction=Point of entry jurisdiction differs from responsible jurisdiction +TravelEntry.pointOfEntry=Point of entry TravelEntry.pointOfEntryRegion=Region TravelEntry.pointOfEntryDistrict=District TravelEntry.pointOfEntryDetails=Point of entry details @@ -2311,6 +2334,9 @@ User.userName=User name User.userRoles=User roles User.address=Address User.uuid=UUID +User.region=Region +User.district=District +User.community=Community # Vaccination vaccinationNewVaccination=New vaccination vaccinationNoVaccinationsForPerson=There are no vaccinations for this person @@ -2458,6 +2484,9 @@ WeeklyReportEntry.numberOfCases=Cases reported # WeeklyReportInformantSummary WeeklyReportInformantSummary.informantReportDate=Informant report submission WeeklyReportInformantSummary.totalCaseCount=Cases reported by informant +WeeklyReportInformantSummary.informant=Informant +WeeklyReportInformantSummary.community=Community +WeeklyReportInformantSummary.facility=Facility # WeeklyReportOfficerSummary WeeklyReportOfficerSummary.informants=Number of informants WeeklyReportOfficerSummary.informantReports=Number of informant reports @@ -2466,6 +2495,7 @@ WeeklyReportOfficerSummary.informantZeroReports=Number of informant zero reports WeeklyReportOfficerSummary.officer=Officer WeeklyReportOfficerSummary.officerReportDate=Officer report submission WeeklyReportOfficerSummary.totalCaseCount=Cases reported by officer +WeeklyReportOfficerSummary.district=District # WeeklyReportRegionSummary WeeklyReportRegionSummary.informants=Number of informants WeeklyReportRegionSummary.informantReports=Number of informant reports @@ -2475,6 +2505,7 @@ WeeklyReportRegionSummary.officers=Number of officers WeeklyReportRegionSummary.officerReports=Number of officers reports WeeklyReportRegionSummary.officerReportPercentage=Percentage WeeklyReportRegionSummary.officerZeroReports=Number of officer zero reports +WeeklyReportRegionSummary.region=Region # SORMAS to SORMAS SormasToSormasOptions.organization=Organization SormasToSormasOptions.withAssociatedContacts=Share associated contacts diff --git a/sormas-api/src/main/resources/captions_cs-CZ.properties b/sormas-api/src/main/resources/captions_cs-CZ.properties index 01f6ed56343..9292e36f07a 100644 --- a/sormas-api/src/main/resources/captions_cs-CZ.properties +++ b/sormas-api/src/main/resources/captions_cs-CZ.properties @@ -67,6 +67,7 @@ aboutAdditionalInfo=Dodatečné informace aboutCopyright=Autorská práva aboutDocuments=Dokumenty aboutVersion=Verze +versionIsMissing=Version is missing aboutBrandedSormasVersion=%s běží na SORMAS aboutCaseClassificationRules=Pravidla klasifikace případů (HTML) aboutChangelog=Úplný seznam změn @@ -362,6 +363,7 @@ caseCreateNew=Vytvořit nový případ caseDataEnterHomeAddressNow=Zadejte domovskou adresu osoby případu caseCancelDeletion=Zrušit odstranění případu CaseData=Případ +CaseData.ageAndBirthDate=Age and birth date CaseData.additionalDetails=Obecný komentář CaseData.caseClassification=Klasifikace případů CaseData.caseIdentificationSource=Zdroj identifikace případu @@ -622,6 +624,8 @@ columnVaccineManufacturer=Výrobce očkovací látky Community=Komunita Community.archived=Archivováno Community.externalID=Externí ID +Community.region=Region +Community.district=District communityActiveCommunities=Aktivní komunity communityArchivedCommunities=Archivované komunity communityAllCommunities=Všechny komunity @@ -677,6 +681,7 @@ contactNumberOfDuplicatesDetected=%d potenciálních duplikátů detekováno contactFilterWithDifferentRegion=Zobrazit duplikáty s různými regiony Contact=Kontakt Contact.additionalDetails=Obecný komentář +Contact.ageAndBirthDate=Age and birth date Contact.caseClassification=Klasifikace zdrojového případu Contact.caze=Zdrojový případ Contact.caze.ageSex=Věk, pohlaví @@ -688,6 +693,7 @@ Contact.cazeDisease=Nákaza zdrojového případu Contact.cazeDiseaseVariant=Varianta nákazy zdrojového případu Contact.cazeDistrict=Okres zdrojového případu Contact.community=Odpovědná komunita +Contact.completeness=Completeness Contact.contactClassification=Klasifikace kontaktů Contact.contactOfficer=Odpovědný kontaktní úředník Contact.contactOfficerUuid=Odpovědný kontaktní úředník @@ -992,6 +998,7 @@ District.epidCode=Epid kód District.growthRate=Míra růstu District.population=Populace District.externalID=Externí ID +District.region=Region epiDataNoSourceContacts=Pro tento případ nebyly vytvořeny žádné kontakty EpiData=Epidemiologické údaje EpiData.areaInfectedAnimals=Potvrzení pobytu, práce nebo cesty do oblasti, kde byla nakažená zvířata potvrzena @@ -1142,6 +1149,9 @@ Event.internalToken=Interní token Event.eventGroups=Skupiny Event.latestEventGroup=Poslední skupina událostí Event.eventGroupCount=Počet skupin událostí +Event.region=Region +Event.district=District +Event.community=Community # Event action EventAction.eventUuid=Id události EventAction.eventTitle=Název události @@ -1589,6 +1599,7 @@ Person.approximateAge=Věk Person.approximateAgeReferenceDate=Poslední aktualizace Person.approximateAgeType=Jednotka Person.birthdate=Datum narození (rok / měsíc / den) +Person.birthDate=Date of birth (year / month / day) Person.birthdateDD=Datum narození Person.birthdateMM=Měsíc narození Person.birthdateYYYY=Rok narození @@ -1684,6 +1695,8 @@ PointOfEntry.latitude=Zeměpisná šířka PointOfEntry.longitude=Zeměpisná délka PointOfEntry.externalID=Externí ID PointOfEntry.archived=Archivováno +PointOfEntry.region=Region +PointOfEntry.district=District populationDataMaleTotal=Muži celkem populationDataFemaleTotal=Ženy celkem PortHealthInfo=Informace Přístavu zdraví @@ -1849,6 +1862,10 @@ Sample.uuid=ID vzorku Sample.samplePurpose=Účel vzorku Sample.samplingReason=Důvod odběru vzorků/vyšetření Sample.samplingReasonDetails=Podrobnosti o důvodu odběru vzorků +Sample.region=Region +Sample.district=District +Sample.community=Community +# Sample Export SampleExport.additionalTestingRequested=Byly požadovány další testy? SampleExport.personAddressCaption=Adresa případu/kontaktu/osoby účastnící se akce SampleExport.personAge=Stáří případu/kontaktu/osoby účastnící se události @@ -1954,6 +1971,9 @@ Immunization.responsibleRegion=Odpovědný region Immunization.responsibleDistrict=Odpovědný okres Immunization.responsibleCommunity=Odpovědná komunita Immunization.immunizationPeriod=Doba imunizace +Immunization.region=Region +Immunization.district=District +Immunization.community=Community immunizationImmunizationsList=Seznam imunizací linkImmunizationToCaseButton=Odkaz na Případ openLinkedCaseToImmunizationButton=Otevřít případ @@ -2207,6 +2227,8 @@ Task.taskType=Typ úkolu Task.taskAssignee=Příjemce úkolu Task.taskPriority=Priorita úkolu Task.travelEntry=Travel entry +Task.region=Region +Task.district=District # TestReport TestReport=Zkušební protokol TestReport.testDateTime=Datum a čas výsledku @@ -2246,6 +2268,7 @@ TravelEntry.responsibleRegion=Odpovědný region TravelEntry.responsibleDistrict=Odpovědný okres TravelEntry.responsibleCommunity=Odpovědná komunita TravelEntry.differentPointOfEntryJurisdiction=Příslušnost místa vstupu se liší od odpovědné jurisdikce +TravelEntry.pointOfEntry=Point of entry TravelEntry.pointOfEntryRegion=Oblast TravelEntry.pointOfEntryDistrict=Okres TravelEntry.pointOfEntryDetails=Údaje o vstupním místě @@ -2311,6 +2334,9 @@ User.userName=Uživatelské jméno User.userRoles=Uživatelské role User.address=Adresa User.uuid=UUID +User.region=Region +User.district=District +User.community=Community # Vaccination vaccinationNewVaccination=Nové očkování vaccinationNoVaccinationsForPerson=Pro tuto osobu neexistuje žádné očkování @@ -2458,6 +2484,9 @@ WeeklyReportEntry.numberOfCases=Nahlášené případy # WeeklyReportInformantSummary WeeklyReportInformantSummary.informantReportDate=Předložení zprávy informátorem WeeklyReportInformantSummary.totalCaseCount=Případy nahlášené informátorem +WeeklyReportInformantSummary.informant=Informant +WeeklyReportInformantSummary.community=Community +WeeklyReportInformantSummary.facility=Facility # WeeklyReportOfficerSummary WeeklyReportOfficerSummary.informants=Počet informátorů WeeklyReportOfficerSummary.informantReports=Počet zpráv informátorů @@ -2466,6 +2495,7 @@ WeeklyReportOfficerSummary.informantZeroReports=Zprávy s nulovým počtem infor WeeklyReportOfficerSummary.officer=Úředník WeeklyReportOfficerSummary.officerReportDate=Předložení zprávy úředníkem WeeklyReportOfficerSummary.totalCaseCount=Případy nahlášené úředníkem +WeeklyReportOfficerSummary.district=District # WeeklyReportRegionSummary WeeklyReportRegionSummary.informants=Počet informátorů WeeklyReportRegionSummary.informantReports=Počet zpráv informátorů @@ -2475,6 +2505,7 @@ WeeklyReportRegionSummary.officers=Počet úředníků WeeklyReportRegionSummary.officerReports=Počet zpráv úředníků WeeklyReportRegionSummary.officerReportPercentage=Procento WeeklyReportRegionSummary.officerZeroReports=Zprávy s nulovým počtem úředníků +WeeklyReportRegionSummary.region=Region # SORMAS to SORMAS SormasToSormasOptions.organization=Organizace SormasToSormasOptions.withAssociatedContacts=Sdílet související kontakty diff --git a/sormas-api/src/main/resources/captions_de-CH.properties b/sormas-api/src/main/resources/captions_de-CH.properties index 49d999a501d..e9783aace5a 100644 --- a/sormas-api/src/main/resources/captions_de-CH.properties +++ b/sormas-api/src/main/resources/captions_de-CH.properties @@ -67,6 +67,7 @@ aboutAdditionalInfo=Zusätzliche Information aboutCopyright=Urheberrecht aboutDocuments=Dokumente aboutVersion=Version +versionIsMissing=Version fehlt aboutBrandedSormasVersion=%s mit SORMAS betrieben aboutCaseClassificationRules=Falldefinitionskategorienregeln (HTML) aboutChangelog=Vollständiges Änderungsprotokoll @@ -362,6 +363,7 @@ caseCreateNew=Neuen Fall erstellen caseDataEnterHomeAddressNow=Heimatadresse der Fallperson jetzt eingeben caseCancelDeletion=Fall Löschung abbrechen CaseData=Fall +CaseData.ageAndBirthDate=Age and birth date CaseData.additionalDetails=Allgemeiner Kommentar CaseData.caseClassification=Falldefinitionskategorie CaseData.caseIdentificationSource=Fallidentifikationsquelle @@ -622,6 +624,8 @@ columnVaccineManufacturer=Impfstoffhersteller Community=Gemeinde Community.archived=Archiviert Community.externalID=Externe ID +Community.region=Region +Community.district=District communityActiveCommunities=Aktive Gemeinden communityArchivedCommunities=Archivierte Gemeinden communityAllCommunities=Alle Gemeinden @@ -677,6 +681,7 @@ contactNumberOfDuplicatesDetected=%d potentielle Duplikate erkannt contactFilterWithDifferentRegion=Duplikate mit unterschiedlichen Kantonen anzeigen Contact=Kontakt Contact.additionalDetails=Allgemeiner Kommentar +Contact.ageAndBirthDate=Age and birth date Contact.caseClassification=Falldefinitionskategorie des Indexfalls Contact.caze=Indexfall Contact.caze.ageSex=Alter, Geschlecht @@ -688,6 +693,7 @@ Contact.cazeDisease=Krankheit des Indexfalls Contact.cazeDiseaseVariant=Krankheitsvariante des Indexfalls Contact.cazeDistrict=Bezirk des Indexfalls Contact.community=Zuständige Gemeinde +Contact.completeness=Completeness Contact.contactClassification=Kontaktklassifikation Contact.contactOfficer=Verantwortliche*r (Gesundheitsamts-)Mitarbeiter*in Contact.contactOfficerUuid=Verantwortliche*r (Gesundheitsamts-)Mitarbeiter*in @@ -992,6 +998,7 @@ District.epidCode=EPID-Nummer District.growthRate=Wachstumsrate District.population=Bevölkerung District.externalID=Externe ID +District.region=Region epiDataNoSourceContacts=Für diesen Fall wurden keine Ursprungskontakte erstellt EpiData=Epidemiologische Daten EpiData.areaInfectedAnimals=Wohnen, Arbeiten oder Reisen in ein Gebiet, in dem infizierte Tiere bestätigt wurden @@ -1142,6 +1149,9 @@ Event.internalToken=Internes Aktenzeichen Event.eventGroups=Gruppen Event.latestEventGroup=Neueste Ereignisgruppe Event.eventGroupCount=Ereignisgruppen Anzahl +Event.region=Region +Event.district=District +Event.community=Community # Event action EventAction.eventUuid=Ereignis ID EventAction.eventTitle=Ereignistitel @@ -1589,6 +1599,7 @@ Person.approximateAge=Alter Person.approximateAgeReferenceDate=Letzte Aktualisierung Person.approximateAgeType=Einheit Person.birthdate=Geburtsdatum (Jahr / Monat / Tag) +Person.birthDate=Date of birth (year / month / day) Person.birthdateDD=Geburtstag Person.birthdateMM=Geburtsmonat Person.birthdateYYYY=Geburtsjahr @@ -1684,6 +1695,8 @@ PointOfEntry.latitude=Breitengrad PointOfEntry.longitude=Längengrad PointOfEntry.externalID=Externe ID PointOfEntry.archived=Archiviert +PointOfEntry.region=Region +PointOfEntry.district=District populationDataMaleTotal=Männlich Gesamt populationDataFemaleTotal=Weiblich Gesamt PortHealthInfo=Einreiseinformation @@ -1849,6 +1862,10 @@ Sample.uuid=Proben-ID Sample.samplePurpose=Zweck der Probe Sample.samplingReason=Grund für Test Sample.samplingReasonDetails=Details zum Grund der Probenentnahme +Sample.region=Region +Sample.district=District +Sample.community=Community +# Sample Export SampleExport.additionalTestingRequested=Wurden zusätzliche Tests angefordert? SampleExport.personAddressCaption=Adresse des Falls/Kontakts/Ereignisteilnehmers/in SampleExport.personAge=Alter des Falls/Kontakts/Eventteilnehmers/in @@ -1954,6 +1971,9 @@ Immunization.responsibleRegion=Zuständiger Kanton Immunization.responsibleDistrict=Zuständiger Bezirk Immunization.responsibleCommunity=Zuständige Gemeinde Immunization.immunizationPeriod=Immunisierungszeitraum +Immunization.region=Region +Immunization.district=District +Immunization.community=Community immunizationImmunizationsList=Immunisierungsliste linkImmunizationToCaseButton=Fall verknüpfen openLinkedCaseToImmunizationButton=Fall öffnen @@ -2207,6 +2227,8 @@ Task.taskType=Aufgabentyp Task.taskAssignee=Zugewiesen an Task.taskPriority=Aufgabenpriorität Task.travelEntry=Einreise +Task.region=Region +Task.district=District # TestReport TestReport=Testbericht TestReport.testDateTime=Datum und Uhrzeit des Ergebnisses @@ -2246,6 +2268,7 @@ TravelEntry.responsibleRegion=Zuständiger Kanton TravelEntry.responsibleDistrict=Zuständiger Bezirk TravelEntry.responsibleCommunity=Zuständige Gemeinde TravelEntry.differentPointOfEntryJurisdiction=Der Einreiseort unterscheidet sich vom Zuständigkeitsbereich +TravelEntry.pointOfEntry=Point of entry TravelEntry.pointOfEntryRegion=Kanton TravelEntry.pointOfEntryDistrict=Bezirk TravelEntry.pointOfEntryDetails=Einreiseort Details @@ -2311,6 +2334,9 @@ User.userName=Benutzername User.userRoles=Benutzerrollen User.address=Adresse User.uuid=UUID +User.region=Region +User.district=District +User.community=Community # Vaccination vaccinationNewVaccination=Neue Impfung vaccinationNoVaccinationsForPerson=Es gibt keine Impfungen für diese Person @@ -2458,6 +2484,9 @@ WeeklyReportEntry.numberOfCases=Gemeldete Fälle # WeeklyReportInformantSummary WeeklyReportInformantSummary.informantReportDate=Informantenberichteinreichung WeeklyReportInformantSummary.totalCaseCount=Fälle von Informant*in gemeldet +WeeklyReportInformantSummary.informant=Informant +WeeklyReportInformantSummary.community=Community +WeeklyReportInformantSummary.facility=Facility # WeeklyReportOfficerSummary WeeklyReportOfficerSummary.informants=Anzahl der Informant*innen WeeklyReportOfficerSummary.informantReports=Anzahl der Informantenberichte @@ -2466,6 +2495,7 @@ WeeklyReportOfficerSummary.informantZeroReports=Anzahl der Informanten-Null-Beri WeeklyReportOfficerSummary.officer=Bearbeiter*in WeeklyReportOfficerSummary.officerReportDate=Beauftragtenberichtseinreichung WeeklyReportOfficerSummary.totalCaseCount=Fälle von der/dem Beauftragten gemeldet +WeeklyReportOfficerSummary.district=District # WeeklyReportRegionSummary WeeklyReportRegionSummary.informants=Anzahl der Informant*innen WeeklyReportRegionSummary.informantReports=Anzahl der Informantenberichte @@ -2475,6 +2505,7 @@ WeeklyReportRegionSummary.officers=Anzahl der Beauftragten WeeklyReportRegionSummary.officerReports=Anzahl der Beauftragtenberichte WeeklyReportRegionSummary.officerReportPercentage=Prozent WeeklyReportRegionSummary.officerZeroReports=Anzahl der Beauftragten-Null-Berichte +WeeklyReportRegionSummary.region=Region # SORMAS to SORMAS SormasToSormasOptions.organization=Ziel SormasToSormasOptions.withAssociatedContacts=Verknüpfte Kontakte teilen diff --git a/sormas-api/src/main/resources/captions_de-DE.properties b/sormas-api/src/main/resources/captions_de-DE.properties index 2d354e22288..b733b4c8164 100644 --- a/sormas-api/src/main/resources/captions_de-DE.properties +++ b/sormas-api/src/main/resources/captions_de-DE.properties @@ -67,6 +67,7 @@ aboutAdditionalInfo=Zusätzliche Information aboutCopyright=Urheberrecht aboutDocuments=Dokumente aboutVersion=Version +versionIsMissing=Version fehlt aboutBrandedSormasVersion=%s mit SORMAS betrieben aboutCaseClassificationRules=Falldefinitionskategorienregeln (HTML) aboutChangelog=Vollständige GitHub Änderungshistorie @@ -362,6 +363,7 @@ caseCreateNew=Neuen Fall erstellen caseDataEnterHomeAddressNow=Heimatadresse der Fallperson jetzt eingeben caseCancelDeletion=Fall Löschung abbrechen CaseData=Fall +CaseData.ageAndBirthDate=Alter und Geburtsdatum CaseData.additionalDetails=Allgemeiner Kommentar CaseData.caseClassification=Falldefinitionskategorie CaseData.caseIdentificationSource=Fall bekannt durch @@ -622,6 +624,8 @@ columnVaccineManufacturer=Impfstoffhersteller Community=Gemeinde Community.archived=Archiviert Community.externalID=Externe ID +Community.region=Bundesland +Community.district=District communityActiveCommunities=Aktive Gemeinden communityArchivedCommunities=Archivierte Gemeinden communityAllCommunities=Alle Gemeinden @@ -677,6 +681,7 @@ contactNumberOfDuplicatesDetected=%d potentielle Duplikate erkannt contactFilterWithDifferentRegion=Duplikate mit unterschiedlichen Bundesländern anzeigen Contact=Kontakt Contact.additionalDetails=Allgemeiner Kommentar +Contact.ageAndBirthDate=Alter und Geburtsdatum Contact.caseClassification=Falldefinitionskategorie des Indexfalls Contact.caze=Indexfall Contact.caze.ageSex=Alter, Geschlecht @@ -688,6 +693,7 @@ Contact.cazeDisease=Krankheit des Indexfalls Contact.cazeDiseaseVariant=Krankheitsvariante des Indexfalles Contact.cazeDistrict=Landkreis des Indexfalls Contact.community=Zuständige Gemeinde +Contact.completeness=Completeness Contact.contactClassification=Kontaktklassifikation Contact.contactOfficer=Verantwortliche*r Kontaktbeauftragte*r Contact.contactOfficerUuid=Verantwortliche*r Kontaktbeauftragte*r @@ -992,6 +998,7 @@ District.epidCode=EPID-Nummer District.growthRate=Wachstumsrate District.population=Bevölkerung District.externalID=Externe ID +District.region=Bundesland epiDataNoSourceContacts=Für diesen Fall wurden keine Ursprungskontakte erstellt EpiData=Epidemiologische Daten EpiData.areaInfectedAnimals=Wohnen, Arbeiten oder Reisen in ein Gebiet, in dem infizierte Tiere bestätigt wurden @@ -1142,6 +1149,9 @@ Event.internalToken=Herdkennung (Internes Aktenzeichen) Event.eventGroups=Gruppen Event.latestEventGroup=Neueste Ereignisgruppe Event.eventGroupCount=Ereignisgruppen Anzahl +Event.region=Bundesland +Event.district=District +Event.community=Community # Event action EventAction.eventUuid=Ereignis ID EventAction.eventTitle=Ereignistitel @@ -1589,6 +1599,7 @@ Person.approximateAge=Alter Person.approximateAgeReferenceDate=Letzte Aktualisierung Person.approximateAgeType=Einheit Person.birthdate=Geburtsdatum (Jahr / Monat / Tag) +Person.birthDate=Geburtsdatum (Jahr / Monat / Tag) Person.birthdateDD=Tag der Geburt Person.birthdateMM=Geburtsmonat Person.birthdateYYYY=Geburtsjahr @@ -1684,6 +1695,8 @@ PointOfEntry.latitude=Breitengrad PointOfEntry.longitude=Längengrad PointOfEntry.externalID=Externe ID PointOfEntry.archived=Archiviert +PointOfEntry.region=Bundesland +PointOfEntry.district=District populationDataMaleTotal=Männlich Gesamt populationDataFemaleTotal=Weiblich Gesamt PortHealthInfo=Einreiseinformation @@ -1849,6 +1862,10 @@ Sample.uuid=Proben-ID Sample.samplePurpose=Zweck der Probe Sample.samplingReason=Grund für Probenentnahme/Testen Sample.samplingReasonDetails=Details zum Grund der Probenentnahme +Sample.region=Bundesland +Sample.district=District +Sample.community=Community +# Sample Export SampleExport.additionalTestingRequested=Wurden zusätzliche Tests angefordert? SampleExport.personAddressCaption=Adresse von Fall/Kontakt/Ereignisteilnehmer/in SampleExport.personAge=Alter von Fall/Kontakt/Eventteilnehmer/in @@ -1954,6 +1971,9 @@ Immunization.responsibleRegion=Zuständiges Bundesland Immunization.responsibleDistrict=Zuständige/r Landkreis/Kreisfreie Stadt Immunization.responsibleCommunity=Zuständige Gemeinde Immunization.immunizationPeriod=Immunisierungszeitraum +Immunization.region=Bundesland +Immunization.district=District +Immunization.community=Community immunizationImmunizationsList=Immunisierungsliste linkImmunizationToCaseButton=Fall verknüpfen openLinkedCaseToImmunizationButton=Fall öffnen @@ -2207,6 +2227,8 @@ Task.taskType=Aufgabentyp Task.taskAssignee=Zugewiesen an Task.taskPriority=Aufgabenpriorität Task.travelEntry=Einreise +Task.region=Bundesland +Task.district=District # TestReport TestReport=Testbericht TestReport.testDateTime=Datum und Uhrzeit des Ergebnisses @@ -2246,6 +2268,7 @@ TravelEntry.responsibleRegion=Zuständiges Bundesland TravelEntry.responsibleDistrict=Zuständige/r Landkreis/Kreisfreie Stadt TravelEntry.responsibleCommunity=Zuständige Gemeinde TravelEntry.differentPointOfEntryJurisdiction=Der Einreiseort unterscheidet sich vom Zuständigkeitsbereich +TravelEntry.pointOfEntry=Point of entry TravelEntry.pointOfEntryRegion=Bundesland TravelEntry.pointOfEntryDistrict=Landkreis/Kreisfreie Stadt TravelEntry.pointOfEntryDetails=Einreiseort Details @@ -2311,6 +2334,9 @@ User.userName=Benutzername User.userRoles=Benutzerrollen User.address=Adresse User.uuid=UUID +User.region=Bundesland +User.district=District +User.community=Community # Vaccination vaccinationNewVaccination=Neue Impfung vaccinationNoVaccinationsForPerson=Es gibt keine Impfungen für diese Person @@ -2458,6 +2484,9 @@ WeeklyReportEntry.numberOfCases=Gemeldete Fälle # WeeklyReportInformantSummary WeeklyReportInformantSummary.informantReportDate=Informantenberichteinreichung WeeklyReportInformantSummary.totalCaseCount=Fälle von Informant*in gemeldet +WeeklyReportInformantSummary.informant=Informant +WeeklyReportInformantSummary.community=Community +WeeklyReportInformantSummary.facility=Einrichtung # WeeklyReportOfficerSummary WeeklyReportOfficerSummary.informants=Anzahl der Informant*innen WeeklyReportOfficerSummary.informantReports=Anzahl der Informantenberichte @@ -2466,6 +2495,7 @@ WeeklyReportOfficerSummary.informantZeroReports=Anzahl der Informanten-Null-Beri WeeklyReportOfficerSummary.officer=Bearbeiter*in WeeklyReportOfficerSummary.officerReportDate=Beauftragtenberichtseinreichung WeeklyReportOfficerSummary.totalCaseCount=Fälle von der/dem Beauftragten gemeldet +WeeklyReportOfficerSummary.district=District # WeeklyReportRegionSummary WeeklyReportRegionSummary.informants=Anzahl der Informant*innen WeeklyReportRegionSummary.informantReports=Anzahl der Informantenberichte @@ -2475,6 +2505,7 @@ WeeklyReportRegionSummary.officers=Anzahl der Beauftragten WeeklyReportRegionSummary.officerReports=Anzahl der Beauftragtenberichte WeeklyReportRegionSummary.officerReportPercentage=Prozent WeeklyReportRegionSummary.officerZeroReports=Anzahl der Beauftragten-Null-Berichte +WeeklyReportRegionSummary.region=Bundesland # SORMAS to SORMAS SormasToSormasOptions.organization=Gesundheitsamt SormasToSormasOptions.withAssociatedContacts=Verknüpfte Kontakte übergeben diff --git a/sormas-api/src/main/resources/captions_en-AF.properties b/sormas-api/src/main/resources/captions_en-AF.properties index 1ca40febb47..acf5cca11a9 100644 --- a/sormas-api/src/main/resources/captions_en-AF.properties +++ b/sormas-api/src/main/resources/captions_en-AF.properties @@ -67,6 +67,7 @@ aboutAdditionalInfo=Additional Info aboutCopyright=Copyright aboutDocuments=Documents aboutVersion=Version +versionIsMissing=Version is missing aboutBrandedSormasVersion=%s powered by SORMAS aboutCaseClassificationRules=Case Classification Rules (HTML) aboutChangelog=Full Changelog @@ -362,6 +363,7 @@ caseCreateNew=Create new case caseDataEnterHomeAddressNow=Enter home address of the case person now caseCancelDeletion=Cancel case deletion CaseData=Case +CaseData.ageAndBirthDate=Age and birth date CaseData.additionalDetails=General comment CaseData.caseClassification=Case classification CaseData.caseIdentificationSource=Case identification source @@ -622,6 +624,8 @@ columnVaccineManufacturer=Vaccine manufacturer Community=Community Community.archived=Archived Community.externalID=External ID +Community.region=Region +Community.district=District communityActiveCommunities=Active clusters communityArchivedCommunities=Archived clusters communityAllCommunities=All clusters @@ -677,6 +681,7 @@ contactNumberOfDuplicatesDetected=%d potential duplicates detected contactFilterWithDifferentRegion=Show duplicates with differing regions Contact=Contact Contact.additionalDetails=General comment +Contact.ageAndBirthDate=Age and birth date Contact.caseClassification=Classification of the source case Contact.caze=Source case Contact.caze.ageSex=Age, sex @@ -688,6 +693,7 @@ Contact.cazeDisease=Disease of source case Contact.cazeDiseaseVariant=Disease variant of source case Contact.cazeDistrict=District of source case Contact.community=Responsible cluster +Contact.completeness=Completeness Contact.contactClassification=Contact classification Contact.contactOfficer=Responsible contact officer Contact.contactOfficerUuid=Responsible contact officer @@ -992,6 +998,7 @@ District.epidCode=Epid code District.growthRate=Growth rate District.population=Population District.externalID=External ID +District.region=Region epiDataNoSourceContacts=No source contacts have been created for this case EpiData=Epidemiological data EpiData.areaInfectedAnimals=Residing, working or travelling to an area where infected animals have been confirmed @@ -1142,6 +1149,9 @@ Event.internalToken=Internal Token Event.eventGroups=Groups Event.latestEventGroup=Latest Event Group Event.eventGroupCount=Event Group Count +Event.region=Region +Event.district=District +Event.community=Community # Event action EventAction.eventUuid=Event id EventAction.eventTitle=Event title @@ -1589,6 +1599,7 @@ Person.approximateAge=Age Person.approximateAgeReferenceDate=Last updated Person.approximateAgeType=Unit Person.birthdate=Date of birth (year / month / day) +Person.birthDate=Date of birth (year / month / day) Person.birthdateDD=Day of birth Person.birthdateMM=Month of birth Person.birthdateYYYY=Year of birth @@ -1684,6 +1695,8 @@ PointOfEntry.latitude=Latitude PointOfEntry.longitude=Longitude PointOfEntry.externalID=External ID PointOfEntry.archived=Archived +PointOfEntry.region=Region +PointOfEntry.district=District populationDataMaleTotal=Male total populationDataFemaleTotal=Female total PortHealthInfo=Port health information @@ -1849,6 +1862,10 @@ Sample.uuid=Sample ID Sample.samplePurpose=Purpose of the Sample Sample.samplingReason=Reason for sampling/testing Sample.samplingReasonDetails=Sampling reason details +Sample.region=Region +Sample.district=District +Sample.community=Community +# Sample Export SampleExport.additionalTestingRequested=Have additional tests been requested? SampleExport.personAddressCaption=Address of case/contact/event participant person SampleExport.personAge=Age of case/contact/event participant person @@ -1954,6 +1971,9 @@ Immunization.responsibleRegion=Responsible region Immunization.responsibleDistrict=Responsible district Immunization.responsibleCommunity=Responsible community Immunization.immunizationPeriod=Immunization period +Immunization.region=Region +Immunization.district=District +Immunization.community=Community immunizationImmunizationsList=Immunizations list linkImmunizationToCaseButton=Link case openLinkedCaseToImmunizationButton=Open case @@ -2207,6 +2227,8 @@ Task.taskType=Task type Task.taskAssignee=Task assignee Task.taskPriority=Task priority Task.travelEntry=Travel entry +Task.region=Region +Task.district=District # TestReport TestReport=Test report TestReport.testDateTime=Date and time of result @@ -2246,6 +2268,7 @@ TravelEntry.responsibleRegion=Responsible region TravelEntry.responsibleDistrict=Responsible district TravelEntry.responsibleCommunity=Responsible community TravelEntry.differentPointOfEntryJurisdiction=Point of entry jurisdiction differs from responsible jurisdiction +TravelEntry.pointOfEntry=Point of entry TravelEntry.pointOfEntryRegion=Region TravelEntry.pointOfEntryDistrict=District TravelEntry.pointOfEntryDetails=Point of entry details @@ -2311,6 +2334,9 @@ User.userName=User name User.userRoles=User roles User.address=Address User.uuid=UUID +User.region=Region +User.district=District +User.community=Community # Vaccination vaccinationNewVaccination=New vaccination vaccinationNoVaccinationsForPerson=There are no vaccinations for this person @@ -2458,6 +2484,9 @@ WeeklyReportEntry.numberOfCases=Cases reported # WeeklyReportInformantSummary WeeklyReportInformantSummary.informantReportDate=Informant report submission WeeklyReportInformantSummary.totalCaseCount=Cases reported by informant +WeeklyReportInformantSummary.informant=Informant +WeeklyReportInformantSummary.community=Community +WeeklyReportInformantSummary.facility=Facility # WeeklyReportOfficerSummary WeeklyReportOfficerSummary.informants=Number of informants WeeklyReportOfficerSummary.informantReports=Number of informant reports @@ -2466,6 +2495,7 @@ WeeklyReportOfficerSummary.informantZeroReports=Number of informant zero reports WeeklyReportOfficerSummary.officer=Officer WeeklyReportOfficerSummary.officerReportDate=Officer report submission WeeklyReportOfficerSummary.totalCaseCount=Cases reported by officer +WeeklyReportOfficerSummary.district=District # WeeklyReportRegionSummary WeeklyReportRegionSummary.informants=Number of informants WeeklyReportRegionSummary.informantReports=Number of informant reports @@ -2475,6 +2505,7 @@ WeeklyReportRegionSummary.officers=Number of officers WeeklyReportRegionSummary.officerReports=Number of officers reports WeeklyReportRegionSummary.officerReportPercentage=Percentage WeeklyReportRegionSummary.officerZeroReports=Number of officer zero reports +WeeklyReportRegionSummary.region=Region # SORMAS to SORMAS SormasToSormasOptions.organization=Organization SormasToSormasOptions.withAssociatedContacts=Share associated contacts diff --git a/sormas-api/src/main/resources/captions_en-GH.properties b/sormas-api/src/main/resources/captions_en-GH.properties index f508d45455e..92290df0c39 100644 --- a/sormas-api/src/main/resources/captions_en-GH.properties +++ b/sormas-api/src/main/resources/captions_en-GH.properties @@ -67,6 +67,7 @@ aboutAdditionalInfo=Additional Info aboutCopyright=Copyright aboutDocuments=Documents aboutVersion=Version +versionIsMissing=Version is missing aboutBrandedSormasVersion=%s powered by SORMAS aboutCaseClassificationRules=Case Classification Rules (HTML) aboutChangelog=Full Changelog @@ -362,6 +363,7 @@ caseCreateNew=Create new case caseDataEnterHomeAddressNow=Enter home address of the case person now caseCancelDeletion=Cancel case deletion CaseData=Case +CaseData.ageAndBirthDate=Age and birth date CaseData.additionalDetails=General comment CaseData.caseClassification=Case classification CaseData.caseIdentificationSource=Case identification source @@ -622,6 +624,8 @@ columnVaccineManufacturer=Vaccine manufacturer Community=Community Community.archived=Archived Community.externalID=External ID +Community.region=Region +Community.district=District communityActiveCommunities=Active sub districts communityArchivedCommunities=Archived sub districts communityAllCommunities=All sub districts @@ -677,6 +681,7 @@ contactNumberOfDuplicatesDetected=%d potential duplicates detected contactFilterWithDifferentRegion=Show duplicates with differing regions Contact=Contact Contact.additionalDetails=General comment +Contact.ageAndBirthDate=Age and birth date Contact.caseClassification=Classification of the source case Contact.caze=Source case Contact.caze.ageSex=Age, sex @@ -688,6 +693,7 @@ Contact.cazeDisease=Disease of source case Contact.cazeDiseaseVariant=Disease variant of source case Contact.cazeDistrict=District of source case Contact.community=Responsible sub district +Contact.completeness=Completeness Contact.contactClassification=Contact classification Contact.contactOfficer=Responsible district disease control officer Contact.contactOfficerUuid=Responsible district disease control officer @@ -992,6 +998,7 @@ District.epidCode=Epid code District.growthRate=Growth rate District.population=Population District.externalID=External ID +District.region=Region epiDataNoSourceContacts=No source contacts have been created for this case EpiData=Epidemiological data EpiData.areaInfectedAnimals=Residing, working or travelling to an area where infected animals have been confirmed @@ -1142,6 +1149,9 @@ Event.internalToken=Internal Token Event.eventGroups=Groups Event.latestEventGroup=Latest Event Group Event.eventGroupCount=Event Group Count +Event.region=Region +Event.district=District +Event.community=Community # Event action EventAction.eventUuid=Event id EventAction.eventTitle=Event title @@ -1589,6 +1599,7 @@ Person.approximateAge=Age Person.approximateAgeReferenceDate=Last updated Person.approximateAgeType=Unit Person.birthdate=Date of birth (year / month / day) +Person.birthDate=Date of birth (year / month / day) Person.birthdateDD=Day of birth Person.birthdateMM=Month of birth Person.birthdateYYYY=Year of birth @@ -1684,6 +1695,8 @@ PointOfEntry.latitude=Latitude PointOfEntry.longitude=Longitude PointOfEntry.externalID=External ID PointOfEntry.archived=Archived +PointOfEntry.region=Region +PointOfEntry.district=District populationDataMaleTotal=Male total populationDataFemaleTotal=Female total PortHealthInfo=Port health information @@ -1849,6 +1862,10 @@ Sample.uuid=Sample ID Sample.samplePurpose=Purpose of the Sample Sample.samplingReason=Reason for sampling/testing Sample.samplingReasonDetails=Sampling reason details +Sample.region=Region +Sample.district=District +Sample.community=Community +# Sample Export SampleExport.additionalTestingRequested=Have additional tests been requested? SampleExport.personAddressCaption=Address of case/contact/event participant person SampleExport.personAge=Age of case/contact/event participant person @@ -1954,6 +1971,9 @@ Immunization.responsibleRegion=Responsible region Immunization.responsibleDistrict=Responsible district Immunization.responsibleCommunity=Responsible community Immunization.immunizationPeriod=Immunization period +Immunization.region=Region +Immunization.district=District +Immunization.community=Community immunizationImmunizationsList=Immunizations list linkImmunizationToCaseButton=Link case openLinkedCaseToImmunizationButton=Open case @@ -2207,6 +2227,8 @@ Task.taskType=Task type Task.taskAssignee=Task assignee Task.taskPriority=Task priority Task.travelEntry=Travel entry +Task.region=Region +Task.district=District # TestReport TestReport=Test report TestReport.testDateTime=Date and time of result @@ -2246,6 +2268,7 @@ TravelEntry.responsibleRegion=Responsible region TravelEntry.responsibleDistrict=Responsible district TravelEntry.responsibleCommunity=Responsible community TravelEntry.differentPointOfEntryJurisdiction=Point of entry jurisdiction differs from responsible jurisdiction +TravelEntry.pointOfEntry=Point of entry TravelEntry.pointOfEntryRegion=Region TravelEntry.pointOfEntryDistrict=District TravelEntry.pointOfEntryDetails=Point of entry details @@ -2311,6 +2334,9 @@ User.userName=User name User.userRoles=User roles User.address=Address User.uuid=UUID +User.region=Region +User.district=District +User.community=Community # Vaccination vaccinationNewVaccination=New vaccination vaccinationNoVaccinationsForPerson=There are no vaccinations for this person @@ -2458,6 +2484,9 @@ WeeklyReportEntry.numberOfCases=Cases reported # WeeklyReportInformantSummary WeeklyReportInformantSummary.informantReportDate=Informant report submission WeeklyReportInformantSummary.totalCaseCount=Cases reported by informant +WeeklyReportInformantSummary.informant=Informant +WeeklyReportInformantSummary.community=Community +WeeklyReportInformantSummary.facility=Facility # WeeklyReportOfficerSummary WeeklyReportOfficerSummary.informants=Number of informants WeeklyReportOfficerSummary.informantReports=Number of informant reports @@ -2466,6 +2495,7 @@ WeeklyReportOfficerSummary.informantZeroReports=Number of informant zero reports WeeklyReportOfficerSummary.officer=Officer WeeklyReportOfficerSummary.officerReportDate=Officer report submission WeeklyReportOfficerSummary.totalCaseCount=Cases reported by officer +WeeklyReportOfficerSummary.district=District # WeeklyReportRegionSummary WeeklyReportRegionSummary.informants=Number of informants WeeklyReportRegionSummary.informantReports=Number of informant reports @@ -2475,6 +2505,7 @@ WeeklyReportRegionSummary.officers=Number of officers WeeklyReportRegionSummary.officerReports=Number of officers reports WeeklyReportRegionSummary.officerReportPercentage=Percentage WeeklyReportRegionSummary.officerZeroReports=Number of officer zero reports +WeeklyReportRegionSummary.region=Region # SORMAS to SORMAS SormasToSormasOptions.organization=Organization SormasToSormasOptions.withAssociatedContacts=Share associated contacts diff --git a/sormas-api/src/main/resources/captions_en-NG.properties b/sormas-api/src/main/resources/captions_en-NG.properties index 8c5cf8e6dff..52bf40fffd5 100644 --- a/sormas-api/src/main/resources/captions_en-NG.properties +++ b/sormas-api/src/main/resources/captions_en-NG.properties @@ -67,6 +67,7 @@ aboutAdditionalInfo=Additional Info aboutCopyright=Copyright aboutDocuments=Documents aboutVersion=Version +versionIsMissing=Version is missing aboutBrandedSormasVersion=%s powered by SORMAS aboutCaseClassificationRules=Case Classification Rules (HTML) aboutChangelog=Full Changelog @@ -362,6 +363,7 @@ caseCreateNew=Create new case caseDataEnterHomeAddressNow=Enter home address of the case person now caseCancelDeletion=Cancel case deletion CaseData=Case +CaseData.ageAndBirthDate=Age and birth date CaseData.additionalDetails=General comment CaseData.caseClassification=Case classification CaseData.caseIdentificationSource=Case identification source @@ -622,6 +624,8 @@ columnVaccineManufacturer=Vaccine manufacturer Community=Community Community.archived=Archived Community.externalID=External ID +Community.region=Region +Community.district=District communityActiveCommunities=Active wards communityArchivedCommunities=Archived wards communityAllCommunities=All wards @@ -677,6 +681,7 @@ contactNumberOfDuplicatesDetected=%d potential duplicates detected contactFilterWithDifferentRegion=Show duplicates with differing states Contact=Contact Contact.additionalDetails=General comment +Contact.ageAndBirthDate=Age and birth date Contact.caseClassification=Classification of the source case Contact.caze=Source case Contact.caze.ageSex=Age, sex @@ -688,6 +693,7 @@ Contact.cazeDisease=Disease of source case Contact.cazeDiseaseVariant=Disease variant of source case Contact.cazeDistrict=LGA of source case Contact.community=Responsible ward +Contact.completeness=Completeness Contact.contactClassification=Contact classification Contact.contactOfficer=Responsible contact officer Contact.contactOfficerUuid=Responsible contact officer @@ -992,6 +998,7 @@ District.epidCode=Epid code District.growthRate=Growth rate District.population=Population District.externalID=External ID +District.region=Region epiDataNoSourceContacts=No source contacts have been created for this case EpiData=Epidemiological data EpiData.areaInfectedAnimals=Residing, working or travelling to an area where infected animals have been confirmed @@ -1142,6 +1149,9 @@ Event.internalToken=Internal Token Event.eventGroups=Groups Event.latestEventGroup=Latest Event Group Event.eventGroupCount=Event Group Count +Event.region=Region +Event.district=District +Event.community=Community # Event action EventAction.eventUuid=Event id EventAction.eventTitle=Event title @@ -1589,6 +1599,7 @@ Person.approximateAge=Age Person.approximateAgeReferenceDate=Last updated Person.approximateAgeType=Unit Person.birthdate=Date of birth (year / month / day) +Person.birthDate=Date of birth (year / month / day) Person.birthdateDD=Day of birth Person.birthdateMM=Month of birth Person.birthdateYYYY=Year of birth @@ -1684,6 +1695,8 @@ PointOfEntry.latitude=Latitude PointOfEntry.longitude=Longitude PointOfEntry.externalID=External ID PointOfEntry.archived=Archived +PointOfEntry.region=Region +PointOfEntry.district=District populationDataMaleTotal=Male total populationDataFemaleTotal=Female total PortHealthInfo=Port health information @@ -1849,6 +1862,10 @@ Sample.uuid=Sample ID Sample.samplePurpose=Purpose of the Sample Sample.samplingReason=Reason for sampling/testing Sample.samplingReasonDetails=Sampling reason details +Sample.region=Region +Sample.district=District +Sample.community=Community +# Sample Export SampleExport.additionalTestingRequested=Have additional tests been requested? SampleExport.personAddressCaption=Address of case/contact/event participant person SampleExport.personAge=Age of case/contact/event participant person @@ -1954,6 +1971,9 @@ Immunization.responsibleRegion=Responsible region Immunization.responsibleDistrict=Responsible district Immunization.responsibleCommunity=Responsible community Immunization.immunizationPeriod=Immunization period +Immunization.region=Region +Immunization.district=District +Immunization.community=Community immunizationImmunizationsList=Immunizations list linkImmunizationToCaseButton=Link case openLinkedCaseToImmunizationButton=Open case @@ -2207,6 +2227,8 @@ Task.taskType=Task type Task.taskAssignee=Task assignee Task.taskPriority=Task priority Task.travelEntry=Travel entry +Task.region=Region +Task.district=District # TestReport TestReport=Test report TestReport.testDateTime=Date and time of result @@ -2246,6 +2268,7 @@ TravelEntry.responsibleRegion=Responsible region TravelEntry.responsibleDistrict=Responsible district TravelEntry.responsibleCommunity=Responsible community TravelEntry.differentPointOfEntryJurisdiction=Point of entry jurisdiction differs from responsible jurisdiction +TravelEntry.pointOfEntry=Point of entry TravelEntry.pointOfEntryRegion=Region TravelEntry.pointOfEntryDistrict=District TravelEntry.pointOfEntryDetails=Point of entry details @@ -2311,6 +2334,9 @@ User.userName=User name User.userRoles=User roles User.address=Address User.uuid=UUID +User.region=Region +User.district=District +User.community=Community # Vaccination vaccinationNewVaccination=New vaccination vaccinationNoVaccinationsForPerson=There are no vaccinations for this person @@ -2458,6 +2484,9 @@ WeeklyReportEntry.numberOfCases=Cases reported # WeeklyReportInformantSummary WeeklyReportInformantSummary.informantReportDate=Informant report submission WeeklyReportInformantSummary.totalCaseCount=Cases reported by informant +WeeklyReportInformantSummary.informant=Informant +WeeklyReportInformantSummary.community=Community +WeeklyReportInformantSummary.facility=Facility # WeeklyReportOfficerSummary WeeklyReportOfficerSummary.informants=Number of informants WeeklyReportOfficerSummary.informantReports=Number of informant reports @@ -2466,6 +2495,7 @@ WeeklyReportOfficerSummary.informantZeroReports=Number of informant zero reports WeeklyReportOfficerSummary.officer=Officer WeeklyReportOfficerSummary.officerReportDate=Officer report submission WeeklyReportOfficerSummary.totalCaseCount=Cases reported by officer +WeeklyReportOfficerSummary.district=District # WeeklyReportRegionSummary WeeklyReportRegionSummary.informants=Number of informants WeeklyReportRegionSummary.informantReports=Number of informant reports @@ -2475,6 +2505,7 @@ WeeklyReportRegionSummary.officers=Number of officers WeeklyReportRegionSummary.officerReports=Number of officers reports WeeklyReportRegionSummary.officerReportPercentage=Percentage WeeklyReportRegionSummary.officerZeroReports=Number of officer zero reports +WeeklyReportRegionSummary.region=Region # SORMAS to SORMAS SormasToSormasOptions.organization=Organization SormasToSormasOptions.withAssociatedContacts=Share associated contacts diff --git a/sormas-api/src/main/resources/captions_es-CU.properties b/sormas-api/src/main/resources/captions_es-CU.properties index ff71ea93b4c..3e819e1a89e 100644 --- a/sormas-api/src/main/resources/captions_es-CU.properties +++ b/sormas-api/src/main/resources/captions_es-CU.properties @@ -67,6 +67,7 @@ aboutAdditionalInfo=Información adicional aboutCopyright=Copyright aboutDocuments=Documentos aboutVersion=Versión +versionIsMissing=Falta la versión aboutBrandedSormasVersion=%s desarrollado por SORMAS aboutCaseClassificationRules=Reglas de Clasificación de Casos (HTML) aboutChangelog=Cambios completos @@ -362,6 +363,7 @@ caseCreateNew=Crear nuevo caso caseDataEnterHomeAddressNow=Ingrese ahora la dirección personal del caso caseCancelDeletion=Cancelar eliminación de caso CaseData=Caso +CaseData.ageAndBirthDate=Edad y fecha de nacimiento CaseData.additionalDetails=Comentario general CaseData.caseClassification=Clasificación de casos CaseData.caseIdentificationSource=Fuente de identificación del caso @@ -622,6 +624,8 @@ columnVaccineManufacturer=Fabricante de vacuna Community=Área de salud Community.archived=Archivado Community.externalID=ID externa +Community.region=Provincia +Community.district=Municipio communityActiveCommunities=Áreas de salud activas communityArchivedCommunities=Áreas de salud archivadas communityAllCommunities=Todas las áreas de salud @@ -677,6 +681,7 @@ contactNumberOfDuplicatesDetected=%d potenciales duplicados detectados contactFilterWithDifferentRegion=Mostrar duplicados con provincias diferentes Contact=Contacto Contact.additionalDetails=Comentario general +Contact.ageAndBirthDate=Edad y fecha de nacimiento Contact.caseClassification=Clasificación del caso de origen Contact.caze=Caso de origen Contact.caze.ageSex=Edad, sexo @@ -688,6 +693,7 @@ Contact.cazeDisease=Enfermedad del caso de origen Contact.cazeDiseaseVariant=Variante de enfermedad del caso de origen Contact.cazeDistrict=Municipio del caso de origen Contact.community=Área de salud responsable +Contact.completeness=Completitud Contact.contactClassification=Clasificación del contacto Contact.contactOfficer=Funcionario de contacto responsable Contact.contactOfficerUuid=Funcionario de contacto responsable @@ -992,6 +998,7 @@ District.epidCode=Código epid District.growthRate=Tasa de crecimiento District.population=Población District.externalID=ID externa +District.region=Provincia epiDataNoSourceContacts=No se han creado contactos de origen para este caso EpiData=Datos epidemiológicos EpiData.areaInfectedAnimals=Reside, trabaja o viaja a una zona donde se han confirmado animales infectados @@ -1142,6 +1149,9 @@ Event.internalToken=Token interno Event.eventGroups=Grupos Event.latestEventGroup=Último grupo de eventos Event.eventGroupCount=Número de grupos de eventos +Event.region=Provincia +Event.district=Municipio +Event.community=Área de salud # Event action EventAction.eventUuid=ID de evento EventAction.eventTitle=Título de evento @@ -1589,6 +1599,7 @@ Person.approximateAge=Edad Person.approximateAgeReferenceDate=Última actualización Person.approximateAgeType=Unidad Person.birthdate=Fecha de nacimiento (año / mes / día) +Person.birthDate=Fecha de nacimiento (año / mes / día) Person.birthdateDD=Día de nacimiento Person.birthdateMM=Mes de nacimiento Person.birthdateYYYY=Año de nacimiento @@ -1684,6 +1695,8 @@ PointOfEntry.latitude=Latitud PointOfEntry.longitude=Longitud PointOfEntry.externalID=ID externa PointOfEntry.archived=Archivado +PointOfEntry.region=Provincia +PointOfEntry.district=Municipio populationDataMaleTotal=Total masculino populationDataFemaleTotal=Total femenino PortHealthInfo=Información de salud portuaria @@ -1849,6 +1862,10 @@ Sample.uuid=Id de la muestra Sample.samplePurpose=Propósito de la muestra Sample.samplingReason=Motivo de muestreo/pruebas Sample.samplingReasonDetails=Detalles del motivo de muestreo +Sample.region=Provincia +Sample.district=Municipio +Sample.community=Área de salud +# Sample Export SampleExport.additionalTestingRequested=¿Se solicitaron pruebas adicionales? SampleExport.personAddressCaption=Dirección de caso/contacto/participante del evento SampleExport.personAge=Edad de caso/contacto/participante del evento @@ -1954,6 +1971,9 @@ Immunization.responsibleRegion=Provincia responsable Immunization.responsibleDistrict=Municipio responsable Immunization.responsibleCommunity=Área de salud responsable Immunization.immunizationPeriod=Período de inmunización +Immunization.region=Provincia +Immunization.district=Municipio +Immunization.community=Área de salud immunizationImmunizationsList=Lista de inmunizaciones linkImmunizationToCaseButton=Vincular caso openLinkedCaseToImmunizationButton=Abrir caso @@ -2207,6 +2227,8 @@ Task.taskType=Tipo de tarea Task.taskAssignee=Encargado de tarea Task.taskPriority=Prioridad de tarea Task.travelEntry=Entrada de viaje +Task.region=Provincia +Task.district=Municipio # TestReport TestReport=Informe de prueba TestReport.testDateTime=Fecha y hora del resultado @@ -2246,6 +2268,7 @@ TravelEntry.responsibleRegion=Provincia responsable TravelEntry.responsibleDistrict=Municipio responsable TravelEntry.responsibleCommunity=Área de salud responsable TravelEntry.differentPointOfEntryJurisdiction=La jurisdicción del punto de entrada difiere de la jurisdicción responsable +TravelEntry.pointOfEntry=Punto de entrada TravelEntry.pointOfEntryRegion=Provincia TravelEntry.pointOfEntryDistrict=Municipio TravelEntry.pointOfEntryDetails=Detalles del punto de entrada @@ -2311,6 +2334,9 @@ User.userName=Nombre de usuario User.userRoles=Roles de usuario User.address=Dirección User.uuid=UUID +User.region=Provincia +User.district=Municipio +User.community=Área de salud # Vaccination vaccinationNewVaccination=Nueva vacunación vaccinationNoVaccinationsForPerson=No hay vacunaciones para esta persona @@ -2458,6 +2484,9 @@ WeeklyReportEntry.numberOfCases=Casos reportados # WeeklyReportInformantSummary WeeklyReportInformantSummary.informantReportDate=Envío de informe del informante WeeklyReportInformantSummary.totalCaseCount=Casos reportados por informante +WeeklyReportInformantSummary.informant=Informante +WeeklyReportInformantSummary.community=Área de salud +WeeklyReportInformantSummary.facility=Centro # WeeklyReportOfficerSummary WeeklyReportOfficerSummary.informants=Número de informantes WeeklyReportOfficerSummary.informantReports=Número de informes de informantes @@ -2466,6 +2495,7 @@ WeeklyReportOfficerSummary.informantZeroReports=Número de informes cero de info WeeklyReportOfficerSummary.officer=Funcionario WeeklyReportOfficerSummary.officerReportDate=Envío de informe de funcionario WeeklyReportOfficerSummary.totalCaseCount=Casos reportados por funcionario +WeeklyReportOfficerSummary.district=Municipio # WeeklyReportRegionSummary WeeklyReportRegionSummary.informants=Número de informantes WeeklyReportRegionSummary.informantReports=Número de informes de informantes @@ -2475,6 +2505,7 @@ WeeklyReportRegionSummary.officers=Número de funcionarios WeeklyReportRegionSummary.officerReports=Número de informes de funcionarios WeeklyReportRegionSummary.officerReportPercentage=Porcentaje WeeklyReportRegionSummary.officerZeroReports=Número de informes cero de funcionarios +WeeklyReportRegionSummary.region=Provincia # SORMAS to SORMAS SormasToSormasOptions.organization=Organización SormasToSormasOptions.withAssociatedContacts=Compartir contactos asociados diff --git a/sormas-api/src/main/resources/captions_es-EC.properties b/sormas-api/src/main/resources/captions_es-EC.properties index fda42a04a37..fb52bfb7c00 100644 --- a/sormas-api/src/main/resources/captions_es-EC.properties +++ b/sormas-api/src/main/resources/captions_es-EC.properties @@ -67,6 +67,7 @@ aboutAdditionalInfo=Additional Info aboutCopyright=Copyright aboutDocuments=Documents aboutVersion=Version +versionIsMissing=Version is missing aboutBrandedSormasVersion=%s powered by SORMAS aboutCaseClassificationRules=Reglas de clasificación de casos (HTML) aboutChangelog=Registros de cambios completos @@ -362,6 +363,7 @@ caseCreateNew=Create new case caseDataEnterHomeAddressNow=Enter home address of the case person now caseCancelDeletion=Cancel case deletion CaseData=Caso +CaseData.ageAndBirthDate=Age and birth date CaseData.additionalDetails=Comentario General CaseData.caseClassification=Clasificación de casos CaseData.caseIdentificationSource=Case identification source @@ -622,6 +624,8 @@ columnVaccineManufacturer=Vaccine manufacturer Community=Community Community.archived=Archived Community.externalID=Id Externo +Community.region=Region +Community.district=District communityActiveCommunities=Comunidades activas communityArchivedCommunities=Comunidades archivadas communityAllCommunities=Todas las comunidades @@ -677,6 +681,7 @@ contactNumberOfDuplicatesDetected=%d potential duplicates detected contactFilterWithDifferentRegion=Show duplicates with differing regions Contact=Contacto Contact.additionalDetails=Comentario General +Contact.ageAndBirthDate=Age and birth date Contact.caseClassification=Clasificación de casos de origen Contact.caze=Caso origen Contact.caze.ageSex=Edad, sexo @@ -688,6 +693,7 @@ Contact.cazeDisease=Enfermedad del caso origen Contact.cazeDiseaseVariant=Disease variant of source case Contact.cazeDistrict=Distrito del caso origen Contact.community=Responsible community +Contact.completeness=Completeness Contact.contactClassification=Clasificación de contacto Contact.contactOfficer=Oficial de contacto responsable Contact.contactOfficerUuid=Oficial de contacto responsable @@ -992,6 +998,7 @@ District.epidCode=Código epidemiológico District.growthRate=Tasa de crecimiento District.population=Población District.externalID=Id Externo +District.region=Region epiDataNoSourceContacts=No source contacts have been created for this case EpiData=Datos epidemiológicos EpiData.areaInfectedAnimals=Residing, working or travelling to an area where infected animals have been confirmed @@ -1142,6 +1149,9 @@ Event.internalToken=Internal Token Event.eventGroups=Groups Event.latestEventGroup=Latest Event Group Event.eventGroupCount=Event Group Count +Event.region=Region +Event.district=District +Event.community=Community # Event action EventAction.eventUuid=Event id EventAction.eventTitle=Event title @@ -1589,6 +1599,7 @@ Person.approximateAge=Edad Person.approximateAgeReferenceDate=Última actualización Person.approximateAgeType=Unidad Person.birthdate=Date of birth (year / month / day) +Person.birthDate=Date of birth (year / month / day) Person.birthdateDD=Day of birth Person.birthdateMM=Month of birth Person.birthdateYYYY=Year of birth @@ -1684,6 +1695,8 @@ PointOfEntry.latitude=Latitud PointOfEntry.longitude=Longitud PointOfEntry.externalID=Id Externo PointOfEntry.archived=Archived +PointOfEntry.region=Region +PointOfEntry.district=District populationDataMaleTotal=Total masculino populationDataFemaleTotal=Total femenino PortHealthInfo=Información sanitaria de puerto @@ -1849,6 +1862,10 @@ Sample.uuid=Id de muestra Sample.samplePurpose=Propósito de la muestra Sample.samplingReason=Reason for sampling/testing Sample.samplingReasonDetails=Sampling reason details +Sample.region=Region +Sample.district=District +Sample.community=Community +# Sample Export SampleExport.additionalTestingRequested=¿Se han solicitado pruebas adicionales? SampleExport.personAddressCaption=Address of case/contact/event participant person SampleExport.personAge=Age of case/contact/event participant person @@ -1954,6 +1971,9 @@ Immunization.responsibleRegion=Responsible region Immunization.responsibleDistrict=Responsible district Immunization.responsibleCommunity=Responsible community Immunization.immunizationPeriod=Immunization period +Immunization.region=Region +Immunization.district=District +Immunization.community=Community immunizationImmunizationsList=Immunizations list linkImmunizationToCaseButton=Link case openLinkedCaseToImmunizationButton=Open case @@ -2207,6 +2227,8 @@ Task.taskType=Tipo de tarea Task.taskAssignee=Task assignee Task.taskPriority=Task priority Task.travelEntry=Travel entry +Task.region=Region +Task.district=District # TestReport TestReport=Test report TestReport.testDateTime=Date and time of result @@ -2246,6 +2268,7 @@ TravelEntry.responsibleRegion=Responsible region TravelEntry.responsibleDistrict=Responsible district TravelEntry.responsibleCommunity=Responsible community TravelEntry.differentPointOfEntryJurisdiction=Point of entry jurisdiction differs from responsible jurisdiction +TravelEntry.pointOfEntry=Point of entry TravelEntry.pointOfEntryRegion=Region TravelEntry.pointOfEntryDistrict=District TravelEntry.pointOfEntryDetails=Point of entry details @@ -2311,6 +2334,9 @@ User.userName=Nombre de usuario User.userRoles=Roles de usuario User.address=Address User.uuid=UUID +User.region=Region +User.district=District +User.community=Community # Vaccination vaccinationNewVaccination=New vaccination vaccinationNoVaccinationsForPerson=There are no vaccinations for this person @@ -2458,6 +2484,9 @@ WeeklyReportEntry.numberOfCases=Casos informados # WeeklyReportInformantSummary WeeklyReportInformantSummary.informantReportDate=Presentación de informe de informante WeeklyReportInformantSummary.totalCaseCount=Casos reportados por informante +WeeklyReportInformantSummary.informant=Informant +WeeklyReportInformantSummary.community=Community +WeeklyReportInformantSummary.facility=Facility # WeeklyReportOfficerSummary WeeklyReportOfficerSummary.informants=Número de informantes WeeklyReportOfficerSummary.informantReports=Número de informes de informantes @@ -2466,6 +2495,7 @@ WeeklyReportOfficerSummary.informantZeroReports=Número de informantes sin infor WeeklyReportOfficerSummary.officer=Officer WeeklyReportOfficerSummary.officerReportDate=Presentación de informe de Oficial WeeklyReportOfficerSummary.totalCaseCount=Casos reportados por Oficial +WeeklyReportOfficerSummary.district=District # WeeklyReportRegionSummary WeeklyReportRegionSummary.informants=Número de informantes WeeklyReportRegionSummary.informantReports=Número de informes del informante @@ -2475,6 +2505,7 @@ WeeklyReportRegionSummary.officers=Número de Oficiales WeeklyReportRegionSummary.officerReports=Número de informes oficiales WeeklyReportRegionSummary.officerReportPercentage=Porcentaje WeeklyReportRegionSummary.officerZeroReports=Número de Oficiales sin informes +WeeklyReportRegionSummary.region=Region # SORMAS to SORMAS SormasToSormasOptions.organization=Organization SormasToSormasOptions.withAssociatedContacts=Share associated contacts diff --git a/sormas-api/src/main/resources/captions_es-ES.properties b/sormas-api/src/main/resources/captions_es-ES.properties index 1b876fb2e67..9fcb51b560c 100644 --- a/sormas-api/src/main/resources/captions_es-ES.properties +++ b/sormas-api/src/main/resources/captions_es-ES.properties @@ -67,6 +67,7 @@ aboutAdditionalInfo=Additional Info aboutCopyright=Copyright aboutDocuments=Documents aboutVersion=Version +versionIsMissing=Version is missing aboutBrandedSormasVersion=%s powered by SORMAS aboutCaseClassificationRules=Case Classification Rules (HTML) aboutChangelog=Full Changelog @@ -362,6 +363,7 @@ caseCreateNew=Create new case caseDataEnterHomeAddressNow=Enter home address of the case person now caseCancelDeletion=Cancel case deletion CaseData=Case +CaseData.ageAndBirthDate=Age and birth date CaseData.additionalDetails=General comment CaseData.caseClassification=Case classification CaseData.caseIdentificationSource=Case identification source @@ -622,6 +624,8 @@ columnVaccineManufacturer=Vaccine manufacturer Community=Community Community.archived=Archived Community.externalID=External ID +Community.region=Region +Community.district=District communityActiveCommunities=Active communities communityArchivedCommunities=Archived communities communityAllCommunities=All communities @@ -677,6 +681,7 @@ contactNumberOfDuplicatesDetected=%d potential duplicates detected contactFilterWithDifferentRegion=Show duplicates with differing regions Contact=Contact Contact.additionalDetails=General comment +Contact.ageAndBirthDate=Age and birth date Contact.caseClassification=Classification of the source case Contact.caze=Source case Contact.caze.ageSex=Age, sex @@ -688,6 +693,7 @@ Contact.cazeDisease=Disease of source case Contact.cazeDiseaseVariant=Disease variant of source case Contact.cazeDistrict=District of source case Contact.community=Responsible community +Contact.completeness=Completeness Contact.contactClassification=Contact classification Contact.contactOfficer=Responsible contact officer Contact.contactOfficerUuid=Responsible contact officer @@ -992,6 +998,7 @@ District.epidCode=Epid code District.growthRate=Growth rate District.population=Population District.externalID=External ID +District.region=Region epiDataNoSourceContacts=No source contacts have been created for this case EpiData=Epidemiological data EpiData.areaInfectedAnimals=Residing, working or travelling to an area where infected animals have been confirmed @@ -1142,6 +1149,9 @@ Event.internalToken=Internal Token Event.eventGroups=Groups Event.latestEventGroup=Latest Event Group Event.eventGroupCount=Event Group Count +Event.region=Region +Event.district=District +Event.community=Community # Event action EventAction.eventUuid=Event id EventAction.eventTitle=Event title @@ -1589,6 +1599,7 @@ Person.approximateAge=Age Person.approximateAgeReferenceDate=Last updated Person.approximateAgeType=Unit Person.birthdate=Date of birth (year / month / day) +Person.birthDate=Date of birth (year / month / day) Person.birthdateDD=Day of birth Person.birthdateMM=Month of birth Person.birthdateYYYY=Year of birth @@ -1684,6 +1695,8 @@ PointOfEntry.latitude=Latitude PointOfEntry.longitude=Longitude PointOfEntry.externalID=External ID PointOfEntry.archived=Archived +PointOfEntry.region=Region +PointOfEntry.district=District populationDataMaleTotal=Male total populationDataFemaleTotal=Female total PortHealthInfo=Port health information @@ -1849,6 +1862,10 @@ Sample.uuid=Sample ID Sample.samplePurpose=Purpose of the Sample Sample.samplingReason=Reason for sampling/testing Sample.samplingReasonDetails=Sampling reason details +Sample.region=Region +Sample.district=District +Sample.community=Community +# Sample Export SampleExport.additionalTestingRequested=Have additional tests been requested? SampleExport.personAddressCaption=Address of case/contact/event participant person SampleExport.personAge=Age of case/contact/event participant person @@ -1954,6 +1971,9 @@ Immunization.responsibleRegion=Responsible region Immunization.responsibleDistrict=Responsible district Immunization.responsibleCommunity=Responsible community Immunization.immunizationPeriod=Immunization period +Immunization.region=Region +Immunization.district=District +Immunization.community=Community immunizationImmunizationsList=Immunizations list linkImmunizationToCaseButton=Link case openLinkedCaseToImmunizationButton=Open case @@ -2207,6 +2227,8 @@ Task.taskType=Task type Task.taskAssignee=Task assignee Task.taskPriority=Task priority Task.travelEntry=Travel entry +Task.region=Region +Task.district=District # TestReport TestReport=Test report TestReport.testDateTime=Date and time of result @@ -2246,6 +2268,7 @@ TravelEntry.responsibleRegion=Responsible region TravelEntry.responsibleDistrict=Responsible district TravelEntry.responsibleCommunity=Responsible community TravelEntry.differentPointOfEntryJurisdiction=Point of entry jurisdiction differs from responsible jurisdiction +TravelEntry.pointOfEntry=Point of entry TravelEntry.pointOfEntryRegion=Region TravelEntry.pointOfEntryDistrict=District TravelEntry.pointOfEntryDetails=Point of entry details @@ -2311,6 +2334,9 @@ User.userName=User name User.userRoles=User roles User.address=Address User.uuid=UUID +User.region=Region +User.district=District +User.community=Community # Vaccination vaccinationNewVaccination=New vaccination vaccinationNoVaccinationsForPerson=There are no vaccinations for this person @@ -2458,6 +2484,9 @@ WeeklyReportEntry.numberOfCases=Cases reported # WeeklyReportInformantSummary WeeklyReportInformantSummary.informantReportDate=Informant report submission WeeklyReportInformantSummary.totalCaseCount=Cases reported by informant +WeeklyReportInformantSummary.informant=Informant +WeeklyReportInformantSummary.community=Community +WeeklyReportInformantSummary.facility=Facility # WeeklyReportOfficerSummary WeeklyReportOfficerSummary.informants=Number of informants WeeklyReportOfficerSummary.informantReports=Number of informant reports @@ -2466,6 +2495,7 @@ WeeklyReportOfficerSummary.informantZeroReports=Number of informant zero reports WeeklyReportOfficerSummary.officer=Officer WeeklyReportOfficerSummary.officerReportDate=Officer report submission WeeklyReportOfficerSummary.totalCaseCount=Cases reported by officer +WeeklyReportOfficerSummary.district=District # WeeklyReportRegionSummary WeeklyReportRegionSummary.informants=Number of informants WeeklyReportRegionSummary.informantReports=Number of informant reports @@ -2475,6 +2505,7 @@ WeeklyReportRegionSummary.officers=Number of officers WeeklyReportRegionSummary.officerReports=Number of officers reports WeeklyReportRegionSummary.officerReportPercentage=Percentage WeeklyReportRegionSummary.officerZeroReports=Number of officer zero reports +WeeklyReportRegionSummary.region=Region # SORMAS to SORMAS SormasToSormasOptions.organization=Organization SormasToSormasOptions.withAssociatedContacts=Share associated contacts diff --git a/sormas-api/src/main/resources/captions_fa-AF.properties b/sormas-api/src/main/resources/captions_fa-AF.properties index 5be4f0417fa..57c400734bf 100644 --- a/sormas-api/src/main/resources/captions_fa-AF.properties +++ b/sormas-api/src/main/resources/captions_fa-AF.properties @@ -67,6 +67,7 @@ aboutAdditionalInfo=Additional Info aboutCopyright=Copyright aboutDocuments=اسناد ها aboutVersion=Version +versionIsMissing=Version is missing aboutBrandedSormasVersion=%s powered by SORMAS aboutCaseClassificationRules=قوانین تاریخ تقسیم بندی واقعه aboutChangelog=معلومات در مورد تغیر @@ -362,6 +363,7 @@ caseCreateNew=Create new case caseDataEnterHomeAddressNow=Enter home address of the case person now caseCancelDeletion=Cancel case deletion CaseData=Case +CaseData.ageAndBirthDate=Age and birth date CaseData.additionalDetails=General comment CaseData.caseClassification=Case classification CaseData.caseIdentificationSource=Case identification source @@ -622,6 +624,8 @@ columnVaccineManufacturer=Vaccine manufacturer Community=Community Community.archived=ارشیف شده Community.externalID=شناسنامه بیرونی +Community.region=Region +Community.district=District communityActiveCommunities=اجتماعات فعال communityArchivedCommunities=اجتماعات ارشیف شده communityAllCommunities=همه اجتماعات @@ -677,6 +681,7 @@ contactNumberOfDuplicatesDetected=%d potential duplicates detected contactFilterWithDifferentRegion=Show duplicates with differing regions Contact=Contact Contact.additionalDetails=General comment +Contact.ageAndBirthDate=Age and birth date Contact.caseClassification=Classification of the source case Contact.caze=Source case Contact.caze.ageSex=Age, sex @@ -688,6 +693,7 @@ Contact.cazeDisease=Disease of source case Contact.cazeDiseaseVariant=Disease variant of source case Contact.cazeDistrict=District of source case Contact.community=Responsible community +Contact.completeness=Completeness Contact.contactClassification=Contact classification Contact.contactOfficer=Responsible contact officer Contact.contactOfficerUuid=Responsible contact officer @@ -992,6 +998,7 @@ District.epidCode=ای پی کود District.growthRate=اندازه نشونمو District.population=نفوس District.externalID=شناسنامه بیرونی +District.region=Region epiDataNoSourceContacts=No source contacts have been created for this case EpiData=Epidemiological data EpiData.areaInfectedAnimals=Residing, working or travelling to an area where infected animals have been confirmed @@ -1142,6 +1149,9 @@ Event.internalToken=Internal Token Event.eventGroups=Groups Event.latestEventGroup=Latest Event Group Event.eventGroupCount=Event Group Count +Event.region=Region +Event.district=District +Event.community=Community # Event action EventAction.eventUuid=Event id EventAction.eventTitle=Event title @@ -1589,6 +1599,7 @@ Person.approximateAge=Age Person.approximateAgeReferenceDate=Last updated Person.approximateAgeType=Unit Person.birthdate=Date of birth (year / month / day) +Person.birthDate=Date of birth (year / month / day) Person.birthdateDD=Day of birth Person.birthdateMM=Month of birth Person.birthdateYYYY=Year of birth @@ -1684,6 +1695,8 @@ PointOfEntry.latitude=Latitude PointOfEntry.longitude=Longitude PointOfEntry.externalID=External ID PointOfEntry.archived=Archived +PointOfEntry.region=Region +PointOfEntry.district=District populationDataMaleTotal=Male total populationDataFemaleTotal=Female total PortHealthInfo=Port health information @@ -1849,6 +1862,10 @@ Sample.uuid=Sample ID Sample.samplePurpose=Purpose of the Sample Sample.samplingReason=Reason for sampling/testing Sample.samplingReasonDetails=Sampling reason details +Sample.region=Region +Sample.district=District +Sample.community=Community +# Sample Export SampleExport.additionalTestingRequested=Have additional tests been requested? SampleExport.personAddressCaption=Address of case/contact/event participant person SampleExport.personAge=Age of case/contact/event participant person @@ -1954,6 +1971,9 @@ Immunization.responsibleRegion=Responsible region Immunization.responsibleDistrict=Responsible district Immunization.responsibleCommunity=Responsible community Immunization.immunizationPeriod=Immunization period +Immunization.region=Region +Immunization.district=District +Immunization.community=Community immunizationImmunizationsList=Immunizations list linkImmunizationToCaseButton=Link case openLinkedCaseToImmunizationButton=Open case @@ -2207,6 +2227,8 @@ Task.taskType=Task type Task.taskAssignee=Task assignee Task.taskPriority=Task priority Task.travelEntry=Travel entry +Task.region=Region +Task.district=District # TestReport TestReport=Test report TestReport.testDateTime=Date and time of result @@ -2246,6 +2268,7 @@ TravelEntry.responsibleRegion=Responsible region TravelEntry.responsibleDistrict=Responsible district TravelEntry.responsibleCommunity=Responsible community TravelEntry.differentPointOfEntryJurisdiction=Point of entry jurisdiction differs from responsible jurisdiction +TravelEntry.pointOfEntry=Point of entry TravelEntry.pointOfEntryRegion=Region TravelEntry.pointOfEntryDistrict=District TravelEntry.pointOfEntryDetails=Point of entry details @@ -2311,6 +2334,9 @@ User.userName=نام شخص استعمال کننده User.userRoles=رول شخص استعمال کننده User.address=ادرس User.uuid=UUID +User.region=Region +User.district=District +User.community=Community # Vaccination vaccinationNewVaccination=New vaccination vaccinationNoVaccinationsForPerson=There are no vaccinations for this person @@ -2458,6 +2484,9 @@ WeeklyReportEntry.numberOfCases=Cases reported # WeeklyReportInformantSummary WeeklyReportInformantSummary.informantReportDate=Informant report submission WeeklyReportInformantSummary.totalCaseCount=Cases reported by informant +WeeklyReportInformantSummary.informant=Informant +WeeklyReportInformantSummary.community=Community +WeeklyReportInformantSummary.facility=Facility # WeeklyReportOfficerSummary WeeklyReportOfficerSummary.informants=Number of informants WeeklyReportOfficerSummary.informantReports=Number of informant reports @@ -2466,6 +2495,7 @@ WeeklyReportOfficerSummary.informantZeroReports=Number of informant zero reports WeeklyReportOfficerSummary.officer=Officer WeeklyReportOfficerSummary.officerReportDate=Officer report submission WeeklyReportOfficerSummary.totalCaseCount=Cases reported by officer +WeeklyReportOfficerSummary.district=District # WeeklyReportRegionSummary WeeklyReportRegionSummary.informants=Number of informants WeeklyReportRegionSummary.informantReports=Number of informant reports @@ -2475,6 +2505,7 @@ WeeklyReportRegionSummary.officers=Number of officers WeeklyReportRegionSummary.officerReports=Number of officers reports WeeklyReportRegionSummary.officerReportPercentage=Percentage WeeklyReportRegionSummary.officerZeroReports=Number of officer zero reports +WeeklyReportRegionSummary.region=Region # SORMAS to SORMAS SormasToSormasOptions.organization=Organization SormasToSormasOptions.withAssociatedContacts=Share associated contacts diff --git a/sormas-api/src/main/resources/captions_fi-FI.properties b/sormas-api/src/main/resources/captions_fi-FI.properties index d639a87bd70..b1bf5fbabdf 100644 --- a/sormas-api/src/main/resources/captions_fi-FI.properties +++ b/sormas-api/src/main/resources/captions_fi-FI.properties @@ -67,6 +67,7 @@ aboutAdditionalInfo=Additional Info aboutCopyright=Copyright aboutDocuments=Documents aboutVersion=Version +versionIsMissing=Version is missing aboutBrandedSormasVersion=%s powered by SORMAS aboutCaseClassificationRules=Potilasluokittelun säännöt (HTML) aboutChangelog=Koko muutosloki @@ -362,6 +363,7 @@ caseCreateNew=Create new case caseDataEnterHomeAddressNow=Enter home address of the case person now caseCancelDeletion=Cancel case deletion CaseData=Potilas +CaseData.ageAndBirthDate=Age and birth date CaseData.additionalDetails=Yleinen kommentti CaseData.caseClassification=Potilaan luokitus CaseData.caseIdentificationSource=Case identification source @@ -622,6 +624,8 @@ columnVaccineManufacturer=Vaccine manufacturer Community=Community Community.archived=Archived Community.externalID=Ulkoinen tunniste +Community.region=Region +Community.district=District communityActiveCommunities=Aktiiviset kunnat communityArchivedCommunities=Arkistoidut kunnat communityAllCommunities=Kaikki kunnat @@ -677,6 +681,7 @@ contactNumberOfDuplicatesDetected=%d potential duplicates detected contactFilterWithDifferentRegion=Show duplicates with differing regions Contact=Kontakti Contact.additionalDetails=Yleinen kommentti +Contact.ageAndBirthDate=Age and birth date Contact.caseClassification=Tartuttaneen potilaan luokitus Contact.caze=Tartuttanut potilas Contact.caze.ageSex=Ikä, sukupuoli @@ -688,6 +693,7 @@ Contact.cazeDisease=Tartuttaneen potilaan sairaus Contact.cazeDiseaseVariant=Disease variant of source case Contact.cazeDistrict=Tartuttaneen potilaan sairaanhoitopiiri Contact.community=Responsible community +Contact.completeness=Completeness Contact.contactClassification=Kontaktin luokittelu Contact.contactOfficer=Vastuullinen kontaktivirkailija Contact.contactOfficerUuid=Vastuullinen kontaktivirkailija @@ -992,6 +998,7 @@ District.epidCode=Epidemian tunnus District.growthRate=Kasvunopeus District.population=Väestö District.externalID=Ulkoinen tunniste +District.region=Region epiDataNoSourceContacts=No source contacts have been created for this case EpiData=Epidemiologiset tiedot EpiData.areaInfectedAnimals=Residing, working or travelling to an area where infected animals have been confirmed @@ -1142,6 +1149,9 @@ Event.internalToken=Internal Token Event.eventGroups=Groups Event.latestEventGroup=Latest Event Group Event.eventGroupCount=Event Group Count +Event.region=Region +Event.district=District +Event.community=Community # Event action EventAction.eventUuid=Event id EventAction.eventTitle=Event title @@ -1589,6 +1599,7 @@ Person.approximateAge=Ikä Person.approximateAgeReferenceDate=Viimeksi päivitetty Person.approximateAgeType=Yksikkö Person.birthdate=Date of birth (year / month / day) +Person.birthDate=Date of birth (year / month / day) Person.birthdateDD=Day of birth Person.birthdateMM=Month of birth Person.birthdateYYYY=Year of birth @@ -1684,6 +1695,8 @@ PointOfEntry.latitude=Leveyspiiri PointOfEntry.longitude=Pituuspiiri PointOfEntry.externalID=Ulkoinen tunniste PointOfEntry.archived=Archived +PointOfEntry.region=Region +PointOfEntry.district=District populationDataMaleTotal=Miehiä yhteensä populationDataFemaleTotal=Naisia yhteensä PortHealthInfo=Maahantulotiedot @@ -1849,6 +1862,10 @@ Sample.uuid=Näytteen ID Sample.samplePurpose=Näytteen tarkoitus Sample.samplingReason=Reason for sampling/testing Sample.samplingReasonDetails=Sampling reason details +Sample.region=Region +Sample.district=District +Sample.community=Community +# Sample Export SampleExport.additionalTestingRequested=Onko lisätestejä pyydetty? SampleExport.personAddressCaption=Address of case/contact/event participant person SampleExport.personAge=Age of case/contact/event participant person @@ -1954,6 +1971,9 @@ Immunization.responsibleRegion=Responsible region Immunization.responsibleDistrict=Responsible district Immunization.responsibleCommunity=Responsible community Immunization.immunizationPeriod=Immunization period +Immunization.region=Region +Immunization.district=District +Immunization.community=Community immunizationImmunizationsList=Immunizations list linkImmunizationToCaseButton=Link case openLinkedCaseToImmunizationButton=Open case @@ -2207,6 +2227,8 @@ Task.taskType=Tehtävätyyppi Task.taskAssignee=Task assignee Task.taskPriority=Task priority Task.travelEntry=Travel entry +Task.region=Region +Task.district=District # TestReport TestReport=Test report TestReport.testDateTime=Date and time of result @@ -2246,6 +2268,7 @@ TravelEntry.responsibleRegion=Responsible region TravelEntry.responsibleDistrict=Responsible district TravelEntry.responsibleCommunity=Responsible community TravelEntry.differentPointOfEntryJurisdiction=Point of entry jurisdiction differs from responsible jurisdiction +TravelEntry.pointOfEntry=Point of entry TravelEntry.pointOfEntryRegion=Region TravelEntry.pointOfEntryDistrict=District TravelEntry.pointOfEntryDetails=Point of entry details @@ -2311,6 +2334,9 @@ User.userName=Käyttäjätunnus User.userRoles=Käyttäjäroolit User.address=Address User.uuid=UUID +User.region=Region +User.district=District +User.community=Community # Vaccination vaccinationNewVaccination=New vaccination vaccinationNoVaccinationsForPerson=There are no vaccinations for this person @@ -2458,6 +2484,9 @@ WeeklyReportEntry.numberOfCases=Raportoidut potilaat # WeeklyReportInformantSummary WeeklyReportInformantSummary.informantReportDate=Tietolähteen raportin lähettäminen WeeklyReportInformantSummary.totalCaseCount=Tietolähteen raportoimat potilaat +WeeklyReportInformantSummary.informant=Informant +WeeklyReportInformantSummary.community=Community +WeeklyReportInformantSummary.facility=Facility # WeeklyReportOfficerSummary WeeklyReportOfficerSummary.informants=Tietolähteiden lukumäärä WeeklyReportOfficerSummary.informantReports=Tietolähteiden raporttien lukumäärä @@ -2466,6 +2495,7 @@ WeeklyReportOfficerSummary.informantZeroReports=Tietolähteiden nollaraporttien WeeklyReportOfficerSummary.officer=Virkailija WeeklyReportOfficerSummary.officerReportDate=Virkailijan raportin lähteminen WeeklyReportOfficerSummary.totalCaseCount=Virkailijan raportoimat potilaat +WeeklyReportOfficerSummary.district=District # WeeklyReportRegionSummary WeeklyReportRegionSummary.informants=Tietolähteiden lukumäärä WeeklyReportRegionSummary.informantReports=Tietolähteiden raporttien lukumäärä @@ -2475,6 +2505,7 @@ WeeklyReportRegionSummary.officers=Virkailijoiden lukumäärä WeeklyReportRegionSummary.officerReports=Virkailijoiden raporttien lukumäärä WeeklyReportRegionSummary.officerReportPercentage=Prosenttiosuus WeeklyReportRegionSummary.officerZeroReports=Virkailijoiden nollaraporttien lukumäärä +WeeklyReportRegionSummary.region=Region # SORMAS to SORMAS SormasToSormasOptions.organization=Organization SormasToSormasOptions.withAssociatedContacts=Share associated contacts diff --git a/sormas-api/src/main/resources/captions_fil-PH.properties b/sormas-api/src/main/resources/captions_fil-PH.properties index 1b876fb2e67..9fcb51b560c 100644 --- a/sormas-api/src/main/resources/captions_fil-PH.properties +++ b/sormas-api/src/main/resources/captions_fil-PH.properties @@ -67,6 +67,7 @@ aboutAdditionalInfo=Additional Info aboutCopyright=Copyright aboutDocuments=Documents aboutVersion=Version +versionIsMissing=Version is missing aboutBrandedSormasVersion=%s powered by SORMAS aboutCaseClassificationRules=Case Classification Rules (HTML) aboutChangelog=Full Changelog @@ -362,6 +363,7 @@ caseCreateNew=Create new case caseDataEnterHomeAddressNow=Enter home address of the case person now caseCancelDeletion=Cancel case deletion CaseData=Case +CaseData.ageAndBirthDate=Age and birth date CaseData.additionalDetails=General comment CaseData.caseClassification=Case classification CaseData.caseIdentificationSource=Case identification source @@ -622,6 +624,8 @@ columnVaccineManufacturer=Vaccine manufacturer Community=Community Community.archived=Archived Community.externalID=External ID +Community.region=Region +Community.district=District communityActiveCommunities=Active communities communityArchivedCommunities=Archived communities communityAllCommunities=All communities @@ -677,6 +681,7 @@ contactNumberOfDuplicatesDetected=%d potential duplicates detected contactFilterWithDifferentRegion=Show duplicates with differing regions Contact=Contact Contact.additionalDetails=General comment +Contact.ageAndBirthDate=Age and birth date Contact.caseClassification=Classification of the source case Contact.caze=Source case Contact.caze.ageSex=Age, sex @@ -688,6 +693,7 @@ Contact.cazeDisease=Disease of source case Contact.cazeDiseaseVariant=Disease variant of source case Contact.cazeDistrict=District of source case Contact.community=Responsible community +Contact.completeness=Completeness Contact.contactClassification=Contact classification Contact.contactOfficer=Responsible contact officer Contact.contactOfficerUuid=Responsible contact officer @@ -992,6 +998,7 @@ District.epidCode=Epid code District.growthRate=Growth rate District.population=Population District.externalID=External ID +District.region=Region epiDataNoSourceContacts=No source contacts have been created for this case EpiData=Epidemiological data EpiData.areaInfectedAnimals=Residing, working or travelling to an area where infected animals have been confirmed @@ -1142,6 +1149,9 @@ Event.internalToken=Internal Token Event.eventGroups=Groups Event.latestEventGroup=Latest Event Group Event.eventGroupCount=Event Group Count +Event.region=Region +Event.district=District +Event.community=Community # Event action EventAction.eventUuid=Event id EventAction.eventTitle=Event title @@ -1589,6 +1599,7 @@ Person.approximateAge=Age Person.approximateAgeReferenceDate=Last updated Person.approximateAgeType=Unit Person.birthdate=Date of birth (year / month / day) +Person.birthDate=Date of birth (year / month / day) Person.birthdateDD=Day of birth Person.birthdateMM=Month of birth Person.birthdateYYYY=Year of birth @@ -1684,6 +1695,8 @@ PointOfEntry.latitude=Latitude PointOfEntry.longitude=Longitude PointOfEntry.externalID=External ID PointOfEntry.archived=Archived +PointOfEntry.region=Region +PointOfEntry.district=District populationDataMaleTotal=Male total populationDataFemaleTotal=Female total PortHealthInfo=Port health information @@ -1849,6 +1862,10 @@ Sample.uuid=Sample ID Sample.samplePurpose=Purpose of the Sample Sample.samplingReason=Reason for sampling/testing Sample.samplingReasonDetails=Sampling reason details +Sample.region=Region +Sample.district=District +Sample.community=Community +# Sample Export SampleExport.additionalTestingRequested=Have additional tests been requested? SampleExport.personAddressCaption=Address of case/contact/event participant person SampleExport.personAge=Age of case/contact/event participant person @@ -1954,6 +1971,9 @@ Immunization.responsibleRegion=Responsible region Immunization.responsibleDistrict=Responsible district Immunization.responsibleCommunity=Responsible community Immunization.immunizationPeriod=Immunization period +Immunization.region=Region +Immunization.district=District +Immunization.community=Community immunizationImmunizationsList=Immunizations list linkImmunizationToCaseButton=Link case openLinkedCaseToImmunizationButton=Open case @@ -2207,6 +2227,8 @@ Task.taskType=Task type Task.taskAssignee=Task assignee Task.taskPriority=Task priority Task.travelEntry=Travel entry +Task.region=Region +Task.district=District # TestReport TestReport=Test report TestReport.testDateTime=Date and time of result @@ -2246,6 +2268,7 @@ TravelEntry.responsibleRegion=Responsible region TravelEntry.responsibleDistrict=Responsible district TravelEntry.responsibleCommunity=Responsible community TravelEntry.differentPointOfEntryJurisdiction=Point of entry jurisdiction differs from responsible jurisdiction +TravelEntry.pointOfEntry=Point of entry TravelEntry.pointOfEntryRegion=Region TravelEntry.pointOfEntryDistrict=District TravelEntry.pointOfEntryDetails=Point of entry details @@ -2311,6 +2334,9 @@ User.userName=User name User.userRoles=User roles User.address=Address User.uuid=UUID +User.region=Region +User.district=District +User.community=Community # Vaccination vaccinationNewVaccination=New vaccination vaccinationNoVaccinationsForPerson=There are no vaccinations for this person @@ -2458,6 +2484,9 @@ WeeklyReportEntry.numberOfCases=Cases reported # WeeklyReportInformantSummary WeeklyReportInformantSummary.informantReportDate=Informant report submission WeeklyReportInformantSummary.totalCaseCount=Cases reported by informant +WeeklyReportInformantSummary.informant=Informant +WeeklyReportInformantSummary.community=Community +WeeklyReportInformantSummary.facility=Facility # WeeklyReportOfficerSummary WeeklyReportOfficerSummary.informants=Number of informants WeeklyReportOfficerSummary.informantReports=Number of informant reports @@ -2466,6 +2495,7 @@ WeeklyReportOfficerSummary.informantZeroReports=Number of informant zero reports WeeklyReportOfficerSummary.officer=Officer WeeklyReportOfficerSummary.officerReportDate=Officer report submission WeeklyReportOfficerSummary.totalCaseCount=Cases reported by officer +WeeklyReportOfficerSummary.district=District # WeeklyReportRegionSummary WeeklyReportRegionSummary.informants=Number of informants WeeklyReportRegionSummary.informantReports=Number of informant reports @@ -2475,6 +2505,7 @@ WeeklyReportRegionSummary.officers=Number of officers WeeklyReportRegionSummary.officerReports=Number of officers reports WeeklyReportRegionSummary.officerReportPercentage=Percentage WeeklyReportRegionSummary.officerZeroReports=Number of officer zero reports +WeeklyReportRegionSummary.region=Region # SORMAS to SORMAS SormasToSormasOptions.organization=Organization SormasToSormasOptions.withAssociatedContacts=Share associated contacts diff --git a/sormas-api/src/main/resources/captions_fj-FJ.properties b/sormas-api/src/main/resources/captions_fj-FJ.properties index 1b876fb2e67..9fcb51b560c 100644 --- a/sormas-api/src/main/resources/captions_fj-FJ.properties +++ b/sormas-api/src/main/resources/captions_fj-FJ.properties @@ -67,6 +67,7 @@ aboutAdditionalInfo=Additional Info aboutCopyright=Copyright aboutDocuments=Documents aboutVersion=Version +versionIsMissing=Version is missing aboutBrandedSormasVersion=%s powered by SORMAS aboutCaseClassificationRules=Case Classification Rules (HTML) aboutChangelog=Full Changelog @@ -362,6 +363,7 @@ caseCreateNew=Create new case caseDataEnterHomeAddressNow=Enter home address of the case person now caseCancelDeletion=Cancel case deletion CaseData=Case +CaseData.ageAndBirthDate=Age and birth date CaseData.additionalDetails=General comment CaseData.caseClassification=Case classification CaseData.caseIdentificationSource=Case identification source @@ -622,6 +624,8 @@ columnVaccineManufacturer=Vaccine manufacturer Community=Community Community.archived=Archived Community.externalID=External ID +Community.region=Region +Community.district=District communityActiveCommunities=Active communities communityArchivedCommunities=Archived communities communityAllCommunities=All communities @@ -677,6 +681,7 @@ contactNumberOfDuplicatesDetected=%d potential duplicates detected contactFilterWithDifferentRegion=Show duplicates with differing regions Contact=Contact Contact.additionalDetails=General comment +Contact.ageAndBirthDate=Age and birth date Contact.caseClassification=Classification of the source case Contact.caze=Source case Contact.caze.ageSex=Age, sex @@ -688,6 +693,7 @@ Contact.cazeDisease=Disease of source case Contact.cazeDiseaseVariant=Disease variant of source case Contact.cazeDistrict=District of source case Contact.community=Responsible community +Contact.completeness=Completeness Contact.contactClassification=Contact classification Contact.contactOfficer=Responsible contact officer Contact.contactOfficerUuid=Responsible contact officer @@ -992,6 +998,7 @@ District.epidCode=Epid code District.growthRate=Growth rate District.population=Population District.externalID=External ID +District.region=Region epiDataNoSourceContacts=No source contacts have been created for this case EpiData=Epidemiological data EpiData.areaInfectedAnimals=Residing, working or travelling to an area where infected animals have been confirmed @@ -1142,6 +1149,9 @@ Event.internalToken=Internal Token Event.eventGroups=Groups Event.latestEventGroup=Latest Event Group Event.eventGroupCount=Event Group Count +Event.region=Region +Event.district=District +Event.community=Community # Event action EventAction.eventUuid=Event id EventAction.eventTitle=Event title @@ -1589,6 +1599,7 @@ Person.approximateAge=Age Person.approximateAgeReferenceDate=Last updated Person.approximateAgeType=Unit Person.birthdate=Date of birth (year / month / day) +Person.birthDate=Date of birth (year / month / day) Person.birthdateDD=Day of birth Person.birthdateMM=Month of birth Person.birthdateYYYY=Year of birth @@ -1684,6 +1695,8 @@ PointOfEntry.latitude=Latitude PointOfEntry.longitude=Longitude PointOfEntry.externalID=External ID PointOfEntry.archived=Archived +PointOfEntry.region=Region +PointOfEntry.district=District populationDataMaleTotal=Male total populationDataFemaleTotal=Female total PortHealthInfo=Port health information @@ -1849,6 +1862,10 @@ Sample.uuid=Sample ID Sample.samplePurpose=Purpose of the Sample Sample.samplingReason=Reason for sampling/testing Sample.samplingReasonDetails=Sampling reason details +Sample.region=Region +Sample.district=District +Sample.community=Community +# Sample Export SampleExport.additionalTestingRequested=Have additional tests been requested? SampleExport.personAddressCaption=Address of case/contact/event participant person SampleExport.personAge=Age of case/contact/event participant person @@ -1954,6 +1971,9 @@ Immunization.responsibleRegion=Responsible region Immunization.responsibleDistrict=Responsible district Immunization.responsibleCommunity=Responsible community Immunization.immunizationPeriod=Immunization period +Immunization.region=Region +Immunization.district=District +Immunization.community=Community immunizationImmunizationsList=Immunizations list linkImmunizationToCaseButton=Link case openLinkedCaseToImmunizationButton=Open case @@ -2207,6 +2227,8 @@ Task.taskType=Task type Task.taskAssignee=Task assignee Task.taskPriority=Task priority Task.travelEntry=Travel entry +Task.region=Region +Task.district=District # TestReport TestReport=Test report TestReport.testDateTime=Date and time of result @@ -2246,6 +2268,7 @@ TravelEntry.responsibleRegion=Responsible region TravelEntry.responsibleDistrict=Responsible district TravelEntry.responsibleCommunity=Responsible community TravelEntry.differentPointOfEntryJurisdiction=Point of entry jurisdiction differs from responsible jurisdiction +TravelEntry.pointOfEntry=Point of entry TravelEntry.pointOfEntryRegion=Region TravelEntry.pointOfEntryDistrict=District TravelEntry.pointOfEntryDetails=Point of entry details @@ -2311,6 +2334,9 @@ User.userName=User name User.userRoles=User roles User.address=Address User.uuid=UUID +User.region=Region +User.district=District +User.community=Community # Vaccination vaccinationNewVaccination=New vaccination vaccinationNoVaccinationsForPerson=There are no vaccinations for this person @@ -2458,6 +2484,9 @@ WeeklyReportEntry.numberOfCases=Cases reported # WeeklyReportInformantSummary WeeklyReportInformantSummary.informantReportDate=Informant report submission WeeklyReportInformantSummary.totalCaseCount=Cases reported by informant +WeeklyReportInformantSummary.informant=Informant +WeeklyReportInformantSummary.community=Community +WeeklyReportInformantSummary.facility=Facility # WeeklyReportOfficerSummary WeeklyReportOfficerSummary.informants=Number of informants WeeklyReportOfficerSummary.informantReports=Number of informant reports @@ -2466,6 +2495,7 @@ WeeklyReportOfficerSummary.informantZeroReports=Number of informant zero reports WeeklyReportOfficerSummary.officer=Officer WeeklyReportOfficerSummary.officerReportDate=Officer report submission WeeklyReportOfficerSummary.totalCaseCount=Cases reported by officer +WeeklyReportOfficerSummary.district=District # WeeklyReportRegionSummary WeeklyReportRegionSummary.informants=Number of informants WeeklyReportRegionSummary.informantReports=Number of informant reports @@ -2475,6 +2505,7 @@ WeeklyReportRegionSummary.officers=Number of officers WeeklyReportRegionSummary.officerReports=Number of officers reports WeeklyReportRegionSummary.officerReportPercentage=Percentage WeeklyReportRegionSummary.officerZeroReports=Number of officer zero reports +WeeklyReportRegionSummary.region=Region # SORMAS to SORMAS SormasToSormasOptions.organization=Organization SormasToSormasOptions.withAssociatedContacts=Share associated contacts diff --git a/sormas-api/src/main/resources/captions_fr-CH.properties b/sormas-api/src/main/resources/captions_fr-CH.properties index 331924e9d4a..f55273402ca 100644 --- a/sormas-api/src/main/resources/captions_fr-CH.properties +++ b/sormas-api/src/main/resources/captions_fr-CH.properties @@ -67,6 +67,7 @@ aboutAdditionalInfo=Information additionnelle aboutCopyright=Copyright aboutDocuments=Documents aboutVersion=Version +versionIsMissing=Version is missing aboutBrandedSormasVersion=%s produit par SORMAS aboutCaseClassificationRules=Règles de Classification des Cas (HTML) aboutChangelog=Changelog complet @@ -362,6 +363,7 @@ caseCreateNew=Créer un nouveau cas caseDataEnterHomeAddressNow=Enter home address of the case person now caseCancelDeletion=Cancel case deletion CaseData=Cas +CaseData.ageAndBirthDate=Age and birth date CaseData.additionalDetails=Détails supplémentaires CaseData.caseClassification=Classification de cas CaseData.caseIdentificationSource=Source d'identification du cas @@ -622,6 +624,8 @@ columnVaccineManufacturer=Vaccine manufacturer Community=Community Community.archived=Archivé Community.externalID=Identification externe +Community.region=Region +Community.district=District communityActiveCommunities=communes actives communityArchivedCommunities=communes archivées communityAllCommunities=Toutes les communes @@ -677,6 +681,7 @@ contactNumberOfDuplicatesDetected=%d potential duplicates detected contactFilterWithDifferentRegion=Show duplicates with differing regions Contact=Contact Contact.additionalDetails=Commentaire général +Contact.ageAndBirthDate=Age and birth date Contact.caseClassification=Classification du cas source Contact.caze=Cas de source Contact.caze.ageSex=Âge, sexe @@ -688,6 +693,7 @@ Contact.cazeDisease=Maladie du cas de source Contact.cazeDiseaseVariant=Disease variant of source case Contact.cazeDistrict=District du cas de la source Contact.community=Commune responsable +Contact.completeness=Completeness Contact.contactClassification=Classification de contact Contact.contactOfficer=Agent de contact responsable Contact.contactOfficerUuid=Agent de contact responsable @@ -992,6 +998,7 @@ District.epidCode=Code epid District.growthRate=Taux de croissance District.population=Population District.externalID=Identification externe +District.region=Region epiDataNoSourceContacts=No source contacts have been created for this case EpiData=Données épidémiologiques EpiData.areaInfectedAnimals=Residing, working or travelling to an area where infected animals have been confirmed @@ -1142,6 +1149,9 @@ Event.internalToken=Internal Token Event.eventGroups=Groups Event.latestEventGroup=Latest Event Group Event.eventGroupCount=Event Group Count +Event.region=Region +Event.district=District +Event.community=Community # Event action EventAction.eventUuid=Id de l'événement EventAction.eventTitle=Titre de l'événement @@ -1589,6 +1599,7 @@ Person.approximateAge=Age Person.approximateAgeReferenceDate=Dernière mise à jour Person.approximateAgeType=Unité Person.birthdate=Date de naissance (année / mois / jour) +Person.birthDate=Date of birth (year / month / day) Person.birthdateDD=Date de naissance  Person.birthdateMM=Mois de naissance Person.birthdateYYYY=Année de naissance @@ -1684,6 +1695,8 @@ PointOfEntry.latitude=Latitude PointOfEntry.longitude=Longitude PointOfEntry.externalID=Identification externe PointOfEntry.archived=Archived +PointOfEntry.region=Region +PointOfEntry.district=District populationDataMaleTotal=Total masculin populationDataFemaleTotal=Total féminin PortHealthInfo=Information sur la santé du port @@ -1849,6 +1862,10 @@ Sample.uuid=ID d’échantillon Sample.samplePurpose=Objectif de l'échantillon Sample.samplingReason=Reason for sampling/testing Sample.samplingReasonDetails=Sampling reason details +Sample.region=Region +Sample.district=District +Sample.community=Community +# Sample Export SampleExport.additionalTestingRequested=Des tests supplémentaires ont-ils été demandés? SampleExport.personAddressCaption=Adresse de la personne de cas/contact/participant à l'événement SampleExport.personAge=Âge de la personne de cas/contact/participant à l'événement @@ -1954,6 +1971,9 @@ Immunization.responsibleRegion=Responsible region Immunization.responsibleDistrict=Responsible district Immunization.responsibleCommunity=Responsible community Immunization.immunizationPeriod=Immunization period +Immunization.region=Region +Immunization.district=District +Immunization.community=Community immunizationImmunizationsList=Immunizations list linkImmunizationToCaseButton=Link case openLinkedCaseToImmunizationButton=Open case @@ -2207,6 +2227,8 @@ Task.taskType=Type de tâche Task.taskAssignee=Task assignee Task.taskPriority=Task priority Task.travelEntry=Travel entry +Task.region=Region +Task.district=District # TestReport TestReport=Test report TestReport.testDateTime=Date and time of result @@ -2246,6 +2268,7 @@ TravelEntry.responsibleRegion=Responsible region TravelEntry.responsibleDistrict=Responsible district TravelEntry.responsibleCommunity=Responsible community TravelEntry.differentPointOfEntryJurisdiction=Point of entry jurisdiction differs from responsible jurisdiction +TravelEntry.pointOfEntry=Point of entry TravelEntry.pointOfEntryRegion=Region TravelEntry.pointOfEntryDistrict=District TravelEntry.pointOfEntryDetails=Point of entry details @@ -2311,6 +2334,9 @@ User.userName=Nom d’utilisateur User.userRoles=Rôles d’utilisateur User.address=Adresse User.uuid=UUID +User.region=Region +User.district=District +User.community=Community # Vaccination vaccinationNewVaccination=New vaccination vaccinationNoVaccinationsForPerson=There are no vaccinations for this person @@ -2458,6 +2484,9 @@ WeeklyReportEntry.numberOfCases=Cas signalés # WeeklyReportInformantSummary WeeklyReportInformantSummary.informantReportDate=Soumission du rapport d'Informant WeeklyReportInformantSummary.totalCaseCount=Cas signalés par l'informant +WeeklyReportInformantSummary.informant=Informant +WeeklyReportInformantSummary.community=Community +WeeklyReportInformantSummary.facility=Facility # WeeklyReportOfficerSummary WeeklyReportOfficerSummary.informants=Nombre d'informants WeeklyReportOfficerSummary.informantReports=Nombre de rapports d'informant @@ -2466,6 +2495,7 @@ WeeklyReportOfficerSummary.informantZeroReports=Nombre sans rapports d'informant WeeklyReportOfficerSummary.officer=Agent WeeklyReportOfficerSummary.officerReportDate=Soumission du rapport d'argent WeeklyReportOfficerSummary.totalCaseCount=Cas signalés par l’agent +WeeklyReportOfficerSummary.district=District # WeeklyReportRegionSummary WeeklyReportRegionSummary.informants=Nombre d'informants WeeklyReportRegionSummary.informantReports=Nombre de rapports d'informant @@ -2475,6 +2505,7 @@ WeeklyReportRegionSummary.officers=Nombre d’agents WeeklyReportRegionSummary.officerReports=Nombre de rapports d’agents WeeklyReportRegionSummary.officerReportPercentage=Pourcentage WeeklyReportRegionSummary.officerZeroReports=Nombre de rapports zéro d'agent +WeeklyReportRegionSummary.region=Region # SORMAS to SORMAS SormasToSormasOptions.organization=Organization SormasToSormasOptions.withAssociatedContacts=Partager les contacts associés diff --git a/sormas-api/src/main/resources/captions_fr-FR.properties b/sormas-api/src/main/resources/captions_fr-FR.properties index 80dfba1151b..00106163e30 100644 --- a/sormas-api/src/main/resources/captions_fr-FR.properties +++ b/sormas-api/src/main/resources/captions_fr-FR.properties @@ -67,6 +67,7 @@ aboutAdditionalInfo=Information additionnelle aboutCopyright=Copyright aboutDocuments=Documents aboutVersion=Version +versionIsMissing=Version is missing aboutBrandedSormasVersion=%s produit par SORMAS aboutCaseClassificationRules=Règles de Classification des Cas (HTML) aboutChangelog=Changelog complet @@ -362,6 +363,7 @@ caseCreateNew=Créer un nouveau cas caseDataEnterHomeAddressNow=Entrez maintenant l'adresse de la personne concernée à la maison caseCancelDeletion=Annuler la suppression du cas CaseData=Cas +CaseData.ageAndBirthDate=Age and birth date CaseData.additionalDetails=Commentaire général CaseData.caseClassification=Classification du cas CaseData.caseIdentificationSource=Source d'identification du cas @@ -622,6 +624,8 @@ columnVaccineManufacturer=Fabricant du vaccin Community=Community Community.archived=Archivé Community.externalID=ID externe +Community.region=Region +Community.district=District communityActiveCommunities=Communautés actives communityArchivedCommunities=Communautés archivées communityAllCommunities=Toutes les communautés @@ -677,6 +681,7 @@ contactNumberOfDuplicatesDetected=%d doublons potentiels détectés contactFilterWithDifferentRegion=Afficher les doublons avec des régions différentes Contact=Contact Contact.additionalDetails=Commentaire général +Contact.ageAndBirthDate=Age and birth date Contact.caseClassification=Classification du cas source Contact.caze=Cas source Contact.caze.ageSex=Âge, sexe @@ -688,6 +693,7 @@ Contact.cazeDisease=Maladie du cas source Contact.cazeDiseaseVariant=Variante de l'épidémie du cas source Contact.cazeDistrict=Département du cas source Contact.community=Communauté responsable +Contact.completeness=Completeness Contact.contactClassification=Classification du contact Contact.contactOfficer=Agent de contact responsable Contact.contactOfficerUuid=Agent de contact responsable @@ -992,6 +998,7 @@ District.epidCode=Code epid District.growthRate=Taux de croissance District.population=Population District.externalID=ID externe +District.region=Region epiDataNoSourceContacts=Aucun contact source n'a été créé pour ce cas EpiData=Données épidémiologiques EpiData.areaInfectedAnimals=Résidence, travail ou voyage dans une région où les animaux infectés ont été confirmés @@ -1142,6 +1149,9 @@ Event.internalToken=Token interne Event.eventGroups=Groupes Event.latestEventGroup=Dernier groupe d'évènement Event.eventGroupCount=Nombre de groupes d'événements +Event.region=Region +Event.district=District +Event.community=Community # Event action EventAction.eventUuid=Id d’événement EventAction.eventTitle=Titre de l'événement @@ -1589,6 +1599,7 @@ Person.approximateAge=Age Person.approximateAgeReferenceDate=Dernière mise à jour Person.approximateAgeType=Unité Person.birthdate=Date de naissance (année/mois / jour) +Person.birthDate=Date of birth (year / month / day) Person.birthdateDD=Date de naissance  Person.birthdateMM=Mois de naissance Person.birthdateYYYY=Année de naissance @@ -1684,6 +1695,8 @@ PointOfEntry.latitude=Latitude PointOfEntry.longitude=Longitude PointOfEntry.externalID=ID externe PointOfEntry.archived=Archived +PointOfEntry.region=Region +PointOfEntry.district=District populationDataMaleTotal=Total masculin populationDataFemaleTotal=Total féminin PortHealthInfo=Information relative au service de santé portuaire @@ -1849,6 +1862,10 @@ Sample.uuid=ID d’échantillon Sample.samplePurpose=Destination de l'échantillon Sample.samplingReason=Motif du prélèvement Sample.samplingReasonDetails=Détails du motif du prélèvement +Sample.region=Region +Sample.district=District +Sample.community=Community +# Sample Export SampleExport.additionalTestingRequested=Des tests supplémentaires ont-ils été demandés? SampleExport.personAddressCaption=Adresse du cas/ contact/ personne participant à l'événement SampleExport.personAge=Âge du cas/ contact/ personne participant à l'événement @@ -1954,6 +1971,9 @@ Immunization.responsibleRegion=Responsible region Immunization.responsibleDistrict=Responsible district Immunization.responsibleCommunity=Responsible community Immunization.immunizationPeriod=Immunization period +Immunization.region=Region +Immunization.district=District +Immunization.community=Community immunizationImmunizationsList=Liste des immunisations linkImmunizationToCaseButton=Lier le cas openLinkedCaseToImmunizationButton=Ouvrir le cas @@ -2207,6 +2227,8 @@ Task.taskType=Type de tâche Task.taskAssignee=Tâche assignée Task.taskPriority=Priorité de la tâche Task.travelEntry=Entrées de voyage +Task.region=Region +Task.district=District # TestReport TestReport=Test report TestReport.testDateTime=Date and time of result @@ -2246,6 +2268,7 @@ TravelEntry.responsibleRegion=Responsible region TravelEntry.responsibleDistrict=Responsible district TravelEntry.responsibleCommunity=Responsible community TravelEntry.differentPointOfEntryJurisdiction=Point of entry jurisdiction differs from responsible jurisdiction +TravelEntry.pointOfEntry=Point of entry TravelEntry.pointOfEntryRegion=Region TravelEntry.pointOfEntryDistrict=District TravelEntry.pointOfEntryDetails=Détails du point d'entrée @@ -2311,6 +2334,9 @@ User.userName=Nom d’utilisateur User.userRoles=Rôles d’utilisateur User.address=Adresse User.uuid=UUID +User.region=Region +User.district=District +User.community=Community # Vaccination vaccinationNewVaccination=Nouvelle vaccination vaccinationNoVaccinationsForPerson=Il n'y a pas de vaccins pour cette personne @@ -2458,6 +2484,9 @@ WeeklyReportEntry.numberOfCases=Cas signalés # WeeklyReportInformantSummary WeeklyReportInformantSummary.informantReportDate=Soumis par l'informateur le WeeklyReportInformantSummary.totalCaseCount=Cas signalés par l'informateur +WeeklyReportInformantSummary.informant=Informant +WeeklyReportInformantSummary.community=Community +WeeklyReportInformantSummary.facility=Facility # WeeklyReportOfficerSummary WeeklyReportOfficerSummary.informants=Nombre d'informateurs WeeklyReportOfficerSummary.informantReports=Nombre de rapports d'informateurs @@ -2466,6 +2495,7 @@ WeeklyReportOfficerSummary.informantZeroReports=Rapports d'agents à zéro cas WeeklyReportOfficerSummary.officer=Agent WeeklyReportOfficerSummary.officerReportDate=Soumis par l'agent le WeeklyReportOfficerSummary.totalCaseCount=Cas signalés par l’agent +WeeklyReportOfficerSummary.district=District # WeeklyReportRegionSummary WeeklyReportRegionSummary.informants=Nombre d'informateurs WeeklyReportRegionSummary.informantReports=Nombre de rapports d'informateurs @@ -2475,6 +2505,7 @@ WeeklyReportRegionSummary.officers=Nombre d’agents WeeklyReportRegionSummary.officerReports=Nombre de rapports d’agents WeeklyReportRegionSummary.officerReportPercentage=Pourcentage WeeklyReportRegionSummary.officerZeroReports=Rapports d'agents à zéro cas +WeeklyReportRegionSummary.region=Region # SORMAS to SORMAS SormasToSormasOptions.organization=Organisation SormasToSormasOptions.withAssociatedContacts=Partager les contacts associés diff --git a/sormas-api/src/main/resources/captions_hi-IN.properties b/sormas-api/src/main/resources/captions_hi-IN.properties index 1b876fb2e67..9fcb51b560c 100644 --- a/sormas-api/src/main/resources/captions_hi-IN.properties +++ b/sormas-api/src/main/resources/captions_hi-IN.properties @@ -67,6 +67,7 @@ aboutAdditionalInfo=Additional Info aboutCopyright=Copyright aboutDocuments=Documents aboutVersion=Version +versionIsMissing=Version is missing aboutBrandedSormasVersion=%s powered by SORMAS aboutCaseClassificationRules=Case Classification Rules (HTML) aboutChangelog=Full Changelog @@ -362,6 +363,7 @@ caseCreateNew=Create new case caseDataEnterHomeAddressNow=Enter home address of the case person now caseCancelDeletion=Cancel case deletion CaseData=Case +CaseData.ageAndBirthDate=Age and birth date CaseData.additionalDetails=General comment CaseData.caseClassification=Case classification CaseData.caseIdentificationSource=Case identification source @@ -622,6 +624,8 @@ columnVaccineManufacturer=Vaccine manufacturer Community=Community Community.archived=Archived Community.externalID=External ID +Community.region=Region +Community.district=District communityActiveCommunities=Active communities communityArchivedCommunities=Archived communities communityAllCommunities=All communities @@ -677,6 +681,7 @@ contactNumberOfDuplicatesDetected=%d potential duplicates detected contactFilterWithDifferentRegion=Show duplicates with differing regions Contact=Contact Contact.additionalDetails=General comment +Contact.ageAndBirthDate=Age and birth date Contact.caseClassification=Classification of the source case Contact.caze=Source case Contact.caze.ageSex=Age, sex @@ -688,6 +693,7 @@ Contact.cazeDisease=Disease of source case Contact.cazeDiseaseVariant=Disease variant of source case Contact.cazeDistrict=District of source case Contact.community=Responsible community +Contact.completeness=Completeness Contact.contactClassification=Contact classification Contact.contactOfficer=Responsible contact officer Contact.contactOfficerUuid=Responsible contact officer @@ -992,6 +998,7 @@ District.epidCode=Epid code District.growthRate=Growth rate District.population=Population District.externalID=External ID +District.region=Region epiDataNoSourceContacts=No source contacts have been created for this case EpiData=Epidemiological data EpiData.areaInfectedAnimals=Residing, working or travelling to an area where infected animals have been confirmed @@ -1142,6 +1149,9 @@ Event.internalToken=Internal Token Event.eventGroups=Groups Event.latestEventGroup=Latest Event Group Event.eventGroupCount=Event Group Count +Event.region=Region +Event.district=District +Event.community=Community # Event action EventAction.eventUuid=Event id EventAction.eventTitle=Event title @@ -1589,6 +1599,7 @@ Person.approximateAge=Age Person.approximateAgeReferenceDate=Last updated Person.approximateAgeType=Unit Person.birthdate=Date of birth (year / month / day) +Person.birthDate=Date of birth (year / month / day) Person.birthdateDD=Day of birth Person.birthdateMM=Month of birth Person.birthdateYYYY=Year of birth @@ -1684,6 +1695,8 @@ PointOfEntry.latitude=Latitude PointOfEntry.longitude=Longitude PointOfEntry.externalID=External ID PointOfEntry.archived=Archived +PointOfEntry.region=Region +PointOfEntry.district=District populationDataMaleTotal=Male total populationDataFemaleTotal=Female total PortHealthInfo=Port health information @@ -1849,6 +1862,10 @@ Sample.uuid=Sample ID Sample.samplePurpose=Purpose of the Sample Sample.samplingReason=Reason for sampling/testing Sample.samplingReasonDetails=Sampling reason details +Sample.region=Region +Sample.district=District +Sample.community=Community +# Sample Export SampleExport.additionalTestingRequested=Have additional tests been requested? SampleExport.personAddressCaption=Address of case/contact/event participant person SampleExport.personAge=Age of case/contact/event participant person @@ -1954,6 +1971,9 @@ Immunization.responsibleRegion=Responsible region Immunization.responsibleDistrict=Responsible district Immunization.responsibleCommunity=Responsible community Immunization.immunizationPeriod=Immunization period +Immunization.region=Region +Immunization.district=District +Immunization.community=Community immunizationImmunizationsList=Immunizations list linkImmunizationToCaseButton=Link case openLinkedCaseToImmunizationButton=Open case @@ -2207,6 +2227,8 @@ Task.taskType=Task type Task.taskAssignee=Task assignee Task.taskPriority=Task priority Task.travelEntry=Travel entry +Task.region=Region +Task.district=District # TestReport TestReport=Test report TestReport.testDateTime=Date and time of result @@ -2246,6 +2268,7 @@ TravelEntry.responsibleRegion=Responsible region TravelEntry.responsibleDistrict=Responsible district TravelEntry.responsibleCommunity=Responsible community TravelEntry.differentPointOfEntryJurisdiction=Point of entry jurisdiction differs from responsible jurisdiction +TravelEntry.pointOfEntry=Point of entry TravelEntry.pointOfEntryRegion=Region TravelEntry.pointOfEntryDistrict=District TravelEntry.pointOfEntryDetails=Point of entry details @@ -2311,6 +2334,9 @@ User.userName=User name User.userRoles=User roles User.address=Address User.uuid=UUID +User.region=Region +User.district=District +User.community=Community # Vaccination vaccinationNewVaccination=New vaccination vaccinationNoVaccinationsForPerson=There are no vaccinations for this person @@ -2458,6 +2484,9 @@ WeeklyReportEntry.numberOfCases=Cases reported # WeeklyReportInformantSummary WeeklyReportInformantSummary.informantReportDate=Informant report submission WeeklyReportInformantSummary.totalCaseCount=Cases reported by informant +WeeklyReportInformantSummary.informant=Informant +WeeklyReportInformantSummary.community=Community +WeeklyReportInformantSummary.facility=Facility # WeeklyReportOfficerSummary WeeklyReportOfficerSummary.informants=Number of informants WeeklyReportOfficerSummary.informantReports=Number of informant reports @@ -2466,6 +2495,7 @@ WeeklyReportOfficerSummary.informantZeroReports=Number of informant zero reports WeeklyReportOfficerSummary.officer=Officer WeeklyReportOfficerSummary.officerReportDate=Officer report submission WeeklyReportOfficerSummary.totalCaseCount=Cases reported by officer +WeeklyReportOfficerSummary.district=District # WeeklyReportRegionSummary WeeklyReportRegionSummary.informants=Number of informants WeeklyReportRegionSummary.informantReports=Number of informant reports @@ -2475,6 +2505,7 @@ WeeklyReportRegionSummary.officers=Number of officers WeeklyReportRegionSummary.officerReports=Number of officers reports WeeklyReportRegionSummary.officerReportPercentage=Percentage WeeklyReportRegionSummary.officerZeroReports=Number of officer zero reports +WeeklyReportRegionSummary.region=Region # SORMAS to SORMAS SormasToSormasOptions.organization=Organization SormasToSormasOptions.withAssociatedContacts=Share associated contacts diff --git a/sormas-api/src/main/resources/captions_hr-HR.properties b/sormas-api/src/main/resources/captions_hr-HR.properties index 1b876fb2e67..9fcb51b560c 100644 --- a/sormas-api/src/main/resources/captions_hr-HR.properties +++ b/sormas-api/src/main/resources/captions_hr-HR.properties @@ -67,6 +67,7 @@ aboutAdditionalInfo=Additional Info aboutCopyright=Copyright aboutDocuments=Documents aboutVersion=Version +versionIsMissing=Version is missing aboutBrandedSormasVersion=%s powered by SORMAS aboutCaseClassificationRules=Case Classification Rules (HTML) aboutChangelog=Full Changelog @@ -362,6 +363,7 @@ caseCreateNew=Create new case caseDataEnterHomeAddressNow=Enter home address of the case person now caseCancelDeletion=Cancel case deletion CaseData=Case +CaseData.ageAndBirthDate=Age and birth date CaseData.additionalDetails=General comment CaseData.caseClassification=Case classification CaseData.caseIdentificationSource=Case identification source @@ -622,6 +624,8 @@ columnVaccineManufacturer=Vaccine manufacturer Community=Community Community.archived=Archived Community.externalID=External ID +Community.region=Region +Community.district=District communityActiveCommunities=Active communities communityArchivedCommunities=Archived communities communityAllCommunities=All communities @@ -677,6 +681,7 @@ contactNumberOfDuplicatesDetected=%d potential duplicates detected contactFilterWithDifferentRegion=Show duplicates with differing regions Contact=Contact Contact.additionalDetails=General comment +Contact.ageAndBirthDate=Age and birth date Contact.caseClassification=Classification of the source case Contact.caze=Source case Contact.caze.ageSex=Age, sex @@ -688,6 +693,7 @@ Contact.cazeDisease=Disease of source case Contact.cazeDiseaseVariant=Disease variant of source case Contact.cazeDistrict=District of source case Contact.community=Responsible community +Contact.completeness=Completeness Contact.contactClassification=Contact classification Contact.contactOfficer=Responsible contact officer Contact.contactOfficerUuid=Responsible contact officer @@ -992,6 +998,7 @@ District.epidCode=Epid code District.growthRate=Growth rate District.population=Population District.externalID=External ID +District.region=Region epiDataNoSourceContacts=No source contacts have been created for this case EpiData=Epidemiological data EpiData.areaInfectedAnimals=Residing, working or travelling to an area where infected animals have been confirmed @@ -1142,6 +1149,9 @@ Event.internalToken=Internal Token Event.eventGroups=Groups Event.latestEventGroup=Latest Event Group Event.eventGroupCount=Event Group Count +Event.region=Region +Event.district=District +Event.community=Community # Event action EventAction.eventUuid=Event id EventAction.eventTitle=Event title @@ -1589,6 +1599,7 @@ Person.approximateAge=Age Person.approximateAgeReferenceDate=Last updated Person.approximateAgeType=Unit Person.birthdate=Date of birth (year / month / day) +Person.birthDate=Date of birth (year / month / day) Person.birthdateDD=Day of birth Person.birthdateMM=Month of birth Person.birthdateYYYY=Year of birth @@ -1684,6 +1695,8 @@ PointOfEntry.latitude=Latitude PointOfEntry.longitude=Longitude PointOfEntry.externalID=External ID PointOfEntry.archived=Archived +PointOfEntry.region=Region +PointOfEntry.district=District populationDataMaleTotal=Male total populationDataFemaleTotal=Female total PortHealthInfo=Port health information @@ -1849,6 +1862,10 @@ Sample.uuid=Sample ID Sample.samplePurpose=Purpose of the Sample Sample.samplingReason=Reason for sampling/testing Sample.samplingReasonDetails=Sampling reason details +Sample.region=Region +Sample.district=District +Sample.community=Community +# Sample Export SampleExport.additionalTestingRequested=Have additional tests been requested? SampleExport.personAddressCaption=Address of case/contact/event participant person SampleExport.personAge=Age of case/contact/event participant person @@ -1954,6 +1971,9 @@ Immunization.responsibleRegion=Responsible region Immunization.responsibleDistrict=Responsible district Immunization.responsibleCommunity=Responsible community Immunization.immunizationPeriod=Immunization period +Immunization.region=Region +Immunization.district=District +Immunization.community=Community immunizationImmunizationsList=Immunizations list linkImmunizationToCaseButton=Link case openLinkedCaseToImmunizationButton=Open case @@ -2207,6 +2227,8 @@ Task.taskType=Task type Task.taskAssignee=Task assignee Task.taskPriority=Task priority Task.travelEntry=Travel entry +Task.region=Region +Task.district=District # TestReport TestReport=Test report TestReport.testDateTime=Date and time of result @@ -2246,6 +2268,7 @@ TravelEntry.responsibleRegion=Responsible region TravelEntry.responsibleDistrict=Responsible district TravelEntry.responsibleCommunity=Responsible community TravelEntry.differentPointOfEntryJurisdiction=Point of entry jurisdiction differs from responsible jurisdiction +TravelEntry.pointOfEntry=Point of entry TravelEntry.pointOfEntryRegion=Region TravelEntry.pointOfEntryDistrict=District TravelEntry.pointOfEntryDetails=Point of entry details @@ -2311,6 +2334,9 @@ User.userName=User name User.userRoles=User roles User.address=Address User.uuid=UUID +User.region=Region +User.district=District +User.community=Community # Vaccination vaccinationNewVaccination=New vaccination vaccinationNoVaccinationsForPerson=There are no vaccinations for this person @@ -2458,6 +2484,9 @@ WeeklyReportEntry.numberOfCases=Cases reported # WeeklyReportInformantSummary WeeklyReportInformantSummary.informantReportDate=Informant report submission WeeklyReportInformantSummary.totalCaseCount=Cases reported by informant +WeeklyReportInformantSummary.informant=Informant +WeeklyReportInformantSummary.community=Community +WeeklyReportInformantSummary.facility=Facility # WeeklyReportOfficerSummary WeeklyReportOfficerSummary.informants=Number of informants WeeklyReportOfficerSummary.informantReports=Number of informant reports @@ -2466,6 +2495,7 @@ WeeklyReportOfficerSummary.informantZeroReports=Number of informant zero reports WeeklyReportOfficerSummary.officer=Officer WeeklyReportOfficerSummary.officerReportDate=Officer report submission WeeklyReportOfficerSummary.totalCaseCount=Cases reported by officer +WeeklyReportOfficerSummary.district=District # WeeklyReportRegionSummary WeeklyReportRegionSummary.informants=Number of informants WeeklyReportRegionSummary.informantReports=Number of informant reports @@ -2475,6 +2505,7 @@ WeeklyReportRegionSummary.officers=Number of officers WeeklyReportRegionSummary.officerReports=Number of officers reports WeeklyReportRegionSummary.officerReportPercentage=Percentage WeeklyReportRegionSummary.officerZeroReports=Number of officer zero reports +WeeklyReportRegionSummary.region=Region # SORMAS to SORMAS SormasToSormasOptions.organization=Organization SormasToSormasOptions.withAssociatedContacts=Share associated contacts diff --git a/sormas-api/src/main/resources/captions_it-CH.properties b/sormas-api/src/main/resources/captions_it-CH.properties index 7087149cef9..fbeaad7bcfc 100644 --- a/sormas-api/src/main/resources/captions_it-CH.properties +++ b/sormas-api/src/main/resources/captions_it-CH.properties @@ -67,6 +67,7 @@ aboutAdditionalInfo=Additional Info aboutCopyright=Copyright aboutDocuments=Documents aboutVersion=Version +versionIsMissing=Version is missing aboutBrandedSormasVersion=%s powered by SORMAS aboutCaseClassificationRules=Regole di classificazione dei casi (HTML) aboutChangelog=Cronologia modifiche completa @@ -362,6 +363,7 @@ caseCreateNew=Create new case caseDataEnterHomeAddressNow=Enter home address of the case person now caseCancelDeletion=Cancel case deletion CaseData=Caso +CaseData.ageAndBirthDate=Age and birth date CaseData.additionalDetails=Commenti generali CaseData.caseClassification=Classificazione caso CaseData.caseIdentificationSource=Case identification source @@ -622,6 +624,8 @@ columnVaccineManufacturer=Vaccine manufacturer Community=Community Community.archived=Archiviato Community.externalID=ID esterno +Community.region=Region +Community.district=District communityActiveCommunities=Comuni attivi communityArchivedCommunities=Comunit archiviati communityAllCommunities=Tutte i comuni @@ -677,6 +681,7 @@ contactNumberOfDuplicatesDetected=%d potential duplicates detected contactFilterWithDifferentRegion=Show duplicates with differing regions Contact=Contatto Contact.additionalDetails=Commenti generali +Contact.ageAndBirthDate=Age and birth date Contact.caseClassification=Classificazione del caso indice Contact.caze=Caso indice Contact.caze.ageSex=Età, sesso @@ -688,6 +693,7 @@ Contact.cazeDisease=Malattia caso indice Contact.cazeDiseaseVariant=Disease variant of source case Contact.cazeDistrict=Distretto caso indice Contact.community=Comunità responsabile +Contact.completeness=Completeness Contact.contactClassification=Classificazione contatto Contact.contactOfficer=Responsabile di contatto Contact.contactOfficerUuid=Responsabile di contatto @@ -992,6 +998,7 @@ District.epidCode=Codice Epid District.growthRate=Tasso di crescita District.population=Popolazione District.externalID=ID esterno +District.region=Region epiDataNoSourceContacts=No source contacts have been created for this case EpiData=Dati epidemiologici EpiData.areaInfectedAnimals=Residing, working or travelling to an area where infected animals have been confirmed @@ -1142,6 +1149,9 @@ Event.internalToken=Internal Token Event.eventGroups=Groups Event.latestEventGroup=Latest Event Group Event.eventGroupCount=Event Group Count +Event.region=Region +Event.district=District +Event.community=Community # Event action EventAction.eventUuid=ID dell'evento EventAction.eventTitle=Titolo evento @@ -1589,6 +1599,7 @@ Person.approximateAge=Età Person.approximateAgeReferenceDate=Ultimo aggiornamento Person.approximateAgeType=Unità Person.birthdate=Data di nascita (anno/mese /giorno) +Person.birthDate=Date of birth (year / month / day) Person.birthdateDD=Giorno di nascita Person.birthdateMM=Mese di nascita Person.birthdateYYYY=Anno di nascita @@ -1684,6 +1695,8 @@ PointOfEntry.latitude=Latitudine PointOfEntry.longitude=Longitudine PointOfEntry.externalID=ID esterno PointOfEntry.archived=Archived +PointOfEntry.region=Region +PointOfEntry.district=District populationDataMaleTotal=Totale maschile populationDataFemaleTotal=Totale femminile PortHealthInfo=Informazioni d'ingresso nel paese @@ -1849,6 +1862,10 @@ Sample.uuid=ID campione Sample.samplePurpose=Scopo del campione Sample.samplingReason=Reason for sampling/testing Sample.samplingReasonDetails=Sampling reason details +Sample.region=Region +Sample.district=District +Sample.community=Community +# Sample Export SampleExport.additionalTestingRequested=Sono stati richiesti test aggiuntivi? SampleExport.personAddressCaption=Indirizzo del caso/contatto/partecipante all’evento SampleExport.personAge=Età del caso/contatto/partecipante di evento @@ -1954,6 +1971,9 @@ Immunization.responsibleRegion=Responsible region Immunization.responsibleDistrict=Responsible district Immunization.responsibleCommunity=Responsible community Immunization.immunizationPeriod=Immunization period +Immunization.region=Region +Immunization.district=District +Immunization.community=Community immunizationImmunizationsList=Immunizations list linkImmunizationToCaseButton=Link case openLinkedCaseToImmunizationButton=Open case @@ -2207,6 +2227,8 @@ Task.taskType=Tipo di compito Task.taskAssignee=Task assignee Task.taskPriority=Task priority Task.travelEntry=Travel entry +Task.region=Region +Task.district=District # TestReport TestReport=Test report TestReport.testDateTime=Date and time of result @@ -2246,6 +2268,7 @@ TravelEntry.responsibleRegion=Responsible region TravelEntry.responsibleDistrict=Responsible district TravelEntry.responsibleCommunity=Responsible community TravelEntry.differentPointOfEntryJurisdiction=Point of entry jurisdiction differs from responsible jurisdiction +TravelEntry.pointOfEntry=Point of entry TravelEntry.pointOfEntryRegion=Region TravelEntry.pointOfEntryDistrict=District TravelEntry.pointOfEntryDetails=Point of entry details @@ -2311,6 +2334,9 @@ User.userName=Nome utente User.userRoles=Ruoli utente User.address=Indirizzo User.uuid=UUID +User.region=Region +User.district=District +User.community=Community # Vaccination vaccinationNewVaccination=New vaccination vaccinationNoVaccinationsForPerson=There are no vaccinations for this person @@ -2458,6 +2484,9 @@ WeeklyReportEntry.numberOfCases=Casi segnalati # WeeklyReportInformantSummary WeeklyReportInformantSummary.informantReportDate=Presentazione del rapporto della persona informante WeeklyReportInformantSummary.totalCaseCount=Casi segnalati da informatore +WeeklyReportInformantSummary.informant=Informant +WeeklyReportInformantSummary.community=Community +WeeklyReportInformantSummary.facility=Facility # WeeklyReportOfficerSummary WeeklyReportOfficerSummary.informants=Numero informanti WeeklyReportOfficerSummary.informantReports=Numero di rapporti di informanti @@ -2466,6 +2495,7 @@ WeeklyReportOfficerSummary.informantZeroReports=Numero di rapporti zero di infor WeeklyReportOfficerSummary.officer=Funzionario WeeklyReportOfficerSummary.officerReportDate=Presentazione del rapporto della persona responsabile WeeklyReportOfficerSummary.totalCaseCount=Casi segnalati dal responsabile +WeeklyReportOfficerSummary.district=District # WeeklyReportRegionSummary WeeklyReportRegionSummary.informants=Numero informanti WeeklyReportRegionSummary.informantReports=Numero di rapporti di informanti @@ -2475,6 +2505,7 @@ WeeklyReportRegionSummary.officers=Numero di responsabili WeeklyReportRegionSummary.officerReports=Numero di rapporti di responsabili WeeklyReportRegionSummary.officerReportPercentage=Percentuale WeeklyReportRegionSummary.officerZeroReports=Numero di rapporti zero di responsabili +WeeklyReportRegionSummary.region=Region # SORMAS to SORMAS SormasToSormasOptions.organization=Organization SormasToSormasOptions.withAssociatedContacts=Share associated contacts diff --git a/sormas-api/src/main/resources/captions_it-IT.properties b/sormas-api/src/main/resources/captions_it-IT.properties index 4534c7f209b..5f9db515222 100644 --- a/sormas-api/src/main/resources/captions_it-IT.properties +++ b/sormas-api/src/main/resources/captions_it-IT.properties @@ -67,6 +67,7 @@ aboutAdditionalInfo=Additional Info aboutCopyright=Copyright aboutDocuments=Documents aboutVersion=Version +versionIsMissing=Version is missing aboutBrandedSormasVersion=%s powered by SORMAS aboutCaseClassificationRules=Regole di classificazione dei casi (HTML) aboutChangelog=Cronologia modifiche completa @@ -362,6 +363,7 @@ caseCreateNew=Create new case caseDataEnterHomeAddressNow=Enter home address of the case person now caseCancelDeletion=Cancel case deletion CaseData=Caso +CaseData.ageAndBirthDate=Age and birth date CaseData.additionalDetails=Commenti generali CaseData.caseClassification=Classificazione caso CaseData.caseIdentificationSource=Case identification source @@ -622,6 +624,8 @@ columnVaccineManufacturer=Vaccine manufacturer Community=Community Community.archived=Archived Community.externalID=ID esterno +Community.region=Region +Community.district=District communityActiveCommunities=Comuni attivi communityArchivedCommunities=Comunit archiviati communityAllCommunities=Tutte i comuni @@ -677,6 +681,7 @@ contactNumberOfDuplicatesDetected=%d potential duplicates detected contactFilterWithDifferentRegion=Show duplicates with differing regions Contact=Contatto Contact.additionalDetails=Commenti generali +Contact.ageAndBirthDate=Age and birth date Contact.caseClassification=Classificazione del caso indice Contact.caze=Caso indice Contact.caze.ageSex=Età, sesso @@ -688,6 +693,7 @@ Contact.cazeDisease=Malattia caso indice Contact.cazeDiseaseVariant=Disease variant of source case Contact.cazeDistrict=Distretto caso indice Contact.community=Responsible community +Contact.completeness=Completeness Contact.contactClassification=Classificazione contatto Contact.contactOfficer=Responsabile di contatto Contact.contactOfficerUuid=Responsabile di contatto @@ -992,6 +998,7 @@ District.epidCode=Codice Epid District.growthRate=Tasso di crescita District.population=Popolazione District.externalID=ID esterno +District.region=Region epiDataNoSourceContacts=No source contacts have been created for this case EpiData=Dati epidemiologici EpiData.areaInfectedAnimals=Residing, working or travelling to an area where infected animals have been confirmed @@ -1142,6 +1149,9 @@ Event.internalToken=Internal Token Event.eventGroups=Groups Event.latestEventGroup=Latest Event Group Event.eventGroupCount=Event Group Count +Event.region=Region +Event.district=District +Event.community=Community # Event action EventAction.eventUuid=Event id EventAction.eventTitle=Event title @@ -1589,6 +1599,7 @@ Person.approximateAge=Età Person.approximateAgeReferenceDate=Ultimo aggiornamento Person.approximateAgeType=Unità Person.birthdate=Date of birth (year / month / day) +Person.birthDate=Date of birth (year / month / day) Person.birthdateDD=Day of birth Person.birthdateMM=Month of birth Person.birthdateYYYY=Year of birth @@ -1684,6 +1695,8 @@ PointOfEntry.latitude=Latitudine PointOfEntry.longitude=Longitudine PointOfEntry.externalID=ID esterno PointOfEntry.archived=Archived +PointOfEntry.region=Region +PointOfEntry.district=District populationDataMaleTotal=Totale maschile populationDataFemaleTotal=Totale femminile PortHealthInfo=Informazioni d'ingresso nel paese @@ -1849,6 +1862,10 @@ Sample.uuid=ID campione Sample.samplePurpose=Scopo del campione Sample.samplingReason=Reason for sampling/testing Sample.samplingReasonDetails=Sampling reason details +Sample.region=Region +Sample.district=District +Sample.community=Community +# Sample Export SampleExport.additionalTestingRequested=Sono stati richiesti test aggiuntivi? SampleExport.personAddressCaption=Indirizzo del caso/contatto/partecipante all’evento SampleExport.personAge=Età del caso/contatto/partecipante di evento @@ -1954,6 +1971,9 @@ Immunization.responsibleRegion=Responsible region Immunization.responsibleDistrict=Responsible district Immunization.responsibleCommunity=Responsible community Immunization.immunizationPeriod=Immunization period +Immunization.region=Region +Immunization.district=District +Immunization.community=Community immunizationImmunizationsList=Immunizations list linkImmunizationToCaseButton=Link case openLinkedCaseToImmunizationButton=Open case @@ -2207,6 +2227,8 @@ Task.taskType=Tipo di compito Task.taskAssignee=Task assignee Task.taskPriority=Task priority Task.travelEntry=Travel entry +Task.region=Region +Task.district=District # TestReport TestReport=Test report TestReport.testDateTime=Date and time of result @@ -2246,6 +2268,7 @@ TravelEntry.responsibleRegion=Responsible region TravelEntry.responsibleDistrict=Responsible district TravelEntry.responsibleCommunity=Responsible community TravelEntry.differentPointOfEntryJurisdiction=Point of entry jurisdiction differs from responsible jurisdiction +TravelEntry.pointOfEntry=Point of entry TravelEntry.pointOfEntryRegion=Region TravelEntry.pointOfEntryDistrict=District TravelEntry.pointOfEntryDetails=Point of entry details @@ -2311,6 +2334,9 @@ User.userName=Nome utente User.userRoles=Ruoli utente User.address=Indirizzo User.uuid=UUID +User.region=Region +User.district=District +User.community=Community # Vaccination vaccinationNewVaccination=New vaccination vaccinationNoVaccinationsForPerson=There are no vaccinations for this person @@ -2458,6 +2484,9 @@ WeeklyReportEntry.numberOfCases=Casi segnalati # WeeklyReportInformantSummary WeeklyReportInformantSummary.informantReportDate=Presentazione del rapporto della persona informante WeeklyReportInformantSummary.totalCaseCount=Casi segnalati da informatore +WeeklyReportInformantSummary.informant=Informant +WeeklyReportInformantSummary.community=Community +WeeklyReportInformantSummary.facility=Facility # WeeklyReportOfficerSummary WeeklyReportOfficerSummary.informants=Numero informanti WeeklyReportOfficerSummary.informantReports=Numero di rapporti di informanti @@ -2466,6 +2495,7 @@ WeeklyReportOfficerSummary.informantZeroReports=Numero di rapporti zero di infor WeeklyReportOfficerSummary.officer=Funzionario WeeklyReportOfficerSummary.officerReportDate=Presentazione del rapporto della persona responsabile WeeklyReportOfficerSummary.totalCaseCount=Casi segnalati dal responsabile +WeeklyReportOfficerSummary.district=District # WeeklyReportRegionSummary WeeklyReportRegionSummary.informants=Numero informanti WeeklyReportRegionSummary.informantReports=Numero di rapporti di informanti @@ -2475,6 +2505,7 @@ WeeklyReportRegionSummary.officers=Numero di responsabili WeeklyReportRegionSummary.officerReports=Numero di rapporti di responsabili WeeklyReportRegionSummary.officerReportPercentage=Percentuale WeeklyReportRegionSummary.officerZeroReports=Numero di rapporti zero di responsabili +WeeklyReportRegionSummary.region=Region # SORMAS to SORMAS SormasToSormasOptions.organization=Organization SormasToSormasOptions.withAssociatedContacts=Share associated contacts diff --git a/sormas-api/src/main/resources/captions_ja-JP.properties b/sormas-api/src/main/resources/captions_ja-JP.properties index 1b876fb2e67..9fcb51b560c 100644 --- a/sormas-api/src/main/resources/captions_ja-JP.properties +++ b/sormas-api/src/main/resources/captions_ja-JP.properties @@ -67,6 +67,7 @@ aboutAdditionalInfo=Additional Info aboutCopyright=Copyright aboutDocuments=Documents aboutVersion=Version +versionIsMissing=Version is missing aboutBrandedSormasVersion=%s powered by SORMAS aboutCaseClassificationRules=Case Classification Rules (HTML) aboutChangelog=Full Changelog @@ -362,6 +363,7 @@ caseCreateNew=Create new case caseDataEnterHomeAddressNow=Enter home address of the case person now caseCancelDeletion=Cancel case deletion CaseData=Case +CaseData.ageAndBirthDate=Age and birth date CaseData.additionalDetails=General comment CaseData.caseClassification=Case classification CaseData.caseIdentificationSource=Case identification source @@ -622,6 +624,8 @@ columnVaccineManufacturer=Vaccine manufacturer Community=Community Community.archived=Archived Community.externalID=External ID +Community.region=Region +Community.district=District communityActiveCommunities=Active communities communityArchivedCommunities=Archived communities communityAllCommunities=All communities @@ -677,6 +681,7 @@ contactNumberOfDuplicatesDetected=%d potential duplicates detected contactFilterWithDifferentRegion=Show duplicates with differing regions Contact=Contact Contact.additionalDetails=General comment +Contact.ageAndBirthDate=Age and birth date Contact.caseClassification=Classification of the source case Contact.caze=Source case Contact.caze.ageSex=Age, sex @@ -688,6 +693,7 @@ Contact.cazeDisease=Disease of source case Contact.cazeDiseaseVariant=Disease variant of source case Contact.cazeDistrict=District of source case Contact.community=Responsible community +Contact.completeness=Completeness Contact.contactClassification=Contact classification Contact.contactOfficer=Responsible contact officer Contact.contactOfficerUuid=Responsible contact officer @@ -992,6 +998,7 @@ District.epidCode=Epid code District.growthRate=Growth rate District.population=Population District.externalID=External ID +District.region=Region epiDataNoSourceContacts=No source contacts have been created for this case EpiData=Epidemiological data EpiData.areaInfectedAnimals=Residing, working or travelling to an area where infected animals have been confirmed @@ -1142,6 +1149,9 @@ Event.internalToken=Internal Token Event.eventGroups=Groups Event.latestEventGroup=Latest Event Group Event.eventGroupCount=Event Group Count +Event.region=Region +Event.district=District +Event.community=Community # Event action EventAction.eventUuid=Event id EventAction.eventTitle=Event title @@ -1589,6 +1599,7 @@ Person.approximateAge=Age Person.approximateAgeReferenceDate=Last updated Person.approximateAgeType=Unit Person.birthdate=Date of birth (year / month / day) +Person.birthDate=Date of birth (year / month / day) Person.birthdateDD=Day of birth Person.birthdateMM=Month of birth Person.birthdateYYYY=Year of birth @@ -1684,6 +1695,8 @@ PointOfEntry.latitude=Latitude PointOfEntry.longitude=Longitude PointOfEntry.externalID=External ID PointOfEntry.archived=Archived +PointOfEntry.region=Region +PointOfEntry.district=District populationDataMaleTotal=Male total populationDataFemaleTotal=Female total PortHealthInfo=Port health information @@ -1849,6 +1862,10 @@ Sample.uuid=Sample ID Sample.samplePurpose=Purpose of the Sample Sample.samplingReason=Reason for sampling/testing Sample.samplingReasonDetails=Sampling reason details +Sample.region=Region +Sample.district=District +Sample.community=Community +# Sample Export SampleExport.additionalTestingRequested=Have additional tests been requested? SampleExport.personAddressCaption=Address of case/contact/event participant person SampleExport.personAge=Age of case/contact/event participant person @@ -1954,6 +1971,9 @@ Immunization.responsibleRegion=Responsible region Immunization.responsibleDistrict=Responsible district Immunization.responsibleCommunity=Responsible community Immunization.immunizationPeriod=Immunization period +Immunization.region=Region +Immunization.district=District +Immunization.community=Community immunizationImmunizationsList=Immunizations list linkImmunizationToCaseButton=Link case openLinkedCaseToImmunizationButton=Open case @@ -2207,6 +2227,8 @@ Task.taskType=Task type Task.taskAssignee=Task assignee Task.taskPriority=Task priority Task.travelEntry=Travel entry +Task.region=Region +Task.district=District # TestReport TestReport=Test report TestReport.testDateTime=Date and time of result @@ -2246,6 +2268,7 @@ TravelEntry.responsibleRegion=Responsible region TravelEntry.responsibleDistrict=Responsible district TravelEntry.responsibleCommunity=Responsible community TravelEntry.differentPointOfEntryJurisdiction=Point of entry jurisdiction differs from responsible jurisdiction +TravelEntry.pointOfEntry=Point of entry TravelEntry.pointOfEntryRegion=Region TravelEntry.pointOfEntryDistrict=District TravelEntry.pointOfEntryDetails=Point of entry details @@ -2311,6 +2334,9 @@ User.userName=User name User.userRoles=User roles User.address=Address User.uuid=UUID +User.region=Region +User.district=District +User.community=Community # Vaccination vaccinationNewVaccination=New vaccination vaccinationNoVaccinationsForPerson=There are no vaccinations for this person @@ -2458,6 +2484,9 @@ WeeklyReportEntry.numberOfCases=Cases reported # WeeklyReportInformantSummary WeeklyReportInformantSummary.informantReportDate=Informant report submission WeeklyReportInformantSummary.totalCaseCount=Cases reported by informant +WeeklyReportInformantSummary.informant=Informant +WeeklyReportInformantSummary.community=Community +WeeklyReportInformantSummary.facility=Facility # WeeklyReportOfficerSummary WeeklyReportOfficerSummary.informants=Number of informants WeeklyReportOfficerSummary.informantReports=Number of informant reports @@ -2466,6 +2495,7 @@ WeeklyReportOfficerSummary.informantZeroReports=Number of informant zero reports WeeklyReportOfficerSummary.officer=Officer WeeklyReportOfficerSummary.officerReportDate=Officer report submission WeeklyReportOfficerSummary.totalCaseCount=Cases reported by officer +WeeklyReportOfficerSummary.district=District # WeeklyReportRegionSummary WeeklyReportRegionSummary.informants=Number of informants WeeklyReportRegionSummary.informantReports=Number of informant reports @@ -2475,6 +2505,7 @@ WeeklyReportRegionSummary.officers=Number of officers WeeklyReportRegionSummary.officerReports=Number of officers reports WeeklyReportRegionSummary.officerReportPercentage=Percentage WeeklyReportRegionSummary.officerZeroReports=Number of officer zero reports +WeeklyReportRegionSummary.region=Region # SORMAS to SORMAS SormasToSormasOptions.organization=Organization SormasToSormasOptions.withAssociatedContacts=Share associated contacts diff --git a/sormas-api/src/main/resources/captions_nl-NL.properties b/sormas-api/src/main/resources/captions_nl-NL.properties index 26a932bd180..5fd25419330 100644 --- a/sormas-api/src/main/resources/captions_nl-NL.properties +++ b/sormas-api/src/main/resources/captions_nl-NL.properties @@ -67,6 +67,7 @@ aboutAdditionalInfo=Additional Info aboutCopyright=Copyright aboutDocuments=Documents aboutVersion=Version +versionIsMissing=Version is missing aboutBrandedSormasVersion=%s powered by SORMAS aboutCaseClassificationRules=Case Classification Rules (HTML) aboutChangelog=Full Changelog @@ -362,6 +363,7 @@ caseCreateNew=Create new case caseDataEnterHomeAddressNow=Enter home address of the case person now caseCancelDeletion=Cancel case deletion CaseData=Case +CaseData.ageAndBirthDate=Age and birth date CaseData.additionalDetails=General comment CaseData.caseClassification=Case classification CaseData.caseIdentificationSource=Case identification source @@ -622,6 +624,8 @@ columnVaccineManufacturer=Vaccine manufacturer Community=Community Community.archived=Archived Community.externalID=External ID +Community.region=Region +Community.district=District communityActiveCommunities=Active communities communityArchivedCommunities=Archived communities communityAllCommunities=All communities @@ -677,6 +681,7 @@ contactNumberOfDuplicatesDetected=%d potential duplicates detected contactFilterWithDifferentRegion=Show duplicates with differing regions Contact=Contact Contact.additionalDetails=General comment +Contact.ageAndBirthDate=Age and birth date Contact.caseClassification=Classification of the source case Contact.caze=Source case Contact.caze.ageSex=Age, sex @@ -688,6 +693,7 @@ Contact.cazeDisease=Disease of source case Contact.cazeDiseaseVariant=Disease variant of source case Contact.cazeDistrict=District of source case Contact.community=Responsible community +Contact.completeness=Completeness Contact.contactClassification=Contact classification Contact.contactOfficer=Responsible contact officer Contact.contactOfficerUuid=Responsible contact officer @@ -992,6 +998,7 @@ District.epidCode=Epid code District.growthRate=Growth rate District.population=Population District.externalID=External ID +District.region=Region epiDataNoSourceContacts=No source contacts have been created for this case EpiData=Epidemiological data EpiData.areaInfectedAnimals=Residing, working or travelling to an area where infected animals have been confirmed @@ -1142,6 +1149,9 @@ Event.internalToken=Internal Token Event.eventGroups=Groups Event.latestEventGroup=Latest Event Group Event.eventGroupCount=Event Group Count +Event.region=Region +Event.district=District +Event.community=Community # Event action EventAction.eventUuid=Event id EventAction.eventTitle=Event title @@ -1589,6 +1599,7 @@ Person.approximateAge=Age Person.approximateAgeReferenceDate=Last updated Person.approximateAgeType=Unit Person.birthdate=Date of birth (year / month / day) +Person.birthDate=Date of birth (year / month / day) Person.birthdateDD=Day of birth Person.birthdateMM=Month of birth Person.birthdateYYYY=Year of birth @@ -1684,6 +1695,8 @@ PointOfEntry.latitude=Latitude PointOfEntry.longitude=Longitude PointOfEntry.externalID=External ID PointOfEntry.archived=Archived +PointOfEntry.region=Region +PointOfEntry.district=District populationDataMaleTotal=Male total populationDataFemaleTotal=Female total PortHealthInfo=Port health information @@ -1849,6 +1862,10 @@ Sample.uuid=Sample ID Sample.samplePurpose=Purpose of the Sample Sample.samplingReason=Reason for sampling/testing Sample.samplingReasonDetails=Sampling reason details +Sample.region=Region +Sample.district=District +Sample.community=Community +# Sample Export SampleExport.additionalTestingRequested=Have additional tests been requested? SampleExport.personAddressCaption=Address of case/contact/event participant person SampleExport.personAge=Age of case/contact/event participant person @@ -1954,6 +1971,9 @@ Immunization.responsibleRegion=Responsible region Immunization.responsibleDistrict=Responsible district Immunization.responsibleCommunity=Responsible community Immunization.immunizationPeriod=Immunization period +Immunization.region=Region +Immunization.district=District +Immunization.community=Community immunizationImmunizationsList=Immunizations list linkImmunizationToCaseButton=Link case openLinkedCaseToImmunizationButton=Open case @@ -2207,6 +2227,8 @@ Task.taskType=Task type Task.taskAssignee=Task assignee Task.taskPriority=Task priority Task.travelEntry=Travel entry +Task.region=Region +Task.district=District # TestReport TestReport=Test report TestReport.testDateTime=Date and time of result @@ -2246,6 +2268,7 @@ TravelEntry.responsibleRegion=Responsible region TravelEntry.responsibleDistrict=Responsible district TravelEntry.responsibleCommunity=Responsible community TravelEntry.differentPointOfEntryJurisdiction=Point of entry jurisdiction differs from responsible jurisdiction +TravelEntry.pointOfEntry=Point of entry TravelEntry.pointOfEntryRegion=Region TravelEntry.pointOfEntryDistrict=District TravelEntry.pointOfEntryDetails=Point of entry details @@ -2311,6 +2334,9 @@ User.userName=User name User.userRoles=User roles User.address=Address User.uuid=UUID +User.region=Region +User.district=District +User.community=Community # Vaccination vaccinationNewVaccination=New vaccination vaccinationNoVaccinationsForPerson=There are no vaccinations for this person @@ -2458,6 +2484,9 @@ WeeklyReportEntry.numberOfCases=Cases reported # WeeklyReportInformantSummary WeeklyReportInformantSummary.informantReportDate=Informant report submission WeeklyReportInformantSummary.totalCaseCount=Cases reported by informant +WeeklyReportInformantSummary.informant=Informant +WeeklyReportInformantSummary.community=Community +WeeklyReportInformantSummary.facility=Facility # WeeklyReportOfficerSummary WeeklyReportOfficerSummary.informants=Number of informants WeeklyReportOfficerSummary.informantReports=Number of informant reports @@ -2466,6 +2495,7 @@ WeeklyReportOfficerSummary.informantZeroReports=Number of informant zero reports WeeklyReportOfficerSummary.officer=Officer WeeklyReportOfficerSummary.officerReportDate=Officer report submission WeeklyReportOfficerSummary.totalCaseCount=Cases reported by officer +WeeklyReportOfficerSummary.district=District # WeeklyReportRegionSummary WeeklyReportRegionSummary.informants=Number of informants WeeklyReportRegionSummary.informantReports=Number of informant reports @@ -2475,6 +2505,7 @@ WeeklyReportRegionSummary.officers=Number of officers WeeklyReportRegionSummary.officerReports=Number of officers reports WeeklyReportRegionSummary.officerReportPercentage=Percentage WeeklyReportRegionSummary.officerZeroReports=Number of officer zero reports +WeeklyReportRegionSummary.region=Region # SORMAS to SORMAS SormasToSormasOptions.organization=Organization SormasToSormasOptions.withAssociatedContacts=Share associated contacts diff --git a/sormas-api/src/main/resources/captions_no-NO.properties b/sormas-api/src/main/resources/captions_no-NO.properties index 1b876fb2e67..9fcb51b560c 100644 --- a/sormas-api/src/main/resources/captions_no-NO.properties +++ b/sormas-api/src/main/resources/captions_no-NO.properties @@ -67,6 +67,7 @@ aboutAdditionalInfo=Additional Info aboutCopyright=Copyright aboutDocuments=Documents aboutVersion=Version +versionIsMissing=Version is missing aboutBrandedSormasVersion=%s powered by SORMAS aboutCaseClassificationRules=Case Classification Rules (HTML) aboutChangelog=Full Changelog @@ -362,6 +363,7 @@ caseCreateNew=Create new case caseDataEnterHomeAddressNow=Enter home address of the case person now caseCancelDeletion=Cancel case deletion CaseData=Case +CaseData.ageAndBirthDate=Age and birth date CaseData.additionalDetails=General comment CaseData.caseClassification=Case classification CaseData.caseIdentificationSource=Case identification source @@ -622,6 +624,8 @@ columnVaccineManufacturer=Vaccine manufacturer Community=Community Community.archived=Archived Community.externalID=External ID +Community.region=Region +Community.district=District communityActiveCommunities=Active communities communityArchivedCommunities=Archived communities communityAllCommunities=All communities @@ -677,6 +681,7 @@ contactNumberOfDuplicatesDetected=%d potential duplicates detected contactFilterWithDifferentRegion=Show duplicates with differing regions Contact=Contact Contact.additionalDetails=General comment +Contact.ageAndBirthDate=Age and birth date Contact.caseClassification=Classification of the source case Contact.caze=Source case Contact.caze.ageSex=Age, sex @@ -688,6 +693,7 @@ Contact.cazeDisease=Disease of source case Contact.cazeDiseaseVariant=Disease variant of source case Contact.cazeDistrict=District of source case Contact.community=Responsible community +Contact.completeness=Completeness Contact.contactClassification=Contact classification Contact.contactOfficer=Responsible contact officer Contact.contactOfficerUuid=Responsible contact officer @@ -992,6 +998,7 @@ District.epidCode=Epid code District.growthRate=Growth rate District.population=Population District.externalID=External ID +District.region=Region epiDataNoSourceContacts=No source contacts have been created for this case EpiData=Epidemiological data EpiData.areaInfectedAnimals=Residing, working or travelling to an area where infected animals have been confirmed @@ -1142,6 +1149,9 @@ Event.internalToken=Internal Token Event.eventGroups=Groups Event.latestEventGroup=Latest Event Group Event.eventGroupCount=Event Group Count +Event.region=Region +Event.district=District +Event.community=Community # Event action EventAction.eventUuid=Event id EventAction.eventTitle=Event title @@ -1589,6 +1599,7 @@ Person.approximateAge=Age Person.approximateAgeReferenceDate=Last updated Person.approximateAgeType=Unit Person.birthdate=Date of birth (year / month / day) +Person.birthDate=Date of birth (year / month / day) Person.birthdateDD=Day of birth Person.birthdateMM=Month of birth Person.birthdateYYYY=Year of birth @@ -1684,6 +1695,8 @@ PointOfEntry.latitude=Latitude PointOfEntry.longitude=Longitude PointOfEntry.externalID=External ID PointOfEntry.archived=Archived +PointOfEntry.region=Region +PointOfEntry.district=District populationDataMaleTotal=Male total populationDataFemaleTotal=Female total PortHealthInfo=Port health information @@ -1849,6 +1862,10 @@ Sample.uuid=Sample ID Sample.samplePurpose=Purpose of the Sample Sample.samplingReason=Reason for sampling/testing Sample.samplingReasonDetails=Sampling reason details +Sample.region=Region +Sample.district=District +Sample.community=Community +# Sample Export SampleExport.additionalTestingRequested=Have additional tests been requested? SampleExport.personAddressCaption=Address of case/contact/event participant person SampleExport.personAge=Age of case/contact/event participant person @@ -1954,6 +1971,9 @@ Immunization.responsibleRegion=Responsible region Immunization.responsibleDistrict=Responsible district Immunization.responsibleCommunity=Responsible community Immunization.immunizationPeriod=Immunization period +Immunization.region=Region +Immunization.district=District +Immunization.community=Community immunizationImmunizationsList=Immunizations list linkImmunizationToCaseButton=Link case openLinkedCaseToImmunizationButton=Open case @@ -2207,6 +2227,8 @@ Task.taskType=Task type Task.taskAssignee=Task assignee Task.taskPriority=Task priority Task.travelEntry=Travel entry +Task.region=Region +Task.district=District # TestReport TestReport=Test report TestReport.testDateTime=Date and time of result @@ -2246,6 +2268,7 @@ TravelEntry.responsibleRegion=Responsible region TravelEntry.responsibleDistrict=Responsible district TravelEntry.responsibleCommunity=Responsible community TravelEntry.differentPointOfEntryJurisdiction=Point of entry jurisdiction differs from responsible jurisdiction +TravelEntry.pointOfEntry=Point of entry TravelEntry.pointOfEntryRegion=Region TravelEntry.pointOfEntryDistrict=District TravelEntry.pointOfEntryDetails=Point of entry details @@ -2311,6 +2334,9 @@ User.userName=User name User.userRoles=User roles User.address=Address User.uuid=UUID +User.region=Region +User.district=District +User.community=Community # Vaccination vaccinationNewVaccination=New vaccination vaccinationNoVaccinationsForPerson=There are no vaccinations for this person @@ -2458,6 +2484,9 @@ WeeklyReportEntry.numberOfCases=Cases reported # WeeklyReportInformantSummary WeeklyReportInformantSummary.informantReportDate=Informant report submission WeeklyReportInformantSummary.totalCaseCount=Cases reported by informant +WeeklyReportInformantSummary.informant=Informant +WeeklyReportInformantSummary.community=Community +WeeklyReportInformantSummary.facility=Facility # WeeklyReportOfficerSummary WeeklyReportOfficerSummary.informants=Number of informants WeeklyReportOfficerSummary.informantReports=Number of informant reports @@ -2466,6 +2495,7 @@ WeeklyReportOfficerSummary.informantZeroReports=Number of informant zero reports WeeklyReportOfficerSummary.officer=Officer WeeklyReportOfficerSummary.officerReportDate=Officer report submission WeeklyReportOfficerSummary.totalCaseCount=Cases reported by officer +WeeklyReportOfficerSummary.district=District # WeeklyReportRegionSummary WeeklyReportRegionSummary.informants=Number of informants WeeklyReportRegionSummary.informantReports=Number of informant reports @@ -2475,6 +2505,7 @@ WeeklyReportRegionSummary.officers=Number of officers WeeklyReportRegionSummary.officerReports=Number of officers reports WeeklyReportRegionSummary.officerReportPercentage=Percentage WeeklyReportRegionSummary.officerZeroReports=Number of officer zero reports +WeeklyReportRegionSummary.region=Region # SORMAS to SORMAS SormasToSormasOptions.organization=Organization SormasToSormasOptions.withAssociatedContacts=Share associated contacts diff --git a/sormas-api/src/main/resources/captions_pl-PL.properties b/sormas-api/src/main/resources/captions_pl-PL.properties index 1b876fb2e67..9fcb51b560c 100644 --- a/sormas-api/src/main/resources/captions_pl-PL.properties +++ b/sormas-api/src/main/resources/captions_pl-PL.properties @@ -67,6 +67,7 @@ aboutAdditionalInfo=Additional Info aboutCopyright=Copyright aboutDocuments=Documents aboutVersion=Version +versionIsMissing=Version is missing aboutBrandedSormasVersion=%s powered by SORMAS aboutCaseClassificationRules=Case Classification Rules (HTML) aboutChangelog=Full Changelog @@ -362,6 +363,7 @@ caseCreateNew=Create new case caseDataEnterHomeAddressNow=Enter home address of the case person now caseCancelDeletion=Cancel case deletion CaseData=Case +CaseData.ageAndBirthDate=Age and birth date CaseData.additionalDetails=General comment CaseData.caseClassification=Case classification CaseData.caseIdentificationSource=Case identification source @@ -622,6 +624,8 @@ columnVaccineManufacturer=Vaccine manufacturer Community=Community Community.archived=Archived Community.externalID=External ID +Community.region=Region +Community.district=District communityActiveCommunities=Active communities communityArchivedCommunities=Archived communities communityAllCommunities=All communities @@ -677,6 +681,7 @@ contactNumberOfDuplicatesDetected=%d potential duplicates detected contactFilterWithDifferentRegion=Show duplicates with differing regions Contact=Contact Contact.additionalDetails=General comment +Contact.ageAndBirthDate=Age and birth date Contact.caseClassification=Classification of the source case Contact.caze=Source case Contact.caze.ageSex=Age, sex @@ -688,6 +693,7 @@ Contact.cazeDisease=Disease of source case Contact.cazeDiseaseVariant=Disease variant of source case Contact.cazeDistrict=District of source case Contact.community=Responsible community +Contact.completeness=Completeness Contact.contactClassification=Contact classification Contact.contactOfficer=Responsible contact officer Contact.contactOfficerUuid=Responsible contact officer @@ -992,6 +998,7 @@ District.epidCode=Epid code District.growthRate=Growth rate District.population=Population District.externalID=External ID +District.region=Region epiDataNoSourceContacts=No source contacts have been created for this case EpiData=Epidemiological data EpiData.areaInfectedAnimals=Residing, working or travelling to an area where infected animals have been confirmed @@ -1142,6 +1149,9 @@ Event.internalToken=Internal Token Event.eventGroups=Groups Event.latestEventGroup=Latest Event Group Event.eventGroupCount=Event Group Count +Event.region=Region +Event.district=District +Event.community=Community # Event action EventAction.eventUuid=Event id EventAction.eventTitle=Event title @@ -1589,6 +1599,7 @@ Person.approximateAge=Age Person.approximateAgeReferenceDate=Last updated Person.approximateAgeType=Unit Person.birthdate=Date of birth (year / month / day) +Person.birthDate=Date of birth (year / month / day) Person.birthdateDD=Day of birth Person.birthdateMM=Month of birth Person.birthdateYYYY=Year of birth @@ -1684,6 +1695,8 @@ PointOfEntry.latitude=Latitude PointOfEntry.longitude=Longitude PointOfEntry.externalID=External ID PointOfEntry.archived=Archived +PointOfEntry.region=Region +PointOfEntry.district=District populationDataMaleTotal=Male total populationDataFemaleTotal=Female total PortHealthInfo=Port health information @@ -1849,6 +1862,10 @@ Sample.uuid=Sample ID Sample.samplePurpose=Purpose of the Sample Sample.samplingReason=Reason for sampling/testing Sample.samplingReasonDetails=Sampling reason details +Sample.region=Region +Sample.district=District +Sample.community=Community +# Sample Export SampleExport.additionalTestingRequested=Have additional tests been requested? SampleExport.personAddressCaption=Address of case/contact/event participant person SampleExport.personAge=Age of case/contact/event participant person @@ -1954,6 +1971,9 @@ Immunization.responsibleRegion=Responsible region Immunization.responsibleDistrict=Responsible district Immunization.responsibleCommunity=Responsible community Immunization.immunizationPeriod=Immunization period +Immunization.region=Region +Immunization.district=District +Immunization.community=Community immunizationImmunizationsList=Immunizations list linkImmunizationToCaseButton=Link case openLinkedCaseToImmunizationButton=Open case @@ -2207,6 +2227,8 @@ Task.taskType=Task type Task.taskAssignee=Task assignee Task.taskPriority=Task priority Task.travelEntry=Travel entry +Task.region=Region +Task.district=District # TestReport TestReport=Test report TestReport.testDateTime=Date and time of result @@ -2246,6 +2268,7 @@ TravelEntry.responsibleRegion=Responsible region TravelEntry.responsibleDistrict=Responsible district TravelEntry.responsibleCommunity=Responsible community TravelEntry.differentPointOfEntryJurisdiction=Point of entry jurisdiction differs from responsible jurisdiction +TravelEntry.pointOfEntry=Point of entry TravelEntry.pointOfEntryRegion=Region TravelEntry.pointOfEntryDistrict=District TravelEntry.pointOfEntryDetails=Point of entry details @@ -2311,6 +2334,9 @@ User.userName=User name User.userRoles=User roles User.address=Address User.uuid=UUID +User.region=Region +User.district=District +User.community=Community # Vaccination vaccinationNewVaccination=New vaccination vaccinationNoVaccinationsForPerson=There are no vaccinations for this person @@ -2458,6 +2484,9 @@ WeeklyReportEntry.numberOfCases=Cases reported # WeeklyReportInformantSummary WeeklyReportInformantSummary.informantReportDate=Informant report submission WeeklyReportInformantSummary.totalCaseCount=Cases reported by informant +WeeklyReportInformantSummary.informant=Informant +WeeklyReportInformantSummary.community=Community +WeeklyReportInformantSummary.facility=Facility # WeeklyReportOfficerSummary WeeklyReportOfficerSummary.informants=Number of informants WeeklyReportOfficerSummary.informantReports=Number of informant reports @@ -2466,6 +2495,7 @@ WeeklyReportOfficerSummary.informantZeroReports=Number of informant zero reports WeeklyReportOfficerSummary.officer=Officer WeeklyReportOfficerSummary.officerReportDate=Officer report submission WeeklyReportOfficerSummary.totalCaseCount=Cases reported by officer +WeeklyReportOfficerSummary.district=District # WeeklyReportRegionSummary WeeklyReportRegionSummary.informants=Number of informants WeeklyReportRegionSummary.informantReports=Number of informant reports @@ -2475,6 +2505,7 @@ WeeklyReportRegionSummary.officers=Number of officers WeeklyReportRegionSummary.officerReports=Number of officers reports WeeklyReportRegionSummary.officerReportPercentage=Percentage WeeklyReportRegionSummary.officerZeroReports=Number of officer zero reports +WeeklyReportRegionSummary.region=Region # SORMAS to SORMAS SormasToSormasOptions.organization=Organization SormasToSormasOptions.withAssociatedContacts=Share associated contacts diff --git a/sormas-api/src/main/resources/captions_ps-AF.properties b/sormas-api/src/main/resources/captions_ps-AF.properties index 9e7ce3502a6..012e3f6fa1c 100644 --- a/sormas-api/src/main/resources/captions_ps-AF.properties +++ b/sormas-api/src/main/resources/captions_ps-AF.properties @@ -67,6 +67,7 @@ aboutAdditionalInfo=Additional Info aboutCopyright=Copyright aboutDocuments=اسنادونه aboutVersion=Version +versionIsMissing=Version is missing aboutBrandedSormasVersion=%s powered by SORMAS aboutCaseClassificationRules=د پیښی د تقسیم بندی قوانین aboutChangelog=د بدلون معلومات @@ -362,6 +363,7 @@ caseCreateNew=د نوې پیښی منځته راتلل caseDataEnterHomeAddressNow=Enter home address of the case person now caseCancelDeletion=Cancel case deletion CaseData=پیښه +CaseData.ageAndBirthDate=Age and birth date CaseData.additionalDetails=ټولیز نظر CaseData.caseClassification=د پیښې طبقه بندي CaseData.caseIdentificationSource=Case identification source @@ -622,6 +624,8 @@ columnVaccineManufacturer=Vaccine manufacturer Community=Community Community.archived=ارشیف شوی Community.externalID=بهرنی هویت +Community.region=Region +Community.district=District communityActiveCommunities=فعالی ټولنې communityArchivedCommunities=ارشیف شوي ټولنې communityAllCommunities=ټولی ټولنی @@ -677,6 +681,7 @@ contactNumberOfDuplicatesDetected=%d potential duplicates detected contactFilterWithDifferentRegion=Show duplicates with differing regions Contact=تماس Contact.additionalDetails=ټولیز نظر +Contact.ageAndBirthDate=Age and birth date Contact.caseClassification=د پیښې د منبع طبقه بندي Contact.caze=د پیښې منبع یا زیرمه Contact.caze.ageSex=عمر او جنس @@ -688,6 +693,7 @@ Contact.cazeDisease=د منبعوي پیښې ناروغي Contact.cazeDiseaseVariant=Disease variant of source case Contact.cazeDistrict=د منبعوي پیښې د ولسوالۍ نوم Contact.community=Responsible community +Contact.completeness=Completeness Contact.contactClassification=د تماس په شوي پیښې طبقه بندي Contact.contactOfficer=مسول ارتباطي امر Contact.contactOfficerUuid=مسول ارتباطي امر @@ -992,6 +998,7 @@ District.epidCode=ای پی کوډ District.growthRate=د ودی اندازه District.population=نفوس District.externalID=بهرنی هویت +District.region=Region epiDataNoSourceContacts=No source contacts have been created for this case EpiData=Epidemiological data EpiData.areaInfectedAnimals=Residing, working or travelling to an area where infected animals have been confirmed @@ -1142,6 +1149,9 @@ Event.internalToken=Internal Token Event.eventGroups=Groups Event.latestEventGroup=Latest Event Group Event.eventGroupCount=Event Group Count +Event.region=Region +Event.district=District +Event.community=Community # Event action EventAction.eventUuid=Event id EventAction.eventTitle=Event title @@ -1589,6 +1599,7 @@ Person.approximateAge=Age Person.approximateAgeReferenceDate=Last updated Person.approximateAgeType=Unit Person.birthdate=Date of birth (year / month / day) +Person.birthDate=Date of birth (year / month / day) Person.birthdateDD=Day of birth Person.birthdateMM=Month of birth Person.birthdateYYYY=Year of birth @@ -1684,6 +1695,8 @@ PointOfEntry.latitude=Latitude PointOfEntry.longitude=Longitude PointOfEntry.externalID=External ID PointOfEntry.archived=Archived +PointOfEntry.region=Region +PointOfEntry.district=District populationDataMaleTotal=Male total populationDataFemaleTotal=Female total PortHealthInfo=Port health information @@ -1849,6 +1862,10 @@ Sample.uuid=Sample ID Sample.samplePurpose=Purpose of the Sample Sample.samplingReason=Reason for sampling/testing Sample.samplingReasonDetails=Sampling reason details +Sample.region=Region +Sample.district=District +Sample.community=Community +# Sample Export SampleExport.additionalTestingRequested=Have additional tests been requested? SampleExport.personAddressCaption=Address of case/contact/event participant person SampleExport.personAge=Age of case/contact/event participant person @@ -1954,6 +1971,9 @@ Immunization.responsibleRegion=Responsible region Immunization.responsibleDistrict=Responsible district Immunization.responsibleCommunity=Responsible community Immunization.immunizationPeriod=Immunization period +Immunization.region=Region +Immunization.district=District +Immunization.community=Community immunizationImmunizationsList=Immunizations list linkImmunizationToCaseButton=Link case openLinkedCaseToImmunizationButton=Open case @@ -2207,6 +2227,8 @@ Task.taskType=Task type Task.taskAssignee=Task assignee Task.taskPriority=Task priority Task.travelEntry=Travel entry +Task.region=Region +Task.district=District # TestReport TestReport=Test report TestReport.testDateTime=Date and time of result @@ -2246,6 +2268,7 @@ TravelEntry.responsibleRegion=Responsible region TravelEntry.responsibleDistrict=Responsible district TravelEntry.responsibleCommunity=Responsible community TravelEntry.differentPointOfEntryJurisdiction=Point of entry jurisdiction differs from responsible jurisdiction +TravelEntry.pointOfEntry=Point of entry TravelEntry.pointOfEntryRegion=Region TravelEntry.pointOfEntryDistrict=District TravelEntry.pointOfEntryDetails=Point of entry details @@ -2311,6 +2334,9 @@ User.userName=د استعمالوونکي نوم User.userRoles=د استعمالوونکي رول User.address=پته User.uuid=UUID +User.region=Region +User.district=District +User.community=Community # Vaccination vaccinationNewVaccination=New vaccination vaccinationNoVaccinationsForPerson=There are no vaccinations for this person @@ -2458,6 +2484,9 @@ WeeklyReportEntry.numberOfCases=Cases reported # WeeklyReportInformantSummary WeeklyReportInformantSummary.informantReportDate=Informant report submission WeeklyReportInformantSummary.totalCaseCount=Cases reported by informant +WeeklyReportInformantSummary.informant=Informant +WeeklyReportInformantSummary.community=Community +WeeklyReportInformantSummary.facility=Facility # WeeklyReportOfficerSummary WeeklyReportOfficerSummary.informants=Number of informants WeeklyReportOfficerSummary.informantReports=Number of informant reports @@ -2466,6 +2495,7 @@ WeeklyReportOfficerSummary.informantZeroReports=Number of informant zero reports WeeklyReportOfficerSummary.officer=Officer WeeklyReportOfficerSummary.officerReportDate=Officer report submission WeeklyReportOfficerSummary.totalCaseCount=Cases reported by officer +WeeklyReportOfficerSummary.district=District # WeeklyReportRegionSummary WeeklyReportRegionSummary.informants=Number of informants WeeklyReportRegionSummary.informantReports=Number of informant reports @@ -2475,6 +2505,7 @@ WeeklyReportRegionSummary.officers=Number of officers WeeklyReportRegionSummary.officerReports=Number of officers reports WeeklyReportRegionSummary.officerReportPercentage=Percentage WeeklyReportRegionSummary.officerZeroReports=Number of officer zero reports +WeeklyReportRegionSummary.region=Region # SORMAS to SORMAS SormasToSormasOptions.organization=Organization SormasToSormasOptions.withAssociatedContacts=Share associated contacts diff --git a/sormas-api/src/main/resources/captions_pt-PT.properties b/sormas-api/src/main/resources/captions_pt-PT.properties index 012bde240a3..5c9ae68f711 100644 --- a/sormas-api/src/main/resources/captions_pt-PT.properties +++ b/sormas-api/src/main/resources/captions_pt-PT.properties @@ -67,6 +67,7 @@ aboutAdditionalInfo=Additional Info aboutCopyright=Copyright aboutDocuments=Documents aboutVersion=Version +versionIsMissing=Version is missing aboutBrandedSormasVersion=%s powered by SORMAS aboutCaseClassificationRules=Case Classification Rules (HTML) aboutChangelog=Full Changelog @@ -362,6 +363,7 @@ caseCreateNew=Create new case caseDataEnterHomeAddressNow=Enter home address of the case person now caseCancelDeletion=Cancel case deletion CaseData=Case +CaseData.ageAndBirthDate=Age and birth date CaseData.additionalDetails=General comment CaseData.caseClassification=Case classification CaseData.caseIdentificationSource=Case identification source @@ -622,6 +624,8 @@ columnVaccineManufacturer=Vaccine manufacturer Community=Community Community.archived=Archived Community.externalID=External ID +Community.region=Region +Community.district=District communityActiveCommunities=Active communities communityArchivedCommunities=Archived communities communityAllCommunities=All communities @@ -677,6 +681,7 @@ contactNumberOfDuplicatesDetected=%d potential duplicates detected contactFilterWithDifferentRegion=Show duplicates with differing regions Contact=Contact Contact.additionalDetails=General comment +Contact.ageAndBirthDate=Age and birth date Contact.caseClassification=Classification of the source case Contact.caze=Source case Contact.caze.ageSex=Age, sex @@ -688,6 +693,7 @@ Contact.cazeDisease=Disease of source case Contact.cazeDiseaseVariant=Disease variant of source case Contact.cazeDistrict=District of source case Contact.community=Responsible community +Contact.completeness=Completeness Contact.contactClassification=Contact classification Contact.contactOfficer=Responsible contact officer Contact.contactOfficerUuid=Responsible contact officer @@ -992,6 +998,7 @@ District.epidCode=Epid code District.growthRate=Growth rate District.population=Population District.externalID=External ID +District.region=Region epiDataNoSourceContacts=No source contacts have been created for this case EpiData=Epidemiological data EpiData.areaInfectedAnimals=Residing, working or travelling to an area where infected animals have been confirmed @@ -1142,6 +1149,9 @@ Event.internalToken=Internal Token Event.eventGroups=Groups Event.latestEventGroup=Latest Event Group Event.eventGroupCount=Event Group Count +Event.region=Region +Event.district=District +Event.community=Community # Event action EventAction.eventUuid=Event id EventAction.eventTitle=Event title @@ -1589,6 +1599,7 @@ Person.approximateAge=Age Person.approximateAgeReferenceDate=Last updated Person.approximateAgeType=Unit Person.birthdate=Date of birth (year / month / day) +Person.birthDate=Date of birth (year / month / day) Person.birthdateDD=Day of birth Person.birthdateMM=Month of birth Person.birthdateYYYY=Year of birth @@ -1684,6 +1695,8 @@ PointOfEntry.latitude=Latitude PointOfEntry.longitude=Longitude PointOfEntry.externalID=External ID PointOfEntry.archived=Archived +PointOfEntry.region=Region +PointOfEntry.district=District populationDataMaleTotal=Male total populationDataFemaleTotal=Female total PortHealthInfo=Port health information @@ -1849,6 +1862,10 @@ Sample.uuid=Sample ID Sample.samplePurpose=Purpose of the Sample Sample.samplingReason=Reason for sampling/testing Sample.samplingReasonDetails=Sampling reason details +Sample.region=Region +Sample.district=District +Sample.community=Community +# Sample Export SampleExport.additionalTestingRequested=Have additional tests been requested? SampleExport.personAddressCaption=Address of case/contact/event participant person SampleExport.personAge=Age of case/contact/event participant person @@ -1954,6 +1971,9 @@ Immunization.responsibleRegion=Responsible region Immunization.responsibleDistrict=Responsible district Immunization.responsibleCommunity=Responsible community Immunization.immunizationPeriod=Immunization period +Immunization.region=Region +Immunization.district=District +Immunization.community=Community immunizationImmunizationsList=Immunizations list linkImmunizationToCaseButton=Link case openLinkedCaseToImmunizationButton=Open case @@ -2207,6 +2227,8 @@ Task.taskType=Task type Task.taskAssignee=Task assignee Task.taskPriority=Task priority Task.travelEntry=Travel entry +Task.region=Region +Task.district=District # TestReport TestReport=Test report TestReport.testDateTime=Date and time of result @@ -2246,6 +2268,7 @@ TravelEntry.responsibleRegion=Responsible region TravelEntry.responsibleDistrict=Responsible district TravelEntry.responsibleCommunity=Responsible community TravelEntry.differentPointOfEntryJurisdiction=Point of entry jurisdiction differs from responsible jurisdiction +TravelEntry.pointOfEntry=Point of entry TravelEntry.pointOfEntryRegion=Region TravelEntry.pointOfEntryDistrict=District TravelEntry.pointOfEntryDetails=Point of entry details @@ -2311,6 +2334,9 @@ User.userName=User name User.userRoles=User roles User.address=Address User.uuid=UUID +User.region=Region +User.district=District +User.community=Community # Vaccination vaccinationNewVaccination=New vaccination vaccinationNoVaccinationsForPerson=There are no vaccinations for this person @@ -2458,6 +2484,9 @@ WeeklyReportEntry.numberOfCases=Cases reported # WeeklyReportInformantSummary WeeklyReportInformantSummary.informantReportDate=Informant report submission WeeklyReportInformantSummary.totalCaseCount=Cases reported by informant +WeeklyReportInformantSummary.informant=Informant +WeeklyReportInformantSummary.community=Community +WeeklyReportInformantSummary.facility=Facility # WeeklyReportOfficerSummary WeeklyReportOfficerSummary.informants=Number of informants WeeklyReportOfficerSummary.informantReports=Number of informant reports @@ -2466,6 +2495,7 @@ WeeklyReportOfficerSummary.informantZeroReports=Number of informant zero reports WeeklyReportOfficerSummary.officer=Officer WeeklyReportOfficerSummary.officerReportDate=Officer report submission WeeklyReportOfficerSummary.totalCaseCount=Cases reported by officer +WeeklyReportOfficerSummary.district=District # WeeklyReportRegionSummary WeeklyReportRegionSummary.informants=Number of informants WeeklyReportRegionSummary.informantReports=Number of informant reports @@ -2475,6 +2505,7 @@ WeeklyReportRegionSummary.officers=Number of officers WeeklyReportRegionSummary.officerReports=Number of officers reports WeeklyReportRegionSummary.officerReportPercentage=Percentage WeeklyReportRegionSummary.officerZeroReports=Number of officer zero reports +WeeklyReportRegionSummary.region=Region # SORMAS to SORMAS SormasToSormasOptions.organization=Organization SormasToSormasOptions.withAssociatedContacts=Share associated contacts diff --git a/sormas-api/src/main/resources/captions_ro-RO.properties b/sormas-api/src/main/resources/captions_ro-RO.properties index 1b876fb2e67..9fcb51b560c 100644 --- a/sormas-api/src/main/resources/captions_ro-RO.properties +++ b/sormas-api/src/main/resources/captions_ro-RO.properties @@ -67,6 +67,7 @@ aboutAdditionalInfo=Additional Info aboutCopyright=Copyright aboutDocuments=Documents aboutVersion=Version +versionIsMissing=Version is missing aboutBrandedSormasVersion=%s powered by SORMAS aboutCaseClassificationRules=Case Classification Rules (HTML) aboutChangelog=Full Changelog @@ -362,6 +363,7 @@ caseCreateNew=Create new case caseDataEnterHomeAddressNow=Enter home address of the case person now caseCancelDeletion=Cancel case deletion CaseData=Case +CaseData.ageAndBirthDate=Age and birth date CaseData.additionalDetails=General comment CaseData.caseClassification=Case classification CaseData.caseIdentificationSource=Case identification source @@ -622,6 +624,8 @@ columnVaccineManufacturer=Vaccine manufacturer Community=Community Community.archived=Archived Community.externalID=External ID +Community.region=Region +Community.district=District communityActiveCommunities=Active communities communityArchivedCommunities=Archived communities communityAllCommunities=All communities @@ -677,6 +681,7 @@ contactNumberOfDuplicatesDetected=%d potential duplicates detected contactFilterWithDifferentRegion=Show duplicates with differing regions Contact=Contact Contact.additionalDetails=General comment +Contact.ageAndBirthDate=Age and birth date Contact.caseClassification=Classification of the source case Contact.caze=Source case Contact.caze.ageSex=Age, sex @@ -688,6 +693,7 @@ Contact.cazeDisease=Disease of source case Contact.cazeDiseaseVariant=Disease variant of source case Contact.cazeDistrict=District of source case Contact.community=Responsible community +Contact.completeness=Completeness Contact.contactClassification=Contact classification Contact.contactOfficer=Responsible contact officer Contact.contactOfficerUuid=Responsible contact officer @@ -992,6 +998,7 @@ District.epidCode=Epid code District.growthRate=Growth rate District.population=Population District.externalID=External ID +District.region=Region epiDataNoSourceContacts=No source contacts have been created for this case EpiData=Epidemiological data EpiData.areaInfectedAnimals=Residing, working or travelling to an area where infected animals have been confirmed @@ -1142,6 +1149,9 @@ Event.internalToken=Internal Token Event.eventGroups=Groups Event.latestEventGroup=Latest Event Group Event.eventGroupCount=Event Group Count +Event.region=Region +Event.district=District +Event.community=Community # Event action EventAction.eventUuid=Event id EventAction.eventTitle=Event title @@ -1589,6 +1599,7 @@ Person.approximateAge=Age Person.approximateAgeReferenceDate=Last updated Person.approximateAgeType=Unit Person.birthdate=Date of birth (year / month / day) +Person.birthDate=Date of birth (year / month / day) Person.birthdateDD=Day of birth Person.birthdateMM=Month of birth Person.birthdateYYYY=Year of birth @@ -1684,6 +1695,8 @@ PointOfEntry.latitude=Latitude PointOfEntry.longitude=Longitude PointOfEntry.externalID=External ID PointOfEntry.archived=Archived +PointOfEntry.region=Region +PointOfEntry.district=District populationDataMaleTotal=Male total populationDataFemaleTotal=Female total PortHealthInfo=Port health information @@ -1849,6 +1862,10 @@ Sample.uuid=Sample ID Sample.samplePurpose=Purpose of the Sample Sample.samplingReason=Reason for sampling/testing Sample.samplingReasonDetails=Sampling reason details +Sample.region=Region +Sample.district=District +Sample.community=Community +# Sample Export SampleExport.additionalTestingRequested=Have additional tests been requested? SampleExport.personAddressCaption=Address of case/contact/event participant person SampleExport.personAge=Age of case/contact/event participant person @@ -1954,6 +1971,9 @@ Immunization.responsibleRegion=Responsible region Immunization.responsibleDistrict=Responsible district Immunization.responsibleCommunity=Responsible community Immunization.immunizationPeriod=Immunization period +Immunization.region=Region +Immunization.district=District +Immunization.community=Community immunizationImmunizationsList=Immunizations list linkImmunizationToCaseButton=Link case openLinkedCaseToImmunizationButton=Open case @@ -2207,6 +2227,8 @@ Task.taskType=Task type Task.taskAssignee=Task assignee Task.taskPriority=Task priority Task.travelEntry=Travel entry +Task.region=Region +Task.district=District # TestReport TestReport=Test report TestReport.testDateTime=Date and time of result @@ -2246,6 +2268,7 @@ TravelEntry.responsibleRegion=Responsible region TravelEntry.responsibleDistrict=Responsible district TravelEntry.responsibleCommunity=Responsible community TravelEntry.differentPointOfEntryJurisdiction=Point of entry jurisdiction differs from responsible jurisdiction +TravelEntry.pointOfEntry=Point of entry TravelEntry.pointOfEntryRegion=Region TravelEntry.pointOfEntryDistrict=District TravelEntry.pointOfEntryDetails=Point of entry details @@ -2311,6 +2334,9 @@ User.userName=User name User.userRoles=User roles User.address=Address User.uuid=UUID +User.region=Region +User.district=District +User.community=Community # Vaccination vaccinationNewVaccination=New vaccination vaccinationNoVaccinationsForPerson=There are no vaccinations for this person @@ -2458,6 +2484,9 @@ WeeklyReportEntry.numberOfCases=Cases reported # WeeklyReportInformantSummary WeeklyReportInformantSummary.informantReportDate=Informant report submission WeeklyReportInformantSummary.totalCaseCount=Cases reported by informant +WeeklyReportInformantSummary.informant=Informant +WeeklyReportInformantSummary.community=Community +WeeklyReportInformantSummary.facility=Facility # WeeklyReportOfficerSummary WeeklyReportOfficerSummary.informants=Number of informants WeeklyReportOfficerSummary.informantReports=Number of informant reports @@ -2466,6 +2495,7 @@ WeeklyReportOfficerSummary.informantZeroReports=Number of informant zero reports WeeklyReportOfficerSummary.officer=Officer WeeklyReportOfficerSummary.officerReportDate=Officer report submission WeeklyReportOfficerSummary.totalCaseCount=Cases reported by officer +WeeklyReportOfficerSummary.district=District # WeeklyReportRegionSummary WeeklyReportRegionSummary.informants=Number of informants WeeklyReportRegionSummary.informantReports=Number of informant reports @@ -2475,6 +2505,7 @@ WeeklyReportRegionSummary.officers=Number of officers WeeklyReportRegionSummary.officerReports=Number of officers reports WeeklyReportRegionSummary.officerReportPercentage=Percentage WeeklyReportRegionSummary.officerZeroReports=Number of officer zero reports +WeeklyReportRegionSummary.region=Region # SORMAS to SORMAS SormasToSormasOptions.organization=Organization SormasToSormasOptions.withAssociatedContacts=Share associated contacts diff --git a/sormas-api/src/main/resources/captions_ru-RU.properties b/sormas-api/src/main/resources/captions_ru-RU.properties index 92b40db6bde..9e633e6ccdc 100644 --- a/sormas-api/src/main/resources/captions_ru-RU.properties +++ b/sormas-api/src/main/resources/captions_ru-RU.properties @@ -67,6 +67,7 @@ aboutAdditionalInfo=Дополнительная информация aboutCopyright=Авторское право aboutDocuments=Документация aboutVersion=Version +versionIsMissing=Version is missing aboutBrandedSormasVersion=При поддержке Сормаса aboutCaseClassificationRules=Правила классификации дела aboutChangelog=Полный список изменений @@ -362,6 +363,7 @@ caseCreateNew=Create new case caseDataEnterHomeAddressNow=Enter home address of the case person now caseCancelDeletion=Cancel case deletion CaseData=Case +CaseData.ageAndBirthDate=Age and birth date CaseData.additionalDetails=General comment CaseData.caseClassification=Case classification CaseData.caseIdentificationSource=Case identification source @@ -622,6 +624,8 @@ columnVaccineManufacturer=Vaccine manufacturer Community=Community Community.archived=Archived Community.externalID=External ID +Community.region=Region +Community.district=District communityActiveCommunities=Active communities communityArchivedCommunities=Archived communities communityAllCommunities=All communities @@ -677,6 +681,7 @@ contactNumberOfDuplicatesDetected=%d potential duplicates detected contactFilterWithDifferentRegion=Show duplicates with differing regions Contact=Contact Contact.additionalDetails=General comment +Contact.ageAndBirthDate=Age and birth date Contact.caseClassification=Classification of the source case Contact.caze=Source case Contact.caze.ageSex=Age, sex @@ -688,6 +693,7 @@ Contact.cazeDisease=Disease of source case Contact.cazeDiseaseVariant=Disease variant of source case Contact.cazeDistrict=District of source case Contact.community=Responsible community +Contact.completeness=Completeness Contact.contactClassification=Contact classification Contact.contactOfficer=Responsible contact officer Contact.contactOfficerUuid=Responsible contact officer @@ -992,6 +998,7 @@ District.epidCode=Epid code District.growthRate=Growth rate District.population=Population District.externalID=External ID +District.region=Region epiDataNoSourceContacts=No source contacts have been created for this case EpiData=Epidemiological data EpiData.areaInfectedAnimals=Residing, working or travelling to an area where infected animals have been confirmed @@ -1142,6 +1149,9 @@ Event.internalToken=Internal Token Event.eventGroups=Groups Event.latestEventGroup=Latest Event Group Event.eventGroupCount=Event Group Count +Event.region=Region +Event.district=District +Event.community=Community # Event action EventAction.eventUuid=Event id EventAction.eventTitle=Event title @@ -1589,6 +1599,7 @@ Person.approximateAge=Age Person.approximateAgeReferenceDate=Last updated Person.approximateAgeType=Unit Person.birthdate=Date of birth (year / month / day) +Person.birthDate=Date of birth (year / month / day) Person.birthdateDD=Day of birth Person.birthdateMM=Month of birth Person.birthdateYYYY=Year of birth @@ -1684,6 +1695,8 @@ PointOfEntry.latitude=Latitude PointOfEntry.longitude=Longitude PointOfEntry.externalID=External ID PointOfEntry.archived=Archived +PointOfEntry.region=Region +PointOfEntry.district=District populationDataMaleTotal=Male total populationDataFemaleTotal=Female total PortHealthInfo=Port health information @@ -1849,6 +1862,10 @@ Sample.uuid=Sample ID Sample.samplePurpose=Purpose of the Sample Sample.samplingReason=Reason for sampling/testing Sample.samplingReasonDetails=Sampling reason details +Sample.region=Region +Sample.district=District +Sample.community=Community +# Sample Export SampleExport.additionalTestingRequested=Have additional tests been requested? SampleExport.personAddressCaption=Address of case/contact/event participant person SampleExport.personAge=Age of case/contact/event participant person @@ -1954,6 +1971,9 @@ Immunization.responsibleRegion=Responsible region Immunization.responsibleDistrict=Responsible district Immunization.responsibleCommunity=Responsible community Immunization.immunizationPeriod=Immunization period +Immunization.region=Region +Immunization.district=District +Immunization.community=Community immunizationImmunizationsList=Immunizations list linkImmunizationToCaseButton=Link case openLinkedCaseToImmunizationButton=Open case @@ -2207,6 +2227,8 @@ Task.taskType=Task type Task.taskAssignee=Task assignee Task.taskPriority=Task priority Task.travelEntry=Travel entry +Task.region=Region +Task.district=District # TestReport TestReport=Test report TestReport.testDateTime=Date and time of result @@ -2246,6 +2268,7 @@ TravelEntry.responsibleRegion=Responsible region TravelEntry.responsibleDistrict=Responsible district TravelEntry.responsibleCommunity=Responsible community TravelEntry.differentPointOfEntryJurisdiction=Point of entry jurisdiction differs from responsible jurisdiction +TravelEntry.pointOfEntry=Point of entry TravelEntry.pointOfEntryRegion=Region TravelEntry.pointOfEntryDistrict=District TravelEntry.pointOfEntryDetails=Point of entry details @@ -2311,6 +2334,9 @@ User.userName=User name User.userRoles=User roles User.address=Address User.uuid=UUID +User.region=Region +User.district=District +User.community=Community # Vaccination vaccinationNewVaccination=New vaccination vaccinationNoVaccinationsForPerson=There are no vaccinations for this person @@ -2458,6 +2484,9 @@ WeeklyReportEntry.numberOfCases=Cases reported # WeeklyReportInformantSummary WeeklyReportInformantSummary.informantReportDate=Informant report submission WeeklyReportInformantSummary.totalCaseCount=Cases reported by informant +WeeklyReportInformantSummary.informant=Informant +WeeklyReportInformantSummary.community=Community +WeeklyReportInformantSummary.facility=Facility # WeeklyReportOfficerSummary WeeklyReportOfficerSummary.informants=Number of informants WeeklyReportOfficerSummary.informantReports=Number of informant reports @@ -2466,6 +2495,7 @@ WeeklyReportOfficerSummary.informantZeroReports=Number of informant zero reports WeeklyReportOfficerSummary.officer=Officer WeeklyReportOfficerSummary.officerReportDate=Officer report submission WeeklyReportOfficerSummary.totalCaseCount=Cases reported by officer +WeeklyReportOfficerSummary.district=District # WeeklyReportRegionSummary WeeklyReportRegionSummary.informants=Number of informants WeeklyReportRegionSummary.informantReports=Number of informant reports @@ -2475,6 +2505,7 @@ WeeklyReportRegionSummary.officers=Number of officers WeeklyReportRegionSummary.officerReports=Number of officers reports WeeklyReportRegionSummary.officerReportPercentage=Percentage WeeklyReportRegionSummary.officerZeroReports=Number of officer zero reports +WeeklyReportRegionSummary.region=Region # SORMAS to SORMAS SormasToSormasOptions.organization=Organization SormasToSormasOptions.withAssociatedContacts=Share associated contacts diff --git a/sormas-api/src/main/resources/captions_sv-SE.properties b/sormas-api/src/main/resources/captions_sv-SE.properties index 1b876fb2e67..9fcb51b560c 100644 --- a/sormas-api/src/main/resources/captions_sv-SE.properties +++ b/sormas-api/src/main/resources/captions_sv-SE.properties @@ -67,6 +67,7 @@ aboutAdditionalInfo=Additional Info aboutCopyright=Copyright aboutDocuments=Documents aboutVersion=Version +versionIsMissing=Version is missing aboutBrandedSormasVersion=%s powered by SORMAS aboutCaseClassificationRules=Case Classification Rules (HTML) aboutChangelog=Full Changelog @@ -362,6 +363,7 @@ caseCreateNew=Create new case caseDataEnterHomeAddressNow=Enter home address of the case person now caseCancelDeletion=Cancel case deletion CaseData=Case +CaseData.ageAndBirthDate=Age and birth date CaseData.additionalDetails=General comment CaseData.caseClassification=Case classification CaseData.caseIdentificationSource=Case identification source @@ -622,6 +624,8 @@ columnVaccineManufacturer=Vaccine manufacturer Community=Community Community.archived=Archived Community.externalID=External ID +Community.region=Region +Community.district=District communityActiveCommunities=Active communities communityArchivedCommunities=Archived communities communityAllCommunities=All communities @@ -677,6 +681,7 @@ contactNumberOfDuplicatesDetected=%d potential duplicates detected contactFilterWithDifferentRegion=Show duplicates with differing regions Contact=Contact Contact.additionalDetails=General comment +Contact.ageAndBirthDate=Age and birth date Contact.caseClassification=Classification of the source case Contact.caze=Source case Contact.caze.ageSex=Age, sex @@ -688,6 +693,7 @@ Contact.cazeDisease=Disease of source case Contact.cazeDiseaseVariant=Disease variant of source case Contact.cazeDistrict=District of source case Contact.community=Responsible community +Contact.completeness=Completeness Contact.contactClassification=Contact classification Contact.contactOfficer=Responsible contact officer Contact.contactOfficerUuid=Responsible contact officer @@ -992,6 +998,7 @@ District.epidCode=Epid code District.growthRate=Growth rate District.population=Population District.externalID=External ID +District.region=Region epiDataNoSourceContacts=No source contacts have been created for this case EpiData=Epidemiological data EpiData.areaInfectedAnimals=Residing, working or travelling to an area where infected animals have been confirmed @@ -1142,6 +1149,9 @@ Event.internalToken=Internal Token Event.eventGroups=Groups Event.latestEventGroup=Latest Event Group Event.eventGroupCount=Event Group Count +Event.region=Region +Event.district=District +Event.community=Community # Event action EventAction.eventUuid=Event id EventAction.eventTitle=Event title @@ -1589,6 +1599,7 @@ Person.approximateAge=Age Person.approximateAgeReferenceDate=Last updated Person.approximateAgeType=Unit Person.birthdate=Date of birth (year / month / day) +Person.birthDate=Date of birth (year / month / day) Person.birthdateDD=Day of birth Person.birthdateMM=Month of birth Person.birthdateYYYY=Year of birth @@ -1684,6 +1695,8 @@ PointOfEntry.latitude=Latitude PointOfEntry.longitude=Longitude PointOfEntry.externalID=External ID PointOfEntry.archived=Archived +PointOfEntry.region=Region +PointOfEntry.district=District populationDataMaleTotal=Male total populationDataFemaleTotal=Female total PortHealthInfo=Port health information @@ -1849,6 +1862,10 @@ Sample.uuid=Sample ID Sample.samplePurpose=Purpose of the Sample Sample.samplingReason=Reason for sampling/testing Sample.samplingReasonDetails=Sampling reason details +Sample.region=Region +Sample.district=District +Sample.community=Community +# Sample Export SampleExport.additionalTestingRequested=Have additional tests been requested? SampleExport.personAddressCaption=Address of case/contact/event participant person SampleExport.personAge=Age of case/contact/event participant person @@ -1954,6 +1971,9 @@ Immunization.responsibleRegion=Responsible region Immunization.responsibleDistrict=Responsible district Immunization.responsibleCommunity=Responsible community Immunization.immunizationPeriod=Immunization period +Immunization.region=Region +Immunization.district=District +Immunization.community=Community immunizationImmunizationsList=Immunizations list linkImmunizationToCaseButton=Link case openLinkedCaseToImmunizationButton=Open case @@ -2207,6 +2227,8 @@ Task.taskType=Task type Task.taskAssignee=Task assignee Task.taskPriority=Task priority Task.travelEntry=Travel entry +Task.region=Region +Task.district=District # TestReport TestReport=Test report TestReport.testDateTime=Date and time of result @@ -2246,6 +2268,7 @@ TravelEntry.responsibleRegion=Responsible region TravelEntry.responsibleDistrict=Responsible district TravelEntry.responsibleCommunity=Responsible community TravelEntry.differentPointOfEntryJurisdiction=Point of entry jurisdiction differs from responsible jurisdiction +TravelEntry.pointOfEntry=Point of entry TravelEntry.pointOfEntryRegion=Region TravelEntry.pointOfEntryDistrict=District TravelEntry.pointOfEntryDetails=Point of entry details @@ -2311,6 +2334,9 @@ User.userName=User name User.userRoles=User roles User.address=Address User.uuid=UUID +User.region=Region +User.district=District +User.community=Community # Vaccination vaccinationNewVaccination=New vaccination vaccinationNoVaccinationsForPerson=There are no vaccinations for this person @@ -2458,6 +2484,9 @@ WeeklyReportEntry.numberOfCases=Cases reported # WeeklyReportInformantSummary WeeklyReportInformantSummary.informantReportDate=Informant report submission WeeklyReportInformantSummary.totalCaseCount=Cases reported by informant +WeeklyReportInformantSummary.informant=Informant +WeeklyReportInformantSummary.community=Community +WeeklyReportInformantSummary.facility=Facility # WeeklyReportOfficerSummary WeeklyReportOfficerSummary.informants=Number of informants WeeklyReportOfficerSummary.informantReports=Number of informant reports @@ -2466,6 +2495,7 @@ WeeklyReportOfficerSummary.informantZeroReports=Number of informant zero reports WeeklyReportOfficerSummary.officer=Officer WeeklyReportOfficerSummary.officerReportDate=Officer report submission WeeklyReportOfficerSummary.totalCaseCount=Cases reported by officer +WeeklyReportOfficerSummary.district=District # WeeklyReportRegionSummary WeeklyReportRegionSummary.informants=Number of informants WeeklyReportRegionSummary.informantReports=Number of informant reports @@ -2475,6 +2505,7 @@ WeeklyReportRegionSummary.officers=Number of officers WeeklyReportRegionSummary.officerReports=Number of officers reports WeeklyReportRegionSummary.officerReportPercentage=Percentage WeeklyReportRegionSummary.officerZeroReports=Number of officer zero reports +WeeklyReportRegionSummary.region=Region # SORMAS to SORMAS SormasToSormasOptions.organization=Organization SormasToSormasOptions.withAssociatedContacts=Share associated contacts diff --git a/sormas-api/src/main/resources/captions_sw-KE.properties b/sormas-api/src/main/resources/captions_sw-KE.properties index 1b876fb2e67..9fcb51b560c 100644 --- a/sormas-api/src/main/resources/captions_sw-KE.properties +++ b/sormas-api/src/main/resources/captions_sw-KE.properties @@ -67,6 +67,7 @@ aboutAdditionalInfo=Additional Info aboutCopyright=Copyright aboutDocuments=Documents aboutVersion=Version +versionIsMissing=Version is missing aboutBrandedSormasVersion=%s powered by SORMAS aboutCaseClassificationRules=Case Classification Rules (HTML) aboutChangelog=Full Changelog @@ -362,6 +363,7 @@ caseCreateNew=Create new case caseDataEnterHomeAddressNow=Enter home address of the case person now caseCancelDeletion=Cancel case deletion CaseData=Case +CaseData.ageAndBirthDate=Age and birth date CaseData.additionalDetails=General comment CaseData.caseClassification=Case classification CaseData.caseIdentificationSource=Case identification source @@ -622,6 +624,8 @@ columnVaccineManufacturer=Vaccine manufacturer Community=Community Community.archived=Archived Community.externalID=External ID +Community.region=Region +Community.district=District communityActiveCommunities=Active communities communityArchivedCommunities=Archived communities communityAllCommunities=All communities @@ -677,6 +681,7 @@ contactNumberOfDuplicatesDetected=%d potential duplicates detected contactFilterWithDifferentRegion=Show duplicates with differing regions Contact=Contact Contact.additionalDetails=General comment +Contact.ageAndBirthDate=Age and birth date Contact.caseClassification=Classification of the source case Contact.caze=Source case Contact.caze.ageSex=Age, sex @@ -688,6 +693,7 @@ Contact.cazeDisease=Disease of source case Contact.cazeDiseaseVariant=Disease variant of source case Contact.cazeDistrict=District of source case Contact.community=Responsible community +Contact.completeness=Completeness Contact.contactClassification=Contact classification Contact.contactOfficer=Responsible contact officer Contact.contactOfficerUuid=Responsible contact officer @@ -992,6 +998,7 @@ District.epidCode=Epid code District.growthRate=Growth rate District.population=Population District.externalID=External ID +District.region=Region epiDataNoSourceContacts=No source contacts have been created for this case EpiData=Epidemiological data EpiData.areaInfectedAnimals=Residing, working or travelling to an area where infected animals have been confirmed @@ -1142,6 +1149,9 @@ Event.internalToken=Internal Token Event.eventGroups=Groups Event.latestEventGroup=Latest Event Group Event.eventGroupCount=Event Group Count +Event.region=Region +Event.district=District +Event.community=Community # Event action EventAction.eventUuid=Event id EventAction.eventTitle=Event title @@ -1589,6 +1599,7 @@ Person.approximateAge=Age Person.approximateAgeReferenceDate=Last updated Person.approximateAgeType=Unit Person.birthdate=Date of birth (year / month / day) +Person.birthDate=Date of birth (year / month / day) Person.birthdateDD=Day of birth Person.birthdateMM=Month of birth Person.birthdateYYYY=Year of birth @@ -1684,6 +1695,8 @@ PointOfEntry.latitude=Latitude PointOfEntry.longitude=Longitude PointOfEntry.externalID=External ID PointOfEntry.archived=Archived +PointOfEntry.region=Region +PointOfEntry.district=District populationDataMaleTotal=Male total populationDataFemaleTotal=Female total PortHealthInfo=Port health information @@ -1849,6 +1862,10 @@ Sample.uuid=Sample ID Sample.samplePurpose=Purpose of the Sample Sample.samplingReason=Reason for sampling/testing Sample.samplingReasonDetails=Sampling reason details +Sample.region=Region +Sample.district=District +Sample.community=Community +# Sample Export SampleExport.additionalTestingRequested=Have additional tests been requested? SampleExport.personAddressCaption=Address of case/contact/event participant person SampleExport.personAge=Age of case/contact/event participant person @@ -1954,6 +1971,9 @@ Immunization.responsibleRegion=Responsible region Immunization.responsibleDistrict=Responsible district Immunization.responsibleCommunity=Responsible community Immunization.immunizationPeriod=Immunization period +Immunization.region=Region +Immunization.district=District +Immunization.community=Community immunizationImmunizationsList=Immunizations list linkImmunizationToCaseButton=Link case openLinkedCaseToImmunizationButton=Open case @@ -2207,6 +2227,8 @@ Task.taskType=Task type Task.taskAssignee=Task assignee Task.taskPriority=Task priority Task.travelEntry=Travel entry +Task.region=Region +Task.district=District # TestReport TestReport=Test report TestReport.testDateTime=Date and time of result @@ -2246,6 +2268,7 @@ TravelEntry.responsibleRegion=Responsible region TravelEntry.responsibleDistrict=Responsible district TravelEntry.responsibleCommunity=Responsible community TravelEntry.differentPointOfEntryJurisdiction=Point of entry jurisdiction differs from responsible jurisdiction +TravelEntry.pointOfEntry=Point of entry TravelEntry.pointOfEntryRegion=Region TravelEntry.pointOfEntryDistrict=District TravelEntry.pointOfEntryDetails=Point of entry details @@ -2311,6 +2334,9 @@ User.userName=User name User.userRoles=User roles User.address=Address User.uuid=UUID +User.region=Region +User.district=District +User.community=Community # Vaccination vaccinationNewVaccination=New vaccination vaccinationNoVaccinationsForPerson=There are no vaccinations for this person @@ -2458,6 +2484,9 @@ WeeklyReportEntry.numberOfCases=Cases reported # WeeklyReportInformantSummary WeeklyReportInformantSummary.informantReportDate=Informant report submission WeeklyReportInformantSummary.totalCaseCount=Cases reported by informant +WeeklyReportInformantSummary.informant=Informant +WeeklyReportInformantSummary.community=Community +WeeklyReportInformantSummary.facility=Facility # WeeklyReportOfficerSummary WeeklyReportOfficerSummary.informants=Number of informants WeeklyReportOfficerSummary.informantReports=Number of informant reports @@ -2466,6 +2495,7 @@ WeeklyReportOfficerSummary.informantZeroReports=Number of informant zero reports WeeklyReportOfficerSummary.officer=Officer WeeklyReportOfficerSummary.officerReportDate=Officer report submission WeeklyReportOfficerSummary.totalCaseCount=Cases reported by officer +WeeklyReportOfficerSummary.district=District # WeeklyReportRegionSummary WeeklyReportRegionSummary.informants=Number of informants WeeklyReportRegionSummary.informantReports=Number of informant reports @@ -2475,6 +2505,7 @@ WeeklyReportRegionSummary.officers=Number of officers WeeklyReportRegionSummary.officerReports=Number of officers reports WeeklyReportRegionSummary.officerReportPercentage=Percentage WeeklyReportRegionSummary.officerZeroReports=Number of officer zero reports +WeeklyReportRegionSummary.region=Region # SORMAS to SORMAS SormasToSormasOptions.organization=Organization SormasToSormasOptions.withAssociatedContacts=Share associated contacts diff --git a/sormas-api/src/main/resources/captions_tr-TR.properties b/sormas-api/src/main/resources/captions_tr-TR.properties index 1b876fb2e67..9fcb51b560c 100644 --- a/sormas-api/src/main/resources/captions_tr-TR.properties +++ b/sormas-api/src/main/resources/captions_tr-TR.properties @@ -67,6 +67,7 @@ aboutAdditionalInfo=Additional Info aboutCopyright=Copyright aboutDocuments=Documents aboutVersion=Version +versionIsMissing=Version is missing aboutBrandedSormasVersion=%s powered by SORMAS aboutCaseClassificationRules=Case Classification Rules (HTML) aboutChangelog=Full Changelog @@ -362,6 +363,7 @@ caseCreateNew=Create new case caseDataEnterHomeAddressNow=Enter home address of the case person now caseCancelDeletion=Cancel case deletion CaseData=Case +CaseData.ageAndBirthDate=Age and birth date CaseData.additionalDetails=General comment CaseData.caseClassification=Case classification CaseData.caseIdentificationSource=Case identification source @@ -622,6 +624,8 @@ columnVaccineManufacturer=Vaccine manufacturer Community=Community Community.archived=Archived Community.externalID=External ID +Community.region=Region +Community.district=District communityActiveCommunities=Active communities communityArchivedCommunities=Archived communities communityAllCommunities=All communities @@ -677,6 +681,7 @@ contactNumberOfDuplicatesDetected=%d potential duplicates detected contactFilterWithDifferentRegion=Show duplicates with differing regions Contact=Contact Contact.additionalDetails=General comment +Contact.ageAndBirthDate=Age and birth date Contact.caseClassification=Classification of the source case Contact.caze=Source case Contact.caze.ageSex=Age, sex @@ -688,6 +693,7 @@ Contact.cazeDisease=Disease of source case Contact.cazeDiseaseVariant=Disease variant of source case Contact.cazeDistrict=District of source case Contact.community=Responsible community +Contact.completeness=Completeness Contact.contactClassification=Contact classification Contact.contactOfficer=Responsible contact officer Contact.contactOfficerUuid=Responsible contact officer @@ -992,6 +998,7 @@ District.epidCode=Epid code District.growthRate=Growth rate District.population=Population District.externalID=External ID +District.region=Region epiDataNoSourceContacts=No source contacts have been created for this case EpiData=Epidemiological data EpiData.areaInfectedAnimals=Residing, working or travelling to an area where infected animals have been confirmed @@ -1142,6 +1149,9 @@ Event.internalToken=Internal Token Event.eventGroups=Groups Event.latestEventGroup=Latest Event Group Event.eventGroupCount=Event Group Count +Event.region=Region +Event.district=District +Event.community=Community # Event action EventAction.eventUuid=Event id EventAction.eventTitle=Event title @@ -1589,6 +1599,7 @@ Person.approximateAge=Age Person.approximateAgeReferenceDate=Last updated Person.approximateAgeType=Unit Person.birthdate=Date of birth (year / month / day) +Person.birthDate=Date of birth (year / month / day) Person.birthdateDD=Day of birth Person.birthdateMM=Month of birth Person.birthdateYYYY=Year of birth @@ -1684,6 +1695,8 @@ PointOfEntry.latitude=Latitude PointOfEntry.longitude=Longitude PointOfEntry.externalID=External ID PointOfEntry.archived=Archived +PointOfEntry.region=Region +PointOfEntry.district=District populationDataMaleTotal=Male total populationDataFemaleTotal=Female total PortHealthInfo=Port health information @@ -1849,6 +1862,10 @@ Sample.uuid=Sample ID Sample.samplePurpose=Purpose of the Sample Sample.samplingReason=Reason for sampling/testing Sample.samplingReasonDetails=Sampling reason details +Sample.region=Region +Sample.district=District +Sample.community=Community +# Sample Export SampleExport.additionalTestingRequested=Have additional tests been requested? SampleExport.personAddressCaption=Address of case/contact/event participant person SampleExport.personAge=Age of case/contact/event participant person @@ -1954,6 +1971,9 @@ Immunization.responsibleRegion=Responsible region Immunization.responsibleDistrict=Responsible district Immunization.responsibleCommunity=Responsible community Immunization.immunizationPeriod=Immunization period +Immunization.region=Region +Immunization.district=District +Immunization.community=Community immunizationImmunizationsList=Immunizations list linkImmunizationToCaseButton=Link case openLinkedCaseToImmunizationButton=Open case @@ -2207,6 +2227,8 @@ Task.taskType=Task type Task.taskAssignee=Task assignee Task.taskPriority=Task priority Task.travelEntry=Travel entry +Task.region=Region +Task.district=District # TestReport TestReport=Test report TestReport.testDateTime=Date and time of result @@ -2246,6 +2268,7 @@ TravelEntry.responsibleRegion=Responsible region TravelEntry.responsibleDistrict=Responsible district TravelEntry.responsibleCommunity=Responsible community TravelEntry.differentPointOfEntryJurisdiction=Point of entry jurisdiction differs from responsible jurisdiction +TravelEntry.pointOfEntry=Point of entry TravelEntry.pointOfEntryRegion=Region TravelEntry.pointOfEntryDistrict=District TravelEntry.pointOfEntryDetails=Point of entry details @@ -2311,6 +2334,9 @@ User.userName=User name User.userRoles=User roles User.address=Address User.uuid=UUID +User.region=Region +User.district=District +User.community=Community # Vaccination vaccinationNewVaccination=New vaccination vaccinationNoVaccinationsForPerson=There are no vaccinations for this person @@ -2458,6 +2484,9 @@ WeeklyReportEntry.numberOfCases=Cases reported # WeeklyReportInformantSummary WeeklyReportInformantSummary.informantReportDate=Informant report submission WeeklyReportInformantSummary.totalCaseCount=Cases reported by informant +WeeklyReportInformantSummary.informant=Informant +WeeklyReportInformantSummary.community=Community +WeeklyReportInformantSummary.facility=Facility # WeeklyReportOfficerSummary WeeklyReportOfficerSummary.informants=Number of informants WeeklyReportOfficerSummary.informantReports=Number of informant reports @@ -2466,6 +2495,7 @@ WeeklyReportOfficerSummary.informantZeroReports=Number of informant zero reports WeeklyReportOfficerSummary.officer=Officer WeeklyReportOfficerSummary.officerReportDate=Officer report submission WeeklyReportOfficerSummary.totalCaseCount=Cases reported by officer +WeeklyReportOfficerSummary.district=District # WeeklyReportRegionSummary WeeklyReportRegionSummary.informants=Number of informants WeeklyReportRegionSummary.informantReports=Number of informant reports @@ -2475,6 +2505,7 @@ WeeklyReportRegionSummary.officers=Number of officers WeeklyReportRegionSummary.officerReports=Number of officers reports WeeklyReportRegionSummary.officerReportPercentage=Percentage WeeklyReportRegionSummary.officerZeroReports=Number of officer zero reports +WeeklyReportRegionSummary.region=Region # SORMAS to SORMAS SormasToSormasOptions.organization=Organization SormasToSormasOptions.withAssociatedContacts=Share associated contacts diff --git a/sormas-api/src/main/resources/captions_uk-UA.properties b/sormas-api/src/main/resources/captions_uk-UA.properties index 1b876fb2e67..9fcb51b560c 100644 --- a/sormas-api/src/main/resources/captions_uk-UA.properties +++ b/sormas-api/src/main/resources/captions_uk-UA.properties @@ -67,6 +67,7 @@ aboutAdditionalInfo=Additional Info aboutCopyright=Copyright aboutDocuments=Documents aboutVersion=Version +versionIsMissing=Version is missing aboutBrandedSormasVersion=%s powered by SORMAS aboutCaseClassificationRules=Case Classification Rules (HTML) aboutChangelog=Full Changelog @@ -362,6 +363,7 @@ caseCreateNew=Create new case caseDataEnterHomeAddressNow=Enter home address of the case person now caseCancelDeletion=Cancel case deletion CaseData=Case +CaseData.ageAndBirthDate=Age and birth date CaseData.additionalDetails=General comment CaseData.caseClassification=Case classification CaseData.caseIdentificationSource=Case identification source @@ -622,6 +624,8 @@ columnVaccineManufacturer=Vaccine manufacturer Community=Community Community.archived=Archived Community.externalID=External ID +Community.region=Region +Community.district=District communityActiveCommunities=Active communities communityArchivedCommunities=Archived communities communityAllCommunities=All communities @@ -677,6 +681,7 @@ contactNumberOfDuplicatesDetected=%d potential duplicates detected contactFilterWithDifferentRegion=Show duplicates with differing regions Contact=Contact Contact.additionalDetails=General comment +Contact.ageAndBirthDate=Age and birth date Contact.caseClassification=Classification of the source case Contact.caze=Source case Contact.caze.ageSex=Age, sex @@ -688,6 +693,7 @@ Contact.cazeDisease=Disease of source case Contact.cazeDiseaseVariant=Disease variant of source case Contact.cazeDistrict=District of source case Contact.community=Responsible community +Contact.completeness=Completeness Contact.contactClassification=Contact classification Contact.contactOfficer=Responsible contact officer Contact.contactOfficerUuid=Responsible contact officer @@ -992,6 +998,7 @@ District.epidCode=Epid code District.growthRate=Growth rate District.population=Population District.externalID=External ID +District.region=Region epiDataNoSourceContacts=No source contacts have been created for this case EpiData=Epidemiological data EpiData.areaInfectedAnimals=Residing, working or travelling to an area where infected animals have been confirmed @@ -1142,6 +1149,9 @@ Event.internalToken=Internal Token Event.eventGroups=Groups Event.latestEventGroup=Latest Event Group Event.eventGroupCount=Event Group Count +Event.region=Region +Event.district=District +Event.community=Community # Event action EventAction.eventUuid=Event id EventAction.eventTitle=Event title @@ -1589,6 +1599,7 @@ Person.approximateAge=Age Person.approximateAgeReferenceDate=Last updated Person.approximateAgeType=Unit Person.birthdate=Date of birth (year / month / day) +Person.birthDate=Date of birth (year / month / day) Person.birthdateDD=Day of birth Person.birthdateMM=Month of birth Person.birthdateYYYY=Year of birth @@ -1684,6 +1695,8 @@ PointOfEntry.latitude=Latitude PointOfEntry.longitude=Longitude PointOfEntry.externalID=External ID PointOfEntry.archived=Archived +PointOfEntry.region=Region +PointOfEntry.district=District populationDataMaleTotal=Male total populationDataFemaleTotal=Female total PortHealthInfo=Port health information @@ -1849,6 +1862,10 @@ Sample.uuid=Sample ID Sample.samplePurpose=Purpose of the Sample Sample.samplingReason=Reason for sampling/testing Sample.samplingReasonDetails=Sampling reason details +Sample.region=Region +Sample.district=District +Sample.community=Community +# Sample Export SampleExport.additionalTestingRequested=Have additional tests been requested? SampleExport.personAddressCaption=Address of case/contact/event participant person SampleExport.personAge=Age of case/contact/event participant person @@ -1954,6 +1971,9 @@ Immunization.responsibleRegion=Responsible region Immunization.responsibleDistrict=Responsible district Immunization.responsibleCommunity=Responsible community Immunization.immunizationPeriod=Immunization period +Immunization.region=Region +Immunization.district=District +Immunization.community=Community immunizationImmunizationsList=Immunizations list linkImmunizationToCaseButton=Link case openLinkedCaseToImmunizationButton=Open case @@ -2207,6 +2227,8 @@ Task.taskType=Task type Task.taskAssignee=Task assignee Task.taskPriority=Task priority Task.travelEntry=Travel entry +Task.region=Region +Task.district=District # TestReport TestReport=Test report TestReport.testDateTime=Date and time of result @@ -2246,6 +2268,7 @@ TravelEntry.responsibleRegion=Responsible region TravelEntry.responsibleDistrict=Responsible district TravelEntry.responsibleCommunity=Responsible community TravelEntry.differentPointOfEntryJurisdiction=Point of entry jurisdiction differs from responsible jurisdiction +TravelEntry.pointOfEntry=Point of entry TravelEntry.pointOfEntryRegion=Region TravelEntry.pointOfEntryDistrict=District TravelEntry.pointOfEntryDetails=Point of entry details @@ -2311,6 +2334,9 @@ User.userName=User name User.userRoles=User roles User.address=Address User.uuid=UUID +User.region=Region +User.district=District +User.community=Community # Vaccination vaccinationNewVaccination=New vaccination vaccinationNoVaccinationsForPerson=There are no vaccinations for this person @@ -2458,6 +2484,9 @@ WeeklyReportEntry.numberOfCases=Cases reported # WeeklyReportInformantSummary WeeklyReportInformantSummary.informantReportDate=Informant report submission WeeklyReportInformantSummary.totalCaseCount=Cases reported by informant +WeeklyReportInformantSummary.informant=Informant +WeeklyReportInformantSummary.community=Community +WeeklyReportInformantSummary.facility=Facility # WeeklyReportOfficerSummary WeeklyReportOfficerSummary.informants=Number of informants WeeklyReportOfficerSummary.informantReports=Number of informant reports @@ -2466,6 +2495,7 @@ WeeklyReportOfficerSummary.informantZeroReports=Number of informant zero reports WeeklyReportOfficerSummary.officer=Officer WeeklyReportOfficerSummary.officerReportDate=Officer report submission WeeklyReportOfficerSummary.totalCaseCount=Cases reported by officer +WeeklyReportOfficerSummary.district=District # WeeklyReportRegionSummary WeeklyReportRegionSummary.informants=Number of informants WeeklyReportRegionSummary.informantReports=Number of informant reports @@ -2475,6 +2505,7 @@ WeeklyReportRegionSummary.officers=Number of officers WeeklyReportRegionSummary.officerReports=Number of officers reports WeeklyReportRegionSummary.officerReportPercentage=Percentage WeeklyReportRegionSummary.officerZeroReports=Number of officer zero reports +WeeklyReportRegionSummary.region=Region # SORMAS to SORMAS SormasToSormasOptions.organization=Organization SormasToSormasOptions.withAssociatedContacts=Share associated contacts diff --git a/sormas-api/src/main/resources/captions_ur-PK.properties b/sormas-api/src/main/resources/captions_ur-PK.properties index c39791298e4..0a089f047ff 100644 --- a/sormas-api/src/main/resources/captions_ur-PK.properties +++ b/sormas-api/src/main/resources/captions_ur-PK.properties @@ -67,6 +67,7 @@ aboutAdditionalInfo=اضافی معلومات aboutCopyright=کاپی رائٹ aboutDocuments=دستاویزات aboutVersion=ورژن +versionIsMissing=ورژن موجود نہیں ہے aboutBrandedSormasVersion=%s پاورڈ باۓ سورماس aboutCaseClassificationRules=کیس کی درجہ بندی کے قواعد (HTML) aboutChangelog=مکمل تبدیلی لاگ @@ -362,6 +363,7 @@ caseCreateNew=نیا کیس بنائیں caseDataEnterHomeAddressNow=ابھی کیس والے شخص کے گھر کا پتہ درج کریں caseCancelDeletion=کیس ڈیلیٹ کرنا منسوخ کریں CaseData=کیس +CaseData.ageAndBirthDate=عمر اور تاریخ پیدائش CaseData.additionalDetails=عمومی تبصرہ CaseData.caseClassification=کیس کی درجہ بندی CaseData.caseIdentificationSource=کیس کی شناخت کا ذریعہ @@ -622,6 +624,8 @@ columnVaccineManufacturer=ویکسین بنانے والا Community=کمیونیٹی Community.archived=آرکائیوڈ Community.externalID=بیرونی شناخت +Community.region=علاقہ +Community.district=ضلع communityActiveCommunities=فعال کمیونٹیز communityArchivedCommunities=آرکائیو شدہ کمیونٹیز communityAllCommunities=تمام کمیونٹیز @@ -677,6 +681,7 @@ contactNumberOfDuplicatesDetected=%d ممکنہ نقول کا پتہ چلا contactFilterWithDifferentRegion=مختلف علاقوں کے ساتھ ڈپلیکیٹس دکھائیں Contact=رابطہ Contact.additionalDetails=عمومی تبصرہ +Contact.ageAndBirthDate=عمر اور تاریخ پیدائش Contact.caseClassification=سورس کیس کی درجہ بندی Contact.caze=سورس کیس Contact.caze.ageSex=عمر، جنس @@ -688,6 +693,7 @@ Contact.cazeDisease=سورس کیس کی بیماری Contact.cazeDiseaseVariant=سورس کیس کی بیماری کی قسم Contact.cazeDistrict=سورس کیس کا ضلع Contact.community=ذمہ دار کمیونیٹی +Contact.completeness=مکمل پن Contact.contactClassification=رابطہ کی درجہ بندی Contact.contactOfficer=ذمہ دار رابطہ افسر Contact.contactOfficerUuid=ذمہ دار رابطہ افسر @@ -992,6 +998,7 @@ District.epidCode=Epid کوڈ District.growthRate=اضافے کی شرح District.population=آبادی District.externalID=بیرونی شناخت +District.region=علاقہ epiDataNoSourceContacts=اس کیس کے لیے کوئی سورس رابطہ نہیں بنایا گیا ہے EpiData=وبائی امراض کا ڈیٹا EpiData.areaInfectedAnimals=کسی ایسے خطے میں رہنا، کام کرنا یا سفر کرنا جہاں متاثرہ جانوروں کی تصدیق ہوئی ہو @@ -1142,6 +1149,9 @@ Event.internalToken=اندرونی ٹوکن Event.eventGroups=گروہ Event.latestEventGroup=تازہ ترین تقریبی گروہ Event.eventGroupCount=تقریبی گروہ کی گنتی +Event.region=علاقہ +Event.district=ضلع +Event.community=کمیونیٹی # Event action EventAction.eventUuid=تقریب کی شناخت EventAction.eventTitle=واقعہ کا عنوان @@ -1589,6 +1599,7 @@ Person.approximateAge=عمر Person.approximateAgeReferenceDate=آخری بار اپ ڈیٹ کیا گیا Person.approximateAgeType=اکائی Person.birthdate=تاریخ پیدائش (سال/مہینہ/دن) +Person.birthDate=تاریخ پیدائش (سال/مہینہ/دن) Person.birthdateDD=پیدائش کا دن Person.birthdateMM=پیدائش کا مہینہ Person.birthdateYYYY=پیدائش کا سال @@ -1684,6 +1695,8 @@ PointOfEntry.latitude=عرض بلد PointOfEntry.longitude=طول البلد PointOfEntry.externalID=بیرونی شناخت PointOfEntry.archived=آرکائیوڈ +PointOfEntry.region=علاقہ +PointOfEntry.district=ضلع populationDataMaleTotal=کل مرد populationDataFemaleTotal=کل خواتین PortHealthInfo=پورٹ کی صحت کی معلومات @@ -1849,6 +1862,10 @@ Sample.uuid=نمونہ کی شناخت Sample.samplePurpose=نمونہ کا مقصد Sample.samplingReason=نمونے لینے/ٹیسٹ کرنے کی وجہ Sample.samplingReasonDetails=نمونے لینے کی وجہ کی تفصیلات +Sample.region=علاقہ +Sample.district=ضلع +Sample.community=کمیونیٹی +# Sample Export SampleExport.additionalTestingRequested=کیا اضافی ٹیسٹ کی درخواست کی گئی ہے؟ SampleExport.personAddressCaption=کیس/رابطہ/تقریب میں شریک شخص کا پتہ SampleExport.personAge=کیس/رابطہ/تقریب میں شریک شخص کی عمر @@ -1954,6 +1971,9 @@ Immunization.responsibleRegion=ذمہ دار علاقہ Immunization.responsibleDistrict=ذمہ دار ضلع Immunization.responsibleCommunity=ذمہ دار کمیونیٹی Immunization.immunizationPeriod=امیونائزیشن کی مدت +Immunization.region=علاقہ +Immunization.district=ضلع +Immunization.community=کمیونیٹی immunizationImmunizationsList=امیونائزیشن کی فہرست linkImmunizationToCaseButton=لنک کیس openLinkedCaseToImmunizationButton=کھلا کیس @@ -2207,6 +2227,8 @@ Task.taskType=کام کی قسم Task.taskAssignee=ٹاسک دينے والا Task.taskPriority=کام کی ترجیح Task.travelEntry=سفری اندراج +Task.region=علاقہ +Task.district=ضلع # TestReport TestReport=ٹیسٹ رپورٹ TestReport.testDateTime=نتیجہ کی تاریخ اور وقت @@ -2246,6 +2268,7 @@ TravelEntry.responsibleRegion=ذمہ دار علاقہ TravelEntry.responsibleDistrict=ذمہ دار ضلع TravelEntry.responsibleCommunity=ذمہ دار کمیونیٹی TravelEntry.differentPointOfEntryJurisdiction=داخلے کی جگہ کا دائرہ اختیار ذمہ دار دائرہ اختیار سے مختلف ہے +TravelEntry.pointOfEntry=داخلے کی جگہ TravelEntry.pointOfEntryRegion=علاقہ TravelEntry.pointOfEntryDistrict=ضلع TravelEntry.pointOfEntryDetails=داخلے کی جگہ کی تفصیلات @@ -2311,6 +2334,9 @@ User.userName=صارف کا نام User.userRoles=صارف کے کردار User.address=پتہ User.uuid=UUID +User.region=علاقہ +User.district=ضلع +User.community=کمیونیٹی # Vaccination vaccinationNewVaccination=نئی ویکسینیشن vaccinationNoVaccinationsForPerson=اس شخص کے لیے کوئی ویکسینیشن نہیں ہے @@ -2458,6 +2484,9 @@ WeeklyReportEntry.numberOfCases=کیسز رپورٹ ہوئے # WeeklyReportInformantSummary WeeklyReportInformantSummary.informantReportDate=مخبر کی دی گئ رپورٹ WeeklyReportInformantSummary.totalCaseCount=مخبر کی طرف سے رپورٹ کردہ کیسز +WeeklyReportInformantSummary.informant=مخبر +WeeklyReportInformantSummary.community=کمیونیٹی +WeeklyReportInformantSummary.facility=سہولت گاہ # WeeklyReportOfficerSummary WeeklyReportOfficerSummary.informants=مخبروں کی تعداد WeeklyReportOfficerSummary.informantReports=مخبر رپورٹس کی تعداد @@ -2466,6 +2495,7 @@ WeeklyReportOfficerSummary.informantZeroReports=مخبر رپورٹس کی تع WeeklyReportOfficerSummary.officer=افسر WeeklyReportOfficerSummary.officerReportDate=افسر کی دی گئ رپورٹ WeeklyReportOfficerSummary.totalCaseCount=افسر کی طرف سے رپورٹ کردہ کیسز +WeeklyReportOfficerSummary.district=ضلع # WeeklyReportRegionSummary WeeklyReportRegionSummary.informants=مخبروں کی تعداد WeeklyReportRegionSummary.informantReports=مخبر رپورٹس کی تعداد @@ -2475,6 +2505,7 @@ WeeklyReportRegionSummary.officers=افسران کی تعداد WeeklyReportRegionSummary.officerReports=افسر رپورٹس کی تعداد WeeklyReportRegionSummary.officerReportPercentage=فیصد WeeklyReportRegionSummary.officerZeroReports=افسر رپورٹس کی تعداد صفر +WeeklyReportRegionSummary.region=علاقہ # SORMAS to SORMAS SormasToSormasOptions.organization=تنظیم SormasToSormasOptions.withAssociatedContacts=وابستہ رابطوں کو اشتراک شیئر کریں diff --git a/sormas-api/src/main/resources/captions_zh-CN.properties b/sormas-api/src/main/resources/captions_zh-CN.properties index 8167a528f38..b609fab81e4 100644 --- a/sormas-api/src/main/resources/captions_zh-CN.properties +++ b/sormas-api/src/main/resources/captions_zh-CN.properties @@ -67,6 +67,7 @@ aboutAdditionalInfo=附加信息 aboutCopyright=版权 aboutDocuments=文件 aboutVersion=Version +versionIsMissing=Version is missing aboutBrandedSormasVersion=%s 由 SORMAS 支持 aboutCaseClassificationRules=案例分类规则 (HTML) aboutChangelog=完整更新日志 @@ -362,6 +363,7 @@ caseCreateNew=Create new case caseDataEnterHomeAddressNow=Enter home address of the case person now caseCancelDeletion=Cancel case deletion CaseData=Case +CaseData.ageAndBirthDate=Age and birth date CaseData.additionalDetails=General comment CaseData.caseClassification=Case classification CaseData.caseIdentificationSource=Case identification source @@ -622,6 +624,8 @@ columnVaccineManufacturer=Vaccine manufacturer Community=Community Community.archived=Archived Community.externalID=External ID +Community.region=Region +Community.district=District communityActiveCommunities=Active communities communityArchivedCommunities=Archived communities communityAllCommunities=All communities @@ -677,6 +681,7 @@ contactNumberOfDuplicatesDetected=%d potential duplicates detected contactFilterWithDifferentRegion=Show duplicates with differing regions Contact=Contact Contact.additionalDetails=General comment +Contact.ageAndBirthDate=Age and birth date Contact.caseClassification=Classification of the source case Contact.caze=Source case Contact.caze.ageSex=Age, sex @@ -688,6 +693,7 @@ Contact.cazeDisease=Disease of source case Contact.cazeDiseaseVariant=Disease variant of source case Contact.cazeDistrict=District of source case Contact.community=Responsible community +Contact.completeness=Completeness Contact.contactClassification=Contact classification Contact.contactOfficer=Responsible contact officer Contact.contactOfficerUuid=Responsible contact officer @@ -992,6 +998,7 @@ District.epidCode=Epid code District.growthRate=Growth rate District.population=Population District.externalID=External ID +District.region=Region epiDataNoSourceContacts=No source contacts have been created for this case EpiData=Epidemiological data EpiData.areaInfectedAnimals=Residing, working or travelling to an area where infected animals have been confirmed @@ -1142,6 +1149,9 @@ Event.internalToken=Internal Token Event.eventGroups=Groups Event.latestEventGroup=Latest Event Group Event.eventGroupCount=Event Group Count +Event.region=Region +Event.district=District +Event.community=Community # Event action EventAction.eventUuid=Event id EventAction.eventTitle=Event title @@ -1589,6 +1599,7 @@ Person.approximateAge=Age Person.approximateAgeReferenceDate=Last updated Person.approximateAgeType=Unit Person.birthdate=Date of birth (year / month / day) +Person.birthDate=Date of birth (year / month / day) Person.birthdateDD=Day of birth Person.birthdateMM=Month of birth Person.birthdateYYYY=Year of birth @@ -1684,6 +1695,8 @@ PointOfEntry.latitude=Latitude PointOfEntry.longitude=Longitude PointOfEntry.externalID=External ID PointOfEntry.archived=Archived +PointOfEntry.region=Region +PointOfEntry.district=District populationDataMaleTotal=Male total populationDataFemaleTotal=Female total PortHealthInfo=Port health information @@ -1849,6 +1862,10 @@ Sample.uuid=Sample ID Sample.samplePurpose=Purpose of the Sample Sample.samplingReason=Reason for sampling/testing Sample.samplingReasonDetails=Sampling reason details +Sample.region=Region +Sample.district=District +Sample.community=Community +# Sample Export SampleExport.additionalTestingRequested=Have additional tests been requested? SampleExport.personAddressCaption=Address of case/contact/event participant person SampleExport.personAge=Age of case/contact/event participant person @@ -1954,6 +1971,9 @@ Immunization.responsibleRegion=Responsible region Immunization.responsibleDistrict=Responsible district Immunization.responsibleCommunity=Responsible community Immunization.immunizationPeriod=Immunization period +Immunization.region=Region +Immunization.district=District +Immunization.community=Community immunizationImmunizationsList=Immunizations list linkImmunizationToCaseButton=Link case openLinkedCaseToImmunizationButton=Open case @@ -2207,6 +2227,8 @@ Task.taskType=Task type Task.taskAssignee=Task assignee Task.taskPriority=Task priority Task.travelEntry=Travel entry +Task.region=Region +Task.district=District # TestReport TestReport=Test report TestReport.testDateTime=Date and time of result @@ -2246,6 +2268,7 @@ TravelEntry.responsibleRegion=Responsible region TravelEntry.responsibleDistrict=Responsible district TravelEntry.responsibleCommunity=Responsible community TravelEntry.differentPointOfEntryJurisdiction=Point of entry jurisdiction differs from responsible jurisdiction +TravelEntry.pointOfEntry=Point of entry TravelEntry.pointOfEntryRegion=Region TravelEntry.pointOfEntryDistrict=District TravelEntry.pointOfEntryDetails=Point of entry details @@ -2311,6 +2334,9 @@ User.userName=User name User.userRoles=User roles User.address=Address User.uuid=UUID +User.region=Region +User.district=District +User.community=Community # Vaccination vaccinationNewVaccination=New vaccination vaccinationNoVaccinationsForPerson=There are no vaccinations for this person @@ -2458,6 +2484,9 @@ WeeklyReportEntry.numberOfCases=Cases reported # WeeklyReportInformantSummary WeeklyReportInformantSummary.informantReportDate=Informant report submission WeeklyReportInformantSummary.totalCaseCount=Cases reported by informant +WeeklyReportInformantSummary.informant=Informant +WeeklyReportInformantSummary.community=Community +WeeklyReportInformantSummary.facility=Facility # WeeklyReportOfficerSummary WeeklyReportOfficerSummary.informants=Number of informants WeeklyReportOfficerSummary.informantReports=Number of informant reports @@ -2466,6 +2495,7 @@ WeeklyReportOfficerSummary.informantZeroReports=Number of informant zero reports WeeklyReportOfficerSummary.officer=Officer WeeklyReportOfficerSummary.officerReportDate=Officer report submission WeeklyReportOfficerSummary.totalCaseCount=Cases reported by officer +WeeklyReportOfficerSummary.district=District # WeeklyReportRegionSummary WeeklyReportRegionSummary.informants=Number of informants WeeklyReportRegionSummary.informantReports=Number of informant reports @@ -2475,6 +2505,7 @@ WeeklyReportRegionSummary.officers=Number of officers WeeklyReportRegionSummary.officerReports=Number of officers reports WeeklyReportRegionSummary.officerReportPercentage=Percentage WeeklyReportRegionSummary.officerZeroReports=Number of officer zero reports +WeeklyReportRegionSummary.region=Region # SORMAS to SORMAS SormasToSormasOptions.organization=Organization SormasToSormasOptions.withAssociatedContacts=Share associated contacts From c8919fa0aa7f7efeb5ec4d481c562cca7906c9b6 Mon Sep 17 00:00:00 2001 From: Michal Kozakiewicz Date: Wed, 11 May 2022 11:57:24 +0200 Subject: [PATCH 072/167] Remove spaces from TravelEntryPage --- .../e2etests/pages/application/entries/TravelEntryPage.java | 1 - 1 file changed, 1 deletion(-) diff --git a/sormas-e2e-tests/src/main/java/org/sormas/e2etests/pages/application/entries/TravelEntryPage.java b/sormas-e2e-tests/src/main/java/org/sormas/e2etests/pages/application/entries/TravelEntryPage.java index 4d8a0b0c487..41a31c969c8 100644 --- a/sormas-e2e-tests/src/main/java/org/sormas/e2etests/pages/application/entries/TravelEntryPage.java +++ b/sormas-e2e-tests/src/main/java/org/sormas/e2etests/pages/application/entries/TravelEntryPage.java @@ -56,7 +56,6 @@ public static By getCheckboxByIndex(String idx) { public static final By LAST_NAME_IMPORTED_PERSON = By.xpath("//span[text()='Nachname']/../following-sibling::div"); public static final By FIRST_RESULT_ID = By.xpath("//table/tbody/tr[2]/td[1]"); - public static final By TRAVEL_ENTRY_DATA_FILTER_OPTION_COMBOBOX = By.cssSelector("[id='dateFilterOption'] [class='v-filterselect-button']"); public static final By WEEK_FROM_OPTION_COMBOBOX = From 72c268841e73ab920a664522fcdd0d6bcf1d335c Mon Sep 17 00:00:00 2001 From: dinua Date: Wed, 11 May 2022 14:48:29 +0300 Subject: [PATCH 073/167] #8978 delete in bulk --- .../sormas/api/therapy/TreatmentFacade.java | 2 +- .../src/main/resources/captions.properties | 6 ++-- .../src/main/resources/strings.properties | 2 +- .../backend/therapy/TreatmentFacadeEjb.java | 4 +-- .../therapy/TreatmentFacadeEjbTest.java | 5 +++- .../sormas/ui/therapy/TherapyController.java | 28 +++++++++++++++---- 6 files changed, 34 insertions(+), 13 deletions(-) diff --git a/sormas-api/src/main/java/de/symeda/sormas/api/therapy/TreatmentFacade.java b/sormas-api/src/main/java/de/symeda/sormas/api/therapy/TreatmentFacade.java index 8c412f11f51..854eff7833f 100644 --- a/sormas-api/src/main/java/de/symeda/sormas/api/therapy/TreatmentFacade.java +++ b/sormas-api/src/main/java/de/symeda/sormas/api/therapy/TreatmentFacade.java @@ -14,7 +14,7 @@ public interface TreatmentFacade { List getIndexList(TreatmentCriteria criteria); - List getTreatmentForPrescription(String prescriptionUuid); + List getTreatmentForPrescription(List prescriptionUuids); TreatmentDto getTreatmentByUuid(String uuid); diff --git a/sormas-api/src/main/resources/captions.properties b/sormas-api/src/main/resources/captions.properties index 8cc361a4cc1..40b66c1b3a3 100644 --- a/sormas-api/src/main/resources/captions.properties +++ b/sormas-api/src/main/resources/captions.properties @@ -1729,9 +1729,9 @@ Prescription.routeDetails=Route specification Prescription.typeOfDrug=Type of drug PrescriptionExport.caseUuid=Case ID PrescriptionExport.caseName=Case name -prescriptionWithTreatmentTitleDelete=Delete Prescription With Treatments -prescriptionAlone=Just Prescription -prescriptionWithTreatment=Prescription With Treatments +prescriptionWithTreatmentTitleDelete=Delete Prescriptions With Treatments +prescriptionAlone=Just Prescriptions +prescriptionWithTreatment=Prescriptions With Treatments # Continent continentActiveContinents=Active continents continentArchivedContinents=Archived continents diff --git a/sormas-api/src/main/resources/strings.properties b/sormas-api/src/main/resources/strings.properties index 22ef90907b7..7e140580cd1 100644 --- a/sormas-api/src/main/resources/strings.properties +++ b/sormas-api/src/main/resources/strings.properties @@ -153,7 +153,7 @@ confirmationDeleteSamples = Are you sure you want to delete all %d selected samp confirmationDeleteTasks = Are you sure you want to delete all %d selected tasks? confirmationDeleteTreatments = Are you sure you want to delete all %d selected treatments? confirmationDeleteVisits = Are you sure you want to delete all %d selected visits? -confirmationDeletePrescriptionWithTreatment = This prescription is assign to treatment. Do you want to delete this prescription alone or also the treatments with ? +confirmationDeletePrescriptionWithTreatment = Those prescriptions are assign to treatment. Do you want to delete the prescriptions alone or also the treatments with ? confirmationLostToFollowUp = Are you sure you want to set the follow-up of all %d selected contacts to lost to follow-up? confirmationPickCaseAndDeleteOther = Are you sure that the case you did not select is a duplicate of this case? The case you did not select and all contacts, samples, tasks and other data linked to it will be deleted. confirmationPickContactAndDeleteOther = Are you sure that the contact you did not select is a duplicate of this contact? The contact you did not select and all samples, tasks and other data linked to it will be deleted. diff --git a/sormas-backend/src/main/java/de/symeda/sormas/backend/therapy/TreatmentFacadeEjb.java b/sormas-backend/src/main/java/de/symeda/sormas/backend/therapy/TreatmentFacadeEjb.java index bd52d3e6743..26a1152ee48 100644 --- a/sormas-backend/src/main/java/de/symeda/sormas/backend/therapy/TreatmentFacadeEjb.java +++ b/sormas-backend/src/main/java/de/symeda/sormas/backend/therapy/TreatmentFacadeEjb.java @@ -97,7 +97,7 @@ public List getIndexList(TreatmentCriteria criteria) { } @Override - public List getTreatmentForPrescription(String prescriptionUuid) { + public List getTreatmentForPrescription(List prescriptionUuids) { CriteriaBuilder cb = em.getCriteriaBuilder(); CriteriaQuery cq = cb.createQuery(TreatmentIndexDto.class); Root treatment = cq.from(Treatment.class); @@ -116,7 +116,7 @@ public List getTreatmentForPrescription(String prescriptionUu JurisdictionHelper.booleanSelector(cb, caseService.inJurisdictionOrOwned(new CaseQueryContext(cb, cq, joins.getCaseJoins())))); Predicate filter = null; - filter = cb.equal(joins.getPrescription().get(Prescription.UUID), prescriptionUuid); + filter = joins.getPrescription().get(Prescription.UUID).in(prescriptionUuids); if(filter != null) { cq.where(filter); diff --git a/sormas-backend/src/test/java/de/symeda/sormas/backend/therapy/TreatmentFacadeEjbTest.java b/sormas-backend/src/test/java/de/symeda/sormas/backend/therapy/TreatmentFacadeEjbTest.java index 99e73f18eb4..e082aeb41cf 100644 --- a/sormas-backend/src/test/java/de/symeda/sormas/backend/therapy/TreatmentFacadeEjbTest.java +++ b/sormas-backend/src/test/java/de/symeda/sormas/backend/therapy/TreatmentFacadeEjbTest.java @@ -75,7 +75,10 @@ public void testTreatmentForPrescription() { t.setPrescription(prescription.toReference()); }); - List results = getTreatmentFacade().getTreatmentForPrescription(prescription.getUuid()); + List prescriptionUuids = new ArrayList<>(); + prescriptionUuids.add(prescription.getUuid()); + + List results = getTreatmentFacade().getTreatmentForPrescription(prescriptionUuids); assertEquals(2, results.size()); List treatmentUuids = results.stream().map(t->t.getUuid()).collect(Collectors.toList()); assertTrue(treatmentUuids.contains(prescriptionTreatment1.getUuid())); diff --git a/sormas-ui/src/main/java/de/symeda/sormas/ui/therapy/TherapyController.java b/sormas-ui/src/main/java/de/symeda/sormas/ui/therapy/TherapyController.java index c125cddda41..7ba13486eb2 100644 --- a/sormas-ui/src/main/java/de/symeda/sormas/ui/therapy/TherapyController.java +++ b/sormas-ui/src/main/java/de/symeda/sormas/ui/therapy/TherapyController.java @@ -1,5 +1,6 @@ package de.symeda.sormas.ui.therapy; +import java.util.ArrayList; import java.util.Collection; import java.util.List; import java.util.function.Consumer; @@ -93,9 +94,11 @@ public void onCommit() { @Override public void onDelete() { - List treatmentDtos = FacadeProvider.getTreatmentFacade().getTreatmentForPrescription(prescription.getUuid()); + List prescriptionUuids = new ArrayList<>(); + prescriptionUuids.add(prescription.getUuid()); + List treatmentDtos = FacadeProvider.getTreatmentFacade().getTreatmentForPrescription(prescriptionUuids); if(treatmentDtos.size() > 0 ){ - handleDeletePrescriptionWithTreatments(treatmentDtos, prescription.getUuid()); + handleDeletePrescriptionWithTreatments(treatmentDtos, prescriptionUuids); } else { FacadeProvider.getPrescriptionFacade().deletePrescription(prescription.getUuid()); @@ -109,7 +112,7 @@ public void onDelete() { } } - private void handleDeletePrescriptionWithTreatments(List treatmentIndexDtos , String prescriptionUuid){ + private void handleDeletePrescriptionWithTreatments(List treatmentIndexDtos , List prescriptionUuids){ Consumer resultConsumer = new Consumer() { @Override @@ -124,7 +127,9 @@ public void accept(Boolean option) { //delete the prescription and all the treatments assign with FacadeProvider.getTreatmentFacade().deleteTreatments(treatmentUuids); } - FacadeProvider.getPrescriptionFacade().deletePrescription(prescriptionUuid); + for(String prescriptionUuid : prescriptionUuids){ + FacadeProvider.getPrescriptionFacade().deletePrescription(prescriptionUuid); + } SormasUI.refreshView(); } }; @@ -239,9 +244,22 @@ public void deleteAllSelectedPrescriptions(Collection selectedRows, Runn new Runnable() { public void run() { + List prescriptionUuids = new ArrayList<>(); for (Object selectedRow : selectedRows) { - FacadeProvider.getPrescriptionFacade().deletePrescription(((PrescriptionIndexDto) selectedRow).getUuid()); + prescriptionUuids.add(((PrescriptionIndexDto) selectedRow).getUuid()); + + } + + List treatmentDtos = FacadeProvider.getTreatmentFacade().getTreatmentForPrescription(prescriptionUuids); + if(treatmentDtos.size() > 0 ){ + handleDeletePrescriptionWithTreatments(treatmentDtos, prescriptionUuids); + } + else { + for(String prescriptionUuid : prescriptionUuids) { + FacadeProvider.getPrescriptionFacade().deletePrescription(prescriptionUuid); + } } + callback.run(); new Notification( I18nProperties.getString(Strings.headingPrescriptionsDeleted), From 0214b0e8a4816469b9563553d096ab57180b591f Mon Sep 17 00:00:00 2001 From: Levente Gal <62599627+leventegal-she@users.noreply.github.com> Date: Wed, 11 May 2022 15:31:28 +0300 Subject: [PATCH 074/167] #7375 refactor labmessage controller (#9005) --- .../de/symeda/sormas/api/event/EventDto.java | 15 + .../sormas/api/event/EventIndexDto.java | 3 + .../sormas/ui/events/EventController.java | 11 +- .../ui/labmessage/EntrySelectionField.java | 34 +- .../ui/labmessage/LabMessageController.java | 1098 +---------- .../labmessage/LabMessageProcessingFlow.java | 425 +++++ .../ui/labmessage/LabMessageUiHelper.java | 3 + .../labmessage/RelatedLabMessageHandler.java | 633 +++---- .../AbstractLabMessageProcessingFlow.java | 699 +++++++ .../AbstractRelatedLabMessageHandler.java | 503 +++++ .../LabMessageProcessingHelper.java | 53 + .../LabMessageProcessingUIHelper.java | 359 ++++ .../processing/PickOrCreateEntryResult.java | 34 +- .../processing/PickOrCreateEventResult.java | 43 + .../processing/PickOrCreateSampleResult.java | 48 + .../processing/SampleAndPathogenTests.java | 42 + .../processing/flow/FlowAction.java | 26 + .../processing/flow/FlowSwitch.java | 78 + .../labmessage/processing/flow/FlowThen.java | 56 + .../processing/flow/ProcessingResult.java | 56 + .../flow/ProcessingResultStatus.java | 43 + .../sormas/ui/person/PersonController.java | 14 +- .../symeda/sormas/ui/utils/VaadinUiUtil.java | 60 +- .../de/symeda/sormas/ui/TestDataCreator.java | 15 + .../AbstractLabMessageProcessingFlowTest.java | 1682 +++++++++++++++++ .../RelatedLabMessageHandlerTest.java | 120 +- 26 files changed, 4593 insertions(+), 1560 deletions(-) create mode 100644 sormas-ui/src/main/java/de/symeda/sormas/ui/labmessage/LabMessageProcessingFlow.java create mode 100644 sormas-ui/src/main/java/de/symeda/sormas/ui/labmessage/processing/AbstractLabMessageProcessingFlow.java create mode 100644 sormas-ui/src/main/java/de/symeda/sormas/ui/labmessage/processing/AbstractRelatedLabMessageHandler.java create mode 100644 sormas-ui/src/main/java/de/symeda/sormas/ui/labmessage/processing/LabMessageProcessingHelper.java create mode 100644 sormas-ui/src/main/java/de/symeda/sormas/ui/labmessage/processing/LabMessageProcessingUIHelper.java rename sormas-api/src/main/java/de/symeda/sormas/api/labmessage/SimilarEntriesDto.java => sormas-ui/src/main/java/de/symeda/sormas/ui/labmessage/processing/PickOrCreateEntryResult.java (51%) create mode 100644 sormas-ui/src/main/java/de/symeda/sormas/ui/labmessage/processing/PickOrCreateEventResult.java create mode 100644 sormas-ui/src/main/java/de/symeda/sormas/ui/labmessage/processing/PickOrCreateSampleResult.java create mode 100644 sormas-ui/src/main/java/de/symeda/sormas/ui/labmessage/processing/SampleAndPathogenTests.java create mode 100644 sormas-ui/src/main/java/de/symeda/sormas/ui/labmessage/processing/flow/FlowAction.java create mode 100644 sormas-ui/src/main/java/de/symeda/sormas/ui/labmessage/processing/flow/FlowSwitch.java create mode 100644 sormas-ui/src/main/java/de/symeda/sormas/ui/labmessage/processing/flow/FlowThen.java create mode 100644 sormas-ui/src/main/java/de/symeda/sormas/ui/labmessage/processing/flow/ProcessingResult.java create mode 100644 sormas-ui/src/main/java/de/symeda/sormas/ui/labmessage/processing/flow/ProcessingResultStatus.java create mode 100644 sormas-ui/src/test/java/de/symeda/sormas/ui/labmessage/AbstractLabMessageProcessingFlowTest.java diff --git a/sormas-api/src/main/java/de/symeda/sormas/api/event/EventDto.java b/sormas-api/src/main/java/de/symeda/sormas/api/event/EventDto.java index e2a548a2e67..1351cba3a12 100644 --- a/sormas-api/src/main/java/de/symeda/sormas/api/event/EventDto.java +++ b/sormas-api/src/main/java/de/symeda/sormas/api/event/EventDto.java @@ -15,6 +15,10 @@ package de.symeda.sormas.api.event; +import de.symeda.sormas.api.FacadeProvider; +import de.symeda.sormas.api.infrastructure.country.CountryReferenceDto; +import de.symeda.sormas.api.infrastructure.region.RegionReferenceDto; +import de.symeda.sormas.api.user.UserDto; import java.util.Date; import java.util.Map; @@ -230,6 +234,17 @@ public static EventDto build() { return event; } + public static EventDto build(CountryReferenceDto country, UserDto user, Disease disease) { + EventDto event = build(); + + event.getEventLocation().setCountry(country); + event.getEventLocation().setRegion(user.getRegion()); + event.setReportingUser(user.toReference()); + event.setDisease(disease); + + return event; + } + public EventStatus getEventStatus() { return eventStatus; } diff --git a/sormas-api/src/main/java/de/symeda/sormas/api/event/EventIndexDto.java b/sormas-api/src/main/java/de/symeda/sormas/api/event/EventIndexDto.java index 1e47963d68e..563e81c707d 100644 --- a/sormas-api/src/main/java/de/symeda/sormas/api/event/EventIndexDto.java +++ b/sormas-api/src/main/java/de/symeda/sormas/api/event/EventIndexDto.java @@ -119,6 +119,9 @@ public class EventIndexDto extends PseudonymizableIndexDto implements Serializab private Long surveillanceToolShareCount; private ExternalShareStatus surveillanceToolStatus; + public EventIndexDto() { + } + public EventIndexDto( Long id, String uuid, diff --git a/sormas-ui/src/main/java/de/symeda/sormas/ui/events/EventController.java b/sormas-ui/src/main/java/de/symeda/sormas/ui/events/EventController.java index 3cfd4ce851b..db79cee0191 100644 --- a/sormas-ui/src/main/java/de/symeda/sormas/ui/events/EventController.java +++ b/sormas-ui/src/main/java/de/symeda/sormas/ui/events/EventController.java @@ -17,6 +17,7 @@ *******************************************************************************/ package de.symeda.sormas.ui.events; +import de.symeda.sormas.api.infrastructure.country.CountryReferenceDto; import java.util.ArrayList; import java.util.Collection; import java.util.Collections; @@ -905,15 +906,7 @@ private int bulkEdit( } public EventDto createNewEvent(Disease disease) { - EventDto event = EventDto.build(); - - event.getEventLocation().setCountry(FacadeProvider.getCountryFacade().getServerCountry()); - event.getEventLocation().setRegion(UserProvider.getCurrent().getUser().getRegion()); - UserReferenceDto userReference = UserProvider.getCurrent().getUserReference(); - event.setReportingUser(userReference); - event.setDisease(disease); - - return event; + return EventDto.build(FacadeProvider.getCountryFacade().getServerCountry(), UserProvider.getCurrent().getUser(), disease); } public void deleteAllSelectedItems(Collection selectedRows, Runnable callback) { diff --git a/sormas-ui/src/main/java/de/symeda/sormas/ui/labmessage/EntrySelectionField.java b/sormas-ui/src/main/java/de/symeda/sormas/ui/labmessage/EntrySelectionField.java index 44bf9f0c973..cd061297fe6 100644 --- a/sormas-ui/src/main/java/de/symeda/sormas/ui/labmessage/EntrySelectionField.java +++ b/sormas-ui/src/main/java/de/symeda/sormas/ui/labmessage/EntrySelectionField.java @@ -1,5 +1,6 @@ package de.symeda.sormas.ui.labmessage; +import de.symeda.sormas.ui.labmessage.processing.PickOrCreateEntryResult; import java.util.List; import java.util.function.Consumer; @@ -17,14 +18,13 @@ import de.symeda.sormas.api.i18n.I18nProperties; import de.symeda.sormas.api.i18n.Strings; import de.symeda.sormas.api.labmessage.LabMessageDto; -import de.symeda.sormas.api.labmessage.SimilarEntriesDto; import de.symeda.sormas.ui.caze.components.caseselection.CaseSelectionGrid; import de.symeda.sormas.ui.contact.ContactSelectionGrid; import de.symeda.sormas.ui.events.EventParticipantSelectionGrid; import de.symeda.sormas.ui.utils.CssStyles; import de.symeda.sormas.ui.utils.VaadinUiUtil; -public class EntrySelectionField extends CustomField { +public class EntrySelectionField extends CustomField { private static final Object CREATE_CASE = "createCase"; private static final Object CREATE_CONTACT = "createContact"; @@ -318,47 +318,47 @@ private void addInfoComponent() { } @Override - protected void doSetValue(SimilarEntriesDto similarEntriesDto) { - if (similarEntriesDto == null) { + protected void doSetValue(PickOrCreateEntryResult pickOrCreateEntryResult) { + if (pickOrCreateEntryResult == null) { throw new IllegalArgumentException(); } - if (similarEntriesDto.getCaze() != null) { + if (pickOrCreateEntryResult.getCaze() != null) { rbSelectCase.setValue(SELECT_CASE); - caseGrid.select(similarEntriesDto.getCaze()); - } else if (similarEntriesDto.getContact() != null) { + caseGrid.select(pickOrCreateEntryResult.getCaze()); + } else if (pickOrCreateEntryResult.getContact() != null) { rbSelectContact.setValue(SELECT_CONTACT); - contactGrid.select(similarEntriesDto.getContact()); - } else if (similarEntriesDto.getEventParticipant() != null) { + contactGrid.select(pickOrCreateEntryResult.getContact()); + } else if (pickOrCreateEntryResult.getEventParticipant() != null) { rbSelectEventParticipant.setValue(SELECT_EVENT_PARTICIPANT); - eventParticipantGrid.select(similarEntriesDto.getEventParticipant()); + eventParticipantGrid.select(pickOrCreateEntryResult.getEventParticipant()); } } @Override - public SimilarEntriesDto getValue() { + public PickOrCreateEntryResult getValue() { if (caseGrid != null && rbSelectCase.getValue() != null) { - SimilarEntriesDto value = new SimilarEntriesDto(); + PickOrCreateEntryResult value = new PickOrCreateEntryResult(); value.setCaze((CaseSelectionDto) caseGrid.getSelectedRow()); return value; } else if (contactGrid != null && rbSelectContact.getValue() != null) { - SimilarEntriesDto value = new SimilarEntriesDto(); + PickOrCreateEntryResult value = new PickOrCreateEntryResult(); value.setContact((SimilarContactDto) contactGrid.getSelectedRow()); return value; } else if (eventParticipantGrid != null && rbSelectEventParticipant.getValue() != null) { - SimilarEntriesDto value = new SimilarEntriesDto(); + PickOrCreateEntryResult value = new PickOrCreateEntryResult(); value.setEventParticipant((SimilarEventParticipantDto) eventParticipantGrid.getSelectedRow()); return value; } else if (CREATE_CASE.equals(rbCreateEntity.getValue())) { - SimilarEntriesDto value = new SimilarEntriesDto(); + PickOrCreateEntryResult value = new PickOrCreateEntryResult(); value.setNewCase(true); return value; } else if (CREATE_CONTACT.equals(rbCreateEntity.getValue())) { - SimilarEntriesDto value = new SimilarEntriesDto(); + PickOrCreateEntryResult value = new PickOrCreateEntryResult(); value.setNewContact(true); return value; } else if (CREATE_EVENT_PARTICIPANT.equals(rbCreateEntity.getValue())) { - SimilarEntriesDto value = new SimilarEntriesDto(); + PickOrCreateEntryResult value = new PickOrCreateEntryResult(); value.setNewEventParticipant(true); return value; } diff --git a/sormas-ui/src/main/java/de/symeda/sormas/ui/labmessage/LabMessageController.java b/sormas-ui/src/main/java/de/symeda/sormas/ui/labmessage/LabMessageController.java index bf75cb65b03..f213b1665fa 100644 --- a/sormas-ui/src/main/java/de/symeda/sormas/ui/labmessage/LabMessageController.java +++ b/sormas-ui/src/main/java/de/symeda/sormas/ui/labmessage/LabMessageController.java @@ -14,61 +14,30 @@ */ package de.symeda.sormas.ui.labmessage; -import java.util.ArrayList; +import de.symeda.sormas.api.sample.SampleReferenceDto; import java.util.Collection; import java.util.List; -import java.util.Objects; import java.util.Optional; -import java.util.concurrent.CompletableFuture; -import java.util.concurrent.CompletionStage; -import java.util.function.Consumer; import java.util.stream.Collectors; -import javax.naming.CannotProceedException; import javax.naming.NamingException; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import com.vaadin.icons.VaadinIcons; -import com.vaadin.server.ClientConnector; import com.vaadin.server.Page; import com.vaadin.server.Sizeable; -import com.vaadin.shared.ui.ContentMode; -import com.vaadin.shared.ui.MarginInfo; import com.vaadin.ui.Button; -import com.vaadin.ui.Component; import com.vaadin.ui.HorizontalLayout; -import com.vaadin.ui.HorizontalSplitPanel; import com.vaadin.ui.Label; import com.vaadin.ui.Notification; -import com.vaadin.ui.Panel; import com.vaadin.ui.UI; import com.vaadin.ui.VerticalLayout; import com.vaadin.ui.Window; import com.vaadin.ui.themes.ValoTheme; -import de.symeda.sormas.api.Disease; import de.symeda.sormas.api.FacadeProvider; -import de.symeda.sormas.api.caze.CaseCriteria; -import de.symeda.sormas.api.caze.CaseDataDto; -import de.symeda.sormas.api.caze.CaseReferenceDto; -import de.symeda.sormas.api.caze.CaseSelectionDto; -import de.symeda.sormas.api.caze.CaseSimilarityCriteria; -import de.symeda.sormas.api.contact.ContactDto; -import de.symeda.sormas.api.contact.ContactReferenceDto; -import de.symeda.sormas.api.contact.ContactSimilarityCriteria; -import de.symeda.sormas.api.contact.SimilarContactDto; -import de.symeda.sormas.api.event.EventCriteria; -import de.symeda.sormas.api.event.EventDto; -import de.symeda.sormas.api.event.EventIndexDto; -import de.symeda.sormas.api.event.EventParticipantCriteria; -import de.symeda.sormas.api.event.EventParticipantDto; -import de.symeda.sormas.api.event.EventParticipantReferenceDto; -import de.symeda.sormas.api.event.EventReferenceDto; -import de.symeda.sormas.api.event.SimilarEventParticipantDto; -import de.symeda.sormas.api.externalsurveillancetool.ExternalSurveillanceToolException; -import de.symeda.sormas.api.feature.FeatureType; import de.symeda.sormas.api.i18n.Captions; import de.symeda.sormas.api.i18n.I18nProperties; import de.symeda.sormas.api.i18n.Strings; @@ -77,39 +46,17 @@ import de.symeda.sormas.api.labmessage.LabMessageDto; import de.symeda.sormas.api.labmessage.LabMessageIndexDto; import de.symeda.sormas.api.labmessage.LabMessageStatus; -import de.symeda.sormas.api.labmessage.SimilarEntriesDto; -import de.symeda.sormas.api.labmessage.TestReportDto; -import de.symeda.sormas.api.person.PersonDto; -import de.symeda.sormas.api.person.PersonReferenceDto; -import de.symeda.sormas.api.sample.PathogenTestDto; -import de.symeda.sormas.api.sample.PathogenTestReferenceDto; -import de.symeda.sormas.api.sample.SampleDto; -import de.symeda.sormas.api.sample.SampleReferenceDto; -import de.symeda.sormas.api.sample.SampleSimilarityCriteria; import de.symeda.sormas.api.user.UserReferenceDto; -import de.symeda.sormas.api.user.UserRight; -import de.symeda.sormas.api.utils.pseudonymization.PseudonymizableDto; import de.symeda.sormas.ui.ControllerProvider; import de.symeda.sormas.ui.SormasUI; import de.symeda.sormas.ui.UserProvider; -import de.symeda.sormas.ui.caze.CaseCreateForm; -import de.symeda.sormas.ui.contact.ContactCreateForm; -import de.symeda.sormas.ui.events.EventDataForm; -import de.symeda.sormas.ui.events.EventParticipantEditForm; -import de.symeda.sormas.ui.events.eventLink.EventSelectionField; -import de.symeda.sormas.ui.labmessage.RelatedLabMessageHandler.HandlerResult; -import de.symeda.sormas.ui.labmessage.RelatedLabMessageHandler.RelatedLabMessageHandlerChain; -import de.symeda.sormas.ui.person.PersonEditForm; -import de.symeda.sormas.ui.samples.PathogenTestForm; -import de.symeda.sormas.ui.samples.SampleController; -import de.symeda.sormas.ui.samples.SampleCreateForm; -import de.symeda.sormas.ui.samples.SampleEditForm; -import de.symeda.sormas.ui.samples.SampleSelectionField; +import de.symeda.sormas.ui.labmessage.processing.flow.ProcessingResultStatus; import de.symeda.sormas.ui.utils.ButtonHelper; -import de.symeda.sormas.ui.utils.CommitDiscardWrapperComponent; import de.symeda.sormas.ui.utils.CssStyles; import de.symeda.sormas.ui.utils.VaadinUiUtil; +import static de.symeda.sormas.ui.labmessage.processing.LabMessageProcessingUIHelper.showAlreadyProcessedPopup; + public class LabMessageController { private final Logger logger = LoggerFactory.getLogger(getClass()); @@ -117,15 +64,7 @@ public class LabMessageController { private final RelatedLabMessageHandler relatedLabMessageHandler; public LabMessageController() { - relatedLabMessageHandler = new RelatedLabMessageHandler( - this::confirmHandleCorrections, - this::confirmShortcut, - this::showPersonCorrectionWindow, - this::showSampleCorrectionWindow, - this::showPathogenTestCorrectionWindow, - this::showCreatePathogenTestWindow, - this::confirmContinueProcessing, - this::editSample); + relatedLabMessageHandler = new RelatedLabMessageHandler(); } public void showLabMessage(String labMessageUuid, boolean withActions, Runnable onFormActionPerformed) { @@ -159,69 +98,26 @@ public void showLabMessagesSlider(List labMessages) { public void processLabMessage(String labMessageUuid) { LabMessageDto labMessage = FacadeProvider.getLabMessageFacade().getByUuid(labMessageUuid); - checkDisease(labMessage); - } - - private void checkDisease(LabMessageDto labMessage) { - if (labMessage.getTestedDisease() == null) { - VaadinUiUtil.showConfirmationPopup( - I18nProperties.getCaption(Captions.labMessageNoDisease), - new Label(I18nProperties.getString(Strings.messageDiseaseNotSpecifiedInLabMessage)), - I18nProperties.getCaption(Captions.actionContinue), - I18nProperties.getCaption(Captions.actionCancel), - null, - yes -> { - if (yes) { - checkRelatedForwardedMessages(labMessage); - } - }); - } else { - checkRelatedForwardedMessages(labMessage); - } - - } - - private void checkRelatedForwardedMessages(LabMessageDto labMessage) { - if (FacadeProvider.getLabMessageFacade().existsForwardedLabMessageWith(labMessage.getReportId())) { - VaadinUiUtil.showConfirmationPopup( - I18nProperties.getCaption(Captions.labMessageForwardedMessageFound), - new Label(I18nProperties.getString(Strings.messageForwardedLabMessageFound)), - I18nProperties.getCaption(Captions.actionYes), - I18nProperties.getCaption(Captions.actionCancel), - null, - yes -> { - if (yes) { - handleRelatedLabMessages(labMessage); - } - }); - } else { - handleRelatedLabMessages(labMessage); - } - } + LabMessageProcessingFlow flow = new LabMessageProcessingFlow(); - private void handleRelatedLabMessages(LabMessageDto labMessage) { + flow.run(labMessage, relatedLabMessageHandler).thenAccept(result -> { + ProcessingResultStatus status = result.getStatus(); - if (FacadeProvider.getLabMessageFacade().isProcessed(labMessage.getUuid())) { - showAlreadyProcessedPopup(null, false); - return; - } - - relatedLabMessageHandler.handle(labMessage).whenComplete((result, e) -> { - if (e != null) { - logger.error("Failed to handle correction lab message", e); - throw (RuntimeException) e; - } - - if (result == HandlerResult.NOT_HANDLED || result == HandlerResult.CONTINUE) { - pickOrCreatePerson(labMessage); - } else if (result == HandlerResult.CANCELED_WITH_UPDATES) { + if (status == ProcessingResultStatus.CANCELED_WITH_CORRECTIONS) { showCorrectionsSavedPopup(); - } else if (result == HandlerResult.HANDLED) { + } else if (status == ProcessingResultStatus.DONE) { + markLabMessageAsProcessed(labMessage, result.getData().getSample().toReference()); SormasUI.get().getNavigator().navigateTo(LabMessagesView.VIEW_NAME); } }); } + public void markLabMessageAsProcessed(LabMessageDto labMessage, SampleReferenceDto sample) { + labMessage.setSample(sample); + labMessage.setStatus(LabMessageStatus.PROCESSED); + FacadeProvider.getLabMessageFacade().save(labMessage); + } + public void assignAllSelectedItems(Collection selectedRows, Runnable callback) { if (selectedRows.isEmpty()) { new Notification( @@ -264,722 +160,6 @@ public void deleteAllSelectedItems(Collection selectedRows, } } - private PersonDto buildPerson(LabMessageMapper mapper) { - final PersonDto personDto = PersonDto.build(); - mapper.mapToPerson(personDto); - mapper.mapToLocation(personDto.getAddress()); - return personDto; - } - - private void pickOrCreatePerson(LabMessageDto labMessage) { - final PersonDto personDto = buildPerson(LabMessageMapper.forLabMessage(labMessage)); - - if (FacadeProvider.getLabMessageFacade().isProcessed(labMessage.getUuid())) { - showAlreadyProcessedPopup(null, false); - return; - } - ControllerProvider.getPersonController() - .selectOrCreatePerson(personDto, I18nProperties.getString(Strings.infoSelectOrCreatePersonForLabMessage), selectedPerson -> { - if (FacadeProvider.getLabMessageFacade().isProcessed(labMessage.getUuid())) { - showAlreadyProcessedPopup(null, false); // it currently is not possible to delete persons, so no reversion is provided here. - return; - } - if (selectedPerson != null) { - PersonDto selectedPersonDto; - if (selectedPerson.getUuid().equals(personDto.getUuid())) { - selectedPersonDto = personDto; - } else { - selectedPersonDto = FacadeProvider.getPersonFacade().getPersonByUuid(selectedPerson.getUuid()); - } - - List similarCases = getSimilarCases(selectedPerson, labMessage); - List similarContacts = getSimilarContacts(labMessage, selectedPerson); - List similarEventParticipants = getSimilarEventParticipants(labMessage, selectedPerson); - - pickOrCreateEntry(labMessage, similarCases, similarContacts, similarEventParticipants, selectedPersonDto); - } - }, - false, - FacadeProvider.getFeatureConfigurationFacade().isFeatureEnabled(FeatureType.PERSON_DUPLICATE_CUSTOM_SEARCH) - ? I18nProperties.getString(Strings.infoSelectOrCreatePersonForLabMessageWithoutMatches) - : null); - } - - private List getSimilarEventParticipants(LabMessageDto labMessage, PersonReferenceDto selectedPerson) { - EventParticipantCriteria eventParticipantCriteria = new EventParticipantCriteria(); - eventParticipantCriteria.setPerson(selectedPerson); - eventParticipantCriteria.setDisease(labMessage.getTestedDisease()); - List similarEventParticipants = - FacadeProvider.getEventParticipantFacade().getMatchingEventParticipants(eventParticipantCriteria); - return similarEventParticipants; - } - - private List getSimilarContacts(LabMessageDto labMessage, PersonReferenceDto selectedPerson) { - ContactSimilarityCriteria contactSimilarityCriteria = new ContactSimilarityCriteria(); - contactSimilarityCriteria.setPerson(selectedPerson); - contactSimilarityCriteria.setDisease(labMessage.getTestedDisease()); - List similarContacts = FacadeProvider.getContactFacade().getMatchingContacts(contactSimilarityCriteria); - return similarContacts; - } - - private List getSimilarCases(PersonReferenceDto selectedPerson, LabMessageDto labMessage) { - CaseCriteria caseCriteria = new CaseCriteria(); - caseCriteria.person(selectedPerson); - caseCriteria.disease(labMessage.getTestedDisease()); - CaseSimilarityCriteria caseSimilarityCriteria = new CaseSimilarityCriteria(); - caseSimilarityCriteria.caseCriteria(caseCriteria); - caseSimilarityCriteria.personUuid(selectedPerson.getUuid()); - return FacadeProvider.getCaseFacade().getSimilarCases(caseSimilarityCriteria); - } - - private void pickOrCreateEntry( - LabMessageDto labMessageDto, - List cases, - List contacts, - List eventParticipants, - PersonDto person) { - EntrySelectionField selectField = new EntrySelectionField(labMessageDto, cases, contacts, eventParticipants); - - final CommitDiscardWrapperComponent selectionField = new CommitDiscardWrapperComponent<>(selectField); - selectionField.getCommitButton().setCaption(I18nProperties.getCaption(Captions.actionConfirm)); - selectionField.setWidth(1280, Sizeable.Unit.PIXELS); - - selectionField.addCommitListener(() -> { - if (FacadeProvider.getLabMessageFacade().isProcessed(labMessageDto.getUuid())) { - showAlreadyProcessedPopup(null, false); - return; - } - SimilarEntriesDto similarEntriesDto = selectField.getValue(); - if (similarEntriesDto.isNewCase()) { - createCase(labMessageDto, person); - } else if (similarEntriesDto.isNewContact()) { - createContact(labMessageDto, person); - } else if (similarEntriesDto.isNewEventParticipant()) { - pickOrCreateEvent(labMessageDto, person); - } else { - UserReferenceDto userReference = UserProvider.getCurrent().getUserReference(); - if (similarEntriesDto.getCaze() != null) { - CaseDataDto caseDto = FacadeProvider.getCaseFacade().getCaseDataByUuid(similarEntriesDto.getCaze().getUuid()); - CaseReferenceDto cazeRef = caseDto.toReference(); - - List samples = FacadeProvider.getSampleFacade().getSimilarSamples(createSampleCriteria(labMessageDto).caze(cazeRef)); - if (samples.isEmpty()) { - createSample(SampleDto.build(userReference, cazeRef), labMessageDto, caseDto.getDisease(), false); - } else { - pickOrCreateSample(caseDto, labMessageDto, samples); - } - } else if (similarEntriesDto.getContact() != null) { - ContactDto contactDto = FacadeProvider.getContactFacade().getByUuid(similarEntriesDto.getContact().getUuid()); - ContactReferenceDto contactRef = contactDto.toReference(); - - List samples = - FacadeProvider.getSampleFacade().getSimilarSamples(createSampleCriteria(labMessageDto).contact(contactRef)); - if (samples.isEmpty()) { - createSample(SampleDto.build(userReference, contactRef), labMessageDto, contactDto.getDisease(), false); - } else { - pickOrCreateSample(contactDto, labMessageDto, samples); - } - } else if (similarEntriesDto.getEventParticipant() != null) { - EventParticipantDto eventParticipantDto = - FacadeProvider.getEventParticipantFacade().getByUuid(similarEntriesDto.getEventParticipant().getUuid()); - EventDto eventDto = FacadeProvider.getEventFacade().getEventByUuid(eventParticipantDto.getEvent().getUuid(), false); - EventParticipantReferenceDto eventParticipantRef = eventParticipantDto.toReference(); - - List samples = - FacadeProvider.getSampleFacade().getSimilarSamples(createSampleCriteria(labMessageDto).eventParticipant(eventParticipantRef)); - if (samples.isEmpty()) { - createSample(SampleDto.build(userReference, eventParticipantRef), labMessageDto, eventDto.getDisease(), false); - } else { - pickOrCreateSample(eventParticipantDto, labMessageDto, samples); - } - } else { - throw new UnsupportedOperationException(); - } - } - }); - - selectField.setSelectionChangeCallback((commitAllowed) -> selectionField.getCommitButton().setEnabled(commitAllowed)); - selectionField.getCommitButton().setEnabled(false); - - VaadinUiUtil.showModalPopupWindow(selectionField, I18nProperties.getString(Strings.headingPickOrCreateEntry)); - } - - private SampleSimilarityCriteria createSampleCriteria(LabMessageDto labMessageDto) { - SampleSimilarityCriteria sampleCriteria = new SampleSimilarityCriteria(); - sampleCriteria.setLabSampleId(labMessageDto.getLabSampleId()); - sampleCriteria.setSampleDateTime(labMessageDto.getSampleDateTime()); - sampleCriteria.setSampleMaterial(labMessageDto.getSampleMaterial()); - return sampleCriteria; - } - - private void pickOrCreateEvent(LabMessageDto labMessageDto, PersonDto person) { - EventSelectionField eventSelect = - new EventSelectionField(labMessageDto.getTestedDisease(), I18nProperties.getString(Strings.infoPickOrCreateEventForLabMessage), null); - eventSelect.setWidth(1024, Sizeable.Unit.PIXELS); - - Window window = VaadinUiUtil.createPopupWindow(); - - final CommitDiscardWrapperComponent component = new CommitDiscardWrapperComponent<>(eventSelect); - component.addCommitListener(() -> { - EventIndexDto selectedEvent = eventSelect.getValue(); - if (selectedEvent != null) { - - EventCriteria eventCriteria = new EventCriteria(); - eventCriteria.setPerson(person.toReference()); - eventCriteria.setUserFilterIncluded(false); - List eventIndexDtos = FacadeProvider.getEventFacade().getIndexList(eventCriteria, null, null, null); - - EventReferenceDto eventReferenceDto = new EventReferenceDto(selectedEvent.getUuid()); - if (!eventIndexDtos.contains(selectedEvent)) { - createEventParticipant(FacadeProvider.getEventFacade().getEventByUuid(eventReferenceDto.getUuid(), false), labMessageDto, person); - } else { - CommitDiscardWrapperComponent commitDiscardWrapperComponent = new CommitDiscardWrapperComponent<>( - new VerticalLayout(new Label(I18nProperties.getString(Strings.infoEventParticipantAlreadyExisting)))); - commitDiscardWrapperComponent.getCommitButton().setCaption(I18nProperties.getCaption(Captions.actionContinue)); - commitDiscardWrapperComponent.getDiscardButton().setCaption(I18nProperties.getCaption(Captions.actionBack)); - - commitDiscardWrapperComponent.addCommitListener(() -> { - EventParticipantReferenceDto participant = - FacadeProvider.getEventParticipantFacade().getReferenceByEventAndPerson(selectedEvent.getUuid(), person.getUuid()); - List samples = - FacadeProvider.getSampleFacade().getSimilarSamples(createSampleCriteria(labMessageDto).eventParticipant(participant)); - if (samples.isEmpty()) { - createSample( - SampleDto.build(UserProvider.getCurrent().getUserReference(), participant), - labMessageDto, - selectedEvent.getDisease(), - false); - } else { - pickOrCreateSample(FacadeProvider.getEventParticipantFacade().getByUuid(participant.getUuid()), labMessageDto, samples); - } - }); - commitDiscardWrapperComponent.addDiscardListener(() -> pickOrCreateEvent(labMessageDto, person)); - VaadinUiUtil.showModalPopupWindow(commitDiscardWrapperComponent, I18nProperties.getCaption(Captions.info)); - } - } else { - createEvent(labMessageDto, person); - } - window.close(); - }); - - component.addDiscardListener(window::close); - - eventSelect.setSelectionChangeCallback((commitAllowed) -> component.getCommitButton().setEnabled(commitAllowed)); - - window.setContent(component); - window.setCaption(I18nProperties.getString(Strings.headingPickOrCreateEvent)); - UI.getCurrent().addWindow(window); - } - - private void createEvent(LabMessageDto labMessageDto, PersonDto person) { - - EventDataForm eventCreateForm = new EventDataForm(true, false); - eventCreateForm.setValue(ControllerProvider.getEventController().createNewEvent(labMessageDto.getTestedDisease())); - eventCreateForm.getField(EventDto.DISEASE).setReadOnly(true); - final CommitDiscardWrapperComponent editView = new CommitDiscardWrapperComponent<>( - eventCreateForm, - UserProvider.getCurrent().hasUserRight(UserRight.EVENT_CREATE), - eventCreateForm.getFieldGroup()); - - Window window = VaadinUiUtil.createPopupWindow(); - editView.addCommitListener(() -> { - if (!eventCreateForm.getFieldGroup().isModified()) { - EventDto dto = eventCreateForm.getValue(); - FacadeProvider.getEventFacade().save(dto); - Notification.show(I18nProperties.getString(Strings.messageEventCreated), Notification.Type.WARNING_MESSAGE); - - createEventParticipant(dto, labMessageDto, person); - window.close(); - } - }); - editView.addDiscardListener(window::close); - - window.setContent(editView); - window.setCaption(I18nProperties.getString(Strings.headingCreateNewEvent)); - UI.getCurrent().addWindow(window); - } - - private void createEventParticipant(EventDto eventDto, LabMessageDto labMessageDto, PersonDto person) { - EventParticipantDto eventParticipant = buildEventParticipant(eventDto, person); - Window window = VaadinUiUtil.createPopupWindow(); - final CommitDiscardWrapperComponent createComponent = - getEventParticipantEditForm(eventDto, labMessageDto, eventParticipant, window, false); - showFormWithLabMessage(labMessageDto, createComponent, window, I18nProperties.getString(Strings.headingCreateNewEventParticipant), false); - } - - private CommitDiscardWrapperComponent getEventParticipantEditForm( - EventDto eventDto, - LabMessageDto labMessageDto, - EventParticipantDto eventParticipant, - Window window, - boolean showPersonSearchButton) { - EventParticipantEditForm createForm = - new EventParticipantEditForm(eventDto, false, eventParticipant.getPerson().isPseudonymized(), showPersonSearchButton); - createForm.setValue(eventParticipant); - final CommitDiscardWrapperComponent createComponent = new CommitDiscardWrapperComponent<>( - createForm, - UserProvider.getCurrent().hasUserRight(UserRight.EVENTPARTICIPANT_CREATE), - createForm.getFieldGroup()); - - createComponent.addCommitListener(() -> { - if (!createForm.getFieldGroup().isModified()) { - final EventParticipantDto dto = createForm.getValue(); - - FacadeProvider.getPersonFacade().savePerson(dto.getPerson()); - EventParticipantDto savedDto = FacadeProvider.getEventParticipantFacade().save(dto); - Notification.show(I18nProperties.getString(Strings.messageEventParticipantCreated), Notification.Type.ASSISTIVE_NOTIFICATION); - createSample( - SampleDto.build(UserProvider.getCurrent().getUserReference(), savedDto.toReference()), - labMessageDto, - eventDto.getDisease(), - true); - window.close(); - } - }); - createComponent.addDiscardListener(window::close); - return createComponent; - } - - private EventParticipantDto buildEventParticipant(EventDto eventDto, PersonDto person) { - EventParticipantDto eventParticipant = EventParticipantDto.build(eventDto.toReference(), UserProvider.getCurrent().getUserReference()); - eventParticipant.setPerson(person); - return eventParticipant; - } - - private void savePerson(PersonDto personDto, LabMessageDto labMessageDto) { - if (personDto.getAddress().getCity() == null - && personDto.getAddress().getHouseNumber() == null - && personDto.getAddress().getPostalCode() == null - && personDto.getAddress().getStreet() == null) { - LabMessageMapper.forLabMessage(labMessageDto).mapToLocation(personDto.getAddress()); - } - FacadeProvider.getPersonFacade().savePerson(personDto); - } - - private void pickOrCreateSample(PseudonymizableDto dto, LabMessageDto labMessageDto, List samples) { - SampleSelectionField selectField = new SampleSelectionField(samples, I18nProperties.getString(Strings.infoPickOrCreateSample)); - - Window window = VaadinUiUtil.createPopupWindow(); - - final CommitDiscardWrapperComponent selectionField = new CommitDiscardWrapperComponent<>(selectField); - selectionField.getCommitButton().setCaption(I18nProperties.getCaption(Captions.actionConfirm)); - selectionField.setWidth(1280, Sizeable.Unit.PIXELS); - selectionField.addCommitListener(() -> { - SampleDto sampleDto = selectField.getValue(); - if (sampleDto != null) { - editSample(sampleDto, labMessageDto); - } else { - UserReferenceDto userReference = UserProvider.getCurrent().getUserReference(); - - if (CaseDataDto.class.equals(dto.getClass())) { - createSample( - SampleDto.build(userReference, ((CaseDataDto) dto).toReference()), - labMessageDto, - ((CaseDataDto) dto).getDisease(), - false); - } else if (ContactDto.class.equals(dto.getClass())) { - createSample( - SampleDto.build(userReference, ((ContactDto) dto).toReference()), - labMessageDto, - ((ContactDto) dto).getDisease(), - false); - } else if (EventParticipantDto.class.equals(dto.getClass())) { - EventDto eventDto = FacadeProvider.getEventFacade().getEventByUuid(((EventParticipantDto) dto).getEvent().getUuid(), false); - createSample( - SampleDto.build(userReference, ((EventParticipantDto) dto).toReference()), - labMessageDto, - eventDto.getDisease(), - false); - } - } - window.close(); - }); - selectField.setSelectionChangeCallback((commitAllowed) -> selectionField.getCommitButton().setEnabled(commitAllowed)); - selectionField.getCommitButton().setEnabled(false); - selectionField.addDiscardListener(window::close); - - showFormWithLabMessage(labMessageDto, selectionField, window, I18nProperties.getString(Strings.headingPickOrCreateSample), false); - } - - private void editSample(LabMessageDto labMessage, SampleDto sample, RelatedLabMessageHandlerChain chain) { - Window sampleWindow = showSampleEditWindow(sample, labMessage, () -> chain.next(true)); - - sampleWindow.addCloseListener(e -> { - if (!chain.done()) { - chain.cancel(); - } - }); - } - - private void editSample(SampleDto sample, LabMessageDto labMessage) { - showSampleEditWindow(sample, labMessage, null); - } - - private Window showSampleEditWindow(SampleDto sample, LabMessageDto labMessage, CommitDiscardWrapperComponent.CommitListener callback) { - - SampleController sampleController = ControllerProvider.getSampleController(); - CommitDiscardWrapperComponent sampleEditComponent = - sampleController.getSampleEditComponent(sample.getUuid(), sample.isPseudonymized(), sampleController.getDiseaseOf(sample), false); - - // add existing tests to edit component - int caseSampleCount = sampleController.caseSampleCountOf(sample); - - List existingTests = FacadeProvider.getPathogenTestFacade().getAllBySample(sample.toReference()); - for (PathogenTestDto existingTest : existingTests) { - PathogenTestForm pathogenTestForm = sampleController.addPathogenTestComponent(sampleEditComponent, existingTest, caseSampleCount); - // when the user removes the pathogen test from the sampleEditComponent, mark the pathogen test as to be removed on commit - pathogenTestForm.addDetachListener((ClientConnector.DetachEvent detachEvent) -> { - sampleEditComponent.getWrappedComponent().getTestsToBeRemovedOnCommit().add(pathogenTestForm.getValue().toReference()); - }); - } - if (!existingTests.isEmpty()) { - // delete all pathogen test marked as removed on commit - sampleEditComponent.addCommitListener(() -> { - for (PathogenTestReferenceDto pathogenTest : sampleEditComponent.getWrappedComponent().getTestsToBeRemovedOnCommit()) { - FacadeProvider.getPathogenTestFacade().deletePathogenTest(pathogenTest.getUuid()); - } - }); - } - // add option to create additional pathogen tests - sampleController.addPathogenTestButton(sampleEditComponent, true); - - // add newly submitted tests to sample edit component - List existingTestExternalIds = - existingTests.stream().filter(Objects::nonNull).map(PathogenTestDto::getExternalId).collect(Collectors.toList()); - existingTestExternalIds = existingTestExternalIds.stream().filter(Objects::nonNull).collect(Collectors.toList()); - - List newTests = buildPathogenTests(sample, labMessage); - - for (PathogenTestDto test : newTests) { - if (!existingTestExternalIds.contains(test.getExternalId())) { - PathogenTestForm form = sampleController.addPathogenTestComponent(sampleEditComponent, test, caseSampleCount); - sampleController.setViaLimsFieldChecked(form); - } - } - - Window window = VaadinUiUtil.createPopupWindow(); - - // button configuration - Consumer createReferral = (disease) -> { - // discard current changes and create sample referral - SampleDto existingSample = - FacadeProvider.getSampleFacade().getSampleByUuid(sampleEditComponent.getWrappedComponent().getValue().getUuid()); - createSampleReferral(existingSample, disease, labMessage); - window.close(); - }; - Consumer editSample = referredTo -> { - editSample(referredTo, labMessage); - window.close(); - }; - sampleController.addReferOrLinkToOtherLabButton(sampleEditComponent, sampleController.getDiseaseOf(sample), createReferral, editSample); - - sampleController.addReferredFromButton(sampleEditComponent, editSample); - - // add commit and discard listeners - if (callback != null) { - sampleEditComponent.addCommitListener(callback); - } - sampleEditComponent.addCommitListener(() -> finishProcessingLabMessage(labMessage, sample.toReference())); - sampleEditComponent.addCommitListener(window::close); - sampleEditComponent.addDiscardListener(window::close); - - LabMessageUiHelper.establishFinalCommitButtons(sampleEditComponent); - - showFormWithLabMessage(labMessage, sampleEditComponent, window, I18nProperties.getString(Strings.headingEditSample), false); - - return window; - } - - private void createSampleReferral(SampleDto existingSample, Disease disease, LabMessageDto labMessage) { - Window window = VaadinUiUtil.createPopupWindow(); - - CommitDiscardWrapperComponent sampleCreateComponent = - getSampleReferralCreateComponent(existingSample, disease, labMessage, window); - - showFormWithLabMessage(labMessage, sampleCreateComponent, window, I18nProperties.getString(Strings.headingCreateNewSample), false); - } - - private CommitDiscardWrapperComponent getSampleReferralCreateComponent( - SampleDto existingSample, - Disease disease, - LabMessageDto labMessage, - Window window) { - SampleController sampleController = ControllerProvider.getSampleController(); - CommitDiscardWrapperComponent sampleCreateComponent = - sampleController.getSampleReferralCreateComponent(existingSample, disease); - addAllTestReportsOf(labMessage, sampleCreateComponent); - // add option to create additional pathogen tests - sampleController.addPathogenTestButton(sampleCreateComponent, true); - - sampleCreateComponent - .addCommitListener(() -> finishProcessingLabMessage(labMessage, sampleCreateComponent.getWrappedComponent().getValue().toReference())); - sampleCreateComponent.addCommitListener(window::close); - sampleCreateComponent.addDiscardListener(window::close); - - LabMessageUiHelper.establishFinalCommitButtons(sampleCreateComponent); - - return sampleCreateComponent; - } - - private void createCase(LabMessageDto labMessageDto, PersonDto person) { - Window window = VaadinUiUtil.createPopupWindow(); - CaseDataDto caseDto = buildCase(labMessageDto, person); - CommitDiscardWrapperComponent caseCreateComponent = getCaseCreateComponent(labMessageDto, person, window, caseDto); - showFormWithLabMessage(labMessageDto, caseCreateComponent, window, I18nProperties.getString(Strings.headingCreateNewCase), false); - } - - private CommitDiscardWrapperComponent getCaseCreateComponent( - LabMessageDto labMessageDto, - PersonDto person, - Window window, - CaseDataDto caseDto) { - CommitDiscardWrapperComponent caseCreateComponent = - ControllerProvider.getCaseController().getCaseCreateComponent(null, null, null, null, true); - caseCreateComponent.addCommitListener(() -> { - savePerson( - FacadeProvider.getPersonFacade().getPersonByUuid(caseCreateComponent.getWrappedComponent().getValue().getPerson().getUuid()), - labMessageDto); - createSample( - SampleDto.build(UserProvider.getCurrent().getUserReference(), caseCreateComponent.getWrappedComponent().getValue().toReference()), - labMessageDto, - caseCreateComponent.getWrappedComponent().getValue().getDisease(), - true); - window.close(); - }); - caseCreateComponent.addDiscardListener(window::close); - caseCreateComponent.getWrappedComponent().setValue(caseDto); - if (FacadeProvider.getPersonFacade().isValidPersonUuid(person.getUuid())) { - caseCreateComponent.getWrappedComponent().setSearchedPerson(person); - } - caseCreateComponent.getWrappedComponent().setPerson(person); - - return caseCreateComponent; - } - - private CaseDataDto buildCase(LabMessageDto labMessageDto, PersonDto person) { - CaseDataDto caseDto = CaseDataDto.build(person.toReference(), labMessageDto.getTestedDisease()); - caseDto.setReportingUser(UserProvider.getCurrent().getUserReference()); - return caseDto; - } - - private void createContact(LabMessageDto labMessageDto, PersonDto person) { - Window window = VaadinUiUtil.createPopupWindow(); - ContactDto contactDto = buildContact(labMessageDto, person); - CommitDiscardWrapperComponent contactCreateComponent = - getContactCreateComponent(labMessageDto, person, window, contactDto); - showFormWithLabMessage(labMessageDto, contactCreateComponent, window, I18nProperties.getString(Strings.headingCreateNewContact), false); - } - - private ContactDto buildContact(LabMessageDto labMessageDto, PersonDto person) { - ContactDto contactDto = ContactDto.build(null, labMessageDto.getTestedDisease(), null, null); - contactDto.setReportingUser(UserProvider.getCurrent().getUserReference()); - contactDto.setPerson(person.toReference()); - return contactDto; - } - - private CommitDiscardWrapperComponent getContactCreateComponent( - LabMessageDto labMessageDto, - PersonDto person, - Window window, - ContactDto contactDto) { - CommitDiscardWrapperComponent contactCreateComponent = - ControllerProvider.getContactController().getContactCreateComponent(null, false, null, true); - - contactCreateComponent.addCommitListener(() -> { - savePerson( - FacadeProvider.getPersonFacade().getPersonByUuid(contactCreateComponent.getWrappedComponent().getValue().getPerson().getUuid()), - labMessageDto); - createSample( - SampleDto.build(UserProvider.getCurrent().getUserReference(), contactCreateComponent.getWrappedComponent().getValue().toReference()), - labMessageDto, - contactCreateComponent.getWrappedComponent().getValue().getDisease(), - true); - window.close(); - }); - contactCreateComponent.addDiscardListener(window::close); - contactCreateComponent.getWrappedComponent().setValue(contactDto); - contactCreateComponent.getWrappedComponent().setPerson(person); - - return contactCreateComponent; - } - - private void createSample(SampleDto sampleDto, LabMessageDto labMessageDto, Disease disease, boolean newEntityCreated) { - LabMessageMapper.forLabMessage(labMessageDto).mapToSample(sampleDto); - - Window window = VaadinUiUtil.createPopupWindow(); - CommitDiscardWrapperComponent sampleCreateComponent = getSampleCreateComponent(sampleDto, labMessageDto, disease, window); - showFormWithLabMessage( - labMessageDto, - sampleCreateComponent, - window, - I18nProperties.getString(Strings.headingCreateNewSample), - newEntityCreated); - } - - private CommitDiscardWrapperComponent getSampleCreateComponent( - SampleDto sample, - LabMessageDto labMessageDto, - Disease disease, - Window window) { - SampleController sampleController = ControllerProvider.getSampleController(); - CommitDiscardWrapperComponent sampleCreateComponent = sampleController.getSampleCreateComponent(sample, disease, null); - - // add pathogen test create components - addAllTestReportsOf(labMessageDto, sampleCreateComponent); - // add option to create additional pathogen tests - sampleController.addPathogenTestButton(sampleCreateComponent, true); - - sampleCreateComponent.addCommitListener(() -> finishProcessingLabMessage(labMessageDto, sample.toReference())); - sampleCreateComponent.addCommitListener(window::close); - sampleCreateComponent.addDiscardListener(window::close); - - LabMessageUiHelper.establishFinalCommitButtons(sampleCreateComponent); - - return sampleCreateComponent; - } - - public void addAllTestReportsOf(LabMessageDto labMessageDto, CommitDiscardWrapperComponent sampleCreateComponent) { - - SampleController sampleController = ControllerProvider.getSampleController(); - SampleDto sample = sampleCreateComponent.getWrappedComponent().getValue(); - List pathogenTests = buildPathogenTests(sample, labMessageDto); - int caseSampleCount = sampleController.caseSampleCountOf(sample); - - for (PathogenTestDto pathogenTest : pathogenTests) { - PathogenTestForm pathogenTestCreateComponent = - sampleController.addPathogenTestComponent(sampleCreateComponent, pathogenTest, caseSampleCount); - sampleController.setViaLimsFieldChecked(pathogenTestCreateComponent); - } - } - - private List buildPathogenTests(SampleDto sample, LabMessageDto labMessage) { - ArrayList pathogenTests = new ArrayList<>(); - for (TestReportDto testReport : labMessage.getTestReports()) { - pathogenTests.add(buildPathogenTest(testReport, labMessage, sample)); - } - // always build at least one PathogenTestDto - if (pathogenTests.isEmpty()) { - pathogenTests.add(buildPathogenTest(null, labMessage, sample)); - } - return pathogenTests; - } - - private PathogenTestDto buildPathogenTest(TestReportDto testReport, LabMessageDto labMessage, SampleDto sample) { - PathogenTestDto pathogenTest = PathogenTestDto.build(sample, UserProvider.getCurrent().getUser()); - LabMessageMapper.forLabMessage(labMessage).mapToPathogenTest(testReport, pathogenTest); - - return pathogenTest; - } - - private void showFormWithLabMessage( - LabMessageDto labMessageDto, - CommitDiscardWrapperComponent createComponent, - Window window, - String heading, - boolean entityCreated) { - - addProcessedInMeantimeCheck(createComponent, labMessageDto, entityCreated); - LabMessageForm form = new LabMessageForm(); - form.setWidth(550, Sizeable.Unit.PIXELS); - - HorizontalSplitPanel horizontalSplitPanel = new HorizontalSplitPanel(); - horizontalSplitPanel.setFirstComponent(form); - horizontalSplitPanel.setSecondComponent(createComponent); - horizontalSplitPanel.setSplitPosition(569, Sizeable.Unit.PIXELS); // This is just the position it needs to avoid vertical scroll bars. - horizontalSplitPanel.addStyleName("lab-message-processing"); - - Panel panel = new Panel(); - panel.setHeightFull(); - panel.setContent(horizontalSplitPanel); - - HorizontalLayout layout = new HorizontalLayout(panel); - layout.setHeightFull(); - layout.setMargin(true); - - window.setHeightFull(); - window.setContent(layout); - window.setCaption(heading); - UI.getCurrent().addWindow(window); - - form.setValue(labMessageDto); - } - - private void finishProcessingLabMessage(LabMessageDto labMessage, SampleReferenceDto sample) { - labMessage.setSample(sample); - labMessage.setStatus(LabMessageStatus.PROCESSED); - FacadeProvider.getLabMessageFacade().save(labMessage); - } - - /** - * @param component - * that holds a reference to the current state of processing a labMessage - * @param entityCreated - * should be true if a Case, Contact or EventParticipant has already been created. This will result in an option to delete - * that entity again. - */ - private void showAlreadyProcessedPopup(Component component, boolean entityCreated) { - VerticalLayout warningLayout = VaadinUiUtil.createWarningLayout(); - Window popupWindow = VaadinUiUtil.showPopupWindow(warningLayout); - Label infoLabel = new Label(I18nProperties.getValidationError(Validations.labMessageAlreadyProcessedError)); - CssStyles.style(infoLabel, CssStyles.LABEL_LARGE, CssStyles.LABEL_WHITE_SPACE_NORMAL); - warningLayout.addComponent(infoLabel); - popupWindow.addCloseListener(e -> popupWindow.close()); - popupWindow.setWidth(400, Sizeable.Unit.PIXELS); - - // If a case, contact or event participant was saved by the user while processing... - if (entityCreated) { - Button button = createDeleteEntityButton(component); - button.addClickListener(e -> popupWindow.close()); - warningLayout.addComponent(button); - } - } - - /** - * @param component - * component is expected to not be null, as it should never be null in a correct call of this method. Calling this method - * with a null component will result in a NPE. - * @return Button to delete the formerly created Case, Contact or EventParticipant entity - */ - private Button createDeleteEntityButton(Component component) { - if (SampleCreateForm.class.equals(component.getClass())) { - SampleDto sample = ((SampleCreateForm) component).getValue(); - if (sample.getAssociatedCase() != null) { - return ButtonHelper.createButton(Captions.labMessage_deleteNewlyCreatedCase, e -> { - try { - FacadeProvider.getCaseFacade().delete(sample.getAssociatedCase().getUuid()); - } catch (ExternalSurveillanceToolException survToolException) { - // should not happen because the new case was not shared - throw new RuntimeException(survToolException); - } - }, ValoTheme.BUTTON_PRIMARY); - } else if (sample.getAssociatedContact() != null) { - return ButtonHelper.createButton( - Captions.labMessage_deleteNewlyCreatedContact, - e -> FacadeProvider.getContactFacade().delete(sample.getAssociatedContact().getUuid()), - ValoTheme.BUTTON_PRIMARY); - } else if (sample.getAssociatedEventParticipant() != null) { - return ButtonHelper.createButton( - Captions.labMessage_deleteNewlyCreatedEventParticipant, - e -> FacadeProvider.getEventParticipantFacade().delete(sample.getAssociatedEventParticipant().getUuid()), - ValoTheme.BUTTON_PRIMARY); - } - } - throw new UnsupportedOperationException("The created entity to be deleted could net be determined."); - } - - private void addProcessedInMeantimeCheck( - CommitDiscardWrapperComponent createComponent, - LabMessageDto labMessageDto, - boolean entityCreated) { - createComponent.setPrimaryCommitListener(() -> { - if (FacadeProvider.getLabMessageFacade().isProcessed(labMessageDto.getUuid())) { - createComponent.getCommitButton().setEnabled(false); - showAlreadyProcessedPopup(createComponent.getWrappedComponent(), entityCreated); - throw new CannotProceedException("The lab message was processed in the meantime"); - } - }); - } - private HorizontalLayout getLabMessageButtonsPanel(LabMessageDto labMessage, Runnable callback) { HorizontalLayout buttonsPanel = new HorizontalLayout(); buttonsPanel.setMargin(false); @@ -1089,250 +269,6 @@ public Optional convertToPDF(String labMessageUuid) { return Optional.empty(); } - // related lab messages - private CompletionStage confirmHandleCorrections() { - CompletableFuture ret = new CompletableFuture<>(); - - Window window = VaadinUiUtil.showConfirmationPopup( - I18nProperties.getString(Strings.headingLabMessageCorrection), - new Label(I18nProperties.getString(Strings.confirmationLabMessageCorrection), ContentMode.HTML), - I18nProperties.getString(Strings.yes), - I18nProperties.getString(Strings.no), - null, - ret::complete); - window.addCloseListener(e -> ret.complete(false)); - - return ret; - } - - private CompletionStage confirmShortcut(boolean hasRelatedLabMessages) { - CompletableFuture ret = new CompletableFuture<>(); - - String message = hasRelatedLabMessages - ? I18nProperties.getString(Strings.messageRelatedSampleAndLabMessagesFound) - : I18nProperties.getString(Strings.messageRelatedSampleFound); - - Window window = VaadinUiUtil.showChooseOptionPopup( - I18nProperties.getCaption(Captions.labMessageRelatedEntriesFound), - new Label(message, ContentMode.HTML), - I18nProperties.getCaption(Captions.actionYes), - I18nProperties.getCaption(Captions.actionNo), - null, - ret::complete); - - window.addCloseListener(e -> ret.complete(false)); - - return ret; - } - - private void showPersonCorrectionWindow( - LabMessageDto labMessageDto, - PersonDto person, - PersonDto updatedPerson, - List changedFields, - RelatedLabMessageHandlerChain chain) { - CorrectionPanel personCorrectionPanel = new CorrectionPanel<>( - () -> new PersonEditForm(person.isPseudonymized()), - person, - updatedPerson, - Strings.headingPreviousPersonInformation, - Strings.headingUpdatedPersonInformation, - changedFields); - - showCorrectionWindow(labMessageDto, Strings.headingCorrectPerson, personCorrectionPanel, (p) -> { - FacadeProvider.getPersonFacade().savePerson(p); - Notification.show(I18nProperties.getString(Strings.messagePersonSaved), Notification.Type.TRAY_NOTIFICATION); - }, chain); - } - - private void showSampleCorrectionWindow( - LabMessageDto labMessage, - SampleDto sample, - SampleDto updatedSample, - List changedFields, - RelatedLabMessageHandlerChain chain) { - CorrectionPanel personCorrectionPanel = new CorrectionPanel<>( - () -> new SampleEditForm(sample.isPseudonymized(), ControllerProvider.getSampleController().getDiseaseOf(sample)), - sample, - updatedSample, - Strings.headingPreviousSampleInformation, - Strings.headingUpdatedSampleInformation, - changedFields); - - showCorrectionWindow(labMessage, Strings.headingCorrectSample, personCorrectionPanel, (s) -> { - FacadeProvider.getSampleFacade().saveSample(s); - Notification.show(I18nProperties.getString(Strings.messageSampleSaved), Notification.Type.TRAY_NOTIFICATION); - }, chain); - } - - private void showPathogenTestCorrectionWindow( - LabMessageDto labMessage, - PathogenTestDto pathogenTest, - PathogenTestDto updatedPathogenTest, - List changedFields, - RelatedLabMessageHandlerChain chain) { - - SampleDto sample = FacadeProvider.getSampleFacade().getSampleByUuid(pathogenTest.getSample().getUuid()); - int caseSampleCount = ControllerProvider.getSampleController().caseSampleCountOf(sample); - - CorrectionPanel personCorrectionPanel = new CorrectionPanel<>( - () -> new PathogenTestForm(sample, false, caseSampleCount, sample.isPseudonymized()), - pathogenTest, - updatedPathogenTest, - Strings.headingPreviousPathogenTestInformation, - Strings.headingUpdatedPathogenTestInformation, - changedFields); - - showCorrectionWindow(labMessage, Strings.headingCorrectPathogenTest, personCorrectionPanel, (t) -> { - FacadeProvider.getPathogenTestFacade().savePathogenTest(t); - Notification.show(I18nProperties.getString(Strings.messagePathogenTestSavedShort), Notification.Type.TRAY_NOTIFICATION); - }, chain); - } - - private void showCorrectionWindow( - LabMessageDto labMessage, - String titleTag, - CorrectionPanel correctionPanel, - Consumer save, - RelatedLabMessageHandlerChain chain) { - Window window = VaadinUiUtil.createPopupWindow(); - - correctionPanel.setCancelListener((e) -> { - chain.cancel(); - window.close(); - }); - correctionPanel.setDiscardListener(() -> { - if (FacadeProvider.getLabMessageFacade().isProcessed(labMessage.getUuid())) { - showAlreadyProcessedPopup(null, false); - correctionPanel.disableContinueButtons(); - } else { - chain.next(false); - window.close(); - } - }); - correctionPanel.setCommitListener((updated) -> { - if (FacadeProvider.getLabMessageFacade().isProcessed(labMessage.getUuid())) { - showAlreadyProcessedPopup(null, false); - correctionPanel.disableContinueButtons(); - } else { - save.accept(updated); - chain.next(true); - window.close(); - } - }); - window.addCloseListener(e -> { - if (!chain.done()) { - chain.cancel(); - } - }); - - HorizontalLayout toolbar = - new HorizontalLayout(ButtonHelper.createIconButton(null, VaadinIcons.EYE, e -> showLabMessage(labMessage.getUuid(), false, null))); - toolbar.setMargin(new MarginInfo(true, true, false, true)); - - VerticalLayout content = new VerticalLayout(toolbar, correctionPanel); - content.setMargin(false); - content.setSpacing(false); - content.setExpandRatio(toolbar, 0); - content.setExpandRatio(correctionPanel, 1); - - content.setSizeFull(); - - window.setContent(content); - window.setSizeFull(); - window.setCaption(I18nProperties.getString(titleTag)); - - UI.getCurrent().addWindow(window); - } - - private void showCreatePathogenTestWindow( - LabMessageDto labMessage, - TestReportDto testReport, - SampleDto sample, - RelatedLabMessageHandlerChain chain) { - Window window = VaadinUiUtil.createPopupWindow(); - - int caseSampleCount = ControllerProvider.getSampleController().caseSampleCountOf(sample); - - CommitDiscardWrapperComponent pathogenTestCreateComponent = - ControllerProvider.getPathogenTestController().getPathogenTestCreateComponent(sample, caseSampleCount, (savedPathogenTest, callback) -> { - chain.next(true); - window.close(); - }, true); - - pathogenTestCreateComponent.addDiscardListener(() -> { - if (FacadeProvider.getLabMessageFacade().isProcessed(labMessage.getUuid())) { - showAlreadyProcessedPopup(null, false); - pathogenTestCreateComponent.getCommitButton().setEnabled(false); - pathogenTestCreateComponent.getDiscardButton().setEnabled(false); - } else { - chain.next(true); - window.close(); - } - }); - - Button cancelButton = LabMessageUiHelper.addCancelAndUpdateLabels(pathogenTestCreateComponent, Captions.actionDiscardAndContinue); - cancelButton.addClickListener(e -> { - chain.cancel(); - window.close(); - }); - - window.addCloseListener(e -> { - if (!chain.done()) { - chain.cancel(); - } - }); - - pathogenTestCreateComponent.getWrappedComponent().setValue(buildPathogenTest(testReport, labMessage, sample)); - ControllerProvider.getSampleController().setViaLimsFieldChecked(pathogenTestCreateComponent.getWrappedComponent()); - - showFormWithLabMessage( - labMessage, - pathogenTestCreateComponent, - window, - I18nProperties.getString(Strings.headingCreatePathogenTestResult), - false); - - pathogenTestCreateComponent.setPrimaryCommitListener(() -> { - if (FacadeProvider.getLabMessageFacade().isProcessed(labMessage.getUuid())) { - pathogenTestCreateComponent.getCommitButton().setEnabled(false); - pathogenTestCreateComponent.getDiscardButton().setEnabled(false); - showAlreadyProcessedPopup(pathogenTestCreateComponent.getWrappedComponent(), false); - throw new CannotProceedException("The lab message was processed in the meantime"); - } - }); - } - - private CompletionStage confirmContinueProcessing(LabMessageDto labMessageDto, SampleReferenceDto sample) { - - CompletableFuture ret = new CompletableFuture<>(); - - Window window = VaadinUiUtil.createPopupWindow(); - Label label = new Label(I18nProperties.getString(Strings.confirmLabMessageCorrectionThrough)); - label.addStyleName(CssStyles.LABEL_WHITE_SPACE_NORMAL); - CommitDiscardWrapperComponent