Search in sources :

Example 1 with CasePersonDto

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

the class CaseFacadeEjbTest method testGetDuplicatesWithReportDateThreshold.

@Test
public void testGetDuplicatesWithReportDateThreshold() {
    RDCF rdcf = creator.createRDCF();
    Date now = new Date();
    // case and person matching for asserts
    PersonDto person = creator.createPerson("Fname", "Lname", (p) -> {
        p.setBirthdateDD(12);
        p.setBirthdateMM(3);
        p.setBirthdateYYYY(1968);
    });
    final UserReferenceDto user = creator.createUser(rdcf, UserRole.SURVEILLANCE_OFFICER).toReference();
    CaseDataDto caze = creator.createCase(user, rdcf, (c) -> {
        c.setPerson(person.toReference());
        c.setDisease(Disease.CORONAVIRUS);
        c.setDistrict(rdcf.district);
        c.setReportDate(new Date());
    });
    PersonDto person2 = creator.createPerson("Fname", "Lname", (p) -> {
        p.setBirthdateMM(3);
        p.setBirthdateYYYY(1968);
    });
    creator.createCase(user, rdcf, (c) -> {
        c.setPerson(person2.toReference());
        c.setDisease(Disease.CORONAVIRUS);
        c.setReportDate(new DateTime(now).minusDays(1).toDate());
    });
    CasePersonDto casePerson = new CasePersonDto();
    PersonDto duplicatePerson = PersonDto.build();
    CaseDataDto duplicateCaze = CaseDataDto.build(duplicatePerson.toReference(), Disease.CORONAVIRUS);
    duplicateCaze.setResponsibleDistrict(rdcf.district);
    duplicateCaze.setReportDate(new Date());
    casePerson.setCaze(duplicateCaze);
    casePerson.setPerson(duplicatePerson);
    List<CasePersonDto> duplicates;
    duplicateCaze.setExternalToken(null);
    duplicatePerson.setFirstName("Fname");
    duplicatePerson.setLastName("Lname");
    duplicates = getCaseFacade().getDuplicates(casePerson, 1);
    MatcherAssert.assertThat(duplicates, hasSize(2));
}
Also used : UserReferenceDto(de.symeda.sormas.api.user.UserReferenceDto) 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) CasePersonDto(de.symeda.sormas.api.caze.CasePersonDto) Date(java.util.Date) LocalDate(java.time.LocalDate) LocalDateTime(java.time.LocalDateTime) DateTime(org.joda.time.DateTime) AbstractBeanTest(de.symeda.sormas.backend.AbstractBeanTest) Test(org.junit.Test)

Example 2 with CasePersonDto

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

the class CaseFacadeEjbTest method testGetDuplicates.

