Search in sources :

Example 1 with ExposureDto

use of de.symeda.sormas.api.exposure.ExposureDto in project SORMAS-Project by hzi-braunschweig.

the class ExposuresField method addGeneratedColumns.

private void addGeneratedColumns(Table table) {
    table.addGeneratedColumn(COLUMN_EXPOSURE_TYPE, (Table.ColumnGenerator) (source, itemId, columnId) -> {
        ExposureDto exposure = (ExposureDto) itemId;
        String exposureString = ExposureType.OTHER != exposure.getExposureType() ? exposure.getExposureType().toString() : exposure.getExposureTypeDetails();
        // if possible, always display "lowest-level" activity type (e.g. show type of gathering instead of just "gathering")
        if (exposure.getExposureType() == ExposureType.GATHERING && exposure.getGatheringType() != null) {
            exposureString += " - " + (exposure.getGatheringType() != GatheringType.OTHER ? exposure.getGatheringType().toString() : (StringUtils.isNotEmpty(exposure.getGatheringDetails()) ? exposure.getGatheringDetails() : GatheringType.OTHER.toString()));
        }
        if (exposure.getExposureType() == ExposureType.HABITATION && exposure.getHabitationType() != null) {
            exposureString += " - " + (exposure.getHabitationType() != HabitationType.OTHER ? exposure.getHabitationType().toString() : (StringUtils.isNotEmpty(exposure.getHabitationDetails()) ? exposure.getHabitationDetails() : HabitationType.OTHER.toString()));
        }
        if (exposure.getExposureType() == ExposureType.ANIMAL_CONTACT && exposure.getTypeOfAnimal() != null) {
            exposureString += " (" + (exposure.getTypeOfAnimal() != TypeOfAnimal.OTHER ? exposure.getTypeOfAnimal().toString() : (exposure.getTypeOfAnimalDetails() != null ? exposure.getTypeOfAnimalDetails() : TypeOfAnimal.OTHER.toString())) + ")";
        }
        if (exposure.getRiskArea() == YesNoUnknown.YES || exposure.isProbableInfectionEnvironment())
            exposureString = "<b>" + exposureString + "</b>";
        if (exposure.getRiskArea() == YesNoUnknown.YES) {
            exposureString = VaadinIcons.INFO_CIRCLE.getHtml() + " " + exposureString;
        }
        if (exposure.isProbableInfectionEnvironment()) {
            exposureString = VaadinIcons.CHECK_CIRCLE.getHtml() + " " + exposureString;
        }
        Label exposureTypeLabel = new Label(exposureString, ContentMode.HTML);
        if (exposure.getRiskArea() == YesNoUnknown.YES) {
            exposureTypeLabel.setDescription(I18nProperties.getString(Strings.infoExposuresRiskAreaHint) + " ");
        }
        if (exposure.isProbableInfectionEnvironment()) {
            exposureTypeLabel.setDescription(exposureTypeLabel.getDescription() + I18nProperties.getString(Strings.infoExposuresInfectionEnvironmentHint));
        }
        return exposureTypeLabel;
    });
    table.addGeneratedColumn(COLUMN_TYPE_OF_PLACE, (Table.ColumnGenerator) (source, itemId, columnId) -> {
        ExposureDto exposure = (ExposureDto) itemId;
        String typeOfPlaceString;
        if (exposure.getTypeOfPlace() == null) {
            return "";
        } else if (exposure.getTypeOfPlace() == TypeOfPlace.FACILITY && exposure.getLocation().getFacilityType() != null) {
            typeOfPlaceString = exposure.getLocation().getFacilityType().toString();
            if (StringUtils.isNotEmpty(exposure.getLocation().getFacilityDetails())) {
                typeOfPlaceString += " - " + exposure.getLocation().getFacilityDetails();
            } else if (exposure.getLocation().getFacility() != null) {
                typeOfPlaceString += " - " + exposure.getLocation().getFacility().toString();
            }
        } else if (exposure.getTypeOfPlace() == TypeOfPlace.MEANS_OF_TRANSPORT) {
            typeOfPlaceString = exposure.getMeansOfTransport() == null ? TypeOfPlace.MEANS_OF_TRANSPORT.toString() : (exposure.getMeansOfTransport() != MeansOfTransport.OTHER ? exposure.getMeansOfTransport().toString() : ((StringUtils.isNotEmpty(exposure.getMeansOfTransportDetails())) ? exposure.getMeansOfTransportDetails() : TypeOfPlace.MEANS_OF_TRANSPORT.toString()));
        } else {
            typeOfPlaceString = exposure.getTypeOfPlace() != TypeOfPlace.OTHER ? exposure.getTypeOfPlace().toString() : (StringUtils.isNotEmpty(exposure.getTypeOfPlaceDetails()) ? exposure.getTypeOfPlaceDetails() : TypeOfPlace.OTHER.toString());
        }
        return typeOfPlaceString;
    });
    table.addGeneratedColumn(COLUMN_DATE, (Table.ColumnGenerator) (source, itemId, columnId) -> {
        ExposureDto exposure = (ExposureDto) itemId;
        return DateFormatHelper.buildPeriodDateTimeString(exposure.getStartDate(), exposure.getEndDate());
    });
    table.addGeneratedColumn(COLUMN_ADDRESS, (Table.ColumnGenerator) (source, itemId, columnId) -> LocationHelper.buildLocationString(((ExposureDto) itemId).getLocation()));
    table.addGeneratedColumn(COLUMN_DESCRIPTION, (Table.ColumnGenerator) (source, itemId, columnId) -> {
        ExposureDto exposure = (ExposureDto) itemId;
        Label descriptionLabel = new Label(StringUtils.abbreviate(exposure.getDescription(), 75));
        if (StringUtils.isNotBlank(exposure.getDescription())) {
            descriptionLabel.setDescription(exposure.getDescription());
        }
        return descriptionLabel;
    });
    table.addGeneratedColumn(COLUMN_SOURCE_CASE_NAME, (Table.ColumnGenerator) (source, itemId, columnId) -> {
        ExposureDto exposure = (ExposureDto) itemId;
        return !isPseudonymized ? DataHelper.toStringNullable(exposure.getContactToCase() != null ? exposure.getContactToCase().getCaseName() : "") : I18nProperties.getCaption(Captions.inaccessibleValue);
    });
}
Also used : TypeOfAnimal(de.symeda.sormas.api.exposure.TypeOfAnimal) AbstractTableField(de.symeda.sormas.ui.caze.AbstractTableField) Table(com.vaadin.v7.ui.Table) VaadinUiUtil(de.symeda.sormas.ui.utils.VaadinUiUtil) I18nProperties(de.symeda.sormas.api.i18n.I18nProperties) DateFormatHelper(de.symeda.sormas.ui.utils.DateFormatHelper) VerticalLayout(com.vaadin.ui.VerticalLayout) ExposureType(de.symeda.sormas.api.exposure.ExposureType) Window(com.vaadin.ui.Window) HabitationType(de.symeda.sormas.api.exposure.HabitationType) Supplier(java.util.function.Supplier) StringUtils(org.apache.commons.lang3.StringUtils) EntityDto(de.symeda.sormas.api.EntityDto) YesNoUnknown(de.symeda.sormas.api.utils.YesNoUnknown) CssStyles(de.symeda.sormas.ui.utils.CssStyles) CommitDiscardWrapperComponent(de.symeda.sormas.ui.utils.CommitDiscardWrapperComponent) FieldAccessCellStyleGenerator(de.symeda.sormas.ui.utils.FieldAccessCellStyleGenerator) VaadinIcons(com.vaadin.icons.VaadinIcons) UserProvider(de.symeda.sormas.ui.UserProvider) Label(com.vaadin.v7.ui.Label) Property(com.vaadin.v7.data.Property) ConfirmationComponent(de.symeda.sormas.ui.utils.ConfirmationComponent) Validations(de.symeda.sormas.api.i18n.Validations) DataHelper(de.symeda.sormas.api.utils.DataHelper) GatheringType(de.symeda.sormas.api.exposure.GatheringType) UserDto(de.symeda.sormas.api.user.UserDto) CaseDataDto(de.symeda.sormas.api.caze.CaseDataDto) Sizeable(com.vaadin.server.Sizeable) Captions(de.symeda.sormas.api.i18n.Captions) TypeOfPlace(de.symeda.sormas.api.event.TypeOfPlace) Consumer(java.util.function.Consumer) ExposureDto(de.symeda.sormas.api.exposure.ExposureDto) UserRight(de.symeda.sormas.api.user.UserRight) List(java.util.List) Button(com.vaadin.ui.Button) ContentMode(com.vaadin.v7.shared.ui.label.ContentMode) ContactDto(de.symeda.sormas.api.contact.ContactDto) MeansOfTransport(de.symeda.sormas.api.event.MeansOfTransport) ContactReferenceDto(de.symeda.sormas.api.contact.ContactReferenceDto) FieldVisibilityCheckers(de.symeda.sormas.api.utils.fieldvisibility.FieldVisibilityCheckers) Strings(de.symeda.sormas.api.i18n.Strings) LocationHelper(de.symeda.sormas.api.utils.LocationHelper) UiFieldAccessCheckers(de.symeda.sormas.api.utils.fieldaccess.UiFieldAccessCheckers) Table(com.vaadin.v7.ui.Table) ExposureDto(de.symeda.sormas.api.exposure.ExposureDto) Label(com.vaadin.v7.ui.Label)

