Search in sources :

Example 16 with ImportErrorException

use of de.symeda.sormas.api.importexport.ImportErrorException in project SORMAS-Project by hzi-braunschweig.

the class CaseImportFacadeEjb method insertRowIntoData.

protected ImportLineResultDto<CaseImportEntities> insertRowIntoData(String[] values, String[] entityClasses, String[][] entityPropertyPaths, boolean ignoreEmptyEntries, Function<ImportCellData, Exception> insertCallback) {
    String importError = null;
    List<String> invalidColumns = new ArrayList<>();
    for (int i = 0; i < values.length; i++) {
        String value = StringUtils.trimToNull(values[i]);
        if (ignoreEmptyEntries && (value == null || value.isEmpty())) {
            continue;
        }
        String[] entityPropertyPath = entityPropertyPaths[i];
        // Error description column is ignored
        if (entityPropertyPath[0].equals(ERROR_COLUMN_NAME)) {
            continue;
        }
        if (!(ignoreEmptyEntries && StringUtils.isEmpty(value))) {
            Exception exception = insertCallback.apply(new ImportCellData(value, entityClasses != null ? entityClasses[i] : null, entityPropertyPath));
            if (exception != null) {
                if (exception instanceof ImportErrorException) {
                    importError = exception.getMessage();
                    StringBuilder additionalInfo = new StringBuilder();
                    for (int j = 0; j < entityPropertyPath.length; j++) {
                        additionalInfo.append(" ").append(entityPropertyPath[j]);
                    }
                    importError += additionalInfo;
                    importError += "value:" + value;
                    break;
                } else if (exception instanceof InvalidColumnException) {
                    invalidColumns.add(((InvalidColumnException) exception).getColumnName());
                }
            }
        }
    }
    if (invalidColumns.size() > 0) {
        LOGGER.warn("Unhandled columns [{}]", String.join(", ", invalidColumns));
    }
    return importError != null ? ImportLineResultDto.errorResult(importError) : ImportLineResultDto.successResult();
}
Also used : ImportCellData(de.symeda.sormas.api.importexport.ImportCellData) ImportErrorException(de.symeda.sormas.api.importexport.ImportErrorException) InvalidColumnException(de.symeda.sormas.api.importexport.InvalidColumnException) ArrayList(java.util.ArrayList) InvalidColumnException(de.symeda.sormas.api.importexport.InvalidColumnException) ParseException(java.text.ParseException) ImportErrorException(de.symeda.sormas.api.importexport.ImportErrorException) IntrospectionException(java.beans.IntrospectionException) InvocationTargetException(java.lang.reflect.InvocationTargetException) ValidationRuntimeException(de.symeda.sormas.api.utils.ValidationRuntimeException)

Example 17 with ImportErrorException

use of de.symeda.sormas.api.importexport.ImportErrorException in project SORMAS-Project by hzi-braunschweig.

the class CaseImportFacadeEjb method buildEntities.

