Search in sources :

Example 1 with VaccinationListCriteria

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());
}
Also used : ImmunizationManagementStatus(de.symeda.sormas.api.immunization.ImmunizationManagementStatus) ImmunizationEntityHelper(de.symeda.sormas.backend.immunization.ImmunizationEntityHelper) DtoHelper(de.symeda.sormas.backend.util.DtoHelper) Date(java.util.Date) I18nProperties(de.symeda.sormas.api.i18n.I18nProperties) HealthConditionsMapper(de.symeda.sormas.backend.clinicalcourse.HealthConditionsMapper) Immunization(de.symeda.sormas.backend.immunization.entity.Immunization) MeansOfImmunization(de.symeda.sormas.api.immunization.MeansOfImmunization) Valid(javax.validation.Valid) VaccinationFacade(de.symeda.sormas.api.vaccination.VaccinationFacade) UserFacadeEjb(de.symeda.sormas.backend.user.UserFacadeEjb) Map(java.util.Map) EventParticipantReferenceDto(de.symeda.sormas.api.event.EventParticipantReferenceDto) ImmunizationFacadeEjbLocal(de.symeda.sormas.backend.immunization.ImmunizationFacadeEjb.ImmunizationFacadeEjbLocal) VaccinationStatus(de.symeda.sormas.api.caze.VaccinationStatus) Contact(de.symeda.sormas.backend.contact.Contact) Stateless(javax.ejb.Stateless) CaseService(de.symeda.sormas.backend.caze.CaseService) NotNull(javax.validation.constraints.NotNull) Pseudonymizer(de.symeda.sormas.backend.util.Pseudonymizer) Collectors(java.util.stream.Collectors) ImmunizationFacadeEjb(de.symeda.sormas.backend.immunization.ImmunizationFacadeEjb) List(java.util.List) UserService(de.symeda.sormas.backend.user.UserService) User(de.symeda.sormas.backend.user.User) Optional(java.util.Optional) ImmunizationDto(de.symeda.sormas.api.immunization.ImmunizationDto) RegionReferenceDto(de.symeda.sormas.api.infrastructure.region.RegionReferenceDto) ValidationRuntimeException(de.symeda.sormas.api.utils.ValidationRuntimeException) EventParticipant(de.symeda.sormas.backend.event.EventParticipant) ClinicalCourseFacadeEjb(de.symeda.sormas.backend.clinicalcourse.ClinicalCourseFacadeEjb) PersonReferenceDto(de.symeda.sormas.api.person.PersonReferenceDto) DateHelper(de.symeda.sormas.api.utils.DateHelper) VaccinationListEntryDto(de.symeda.sormas.api.vaccination.VaccinationListEntryDto) EventParticipantService(de.symeda.sormas.backend.event.EventParticipantService) ArrayList(java.util.ArrayList) CaseReferenceDto(de.symeda.sormas.api.caze.CaseReferenceDto) Case(de.symeda.sormas.backend.caze.Case) LocalBean(javax.ejb.LocalBean) EJB(javax.ejb.EJB) Validations(de.symeda.sormas.api.i18n.Validations) DataHelper(de.symeda.sormas.api.utils.DataHelper) DistrictReferenceDto(de.symeda.sormas.api.infrastructure.district.DistrictReferenceDto) VaccinationListCriteria(de.symeda.sormas.api.vaccination.VaccinationListCriteria) ImmunizationService(de.symeda.sormas.backend.immunization.ImmunizationService) SortProperty(de.symeda.sormas.api.utils.SortProperty) Event(de.symeda.sormas.backend.event.Event) UserRight(de.symeda.sormas.api.user.UserRight) Disease(de.symeda.sormas.api.Disease) ContactService(de.symeda.sormas.backend.contact.ContactService) VaccinationDto(de.symeda.sormas.api.vaccination.VaccinationDto) ImmunizationStatus(de.symeda.sormas.api.immunization.ImmunizationStatus) ContactReferenceDto(de.symeda.sormas.api.contact.ContactReferenceDto) Comparator(java.util.Comparator) Strings(de.symeda.sormas.api.i18n.Strings) Case(de.symeda.sormas.backend.caze.Case)

