Search in sources :

Example 1 with EntityDto

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

the class ImmunizationFacadeEjb method linkRecoveryImmunizationToSearchedCase.

@Override
public boolean linkRecoveryImmunizationToSearchedCase(String specificCaseSearchValue, ImmunizationDto immunization) {
    CaseCriteria criteria = new CaseCriteria();
    criteria.setPerson(immunization.getPerson());
    criteria.setDisease(immunization.getDisease());
    criteria.setOutcome(CaseOutcome.RECOVERED);
    String foundCaseUuid = caseFacade.getUuidByUuidEpidNumberOrExternalId(specificCaseSearchValue, criteria);
    if (foundCaseUuid != null) {
        CaseDataDto caseDataDto = caseFacade.getCaseDataByUuid(foundCaseUuid);
        List<String> samples = sampleFacade.getByCaseUuids(Collections.singletonList(caseDataDto.getUuid())).stream().map(EntityDto::getUuid).collect(Collectors.toList());
        List<PathogenTestDto> pathogenTestDto = pathogenTestFacade.getBySampleUuids(samples);
        PathogenTestDto relevantPathogenTest = pathogenTestDto.stream().filter(pathogenTest -> pathogenTest.getTestedDisease().equals(caseDataDto.getDisease()) && PathogenTestResultType.POSITIVE.equals(pathogenTest.getTestResult())).sorted(Comparator.comparing(PathogenTestDto::getTestDateTime)).findFirst().orElse(null);
        immunization.setRelatedCase(new CaseReferenceDto(foundCaseUuid));
        if (relevantPathogenTest != null) {
            Date latestPositiveTestResultDate = relevantPathogenTest.getTestDateTime();
            if (latestPositiveTestResultDate != null) {
                immunization.setPositiveTestResultDate(latestPositiveTestResultDate);
            }
            Date onsetDate = caseDataDto.getSymptoms().getOnsetDate();
            if (onsetDate != null) {
                immunization.setLastInfectionDate(onsetDate);
            }
            Date outcomeDate = caseDataDto.getOutcomeDate();
            if (outcomeDate != null) {
                immunization.setRecoveryDate(outcomeDate);
            }
        }
        this.save(immunization);
        return true;
    }
    return false;
}
Also used : ImmunizationManagementStatus(de.symeda.sormas.api.immunization.ImmunizationManagementStatus) DtoHelper(de.symeda.sormas.backend.util.DtoHelper) Date(java.util.Date) I18nProperties(de.symeda.sormas.api.i18n.I18nProperties) PathogenTestFacadeEjb(de.symeda.sormas.backend.sample.PathogenTestFacadeEjb) LoggerFactory(org.slf4j.LoggerFactory) ImmunizationFacade(de.symeda.sormas.api.immunization.ImmunizationFacade) AbstractCoreAdoService(de.symeda.sormas.backend.common.AbstractCoreAdoService) Immunization(de.symeda.sormas.backend.immunization.entity.Immunization) CommunityFacadeEjb(de.symeda.sormas.backend.infrastructure.community.CommunityFacadeEjb) MeansOfImmunization(de.symeda.sormas.api.immunization.MeansOfImmunization) AccessDeniedException(de.symeda.sormas.api.utils.AccessDeniedException) DistrictService(de.symeda.sormas.backend.infrastructure.district.DistrictService) PersonDto(de.symeda.sormas.api.person.PersonDto) CountryService(de.symeda.sormas.backend.infrastructure.country.CountryService) Valid(javax.validation.Valid) EntityDto(de.symeda.sormas.api.EntityDto) AbstractCoreFacadeEjb(de.symeda.sormas.backend.common.AbstractCoreFacadeEjb) CaseOutcome(de.symeda.sormas.api.caze.CaseOutcome) Page(de.symeda.sormas.api.common.Page) ImmunizationReferenceDto(de.symeda.sormas.api.immunization.ImmunizationReferenceDto) SormasToSormasCaseFacadeEjb(de.symeda.sormas.backend.sormastosormas.entities.caze.SormasToSormasCaseFacadeEjb) UserFacadeEjb(de.symeda.sormas.backend.user.UserFacadeEjb) ImmunizationListEntryDto(de.symeda.sormas.api.immunization.ImmunizationListEntryDto) Vaccination(de.symeda.sormas.backend.vaccination.Vaccination) ImmunizationListCriteria(de.symeda.sormas.api.immunization.ImmunizationListCriteria) SormasToSormasOriginInfoFacadeEjb(de.symeda.sormas.backend.sormastosormas.origin.SormasToSormasOriginInfoFacadeEjb) ManagedScheduledExecutorService(javax.enterprise.concurrent.ManagedScheduledExecutorService) Stateless(javax.ejb.Stateless) CriteriaQuery(javax.persistence.criteria.CriteriaQuery) FacilityService(de.symeda.sormas.backend.infrastructure.facility.FacilityService) CaseService(de.symeda.sormas.backend.caze.CaseService) CountryFacadeEjb(de.symeda.sormas.backend.infrastructure.country.CountryFacadeEjb) CaseCriteria(de.symeda.sormas.api.caze.CaseCriteria) CommunityService(de.symeda.sormas.backend.infrastructure.community.CommunityService) Collection(java.util.Collection) ShareRequestDataType(de.symeda.sormas.api.sormastosormas.sharerequest.ShareRequestDataType) Resource(javax.annotation.Resource) CaseDataDto(de.symeda.sormas.api.caze.CaseDataDto) NotNull(javax.validation.constraints.NotNull) Pseudonymizer(de.symeda.sormas.backend.util.Pseudonymizer) Collectors(java.util.stream.Collectors) Objects(java.util.Objects) ShareTreeCriteria(de.symeda.sormas.api.sormastosormas.ShareTreeCriteria) List(java.util.List) ImmunizationCriteria(de.symeda.sormas.api.immunization.ImmunizationCriteria) UserService(de.symeda.sormas.backend.user.UserService) DistrictFacadeEjb(de.symeda.sormas.backend.infrastructure.district.DistrictFacadeEjb) User(de.symeda.sormas.backend.user.User) PathogenTestResultType(de.symeda.sormas.api.sample.PathogenTestResultType) SormasToSormasContactFacadeEjb(de.symeda.sormas.backend.sormastosormas.entities.contact.SormasToSormasContactFacadeEjb) ImmunizationDto(de.symeda.sormas.api.immunization.ImmunizationDto) ShareRequestInfo(de.symeda.sormas.backend.sormastosormas.share.shareinfo.ShareRequestInfo) ValidationRuntimeException(de.symeda.sormas.api.utils.ValidationRuntimeException) PersonReferenceDto(de.symeda.sormas.api.person.PersonReferenceDto) DateHelper(de.symeda.sormas.api.utils.DateHelper) FacilityFacadeEjb(de.symeda.sormas.backend.infrastructure.facility.FacilityFacadeEjb) CaseFacadeEjb(de.symeda.sormas.backend.caze.CaseFacadeEjb) CoreEntityType(de.symeda.sormas.backend.deletionconfiguration.CoreEntityType) ArrayList(java.util.ArrayList) CaseReferenceDto(de.symeda.sormas.api.caze.CaseReferenceDto) Inject(javax.inject.Inject) LocalBean(javax.ejb.LocalBean) SampleFacadeEjb(de.symeda.sormas.backend.sample.SampleFacadeEjb) VaccinationFacadeEjbLocal(de.symeda.sormas.backend.vaccination.VaccinationFacadeEjb.VaccinationFacadeEjbLocal) PathogenTestDto(de.symeda.sormas.api.sample.PathogenTestDto) EJB(javax.ejb.EJB) Root(javax.persistence.criteria.Root) Logger(org.slf4j.Logger) Validations(de.symeda.sormas.api.i18n.Validations) DataHelper(de.symeda.sormas.api.utils.DataHelper) PersonFacadeEjb(de.symeda.sormas.backend.person.PersonFacadeEjb) SormasToSormasFacadeEjb(de.symeda.sormas.backend.sormastosormas.SormasToSormasFacadeEjb) ImmunizationIndexDto(de.symeda.sormas.api.immunization.ImmunizationIndexDto) PersonService(de.symeda.sormas.backend.person.PersonService) SortProperty(de.symeda.sormas.api.utils.SortProperty) RegionFacadeEjb(de.symeda.sormas.backend.infrastructure.region.RegionFacadeEjb) RegionService(de.symeda.sormas.backend.infrastructure.region.RegionService) Captions(de.symeda.sormas.api.i18n.Captions) TimeUnit(java.util.concurrent.TimeUnit) UserRight(de.symeda.sormas.api.user.UserRight) VaccinationDto(de.symeda.sormas.api.vaccination.VaccinationDto) ImmunizationSimilarityCriteria(de.symeda.sormas.api.immunization.ImmunizationSimilarityCriteria) ImmunizationStatus(de.symeda.sormas.api.immunization.ImmunizationStatus) ShareInfoHelper(de.symeda.sormas.backend.sormastosormas.share.shareinfo.ShareInfoHelper) Comparator(java.util.Comparator) Strings(de.symeda.sormas.api.i18n.Strings) Collections(java.util.Collections) SormasToSormasEventFacadeEjb(de.symeda.sormas.backend.sormastosormas.entities.event.SormasToSormasEventFacadeEjb) CaseDataDto(de.symeda.sormas.api.caze.CaseDataDto) CaseCriteria(de.symeda.sormas.api.caze.CaseCriteria) PathogenTestDto(de.symeda.sormas.api.sample.PathogenTestDto) CaseReferenceDto(de.symeda.sormas.api.caze.CaseReferenceDto) Date(java.util.Date)

