use of de.symeda.sormas.api.vaccination.VaccinationListCriteria in project SORMAS-Project by hzi-braunschweig.
the class VaccinationFacadeEjb method getEntriesListWithRelevance.
@Override
public List<VaccinationListEntryDto> getEntriesListWithRelevance(CaseReferenceDto caseReferenceDto, VaccinationListCriteria criteria, Integer first, Integer max) {
List<Vaccination> vaccinationsList = vaccinationService.getVaccinationsByCriteria(criteria, first, max, null);
Case caze = caseService.getByReferenceDto(caseReferenceDto);
return vaccinationsList.stream().map(v -> toVaccinationListEntryDto(v, vaccinationService.isVaccinationRelevant(caze, v), I18nProperties.getString(v.getVaccinationDate() != null ? Strings.messageVaccinationNotRelevantForCase : Strings.messageVaccinationNoDateNotRelevantForCase))).collect(Collectors.toList());
}
use of de.symeda.sormas.api.vaccination.VaccinationListCriteria in project SORMAS-Project by hzi-braunschweig.
the class VaccinationFacadeEjb method getEntriesListWithRelevance.
@Override
public List<VaccinationListEntryDto> getEntriesListWithRelevance(ContactReferenceDto contactReferenceDto, VaccinationListCriteria criteria, Integer first, Integer max) {
List<Vaccination> vaccinationsList = vaccinationService.getVaccinationsByCriteria(criteria, first, max, null);
Contact contact = contactService.getByReferenceDto(contactReferenceDto);
return vaccinationsList.stream().map(v -> toVaccinationListEntryDto(v, vaccinationService.isVaccinationRelevant(contact, v), I18nProperties.getString(v.getVaccinationDate() != null ? Strings.messageVaccinationNotRelevantForContact : Strings.messageVaccinationNoDateNotRelevantForContact))).collect(Collectors.toList());
}
use of de.symeda.sormas.api.vaccination.VaccinationListCriteria in project SORMAS-Project by hzi-braunschweig.
the class QuarantineOrderDocumentsComponent method addComponentToLayout.
public static void addComponentToLayout(CustomLayout targetLayout, CaseDataDto caze, DocumentListComponent documentList) {
SampleCriteria sampleCriteria = new SampleCriteria().caze(caze.toReference());
VaccinationListCriteria vaccinationCriteria = new VaccinationListCriteria.Builder(caze.getPerson()).withDisease(caze.getDisease()).build();
addComponentToLayout(targetLayout, caze.toReference(), DocumentWorkflow.QUARANTINE_ORDER_CASE, sampleCriteria, vaccinationCriteria, documentList);
}
use of de.symeda.sormas.api.vaccination.VaccinationListCriteria in project SORMAS-Project by hzi-braunschweig.
the class PersonDataView method initView.
@Override
protected void initView(String params) {
setHeightUndefined();
String htmlLayout = LayoutUtil.fluidRow(LayoutUtil.fluidColumnLoc(8, 0, 12, 0, PERSON_LOC), LayoutUtil.fluidColumnLoc(4, 0, 6, 0, CASES_LOC), LayoutUtil.fluidColumnLoc(4, 0, 6, 0, CONTACTS_LOC), LayoutUtil.fluidColumnLoc(4, 0, 6, 0, EVENT_PARTICIPANTS_LOC), LayoutUtil.fluidColumnLoc(4, 0, 6, 0, TRAVEL_ENTRIES_LOC), LayoutUtil.fluidColumnLoc(4, 0, 6, 0, IMMUNIZATION_LOC), LayoutUtil.fluidColumnLoc(4, 0, 6, 0, VACCINATIONS_LOC));
DetailSubComponentWrapper container = new DetailSubComponentWrapper(() -> editComponent);
container.setWidth(100, Unit.PERCENTAGE);
container.setMargin(true);
setSubComponent(container);
CustomLayout layout = new CustomLayout();
layout.addStyleName(CssStyles.ROOT_COMPONENT);
layout.setTemplateContents(htmlLayout);
layout.setWidth(100, Unit.PERCENTAGE);
layout.setHeightUndefined();
container.addComponent(layout);
editComponent = ControllerProvider.getPersonController().getPersonEditComponent(getReference().getUuid(), UserRight.PERSON_EDIT);
editComponent.setMargin(false);
editComponent.setWidth(100, Unit.PERCENTAGE);
editComponent.getWrappedComponent().setWidth(100, Unit.PERCENTAGE);
editComponent.addStyleName(CssStyles.MAIN_COMPONENT);
layout.addComponent(editComponent, PERSON_LOC);
if (FacadeProvider.getPersonFacade().isSharedWithoutOwnership(getReference().getUuid())) {
editComponent.setEnabled(false);
}
if (FacadeProvider.getFeatureConfigurationFacade().isFeatureEnabled(FeatureType.CASE_SURVEILANCE)) {
layout.addComponent(new SideComponentLayout(new CaseListComponent(getReference())), CASES_LOC);
}
if (FacadeProvider.getFeatureConfigurationFacade().isFeatureEnabled(FeatureType.CONTACT_TRACING)) {
layout.addComponent(new SideComponentLayout(new ContactListComponent(getReference())), CONTACTS_LOC);
}
if (FacadeProvider.getFeatureConfigurationFacade().isFeatureEnabled(FeatureType.EVENT_SURVEILLANCE)) {
layout.addComponent(new SideComponentLayout(new EventParticipantListComponent(getReference())), EVENT_PARTICIPANTS_LOC);
}
UserProvider currentUser = UserProvider.getCurrent();
if (FacadeProvider.getConfigFacade().isConfiguredCountry(CountryHelper.COUNTRY_CODE_GERMANY) && FacadeProvider.getFeatureConfigurationFacade().isFeatureEnabled(FeatureType.TRAVEL_ENTRIES) && currentUser != null && currentUser.hasUserRight(UserRight.TRAVEL_ENTRY_VIEW)) {
TravelEntryListCriteria travelEntryListCriteria = new TravelEntryListCriteria.Builder().withPerson(getReference()).build();
layout.addComponent(new SideComponentLayout(new TravelEntryListComponent(travelEntryListCriteria)), TRAVEL_ENTRIES_LOC);
}
if (FacadeProvider.getFeatureConfigurationFacade().isFeatureEnabled(FeatureType.IMMUNIZATION_MANAGEMENT) && currentUser != null && currentUser.hasUserRight(UserRight.IMMUNIZATION_VIEW)) {
if (!FacadeProvider.getFeatureConfigurationFacade().isPropertyValueTrue(FeatureType.IMMUNIZATION_MANAGEMENT, FeatureTypeProperty.REDUCED)) {
final ImmunizationListCriteria immunizationListCriteria = new ImmunizationListCriteria.Builder(getReference()).build();
layout.addComponent(new SideComponentLayout(new ImmunizationListComponent(immunizationListCriteria)), IMMUNIZATION_LOC);
} else {
VaccinationListCriteria criteria = new VaccinationListCriteria.Builder(getReference()).build();
layout.addComponent(new SideComponentLayout(new VaccinationListComponent(criteria, this)), VACCINATIONS_LOC);
}
}
}
use of de.symeda.sormas.api.vaccination.VaccinationListCriteria in project SORMAS-Project by hzi-braunschweig.
the class VaccinationFacadeEjb method getEntriesListWithRelevance.
@Override
public List<VaccinationListEntryDto> getEntriesListWithRelevance(EventParticipantReferenceDto eventParticipantReferenceDto, VaccinationListCriteria criteria, Integer first, Integer max) {
List<Vaccination> vaccinationsList = vaccinationService.getVaccinationsByCriteria(criteria, first, max, null);
EventParticipant eventParticipant = eventParticipantService.getByReferenceDto(eventParticipantReferenceDto);
return vaccinationsList.stream().map(v -> toVaccinationListEntryDto(v, vaccinationService.isVaccinationRelevant(eventParticipant.getEvent(), v), I18nProperties.getString(v.getVaccinationDate() != null ? Strings.messageVaccinationNotRelevantForEventParticipant : Strings.messageVaccinationNoDateNotRelevantForEventParticipant))).collect(Collectors.toList());
}
Aggregations