private ImportLineResultDto<CaseImportEntities> buildEntities(String[] values, String[] entityClasses, String[][] entityPropertyPaths, boolean ignoreEmptyEntries, CaseImportEntities entities) {
    final UserReferenceDto currentUserRef = userService.getCurrentUser().toReference();
    final List<SampleDto> samples = entities.getSamples();
    final List<PathogenTestDto> pathogenTests = entities.getPathogenTests();
    final List<VaccinationDto> vaccinations = entities.getVaccinations();
    ImportRelatedObjectsMapper.Builder relatedObjectsMapperBuilder = new ImportRelatedObjectsMapper.Builder().addMapper(SampleDto.class, samples, () -> SampleDto.build(currentUserRef, new CaseReferenceDto(entities.getCaze().getUuid())), this::insertColumnEntryIntoRelatedObject).addMapper(PathogenTestDto.class, pathogenTests, () -> {
        if (samples.isEmpty()) {
            return null;
        }
        SampleDto referenceSample = samples.get(samples.size() - 1);
        return PathogenTestDto.build(new SampleReferenceDto(referenceSample.getUuid()), currentUserRef);
    }, this::insertColumnEntryIntoRelatedObject);
    if (featureConfigurationFacade.isPropertyValueTrue(FeatureType.IMMUNIZATION_MANAGEMENT, FeatureTypeProperty.REDUCED)) {
        relatedObjectsMapperBuilder.addMapper(VaccinationDto.class, vaccinations, () -> VaccinationDto.build(currentUserRef), this::insertColumnEntryIntoRelatedObject);
    }
    ImportRelatedObjectsMapper relatedMapper = relatedObjectsMapperBuilder.build();
    final ImportLineResultDto<CaseImportEntities> result = insertRowIntoData(values, entityClasses, entityPropertyPaths, ignoreEmptyEntries, (cellData) -> {
        try {
            CaseDataDto caze = entities.getCaze();
            if (!relatedMapper.map(cellData)) {
                if (StringUtils.isNotEmpty(cellData.getValue())) {
                    // If the cell entry is not empty, try to insert it into the current case or its person
                    insertColumnEntryIntoData(caze, entities.getPerson(), cellData.getValue(), cellData.getEntityPropertyPath());
                }
            }
        } catch (ImportErrorException | InvalidColumnException e) {
            return e;
        }
        return null;
    });
    // Sanitize non-HOME address
    PersonHelper.sanitizeNonHomeAddress(entities.getPerson());
    return result;
}
Also used : SampleReferenceDto(de.symeda.sormas.api.sample.SampleReferenceDto) CaseImportEntities(de.symeda.sormas.api.caze.caseimport.CaseImportEntities) ImportErrorException(de.symeda.sormas.api.importexport.ImportErrorException) CaseDataDto(de.symeda.sormas.api.caze.CaseDataDto) VaccinationDto(de.symeda.sormas.api.vaccination.VaccinationDto) PathogenTestDto(de.symeda.sormas.api.sample.PathogenTestDto) UserReferenceDto(de.symeda.sormas.api.user.UserReferenceDto) InvalidColumnException(de.symeda.sormas.api.importexport.InvalidColumnException) SampleDto(de.symeda.sormas.api.sample.SampleDto) ImportRelatedObjectsMapper(de.symeda.sormas.api.importexport.ImportRelatedObjectsMapper) CaseReferenceDto(de.symeda.sormas.api.caze.CaseReferenceDto)

Example 18 with ImportErrorException

use of de.symeda.sormas.api.importexport.ImportErrorException in project SORMAS-Project by hzi-braunschweig.

the class CaseImportFacadeEjb method insertColumnEntryIntoRelatedObject.

/**
 * Inserts the entry of a single cell into the sample, pathogen test, vaccinations or any other related object
 */