Example 2 with EntityDto

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

the class DataHelperTest method testShortUuid.

@Test
public void testShortUuid() {
    EntityDto entityDto = new EntityDto() {
    };
    entityDto.setUuid("ABCDEF-GHIJKL");
    assertEquals("ABCDEF", DataHelper.getShortUuid(entityDto));
    ReferenceDto referenceDto = new ReferenceDto() {
    };
    referenceDto.setUuid("MNOPQR-STUVWX");
    assertEquals("MNOPQR", DataHelper.getShortUuid(referenceDto));
    assertEquals("UZOUEH", DataHelper.getShortUuid("UZOUEH-HP7DRG-YOJ74F-PXWL2JZ4"));
    assertNull(DataHelper.getShortUuid((String) null));
    boolean exceptionThrown = false;
    try {
        assertEquals("A", DataHelper.getShortUuid("A"));
        fail("getShortUuid should not be graceful on Uuids that are too short.");
    } catch (StringIndexOutOfBoundsException e) {
        exceptionThrown = true;
    }
    assertTrue("getShortUuid should throw StringIndexOutOfBoundsException on Uuids that are too short.", exceptionThrown);
}
Also used : EntityDto(de.symeda.sormas.api.EntityDto) ReferenceDto(de.symeda.sormas.api.ReferenceDto) RegionReferenceDto(de.symeda.sormas.api.infrastructure.region.RegionReferenceDto) Test(org.junit.Test)

