4848import de .symeda .sormas .api .caze .CaseCriteria ;
4949import de .symeda .sormas .api .caze .CaseDataDto ;
5050import de .symeda .sormas .api .caze .CaseOutcome ;
51+ import de .symeda .sormas .api .contact .FollowUpStatus ;
5152import de .symeda .sormas .api .externaljournal .ExternalPersonValidation ;
5253import de .symeda .sormas .api .i18n .I18nProperties ;
5354import de .symeda .sormas .api .i18n .Validations ;
@@ -375,6 +376,9 @@ public List<PersonFollowUpEndDto> getLatestFollowUpEndDates(Date since, boolean
375376 Join <Contact , Person > personJoin = contactRoot .join (Contact .PERSON , JoinType .LEFT );
376377
377378 Predicate filter = contactService .createUserFilter (cb , cq , contactRoot );
379+ filter = ContactService .and (cb , filter , cb .notEqual (contactRoot .get (Contact .FOLLOW_UP_STATUS ), FollowUpStatus .CANCELED ));
380+ filter = ContactService .and (cb , filter , cb .notEqual (contactRoot .get (Contact .FOLLOW_UP_STATUS ), FollowUpStatus .NO_FOLLOW_UP ));
381+
378382 if (since != null ) {
379383 filter = PersonService .and (cb , filter , contactService .createChangeDateFilter (cb , contactRoot , since ));
380384 }
@@ -401,6 +405,8 @@ public Date getLatestFollowUpEndDateByUuid(String uuid) {
401405 Join <Contact , Person > personJoin = contactRoot .join (Contact .PERSON , JoinType .LEFT );
402406
403407 Predicate filter = contactService .createUserFilter (cb , cq , contactRoot );
408+ filter = ContactService .and (cb , filter , cb .notEqual (contactRoot .get (Contact .FOLLOW_UP_STATUS ), FollowUpStatus .CANCELED ));
409+ filter = ContactService .and (cb , filter , cb .notEqual (contactRoot .get (Contact .FOLLOW_UP_STATUS ), FollowUpStatus .NO_FOLLOW_UP ));
404410
405411 if (uuid != null ) {
406412 filter = PersonService .and (cb , filter , cb .equal (personJoin .get (Person .UUID ), uuid ));
0 commit comments