Search in sources :

Example 1 with EventStatus

use of de.symeda.sormas.api.event.EventStatus in project SORMAS-Project by hzi-braunschweig.

the class EventReadFragment method onAfterLayoutBinding.

@Override
protected void onAfterLayoutBinding(FragmentEventReadLayoutBinding contentBinding) {
    super.onAfterLayoutBinding(contentBinding);
    String startDateCaption = Boolean.TRUE.equals(contentBinding.getMultiDayEvent()) ? I18nProperties.getPrefixCaption(EventDto.I18N_PREFIX, EventDto.START_DATE) : I18nProperties.getCaption(Captions.singleDayEventDate);
    contentBinding.eventStartDate.setCaption(startDateCaption);
    setFieldVisibilitiesAndAccesses(EventDto.class, contentBinding.mainContent);
    EventStatus eventStatus = record.getEventStatus();
    // The status will be used to modify the caption of the field
    // However we don't want to have somthing like "Dropped evolution date"
    // So let's ignore the DROPPED status and use the EVENT status instead
    String statusCaption;
    if (eventStatus == EventStatus.DROPPED) {
        statusCaption = I18nProperties.getCaption(EVENT_ENTITY);
    } else {
        statusCaption = I18nProperties.getEnumCaption(eventStatus);
    }
    contentBinding.eventEvolutionDate.setCaption(String.format(I18nProperties.getCaption(EVOLUTION_DATE_WITH_STATUS), statusCaption));
    contentBinding.eventEvolutionComment.setCaption(String.format(I18nProperties.getCaption(EVOLUTION_COMMENT_WITH_STATUS), statusCaption));
    FacilityType facilityType = record.getEventLocation().getFacilityType();
    contentBinding.exposureWorkEnvironment.setVisibility(facilityType == null || FacilityTypeGroup.WORKING_PLACE != facilityType.getFacilityTypeGroup() ? View.GONE : View.VISIBLE);
    if (isVisibleAllowed(EventDto.class, contentBinding.eventInfectionPathCertainty)) {
        setVisibleWhen(contentBinding.eventInfectionPathCertainty, contentBinding.eventNosocomial, YesNoUnknown.YES);
    }
    if (isVisibleAllowed(EventDto.class, contentBinding.eventHumanTransmissionMode)) {
        setVisibleWhen(contentBinding.eventHumanTransmissionMode, contentBinding.eventDiseaseTransmissionMode, DiseaseTransmissionMode.HUMAN_TO_HUMAN);
    }
    if (isVisibleAllowed(EventDto.class, contentBinding.eventParenteralTransmissionMode)) {
        setVisibleWhen(contentBinding.eventParenteralTransmissionMode, contentBinding.eventHumanTransmissionMode, HumanTransmissionMode.PARENTERAL);
    }
    if (isVisibleAllowed(EventDto.class, contentBinding.eventMedicallyAssociatedTransmissionMode)) {
        setVisibleWhen(contentBinding.eventMedicallyAssociatedTransmissionMode, contentBinding.eventParenteralTransmissionMode, ParenteralTransmissionMode.MEDICALLY_ASSOCIATED);
    }
    if (isVisibleAllowed(EventDto.class, contentBinding.eventDiseaseVariant)) {
        contentBinding.eventDiseaseVariant.setVisibility(record.getDiseaseVariant() != null ? VISIBLE : GONE);
    }
    if (isVisibleAllowed(EventDto.class, contentBinding.eventSpecificRisk)) {
        contentBinding.eventSpecificRisk.setVisibility(record.getSpecificRisk() != null ? VISIBLE : GONE);
    }
}
Also used : EventStatus(de.symeda.sormas.api.event.EventStatus) FacilityType(de.symeda.sormas.api.infrastructure.facility.FacilityType)

Example 2 with EventStatus

use of de.symeda.sormas.api.event.EventStatus in project SORMAS-Project by hzi-braunschweig.

the class EventsView method createStatusFilterBar.