private void insertColumnEntryIntoRelatedObject(Object currentElement, String entry, String[] entryHeaderPath) throws InvalidColumnException, ImportErrorException {
    for (int i = 0; i < entryHeaderPath.length; i++) {
        String headerPathElementName = entryHeaderPath[i];
        try {
            if (i != entryHeaderPath.length - 1) {
                currentElement = new PropertyDescriptor(headerPathElementName, currentElement.getClass()).getReadMethod().invoke(currentElement);
            } else {
                PropertyDescriptor pd = new PropertyDescriptor(headerPathElementName, currentElement.getClass());
                Class<?> propertyType = pd.getPropertyType();
                // according to the types of the sample or pathogen test fields
                if (importFacade.executeDefaultInvoke(pd, currentElement, entry, entryHeaderPath, false)) {
                    continue;
                } else if (propertyType.isAssignableFrom(FacilityReferenceDto.class)) {
                    List<FacilityReferenceDto> lab = facilityFacade.getLaboratoriesByName(entry, false);
                    if (lab.isEmpty()) {
                        throw new ImportErrorException(I18nProperties.getValidationError(Validations.importEntryDoesNotExist, entry, buildEntityProperty(entryHeaderPath)));
                    } else if (lab.size() > 1) {
                        throw new ImportErrorException(I18nProperties.getValidationError(Validations.importLabNotUnique, entry, buildEntityProperty(entryHeaderPath)));
                    } else {
                        pd.getWriteMethod().invoke(currentElement, lab.get(0));
                    }
                } else {
                    throw new UnsupportedOperationException(I18nProperties.getValidationError(Validations.importCasesPropertyTypeNotAllowed, propertyType.getName()));
                }
            }
        } catch (IntrospectionException e) {
            throw new InvalidColumnException(buildEntityProperty(entryHeaderPath));
        } catch (InvocationTargetException | IllegalAccessException e) {
            throw new ImportErrorException(I18nProperties.getValidationError(Validations.importErrorInColumn, buildEntityProperty(entryHeaderPath)));
        } catch (IllegalArgumentException e) {
            throw new ImportErrorException(entry, buildEntityProperty(entryHeaderPath));
        } catch (ParseException e) {
            throw new ImportErrorException(I18nProperties.getValidationError(Validations.importInvalidDate, buildEntityProperty(entryHeaderPath), DateHelper.getAllowedDateFormats(I18nProperties.getUserLanguage().getDateFormat())));
        } catch (ImportErrorException e) {
            throw e;
        } catch (Exception e) {
            LOGGER.error("Unexpected error when trying to import a case: " + e.getMessage());
            throw new ImportErrorException(I18nProperties.getValidationError(Validations.importCasesUnexpectedError));
        }
    }
}
Also used : PropertyDescriptor(java.beans.PropertyDescriptor) ImportErrorException(de.symeda.sormas.api.importexport.ImportErrorException) FacilityReferenceDto(de.symeda.sormas.api.infrastructure.facility.FacilityReferenceDto) IntrospectionException(java.beans.IntrospectionException) InvocationTargetException(java.lang.reflect.InvocationTargetException) InvalidColumnException(de.symeda.sormas.api.importexport.InvalidColumnException) ParseException(java.text.ParseException) ImportErrorException(de.symeda.sormas.api.importexport.ImportErrorException) IntrospectionException(java.beans.IntrospectionException) InvocationTargetException(java.lang.reflect.InvocationTargetException) ValidationRuntimeException(de.symeda.sormas.api.utils.ValidationRuntimeException) InvalidColumnException(de.symeda.sormas.api.importexport.InvalidColumnException) List(java.util.List) ArrayList(java.util.ArrayList) ParseException(java.text.ParseException)

Example 19 with ImportErrorException

use of de.symeda.sormas.api.importexport.ImportErrorException in project SORMAS-Project by hzi-braunschweig.

the class TravelEntryImportFacadeEjb method insertColumnEntryIntoData.