Example 2 with VaccinationListCriteria

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());
}
Also used : ImmunizationManagementStatus(de.symeda.sormas.api.immunization.ImmunizationManagementStatus) ImmunizationEntityHelper(de.symeda.sormas.backend.immunization.ImmunizationEntityHelper) DtoHelper(de.symeda.sormas.backend.util.DtoHelper) Date(java.util.Date) I18nProperties(de.symeda.sormas.api.i18n.I18nProperties) HealthConditionsMapper(de.symeda.sormas.backend.clinicalcourse.HealthConditionsMapper) Immunization(de.symeda.sormas.backend.immunization.entity.Immunization) MeansOfImmunization(de.symeda.sormas.api.immunization.MeansOfImmunization) Valid(javax.validation.Valid) VaccinationFacade(de.symeda.sormas.api.vaccination.VaccinationFacade) UserFacadeEjb(de.symeda.sormas.backend.user.UserFacadeEjb) Map(java.util.Map) EventParticipantReferenceDto(de.symeda.sormas.api.event.EventParticipantReferenceDto) ImmunizationFacadeEjbLocal(de.symeda.sormas.backend.immunization.ImmunizationFacadeEjb.ImmunizationFacadeEjbLocal) VaccinationStatus(de.symeda.sormas.api.caze.VaccinationStatus) Contact(de.symeda.sormas.backend.contact.Contact) Stateless(javax.ejb.Stateless) CaseService(de.symeda.sormas.backend.caze.CaseService) NotNull(javax.validation.constraints.NotNull) Pseudonymizer(de.symeda.sormas.backend.util.Pseudonymizer) Collectors(java.util.stream.Collectors) ImmunizationFacadeEjb(de.symeda.sormas.backend.immunization.ImmunizationFacadeEjb) List(java.util.List) UserService(de.symeda.sormas.backend.user.UserService) User(de.symeda.sormas.backend.user.User) Optional(java.util.Optional) ImmunizationDto(de.symeda.sormas.api.immunization.ImmunizationDto) RegionReferenceDto(de.symeda.sormas.api.infrastructure.region.RegionReferenceDto) ValidationRuntimeException(de.symeda.sormas.api.utils.ValidationRuntimeException) EventParticipant(de.symeda.sormas.backend.event.EventParticipant) ClinicalCourseFacadeEjb(de.symeda.sormas.backend.clinicalcourse.ClinicalCourseFacadeEjb) PersonReferenceDto(de.symeda.sormas.api.person.PersonReferenceDto) DateHelper(de.symeda.sormas.api.utils.DateHelper) VaccinationListEntryDto(de.symeda.sormas.api.vaccination.VaccinationListEntryDto) EventParticipantService(de.symeda.sormas.backend.event.EventParticipantService) ArrayList(java.util.ArrayList) CaseReferenceDto(de.symeda.sormas.api.caze.CaseReferenceDto) Case(de.symeda.sormas.backend.caze.Case) LocalBean(javax.ejb.LocalBean) EJB(javax.ejb.EJB) Validations(de.symeda.sormas.api.i18n.Validations) DataHelper(de.symeda.sormas.api.utils.DataHelper) DistrictReferenceDto(de.symeda.sormas.api.infrastructure.district.DistrictReferenceDto) VaccinationListCriteria(de.symeda.sormas.api.vaccination.VaccinationListCriteria) ImmunizationService(de.symeda.sormas.backend.immunization.ImmunizationService) SortProperty(de.symeda.sormas.api.utils.SortProperty) Event(de.symeda.sormas.backend.event.Event) UserRight(de.symeda.sormas.api.user.UserRight) Disease(de.symeda.sormas.api.Disease) ContactService(de.symeda.sormas.backend.contact.ContactService) VaccinationDto(de.symeda.sormas.api.vaccination.VaccinationDto) ImmunizationStatus(de.symeda.sormas.api.immunization.ImmunizationStatus) ContactReferenceDto(de.symeda.sormas.api.contact.ContactReferenceDto) Comparator(java.util.Comparator) Strings(de.symeda.sormas.api.i18n.Strings) Contact(de.symeda.sormas.backend.contact.Contact)