@Test
public void testGetDuplicates() {
    RDCF rdcf = creator.createRDCF();
    // case and person matching for asserts
    PersonDto person = creator.createPerson("Fname", "Lname", (p) -> {
        p.setBirthdateDD(12);
        p.setBirthdateMM(3);
        p.setBirthdateYYYY(1968);
    });
    final UserReferenceDto user = creator.createUser(rdcf, UserRole.SURVEILLANCE_OFFICER).toReference();
    CaseDataDto caze = creator.createCase(user, rdcf, (c) -> {
        c.setPerson(person.toReference());
        c.setExternalID("test-ext-id");
        c.setExternalToken("test-ext-token");
        c.setDisease(Disease.CORONAVIRUS);
        c.setDistrict(rdcf.district);
        c.setReportDate(new Date());
    });
    // case and person matching for some asserts
    PersonDto person2 = creator.createPerson("Fname", "Lname", (p) -> {
        p.setBirthdateMM(3);
        p.setBirthdateYYYY(1968);
    });
    creator.createCase(user, rdcf, (c) -> {
        c.setPerson(person2.toReference());
        c.setDisease(Disease.CORONAVIRUS);
    });
    creator.createCase(user, rdcf, (c) -> {
        c.setPerson(creator.createPerson().toReference());
        c.setDisease(Disease.CHOLERA);
    });
    creator.createCase(user, rdcf, (c) -> {
        c.setPerson(person.toReference());
        c.setDisease(Disease.CHOLERA);
    });
    CasePersonDto casePerson = new CasePersonDto();
    PersonDto duplicatePerson = PersonDto.build();
    CaseDataDto duplicateCaze = CaseDataDto.build(duplicatePerson.toReference(), Disease.CORONAVIRUS);
    duplicateCaze.setResponsibleDistrict(rdcf.district);
    duplicateCaze.setReportDate(new Date());
    casePerson.setCaze(duplicateCaze);
    casePerson.setPerson(duplicatePerson);
    List<CasePersonDto> duplicates = getCaseFacade().getDuplicates(casePerson);
    MatcherAssert.assertThat(duplicates, hasSize(0));
    // match by external ID
    duplicateCaze.setExternalID("test-ext-id");
    duplicates = getCaseFacade().getDuplicates(casePerson);
    MatcherAssert.assertThat(duplicates, hasSize(1));
    // match by external ID case insensitive + trim
    duplicateCaze.setExternalID(" test-EXT-id ");
    duplicates = getCaseFacade().getDuplicates(casePerson);
    MatcherAssert.assertThat(duplicates, hasSize(1));
    // match by external token
    duplicateCaze.setExternalID(null);
    duplicateCaze.setExternalToken(caze.getExternalToken());
    duplicates = getCaseFacade().getDuplicates(casePerson);
    MatcherAssert.assertThat(duplicates, hasSize(1));
    // match by external token case insensitive + trim
    duplicateCaze.setExternalToken(" Test-ext-TOKEN ");
    duplicates = getCaseFacade().getDuplicates(casePerson);
    MatcherAssert.assertThat(duplicates, hasSize(1));
    // match by first name and last name
    duplicateCaze.setExternalToken(null);
    duplicatePerson.setFirstName("Fname");
    duplicatePerson.setLastName("Lname");
    duplicates = getCaseFacade().getDuplicates(casePerson);
    MatcherAssert.assertThat(duplicates, hasSize(2));
    // match by name and birth day should match also the one with missing birth day
    duplicatePerson.setBirthdateDD(12);
    duplicates = getCaseFacade().getDuplicates(casePerson);
    MatcherAssert.assertThat(duplicates, hasSize(2));
    // match by name and birth day / month should match also the one with missing birth day
    duplicatePerson.setBirthdateMM(3);
    duplicates = getCaseFacade().getDuplicates(casePerson);
    MatcherAssert.assertThat(duplicates, hasSize(2));
    // match by name and birth day / month / year should match also the one with missing birth day
    duplicatePerson.setBirthdateYYYY(1968);
    duplicates = getCaseFacade().getDuplicates(casePerson);
    MatcherAssert.assertThat(duplicates, hasSize(2));
    // match by name and birth month / year
    duplicatePerson.setBirthdateDD(null);
    duplicates = getCaseFacade().getDuplicates(casePerson);
    MatcherAssert.assertThat(duplicates, hasSize(2));
    // case insensitive name
    duplicatePerson.setFirstName(" fnamE");
    duplicatePerson.setLastName("lName ");
    duplicates = getCaseFacade().getDuplicates(casePerson);
    MatcherAssert.assertThat(duplicates, hasSize(2));
}
Also used : UserReferenceDto(de.symeda.sormas.api.user.UserReferenceDto) 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) CasePersonDto(de.symeda.sormas.api.caze.CasePersonDto) Date(java.util.Date) LocalDate(java.time.LocalDate) AbstractBeanTest(de.symeda.sormas.backend.AbstractBeanTest) Test(org.junit.Test)

Example 3 with CasePersonDto

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

the class CaseFacadeEjb method getDuplicates.

/**
 * Find duplicates based on case and person dto
 * Conditions:
 * * same externalId
 * * same externalToken
 * * same first name, last name, date of birth, sex (null is considered equal to any sex), disease, reportDate (ignore time), district
 *
 * The reportDateThreshold allows to return duplicates where
 * -reportDateThreshold <= match.reportDate <= reportDateThreshold
 *
 * @param casePerson
 *            - case and person
 * @param reportDateThreshold
 *            - the range bounds on match.reportDate
 * @return list of duplicate cases
 */