private void insertColumnEntryIntoData(TravelEntryDto travelEntry, PersonDto person, String entry, String[] entryHeaderPath) throws InvalidColumnException, ImportErrorException {
    String propertyCaption = String.join("", entryHeaderPath);
    // Build the SORMAS property based on the DEA caption
    String personProperty = getPersonProperty(propertyCaption);
    Object currentElement = personProperty != null ? person : travelEntry;
    if (personProperty != null) {
        // Map the entry to an expected SORMAS value if necessary
        entry = getPersonValue(personProperty, entry);
    }
    Language language = I18nProperties.getUserLanguage();
    try {
        // Some person-related fields need to be handled in a specific way for the DEA import
        if (PersonDto.BIRTH_DATE.equals(personProperty)) {
            Date birthDate = DateHelper.parseDate(entry, new SimpleDateFormat("dd.MM.yyyy"));
            Calendar calendar = Calendar.getInstance();
            calendar.setTime(birthDate);
            person.setBirthdateDD(calendar.get(Calendar.DAY_OF_MONTH));
            // In calendar API months are indexed from 0 @see https://docs.oracle.com/javase/7/docs/api/java/util/Calendar.html#MONTH
            int birthdateMonth = calendar.get(Calendar.MONTH) + 1;
            person.setBirthdateMM(birthdateMonth);
            person.setBirthdateYYYY(calendar.get(Calendar.YEAR));
            return;
        } else if (PHONE_PRIVATE.equals(personProperty)) {
            person.setPhone(entry);
            return;
        } else if (PHONE_ADDITIONAL.equals(personProperty)) {
            person.setAdditionalPhone(entry);
            return;
        } else if (EMAIL.equals(personProperty)) {
            person.setEmailAddress(entry);
            return;
        }
        String relevantProperty = personProperty != null ? personProperty : propertyCaption;
        PropertyDescriptor pd = new PropertyDescriptor(relevantProperty, currentElement.getClass());
        Class<?> propertyType = pd.getPropertyType();
        // according to the types of the case or person fields
        if (importFacade.executeDefaultInvoke(pd, currentElement, entry, entryHeaderPath, false)) {
        // No action needed
        } else if (propertyType.isAssignableFrom(DistrictReferenceDto.class)) {
            List<DistrictReferenceDto> district = districtFacade.getByName(entry, ImportHelper.getRegionBasedOnDistrict(pd.getName(), null, null, travelEntry, person, currentElement), false);
            if (district.isEmpty()) {
                throw new ImportErrorException(I18nProperties.getValidationError(Validations.importEntryDoesNotExistDbOrRegion, entry, buildEntityProperty(entryHeaderPath)));
            } else if (district.size() > 1) {
                throw new ImportErrorException(I18nProperties.getValidationError(Validations.importDistrictNotUnique, entry, buildEntityProperty(entryHeaderPath)));
            } else {
                pd.getWriteMethod().invoke(currentElement, district.get(0));
            }
        } else if (propertyType.isAssignableFrom(CommunityReferenceDto.class)) {
            List<CommunityReferenceDto> community = communityFacade.getByName(entry, travelEntry.getResponsibleDistrict(), false);
            if (community.isEmpty()) {
                throw new ImportErrorException(I18nProperties.getValidationError(Validations.importEntryDoesNotExistDbOrDistrict, entry, buildEntityProperty(entryHeaderPath)));
            } else if (community.size() > 1) {
                throw new ImportErrorException(I18nProperties.getValidationError(Validations.importCommunityNotUnique, entry, buildEntityProperty(entryHeaderPath)));
            } else {
                pd.getWriteMethod().invoke(currentElement, community.get(0));
            }
        } else if (propertyType.isAssignableFrom(PointOfEntryReferenceDto.class)) {
            PointOfEntryReferenceDto pointOfEntryReference;
            DistrictReferenceDto pointOfEntryDistrict = travelEntry.getPointOfEntryDistrict() != null ? travelEntry.getPointOfEntryDistrict() : travelEntry.getResponsibleDistrict();
            List<PointOfEntryReferenceDto> customPointsOfEntry = pointOfEntryFacade.getByName(entry, pointOfEntryDistrict, false);
            if (customPointsOfEntry.isEmpty()) {
                final String poeName = entry;
                List<PointOfEntryDto> defaultPointOfEntries = pointOfEntryFacade.getByUuids(PointOfEntryDto.CONSTANT_POE_UUIDS);
                Optional<PointOfEntryDto> defaultPointOfEntry = defaultPointOfEntries.stream().filter(defaultPoe -> InfrastructureHelper.buildPointOfEntryString(defaultPoe.getUuid(), defaultPoe.getName()).equals(poeName)).findFirst();
                if (!defaultPointOfEntry.isPresent()) {
                    throw new ImportErrorException(I18nProperties.getValidationError(Validations.importEntryDoesNotExistDbOrDistrict, entry, buildEntityProperty(entryHeaderPath)));
                }
                pointOfEntryReference = defaultPointOfEntry.get().toReference();
            } else if (customPointsOfEntry.size() > 1) {
                throw new ImportErrorException(I18nProperties.getValidationError(Validations.importPointOfEntryNotUniqueInDistrict, entry, buildEntityProperty(entryHeaderPath)));
            } else {
                pointOfEntryReference = customPointsOfEntry.get(0);
            }
            pd.getWriteMethod().invoke(currentElement, pointOfEntryReference);
        } else {
            throw new UnsupportedOperationException(I18nProperties.getValidationError(Validations.importPropertyTypeNotAllowed, propertyType.getName()));
        }
    } catch (IntrospectionException e) {
        // Add the property to the deaContent field of the travel entry
        if (travelEntry.getDeaContent() == null) {
            travelEntry.setDeaContent(new ArrayList<>());
        }
        travelEntry.getDeaContent().add(new DeaContentEntry(propertyCaption, entry));
    } catch (InvocationTargetException | IllegalAccessException e) {
        throw new ImportErrorException(I18nProperties.getValidationError(Validations.importErrorInColumn, buildEntityProperty(entryHeaderPath)));
    } catch (IllegalArgumentException | EnumService.InvalidEnumCaptionException e) {
        throw new ImportErrorException(entry, buildEntityProperty(entryHeaderPath));
    } catch (ParseException e) {
        throw new ImportErrorException(I18nProperties.getValidationError(Validations.importInvalidDate, buildEntityProperty(entryHeaderPath), DateHelper.getAllowedDateFormats(language.getDateFormat())));
    } catch (ImportErrorException | UnsupportedOperationException e) {
        throw e;
    } catch (Exception e) {
        LOGGER.error("Unexpected error when trying to import a travel entry: " + e.getMessage(), e);
        throw new ImportErrorException(I18nProperties.getValidationError(Validations.importUnexpectedError));
    }
}
Also used : IntrospectionException(java.beans.IntrospectionException) ArrayList(java.util.ArrayList) CommunityReferenceDto(de.symeda.sormas.api.infrastructure.community.CommunityReferenceDto) Language(de.symeda.sormas.api.Language) List(java.util.List) ArrayList(java.util.ArrayList) PropertyDescriptor(java.beans.PropertyDescriptor) ImportErrorException(de.symeda.sormas.api.importexport.ImportErrorException) Optional(java.util.Optional) DeaContentEntry(de.symeda.sormas.api.travelentry.DeaContentEntry) Calendar(java.util.Calendar) DistrictReferenceDto(de.symeda.sormas.api.infrastructure.district.DistrictReferenceDto) Date(java.util.Date) InvocationTargetException(java.lang.reflect.InvocationTargetException) InvalidColumnException(de.symeda.sormas.api.importexport.InvalidColumnException) ParseException(java.text.ParseException) ImportErrorException(de.symeda.sormas.api.importexport.ImportErrorException) IntrospectionException(java.beans.IntrospectionException) InvocationTargetException(java.lang.reflect.InvocationTargetException) ValidationRuntimeException(de.symeda.sormas.api.utils.ValidationRuntimeException) PointOfEntryReferenceDto(de.symeda.sormas.api.infrastructure.pointofentry.PointOfEntryReferenceDto) ParseException(java.text.ParseException) SimpleDateFormat(java.text.SimpleDateFormat)