Example 3 with VaccinationListCriteria

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);
}
Also used : SampleCriteria(de.symeda.sormas.api.sample.SampleCriteria) VaccinationListCriteria(de.symeda.sormas.api.vaccination.VaccinationListCriteria)

Example 4 with VaccinationListCriteria

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);
        }
    }
}
Also used : DetailSubComponentWrapper(de.symeda.sormas.ui.utils.DetailSubComponentWrapper) EventParticipantListComponent(de.symeda.sormas.ui.events.eventParticipantLink.EventParticipantListComponent) VaccinationListComponent(de.symeda.sormas.ui.vaccination.list.VaccinationListComponent) TravelEntryListCriteria(de.symeda.sormas.api.travelentry.TravelEntryListCriteria) SideComponentLayout(de.symeda.sormas.ui.utils.components.sidecomponent.SideComponentLayout) VaccinationListCriteria(de.symeda.sormas.api.vaccination.VaccinationListCriteria) UserProvider(de.symeda.sormas.ui.UserProvider) CustomLayout(com.vaadin.ui.CustomLayout) ContactListComponent(de.symeda.sormas.ui.contact.contactlink.ContactListComponent) ImmunizationListCriteria(de.symeda.sormas.api.immunization.ImmunizationListCriteria) CaseListComponent(de.symeda.sormas.ui.caze.caselink.CaseListComponent) TravelEntryListComponent(de.symeda.sormas.ui.travelentry.travelentrylink.TravelEntryListComponent) ImmunizationListComponent(de.symeda.sormas.ui.immunization.immunizationlink.ImmunizationListComponent)