public HorizontalLayout createStatusFilterBar() {
    HorizontalLayout statusFilterLayout = new HorizontalLayout();
    statusFilterLayout.setSpacing(true);
    statusFilterLayout.setMargin(false);
    statusFilterLayout.setWidth(100, Unit.PERCENTAGE);
    statusFilterLayout.addStyleName(CssStyles.VSPACE_3);
    statusButtons = new HashMap<>();
    if (isDefaultViewType()) {
        Button statusAll = ButtonHelper.createButton(Captions.all, e -> {
            eventCriteria.setEventStatus(null);
            navigateTo(eventCriteria);
        }, ValoTheme.BUTTON_BORDERLESS, CssStyles.BUTTON_FILTER);
        statusAll.setCaptionAsHtml(true);
        statusFilterLayout.addComponent(statusAll);
        statusButtons.put(statusAll, I18nProperties.getCaption(Captions.all));
        activeStatusButton = statusAll;
        for (EventStatus status : EventStatus.values()) {
            Button statusButton = ButtonHelper.createButton("status-" + status, status.toString(), e -> {
                eventCriteria.setEventStatus(status);
                navigateTo(eventCriteria);
            }, ValoTheme.BUTTON_BORDERLESS, CssStyles.BUTTON_FILTER, CssStyles.BUTTON_FILTER_LIGHT);
            statusButton.setCaptionAsHtml(true);
            statusButton.setData(status);
            statusFilterLayout.addComponent(statusButton);
            statusButtons.put(statusButton, status.toString());
        }
    } else if (isActionViewType()) {
        Button statusAll = ButtonHelper.createButton(Captions.all, e -> {
            eventCriteria.setActionStatus(null);
            navigateTo(eventCriteria);
        }, ValoTheme.BUTTON_BORDERLESS, CssStyles.BUTTON_FILTER);
        statusAll.setCaptionAsHtml(true);
        statusFilterLayout.addComponent(statusAll);
        statusButtons.put(statusAll, I18nProperties.getCaption(Captions.all));
        activeStatusButton = statusAll;
        for (ActionStatus status : ActionStatus.values()) {
            Button statusButton = ButtonHelper.createButton("status-" + status, status.toString(), e -> {
                eventCriteria.actionStatus(status);
                navigateTo(eventCriteria);
            }, ValoTheme.BUTTON_BORDERLESS, CssStyles.BUTTON_FILTER, CssStyles.BUTTON_FILTER_LIGHT);
            statusButton.setCaptionAsHtml(true);
            statusButton.setData(status);
            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.EVENT_VIEW)) {
            if (isGroupViewType()) {
                groupRelevanceStatusFilter = buildRelevanceStatus(Captions.eventActiveGroups, Captions.eventArchivedGroups, Captions.eventAllGroups);
                groupRelevanceStatusFilter.addValueChangeListener(e -> {
                    eventGroupCriteria.relevanceStatus((EntityRelevanceStatus) e.getProperty().getValue());
                    navigateTo(eventGroupCriteria);
                });
                actionButtonsLayout.addComponent(groupRelevanceStatusFilter);
            } else {
                int daysAfterEventGetsArchived = FacadeProvider.getConfigFacade().getDaysAfterEventGetsArchived();
                if (daysAfterEventGetsArchived > 0) {
                    relevanceStatusInfoLabel = new Label(VaadinIcons.INFO_CIRCLE.getHtml() + " " + String.format(I18nProperties.getString(Strings.infoArchivedEvents), daysAfterEventGetsArchived), ContentMode.HTML);
                    relevanceStatusInfoLabel.setVisible(false);
                    relevanceStatusInfoLabel.addStyleName(CssStyles.LABEL_VERTICAL_ALIGN_SUPER);
                    actionButtonsLayout.addComponent(relevanceStatusInfoLabel);
                    actionButtonsLayout.setComponentAlignment(relevanceStatusInfoLabel, Alignment.MIDDLE_RIGHT);
                }
                eventRelevanceStatusFilter = buildRelevanceStatus(Captions.eventActiveEvents, Captions.eventArchivedEvents, Captions.eventAllEvents);
                eventRelevanceStatusFilter.addValueChangeListener(e -> {
                    relevanceStatusInfoLabel.setVisible(EntityRelevanceStatus.ARCHIVED.equals(e.getProperty().getValue()));
                    eventCriteria.relevanceStatus((EntityRelevanceStatus) e.getProperty().getValue());
                    navigateTo(eventCriteria);
                });
                actionButtonsLayout.addComponent(eventRelevanceStatusFilter);
            }
        }
        // Bulk operation dropdown
        if (UserProvider.getCurrent().hasUserRight(UserRight.PERFORM_BULK_OPERATIONS_EVENT) && isDefaultViewType()) {
            EventGrid eventGrid = (EventGrid) grid;
            List<MenuBarHelper.MenuBarItem> bulkActions = new ArrayList<>();
            if (UserProvider.getCurrent().hasUserRight(UserRight.EVENT_EDIT)) {
                bulkActions.add(new MenuBarHelper.MenuBarItem(I18nProperties.getCaption(Captions.bulkEdit), VaadinIcons.ELLIPSIS_H, mi -> grid.bulkActionHandler(items -> ControllerProvider.getEventController().showBulkEventDataEditComponent(items))));
            }
            if (UserProvider.getCurrent().hasUserRight(UserRight.EVENT_DELETE)) {
                bulkActions.add(new MenuBarHelper.MenuBarItem(I18nProperties.getCaption(Captions.bulkDelete), VaadinIcons.TRASH, mi -> grid.bulkActionHandler(items -> ControllerProvider.getEventController().deleteAllSelectedItems(items, () -> navigateTo(eventCriteria)), true)));
            }
            if (UserProvider.getCurrent().hasUserRight(UserRight.EVENT_ARCHIVE)) {
                bulkActions.add(new MenuBarHelper.MenuBarItem(I18nProperties.getCaption(Captions.actionArchive), VaadinIcons.ARCHIVE, mi -> grid.bulkActionHandler(items -> ControllerProvider.getEventController().archiveAllSelectedItems(items, () -> navigateTo(eventCriteria, true)), true), EntityRelevanceStatus.ACTIVE.equals(eventCriteria.getRelevanceStatus())));
                bulkActions.add(new MenuBarHelper.MenuBarItem(I18nProperties.getCaption(Captions.actionDearchive), VaadinIcons.ARCHIVE, mi -> grid.bulkActionHandler(items -> ControllerProvider.getEventController().dearchiveAllSelectedItems(eventGrid.asMultiSelect().getSelectedItems(), () -> navigateTo(eventCriteria, true)), true), EntityRelevanceStatus.ARCHIVED.equals(eventCriteria.getRelevanceStatus())));
            }
            if (UserProvider.getCurrent().hasUserRight(UserRight.EVENTGROUP_CREATE) && UserProvider.getCurrent().hasUserRight(UserRight.EVENTGROUP_LINK)) {
                bulkActions.add(new MenuBarHelper.MenuBarItem(I18nProperties.getCaption(Captions.actionGroupEvent), VaadinIcons.FILE_TREE, mi -> grid.bulkActionHandler(items -> ControllerProvider.getEventGroupController().linkAllToGroup(eventGrid.asMultiSelect().getSelectedItems(), () -> navigateTo(eventCriteria)))));
            }
            bulkActions.add(new MenuBarHelper.MenuBarItem(I18nProperties.getCaption(Captions.ExternalSurveillanceToolGateway_send), VaadinIcons.SHARE, mi -> grid.bulkActionHandler(items -> ControllerProvider.getEventController().sendAllSelectedToExternalSurveillanceTool(eventGrid.asMultiSelect().getSelectedItems(), () -> navigateTo(eventCriteria))), FacadeProvider.getExternalSurveillanceToolFacade().isFeatureEnabled()));
            if (isDocGenerationAllowed()) {
                bulkActions.add(new MenuBarHelper.MenuBarItem(I18nProperties.getCaption(Captions.bulkActionCreatDocuments), VaadinIcons.FILE_TEXT, mi -> {
                    grid.bulkActionHandler(items -> {
                        EventGrid eventGrid1 = (EventGrid) this.grid;
                        List<EventReferenceDto> references = eventGrid1.asMultiSelect().getSelectedItems().stream().map(EventIndexDto::toReference).collect(Collectors.toList());
                        if (references.size() == 0) {
                            new Notification(I18nProperties.getString(Strings.headingNoEventsSelected), I18nProperties.getString(Strings.headingNoEventsSelected), Notification.Type.WARNING_MESSAGE, false).show(Page.getCurrent());
                            return;
                        }
                        ControllerProvider.getDocGenerationController().showEventDocumentDialog(references);
                    });
                }));
            }
            bulkOperationsDropdown = MenuBarHelper.createDropDown(Captions.bulkActions, bulkActions);
            bulkOperationsDropdown.setVisible(viewConfiguration.isInEagerMode());
            bulkOperationsDropdown.setCaption("");
            actionButtonsLayout.addComponent(bulkOperationsDropdown);
        }
        if (isDefaultViewType()) {
            // Contact Count Method Dropdown
            contactCountMethod = ComboBoxHelper.createComboBoxV7();
            contactCountMethod.setCaption(I18nProperties.getCaption(Captions.Event_contactCountMethod));
            contactCountMethod.addItem(EventContactCountMethod.ALL);
            contactCountMethod.addItem(EventContactCountMethod.SOURCE_CASE_IN_EVENT);
            contactCountMethod.addItem(EventContactCountMethod.BOTH_METHODS);
            contactCountMethod.setItemCaption(EventContactCountMethod.ALL, I18nProperties.getEnumCaption(EventContactCountMethod.ALL));
            contactCountMethod.setItemCaption(EventContactCountMethod.SOURCE_CASE_IN_EVENT, I18nProperties.getEnumCaption(EventContactCountMethod.SOURCE_CASE_IN_EVENT));
            contactCountMethod.setItemCaption(EventContactCountMethod.BOTH_METHODS, I18nProperties.getEnumCaption(EventContactCountMethod.BOTH_METHODS));
            contactCountMethod.setValue(EventContactCountMethod.ALL);
            contactCountMethod.setTextInputAllowed(false);
            contactCountMethod.setNullSelectionAllowed(false);
            contactCountMethod.addValueChangeListener(event -> {
                ((EventGrid) grid).setContactCountMethod((EventContactCountMethod) event.getProperty().getValue());
                ((EventGrid) grid).reload();
            });
            actionButtonsLayout.addComponent(contactCountMethod);
        }
    }
    statusFilterLayout.addComponent(actionButtonsLayout);
    statusFilterLayout.setComponentAlignment(actionButtonsLayout, Alignment.TOP_RIGHT);
    statusFilterLayout.setExpandRatio(actionButtonsLayout, 1);
    return statusFilterLayout;
}
Also used : FeatureType(de.symeda.sormas.api.feature.FeatureType) ActionStatus(de.symeda.sormas.api.action.ActionStatus) TextField(com.vaadin.ui.TextField) Date(java.util.Date) I18nProperties(de.symeda.sormas.api.i18n.I18nProperties) Alignment(com.vaadin.ui.Alignment) UI(com.vaadin.ui.UI) Window(com.vaadin.ui.Window) ControllerProvider(de.symeda.sormas.ui.ControllerProvider) ExportEntityName(de.symeda.sormas.ui.utils.ExportEntityName) ViewModelProviders(de.symeda.sormas.ui.ViewModelProviders) CssStyles(de.symeda.sormas.ui.utils.CssStyles) MenuBarHelper(de.symeda.sormas.ui.utils.MenuBarHelper) Page(com.vaadin.server.Page) ViewChangeEvent(com.vaadin.navigator.ViewChangeListener.ViewChangeEvent) VaadinIcons(com.vaadin.icons.VaadinIcons) ComboBoxHelper(de.symeda.sormas.ui.utils.ComboBoxHelper) UserProvider(de.symeda.sormas.ui.UserProvider) ValoTheme(com.vaadin.ui.themes.ValoTheme) DownloadUtil(de.symeda.sormas.ui.utils.DownloadUtil) FilteredGrid(de.symeda.sormas.ui.utils.FilteredGrid) MenuBar(com.vaadin.ui.MenuBar) ComboBox(com.vaadin.v7.ui.ComboBox) Set(java.util.Set) RefreshEvent(org.hibernate.event.spi.RefreshEvent) EventDto(de.symeda.sormas.api.event.EventDto) Collectors(java.util.stream.Collectors) ExportConfigurationDto(de.symeda.sormas.api.importexport.ExportConfigurationDto) List(java.util.List) EventImportLayout(de.symeda.sormas.ui.events.importer.EventImportLayout) EventIndexDto(de.symeda.sormas.api.event.EventIndexDto) StreamResource(com.vaadin.server.StreamResource) VaadinUiUtil(de.symeda.sormas.ui.utils.VaadinUiUtil) SearchSpecificLayout(de.symeda.sormas.ui.SearchSpecificLayout) FacadeProvider(de.symeda.sormas.api.FacadeProvider) DateFormatHelper(de.symeda.sormas.ui.utils.DateFormatHelper) VerticalLayout(com.vaadin.ui.VerticalLayout) GridExportStreamResource(de.symeda.sormas.ui.utils.GridExportStreamResource) HashMap(java.util.HashMap) PopupButton(org.vaadin.hene.popupbutton.PopupButton) EntityRelevanceStatus(de.symeda.sormas.api.EntityRelevanceStatus) EventGroupCriteria(de.symeda.sormas.api.event.EventGroupCriteria) PopupMenu(de.symeda.sormas.ui.utils.components.popupmenu.PopupMenu) EventStatus(de.symeda.sormas.api.event.EventStatus) ArrayList(java.util.ArrayList) CaseReferenceDto(de.symeda.sormas.api.caze.CaseReferenceDto) OptionGroup(com.vaadin.v7.ui.OptionGroup) EventCriteria(de.symeda.sormas.api.event.EventCriteria) Notification(com.vaadin.ui.Notification) SormasUI(de.symeda.sormas.ui.SormasUI) Label(com.vaadin.ui.Label) EventActionExportDto(de.symeda.sormas.api.event.EventActionExportDto) AbstractView(de.symeda.sormas.ui.utils.AbstractView) ButtonHelper(de.symeda.sormas.ui.utils.ButtonHelper) ContentMode(com.vaadin.shared.ui.ContentMode) Captions(de.symeda.sormas.api.i18n.Captions) EventActionIndexDto(de.symeda.sormas.api.event.EventActionIndexDto) UserRight(de.symeda.sormas.api.user.UserRight) Button(com.vaadin.ui.Button) LayoutUtil(de.symeda.sormas.ui.utils.LayoutUtil) ImportExportUtils(de.symeda.sormas.api.importexport.ImportExportUtils) HorizontalLayout(com.vaadin.ui.HorizontalLayout) EventReferenceDto(de.symeda.sormas.api.event.EventReferenceDto) Strings(de.symeda.sormas.api.i18n.Strings) ExportPropertyMetaInfo(de.symeda.sormas.api.importexport.ExportPropertyMetaInfo) DocGenerationHelper.isDocGenerationAllowed(de.symeda.sormas.ui.docgeneration.DocGenerationHelper.isDocGenerationAllowed) Collections(java.util.Collections) EventDownloadUtil(de.symeda.sormas.ui.utils.EventDownloadUtil) ActionDto(de.symeda.sormas.api.action.ActionDto) EventStatus(de.symeda.sormas.api.event.EventStatus) EntityRelevanceStatus(de.symeda.sormas.api.EntityRelevanceStatus) Label(com.vaadin.ui.Label) Notification(com.vaadin.ui.Notification) HorizontalLayout(com.vaadin.ui.HorizontalLayout) ActionStatus(de.symeda.sormas.api.action.ActionStatus) MenuBarHelper(de.symeda.sormas.ui.utils.MenuBarHelper) PopupButton(org.vaadin.hene.popupbutton.PopupButton) Button(com.vaadin.ui.Button) EventReferenceDto(de.symeda.sormas.api.event.EventReferenceDto) List(java.util.List) ArrayList(java.util.ArrayList)