@Override
public List<CasePersonDto> getDuplicates(@Valid CasePersonDto casePerson, int reportDateThreshold) {
    CaseDataDto searchCaze = casePerson.getCaze();
    PersonDto searchPerson = casePerson.getPerson();
    CriteriaBuilder cb = em.getCriteriaBuilder();
    CriteriaQuery<Object[]> cq = cb.createQuery(Object[].class);
    Root<Case> caseRoot = cq.from(Case.class);
    CaseJoins<Case> caseCaseJoins = new CaseJoins<>(caseRoot);
    Join<Case, Person> person = caseCaseJoins.getPerson();
    cq.multiselect(caseRoot.get(Case.UUID), person.get(Person.UUID));
    Path<String> externalId = caseRoot.get(Case.EXTERNAL_ID);
    Path<String> externalToken = caseRoot.get(Case.EXTERNAL_TOKEN);
    Predicate externalIdPredicate = null;
    if (searchCaze.getExternalID() != null) {
        externalIdPredicate = and(cb, cb.isNotNull(externalId), cb.equal(cb.lower(externalId), searchCaze.getExternalID().toLowerCase().trim()));
    }
    Predicate externalTokenPredicate = null;
    if (searchCaze.getExternalToken() != null) {
        externalTokenPredicate = and(cb, cb.isNotNull(externalToken), cb.equal(cb.trim(cb.lower(externalToken)), searchCaze.getExternalToken().toLowerCase().trim()));
    }
    // todo this should use PersonService.buildSimilarityCriteriaFilter
    Predicate combinedPredicate = null;
    if (searchPerson.getFirstName() != null && searchPerson.getLastName() != null && searchCaze.getReportDate() != null && searchCaze.getResponsibleDistrict() != null) {
        Predicate personPredicate = and(cb, cb.equal(cb.trim(cb.lower(person.get(Person.FIRST_NAME))), searchPerson.getFirstName().toLowerCase().trim()), cb.equal(cb.trim(cb.lower(person.get(Person.LAST_NAME))), searchPerson.getLastName().toLowerCase().trim()));
        if (searchPerson.getBirthdateDD() != null) {
            personPredicate = and(cb, personPredicate, or(cb, cb.isNull(person.get(Person.BIRTHDATE_DD)), cb.equal(person.get(Person.BIRTHDATE_DD), searchPerson.getBirthdateDD())));
        }
        if (searchPerson.getBirthdateMM() != null) {
            personPredicate = and(cb, personPredicate, or(cb, cb.isNull(person.get(Person.BIRTHDATE_DD)), cb.equal(person.get(Person.BIRTHDATE_MM), searchPerson.getBirthdateMM())));
        }
        if (searchPerson.getBirthdateYYYY() != null) {
            personPredicate = and(cb, personPredicate, or(cb, cb.isNull(person.get(Person.BIRTHDATE_YYYY)), cb.equal(person.get(Person.BIRTHDATE_YYYY), searchPerson.getBirthdateYYYY())));
        }
        if (searchPerson.getSex() != null) {
            personPredicate = and(cb, personPredicate, or(cb, cb.isNull(person.get(Person.SEX)), cb.equal(person.get(Person.SEX), searchPerson.getSex())));
        }
        Predicate reportDatePredicate;
        if (reportDateThreshold == 0) {
            // threshold is zero: we want to get exact matches
            reportDatePredicate = cb.equal(cb.function("date", Date.class, caseRoot.get(Case.REPORT_DATE)), cb.function("date", Date.class, cb.literal(searchCaze.getReportDate())));
        } else {
            // threshold is nonzero: apply time range of threshold to the reportDate
            Date reportDate = casePerson.getCaze().getReportDate();
            Date dateBefore = new DateTime(reportDate).minusDays(reportDateThreshold).toDate();
            Date dateAfter = new DateTime(reportDate).plusDays(reportDateThreshold).toDate();
            reportDatePredicate = cb.between(cb.function("date", Date.class, caseRoot.get(Case.REPORT_DATE)), cb.function("date", Date.class, cb.literal(dateBefore)), cb.function("date", Date.class, cb.literal(dateAfter)));
        }
        Predicate districtPredicate = CriteriaBuilderHelper.or(cb, cb.equal(caseCaseJoins.getResponsibleDistrict().get(District.UUID), searchCaze.getResponsibleDistrict().getUuid()), cb.equal(caseCaseJoins.getDistrict().get(District.UUID), searchCaze.getResponsibleDistrict().getUuid()));
        if (searchCaze.getDistrict() != null) {
            districtPredicate = CriteriaBuilderHelper.or(cb, districtPredicate, cb.equal(caseCaseJoins.getResponsibleDistrict().get(District.UUID), searchCaze.getDistrict().getUuid()), cb.equal(caseCaseJoins.getDistrict().get(District.UUID), searchCaze.getDistrict().getUuid()));
        }
        combinedPredicate = and(cb, personPredicate, cb.equal(caseRoot.get(Case.DISEASE), searchCaze.getDisease()), reportDatePredicate, districtPredicate);
    }
    Predicate filters = or(cb, externalIdPredicate, externalTokenPredicate, combinedPredicate);
    if (filters == null) {
        return Collections.emptyList();
    }
    cq.where(filters);
    List<Object[]> duplicateUuids = em.createQuery(cq).getResultList();
    return duplicateUuids.stream().map((casePersonUuids) -> new CasePersonDto(getCaseDataByUuid((String) casePersonUuids[0]), personFacade.getPersonByUuid((String) casePersonUuids[1]))).collect(Collectors.toList());
}
Also used : CriteriaBuilder(javax.persistence.criteria.CriteriaBuilder) 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) CaseDataDto(de.symeda.sormas.api.caze.CaseDataDto) PersonDto(de.symeda.sormas.api.person.PersonDto) CasePersonDto(de.symeda.sormas.api.caze.CasePersonDto) CasePersonDto(de.symeda.sormas.api.caze.CasePersonDto) Date(java.util.Date) LocalDate(java.time.LocalDate) ExternalShareInfoCountAndLatestDate(de.symeda.sormas.backend.share.ExternalShareInfoCountAndLatestDate) DateTime(org.joda.time.DateTime) Predicate(javax.persistence.criteria.Predicate) AbstractDomainObject(de.symeda.sormas.backend.common.AbstractDomainObject) Person(de.symeda.sormas.backend.person.Person) CaseJoins(de.symeda.sormas.utils.CaseJoins)

