use of de.symeda.sormas.api.followup.FollowUpDto in project SORMAS-Project by hzi-braunschweig.
the class CaseFollowUpGrid method setVisitColumns.
public void setVisitColumns(CaseCriteria criteria) {
Date referenceDate = criteria.getFollowUpVisitsTo();
int interval = criteria.getFollowUpVisitsInterval();
setDataProvider(referenceDate, interval - 1);
setCriteria(criteria);
dates.forEach(date -> removeColumn(DateFormatHelper.formatDate(date)));
setDates(referenceDate, interval);
for (int i = 0; i < interval; i++) {
String columnId = DateFormatHelper.formatDate(dates.get(i));
addComponentColumn(followUpDto -> new Label("")).setId(columnId);
final int index = i;
getColumn(columnId).setCaption(columnId).setSortable(false).setStyleGenerator((StyleGenerator<CaseFollowUpDto>) item -> {
final VisitResultDto visitResult = item.getVisitResults()[index];
final Date date = dates.get(index);
return getVisitResultCssStyle(visitResult, date, item.getReportDate(), item.getFollowUpUntil());
}).setDescriptionGenerator((DescriptionGenerator<CaseFollowUpDto>) item -> {
final VisitResultDto visitResult = item.getVisitResults()[index];
final Date date = dates.get(index);
return getVisitResultDescription(visitResult, date, item.getReportDate(), item.getFollowUpUntil());
});
}
}
use of de.symeda.sormas.api.followup.FollowUpDto in project SORMAS-Project by hzi-braunschweig.
the class ContactFollowUpGrid method setVisitColumns.
public void setVisitColumns(ContactCriteria criteria) {
Date referenceDate = criteria.getFollowUpVisitsTo();
int interval = criteria.getFollowUpVisitsInterval();
setDataProvider(referenceDate, interval - 1);
setCriteria(criteria);
dates.forEach(date -> removeColumn(DateFormatHelper.formatDate(date)));
setDates(referenceDate, interval);
dateColumnIds.clear();
for (int i = 0; i < interval; i++) {
String columnId = DateFormatHelper.formatDate(dates.get(i));
dateColumnIds.add(columnId);
addComponentColumn(followUpDto -> new Label("")).setId(columnId);
final int index = i;
getColumn(columnId).setCaption(columnId).setSortable(false).setStyleGenerator((StyleGenerator<ContactFollowUpDto>) item -> {
final VisitResultDto visitResult = item.getVisitResults()[index];
final Date date = dates.get(index);
return getVisitResultCssStyle(visitResult, date, ContactLogic.getStartDate(item.getLastContactDate(), item.getReportDate()), item.getFollowUpUntil());
}).setDescriptionGenerator((DescriptionGenerator<ContactFollowUpDto>) item -> {
final VisitResultDto visitResult = item.getVisitResults()[index];
final Date date = dates.get(index);
return getVisitResultDescription(visitResult, date, ContactLogic.getStartDate(item.getLastContactDate(), item.getReportDate()), item.getFollowUpUntil());
});
}
}
Aggregations