Search in sources :

Example 1 with EpiDataDto

use of de.symeda.sormas.api.epidata.EpiDataDto 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 2 with EpiDataDto

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

the class CaseFacadeEjbTest method testMergeCase.

@Test
public void testMergeCase() throws IOException {
    useNationalUserLogin();
    // 1. Create
    // Create leadCase
    UserDto leadUser = creator.createUser("", "", "", "First", "User");
    UserReferenceDto leadUserReference = new UserReferenceDto(leadUser.getUuid());
    PersonDto leadPerson = creator.createPerson("Alex", "Miller");
    PersonReferenceDto leadPersonReference = new PersonReferenceDto(leadPerson.getUuid());
    RDCF leadRdcf = creator.createRDCF();
    CaseDataDto leadCase = creator.createCase(leadUserReference, leadPersonReference, Disease.DENGUE, CaseClassification.SUSPECT, InvestigationStatus.PENDING, new Date(), leadRdcf, (c) -> {
        c.setAdditionalDetails("Test additional details");
        c.setFollowUpComment("Test followup comment");
    });
    leadCase.setClinicianEmail("mail");
    leadCase.getEpiData().setActivityAsCaseDetailsKnown(YesNoUnknown.NO);
    getCaseFacade().save(leadCase);
    VisitDto leadVisit = creator.createVisit(leadCase.getDisease(), leadCase.getPerson(), leadCase.getReportDate());
    leadVisit.getSymptoms().setAnorexiaAppetiteLoss(SymptomState.YES);
    getVisitFacade().saveVisit(leadVisit);
    // Create otherCase
    UserDto otherUser = creator.createUser("", "", "", "Second", "User");
    UserReferenceDto otherUserReference = new UserReferenceDto(otherUser.getUuid());
    PersonDto otherPerson = creator.createPerson("Max", "Smith");
    otherPerson.setBirthWeight(2);
    getPersonFacade().savePerson(otherPerson);
    PersonReferenceDto otherPersonReference = new PersonReferenceDto(otherPerson.getUuid());
    RDCF otherRdcf = creator.createRDCF("Reg2", "Dis2", "Comm2", "Fac2", "Poe2");
    CaseDataDto otherCase = creator.createCase(otherUserReference, otherPersonReference, Disease.CHOLERA, CaseClassification.SUSPECT, InvestigationStatus.PENDING, new Date(), otherRdcf, (c) -> {
        c.setAdditionalDetails("Test other additional details");
        c.setFollowUpComment("Test other followup comment");
    });
    otherCase.setClinicianName("name");
    CaseReferenceDto otherCaseReference = getCaseFacade().getReferenceByUuid(otherCase.getUuid());
    ContactDto contact = creator.createContact(otherUserReference, otherUserReference, otherPersonReference, otherCase, new Date(), new Date(), null);
    Region region = creator.createRegion("");
    District district = creator.createDistrict("", region);
    SampleDto sample = creator.createSample(otherCaseReference, otherUserReference, creator.createFacility("", region, district, creator.createCommunity("", district)));
    TaskDto task = creator.createTask(TaskContext.CASE, TaskType.CASE_INVESTIGATION, TaskStatus.PENDING, otherCaseReference, new ContactReferenceDto(), new EventReferenceDto(), new Date(), otherUserReference);
    TreatmentDto treatment = creator.createTreatment(otherCase);
    PrescriptionDto prescription = creator.createPrescription(otherCase);
    ClinicalVisitDto visit = creator.createClinicalVisit(otherCase);
    otherCase.getEpiData().setActivityAsCaseDetailsKnown(YesNoUnknown.YES);
    final ArrayList<ActivityAsCaseDto> otherActivitiesAsCase = new ArrayList<>();
    ActivityAsCaseDto activityAsCaseDto = new ActivityAsCaseDto();
    activityAsCaseDto.setActivityAsCaseType(ActivityAsCaseType.GATHERING);
    otherActivitiesAsCase.add(activityAsCaseDto);
    otherCase.getEpiData().setActivitiesAsCase(otherActivitiesAsCase);
    getCaseFacade().save(otherCase);
    VisitDto otherVisit = creator.createVisit(otherCase.getDisease(), otherCase.getPerson(), otherCase.getReportDate());
    otherVisit.getSymptoms().setAbdominalPain(SymptomState.YES);
    getVisitFacade().saveVisit(otherVisit);
    EventDto event = creator.createEvent(otherUserReference);
    event.setDisease(otherCase.getDisease());
    getEventFacade().save(event);
    EventParticipantDto otherCaseEventParticipant = creator.createEventParticipant(event.toReference(), otherPerson, otherUserReference);
    otherCaseEventParticipant.setResultingCase(otherCaseReference);
    getEventParticipantFacade().saveEventParticipant(otherCaseEventParticipant);
    creator.createSurveillanceReport(otherUserReference, otherCaseReference);
    TravelEntryDto travelEntry = creator.createTravelEntry(otherPersonReference, otherUserReference, otherCase.getDisease(), otherRdcf.region, otherRdcf.district, otherRdcf.pointOfEntry);
    travelEntry.setResultingCase(otherCaseReference);
    travelEntry = getTravelEntryFacade().save(travelEntry);
    DocumentDto document = creator.createDocument(leadUserReference, "document.pdf", "application/pdf", 42L, DocumentRelatedEntityType.CASE, leadCase.getUuid(), "content".getBytes(StandardCharsets.UTF_8));
    DocumentDto otherDocument = creator.createDocument(leadUserReference, "other_document.pdf", "application/pdf", 42L, DocumentRelatedEntityType.CASE, otherCase.getUuid(), "other content".getBytes(StandardCharsets.UTF_8));
    // 2. Merge
    getCaseFacade().mergeCase(leadCase.getUuid(), otherCase.getUuid());
    // 3. Test
    CaseDataDto mergedCase = getCaseFacade().getCaseDataByUuid(leadCase.getUuid());
    // Check no values
    assertNull(mergedCase.getClassificationComment());
    // Check 'lead and other have different values'
    assertEquals(leadCase.getDisease(), mergedCase.getDisease());
    // Check 'lead has value, other has not'
    assertEquals(leadCase.getClinicianEmail(), mergedCase.getClinicianEmail());
    // Check 'lead has no value, other has'
    assertEquals(otherCase.getClinicianName(), mergedCase.getClinicianName());
    PersonDto mergedPerson = getPersonFacade().getPersonByUuid(mergedCase.getPerson().getUuid());
    // Check no values
    assertNull(mergedPerson.getBirthdateDD());
    // Check 'lead and other have different values'
    assertEquals(leadCase.getPerson().getFirstName(), mergedPerson.getFirstName());
    // Check 'lead has value, other has not'
    assertEquals(leadCase.getPerson().getLastName(), mergedPerson.getLastName());
    // Check 'lead has no value, other has'
    assertEquals(otherPerson.getBirthWeight(), mergedPerson.getBirthWeight());
    // Check merge comments
    assertEquals("Test additional details Test other additional details", mergedCase.getAdditionalDetails());
    assertEquals("Test followup comment Test other followup comment", mergedCase.getFollowUpComment());
    // 4. Test Reference Changes
    // 4.1 Contacts
    List<String> contactUuids = new ArrayList<>();
    contactUuids.add(contact.getUuid());
    assertEquals(leadCase.getUuid(), getContactFacade().getByUuids(contactUuids).get(0).getCaze().getUuid());
    // 4.2 Samples
    List<String> sampleUuids = new ArrayList<>();
    sampleUuids.add(sample.getUuid());
    assertEquals(leadCase.getUuid(), getSampleFacade().getByUuids(sampleUuids).get(0).getAssociatedCase().getUuid());
    // 4.3 Tasks
    List<String> taskUuids = new ArrayList<>();
    taskUuids.add(task.getUuid());
    assertEquals(leadCase.getUuid(), getTaskFacade().getByUuids(taskUuids).get(0).getCaze().getUuid());
    // 4.4 Treatments
    List<String> treatmentUuids = new ArrayList<>();
    treatmentUuids.add(treatment.getUuid());
    assertEquals(leadCase.getTherapy().getUuid(), getTreatmentFacade().getByUuids(treatmentUuids).get(0).getTherapy().getUuid());
    // 4.5 Prescriptions
    List<String> prescriptionUuids = new ArrayList<>();
    prescriptionUuids.add(prescription.getUuid());
    assertEquals(leadCase.getTherapy().getUuid(), getPrescriptionFacade().getByUuids(prescriptionUuids).get(0).getTherapy().getUuid());
    // 4.6 Clinical Visits
    List<String> visitUuids = new ArrayList<>();
    visitUuids.add(visit.getUuid());
    assertEquals(leadCase.getClinicalCourse().getUuid(), getClinicalVisitFacade().getByUuids(visitUuids).get(0).getClinicalCourse().getUuid());
    // 4.7 Visits;
    List<String> mergedVisits = getVisitFacade().getIndexList(new VisitCriteria().caze(mergedCase.toReference()), null, null, null).stream().map(VisitIndexDto::getUuid).collect(Collectors.toList());
    assertEquals(2, mergedVisits.size());
    assertTrue(mergedVisits.contains(leadVisit.getUuid()));
    assertTrue(mergedVisits.contains(otherVisit.getUuid()));
    // and symptoms
    assertEquals(SymptomState.YES, mergedCase.getSymptoms().getAbdominalPain());
    assertEquals(SymptomState.YES, mergedCase.getSymptoms().getAnorexiaAppetiteLoss());
    assertTrue(mergedCase.getSymptoms().getSymptomatic());
    // 4.8 Linked Events
    assertEquals(1, getEventFacade().count(new EventCriteria().caze(mergedCase.toReference())));
    // 4.8 Linked Surveillance Reports
    List<SurveillanceReportDto> surveillanceReportList = getSurveillanceReportFacade().getByCaseUuids(Collections.singletonList(mergedCase.getUuid()));
    MatcherAssert.assertThat(surveillanceReportList, hasSize(1));
    // 5 Documents
    List<DocumentDto> mergedDocuments = getDocumentFacade().getDocumentsRelatedToEntity(DocumentRelatedEntityType.CASE, leadCase.getUuid());
    assertEquals(2, mergedDocuments.size());
    List<String> documentUuids = mergedDocuments.stream().map(DocumentDto::getUuid).collect(Collectors.toList());
    assertTrue(documentUuids.contains(document.getUuid()));
    assertTrue(documentUuids.contains(otherDocument.getUuid()));
    // 10 Activities as case
    final EpiDataDto epiData = mergedCase.getEpiData();
    assertEquals(YesNoUnknown.YES, epiData.getActivityAsCaseDetailsKnown());
    final List<ActivityAsCaseDto> activitiesAsCase = epiData.getActivitiesAsCase();
    assertEquals(1, activitiesAsCase.size());
    assertEquals(ActivityAsCaseType.GATHERING, activitiesAsCase.get(0).getActivityAsCaseType());
    // Travel entry
    travelEntry = getTravelEntryFacade().getByUuid(travelEntry.getUuid());
    assertEquals(mergedCase.toReference(), travelEntry.getResultingCase());
}
Also used : UserDto(de.symeda.sormas.api.user.UserDto) PersonReferenceDto(de.symeda.sormas.api.person.PersonReferenceDto) ArrayList(java.util.ArrayList) Matchers.isEmptyOrNullString(org.hamcrest.Matchers.isEmptyOrNullString) EventCriteria(de.symeda.sormas.api.event.EventCriteria) TreatmentDto(de.symeda.sormas.api.therapy.TreatmentDto) ActivityAsCaseDto(de.symeda.sormas.api.activityascase.ActivityAsCaseDto) ContactDto(de.symeda.sormas.api.contact.ContactDto) PrescriptionDto(de.symeda.sormas.api.therapy.PrescriptionDto) VisitCriteria(de.symeda.sormas.api.visit.VisitCriteria) EpiDataDto(de.symeda.sormas.api.epidata.EpiDataDto) CaseDataDto(de.symeda.sormas.api.caze.CaseDataDto) CasePersonDto(de.symeda.sormas.api.caze.CasePersonDto) PersonDto(de.symeda.sormas.api.person.PersonDto) TravelEntryDto(de.symeda.sormas.api.travelentry.TravelEntryDto) EventDto(de.symeda.sormas.api.event.EventDto) EventParticipantDto(de.symeda.sormas.api.event.EventParticipantDto) TaskDto(de.symeda.sormas.api.task.TaskDto) Date(java.util.Date) LocalDate(java.time.LocalDate) UserReferenceDto(de.symeda.sormas.api.user.UserReferenceDto) RDCF(de.symeda.sormas.backend.TestDataCreator.RDCF) EventReferenceDto(de.symeda.sormas.api.event.EventReferenceDto) ClinicalVisitDto(de.symeda.sormas.api.clinicalcourse.ClinicalVisitDto) ContactReferenceDto(de.symeda.sormas.api.contact.ContactReferenceDto) DocumentDto(de.symeda.sormas.api.document.DocumentDto) Region(de.symeda.sormas.backend.infrastructure.region.Region) ClinicalVisitDto(de.symeda.sormas.api.clinicalcourse.ClinicalVisitDto) VisitDto(de.symeda.sormas.api.visit.VisitDto) SurveillanceReportDto(de.symeda.sormas.api.caze.surveillancereport.SurveillanceReportDto) District(de.symeda.sormas.backend.infrastructure.district.District) SampleDto(de.symeda.sormas.api.sample.SampleDto) CaseReferenceDto(de.symeda.sormas.api.caze.CaseReferenceDto) AbstractBeanTest(de.symeda.sormas.backend.AbstractBeanTest) Test(org.junit.Test)