Example 20 with ImportErrorException

use of de.symeda.sormas.api.importexport.ImportErrorException in project SORMAS-Project by hzi-braunschweig.

the class CampaignFormDataImporter method insertImportRowIntoData.

private void insertImportRowIntoData(CampaignFormDataDto campaignFormData, String[] entry, String[] entryHeaderPath) throws InvalidColumnException, ImportErrorException {
    CampaignFormMetaDto campaignMetaDto = FacadeProvider.getCampaignFormMetaFacade().getCampaignFormMetaByUuid(campaignFormMetaUuid);
    campaignFormData.setCampaignFormMeta(new CampaignFormMetaReferenceDto(campaignFormMetaUuid, campaignMetaDto.getFormName()));
    List<String> formDataDtoFields = Stream.of(campaignFormData.getClass().getDeclaredFields()).map(Field::getName).collect(Collectors.toList());
    for (int i = 0; i < entry.length; i++) {
        final String propertyPath = entryHeaderPath[i];
        if (formDataDtoFields.contains(propertyPath)) {
            try {
                PropertyDescriptor propertyDescriptor = new PropertyDescriptor(propertyPath, campaignFormData.getClass());
                Class<?> propertyType = propertyDescriptor.getPropertyType();
                if (!executeDefaultInvoke(propertyDescriptor, campaignFormData, entry[i], new String[] { propertyPath })) {
                    final UserDto currentUserDto = userFacade.getByUuid(currentUser.getUuid());
                    final JurisdictionLevel jurisdictionLevel = UserRole.getJurisdictionLevel(currentUserDto.getUserRoles());
                    if (propertyType.isAssignableFrom(DistrictReferenceDto.class)) {
                        if (jurisdictionLevel == JurisdictionLevel.DISTRICT && !currentUserDto.getDistrict().getCaption().equals(entry[i])) {
                            throw new ImportErrorException(I18nProperties.getValidationError(Validations.importEntryDistrictNotInUsersJurisdiction, entry[i], propertyPath));
                        }
                        List<DistrictReferenceDto> district = FacadeProvider.getDistrictFacade().getByName(entry[i], campaignFormData.getRegion(), true);
                        if (district.isEmpty()) {
                            throw new ImportErrorException(I18nProperties.getValidationError(Validations.importEntryDoesNotExistDbOrRegion, entry[i], propertyPath));
                        } else if (district.size() > 1) {
                            throw new ImportErrorException(I18nProperties.getValidationError(Validations.importDistrictNotUnique, entry[i], propertyPath));
                        } else {
                            propertyDescriptor.getWriteMethod().invoke(campaignFormData, district.get(0));
                        }
                    } else if (propertyType.isAssignableFrom(CommunityReferenceDto.class)) {
                        if (jurisdictionLevel == JurisdictionLevel.COMMUNITY && !currentUserDto.getCommunity().getCaption().equals(entry[i])) {
                            throw new ImportErrorException(I18nProperties.getValidationError(Validations.importEntryCommunityNotInUsersJurisdiction, entry[i], propertyPath));
                        }
                        List<CommunityReferenceDto> community = FacadeProvider.getCommunityFacade().getByName(entry[i], campaignFormData.getDistrict(), true);
                        if (community.isEmpty()) {
                            throw new ImportErrorException(I18nProperties.getValidationError(Validations.importEntryDoesNotExistDbOrDistrict, entry[i], propertyPath));
                        } else if (community.size() > 1) {
                            throw new ImportErrorException(I18nProperties.getValidationError(Validations.importCommunityNotUnique, entry[i], propertyPath));
                        } else {
                            propertyDescriptor.getWriteMethod().invoke(campaignFormData, community.get(0));
                        }
                    }
                }
            } catch (InvocationTargetException | IllegalAccessException e) {
                throw new ImportErrorException(I18nProperties.getValidationError(Validations.importErrorInColumn, propertyPath));
            } catch (IntrospectionException e) {
            // skip unknown fields
            } catch (ImportErrorException e) {
                throw e;
            } catch (Exception e) {
                LOGGER.error("Unexpected error when trying to import campaign form data: " + e.getMessage(), e);
                throw new ImportErrorException(I18nProperties.getValidationError(Validations.importUnexpectedError));
            }
        } else {
            CampaignFormDataEntry formEntry = new CampaignFormDataEntry(propertyPath, entry[i]);
            Optional<CampaignFormElement> existingFormElement = campaignMetaDto.getCampaignFormElements().stream().filter(e -> e.getId().equals(formEntry.getId())).findFirst();
            if (!existingFormElement.isPresent()) {
                // skip unknown fields
                continue;
            } else if (Objects.nonNull(formEntry.getValue()) && StringUtils.isNotBlank(formEntry.getValue().toString()) && !isEntryValid(existingFormElement.get(), formEntry)) {
                throw new ImportErrorException(I18nProperties.getValidationError(Validations.importWrongDataTypeError, entry[i], propertyPath));
            }
            if (formEntry.getValue() == null || StringUtils.isBlank(formEntry.getValue().toString())) {
                continue;
            }
            // Convert yes/no values to true/false
            if (CampaignFormElementType.YES_NO.toString().equals(existingFormElement.get().getType())) {
                String value = formEntry.getValue().toString();
                if ("yes".equalsIgnoreCase(value) || "true".equalsIgnoreCase(value)) {
                    formEntry.setValue(true);
                } else if ("no".equalsIgnoreCase(value) || "false".equalsIgnoreCase(value)) {
                    formEntry.setValue(false);
                }
            }
            if (Objects.nonNull(campaignFormData.getFormValues())) {
                List<CampaignFormDataEntry> currentElementFormValues = campaignFormData.getFormValues();
                currentElementFormValues.add(formEntry);
                campaignFormData.setFormValues(currentElementFormValues);
            } else {
                List<CampaignFormDataEntry> formValues = new LinkedList<>();
                formValues.add(formEntry);
                campaignFormData.setFormValues(formValues);
            }
        }
    }
    ImportLineResultDto<CampaignFormDataDto> constraintErrors = validateConstraints(campaignFormData);
    if (constraintErrors.isError()) {
        throw new ImportErrorException(constraintErrors.getMessage());
    }
}
Also used : Arrays(java.util.Arrays) I18nProperties(de.symeda.sormas.api.i18n.I18nProperties) ValueSeparator(de.symeda.sormas.api.importexport.ValueSeparator) LoggerFactory(org.slf4j.LoggerFactory) UI(com.vaadin.ui.UI) Window(com.vaadin.ui.Window) StringUtils(org.apache.commons.lang3.StringUtils) InvalidColumnException(de.symeda.sormas.api.importexport.InvalidColumnException) ImportLineResult(de.symeda.sormas.ui.importer.ImportLineResult) UserRole(de.symeda.sormas.api.user.UserRole) CampaignFormElementType(de.symeda.sormas.api.campaign.form.CampaignFormElementType) CsvValidationException(com.opencsv.exceptions.CsvValidationException) CampaignFormDataSelectionField(de.symeda.sormas.ui.campaign.campaigndata.CampaignFormDataSelectionField) ImportLineResultDto(de.symeda.sormas.api.importexport.ImportLineResultDto) ImportErrorException(de.symeda.sormas.api.importexport.ImportErrorException) Collectors(java.util.stream.Collectors) IntrospectionException(java.beans.IntrospectionException) InvocationTargetException(java.lang.reflect.InvocationTargetException) CommunityReferenceDto(de.symeda.sormas.api.infrastructure.community.CommunityReferenceDto) Objects(java.util.Objects) List(java.util.List) Stream(java.util.stream.Stream) CampaignFormDataCriteria(de.symeda.sormas.api.campaign.data.CampaignFormDataCriteria) PropertyDescriptor(java.beans.PropertyDescriptor) Optional(java.util.Optional) CampaignFormMetaDto(de.symeda.sormas.api.campaign.form.CampaignFormMetaDto) JurisdictionLevel(de.symeda.sormas.api.user.JurisdictionLevel) RegionReferenceDto(de.symeda.sormas.api.infrastructure.region.RegionReferenceDto) ValidationRuntimeException(de.symeda.sormas.api.utils.ValidationRuntimeException) StreamResource(com.vaadin.server.StreamResource) VaadinUiUtil(de.symeda.sormas.ui.utils.VaadinUiUtil) FacadeProvider(de.symeda.sormas.api.FacadeProvider) CampaignFormElement(de.symeda.sormas.api.campaign.form.CampaignFormElement) CampaignFormDataDto(de.symeda.sormas.api.campaign.data.CampaignFormDataDto) LinkedList(java.util.LinkedList) CampaignFormDataEntry(de.symeda.sormas.api.campaign.data.CampaignFormDataEntry) Logger(org.slf4j.Logger) Validations(de.symeda.sormas.api.i18n.Validations) DistrictReferenceDto(de.symeda.sormas.api.infrastructure.district.DistrictReferenceDto) UserDto(de.symeda.sormas.api.user.UserDto) CampaignReferenceDto(de.symeda.sormas.api.campaign.CampaignReferenceDto) IOException(java.io.IOException) Field(java.lang.reflect.Field) Sizeable(com.vaadin.server.Sizeable) File(java.io.File) UserFacade(de.symeda.sormas.api.user.UserFacade) Consumer(java.util.function.Consumer) NumberUtils(org.apache.commons.lang3.math.NumberUtils) DataImporter(de.symeda.sormas.ui.importer.DataImporter) CampaignFormMetaReferenceDto(de.symeda.sormas.api.campaign.form.CampaignFormMetaReferenceDto) Strings(de.symeda.sormas.api.i18n.Strings) CampaignFormDataDto(de.symeda.sormas.api.campaign.data.CampaignFormDataDto) UserDto(de.symeda.sormas.api.user.UserDto) JurisdictionLevel(de.symeda.sormas.api.user.JurisdictionLevel) IntrospectionException(java.beans.IntrospectionException) CampaignFormElement(de.symeda.sormas.api.campaign.form.CampaignFormElement) CampaignFormMetaReferenceDto(de.symeda.sormas.api.campaign.form.CampaignFormMetaReferenceDto) CommunityReferenceDto(de.symeda.sormas.api.infrastructure.community.CommunityReferenceDto) List(java.util.List) LinkedList(java.util.LinkedList) PropertyDescriptor(java.beans.PropertyDescriptor) ImportErrorException(de.symeda.sormas.api.importexport.ImportErrorException) CampaignFormMetaDto(de.symeda.sormas.api.campaign.form.CampaignFormMetaDto) DistrictReferenceDto(de.symeda.sormas.api.infrastructure.district.DistrictReferenceDto) InvocationTargetException(java.lang.reflect.InvocationTargetException) InvalidColumnException(de.symeda.sormas.api.importexport.InvalidColumnException) CsvValidationException(com.opencsv.exceptions.CsvValidationException) ImportErrorException(de.symeda.sormas.api.importexport.ImportErrorException) IntrospectionException(java.beans.IntrospectionException) InvocationTargetException(java.lang.reflect.InvocationTargetException) ValidationRuntimeException(de.symeda.sormas.api.utils.ValidationRuntimeException) IOException(java.io.IOException) LinkedList(java.util.LinkedList) CampaignFormDataEntry(de.symeda.sormas.api.campaign.data.CampaignFormDataEntry)