Example 2 with ExposureDto

use of de.symeda.sormas.api.exposure.ExposureDto in project SORMAS-Project by hzi-braunschweig.

the class ExposuresField method createEntry.

@Override
protected ExposureDto createEntry() {
    UserDto user = UserProvider.getCurrent().getUser();
    ExposureDto exposure = ExposureDto.build(null);
    exposure.getLocation().setRegion(user.getRegion());
    exposure.getLocation().setDistrict(user.getDistrict());
    exposure.getLocation().setCommunity(user.getCommunity());
    exposure.setReportingUser(user.toReference());
    return exposure;
}
Also used : ExposureDto(de.symeda.sormas.api.exposure.ExposureDto) UserDto(de.symeda.sormas.api.user.UserDto)

Example 3 with ExposureDto

use of de.symeda.sormas.api.exposure.ExposureDto in project SORMAS-Project by hzi-braunschweig.

the class ExposuresField method showMultipleInfectionEnvironmentsPopup.

private void showMultipleInfectionEnvironmentsPopup(ExposureDto entry) {
    VerticalLayout warningLayout = VaadinUiUtil.createWarningLayout();
    Window popupWindow = VaadinUiUtil.showPopupWindow(warningLayout);
    com.vaadin.ui.Label infoLabel = new com.vaadin.ui.Label(I18nProperties.getValidationError(Validations.caseMultipleInfectionEnvironments));
    CssStyles.style(infoLabel, CssStyles.LABEL_LARGE, CssStyles.LABEL_WHITE_SPACE_NORMAL);
    warningLayout.addComponent(infoLabel);
    ConfirmationComponent yesNo = VaadinUiUtil.buildYesNoConfirmationComponent();
    yesNo.getConfirmButton().addClickListener(new Button.ClickListener() {

        private static final long serialVersionUID = 1L;

        @Override
        public void buttonClick(Button.ClickEvent event) {
            popupWindow.close();
            for (ExposureDto exposure : getValue()) {
                if (exposure.isProbableInfectionEnvironment() && !exposure.getUuid().equals(entry.getUuid())) {
                    exposure.setProbableInfectionEnvironment(false);
                }
            }
            getTable().refreshRowCache();
        }
    });
    yesNo.getCancelButton().addClickListener(new Button.ClickListener() {

        private static final long serialVersionUID = 1L;

        @Override
        public void buttonClick(Button.ClickEvent event) {
            popupWindow.close();
            entry.setProbableInfectionEnvironment(false);
            getTable().refreshRowCache();
        }
    });
    warningLayout.addComponent(yesNo);
    popupWindow.setWidth(800, Sizeable.Unit.PIXELS);
    popupWindow.setClosable(false);
}
Also used : Window(com.vaadin.ui.Window) Label(com.vaadin.v7.ui.Label) Button(com.vaadin.ui.Button) ExposureDto(de.symeda.sormas.api.exposure.ExposureDto) VerticalLayout(com.vaadin.ui.VerticalLayout) ConfirmationComponent(de.symeda.sormas.ui.utils.ConfirmationComponent)