Example 3 with EpiDataDto

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

the class CaseFacadeEjbTest method testCloneCaseActivityAsCaseIsCloned.

@Test
public void testCloneCaseActivityAsCaseIsCloned() {
    useNationalUserLogin();
    // 1. Create
    // Create aCase
    UserDto user = creator.createUser("", "", "", "", "");
    UserReferenceDto userReferenceDto = new UserReferenceDto(user.getUuid());
    PersonDto person = creator.createPerson("Max", "Smith");
    person.setBirthWeight(2);
    getPersonFacade().savePerson(person);
    PersonReferenceDto personReferenceDto = new PersonReferenceDto(person.getUuid());
    RDCF rdcf = creator.createRDCF();
    CaseDataDto aCase = creator.createCase(userReferenceDto, personReferenceDto, Disease.CHOLERA, CaseClassification.SUSPECT, InvestigationStatus.PENDING, new Date(), rdcf, (c) -> {
        c.setAdditionalDetails("Test other additional details");
        c.setFollowUpComment("Test other followup comment");
    });
    aCase.setClinicianName("name");
    aCase.getEpiData().setActivityAsCaseDetailsKnown(YesNoUnknown.YES);
    final ArrayList<ActivityAsCaseDto> otherActivitiesAsCase = new ArrayList<>();
    ActivityAsCaseDto activityAsCaseDto = new ActivityAsCaseDto();
    activityAsCaseDto.setActivityAsCaseType(ActivityAsCaseType.GATHERING);
    otherActivitiesAsCase.add(activityAsCaseDto);
    aCase.getEpiData().setActivitiesAsCase(otherActivitiesAsCase);
    CaseDataDto caseDataDto = getCaseFacade().save(aCase);
    // 2. Clone
    CaseDataDto clonedCase = getCaseFacade().cloneCase(caseDataDto);
    final EpiDataDto epiData = clonedCase.getEpiData();
    assertEquals(YesNoUnknown.YES, epiData.getActivityAsCaseDetailsKnown());
    final List<ActivityAsCaseDto> activitiesAsCase = epiData.getActivitiesAsCase();
    assertEquals(1, activitiesAsCase.size());
    assertEquals(ActivityAsCaseType.GATHERING, activitiesAsCase.get(0).getActivityAsCaseType());
}
Also used : UserReferenceDto(de.symeda.sormas.api.user.UserReferenceDto) EpiDataDto(de.symeda.sormas.api.epidata.EpiDataDto) RDCF(de.symeda.sormas.backend.TestDataCreator.RDCF) CaseDataDto(de.symeda.sormas.api.caze.CaseDataDto) CasePersonDto(de.symeda.sormas.api.caze.CasePersonDto) PersonDto(de.symeda.sormas.api.person.PersonDto) UserDto(de.symeda.sormas.api.user.UserDto) PersonReferenceDto(de.symeda.sormas.api.person.PersonReferenceDto) ActivityAsCaseDto(de.symeda.sormas.api.activityascase.ActivityAsCaseDto) ArrayList(java.util.ArrayList) Date(java.util.Date) LocalDate(java.time.LocalDate) AbstractBeanTest(de.symeda.sormas.backend.AbstractBeanTest) Test(org.junit.Test)