Example 3 with EntityDto

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

the class SizeGenerator method getSizeOfFilledDto.

private static void getSizeOfFilledDto(PodamFactory factory, Class<? extends EntityDto> dtoClass) throws JsonProcessingException {
    final EntityDto dto = factory.manufacturePojo(dtoClass);
    Assert.assertNotNull(dto);
    final ObjectMapper objectMapper = new ObjectMapper();
    final String json = objectMapper.writeValueAsString(dto);
    System.out.println(dtoClass.getSimpleName() + " JSON (UTF-8) size: " + Utf8.encodedLength(json));
}
Also used : EntityDto(de.symeda.sormas.api.EntityDto) ObjectMapper(com.fasterxml.jackson.databind.ObjectMapper)

Example 4 with EntityDto

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

the class InfoFacadeEjb method createEntitySheet.

private void createEntitySheet(XSSFWorkbook workbook, Class<? extends EntityDto> entityClass, String i18nPrefix, EnumSet<EntityColumn> entityColumns, List<ColumnData> extraColumns, Map<String, List<XSSFCell>> extraCells) {
    String name = I18nProperties.getCaption(i18nPrefix);
    String safeName = WorkbookUtil.createSafeSheetName(name);
    XSSFSheet sheet = workbook.createSheet(safeName);
    int columnCount = entityColumns.size() + extraColumns.size();
    int rowNumber = 0;
    // header
    XSSFRow headerRow = sheet.createRow(rowNumber++);
    entityColumns.forEach(column -> {
        int colIndex = Math.max(headerRow.getLastCellNum(), 0);
        headerRow.createCell(colIndex).setCellValue(column.toString());
        sheet.setColumnWidth(colIndex, column.getWidth());
    });
    extraColumns.forEach(c -> {
        short colIndex = headerRow.getLastCellNum();
        headerRow.createCell(colIndex).setCellValue(c.header);
        sheet.setColumnWidth(colIndex, c.width);
    });
    CellStyle defaultCellStyle = workbook.createCellStyle();
    defaultCellStyle.setWrapText(true);
    List<Class<Enum<?>>> usedEnums = new ArrayList<>();
    boolean usesFacilityReference = false;
    for (Field field : entityClass.getDeclaredFields()) {
        if (java.lang.reflect.Modifier.isStatic(field.getModifiers()))
            continue;
        FieldData fieldData = new FieldData(field, entityClass, i18nPrefix);
        XSSFRow row = sheet.createRow(rowNumber++);
        for (EntityColumn c : entityColumns) {
            XSSFCell newCell = row.createCell(Math.max(row.getLastCellNum(), 0));
            String fieldValue = c.getGetValueFromField(fieldData);
            if (fieldValue != null) {
                newCell.setCellValue(fieldValue);
            }
            if (c.hasDefaultStyle()) {
                newCell.setCellStyle(defaultCellStyle);
            }
            Class<?> fieldType = field.getType();
            if (fieldType.isEnum()) {
                if (!usedEnums.contains(fieldType)) {
                    @SuppressWarnings("unchecked") Class<Enum<?>> enumType = (Class<Enum<?>>) fieldType;
                    usedEnums.add(enumType);
                }
            } else if (Map.class.isAssignableFrom(fieldType)) {
                getEnumGenericsOf(field, Map.class).filter(e -> !usedEnums.contains(e)).collect(Collectors.toCollection(() -> usedEnums));
            } else if (Collection.class.isAssignableFrom(fieldType)) {
                getEnumGenericsOf(field, Collection.class).filter(e -> !usedEnums.contains(e)).collect(Collectors.toCollection(() -> usedEnums));
            } else if (FacilityReferenceDto.class.isAssignableFrom(fieldType)) {
                usesFacilityReference = true;
            }
        }
        String fieldId = EntityColumn.FIELD_ID.getGetValueFromField(fieldData);
        if (extraCells.containsKey(fieldId)) {
            extraCells.get(fieldId).forEach((extraCell) -> {
                XSSFCell newCell = row.createCell(row.getLastCellNum());
                if (extraCell != null) {
                    newCell.copyCellFrom(extraCell, new CellCopyPolicy.Builder().cellValue(true).cellStyle(false).cellFormula(false).build());
                }
            });
        }
    }
    // Configure table
    AreaReference reference = workbook.getCreationHelper().createAreaReference(new CellReference(0, 0), new CellReference(rowNumber - 1, columnCount - 1));
    XssfHelper.configureTable(reference, getSafeTableName(safeName), sheet, XssfHelper.TABLE_STYLE_PRIMARY);
    // constant facilities
    if (usesFacilityReference) {
        rowNumber = createFacilityTable(sheet, rowNumber + 1, defaultCellStyle);
    }
    // enums
    for (Class<Enum<?>> usedEnum : usedEnums) {
        rowNumber = createEnumTable(sheet, rowNumber + 1, usedEnum);
    }
}
Also used : Arrays(java.util.Arrays) CountryDto(de.symeda.sormas.api.infrastructure.country.CountryDto) Date(java.util.Date) I18nProperties(de.symeda.sormas.api.i18n.I18nProperties) EventParticipantDto(de.symeda.sormas.api.event.EventParticipantDto) Random(java.util.Random) PersonDto(de.symeda.sormas.api.person.PersonDto) XSSFWorkbook(org.apache.poi.xssf.usermodel.XSSFWorkbook) EntityDto(de.symeda.sormas.api.EntityDto) CommunityDto(de.symeda.sormas.api.infrastructure.community.CommunityDto) Map(java.util.Map) CellCopyPolicy(org.apache.poi.ss.usermodel.CellCopyPolicy) Path(java.nio.file.Path) SubcontinentDto(de.symeda.sormas.api.infrastructure.subcontinent.SubcontinentDto) EnumSet(java.util.EnumSet) PointOfEntryDto(de.symeda.sormas.api.infrastructure.pointofentry.PointOfEntryDto) PrescriptionDto(de.symeda.sormas.api.therapy.PrescriptionDto) Stateless(javax.ejb.Stateless) TaskDto(de.symeda.sormas.api.task.TaskDto) InvalidFormatException(org.apache.poi.openxml4j.exceptions.InvalidFormatException) WorkbookUtil(org.apache.poi.ss.util.WorkbookUtil) Collection(java.util.Collection) CaseDataDto(de.symeda.sormas.api.caze.CaseDataDto) EventDto(de.symeda.sormas.api.event.EventDto) Collectors(java.util.stream.Collectors) XssfHelper(de.symeda.sormas.backend.util.XssfHelper) List(java.util.List) Stream(java.util.stream.Stream) AreaReference(org.apache.poi.ss.util.AreaReference) SpreadsheetVersion(org.apache.poi.ss.SpreadsheetVersion) EpiDataDto(de.symeda.sormas.api.epidata.EpiDataDto) ContactDto(de.symeda.sormas.api.contact.ContactDto) DistrictDto(de.symeda.sormas.api.infrastructure.district.DistrictDto) ActivityAsCaseDto(de.symeda.sormas.api.activityascase.ActivityAsCaseDto) ImmunizationDto(de.symeda.sormas.api.immunization.ImmunizationDto) CellStyle(org.apache.poi.ss.usermodel.CellStyle) TestReportDto(de.symeda.sormas.api.labmessage.TestReportDto) FacilityDto(de.symeda.sormas.api.infrastructure.facility.FacilityDto) HealthConditionsDto(de.symeda.sormas.api.clinicalcourse.HealthConditionsDto) InfoFacade(de.symeda.sormas.api.info.InfoFacade) DateHelper(de.symeda.sormas.api.utils.DateHelper) RegionDto(de.symeda.sormas.api.infrastructure.region.RegionDto) HashMap(java.util.HashMap) AdditionalTestDto(de.symeda.sormas.api.sample.AdditionalTestDto) PersonContactDetailDto(de.symeda.sormas.api.person.PersonContactDetailDto) SurveillanceReportDto(de.symeda.sormas.api.caze.surveillancereport.SurveillanceReportDto) ArrayList(java.util.ArrayList) CellReference(org.apache.poi.ss.util.CellReference) XSSFRow(org.apache.poi.xssf.usermodel.XSSFRow) LocalBean(javax.ejb.LocalBean) PreviousHospitalizationDto(de.symeda.sormas.api.hospitalization.PreviousHospitalizationDto) ContinentDto(de.symeda.sormas.api.infrastructure.continent.ContinentDto) SymptomsDto(de.symeda.sormas.api.symptoms.SymptomsDto) PathogenTestDto(de.symeda.sormas.api.sample.PathogenTestDto) ConfigFacadeEjbLocal(de.symeda.sormas.backend.common.ConfigFacadeEjb.ConfigFacadeEjbLocal) EJB(javax.ejb.EJB) ClinicalVisitDto(de.symeda.sormas.api.clinicalcourse.ClinicalVisitDto) OutputStream(java.io.OutputStream) LocationDto(de.symeda.sormas.api.location.LocationDto) TypeUtils(org.apache.commons.lang3.reflect.TypeUtils) DataHelper(de.symeda.sormas.api.utils.DataHelper) Files(java.nio.file.Files) UserDto(de.symeda.sormas.api.user.UserDto) LabMessageDto(de.symeda.sormas.api.labmessage.LabMessageDto) IOException(java.io.IOException) Field(java.lang.reflect.Field) FacilityReferenceDto(de.symeda.sormas.api.infrastructure.facility.FacilityReferenceDto) File(java.io.File) ExposureDto(de.symeda.sormas.api.exposure.ExposureDto) VisitDto(de.symeda.sormas.api.visit.VisitDto) ImportExportUtils(de.symeda.sormas.api.importexport.ImportExportUtils) SampleDto(de.symeda.sormas.api.sample.SampleDto) TravelEntryDto(de.symeda.sormas.api.travelentry.TravelEntryDto) VaccinationDto(de.symeda.sormas.api.vaccination.VaccinationDto) Paths(java.nio.file.Paths) XSSFSheet(org.apache.poi.xssf.usermodel.XSSFSheet) HospitalizationDto(de.symeda.sormas.api.hospitalization.HospitalizationDto) XSSFCell(org.apache.poi.xssf.usermodel.XSSFCell) Collections(java.util.Collections) ActionDto(de.symeda.sormas.api.action.ActionDto) TreatmentDto(de.symeda.sormas.api.therapy.TreatmentDto) FacilityReferenceDto(de.symeda.sormas.api.infrastructure.facility.FacilityReferenceDto) ArrayList(java.util.ArrayList) CellReference(org.apache.poi.ss.util.CellReference) Field(java.lang.reflect.Field) XSSFSheet(org.apache.poi.xssf.usermodel.XSSFSheet) XSSFRow(org.apache.poi.xssf.usermodel.XSSFRow) CellCopyPolicy(org.apache.poi.ss.usermodel.CellCopyPolicy) AreaReference(org.apache.poi.ss.util.AreaReference) XSSFCell(org.apache.poi.xssf.usermodel.XSSFCell) CellStyle(org.apache.poi.ss.usermodel.CellStyle) Map(java.util.Map) HashMap(java.util.HashMap)