Aggregations

ImportErrorException (de.symeda.sormas.api.importexport.ImportErrorException)29 InvalidColumnException (de.symeda.sormas.api.importexport.InvalidColumnException)25 ValidationRuntimeException (de.symeda.sormas.api.utils.ValidationRuntimeException)20 IntrospectionException (java.beans.IntrospectionException)15 InvocationTargetException (java.lang.reflect.InvocationTargetException)15 ArrayList (java.util.ArrayList)14 PropertyDescriptor (java.beans.PropertyDescriptor)11 ParseException (java.text.ParseException)11 List (java.util.List)10 CommunityReferenceDto (de.symeda.sormas.api.infrastructure.community.CommunityReferenceDto)9 DistrictReferenceDto (de.symeda.sormas.api.infrastructure.district.DistrictReferenceDto)9 IOException (java.io.IOException)9 CsvValidationException (com.opencsv.exceptions.CsvValidationException)6 FacilityReferenceDto (de.symeda.sormas.api.infrastructure.facility.FacilityReferenceDto)6 ImportCellData (de.symeda.sormas.api.importexport.ImportCellData)5 PersonDto (de.symeda.sormas.api.person.PersonDto)4 UserDto (de.symeda.sormas.api.user.UserDto)4 DataHelper (de.symeda.sormas.api.utils.DataHelper)4 ImportRelatedObjectsMapper (de.symeda.sormas.api.importexport.ImportRelatedObjectsMapper)3 Date (java.util.Date)3