Example 4 with EpiDataDto

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

the class EpiDataPseudonymizationTest method createCaseWEpiData.

private CaseDataDto createCaseWEpiData(UserDto user, TestDataCreator.RDCF rdcf) {
    CaseDataDto caze = creator.createCase(user.toReference(), rdcf, c -> {
        EpiDataDto epiData = c.getEpiData();
        ExposureDto exposure = ExposureDto.build(ExposureType.ANIMAL_CONTACT);
        exposure.setAnimalCondition(AnimalCondition.DEAD);
        exposure.setDescription("Test description");
        exposure.getLocation().setDetails("Test location details");
        epiData.getExposures().add(exposure);
        ExposureDto exposure2 = ExposureDto.build(ExposureType.ANIMAL_CONTACT);
        exposure2.setTypeOfAnimal(TypeOfAnimal.OTHER);
        exposure2.setTypeOfAnimalDetails("Test other animal details");
        epiData.getExposures().add(exposure2);
        ExposureDto exposure3 = ExposureDto.build(ExposureType.TRAVEL);
        exposure3.setBodyOfWater(YesNoUnknown.YES);
        exposure3.setWaterSource(WaterSource.OTHER);
        exposure3.setWaterSourceDetails("Test water source details");
        epiData.getExposures().add(exposure3);
        ExposureDto exposure4 = ExposureDto.build(ExposureType.ANIMAL_CONTACT);
        exposure4.setAnimalContactType(AnimalContactType.OTHER);
        exposure4.setAnimalContactTypeDetails("Test animal contact type details");
        epiData.getExposures().add(exposure4);
        ExposureDto burial = ExposureDto.build(ExposureType.BURIAL);
        burial.setDeceasedPersonName("John Smith");
        burial.setDeceasedPersonRelation("Test burial relation");
        LocationDto address = new LocationDto();
        address.setRegion(rdcf.region);
        address.setDistrict(rdcf.district);
        address.setCommunity(rdcf.community);
        address.setCity("Test City");
        burial.setLocation(address);
        epiData.getExposures().add(burial);
        ExposureDto travel = ExposureDto.build(ExposureType.TRAVEL);
        travel.getLocation().setDetails("Test travel destination");
        epiData.getExposures().add(travel);
        ExposureDto gathering = ExposureDto.build(ExposureType.GATHERING);
        gathering.setLocation(address);
        gathering.setDescription("Test gathering description");
        epiData.getExposures().add(gathering);
    });
    return caze;
}
Also used : EpiDataDto(de.symeda.sormas.api.epidata.EpiDataDto) CaseDataDto(de.symeda.sormas.api.caze.CaseDataDto) ExposureDto(de.symeda.sormas.api.exposure.ExposureDto) LocationDto(de.symeda.sormas.api.location.LocationDto)

