Search in sources :

Example 6 with FacilityDto

use of de.symeda.sormas.api.infrastructure.facility.FacilityDto in project SORMAS-Project by hzi-braunschweig.

the class DashboardMapComponent method onMarkerClicked.

private void onMarkerClicked(String groupId, int markerIndex) {
    switch(groupId) {
        case CASES_GROUP_ID:
            if (markerIndex < markerCaseFacilities.size()) {
                FacilityReferenceDto facility = markerCaseFacilities.get(markerIndex);
                VerticalLayout layout = new VerticalLayout();
                Window window = VaadinUiUtil.showPopupWindow(layout);
                CasePopupGrid caseGrid = new CasePopupGrid(window, facility, DashboardMapComponent.this);
                caseGrid.setHeightMode(HeightMode.ROW);
                layout.addComponent(caseGrid);
                layout.setMargin(true);
                FacilityDto facilityDto = FacadeProvider.getFacilityFacade().getByUuid(facility.getUuid());
                window.setCaption(I18nProperties.getCaption(Captions.dashboardCasesIn) + " " + facilityDto.toString());
            } else {
                markerIndex -= markerCaseFacilities.size();
                MapCaseDto caze = mapCaseDtos.get(markerIndex);
                ControllerProvider.getCaseController().navigateToCase(caze.getUuid(), true);
            }
            break;
        case CONTACTS_GROUP_ID:
            MapContactDto contact = markerContacts.get(markerIndex);
            ControllerProvider.getContactController().navigateToData(contact.getUuid(), true);
            break;
        case EVENTS_GROUP_ID:
            DashboardEventDto event = markerEvents.get(markerIndex);
            ControllerProvider.getEventController().navigateToData(event.getUuid(), true);
            break;
    }
}
Also used : Window(com.vaadin.ui.Window) MapCaseDto(de.symeda.sormas.api.caze.MapCaseDto) FacilityReferenceDto(de.symeda.sormas.api.infrastructure.facility.FacilityReferenceDto) MapContactDto(de.symeda.sormas.api.contact.MapContactDto) VerticalLayout(com.vaadin.ui.VerticalLayout) DashboardEventDto(de.symeda.sormas.api.dashboard.DashboardEventDto) FacilityDto(de.symeda.sormas.api.infrastructure.facility.FacilityDto)

Example 7 with FacilityDto

use of de.symeda.sormas.api.infrastructure.facility.FacilityDto in project SORMAS-Project by hzi-braunschweig.

the class FacilityFacadeEjbTest method testGetAllActiveLaboratories.

@Test
public void testGetAllActiveLaboratories() {
    RDCF rdcf = creator.createRDCF("r", "d", "c", "f");
    FacilityDto f1 = getFacilityFacade().getByUuid(rdcf.facility.getUuid());
    getFacilityFacade().archive(f1.getUuid());
    f1 = getFacilityFacade().getByUuid(f1.getUuid());
    f1.setType(FacilityType.LABORATORY);
    getFacilityFacade().save(f1);
    FacilityDto f2 = creator.createFacility("f2", rdcf.region, rdcf.district, rdcf.community);
    f2 = getFacilityFacade().getByUuid(f2.getUuid());
    f2.setType(FacilityType.LABORATORY);
    getFacilityFacade().save(f2);
    assertEquals(1, getFacilityFacade().getAllActiveLaboratories(false).size());
}
Also used : RDCF(de.symeda.sormas.backend.TestDataCreator.RDCF) FacilityDto(de.symeda.sormas.api.infrastructure.facility.FacilityDto) Test(org.junit.Test) AbstractBeanTest(de.symeda.sormas.backend.AbstractBeanTest)

Example 8 with FacilityDto

use of de.symeda.sormas.api.infrastructure.facility.FacilityDto in project SORMAS-Project by hzi-braunschweig.

the class TestDataCreator method createFacility.

public FacilityDto createFacility(String facilityName, FacilityType facilityType, RegionReferenceDto region, DistrictReferenceDto district, CommunityReferenceDto community) {
    FacilityDto facility = FacilityDto.build();
    facility.setUuid(DataHelper.createUuid());
    facility.setName(facilityName);
    facility.setType(facilityType);
    facility.setCommunity(community);
    facility.setDistrict(district);
    facility.setRegion(region);
    FacadeProvider.getFacilityFacade().save(facility);
    return facility;
}
Also used : FacilityDto(de.symeda.sormas.api.infrastructure.facility.FacilityDto)

Example 9 with FacilityDto

use of de.symeda.sormas.api.infrastructure.facility.FacilityDto in project SORMAS-Project by hzi-braunschweig.

the class TestDataCreator method createFacility.

public FacilityDto createFacility(String facilityName, RegionReferenceDto region, DistrictReferenceDto district, CommunityReferenceDto community, FacilityType type) {
    FacilityDto facility = FacilityDto.build();
    facility.setName(facilityName);
    facility.setType(type == null ? FacilityType.HOSPITAL : type);
    facility.setCommunity(community);
    facility.setDistrict(district);
    facility.setRegion(region);
    beanTest.getFacilityFacade().save(facility);
    return facility;
}
Also used : FacilityDto(de.symeda.sormas.api.infrastructure.facility.FacilityDto)

Example 10 with FacilityDto

use of de.symeda.sormas.api.infrastructure.facility.FacilityDto in project SORMAS-Project by hzi-braunschweig.

the class InfrastructureController method editFacility.

public void editFacility(String uuid) {
    FacilityDto facility = FacadeProvider.getFacilityFacade().getByUuid(uuid);
    CommitDiscardWrapperComponent<FacilityEditForm> editComponent = getFacilityEditComponent(facility);
    String caption = I18nProperties.getString(Strings.edit) + " " + facility.getName();
    VaadinUiUtil.showModalPopupWindow(editComponent, caption);
}
Also used : FacilityDto(de.symeda.sormas.api.infrastructure.facility.FacilityDto)

Aggregations

FacilityDto (de.symeda.sormas.api.infrastructure.facility.FacilityDto)19 Date (java.util.Date)6 List (java.util.List)5 Test (org.junit.Test)5 FacilityReferenceDto (de.symeda.sormas.api.infrastructure.facility.FacilityReferenceDto)3 ContentMode (com.vaadin.shared.ui.ContentMode)2 Alignment (com.vaadin.ui.Alignment)2 Button (com.vaadin.ui.Button)2 Component (com.vaadin.ui.Component)2 HorizontalLayout (com.vaadin.ui.HorizontalLayout)2 Label (com.vaadin.ui.Label)2 VerticalLayout (com.vaadin.ui.VerticalLayout)2 Window (com.vaadin.ui.Window)2 ValoTheme (com.vaadin.ui.themes.ValoTheme)2 CaseDataDto (de.symeda.sormas.api.caze.CaseDataDto)2 EventDto (de.symeda.sormas.api.event.EventDto)2 EventParticipantDto (de.symeda.sormas.api.event.EventParticipantDto)2 CommunityDto (de.symeda.sormas.api.infrastructure.community.CommunityDto)2 CommunityReferenceDto (de.symeda.sormas.api.infrastructure.community.CommunityReferenceDto)2 DistrictReferenceDto (de.symeda.sormas.api.infrastructure.district.DistrictReferenceDto)2