Example 3 with EventStatus

use of de.symeda.sormas.api.event.EventStatus in project SORMAS-Project by hzi-braunschweig.

the class EventEditFragment method setUpControlListeners.

private void setUpControlListeners(final FragmentEventEditLayoutBinding contentBinding) {
    contentBinding.eventEventLocation.setOnClickListener(new View.OnClickListener() {

        @Override
        public void onClick(View v) {
            openAddressPopup(contentBinding);
        }
    });
    contentBinding.eventEventStatus.addValueChangedListener(e -> {
        EventStatus eventStatus = (EventStatus) e.getValue();
        // The status will be used to modify the caption of the field
        // However we don't want to have somthing like "Dropped evolution date"
        // So let's ignore the DROPPED status and use the EVENT status instead
        String statusCaption;
        if (eventStatus == EventStatus.DROPPED) {
            statusCaption = I18nProperties.getCaption(EVENT_ENTITY);
        } else {
            statusCaption = I18nProperties.getEnumCaption(eventStatus);
        }
        contentBinding.eventEvolutionDate.setCaption(String.format(I18nProperties.getCaption(EVOLUTION_DATE_WITH_STATUS), statusCaption));
        contentBinding.eventEvolutionComment.setCaption(String.format(I18nProperties.getCaption(EVOLUTION_COMMENT_WITH_STATUS), statusCaption));
    });
    contentBinding.eventDisease.addValueChangedListener(f -> updateCustomizableEnumFields(contentBinding));
}
Also used : EventStatus(de.symeda.sormas.api.event.EventStatus) View(android.view.View)

Example 4 with EventStatus