Example 5 with EpiDataDto

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

the class EpiDataPseudonymizationTest method getEpiDataInJurisdiction.

@Test
public void getEpiDataInJurisdiction() {
    CaseDataDto caseWEpiData = createCaseWEpiData(user2, rdcf2);
    CaseDataDto savedCase = getCaseFacade().getCaseDataByUuid(caseWEpiData.getUuid());
    EpiDataDto epiData = savedCase.getEpiData();
    assertThat(epiData.getExposures().get(0).getDescription(), is("Test description"));
    assertThat(epiData.getExposures().get(0).getLocation().getDetails(), is("Test location details"));
    assertThat(epiData.getExposures().get(1).getTypeOfAnimalDetails(), is("Test other animal details"));
    assertThat(epiData.getExposures().get(2).getWaterSourceDetails(), is("Test water source details"));
    assertThat(epiData.getExposures().get(3).getAnimalContactTypeDetails(), is("Test animal contact type details"));
    ExposureDto burial = epiData.getExposures().get(4);
    assertThat(burial.getDeceasedPersonName(), is("John Smith"));
    assertThat(burial.getDeceasedPersonRelation(), is("Test burial relation"));
    LocationDto burialAddress = burial.getLocation();
    assertThat(burialAddress.getCommunity(), is(rdcf2.community));
    assertThat(burialAddress.getCity(), is("Test City"));
    ExposureDto travel = epiData.getExposures().get(5);
    assertThat(travel.getLocation().getDetails(), is("Test travel destination"));
    ExposureDto gathering = epiData.getExposures().get(6);
    assertThat(gathering.getDescription(), is("Test gathering description"));
    LocationDto gatheringAddress = gathering.getLocation();
    assertThat(gatheringAddress.getCommunity(), is(rdcf2.community));
    assertThat(gatheringAddress.getCity(), is("Test City"));
}
Also used : EpiDataDto(de.symeda.sormas.api.epidata.EpiDataDto) CaseDataDto(de.symeda.sormas.api.caze.CaseDataDto) ExposureDto(de.symeda.sormas.api.exposure.ExposureDto) LocationDto(de.symeda.sormas.api.location.LocationDto) Test(org.junit.Test) AbstractBeanTest(de.symeda.sormas.backend.AbstractBeanTest)