Example 5 with VaccinationListCriteria

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());
}
Also used : ImmunizationManagementStatus(de.symeda.sormas.api.immunization.ImmunizationManagementStatus) ImmunizationEntityHelper(de.symeda.sormas.backend.immunization.ImmunizationEntityHelper) DtoHelper(de.symeda.sormas.backend.util.DtoHelper) Date(java.util.Date) I18nProperties(de.symeda.sormas.api.i18n.I18nProperties) HealthConditionsMapper(de.symeda.sormas.backend.clinicalcourse.HealthConditionsMapper) Immunization(de.symeda.sormas.backend.immunization.entity.Immunization) MeansOfImmunization(de.symeda.sormas.api.immunization.MeansOfImmunization) Valid(javax.validation.Valid) VaccinationFacade(de.symeda.sormas.api.vaccination.VaccinationFacade) UserFacadeEjb(de.symeda.sormas.backend.user.UserFacadeEjb) Map(java.util.Map) EventParticipantReferenceDto(de.symeda.sormas.api.event.EventParticipantReferenceDto) ImmunizationFacadeEjbLocal(de.symeda.sormas.backend.immunization.ImmunizationFacadeEjb.ImmunizationFacadeEjbLocal) VaccinationStatus(de.symeda.sormas.api.caze.VaccinationStatus) Contact(de.symeda.sormas.backend.contact.Contact) Stateless(javax.ejb.Stateless) CaseService(de.symeda.sormas.backend.caze.CaseService) NotNull(javax.validation.constraints.NotNull) Pseudonymizer(de.symeda.sormas.backend.util.Pseudonymizer) Collectors(java.util.stream.Collectors) ImmunizationFacadeEjb(de.symeda.sormas.backend.immunization.ImmunizationFacadeEjb) List(java.util.List) UserService(de.symeda.sormas.backend.user.UserService) User(de.symeda.sormas.backend.user.User) Optional(java.util.Optional) ImmunizationDto(de.symeda.sormas.api.immunization.ImmunizationDto) RegionReferenceDto(de.symeda.sormas.api.infrastructure.region.RegionReferenceDto) ValidationRuntimeException(de.symeda.sormas.api.utils.ValidationRuntimeException) EventParticipant(de.symeda.sormas.backend.event.EventParticipant) ClinicalCourseFacadeEjb(de.symeda.sormas.backend.clinicalcourse.ClinicalCourseFacadeEjb) PersonReferenceDto(de.symeda.sormas.api.person.PersonReferenceDto) DateHelper(de.symeda.sormas.api.utils.DateHelper) VaccinationListEntryDto(de.symeda.sormas.api.vaccination.VaccinationListEntryDto) EventParticipantService(de.symeda.sormas.backend.event.EventParticipantService) ArrayList(java.util.ArrayList) CaseReferenceDto(de.symeda.sormas.api.caze.CaseReferenceDto) Case(de.symeda.sormas.backend.caze.Case) LocalBean(javax.ejb.LocalBean) EJB(javax.ejb.EJB) Validations(de.symeda.sormas.api.i18n.Validations) DataHelper(de.symeda.sormas.api.utils.DataHelper) DistrictReferenceDto(de.symeda.sormas.api.infrastructure.district.DistrictReferenceDto) VaccinationListCriteria(de.symeda.sormas.api.vaccination.VaccinationListCriteria) ImmunizationService(de.symeda.sormas.backend.immunization.ImmunizationService) SortProperty(de.symeda.sormas.api.utils.SortProperty) Event(de.symeda.sormas.backend.event.Event) UserRight(de.symeda.sormas.api.user.UserRight) Disease(de.symeda.sormas.api.Disease) ContactService(de.symeda.sormas.backend.contact.ContactService) VaccinationDto(de.symeda.sormas.api.vaccination.VaccinationDto) ImmunizationStatus(de.symeda.sormas.api.immunization.ImmunizationStatus) ContactReferenceDto(de.symeda.sormas.api.contact.ContactReferenceDto) Comparator(java.util.Comparator) Strings(de.symeda.sormas.api.i18n.Strings) EventParticipant(de.symeda.sormas.backend.event.EventParticipant)

Aggregations

VaccinationListCriteria (de.symeda.sormas.api.vaccination.VaccinationListCriteria)9 Disease (de.symeda.sormas.api.Disease)4 EventParticipantReferenceDto (de.symeda.sormas.api.event.EventParticipantReferenceDto)4 SampleCriteria (de.symeda.sormas.api.sample.SampleCriteria)4 CustomLayout (com.vaadin.ui.CustomLayout)3 VerticalLayout (com.vaadin.ui.VerticalLayout)3 CaseReferenceDto (de.symeda.sormas.api.caze.CaseReferenceDto)3 VaccinationStatus (de.symeda.sormas.api.caze.VaccinationStatus)3 ContactReferenceDto (de.symeda.sormas.api.contact.ContactReferenceDto)3 I18nProperties (de.symeda.sormas.api.i18n.I18nProperties)3 Strings (de.symeda.sormas.api.i18n.Strings)3 Validations (de.symeda.sormas.api.i18n.Validations)3 ImmunizationDto (de.symeda.sormas.api.immunization.ImmunizationDto)3 ImmunizationListCriteria (de.symeda.sormas.api.immunization.ImmunizationListCriteria)3 ImmunizationManagementStatus (de.symeda.sormas.api.immunization.ImmunizationManagementStatus)3 ImmunizationStatus (de.symeda.sormas.api.immunization.ImmunizationStatus)3 MeansOfImmunization (de.symeda.sormas.api.immunization.MeansOfImmunization)3 DistrictReferenceDto (de.symeda.sormas.api.infrastructure.district.DistrictReferenceDto)3 RegionReferenceDto (de.symeda.sormas.api.infrastructure.region.RegionReferenceDto)3 PersonReferenceDto (de.symeda.sormas.api.person.PersonReferenceDto)3