use of de.symeda.sormas.api.event.EventStatus in project SORMAS-Project by hzi-braunschweig.

the class DashboardService method getEventCountByStatus.

public Map<EventStatus, Long> getEventCountByStatus(DashboardCriteria dashboardCriteria) {
    CriteriaBuilder cb = em.getCriteriaBuilder();
    CriteriaQuery<Object[]> cq = cb.createQuery(Object[].class);
    Root<Event> event = cq.from(Event.class);
    EventQueryContext eventQueryContext = new EventQueryContext(cb, cq, event);
    cq.multiselect(event.get(Event.EVENT_STATUS), cb.count(event));
    cq.groupBy(event.get(Event.EVENT_STATUS));
    Predicate filter = eventService.createDefaultFilter(cb, event);
    filter = CriteriaBuilderHelper.and(cb, filter, buildEventCriteriaFilter(dashboardCriteria, eventQueryContext));
    filter = CriteriaBuilderHelper.and(cb, filter, eventService.createUserFilter(cb, cq, event));
    if (filter != null)
        cq.where(filter);
    List<Object[]> results = em.createQuery(cq).getResultList();
    return results.stream().collect(Collectors.toMap(e -> (EventStatus) e[0], e -> (Long) e[1]));
}
Also used : CriteriaBuilder(javax.persistence.criteria.CriteriaBuilder) EventService(de.symeda.sormas.backend.event.EventService) Join(javax.persistence.criteria.Join) AbstractDomainObject(de.symeda.sormas.backend.common.AbstractDomainObject) Date(java.util.Date) DashboardEventDto(de.symeda.sormas.api.dashboard.DashboardEventDto) EventJoins(de.symeda.sormas.utils.EventJoins) StringUtils(org.apache.commons.lang3.StringUtils) Predicate(javax.persistence.criteria.Predicate) Map(java.util.Map) CriteriaBuilder(javax.persistence.criteria.CriteriaBuilder) JoinType(javax.persistence.criteria.JoinType) From(javax.persistence.criteria.From) DashboardCaseDto(de.symeda.sormas.api.dashboard.DashboardCaseDto) Stateless(javax.ejb.Stateless) CriteriaQuery(javax.persistence.criteria.CriteriaQuery) CaseService(de.symeda.sormas.backend.caze.CaseService) Person(de.symeda.sormas.backend.person.Person) Region(de.symeda.sormas.backend.infrastructure.region.Region) District(de.symeda.sormas.backend.infrastructure.district.District) Collectors(java.util.stream.Collectors) List(java.util.List) User(de.symeda.sormas.backend.user.User) JurisdictionHelper(de.symeda.sormas.backend.util.JurisdictionHelper) Order(javax.persistence.criteria.Order) Location(de.symeda.sormas.backend.location.Location) Community(de.symeda.sormas.backend.infrastructure.community.Community) CaseUserFilterCriteria(de.symeda.sormas.backend.caze.CaseUserFilterCriteria) QueryHelper(de.symeda.sormas.backend.util.QueryHelper) CaseClassification(de.symeda.sormas.api.caze.CaseClassification) DateHelper(de.symeda.sormas.api.utils.DateHelper) HashMap(java.util.HashMap) EventStatus(de.symeda.sormas.api.event.EventStatus) EventQueryContext(de.symeda.sormas.backend.event.EventQueryContext) ArrayList(java.util.ArrayList) Case(de.symeda.sormas.backend.caze.Case) DashboardCriteria(de.symeda.sormas.api.dashboard.DashboardCriteria) LocalBean(javax.ejb.LocalBean) CaseQueryContext(de.symeda.sormas.backend.caze.CaseQueryContext) Expression(javax.persistence.criteria.Expression) CriteriaBuilderHelper(de.symeda.sormas.backend.common.CriteriaBuilderHelper) EJB(javax.ejb.EJB) Root(javax.persistence.criteria.Root) ModelConstants(de.symeda.sormas.backend.util.ModelConstants) CaseJoins(de.symeda.sormas.utils.CaseJoins) EntityManager(javax.persistence.EntityManager) PersistenceContext(javax.persistence.PersistenceContext) Event(de.symeda.sormas.backend.event.Event) PresentCondition(de.symeda.sormas.api.person.PresentCondition) Disease(de.symeda.sormas.api.Disease) Collections(java.util.Collections) EventStatus(de.symeda.sormas.api.event.EventStatus) Event(de.symeda.sormas.backend.event.Event) AbstractDomainObject(de.symeda.sormas.backend.common.AbstractDomainObject) EventQueryContext(de.symeda.sormas.backend.event.EventQueryContext) Predicate(javax.persistence.criteria.Predicate)

Example 5 with EventStatus

use of de.symeda.sormas.api.event.EventStatus in project SORMAS-Project by hzi-braunschweig.

the class EventDataForm method addFields.