Aggregations

EpiDataDto (de.symeda.sormas.api.epidata.EpiDataDto)12 CaseDataDto (de.symeda.sormas.api.caze.CaseDataDto)11 ExposureDto (de.symeda.sormas.api.exposure.ExposureDto)10 Test (org.junit.Test)8 AbstractBeanTest (de.symeda.sormas.backend.AbstractBeanTest)7 Date (java.util.Date)7 LocalDate (java.time.LocalDate)6 PersonDto (de.symeda.sormas.api.person.PersonDto)5 UserDto (de.symeda.sormas.api.user.UserDto)5 ArrayList (java.util.ArrayList)5 LocationDto (de.symeda.sormas.api.location.LocationDto)4 PersonReferenceDto (de.symeda.sormas.api.person.PersonReferenceDto)4 RDCF (de.symeda.sormas.backend.TestDataCreator.RDCF)4 ActivityAsCaseDto (de.symeda.sormas.api.activityascase.ActivityAsCaseDto)3 CasePersonDto (de.symeda.sormas.api.caze.CasePersonDto)3 ContactDto (de.symeda.sormas.api.contact.ContactDto)3 SymptomsDto (de.symeda.sormas.api.symptoms.SymptomsDto)3 UserReferenceDto (de.symeda.sormas.api.user.UserReferenceDto)3 VisitDto (de.symeda.sormas.api.visit.VisitDto)3 JsonNode (com.fasterxml.jackson.databind.JsonNode)2