Aggregations

CaseDataDto (de.symeda.sormas.api.caze.CaseDataDto)3 CasePersonDto (de.symeda.sormas.api.caze.CasePersonDto)3 PersonDto (de.symeda.sormas.api.person.PersonDto)2 UserReferenceDto (de.symeda.sormas.api.user.UserReferenceDto)2 AbstractBeanTest (de.symeda.sormas.backend.AbstractBeanTest)2 RDCF (de.symeda.sormas.backend.TestDataCreator.RDCF)2 LocalDate (java.time.LocalDate)2 Date (java.util.Date)2 Test (org.junit.Test)2 JsonNode (com.fasterxml.jackson.databind.JsonNode)1 CaseMeasure (de.symeda.sormas.api.CaseMeasure)1 CountryHelper (de.symeda.sormas.api.CountryHelper)1 Disease (de.symeda.sormas.api.Disease)1 DiseaseHelper (de.symeda.sormas.api.DiseaseHelper)1 Language (de.symeda.sormas.api.Language)1 VisitOrigin (de.symeda.sormas.api.VisitOrigin)1 AgeAndBirthDateDto (de.symeda.sormas.api.caze.AgeAndBirthDateDto)1 BirthDateDto (de.symeda.sormas.api.caze.BirthDateDto)1 BurialInfoDto (de.symeda.sormas.api.caze.BurialInfoDto)1 CaseBulkEditData (de.symeda.sormas.api.caze.CaseBulkEditData)1