Example 4 with ExposureDto

use of de.symeda.sormas.api.exposure.ExposureDto in project SORMAS-Project by hzi-braunschweig.

the class CaseFacadeEjb method restorePseudonymizedDto.

public void restorePseudonymizedDto(CaseDataDto dto, CaseDataDto existingCaseDto, Case caze, Pseudonymizer pseudonymizer) {
    if (existingCaseDto != null) {
        boolean inJurisdiction = service.inJurisdictionOrOwned(caze);
        User currentUser = userService.getCurrentUser();
        pseudonymizer.restoreUser(caze.getReportingUser(), currentUser, dto, dto::setReportingUser);
        pseudonymizer.restoreUser(caze.getClassificationUser(), currentUser, dto, dto::setClassificationUser);
        pseudonymizer.restorePseudonymizedValues(CaseDataDto.class, dto, existingCaseDto, inJurisdiction);
        EpiDataDto epiData = dto.getEpiData();
        EpiDataDto existingEpiData = existingCaseDto.getEpiData();
        pseudonymizer.restorePseudonymizedValues(EpiDataDto.class, epiData, existingEpiData, inJurisdiction);
        epiData.getExposures().forEach(exposure -> {
            ExposureDto existingExposure = existingEpiData.getExposures().stream().filter(exp -> DataHelper.isSame(exposure, exp)).findFirst().orElse(null);
            if (existingExposure != null) {
                pseudonymizer.restorePseudonymizedValues(ExposureDto.class, exposure, existingExposure, inJurisdiction);
                pseudonymizer.restorePseudonymizedValues(LocationDto.class, exposure.getLocation(), existingExposure.getLocation(), inJurisdiction);
            }
        });
        pseudonymizer.restorePseudonymizedValues(HealthConditionsDto.class, dto.getHealthConditions(), existingCaseDto.getHealthConditions(), inJurisdiction);
        dto.getHospitalization().getPreviousHospitalizations().forEach(previousHospitalization -> existingCaseDto.getHospitalization().getPreviousHospitalizations().stream().filter(eh -> DataHelper.isSame(previousHospitalization, eh)).findFirst().ifPresent(existingPreviousHospitalization -> pseudonymizer.restorePseudonymizedValues(PreviousHospitalizationDto.class, previousHospitalization, existingPreviousHospitalization, inJurisdiction)));
        pseudonymizer.restorePseudonymizedValues(SymptomsDto.class, dto.getSymptoms(), existingCaseDto.getSymptoms(), inJurisdiction);
        pseudonymizer.restorePseudonymizedValues(MaternalHistoryDto.class, dto.getMaternalHistory(), existingCaseDto.getMaternalHistory(), inJurisdiction);
    }
}
Also used : VisitService(de.symeda.sormas.backend.visit.VisitService) PlagueType(de.symeda.sormas.api.caze.PlagueType) VisitStatus(de.symeda.sormas.api.visit.VisitStatus) CaseSimilarityCriteria(de.symeda.sormas.api.caze.CaseSimilarityCriteria) DistrictService(de.symeda.sormas.backend.infrastructure.district.DistrictService) StringUtils(org.apache.commons.lang3.StringUtils) PersonDto(de.symeda.sormas.api.person.PersonDto) TaskHelper(de.symeda.sormas.api.task.TaskHelper) AbstractCoreFacadeEjb(de.symeda.sormas.backend.common.AbstractCoreFacadeEjb) TransactionAttributeType(javax.ejb.TransactionAttributeType) CaseExportDto(de.symeda.sormas.api.caze.CaseExportDto) Duration(java.time.Duration) Map(java.util.Map) TreatmentFacadeEjb(de.symeda.sormas.backend.therapy.TreatmentFacadeEjb) DocumentRelatedEntityType(de.symeda.sormas.api.document.DocumentRelatedEntityType) PrescriptionDto(de.symeda.sormas.api.therapy.PrescriptionDto) CriteriaQuery(javax.persistence.criteria.CriteriaQuery) ParameterExpression(javax.persistence.criteria.ParameterExpression) OutbreakService(de.symeda.sormas.backend.outbreak.OutbreakService) DiseaseHelper(de.symeda.sormas.api.DiseaseHelper) CommunityService(de.symeda.sormas.backend.infrastructure.community.CommunityService) FacilityHelper(de.symeda.sormas.api.infrastructure.facility.FacilityHelper) Resource(javax.annotation.Resource) TaskPriority(de.symeda.sormas.api.task.TaskPriority) NotNull(javax.validation.constraints.NotNull) CaseIndexDetailedDto(de.symeda.sormas.api.caze.CaseIndexDetailedDto) User(de.symeda.sormas.backend.user.User) PathogenTestResultType(de.symeda.sormas.api.sample.PathogenTestResultType) CaseLogic(de.symeda.sormas.api.caze.CaseLogic) EpiDataDto(de.symeda.sormas.api.epidata.EpiDataDto) JurisdictionHelper(de.symeda.sormas.backend.util.JurisdictionHelper) SampleService(de.symeda.sormas.backend.sample.SampleService) ExternalSurveillanceToolException(de.symeda.sormas.api.externalsurveillancetool.ExternalSurveillanceToolException) Sample(de.symeda.sormas.backend.sample.Sample) Hospitalization(de.symeda.sormas.backend.hospitalization.Hospitalization) Community(de.symeda.sormas.backend.infrastructure.community.Community) QueryHelper(de.symeda.sormas.backend.util.QueryHelper) CaseClassification(de.symeda.sormas.api.caze.CaseClassification) ManualMessageLogDto(de.symeda.sormas.api.messaging.ManualMessageLogDto) FacilityFacadeEjb(de.symeda.sormas.backend.infrastructure.facility.FacilityFacadeEjb) TypedQuery(javax.persistence.TypedQuery) VisitFacadeEjbLocal(de.symeda.sormas.backend.visit.VisitFacadeEjb.VisitFacadeEjbLocal) PathogenTestType(de.symeda.sormas.api.sample.PathogenTestType) CaseListEntryDto(de.symeda.sormas.api.caze.CaseListEntryDto) Calendar(java.util.Calendar) PreviousHospitalizationDto(de.symeda.sormas.api.hospitalization.PreviousHospitalizationDto) SampleFacadeEjb(de.symeda.sormas.backend.sample.SampleFacadeEjb) ConfigFacadeEjbLocal(de.symeda.sormas.backend.common.ConfigFacadeEjb.ConfigFacadeEjbLocal) ExportHelper(de.symeda.sormas.backend.importexport.ExportHelper) EJB(javax.ejb.EJB) TaskCriteria(de.symeda.sormas.api.task.TaskCriteria) ManualMessageLogService(de.symeda.sormas.backend.common.messaging.ManualMessageLogService) HospitalizationFacadeEjbLocal(de.symeda.sormas.backend.hospitalization.HospitalizationFacadeEjb.HospitalizationFacadeEjbLocal) DataHelper(de.symeda.sormas.api.utils.DataHelper) Task(de.symeda.sormas.backend.task.Task) PointOfEntry(de.symeda.sormas.backend.infrastructure.pointofentry.PointOfEntry) PersonFacadeEjb(de.symeda.sormas.backend.person.PersonFacadeEjb) CaseOrigin(de.symeda.sormas.api.caze.CaseOrigin) AgeAndBirthDateDto(de.symeda.sormas.api.caze.AgeAndBirthDateDto) PersonService(de.symeda.sormas.backend.person.PersonService) SymptomsHelper(de.symeda.sormas.api.symptoms.SymptomsHelper) SortProperty(de.symeda.sormas.api.utils.SortProperty) Prescription(de.symeda.sormas.backend.therapy.Prescription) TravelEntryService(de.symeda.sormas.backend.travelentry.services.TravelEntryService) PrescriptionFacadeEjb(de.symeda.sormas.backend.therapy.PrescriptionFacadeEjb) AtomicLong(java.util.concurrent.atomic.AtomicLong) ExposureDto(de.symeda.sormas.api.exposure.ExposureDto) Disease(de.symeda.sormas.api.Disease) VisitDto(de.symeda.sormas.api.visit.VisitDto) HealthConditions(de.symeda.sormas.backend.clinicalcourse.HealthConditions) FeatureTypeProperty(de.symeda.sormas.api.feature.FeatureTypeProperty) FieldVisibilityCheckers(de.symeda.sormas.api.utils.fieldvisibility.FieldVisibilityCheckers) PortHealthInfoFacadeEjbLocal(de.symeda.sormas.backend.caze.porthealthinfo.PortHealthInfoFacadeEjb.PortHealthInfoFacadeEjbLocal) VisitFacadeEjb(de.symeda.sormas.backend.visit.VisitFacadeEjb) CaseSelectionDto(de.symeda.sormas.api.caze.CaseSelectionDto) ContactCriteria(de.symeda.sormas.api.contact.ContactCriteria) SurveillanceReportService(de.symeda.sormas.backend.caze.surveillancereport.SurveillanceReportService) ImmunizationEntityHelper(de.symeda.sormas.backend.immunization.ImmunizationEntityHelper) Join(javax.persistence.criteria.Join) Date(java.util.Date) I18nProperties(de.symeda.sormas.api.i18n.I18nProperties) PopulationDataFacadeEjbLocal(de.symeda.sormas.backend.infrastructure.PopulationDataFacadeEjb.PopulationDataFacadeEjbLocal) Random(java.util.Random) AccessDeniedException(de.symeda.sormas.api.utils.AccessDeniedException) PortHealthInfoDto(de.symeda.sormas.api.caze.porthealthinfo.PortHealthInfoDto) PrescriptionService(de.symeda.sormas.backend.therapy.PrescriptionService) Facility(de.symeda.sormas.backend.infrastructure.facility.Facility) CriteriaBuilderHelper.or(de.symeda.sormas.backend.common.CriteriaBuilderHelper.or) CaseClassificationFacadeEjbLocal(de.symeda.sormas.backend.caze.classification.CaseClassificationFacadeEjb.CaseClassificationFacadeEjbLocal) Vaccination(de.symeda.sormas.backend.vaccination.Vaccination) VisitSummaryExportDetails(de.symeda.sormas.backend.contact.VisitSummaryExportDetails) ManagedScheduledExecutorService(javax.enterprise.concurrent.ManagedScheduledExecutorService) InfrastructureHelper(de.symeda.sormas.api.infrastructure.InfrastructureHelper) DiseaseConfigurationFacadeEjbLocal(de.symeda.sormas.backend.disease.DiseaseConfigurationFacadeEjb.DiseaseConfigurationFacadeEjbLocal) Person(de.symeda.sormas.backend.person.Person) FacilityType(de.symeda.sormas.api.infrastructure.facility.FacilityType) Timestamp(java.sql.Timestamp) Collection(java.util.Collection) InvestigationStatus(de.symeda.sormas.api.caze.InvestigationStatus) PrescriptionFacadeEjbLocal(de.symeda.sormas.backend.therapy.PrescriptionFacadeEjb.PrescriptionFacadeEjbLocal) Instant(java.time.Instant) Pseudonymizer(de.symeda.sormas.backend.util.Pseudonymizer) Collectors(java.util.stream.Collectors) Language(de.symeda.sormas.api.Language) NewCaseDateType(de.symeda.sormas.api.caze.NewCaseDateType) PatchHelper(de.symeda.sormas.backend.util.PatchHelper) Objects(java.util.Objects) CaseIndexDto(de.symeda.sormas.api.caze.CaseIndexDto) SurveillanceReportFacadeEjb(de.symeda.sormas.backend.caze.surveillancereport.SurveillanceReportFacadeEjb) ExportConfigurationDto(de.symeda.sormas.api.importexport.ExportConfigurationDto) ShareTreeCriteria(de.symeda.sormas.api.sormastosormas.ShareTreeCriteria) MessageContents(de.symeda.sormas.backend.common.messaging.MessageContents) BirthDateDto(de.symeda.sormas.api.caze.BirthDateDto) PreviousHospitalization(de.symeda.sormas.backend.hospitalization.PreviousHospitalization) ContactDto(de.symeda.sormas.api.contact.ContactDto) LocalDate(java.time.LocalDate) Order(javax.persistence.criteria.Order) ClinicalCourseDto(de.symeda.sormas.api.clinicalcourse.ClinicalCourseDto) FeatureConfigurationFacadeEjbLocal(de.symeda.sormas.backend.feature.FeatureConfigurationFacadeEjb.FeatureConfigurationFacadeEjbLocal) FacilityDto(de.symeda.sormas.api.infrastructure.facility.FacilityDto) ContactFacadeEjbLocal(de.symeda.sormas.backend.contact.ContactFacadeEjb.ContactFacadeEjbLocal) CaseFollowUpDto(de.symeda.sormas.api.caze.CaseFollowUpDto) DateHelper(de.symeda.sormas.api.utils.DateHelper) AdditionalTestDto(de.symeda.sormas.api.sample.AdditionalTestDto) CoreEntityType(de.symeda.sormas.backend.deletionconfiguration.CoreEntityType) Function(java.util.function.Function) VisitOrigin(de.symeda.sormas.api.VisitOrigin) EventParticipantService(de.symeda.sormas.backend.event.EventParticipantService) AdditionalTestFacadeEjbLocal(de.symeda.sormas.backend.sample.AdditionalTestFacadeEjb.AdditionalTestFacadeEjbLocal) Inject(javax.inject.Inject) ReinfectionDetail(de.symeda.sormas.api.caze.ReinfectionDetail) PreviousCaseDto(de.symeda.sormas.api.caze.PreviousCaseDto) TransactionAttribute(javax.ejb.TransactionAttribute) TaskStatus(de.symeda.sormas.api.task.TaskStatus) TherapyReferenceDto(de.symeda.sormas.api.therapy.TherapyReferenceDto) CriteriaBuilderHelper.and(de.symeda.sormas.backend.common.CriteriaBuilderHelper.and) SymptomsDto(de.symeda.sormas.api.symptoms.SymptomsDto) CriteriaBuilderHelper(de.symeda.sormas.backend.common.CriteriaBuilderHelper) PathogenTestDto(de.symeda.sormas.api.sample.PathogenTestDto) ExternalShareInfoService(de.symeda.sormas.backend.share.ExternalShareInfoService) LocationDto(de.symeda.sormas.api.location.LocationDto) TaskContext(de.symeda.sormas.api.task.TaskContext) Logger(org.slf4j.Logger) HospitalizationFacadeEjb(de.symeda.sormas.backend.hospitalization.HospitalizationFacadeEjb) Document(de.symeda.sormas.backend.document.Document) TherapyFacadeEjbLocal(de.symeda.sormas.backend.therapy.TherapyFacadeEjb.TherapyFacadeEjbLocal) VisitLogic.getVisitResult(de.symeda.sormas.backend.visit.VisitLogic.getVisitResult) DateTime(org.joda.time.DateTime) UserReference(de.symeda.sormas.backend.user.UserReference) RegionFacadeEjb(de.symeda.sormas.backend.infrastructure.region.RegionFacadeEjb) PresentCondition(de.symeda.sormas.api.person.PresentCondition) UserRight(de.symeda.sormas.api.user.UserRight) VisitResultDto(de.symeda.sormas.api.visit.VisitResultDto) ExternalJournalService(de.symeda.sormas.backend.externaljournal.ExternalJournalService) ContactReferenceDto(de.symeda.sormas.api.contact.ContactReferenceDto) ShareInfoHelper(de.symeda.sormas.backend.sormastosormas.share.shareinfo.ShareInfoHelper) Comparator(java.util.Comparator) Arrays(java.util.Arrays) CasePersonDto(de.symeda.sormas.api.caze.CasePersonDto) DtoHelper(de.symeda.sormas.backend.util.DtoHelper) EmbeddedSampleExportDto(de.symeda.sormas.api.caze.EmbeddedSampleExportDto) SymptomsFacadeEjbLocal(de.symeda.sormas.backend.symptoms.SymptomsFacadeEjb.SymptomsFacadeEjbLocal) Immunization(de.symeda.sormas.backend.immunization.entity.Immunization) CommunityFacadeEjb(de.symeda.sormas.backend.infrastructure.community.CommunityFacadeEjb) ExternalDataUpdateException(de.symeda.sormas.api.externaldata.ExternalDataUpdateException) MeansOfImmunization(de.symeda.sormas.api.immunization.MeansOfImmunization) ClinicalVisitCriteria(de.symeda.sormas.api.clinicalcourse.ClinicalVisitCriteria) Valid(javax.validation.Valid) BigDecimal(java.math.BigDecimal) CaseOutcome(de.symeda.sormas.api.caze.CaseOutcome) YesNoUnknown(de.symeda.sormas.api.utils.YesNoUnknown) Page(de.symeda.sormas.api.common.Page) FollowUpDto(de.symeda.sormas.api.followup.FollowUpDto) Predicate(javax.persistence.criteria.Predicate) UserFacadeEjb(de.symeda.sormas.backend.user.UserFacadeEjb) CriteriaBuilder(javax.persistence.criteria.CriteriaBuilder) JoinType(javax.persistence.criteria.JoinType) JsonNode(com.fasterxml.jackson.databind.JsonNode) Visit(de.symeda.sormas.backend.visit.Visit) EpiData(de.symeda.sormas.backend.epidata.EpiData) SormasToSormasOriginInfoFacadeEjb(de.symeda.sormas.backend.sormastosormas.origin.SormasToSormasOriginInfoFacadeEjb) EventParticipantReferenceDto(de.symeda.sormas.api.event.EventParticipantReferenceDto) FacilityService(de.symeda.sormas.backend.infrastructure.facility.FacilityService) TherapyDto(de.symeda.sormas.api.therapy.TherapyDto) Set(java.util.Set) SampleFacadeEjbLocal(de.symeda.sormas.backend.sample.SampleFacadeEjb.SampleFacadeEjbLocal) DistrictFacadeEjbLocal(de.symeda.sormas.backend.infrastructure.district.DistrictFacadeEjb.DistrictFacadeEjbLocal) PointOfEntryService(de.symeda.sormas.backend.infrastructure.pointofentry.PointOfEntryService) UserService(de.symeda.sormas.backend.user.UserService) MaternalHistoryDto(de.symeda.sormas.api.caze.maternalhistory.MaternalHistoryDto) ExternalDataDto(de.symeda.sormas.api.externaldata.ExternalDataDto) RegionReferenceDto(de.symeda.sormas.api.infrastructure.region.RegionReferenceDto) SampleCriteria(de.symeda.sormas.api.sample.SampleCriteria) EventParticipant(de.symeda.sormas.backend.event.EventParticipant) HealthConditionsDto(de.symeda.sormas.api.clinicalcourse.HealthConditionsDto) FollowUpPeriodDto(de.symeda.sormas.api.followup.FollowUpPeriodDto) CaseReferenceDefinition(de.symeda.sormas.api.caze.CaseReferenceDefinition) CaseMeasure(de.symeda.sormas.api.CaseMeasure) PersonReferenceDto(de.symeda.sormas.api.person.PersonReferenceDto) PathogenTest(de.symeda.sormas.backend.sample.PathogenTest) ArrayList(java.util.ArrayList) CaseReferenceDto(de.symeda.sormas.api.caze.CaseReferenceDto) ClinicalVisitFacadeEjb(de.symeda.sormas.backend.clinicalcourse.ClinicalVisitFacadeEjb) EpiDataFacadeEjb(de.symeda.sormas.backend.epidata.EpiDataFacadeEjb) TreatmentCriteria(de.symeda.sormas.api.therapy.TreatmentCriteria) LocalBean(javax.ejb.LocalBean) CountryHelper(de.symeda.sormas.api.CountryHelper) Root(javax.persistence.criteria.Root) PersonFacadeEjbLocal(de.symeda.sormas.backend.person.PersonFacadeEjb.PersonFacadeEjbLocal) ClinicalVisitDto(de.symeda.sormas.api.clinicalcourse.ClinicalVisitDto) MessageType(de.symeda.sormas.api.messaging.MessageType) DistrictReferenceDto(de.symeda.sormas.api.infrastructure.district.DistrictReferenceDto) MaternalHistoryFacadeEjbLocal(de.symeda.sormas.backend.caze.maternalhistory.MaternalHistoryFacadeEjb.MaternalHistoryFacadeEjbLocal) CaseFacade(de.symeda.sormas.api.caze.CaseFacade) Captions(de.symeda.sormas.api.i18n.Captions) Exposure(de.symeda.sormas.backend.exposure.Exposure) Treatment(de.symeda.sormas.backend.therapy.Treatment) CaseBulkEditData(de.symeda.sormas.api.caze.CaseBulkEditData) PrescriptionCriteria(de.symeda.sormas.api.therapy.PrescriptionCriteria) ContactService(de.symeda.sormas.backend.contact.ContactService) SampleDto(de.symeda.sormas.api.sample.SampleDto) Subquery(javax.persistence.criteria.Subquery) SymptomsFacadeEjb(de.symeda.sormas.backend.symptoms.SymptomsFacadeEjb) TravelEntry(de.symeda.sormas.backend.travelentry.TravelEntry) SurveillanceReport(de.symeda.sormas.backend.caze.surveillancereport.SurveillanceReport) SormasToSormasOriginInfo(de.symeda.sormas.backend.sormastosormas.origin.SormasToSormasOriginInfo) FeatureType(de.symeda.sormas.api.feature.FeatureType) TherapyFacadeEjb(de.symeda.sormas.backend.therapy.TherapyFacadeEjb) EventService(de.symeda.sormas.backend.event.EventService) PointOfEntryFacadeEjb(de.symeda.sormas.backend.infrastructure.pointofentry.PointOfEntryFacadeEjb) ApproximateAgeType(de.symeda.sormas.api.person.ApproximateAgeType) ClinicalVisitService(de.symeda.sormas.backend.clinicalcourse.ClinicalVisitService) AbstractDomainObject(de.symeda.sormas.backend.common.AbstractDomainObject) InfoProvider(de.symeda.sormas.api.utils.InfoProvider) LoggerFactory(org.slf4j.LoggerFactory) ExposureType(de.symeda.sormas.api.exposure.ExposureType) HealthConditionsMapper(de.symeda.sormas.backend.clinicalcourse.HealthConditionsMapper) CauseOfDeath(de.symeda.sormas.api.person.CauseOfDeath) CommunityFacadeEjbLocal(de.symeda.sormas.backend.infrastructure.community.CommunityFacadeEjb.CommunityFacadeEjbLocal) ExposureService(de.symeda.sormas.backend.exposure.ExposureService) ExternalShareInfoCountAndLatestDate(de.symeda.sormas.backend.share.ExternalShareInfoCountAndLatestDate) SormasToSormasCaseFacadeEjbLocal(de.symeda.sormas.backend.sormastosormas.entities.caze.SormasToSormasCaseFacadeEjb.SormasToSormasCaseFacadeEjbLocal) NotificationService(de.symeda.sormas.backend.common.NotificationService) TreatmentFacadeEjbLocal(de.symeda.sormas.backend.therapy.TreatmentFacadeEjb.TreatmentFacadeEjbLocal) UserRole(de.symeda.sormas.api.user.UserRole) Path(javax.persistence.criteria.Path) Contact(de.symeda.sormas.backend.contact.Contact) Stateless(javax.ejb.Stateless) PortHealthInfoFacadeEjb(de.symeda.sormas.backend.caze.porthealthinfo.PortHealthInfoFacadeEjb) DocumentService(de.symeda.sormas.backend.document.DocumentService) NotificationDeliveryFailedException(de.symeda.sormas.backend.common.messaging.NotificationDeliveryFailedException) CaseCriteria(de.symeda.sormas.api.caze.CaseCriteria) CaseDataDto(de.symeda.sormas.api.caze.CaseDataDto) Region(de.symeda.sormas.backend.infrastructure.region.Region) District(de.symeda.sormas.backend.infrastructure.district.District) AdditionalTest(de.symeda.sormas.backend.sample.AdditionalTest) SormasToSormasFacadeEjbLocal(de.symeda.sormas.backend.sormastosormas.SormasToSormasFacadeEjb.SormasToSormasFacadeEjbLocal) CommunityReferenceDto(de.symeda.sormas.api.infrastructure.community.CommunityReferenceDto) TaskType(de.symeda.sormas.api.task.TaskType) EventSummaryDetails(de.symeda.sormas.backend.event.EventSummaryDetails) List(java.util.List) MaternalHistoryFacadeEjb(de.symeda.sormas.backend.caze.maternalhistory.MaternalHistoryFacadeEjb) DistrictFacadeEjb(de.symeda.sormas.backend.infrastructure.district.DistrictFacadeEjb) DistrictDto(de.symeda.sormas.api.infrastructure.district.DistrictDto) Optional(java.util.Optional) EpiDataHelper(de.symeda.sormas.api.epidata.EpiDataHelper) Location(de.symeda.sormas.backend.location.Location) ValidationRuntimeException(de.symeda.sormas.api.utils.ValidationRuntimeException) ClinicalCourseFacadeEjb(de.symeda.sormas.backend.clinicalcourse.ClinicalCourseFacadeEjb) VaccinationFacadeEjb(de.symeda.sormas.backend.vaccination.VaccinationFacadeEjb) TaskService(de.symeda.sormas.backend.task.TaskService) HashMap(java.util.HashMap) PathogenTestFacadeEjbLocal(de.symeda.sormas.backend.sample.PathogenTestFacadeEjb.PathogenTestFacadeEjbLocal) SurveillanceReportDto(de.symeda.sormas.api.caze.surveillancereport.SurveillanceReportDto) CaseExportType(de.symeda.sormas.api.caze.CaseExportType) CollectionUtils(org.apache.commons.collections.CollectionUtils) IterableHelper(de.symeda.sormas.backend.util.IterableHelper) FacilityFacadeEjbLocal(de.symeda.sormas.backend.infrastructure.facility.FacilityFacadeEjb.FacilityFacadeEjbLocal) Symptoms(de.symeda.sormas.backend.symptoms.Symptoms) TreatmentService(de.symeda.sormas.backend.therapy.TreatmentService) Expression(javax.persistence.criteria.Expression) BurialInfoDto(de.symeda.sormas.api.caze.BurialInfoDto) SormasToSormasOriginInfoFacadeEjbLocal(de.symeda.sormas.backend.sormastosormas.origin.SormasToSormasOriginInfoFacadeEjb.SormasToSormasOriginInfoFacadeEjbLocal) ModelConstants(de.symeda.sormas.backend.util.ModelConstants) EpiDataService(de.symeda.sormas.backend.epidata.EpiDataService) CaseJoins(de.symeda.sormas.utils.CaseJoins) ClinicalVisit(de.symeda.sormas.backend.clinicalcourse.ClinicalVisit) EpiDataFacadeEjbLocal(de.symeda.sormas.backend.epidata.EpiDataFacadeEjb.EpiDataFacadeEjbLocal) Validations(de.symeda.sormas.api.i18n.Validations) ClinicalVisitFacadeEjbLocal(de.symeda.sormas.backend.clinicalcourse.ClinicalVisitFacadeEjb.ClinicalVisitFacadeEjbLocal) MessageSubject(de.symeda.sormas.backend.common.messaging.MessageSubject) Pair(de.symeda.sormas.api.utils.DataHelper.Pair) PathogenTestService(de.symeda.sormas.backend.sample.PathogenTestService) MapCaseDto(de.symeda.sormas.api.caze.MapCaseDto) RegionService(de.symeda.sormas.backend.infrastructure.region.RegionService) TimeUnit(java.util.concurrent.TimeUnit) Event(de.symeda.sormas.backend.event.Event) NotificationType(de.symeda.sormas.api.user.NotificationType) MessagingService(de.symeda.sormas.backend.common.messaging.MessagingService) Country(de.symeda.sormas.backend.infrastructure.country.Country) SormasToSormasShareInfo(de.symeda.sormas.backend.sormastosormas.share.shareinfo.SormasToSormasShareInfo) ClinicalCourseFacadeEjbLocal(de.symeda.sormas.backend.clinicalcourse.ClinicalCourseFacadeEjb.ClinicalCourseFacadeEjbLocal) Strings(de.symeda.sormas.api.i18n.Strings) ExternalSurveillanceToolGatewayFacadeEjbLocal(de.symeda.sormas.backend.externalsurveillancetool.ExternalSurveillanceToolGatewayFacadeEjb.ExternalSurveillanceToolGatewayFacadeEjbLocal) Collections(java.util.Collections) ClinicalCourseReferenceDto(de.symeda.sormas.api.clinicalcourse.ClinicalCourseReferenceDto) TreatmentDto(de.symeda.sormas.api.therapy.TreatmentDto) EpiDataDto(de.symeda.sormas.api.epidata.EpiDataDto) User(de.symeda.sormas.backend.user.User) ExposureDto(de.symeda.sormas.api.exposure.ExposureDto)