Example 5 with EntityDto

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

the class ImportFacadeEjb method appendListOfFields.

/**
 * Builds a list of all fields in the case and its relevant sub entities. IMPORTANT: The order
 * is not guaranteed; at the time of writing, clazz.getDeclaredFields() seems to return the
 * fields in the order of declaration (which is what we need here), but that could change
 * in the future.
 */
private void appendListOfFields(List<ImportColumn> importColumns, Class<?> clazz, String prefix, char separator) {
    for (Field field : clazz.getDeclaredFields()) {
        if (Modifier.isStatic(field.getModifiers())) {
            continue;
        }
        String currentCountry = configFacade.getCountryCode();
        CountryFieldVisibilityChecker visibilityChecker = new CountryFieldVisibilityChecker(currentCountry);
        if (!visibilityChecker.isVisible(field)) {
            continue;
        }
        Method readMethod;
        try {
            readMethod = clazz.getDeclaredMethod("get" + WordUtils.capitalize(field.getName()));
        } catch (NoSuchMethodException e) {
            try {
                readMethod = clazz.getDeclaredMethod("is" + WordUtils.capitalize(field.getName()));
            } catch (NoSuchMethodException f) {
                continue;
            }
        }
        // Fields without a getter or whose getters are declared in a superclass are ignored
        if (readMethod.getDeclaringClass() != clazz) {
            continue;
        }
        // Fields with the @ImportIgnore annotation are ignored
        if (readMethod.isAnnotationPresent(ImportIgnore.class)) {
            continue;
        }
        // Fields that are depending on a certain feature type to be active may be ignored
        if (readMethod.isAnnotationPresent(DependingOnFeatureType.class)) {
            List<FeatureType> activeServerFeatures = featureConfigurationFacade.getActiveServerFeatureTypes();
            if (!activeServerFeatures.isEmpty() && !activeServerFeatures.contains(readMethod.getAnnotation(DependingOnFeatureType.class).featureType())) {
                continue;
            }
        }
        // List types are ignored
        if (Collection.class.isAssignableFrom(field.getType())) {
            continue;
        }
        // Certain field types are ignored
        if (field.getType() == UserReferenceDto.class) {
            continue;
        }
        // Other non-infrastructure EntityDto/ReferenceDto classes, recursively call this method to include fields of the sub-entity
        if (EntityDto.class.isAssignableFrom(field.getType()) && !isInfrastructureClass(field.getType())) {
            appendListOfFields(importColumns, field.getType(), StringUtils.isEmpty(prefix) ? field.getName() + "." : prefix + field.getName() + ".", separator);
        } else if (PersonReferenceDto.class.isAssignableFrom(field.getType()) && !isInfrastructureClass(field.getType())) {
            appendListOfFields(importColumns, PersonDto.class, StringUtils.isEmpty(prefix) ? field.getName() + "." : prefix + field.getName() + ".", separator);
            addPrimaryPhoneAndEmail(separator, importColumns);
        } else {
            importColumns.add(ImportColumn.from(clazz, prefix + field.getName(), field.getType(), separator));
        }
    }
}
Also used : Field(java.lang.reflect.Field) FeatureType(de.symeda.sormas.api.feature.FeatureType) DependingOnFeatureType(de.symeda.sormas.api.utils.DependingOnFeatureType) EntityDto(de.symeda.sormas.api.EntityDto) CountryFieldVisibilityChecker(de.symeda.sormas.api.utils.fieldvisibility.checkers.CountryFieldVisibilityChecker) PersonDto(de.symeda.sormas.api.person.PersonDto) Method(java.lang.reflect.Method)