@Override
protected void addFields() {
    if (isCreateForm == null) {
        return;
    }
    Label eventDataHeadingLabel = new Label(I18nProperties.getString(Strings.headingEventData));
    eventDataHeadingLabel.addStyleName(H3);
    getContent().addComponent(eventDataHeadingLabel, EVENT_DATA_HEADING_LOC);
    Label informationSourceHeadingLabel = new Label(I18nProperties.getString(Strings.headingInformationSource));
    informationSourceHeadingLabel.addStyleName(H3);
    getContent().addComponent(informationSourceHeadingLabel, INFORMATION_SOURCE_HEADING_LOC);
    Label locationHeadingLabel = new Label(I18nProperties.getString(Strings.headingLocation));
    locationHeadingLabel.addStyleName(H3);
    getContent().addComponent(locationHeadingLabel, LOCATION_HEADING_LOC);
    addField(EventDto.UUID, TextField.class);
    ComboBox diseaseField = addDiseaseField(EventDto.DISEASE, false, isCreateForm);
    addField(EventDto.DISEASE_DETAILS, TextField.class);
    ComboBox diseaseVariantField = addField(EventDto.DISEASE_VARIANT, ComboBox.class);
    diseaseVariantField.setNullSelectionAllowed(true);
    addFields(EventDto.EXTERNAL_ID);
    TextField diseaseVariantDetailsField = addField(EventDto.DISEASE_VARIANT_DETAILS, TextField.class);
    diseaseVariantDetailsField.setVisible(false);
    TextField externalTokenField = addField(EventDto.EXTERNAL_TOKEN);
    Label externalTokenWarningLabel = new Label(I18nProperties.getString(Strings.messageEventExternalTokenWarning));
    externalTokenWarningLabel.addStyleNames(VSPACE_3, LABEL_WHITE_SPACE_NORMAL);
    getContent().addComponent(externalTokenWarningLabel, EXTERNAL_TOKEN_WARNING_LOC);
    addField(EventDto.INTERNAL_TOKEN);
    DateTimeField startDate = addField(EventDto.START_DATE, DateTimeField.class);
    CheckBox multiDayCheckbox = addField(EventDto.MULTI_DAY_EVENT, CheckBox.class);
    DateTimeField endDate = addField(EventDto.END_DATE, DateTimeField.class);
    initEventDateValidation(startDate, endDate, multiDayCheckbox);
    addField(EventDto.EVENT_STATUS, NullableOptionGroup.class);
    addField(EventDto.RISK_LEVEL);
    ComboBox specificRiskField = addField(EventDto.SPECIFIC_RISK, ComboBox.class);
    specificRiskField.setNullSelectionAllowed(true);
    addField(EventDto.EVENT_MANAGEMENT_STATUS, NullableOptionGroup.class);
    addField(EventDto.EVENT_IDENTIFICATION_SOURCE, NullableOptionGroup.class);
    addField(EventDto.EVENT_INVESTIGATION_STATUS, NullableOptionGroup.class);
    addField(EventDto.EVENT_INVESTIGATION_START_DATE, DateField.class);
    addField(EventDto.EVENT_INVESTIGATION_END_DATE, DateField.class);
    FieldHelper.setVisibleWhen(getFieldGroup(), Arrays.asList(EventDto.EVENT_INVESTIGATION_START_DATE, EventDto.EVENT_INVESTIGATION_END_DATE), EventDto.EVENT_INVESTIGATION_STATUS, Arrays.asList(EventInvestigationStatus.ONGOING, EventInvestigationStatus.DONE, EventInvestigationStatus.DISCARDED), true);
    TextField title = addField(EventDto.EVENT_TITLE, TextField.class);
    title.addStyleName(CssStyles.SOFT_REQUIRED);
    TextArea descriptionField = addField(EventDto.EVENT_DESC, TextArea.class, new ResizableTextAreaWrapper<>());
    descriptionField.setRows(2);
    descriptionField.setDescription(I18nProperties.getPrefixDescription(EventDto.I18N_PREFIX, EventDto.EVENT_DESC, "") + "\n" + I18nProperties.getDescription(Descriptions.descGdpr));
    addField(EventDto.DISEASE_TRANSMISSION_MODE, ComboBox.class);
    addField(EventDto.NOSOCOMIAL, NullableOptionGroup.class);
    addFields(EventDto.HUMAN_TRANSMISSION_MODE, EventDto.INFECTION_PATH_CERTAINTY);
    addFields(EventDto.PARENTERAL_TRANSMISSION_MODE, EventDto.MEDICALLY_ASSOCIATED_TRANSMISSION_MODE);
    final NullableOptionGroup epidemiologicalEvidence = addField(EventDto.EPIDEMIOLOGICAL_EVIDENCE, NullableOptionGroup.class);
    final NullableOptionGroup laboratoryDiagnosticEvidence = addField(EventDto.LABORATORY_DIAGNOSTIC_EVIDENCE, NullableOptionGroup.class);
    epidemiologicalEvidenceCheckBoxTree = new EpidemiologicalEvidenceCheckBoxTree(Arrays.stream(EpidemiologicalEvidenceDetail.values()).map(epidemiologicalEvidenceDetail -> epidemiologicalEvidenceDetailToCheckBoxElement(epidemiologicalEvidenceDetail)).collect(Collectors.toList()));
    getContent().addComponent(epidemiologicalEvidenceCheckBoxTree, EventDto.EPIDEMIOLOGICAL_EVIDENCE_DETAILS);
    epidemiologicalEvidenceCheckBoxTree.setVisible(false);
    laboratoryDiagnosticEvidenceCheckBoxTree = new LaboratoryDiagnosticEvidenceCheckBoxTree(Arrays.stream(LaboratoryDiagnosticEvidenceDetail.values()).map(laboratoryDiagnosticEvidenceDetail -> laboratoryDiagnosticEvidenceDetailToCheckBoxElement(laboratoryDiagnosticEvidenceDetail)).collect(Collectors.toList()));
    getContent().addComponent(laboratoryDiagnosticEvidenceCheckBoxTree, EventDto.LABORATORY_DIAGNOSTIC_EVIDENCE_DETAILS);
    laboratoryDiagnosticEvidenceCheckBoxTree.setVisible(false);
    DateField evolutionDateField = addField(EventDto.EVOLUTION_DATE, DateField.class);
    TextField evolutionCommentField = addField(EventDto.EVOLUTION_COMMENT, TextField.class);
    Field<?> statusField = getField(EventDto.EVENT_STATUS);
    statusField.addValueChangeListener(e -> {
        if (statusField.getValue() == null) {
            return;
        }
        EventStatus eventStatus = (EventStatus) statusField.getValue();
        // The status will be used to modify the caption of the field
        // However we don't want to have somthing like "Dropped evolution date"
        // So let's ignore the DROPPED status and use the Event entity caption instead
        String statusCaption;
        if (eventStatus == EventStatus.DROPPED) {
            statusCaption = I18nProperties.getCaption(EVENT_ENTITY);
        } else {
            statusCaption = I18nProperties.getEnumCaption(eventStatus);
        }
        evolutionDateField.setCaption(String.format(I18nProperties.getCaption(EVOLUTION_DATE_WITH_STATUS), statusCaption));
        evolutionCommentField.setCaption(String.format(I18nProperties.getCaption(EVOLUTION_COMMENT_WITH_STATUS), statusCaption));
    });
    FieldHelper.setVisibleWhenSourceNotNull(getFieldGroup(), Collections.singletonList(EventDto.EVOLUTION_COMMENT), EventDto.EVOLUTION_DATE, true);
    ComboBox typeOfPlace = addField(EventDto.TYPE_OF_PLACE, ComboBox.class);
    typeOfPlace.setNullSelectionAllowed(true);
    addField(EventDto.TYPE_OF_PLACE_TEXT, TextField.class);
    addField(EventDto.WORK_ENVIRONMENT);
    ComboBox meansOfTransport = addField(EventDto.MEANS_OF_TRANSPORT);
    TextField connectionNumber = addField(EventDto.CONNECTION_NUMBER);
    DateField travelDate = addField(EventDto.TRAVEL_DATE);
    FieldHelper.setVisibleWhen(getFieldGroup(), Collections.singletonList(EventDto.MEANS_OF_TRANSPORT), EventDto.TYPE_OF_PLACE, Collections.singletonList(TypeOfPlace.MEANS_OF_TRANSPORT), true);
    TextField meansOfTransportDetails = addField(EventDto.MEANS_OF_TRANSPORT_DETAILS);
    FieldHelper.setVisibleWhen(getFieldGroup(), Collections.singletonList(EventDto.MEANS_OF_TRANSPORT_DETAILS), EventDto.MEANS_OF_TRANSPORT, Collections.singletonList(MeansOfTransport.OTHER), true);
    FieldHelper.setVisibleWhen(getFieldGroup(), Arrays.asList(EventDto.CONNECTION_NUMBER, EventDto.TRAVEL_DATE), EventDto.TYPE_OF_PLACE, Collections.singletonList(TypeOfPlace.MEANS_OF_TRANSPORT), true);
    getField(EventDto.MEANS_OF_TRANSPORT).addValueChangeListener(e -> {
        if (e.getProperty().getValue() == MeansOfTransport.PLANE) {
            getField(EventDto.CONNECTION_NUMBER).setCaption(I18nProperties.getCaption(Captions.exposureFlightNumber));
        } else {
            getField(EventDto.CONNECTION_NUMBER).setCaption(I18nProperties.getPrefixCaption(EventDto.I18N_PREFIX, EventDto.CONNECTION_NUMBER));
        }
    });
    DateField reportDate = addField(EventDto.REPORT_DATE_TIME, DateField.class);
    addField(EventDto.REPORTING_USER, ComboBox.class);
    addField(EventDto.TRANSREGIONAL_OUTBREAK, NullableOptionGroup.class);
    ComboBox srcType = addField(EventDto.SRC_TYPE);
    TextField srcFirstName = addField(EventDto.SRC_FIRST_NAME, TextField.class);
    TextField srcLastName = addField(EventDto.SRC_LAST_NAME, TextField.class);
    TextField srcTelNo = addField(EventDto.SRC_TEL_NO, TextField.class);
    addField(EventDto.SRC_EMAIL, TextField.class);
    TextField srcMediaWebsite = addField(EventDto.SRC_MEDIA_WEBSITE, TextField.class);
    TextField srcMediaName = addField(EventDto.SRC_MEDIA_NAME, TextField.class);
    TextArea srcMediaDetails = addField(EventDto.SRC_MEDIA_DETAILS, TextArea.class);
    srcMediaDetails.setRows(4);
    ComboBox srcInstitutionalPartnerType = addField(EventDto.SRC_INSTITUTIONAL_PARTNER_TYPE);
    FieldHelper.setVisibleWhen(getFieldGroup(), Collections.singletonList(EventDto.SRC_INSTITUTIONAL_PARTNER_TYPE), EventDto.SRC_TYPE, Collections.singletonList(EventSourceType.INSTITUTIONAL_PARTNER), true);
    TextField srcInstitutionalPartnerTypeDetails = addField(EventDto.SRC_INSTITUTIONAL_PARTNER_TYPE_DETAILS);
    FieldHelper.setVisibleWhen(getFieldGroup(), Collections.singletonList(EventDto.SRC_INSTITUTIONAL_PARTNER_TYPE_DETAILS), EventDto.SRC_INSTITUTIONAL_PARTNER_TYPE, Collections.singletonList(InstitutionalPartnerType.OTHER), true);
    addField(EventDto.EVENT_LOCATION, new LocationEditForm(fieldVisibilityCheckers, createFieldAccessCheckers(isPseudonymized, false))).setCaption(null);
    locationForm = (LocationEditForm) getFieldGroup().getField(EventDto.EVENT_LOCATION);
    locationForm.setDistrictRequiredOnDefaultCountry(true);
    ComboBox regionField = (ComboBox) locationForm.getFieldGroup().getField(LocationDto.REGION);
    ComboBox districtField = (ComboBox) locationForm.getFieldGroup().getField(LocationDto.DISTRICT);
    ComboBox responsibleUserField = addField(EventDto.RESPONSIBLE_USER, ComboBox.class);
    responsibleUserField.setNullSelectionAllowed(true);
    if (isCreateForm) {
        locationForm.hideValidationUntilNextCommit();
    }
    setReadOnly(true, EventDto.UUID, EventDto.REPORTING_USER);
    initializeVisibilitiesAndAllowedVisibilities();
    initializeAccessAndAllowedAccesses();
    FieldHelper.setVisibleWhen(getFieldGroup(), EventDto.WORK_ENVIRONMENT, locationForm.getFacilityTypeGroup(), Collections.singletonList(FacilityTypeGroup.WORKING_PLACE), true);
    FieldHelper.setVisibleWhen(getFieldGroup(), Collections.singletonList(EventDto.DISEASE_DETAILS), EventDto.DISEASE, Collections.singletonList(Disease.OTHER), true);
    FieldHelper.setRequiredWhen(getFieldGroup(), EventDto.DISEASE, Collections.singletonList(EventDto.DISEASE_DETAILS), Collections.singletonList(Disease.OTHER));
    // Customizable enum fields visibilities
    diseaseVariantField.setVisible(false);
    diseaseField.addValueChangeListener((ValueChangeListener) valueChangeEvent -> {
        Disease disease = (Disease) valueChangeEvent.getProperty().getValue();
        List<DiseaseVariant> diseaseVariants = FacadeProvider.getCustomizableEnumFacade().getEnumValues(CustomizableEnumType.DISEASE_VARIANT, disease);
        FieldHelper.updateItems(diseaseVariantField, diseaseVariants);
        diseaseVariantField.setVisible(disease != null && CollectionUtils.isNotEmpty(diseaseVariants));
        List<SpecificRisk> specificRiskValues = FacadeProvider.getCustomizableEnumFacade().getEnumValues(CustomizableEnumType.SPECIFIC_EVENT_RISK, disease);
        FieldHelper.updateItems(specificRiskField, specificRiskValues);
        specificRiskField.setVisible(isVisibleAllowed(EventDto.SPECIFIC_RISK) && CollectionUtils.isNotEmpty(specificRiskValues));
    });
    diseaseVariantField.addValueChangeListener(e -> {
        DiseaseVariant diseaseVariant = (DiseaseVariant) e.getProperty().getValue();
        diseaseVariantDetailsField.setVisible(diseaseVariant != null && diseaseVariant.matchPropertyValue(DiseaseVariant.HAS_DETAILS, true));
    });
    setRequired(true, EventDto.EVENT_STATUS, EventDto.UUID, EventDto.EVENT_TITLE, EventDto.REPORT_DATE_TIME, EventDto.REPORTING_USER);
    reportDate.addValidator(new DateComparisonValidator(reportDate, startDate, false, false, I18nProperties.getValidationError(Validations.afterDate, reportDate.getCaption(), startDate.getCaption())));
    startDate.addValidator(new DateComparisonValidator(startDate, reportDate, true, false, I18nProperties.getValidationError(Validations.beforeDate, startDate.getCaption(), reportDate.getCaption())));
    FieldHelper.setVisibleWhen(getFieldGroup(), EventDto.END_DATE, EventDto.MULTI_DAY_EVENT, Collections.singletonList(true), true);
    FieldHelper.setCaptionWhen(multiDayCheckbox, startDate, false, I18nProperties.getCaption(Captions.singleDayEventDate), I18nProperties.getCaption(Captions.Event_startDate));
    FieldHelper.setVisibleWhen(getFieldGroup(), Arrays.asList(EventDto.NOSOCOMIAL, EventDto.TRANSREGIONAL_OUTBREAK, EventDto.DISEASE_TRANSMISSION_MODE), EventDto.EVENT_STATUS, Collections.singletonList(EventStatus.CLUSTER), true);
    if (isVisibleAllowed(EventDto.INFECTION_PATH_CERTAINTY)) {
        FieldHelper.setVisibleWhen(getFieldGroup(), EventDto.INFECTION_PATH_CERTAINTY, EventDto.NOSOCOMIAL, Collections.singletonList(YesNoUnknown.YES), true);
    }
    if (isVisibleAllowed(EventDto.HUMAN_TRANSMISSION_MODE)) {
        FieldHelper.setVisibleWhen(getFieldGroup(), EventDto.HUMAN_TRANSMISSION_MODE, EventDto.DISEASE_TRANSMISSION_MODE, Collections.singletonList(DiseaseTransmissionMode.HUMAN_TO_HUMAN), true);
    }
    if (isVisibleAllowed(EventDto.PARENTERAL_TRANSMISSION_MODE)) {
        FieldHelper.setVisibleWhen(getFieldGroup(), EventDto.PARENTERAL_TRANSMISSION_MODE, EventDto.HUMAN_TRANSMISSION_MODE, Collections.singletonList(HumanTransmissionMode.PARENTERAL), true);
    }
    if (isVisibleAllowed(EventDto.MEDICALLY_ASSOCIATED_TRANSMISSION_MODE)) {
        FieldHelper.setVisibleWhen(getFieldGroup(), EventDto.MEDICALLY_ASSOCIATED_TRANSMISSION_MODE, EventDto.PARENTERAL_TRANSMISSION_MODE, Collections.singletonList(ParenteralTransmissionMode.MEDICALLY_ASSOCIATED), true);
    }
    if (isVisibleAllowed(EventDto.EPIDEMIOLOGICAL_EVIDENCE)) {
        FieldHelper.setVisibleWhen(getFieldGroup(), EventDto.EPIDEMIOLOGICAL_EVIDENCE, EventDto.DISEASE_TRANSMISSION_MODE, Collections.singletonList(DiseaseTransmissionMode.HUMAN_TO_HUMAN), true);
        epidemiologicalEvidence.addValueChangeListener(valueChangeEvent -> {
            if (((NullableOptionGroup) valueChangeEvent.getProperty()).getNullableValue() == YesNoUnknown.YES) {
                epidemiologicalEvidenceCheckBoxTree.setVisible(true);
            } else {
                epidemiologicalEvidenceCheckBoxTree.clearCheckBoxTree();
                epidemiologicalEvidenceCheckBoxTree.setVisible(false);
            }
        });
    }
    if (isVisibleAllowed(EventDto.LABORATORY_DIAGNOSTIC_EVIDENCE)) {
        FieldHelper.setVisibleWhen(getFieldGroup(), EventDto.LABORATORY_DIAGNOSTIC_EVIDENCE, EventDto.DISEASE_TRANSMISSION_MODE, Collections.singletonList(DiseaseTransmissionMode.HUMAN_TO_HUMAN), true);
        laboratoryDiagnosticEvidence.addValueChangeListener(valueChangeEvent -> {
            if (((NullableOptionGroup) valueChangeEvent.getProperty()).getNullableValue() == YesNoUnknown.YES) {
                laboratoryDiagnosticEvidenceCheckBoxTree.setVisible(true);
            } else {
                laboratoryDiagnosticEvidenceCheckBoxTree.clearCheckBoxTree();
                laboratoryDiagnosticEvidenceCheckBoxTree.setVisible(false);
            }
        });
    }
    FieldHelper.setVisibleWhen(getFieldGroup(), Arrays.asList(EventDto.SRC_FIRST_NAME, EventDto.SRC_LAST_NAME, EventDto.SRC_TEL_NO, EventDto.SRC_EMAIL), EventDto.SRC_TYPE, Arrays.asList(EventSourceType.HOTLINE_PERSON, EventSourceType.INSTITUTIONAL_PARTNER), true);
    FieldHelper.setVisibleWhen(getFieldGroup(), Arrays.asList(EventDto.SRC_MEDIA_WEBSITE, EventDto.SRC_MEDIA_NAME, EventDto.SRC_MEDIA_DETAILS), EventDto.SRC_TYPE, Collections.singletonList(EventSourceType.MEDIA_NEWS), true);
    FieldHelper.setVisibleWhen(getFieldGroup(), EventDto.TYPE_OF_PLACE_TEXT, EventDto.TYPE_OF_PLACE, Collections.singletonList(TypeOfPlace.OTHER), true);
    setTypeOfPlaceTextRequirement();
    locationForm.setFacilityFieldsVisible(getField(EventDto.TYPE_OF_PLACE).getValue() == TypeOfPlace.FACILITY, true);
    typeOfPlace.addValueChangeListener(e -> locationForm.setFacilityFieldsVisible(e.getProperty().getValue() == TypeOfPlace.FACILITY, true));
    regionField.addValueChangeListener(e -> {
        RegionReferenceDto region = (RegionReferenceDto) regionField.getValue();
        if (region != null) {
            responsibleUserSurveillanceSupervisors = FacadeProvider.getUserFacade().getUsersByRegionAndRoles(region, UserRole.SURVEILLANCE_SUPERVISOR);
        } else {
            responsibleUserSurveillanceSupervisors.clear();
        }
    });
    districtField.addValueChangeListener(e -> {
        DistrictReferenceDto district = (DistrictReferenceDto) districtField.getValue();
        if (district != null) {
            List<UserReferenceDto> currentDistrictSurveillanceOfficers = FacadeProvider.getUserFacade().getUserRefsByDistrict(district, false, UserRole.SURVEILLANCE_OFFICER);
            List<UserReferenceDto> responsibleUsers = new ArrayList<>();
            responsibleUsers.addAll(currentDistrictSurveillanceOfficers);
            responsibleUsers.addAll(responsibleUserSurveillanceSupervisors);
            FieldHelper.updateItems(responsibleUserField, responsibleUsers);
        } else {
            responsibleUserField.removeAllItems();
        }
    });
    FieldHelper.addSoftRequiredStyle(startDate, endDate, typeOfPlace, meansOfTransport, meansOfTransportDetails, connectionNumber, travelDate, responsibleUserField, srcType, srcInstitutionalPartnerType, srcInstitutionalPartnerTypeDetails, srcFirstName, srcLastName, srcTelNo, srcMediaWebsite, srcMediaName);
    // Make external ID field read-only when SORMAS is connected to a SurvNet instance
    if (StringUtils.isNotEmpty(FacadeProvider.getConfigFacade().getExternalSurveillanceToolGatewayUrl())) {
        setEnabled(false, EventDto.EXTERNAL_ID);
        ((TextField) getField(EventDto.EXTERNAL_ID)).setInputPrompt(I18nProperties.getString(Strings.promptExternalIdExternalSurveillanceTool));
    }
    addValueChangeListener((e) -> {
        ValidationUtils.initComponentErrorValidator(externalTokenField, getValue().getExternalToken(), Validations.duplicateExternalToken, externalTokenWarningLabel, (externalToken) -> FacadeProvider.getEventFacade().doesExternalTokenExist(externalToken, getValue().getUuid()));
        epidemiologicalEvidenceCheckBoxTree.initCheckboxes();
        laboratoryDiagnosticEvidenceCheckBoxTree.initCheckboxes();
        // Initialize specific risk field if disease is null
        if (getValue().getDisease() == null) {
            List<SpecificRisk> specificRiskValues = FacadeProvider.getCustomizableEnumFacade().getEnumValues(CustomizableEnumType.SPECIFIC_EVENT_RISK, null);
            FieldHelper.updateItems(specificRiskField, specificRiskValues);
            specificRiskField.setVisible(isVisibleAllowed(EventDto.SPECIFIC_RISK) && CollectionUtils.isNotEmpty(specificRiskValues));
        }
    });
}
Also used : AbstractEditForm(de.symeda.sormas.ui.utils.AbstractEditForm) CheckBoxTree(de.symeda.sormas.ui.utils.CheckBoxTree) H3(de.symeda.sormas.ui.utils.CssStyles.H3) Arrays(java.util.Arrays) DiseaseTransmissionMode(de.symeda.sormas.api.event.DiseaseTransmissionMode) ValidationUtils(de.symeda.sormas.ui.utils.ValidationUtils) CheckBox(com.vaadin.v7.ui.CheckBox) I18nProperties(de.symeda.sormas.api.i18n.I18nProperties) LayoutUtil.locs(de.symeda.sormas.ui.utils.LayoutUtil.locs) StringUtils(org.apache.commons.lang3.StringUtils) SpecificRisk(de.symeda.sormas.api.event.SpecificRisk) YesNoUnknown(de.symeda.sormas.api.utils.YesNoUnknown) EpidemiologicalEvidenceDetail(de.symeda.sormas.api.event.EpidemiologicalEvidenceDetail) HumanTransmissionMode(de.symeda.sormas.api.event.HumanTransmissionMode) CssStyles(de.symeda.sormas.ui.utils.CssStyles) EventInvestigationStatus(de.symeda.sormas.api.event.EventInvestigationStatus) VSPACE_3(de.symeda.sormas.ui.utils.CssStyles.VSPACE_3) UserRole(de.symeda.sormas.api.user.UserRole) LayoutUtil.fluidRow(de.symeda.sormas.ui.utils.LayoutUtil.fluidRow) ComboBox(com.vaadin.v7.ui.ComboBox) LaboratoryDiagnosticEvidenceDetail(de.symeda.sormas.api.event.LaboratoryDiagnosticEvidenceDetail) Field(com.vaadin.v7.ui.Field) EventDto(de.symeda.sormas.api.event.EventDto) FieldHelper(de.symeda.sormas.ui.utils.FieldHelper) Collectors(java.util.stream.Collectors) TypeOfPlace(de.symeda.sormas.api.event.TypeOfPlace) List(java.util.List) LayoutUtil.fluidColumnLoc(de.symeda.sormas.ui.utils.LayoutUtil.fluidColumnLoc) InstitutionalPartnerType(de.symeda.sormas.api.event.InstitutionalPartnerType) TextField(com.vaadin.v7.ui.TextField) MeansOfTransport(de.symeda.sormas.api.event.MeansOfTransport) Descriptions(de.symeda.sormas.api.i18n.Descriptions) UiFieldAccessCheckers(de.symeda.sormas.api.utils.fieldaccess.UiFieldAccessCheckers) RegionReferenceDto(de.symeda.sormas.api.infrastructure.region.RegionReferenceDto) DateComparisonValidator(de.symeda.sormas.ui.utils.DateComparisonValidator) LABEL_WHITE_SPACE_NORMAL(de.symeda.sormas.ui.utils.CssStyles.LABEL_WHITE_SPACE_NORMAL) FacadeProvider(de.symeda.sormas.api.FacadeProvider) VerticalLayout(com.vaadin.ui.VerticalLayout) Converter(com.vaadin.v7.data.util.converter.Converter) EventStatus(de.symeda.sormas.api.event.EventStatus) ArrayList(java.util.ArrayList) CustomizableEnumType(de.symeda.sormas.api.customizableenum.CustomizableEnumType) LayoutUtil.loc(de.symeda.sormas.ui.utils.LayoutUtil.loc) CollectionUtils(org.apache.commons.collections.CollectionUtils) Label(com.vaadin.ui.Label) NullableOptionGroup(de.symeda.sormas.ui.utils.NullableOptionGroup) LayoutUtil.fluidRowLocs(de.symeda.sormas.ui.utils.LayoutUtil.fluidRowLocs) DateField(com.vaadin.v7.ui.DateField) LocationDto(de.symeda.sormas.api.location.LocationDto) Validations(de.symeda.sormas.api.i18n.Validations) DistrictReferenceDto(de.symeda.sormas.api.infrastructure.district.DistrictReferenceDto) ResizableTextAreaWrapper(de.symeda.sormas.ui.utils.ResizableTextAreaWrapper) Captions(de.symeda.sormas.api.i18n.Captions) DiseaseVariant(de.symeda.sormas.api.disease.DiseaseVariant) ParenteralTransmissionMode(de.symeda.sormas.api.event.ParenteralTransmissionMode) FieldGroup(com.vaadin.v7.data.fieldgroup.FieldGroup) UserReferenceDto(de.symeda.sormas.api.user.UserReferenceDto) Disease(de.symeda.sormas.api.Disease) LocationEditForm(de.symeda.sormas.ui.location.LocationEditForm) TextArea(com.vaadin.v7.ui.TextArea) EventSourceType(de.symeda.sormas.api.event.EventSourceType) FacilityTypeGroup(de.symeda.sormas.api.infrastructure.facility.FacilityTypeGroup) LayoutUtil.fluidColumn(de.symeda.sormas.ui.utils.LayoutUtil.fluidColumn) DateTimeField(de.symeda.sormas.ui.utils.DateTimeField) FieldVisibilityCheckers(de.symeda.sormas.api.utils.fieldvisibility.FieldVisibilityCheckers) Strings(de.symeda.sormas.api.i18n.Strings) Collections(java.util.Collections) Disease(de.symeda.sormas.api.Disease) TextArea(com.vaadin.v7.ui.TextArea) Label(com.vaadin.ui.Label) EventStatus(de.symeda.sormas.api.event.EventStatus) ArrayList(java.util.ArrayList) DateTimeField(de.symeda.sormas.ui.utils.DateTimeField) TextField(com.vaadin.v7.ui.TextField) List(java.util.List) ArrayList(java.util.ArrayList) LocationEditForm(de.symeda.sormas.ui.location.LocationEditForm) NullableOptionGroup(de.symeda.sormas.ui.utils.NullableOptionGroup) DiseaseVariant(de.symeda.sormas.api.disease.DiseaseVariant) ComboBox(com.vaadin.v7.ui.ComboBox) DistrictReferenceDto(de.symeda.sormas.api.infrastructure.district.DistrictReferenceDto) DateComparisonValidator(de.symeda.sormas.ui.utils.DateComparisonValidator) UserReferenceDto(de.symeda.sormas.api.user.UserReferenceDto) RegionReferenceDto(de.symeda.sormas.api.infrastructure.region.RegionReferenceDto) SpecificRisk(de.symeda.sormas.api.event.SpecificRisk) CheckBox(com.vaadin.v7.ui.CheckBox) DateField(com.vaadin.v7.ui.DateField)

Aggregations

EventStatus (de.symeda.sormas.api.event.EventStatus)5 Label (com.vaadin.ui.Label)2 VerticalLayout (com.vaadin.ui.VerticalLayout)2 ComboBox (com.vaadin.v7.ui.ComboBox)2 Disease (de.symeda.sormas.api.Disease)2 FacadeProvider (de.symeda.sormas.api.FacadeProvider)2 EventDto (de.symeda.sormas.api.event.EventDto)2 Captions (de.symeda.sormas.api.i18n.Captions)2 I18nProperties (de.symeda.sormas.api.i18n.I18nProperties)2 ArrayList (java.util.ArrayList)2 Collections (java.util.Collections)2 List (java.util.List)2 Collectors (java.util.stream.Collectors)2 StringUtils (org.apache.commons.lang3.StringUtils)2 View (android.view.View)1 VaadinIcons (com.vaadin.icons.VaadinIcons)1 ViewChangeEvent (com.vaadin.navigator.ViewChangeListener.ViewChangeEvent)1 Page (com.vaadin.server.Page)1 StreamResource (com.vaadin.server.StreamResource)1 ContentMode (com.vaadin.shared.ui.ContentMode)1