Example 5 with ExposureDto

use of de.symeda.sormas.api.exposure.ExposureDto in project SORMAS-Project by hzi-braunschweig.

the class EpiDataDtoHelper method fillInnerFromAdo.

@Override
public void fillInnerFromAdo(EpiDataDto target, EpiData source) {
    target.setExposureDetailsKnown(source.getExposureDetailsKnown());
    target.setActivityAsCaseDetailsKnown(source.getActivityAsCaseDetailsKnown());
    target.setContactWithSourceCaseKnown(source.getContactWithSourceCaseKnown());
    target.setHighTransmissionRiskArea(source.getHighTransmissionRiskArea());
    target.setLargeOutbreaksArea(source.getLargeOutbreaksArea());
    target.setAreaInfectedAnimals(source.getAreaInfectedAnimals());
    List<ExposureDto> exposureDtos = new ArrayList<>();
    if (!source.getExposures().isEmpty()) {
        for (Exposure exposure : source.getExposures()) {
            ExposureDto exposureDto = exposureDtoHelper.adoToDto(exposure);
            exposureDtos.add(exposureDto);
        }
    }
    target.setExposures(exposureDtos);
    List<ActivityAsCaseDto> activityAsCaseDtos = new ArrayList<>();
    if (!source.getActivitiesAsCase().isEmpty()) {
        for (ActivityAsCase activityAsCase : source.getActivitiesAsCase()) {
            ActivityAsCaseDto exposureDto = activityAsCaseDtoHelper.adoToDto(activityAsCase);
            activityAsCaseDtos.add(exposureDto);
        }
    }
    target.setActivitiesAsCase(activityAsCaseDtos);
    target.setPseudonymized(source.isPseudonymized());
}
Also used : ExposureDto(de.symeda.sormas.api.exposure.ExposureDto) ActivityAsCaseDto(de.symeda.sormas.api.activityascase.ActivityAsCaseDto) ArrayList(java.util.ArrayList) Exposure(de.symeda.sormas.app.backend.exposure.Exposure) ActivityAsCase(de.symeda.sormas.app.backend.activityascase.ActivityAsCase)

