use of de.symeda.sormas.api.contact.ContactStatus in project SORMAS-Project by hzi-braunschweig.
the class CaseContactsView method createStatusFilterBar.
public HorizontalLayout createStatusFilterBar() {
HorizontalLayout statusFilterLayout = new HorizontalLayout();
statusFilterLayout.setSpacing(true);
statusFilterLayout.setWidth("100%");
statusFilterLayout.addStyleName(CssStyles.VSPACE_3);
statusButtons = new HashMap<>();
Button statusAll = ButtonHelper.createButton(Captions.all, e -> {
criteria.contactStatus(null);
navigateTo(criteria);
}, ValoTheme.BUTTON_BORDERLESS, CssStyles.BUTTON_FILTER);
statusAll.setCaptionAsHtml(true);
statusFilterLayout.addComponent(statusAll);
statusButtons.put(statusAll, I18nProperties.getCaption(Captions.all));
activeStatusButton = statusAll;
for (ContactStatus status : ContactStatus.values()) {
Button statusButton = ButtonHelper.createButton(status.toString(), e -> {
criteria.contactStatus(status);
navigateTo(criteria);
}, ValoTheme.BUTTON_BORDERLESS, CssStyles.BUTTON_FILTER, CssStyles.BUTTON_FILTER_LIGHT);
statusButton.setData(status);
statusButton.setCaptionAsHtml(true);
statusFilterLayout.addComponent(statusButton);
statusButtons.put(statusButton, status.toString());
}
statusFilterLayout.setExpandRatio(statusFilterLayout.getComponent(statusFilterLayout.getComponentCount() - 1), 1);
// Bulk operation dropdown
if (UserProvider.getCurrent().hasUserRight(UserRight.PERFORM_BULK_OPERATIONS)) {
statusFilterLayout.setWidth(100, Unit.PERCENTAGE);
MenuBar bulkOperationsDropdown = MenuBarHelper.createDropDown(Captions.bulkActions, new MenuBarHelper.MenuBarItem(I18nProperties.getCaption(Captions.bulkEdit), VaadinIcons.ELLIPSIS_H, selectedItem -> {
ControllerProvider.getContactController().showBulkContactDataEditComponent(grid.asMultiSelect().getSelectedItems(), getCaseRef().getUuid());
}), new MenuBarHelper.MenuBarItem(I18nProperties.getCaption(Captions.bulkCancelFollowUp), VaadinIcons.CLOSE, selectedItem -> {
ControllerProvider.getContactController().cancelFollowUpOfAllSelectedItems(grid.asMultiSelect().getSelectedItems(), () -> navigateTo(criteria));
}), new MenuBarHelper.MenuBarItem(I18nProperties.getCaption(Captions.bulkLostToFollowUp), VaadinIcons.UNLINK, selectedItem -> {
ControllerProvider.getContactController().setAllSelectedItemsToLostToFollowUp(grid.asMultiSelect().getSelectedItems(), () -> navigateTo(criteria));
}), new MenuBarHelper.MenuBarItem(I18nProperties.getCaption(Captions.bulkDelete), VaadinIcons.TRASH, selectedItem -> {
ControllerProvider.getContactController().deleteAllSelectedItems(grid.asMultiSelect().getSelectedItems(), () -> navigateTo(criteria));
}));
statusFilterLayout.addComponent(bulkOperationsDropdown);
statusFilterLayout.setComponentAlignment(bulkOperationsDropdown, Alignment.TOP_RIGHT);
statusFilterLayout.setExpandRatio(bulkOperationsDropdown, 1);
}
if (UserProvider.getCurrent().hasUserRight(UserRight.CONTACT_IMPORT)) {
Button importButton = ButtonHelper.createIconButton(Captions.actionImport, VaadinIcons.UPLOAD, e -> {
Window popupWindow = VaadinUiUtil.showPopupWindow(new CaseContactsImportLayout(FacadeProvider.getCaseFacade().getCaseDataByUuid(criteria.getCaze().getUuid())));
popupWindow.setCaption(I18nProperties.getString(Strings.headingImportCaseContacts));
popupWindow.addCloseListener(c -> {
grid.reload();
});
}, ValoTheme.BUTTON_PRIMARY);
statusFilterLayout.addComponent(importButton);
statusFilterLayout.setComponentAlignment(importButton, Alignment.MIDDLE_RIGHT);
if (!UserProvider.getCurrent().hasUserRight(UserRight.PERFORM_BULK_OPERATIONS)) {
statusFilterLayout.setExpandRatio(importButton, 1);
}
}
if (UserProvider.getCurrent().hasUserRight(UserRight.CONTACT_EXPORT)) {
VerticalLayout exportLayout = new VerticalLayout();
exportLayout.setSpacing(true);
exportLayout.setMargin(true);
exportLayout.addStyleName(CssStyles.LAYOUT_MINIMAL);
exportLayout.setWidth(200, Unit.PIXELS);
PopupButton exportButton = ButtonHelper.createIconPopupButton(Captions.export, VaadinIcons.DOWNLOAD, exportLayout);
statusFilterLayout.addComponent(exportButton);
statusFilterLayout.setComponentAlignment(exportButton, Alignment.MIDDLE_RIGHT);
if (!UserProvider.getCurrent().hasUserRight(UserRight.PERFORM_BULK_OPERATIONS)) {
statusFilterLayout.setExpandRatio(exportButton, 1);
}
StreamResource streamResource = GridExportStreamResource.createStreamResourceWithSelectedItems(grid, () -> viewConfiguration.isInEagerMode() ? this.grid.asMultiSelect().getSelectedItems() : null, ExportEntityName.CONTACTS);
addExportButton(streamResource, exportButton, exportLayout, VaadinIcons.TABLE, Captions.exportBasic, Descriptions.descExportButton);
StreamResource extendedExportStreamResource = ContactDownloadUtil.createContactExportResource(grid.getCriteria(), this::getSelectedRows, null);
addExportButton(extendedExportStreamResource, exportButton, exportLayout, VaadinIcons.FILE_TEXT, Captions.exportDetailed, Descriptions.descDetailedExportButton);
Button btnCustomExport = ButtonHelper.createIconButton(Captions.exportCustom, VaadinIcons.FILE_TEXT, e -> {
ControllerProvider.getCustomExportController().openContactExportWindow(grid.getCriteria(), this::getSelectedRows);
}, ValoTheme.BUTTON_PRIMARY);
btnCustomExport.setDescription(I18nProperties.getString(Strings.infoCustomExport));
btnCustomExport.setWidth(100, Unit.PERCENTAGE);
exportLayout.addComponent(btnCustomExport);
// Warning if no filters have been selected
Label warningLabel = new Label(I18nProperties.getString(Strings.infoExportNoFilters));
warningLabel.setWidth(100, Unit.PERCENTAGE);
exportLayout.addComponent(warningLabel);
warningLabel.setVisible(false);
exportButton.addClickListener(e -> warningLabel.setVisible(!criteria.hasAnyFilterActive()));
}
if (UserProvider.getCurrent().hasUserRight(UserRight.CONTACT_CREATE)) {
final CaseDataDto caseDto = FacadeProvider.getCaseFacade().getCaseDataByUuid(this.getCaseRef().getUuid());
final ExpandableButton lineListingButton = new ExpandableButton(Captions.lineListing).expand(e -> ControllerProvider.getContactController().openLineListingWindow(caseDto));
statusFilterLayout.addComponent(lineListingButton);
final Button newButton = ButtonHelper.createIconButtonWithCaption(Captions.contactNewContact, I18nProperties.getPrefixCaption(ContactDto.I18N_PREFIX, Captions.contactNewContact), VaadinIcons.PLUS_CIRCLE, e -> ControllerProvider.getContactController().create(this.getCaseRef()), ValoTheme.BUTTON_PRIMARY);
statusFilterLayout.addComponent(newButton);
statusFilterLayout.setComponentAlignment(newButton, Alignment.MIDDLE_RIGHT);
}
statusFilterLayout.addStyleName("top-bar");
activeStatusButton = statusAll;
return statusFilterLayout;
}
use of de.symeda.sormas.api.contact.ContactStatus in project SORMAS-Project by hzi-braunschweig.
the class ContactService method getNewContactCountPerStatus.
public Map<ContactStatus, Long> getNewContactCountPerStatus(ContactCriteria contactCriteria, User user) {
CriteriaBuilder cb = em.getCriteriaBuilder();
CriteriaQuery<Object[]> cq = cb.createQuery(Object[].class);
Root<Contact> contact = cq.from(getElementClass());
final ContactQueryContext contactQueryContext = new ContactQueryContext(cb, cq, contact);
Predicate filter = createUserFilter(contactQueryContext, null);
Predicate criteriaFilter = buildCriteriaFilter(contactCriteria, contactQueryContext);
Predicate notDeleted = cb.isFalse(contact.get(Contact.DELETED));
if (filter != null) {
filter = cb.and(filter, criteriaFilter, notDeleted);
} else {
filter = cb.and(criteriaFilter, notDeleted);
}
if (filter != null) {
cq.where(filter);
}
cq.groupBy(contact.get(Contact.CONTACT_STATUS));
cq.multiselect(contact.get(Contact.CONTACT_STATUS), cb.count(contact));
List<Object[]> results = em.createQuery(cq).getResultList();
return results.stream().collect(Collectors.toMap(e -> (ContactStatus) e[0], e -> (Long) e[1]));
}
use of de.symeda.sormas.api.contact.ContactStatus in project SORMAS-Project by hzi-braunschweig.
the class FollowUpStatusCurveBuilder method buildEpiCurve.
@Override
public void buildEpiCurve(List<Date> datesGroupedBy, DashboardDataProvider dashboardDataProvider) {
int[] underFollowUpNumbers = new int[datesGroupedBy.size()];
int[] lostToFollowUpNumbers = new int[datesGroupedBy.size()];
int[] completedFollowUpNumbers = new int[datesGroupedBy.size()];
int[] canceledFollowUpNumbers = new int[datesGroupedBy.size()];
int[] convertedNumbers = new int[datesGroupedBy.size()];
for (int i = 0; i < datesGroupedBy.size(); i++) {
Date date = datesGroupedBy.get(i);
ContactCriteria contactCriteria = new ContactCriteria().disease(dashboardDataProvider.getDisease()).region(dashboardDataProvider.getRegion()).district(dashboardDataProvider.getDistrict());
if (epiCurveGrouping == EpiCurveGrouping.DAY) {
contactCriteria.reportDateBetween(DateHelper.getStartOfDay(date), DateHelper.getEndOfDay(date));
} else if (epiCurveGrouping == EpiCurveGrouping.WEEK) {
contactCriteria.reportDateBetween(DateHelper.getStartOfWeek(date), DateHelper.getEndOfWeek(date));
} else {
contactCriteria.reportDateBetween(DateHelper.getStartOfMonth(date), DateHelper.getEndOfMonth(date));
}
Map<FollowUpStatus, Long> contactCounts = FacadeProvider.getContactFacade().getNewContactCountPerFollowUpStatus(contactCriteria);
Map<ContactStatus, Long> contactStatusCounts = FacadeProvider.getContactFacade().getNewContactCountPerStatus(contactCriteria);
Long underFollowUpCount = contactCounts.get(FollowUpStatus.FOLLOW_UP);
Long lostToFollowUpCount = contactCounts.get(FollowUpStatus.LOST);
Long completedFollowUpCount = contactCounts.get(FollowUpStatus.COMPLETED);
Long canceledFollowUpCount = contactCounts.get(FollowUpStatus.CANCELED);
Long convertedCount = contactStatusCounts.get(ContactStatus.CONVERTED);
underFollowUpNumbers[i] = underFollowUpCount != null ? underFollowUpCount.intValue() : 0;
lostToFollowUpNumbers[i] = lostToFollowUpCount != null ? lostToFollowUpCount.intValue() : 0;
completedFollowUpNumbers[i] = completedFollowUpCount != null ? completedFollowUpCount.intValue() : 0;
canceledFollowUpNumbers[i] = canceledFollowUpCount != null ? canceledFollowUpCount.intValue() : 0;
convertedNumbers[i] = convertedCount != null ? convertedCount.intValue() : 0;
}
hcjs.append("series: [");
hcjs.append("{ name: '" + I18nProperties.getCaption(Captions.dashboardUnderFollowUpShort) + "', color: '#005A9C', dataLabels: { allowOverlap: false }, data: [");
for (int i = 0; i < underFollowUpNumbers.length; i++) {
if (i == underFollowUpNumbers.length - 1) {
hcjs.append(underFollowUpNumbers[i] + "]},");
} else {
hcjs.append(underFollowUpNumbers[i] + ", ");
}
}
hcjs.append("{ name: '" + I18nProperties.getCaption(Captions.dashboardLostToFollowUpShort) + "', color: '#FF0000', dataLabels: { allowOverlap: false }, data: [");
for (int i = 0; i < lostToFollowUpNumbers.length; i++) {
if (i == lostToFollowUpNumbers.length - 1) {
hcjs.append(lostToFollowUpNumbers[i] + "]},");
} else {
hcjs.append(lostToFollowUpNumbers[i] + ", ");
}
}
hcjs.append("{ name: '" + I18nProperties.getCaption(Captions.dashboardCompletedFollowUpShort) + "', color: '#32CD32', dataLabels: { allowOverlap: false }, data: [");
for (int i = 0; i < completedFollowUpNumbers.length; i++) {
if (i == completedFollowUpNumbers.length - 1) {
hcjs.append(completedFollowUpNumbers[i] + "]},");
} else {
hcjs.append(completedFollowUpNumbers[i] + ", ");
}
}
hcjs.append("{ name: '" + I18nProperties.getCaption(Captions.dashboardCanceledFollowUpShort) + "', color: '#FF8C00', dataLabels: { allowOverlap: false }, data: [");
for (int i = 0; i < canceledFollowUpNumbers.length; i++) {
if (i == canceledFollowUpNumbers.length - 1) {
hcjs.append(canceledFollowUpNumbers[i] + "]},");
} else {
hcjs.append(canceledFollowUpNumbers[i] + ", ");
}
}
hcjs.append("{ name: '" + I18nProperties.getCaption(Captions.dashboardConvertedToCase) + "', color: '#00BFFF', dataLabels: { allowOverlap: false }, data: [");
for (int i = 0; i < convertedNumbers.length; i++) {
if (i == convertedNumbers.length - 1) {
hcjs.append(convertedNumbers[i] + "]}],");
} else {
hcjs.append(convertedNumbers[i] + ", ");
}
}
}
use of de.symeda.sormas.api.contact.ContactStatus in project SORMAS-Project by hzi-braunschweig.
the class ContactsView method createStatusFilterBar.
public HorizontalLayout createStatusFilterBar() {
HorizontalLayout statusFilterLayout = new HorizontalLayout();
statusFilterLayout.setMargin(false);
statusFilterLayout.setSpacing(true);
statusFilterLayout.setWidth(100, Unit.PERCENTAGE);
statusFilterLayout.addStyleName(CssStyles.VSPACE_3);
statusButtons = new HashMap<>();
Button statusAll = ButtonHelper.createButton(I18nProperties.getCaption(Captions.all), e -> {
criteria.contactStatus(null);
navigateTo(criteria);
}, ValoTheme.BUTTON_BORDERLESS, CssStyles.BUTTON_FILTER);
statusAll.setCaptionAsHtml(true);
if (ContactsViewType.FOLLOW_UP_VISITS_OVERVIEW.equals(viewConfiguration.getViewType())) {
CssStyles.style(statusAll, CssStyles.FORCE_CAPTION);
}
statusFilterLayout.addComponent(statusAll);
statusButtons.put(statusAll, I18nProperties.getCaption(Captions.all));
activeStatusButton = statusAll;
for (ContactStatus status : ContactStatus.values()) {
Button statusButton = ButtonHelper.createButton("status-" + status.toString(), status.toString(), e -> {
criteria.contactStatus(status);
navigateTo(criteria);
}, ValoTheme.BUTTON_BORDERLESS, CssStyles.BUTTON_FILTER, CssStyles.BUTTON_FILTER_LIGHT);
statusButton.setCaptionAsHtml(true);
statusButton.setData(status);
if (ContactsViewType.FOLLOW_UP_VISITS_OVERVIEW.equals(viewConfiguration.getViewType())) {
CssStyles.style(statusButton, CssStyles.FORCE_CAPTION);
}
statusFilterLayout.addComponent(statusButton);
statusButtons.put(statusButton, status.toString());
}
HorizontalLayout actionButtonsLayout = new HorizontalLayout();
actionButtonsLayout.setSpacing(true);
{
// Show active/archived/all dropdown
if (UserProvider.getCurrent().hasUserRight(UserRight.CONTACT_VIEW)) {
if (FacadeProvider.getFeatureConfigurationFacade().isFeatureEnabled(FeatureType.AUTOMATIC_ARCHIVING, CoreEntityType.CONTACT)) {
int daysAfterContactGetsArchived = FacadeProvider.getFeatureConfigurationFacade().getProperty(FeatureType.AUTOMATIC_ARCHIVING, CoreEntityType.CONTACT, FeatureTypeProperty.THRESHOLD_IN_DAYS, Integer.class);
if (daysAfterContactGetsArchived > 0) {
relevanceStatusInfoLabel = new Label(VaadinIcons.INFO_CIRCLE.getHtml() + " " + String.format(I18nProperties.getString(Strings.infoArchivedContacts), daysAfterContactGetsArchived), ContentMode.HTML);
relevanceStatusInfoLabel.setVisible(false);
relevanceStatusInfoLabel.addStyleName(CssStyles.LABEL_VERTICAL_ALIGN_SUPER);
actionButtonsLayout.addComponent(relevanceStatusInfoLabel);
actionButtonsLayout.setComponentAlignment(relevanceStatusInfoLabel, Alignment.MIDDLE_RIGHT);
}
}
relevanceStatusFilter = ComboBoxHelper.createComboBoxV7();
relevanceStatusFilter.setId("relevanceStatus");
relevanceStatusFilter.setWidth(140, Unit.PERCENTAGE);
relevanceStatusFilter.setNullSelectionAllowed(false);
relevanceStatusFilter.addItems((Object[]) EntityRelevanceStatus.values());
relevanceStatusFilter.setItemCaption(EntityRelevanceStatus.ACTIVE, I18nProperties.getCaption(Captions.contactActiveContacts));
relevanceStatusFilter.setItemCaption(EntityRelevanceStatus.ARCHIVED, I18nProperties.getCaption(Captions.contactArchivedContacts));
relevanceStatusFilter.setItemCaption(EntityRelevanceStatus.ALL, I18nProperties.getCaption(Captions.contactAllContacts));
relevanceStatusFilter.addValueChangeListener(e -> {
if (relevanceStatusInfoLabel != null) {
relevanceStatusInfoLabel.setVisible(EntityRelevanceStatus.ARCHIVED.equals(e.getProperty().getValue()));
}
criteria.relevanceStatus((EntityRelevanceStatus) e.getProperty().getValue());
navigateTo(criteria);
});
actionButtonsLayout.addComponent(relevanceStatusFilter);
}
// Bulk operation dropdown
if (isBulkEditAllowed()) {
statusFilterLayout.setWidth(100, Unit.PERCENTAGE);
boolean hasBulkOperationsRight = UserProvider.getCurrent().hasUserRight(UserRight.PERFORM_BULK_OPERATIONS);
List<MenuBarHelper.MenuBarItem> bulkActions = new ArrayList<>(Arrays.asList(new MenuBarHelper.MenuBarItem(I18nProperties.getCaption(Captions.bulkEdit), VaadinIcons.ELLIPSIS_H, mi -> grid.bulkActionHandler(items -> ControllerProvider.getContactController().showBulkContactDataEditComponent(items, null)), hasBulkOperationsRight), new MenuBarHelper.MenuBarItem(I18nProperties.getCaption(Captions.bulkCancelFollowUp), VaadinIcons.CLOSE, mi -> grid.bulkActionHandler(items -> ControllerProvider.getContactController().cancelFollowUpOfAllSelectedItems(items, () -> navigateTo(criteria))), hasBulkOperationsRight), new MenuBarHelper.MenuBarItem(I18nProperties.getCaption(Captions.bulkLostToFollowUp), VaadinIcons.UNLINK, mi -> grid.bulkActionHandler(items -> ControllerProvider.getContactController().setAllSelectedItemsToLostToFollowUp(items, () -> navigateTo(criteria))), hasBulkOperationsRight), new MenuBarHelper.MenuBarItem(I18nProperties.getCaption(Captions.bulkDelete), VaadinIcons.TRASH, mi -> grid.bulkActionHandler(items -> ControllerProvider.getContactController().deleteAllSelectedItems(items, () -> navigateTo(criteria)), true), hasBulkOperationsRight), new MenuBarHelper.MenuBarItem(I18nProperties.getCaption(Captions.sormasToSormasShare), VaadinIcons.SHARE, mi -> grid.bulkActionHandler(items -> ControllerProvider.getSormasToSormasController().shareSelectedContacts(items, () -> navigateTo(criteria))), FacadeProvider.getSormasToSormasFacade().isSharingCasesContactsAndSamplesEnabledForUser())));
if (isDocGenerationAllowed() && grid instanceof AbstractContactGrid) {
bulkActions.add(new MenuBarHelper.MenuBarItem(I18nProperties.getCaption(Captions.bulkActionCreatDocuments), VaadinIcons.FILE_TEXT, mi -> grid.bulkActionHandler(items -> {
List<ReferenceDto> references = ((AbstractContactGrid<?>) grid).asMultiSelect().getSelectedItems().stream().map(ContactIndexDto::toReference).collect(Collectors.toList());
if (references.size() == 0) {
new Notification(I18nProperties.getString(Strings.headingNoContactsSelected), I18nProperties.getString(Strings.messageNoContactsSelected), Notification.Type.WARNING_MESSAGE, false).show(Page.getCurrent());
return;
}
ControllerProvider.getDocGenerationController().showBulkQuarantineOrderDocumentDialog(references, DocumentWorkflow.QUARANTINE_ORDER_CONTACT);
})));
}
if (FacadeProvider.getFeatureConfigurationFacade().isFeatureEnabled(FeatureType.EVENT_SURVEILLANCE)) {
bulkActions.add(new MenuBarHelper.MenuBarItem(I18nProperties.getCaption(Captions.bulkLinkToEvent), VaadinIcons.PHONE, mi -> grid.bulkActionHandler(items -> {
List<ContactIndexDto> selectedContacts = grid.asMultiSelect().getSelectedItems().stream().map(item -> (ContactIndexDto) item).collect(Collectors.toList());
if (selectedContacts.isEmpty()) {
new Notification(I18nProperties.getString(Strings.headingNoContactsSelected), I18nProperties.getString(Strings.messageNoContactsSelected), Notification.Type.WARNING_MESSAGE, false).show(Page.getCurrent());
return;
}
if (!selectedContacts.stream().allMatch(contact -> contact.getDisease().equals(selectedContacts.stream().findAny().get().getDisease()))) {
new Notification(I18nProperties.getString(Strings.messageBulkContactsWithDifferentDiseasesSelected), Notification.Type.WARNING_MESSAGE).show(Page.getCurrent());
return;
}
ControllerProvider.getEventController().selectOrCreateEventForContactList(selectedContacts.stream().map(ContactIndexDto::toReference).collect(Collectors.toList()));
})));
}
bulkOperationsDropdown = MenuBarHelper.createDropDown(Captions.bulkActions, bulkActions);
bulkOperationsDropdown.setVisible(viewConfiguration.isInEagerMode());
actionButtonsLayout.addComponent(bulkOperationsDropdown);
}
}
statusFilterLayout.addComponent(actionButtonsLayout);
statusFilterLayout.setComponentAlignment(actionButtonsLayout, Alignment.TOP_RIGHT);
statusFilterLayout.setExpandRatio(actionButtonsLayout, 1);
return statusFilterLayout;
}
use of de.symeda.sormas.api.contact.ContactStatus in project SORMAS-Project by hzi-braunschweig.
the class DashboardFacadeEjb method getEpiCurveSeriesElementsPerContactFollowUpStatus.
@RolesAllowed(UserRight._DASHBOARD_SURVEILLANCE_VIEW)
public Map<Date, Map<String, Long>> getEpiCurveSeriesElementsPerContactFollowUpStatus(DashboardCriteria dashboardCriteria) {
Map<Date, Map<String, Long>> epiCurveSeriesElements = new TreeMap<>();
List<Date> criteriaIntervalStartDates = buildListOfFilteredDates(dashboardCriteria.getDateFrom(), dashboardCriteria.getDateTo(), dashboardCriteria.getEpiCurveGrouping(), dashboardCriteria.isShowMinimumEntries());
ContactCriteria contactCriteria = new ContactCriteria().disease(dashboardCriteria.getDisease()).region(dashboardCriteria.getRegion()).district(dashboardCriteria.getDistrict());
criteriaIntervalStartDates.forEach(intervalStartDate -> {
contactCriteria.reportDateBetween(intervalStartDate, getIntervalEndDate(intervalStartDate, dashboardCriteria.getEpiCurveGrouping()));
Map<FollowUpStatus, Long> contactCounts = contactFacade.getNewContactCountPerFollowUpStatus(contactCriteria);
Map<String, Long> followUpClassificationMap = contactCounts.entrySet().stream().collect(Collectors.toMap(e -> e.getKey().toShortString(), e -> e.getValue()));
Map<ContactStatus, Long> contactStatusCounts = contactFacade.getNewContactCountPerStatus(contactCriteria);
followUpClassificationMap.put(ContactStatus.CONVERTED.toString(), contactStatusCounts.get(ContactStatus.CONVERTED));
epiCurveSeriesElements.put(intervalStartDate, followUpClassificationMap);
});
return epiCurveSeriesElements;
}
Aggregations