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;
}
}
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());
}
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;
}
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;
}
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);
}
Aggregations