Aggregations

ExposureDto (de.symeda.sormas.api.exposure.ExposureDto)38 CaseDataDto (de.symeda.sormas.api.caze.CaseDataDto)28 Test (org.junit.Test)24 AbstractBeanTest (de.symeda.sormas.backend.AbstractBeanTest)21 EpiDataDto (de.symeda.sormas.api.epidata.EpiDataDto)10 PersonDto (de.symeda.sormas.api.person.PersonDto)9 UserDto (de.symeda.sormas.api.user.UserDto)8 Date (java.util.Date)8 ArrayList (java.util.ArrayList)7 SymptomsDto (de.symeda.sormas.api.symptoms.SymptomsDto)5 LocalDate (java.time.LocalDate)5 ContactDto (de.symeda.sormas.api.contact.ContactDto)4 LocationDto (de.symeda.sormas.api.location.LocationDto)4 PathogenTestDto (de.symeda.sormas.api.sample.PathogenTestDto)4 Window (com.vaadin.ui.Window)3 ActivityAsCaseDto (de.symeda.sormas.api.activityascase.ActivityAsCaseDto)3 RDCF (de.symeda.sormas.backend.TestDataCreator.RDCF)3 JsonNode (com.fasterxml.jackson.databind.JsonNode)2 Button (com.vaadin.ui.Button)2 VerticalLayout (com.vaadin.ui.VerticalLayout)2