use of de.symeda.sormas.api.utils.ExtendedReduced in project SORMAS-Project by hzi-braunschweig.
the class CaseDataForm method onQuarantineEndChange.
// This logic should be consistent with CaseFacadeEjb.onCaseChanged
private void onQuarantineEndChange() {
if (quarantineChangedByFollowUpUntilChange) {
quarantineChangedByFollowUpUntilChange = false;
} else {
Date newQuarantineEnd = dfQuarantineTo.getValue();
CaseDataDto originalCase = getInternalValue();
Date oldQuarantineEnd = originalCase.getQuarantineTo();
ExtendedReduced changeType = null;
if (oldQuarantineEnd != null && newQuarantineEnd != null) {
changeType = newQuarantineEnd.after(oldQuarantineEnd) ? ExtendedReduced.EXTENDED : (newQuarantineEnd.before(oldQuarantineEnd) ? ExtendedReduced.REDUCED : null);
}
if (changeType != null) {
confirmQuarantineEndChanged(changeType, originalCase);
} else {
resetPreviousQuarantineTo(originalCase);
}
}
}
use of de.symeda.sormas.api.utils.ExtendedReduced in project SORMAS-Project by hzi-braunschweig.
the class ContactDataForm method onQuarantineEndChange.
// This logic should be consistent with ContactFacadeEjb.onQuarantineEndChange
private void onQuarantineEndChange() {
if (quarantineChangedByFollowUpUntilChange) {
quarantineChangedByFollowUpUntilChange = false;
} else {
Date newQuarantineEnd = dfQuarantineTo.getValue();
ContactDto originalContact = getInternalValue();
Date oldQuarantineEnd = originalContact.getQuarantineTo();
Date oldPreviousQuarantineTo = originalContact.getPreviousQuarantineTo();
ExtendedReduced changeType = null;
if (oldQuarantineEnd != null && newQuarantineEnd != null) {
changeType = newQuarantineEnd.after(oldQuarantineEnd) ? ExtendedReduced.EXTENDED : (newQuarantineEnd.before(oldQuarantineEnd) ? ExtendedReduced.REDUCED : null);
}
if (changeType != null) {
confirmQuarantineEndChanged(changeType, originalContact);
} else {
resetPreviousQuarantineTo(originalContact);
}
}
}
Aggregations