Aggregations

EntityDto (de.symeda.sormas.api.EntityDto)11 CaseDataDto (de.symeda.sormas.api.caze.CaseDataDto)3 I18nProperties (de.symeda.sormas.api.i18n.I18nProperties)3 PersonDto (de.symeda.sormas.api.person.PersonDto)3 UserDto (de.symeda.sormas.api.user.UserDto)3 DataHelper (de.symeda.sormas.api.utils.DataHelper)3 ValidationRuntimeException (de.symeda.sormas.api.utils.ValidationRuntimeException)3 VaccinationDto (de.symeda.sormas.api.vaccination.VaccinationDto)3 InvocationTargetException (java.lang.reflect.InvocationTargetException)3 ReferenceDto (de.symeda.sormas.api.ReferenceDto)2 ImportErrorException (de.symeda.sormas.api.importexport.ImportErrorException)2 InvalidColumnException (de.symeda.sormas.api.importexport.InvalidColumnException)2 CommunityDto (de.symeda.sormas.api.infrastructure.community.CommunityDto)2 FacilityDto (de.symeda.sormas.api.infrastructure.facility.FacilityDto)2 PointOfEntryDto (de.symeda.sormas.api.infrastructure.pointofentry.PointOfEntryDto)2 IntrospectionException (java.beans.IntrospectionException)2 PropertyDescriptor (java.beans.PropertyDescriptor)2 IOException (java.io.IOException)2 Field (java.lang.reflect.Field)2 Method (java.lang.reflect.Method)2