Search in sources :

Example 1 with DiseaseConfiguration

use of de.symeda.sormas.backend.disease.DiseaseConfiguration in project SORMAS-Project by hzi-braunschweig.

the class StartupShutdownService method createMissingDiseaseConfigurations.

private void createMissingDiseaseConfigurations() {
    List<DiseaseConfiguration> diseaseConfigurations = diseaseConfigurationService.getAll();
    List<Disease> configuredDiseases = diseaseConfigurations.stream().map(DiseaseConfiguration::getDisease).collect(Collectors.toList());
    Arrays.stream(Disease.values()).filter(d -> !configuredDiseases.contains(d)).forEach(d -> {
        DiseaseConfiguration configuration = DiseaseConfiguration.build(d);
        diseaseConfigurationService.ensurePersisted(configuration);
    });
}
Also used : Arrays(java.util.Arrays) Date(java.util.Date) I18nProperties(de.symeda.sormas.api.i18n.I18nProperties) LoggerFactory(org.slf4j.LoggerFactory) Scanner(java.util.Scanner) DistrictService(de.symeda.sormas.backend.infrastructure.district.DistrictService) StringUtils(org.apache.commons.lang3.StringUtils) CountryService(de.symeda.sormas.backend.infrastructure.country.CountryService) SecureRandom(java.security.SecureRandom) PreDestroy(javax.annotation.PreDestroy) Matcher(java.util.regex.Matcher) TransactionAttributeType(javax.ejb.TransactionAttributeType) Facility(de.symeda.sormas.backend.infrastructure.facility.Facility) CountryReferenceDto(de.symeda.sormas.api.infrastructure.country.CountryReferenceDto) UserRole(de.symeda.sormas.api.user.UserRole) DefaultEntityHelper(de.symeda.sormas.api.utils.DefaultEntityHelper) Contact(de.symeda.sormas.backend.contact.Contact) Stateless(javax.ejb.Stateless) FacilityService(de.symeda.sormas.backend.infrastructure.facility.FacilityService) UserUpdateEvent(de.symeda.sormas.backend.user.event.UserUpdateEvent) CommunityService(de.symeda.sormas.backend.infrastructure.community.CommunityService) FacilityType(de.symeda.sormas.api.infrastructure.facility.FacilityType) Timestamp(java.sql.Timestamp) UserConfig(de.symeda.sormas.api.externaljournal.UserConfig) Set(java.util.Set) SymptomJournalConfig(de.symeda.sormas.api.externaljournal.SymptomJournalConfig) Region(de.symeda.sormas.backend.infrastructure.region.Region) District(de.symeda.sormas.backend.infrastructure.district.District) Collectors(java.util.stream.Collectors) Language(de.symeda.sormas.api.Language) StandardCharsets(java.nio.charset.StandardCharsets) PointOfEntryService(de.symeda.sormas.backend.infrastructure.pointofentry.PointOfEntryService) UncheckedIOException(java.io.UncheckedIOException) List(java.util.List) DeletionConfigurationService(de.symeda.sormas.backend.deletionconfiguration.DeletionConfigurationService) UserService(de.symeda.sormas.backend.user.UserService) Stream(java.util.stream.Stream) User(de.symeda.sormas.backend.user.User) Singleton(javax.ejb.Singleton) PostConstruct(javax.annotation.PostConstruct) Optional(java.util.Optional) Pattern(java.util.regex.Pattern) DiseaseConfiguration(de.symeda.sormas.backend.disease.DiseaseConfiguration) MockDataGenerator(de.symeda.sormas.backend.util.MockDataGenerator) AuthProvider(de.symeda.sormas.api.AuthProvider) Community(de.symeda.sormas.backend.infrastructure.community.Community) DiseaseConfigurationService(de.symeda.sormas.backend.disease.DiseaseConfigurationService) PatientDiaryConfig(de.symeda.sormas.api.externaljournal.PatientDiaryConfig) CountryFacadeEjbLocal(de.symeda.sormas.backend.infrastructure.country.CountryFacadeEjb.CountryFacadeEjbLocal) MessageFormat(java.text.MessageFormat) ArrayList(java.util.ArrayList) HashSet(java.util.HashSet) Inject(javax.inject.Inject) FacilityCriteria(de.symeda.sormas.api.infrastructure.facility.FacilityCriteria) TransactionAttribute(javax.ejb.TransactionAttribute) FacilityFacadeEjbLocal(de.symeda.sormas.backend.infrastructure.facility.FacilityFacadeEjb.FacilityFacadeEjbLocal) LocalBean(javax.ejb.LocalBean) ImportFacadeEjbLocal(de.symeda.sormas.backend.importexport.ImportFacadeEjb.ImportFacadeEjbLocal) NoSuchElementException(java.util.NoSuchElementException) ConfigFacadeEjbLocal(de.symeda.sormas.backend.common.ConfigFacadeEjb.ConfigFacadeEjbLocal) EJB(javax.ejb.EJB) ModelConstants(de.symeda.sormas.backend.util.ModelConstants) CentralInfraSyncFacade(de.symeda.sormas.backend.infrastructure.central.CentralInfraSyncFacade) Event(javax.enterprise.event.Event) TransactionManagement(javax.ejb.TransactionManagement) Logger(org.slf4j.Logger) DataHelper(de.symeda.sormas.api.utils.DataHelper) PointOfEntry(de.symeda.sormas.backend.infrastructure.pointofentry.PointOfEntry) SormasToSormasFacadeEjb(de.symeda.sormas.backend.sormastosormas.SormasToSormasFacadeEjb) IOException(java.io.IOException) EntityManager(javax.persistence.EntityManager) PersistenceContext(javax.persistence.PersistenceContext) RunAs(javax.annotation.security.RunAs) RegionService(de.symeda.sormas.backend.infrastructure.region.RegionService) Consumer(java.util.function.Consumer) Disease(de.symeda.sormas.api.Disease) ContactService(de.symeda.sormas.backend.contact.ContactService) Country(de.symeda.sormas.backend.infrastructure.country.Country) Startup(javax.ejb.Startup) PasswordResetEvent(de.symeda.sormas.backend.user.event.PasswordResetEvent) Collections(java.util.Collections) PasswordHelper(de.symeda.sormas.api.utils.PasswordHelper) InputStream(java.io.InputStream) TransactionManagementType(javax.ejb.TransactionManagementType) FeatureConfigurationService(de.symeda.sormas.backend.feature.FeatureConfigurationService) Disease(de.symeda.sormas.api.Disease) DiseaseConfiguration(de.symeda.sormas.backend.disease.DiseaseConfiguration)

Example 2 with DiseaseConfiguration

use of de.symeda.sormas.backend.disease.DiseaseConfiguration in project SORMAS-Project by hzi-braunschweig.

the class AbstractBeanTest method createDiseaseConfigurations.

@Before
public void createDiseaseConfigurations() {
    List<DiseaseConfiguration> diseaseConfigurations = getDiseaseConfigurationService().getAll();
    List<Disease> configuredDiseases = diseaseConfigurations.stream().map(DiseaseConfiguration::getDisease).collect(Collectors.toList());
    Arrays.stream(Disease.values()).filter(d -> !configuredDiseases.contains(d)).forEach(d -> {
        DiseaseConfiguration configuration = DiseaseConfiguration.build(d);
        getDiseaseConfigurationService().ensurePersisted(configuration);
    });
}
Also used : DocumentTemplateFacade(de.symeda.sormas.api.docgeneneration.DocumentTemplateFacade) VisitService(de.symeda.sormas.backend.visit.VisitService) ContinentFacadeEjb(de.symeda.sormas.backend.infrastructure.continent.ContinentFacadeEjb) BAGExportFacade(de.symeda.sormas.api.bagexport.BAGExportFacade) DistrictService(de.symeda.sormas.backend.infrastructure.district.DistrictService) SubcontinentFacade(de.symeda.sormas.api.infrastructure.subcontinent.SubcontinentFacade) QuarantineOrderFacade(de.symeda.sormas.api.docgeneneration.QuarantineOrderFacade) SormasToSormasEventFacade(de.symeda.sormas.api.sormastosormas.event.SormasToSormasEventFacade) QuarantineOrderFacadeEjb(de.symeda.sormas.backend.docgeneration.QuarantineOrderFacadeEjb) RegionFacade(de.symeda.sormas.api.infrastructure.region.RegionFacade) CampaignFormDataFacade(de.symeda.sormas.api.campaign.data.CampaignFormDataFacade) CommunityService(de.symeda.sormas.backend.infrastructure.community.CommunityService) VaccinationService(de.symeda.sormas.backend.vaccination.VaccinationService) CaseFacadeEjbLocal(de.symeda.sormas.backend.caze.CaseFacadeEjb.CaseFacadeEjbLocal) SampleService(de.symeda.sormas.backend.sample.SampleService) ImportFacade(de.symeda.sormas.api.importexport.ImportFacade) CampaignDiagramDefinitionFacade(de.symeda.sormas.api.campaign.diagram.CampaignDiagramDefinitionFacade) SampleFacade(de.symeda.sormas.api.sample.SampleFacade) VisitFacadeEjbLocal(de.symeda.sormas.backend.visit.VisitFacadeEjb.VisitFacadeEjbLocal) ConfigFacadeEjbLocal(de.symeda.sormas.backend.common.ConfigFacadeEjb.ConfigFacadeEjbLocal) Before(org.junit.Before) CaseStatisticsFacade(de.symeda.sormas.api.caze.CaseStatisticsFacade) ContinentFacade(de.symeda.sormas.api.infrastructure.continent.ContinentFacade) HospitalizationFacadeEjbLocal(de.symeda.sormas.backend.hospitalization.HospitalizationFacadeEjb.HospitalizationFacadeEjbLocal) ActionFacade(de.symeda.sormas.api.action.ActionFacade) DistrictFacade(de.symeda.sormas.api.infrastructure.district.DistrictFacade) VisitFacade(de.symeda.sormas.api.visit.VisitFacade) CustomizableEnumFacadeEjb(de.symeda.sormas.backend.customizableenum.CustomizableEnumFacadeEjb) PersonService(de.symeda.sormas.backend.person.PersonService) PointOfEntryFacade(de.symeda.sormas.api.infrastructure.pointofentry.PointOfEntryFacade) Disease(de.symeda.sormas.api.Disease) ExportFacadeEjb(de.symeda.sormas.backend.importexport.ExportFacadeEjb) SormasToSormasShareRequestFacade(de.symeda.sormas.api.sormastosormas.sharerequest.SormasToSormasShareRequestFacade) FeatureConfigurationFacade(de.symeda.sormas.api.feature.FeatureConfigurationFacade) ExternalShareInfoFacade(de.symeda.sormas.api.share.ExternalShareInfoFacade) ExportFacade(de.symeda.sormas.api.importexport.ExportFacade) EventDocumentFacadeEjb(de.symeda.sormas.backend.docgeneration.EventDocumentFacadeEjb) SurveillanceReportService(de.symeda.sormas.backend.caze.surveillancereport.SurveillanceReportService) I18nProperties(de.symeda.sormas.api.i18n.I18nProperties) LabMessageFacade(de.symeda.sormas.api.labmessage.LabMessageFacade) PopulationDataFacadeEjbLocal(de.symeda.sormas.backend.infrastructure.PopulationDataFacadeEjb.PopulationDataFacadeEjbLocal) ReceivedImmunizationProcessor(de.symeda.sormas.backend.sormastosormas.entities.immunization.ReceivedImmunizationProcessor) LabMessageFacadeEjbLocal(de.symeda.sormas.backend.labmessage.LabMessageFacadeEjb.LabMessageFacadeEjbLocal) UserRightsFacadeEjbLocal(de.symeda.sormas.backend.user.UserRightsFacadeEjb.UserRightsFacadeEjbLocal) CountryService(de.symeda.sormas.backend.infrastructure.country.CountryService) GeoShapeProvider(de.symeda.sormas.api.geo.GeoShapeProvider) PrescriptionFacade(de.symeda.sormas.api.therapy.PrescriptionFacade) PrescriptionService(de.symeda.sormas.backend.therapy.PrescriptionService) PopulationDataFacade(de.symeda.sormas.api.infrastructure.PopulationDataFacade) TaskFacade(de.symeda.sormas.api.task.TaskFacade) CoreEntityDeletionService(de.symeda.sormas.backend.deletionconfiguration.CoreEntityDeletionService) ImmunizationFacadeEjbLocal(de.symeda.sormas.backend.immunization.ImmunizationFacadeEjb.ImmunizationFacadeEjbLocal) CommunityFacade(de.symeda.sormas.api.infrastructure.community.CommunityFacade) CampaignFacadeEjbLocal(de.symeda.sormas.backend.campaign.CampaignFacadeEjb.CampaignFacadeEjbLocal) CaseService(de.symeda.sormas.backend.caze.CaseService) DiseaseConfigurationFacadeEjbLocal(de.symeda.sormas.backend.disease.DiseaseConfigurationFacadeEjb.DiseaseConfigurationFacadeEjbLocal) DocumentFacade(de.symeda.sormas.api.document.DocumentFacade) AdditionalTestFacade(de.symeda.sormas.api.sample.AdditionalTestFacade) PrescriptionFacadeEjbLocal(de.symeda.sormas.backend.therapy.PrescriptionFacadeEjb.PrescriptionFacadeEjbLocal) Collectors(java.util.stream.Collectors) Language(de.symeda.sormas.api.Language) ClinicalCourseFacade(de.symeda.sormas.api.clinicalcourse.ClinicalCourseFacade) SurveillanceReportFacadeEjb(de.symeda.sormas.backend.caze.surveillancereport.SurveillanceReportFacadeEjb) Query(javax.persistence.Query) ImportParserService(de.symeda.sormas.backend.importexport.parser.ImportParserService) DiseaseConfiguration(de.symeda.sormas.backend.disease.DiseaseConfiguration) FeatureConfigurationFacadeEjbLocal(de.symeda.sormas.backend.feature.FeatureConfigurationFacadeEjb.FeatureConfigurationFacadeEjbLocal) CountryFacade(de.symeda.sormas.api.infrastructure.country.CountryFacade) ContactFacadeEjbLocal(de.symeda.sormas.backend.contact.ContactFacadeEjb.ContactFacadeEjbLocal) DiseaseConfigurationService(de.symeda.sormas.backend.disease.DiseaseConfigurationService) TaskFacadeEjbLocal(de.symeda.sormas.backend.task.TaskFacadeEjb.TaskFacadeEjbLocal) EventParticipantService(de.symeda.sormas.backend.event.EventParticipantService) ShareDataBuilderHelper(de.symeda.sormas.backend.sormastosormas.share.ShareDataBuilderHelper) AdditionalTestFacadeEjbLocal(de.symeda.sormas.backend.sample.AdditionalTestFacadeEjb.AdditionalTestFacadeEjbLocal) ImportFacadeEjbLocal(de.symeda.sormas.backend.importexport.ImportFacadeEjb.ImportFacadeEjbLocal) ExternalShareInfoService(de.symeda.sormas.backend.share.ExternalShareInfoService) CampaignFormMetaFacadeEjbLocal(de.symeda.sormas.backend.campaign.form.CampaignFormMetaFacadeEjb.CampaignFormMetaFacadeEjbLocal) TherapyFacade(de.symeda.sormas.api.therapy.TherapyFacade) UserDto(de.symeda.sormas.api.user.UserDto) TherapyFacadeEjbLocal(de.symeda.sormas.backend.therapy.TherapyFacadeEjb.TherapyFacadeEjbLocal) Mockito.when(org.mockito.Mockito.when) ReceivedContactProcessor(de.symeda.sormas.backend.sormastosormas.entities.contact.ReceivedContactProcessor) ReceivedSampleProcessor(de.symeda.sormas.backend.sormastosormas.entities.sample.ReceivedSampleProcessor) DiseaseConfigurationFacade(de.symeda.sormas.api.disease.DiseaseConfigurationFacade) SurveillanceReportFacade(de.symeda.sormas.api.caze.surveillancereport.SurveillanceReportFacade) EpiDataFacade(de.symeda.sormas.api.epidata.EpiDataFacade) SormasToSormasEventFacadeEjbLocal(de.symeda.sormas.backend.sormastosormas.entities.event.SormasToSormasEventFacadeEjb.SormasToSormasEventFacadeEjbLocal) SormasToSormasShareRequestService(de.symeda.sormas.backend.sormastosormas.share.sharerequest.SormasToSormasShareRequestService) TestReportService(de.symeda.sormas.backend.labmessage.TestReportService) ShareRequestInfoService(de.symeda.sormas.backend.sormastosormas.share.shareinfo.ShareRequestInfoService) RegionFacadeEjbLocal(de.symeda.sormas.backend.infrastructure.region.RegionFacadeEjb.RegionFacadeEjbLocal) SormasToSormasSampleDtoValidator(de.symeda.sormas.backend.sormastosormas.entities.sample.SormasToSormasSampleDtoValidator) ExternalJournalService(de.symeda.sormas.backend.externaljournal.ExternalJournalService) Arrays(java.util.Arrays) DocumentFacadeEjb(de.symeda.sormas.backend.document.DocumentFacadeEjb) CustomizableEnumValueService(de.symeda.sormas.backend.customizableenum.CustomizableEnumValueService) SymptomsFacadeEjbLocal(de.symeda.sormas.backend.symptoms.SymptomsFacadeEjb.SymptomsFacadeEjbLocal) CampaignFormDataFacadeEjbLocal(de.symeda.sormas.backend.campaign.data.CampaignFormDataFacadeEjb.CampaignFormDataFacadeEjbLocal) SormasToSormasEventParticipantDtoValidator(de.symeda.sormas.backend.sormastosormas.entities.eventparticipant.SormasToSormasEventParticipantDtoValidator) SormasToSormasLabMessageFacade(de.symeda.sormas.api.sormastosormas.labmessage.SormasToSormasLabMessageFacade) SormasToSormasImmunizationDtoValidator(de.symeda.sormas.backend.sormastosormas.entities.immunization.SormasToSormasImmunizationDtoValidator) DocumentTemplateFacadeEjbLocal(de.symeda.sormas.backend.docgeneration.DocumentTemplateFacadeEjb.DocumentTemplateFacadeEjbLocal) SormasToSormasContactFacade(de.symeda.sormas.api.sormastosormas.contact.SormasToSormasContactFacade) CurrentUserService(de.symeda.sormas.backend.user.CurrentUserService) SystemEventFacade(de.symeda.sormas.api.systemevents.SystemEventFacade) FacilityService(de.symeda.sormas.backend.infrastructure.facility.FacilityService) CaseClassificationFacadeEjb(de.symeda.sormas.backend.caze.classification.CaseClassificationFacadeEjb) SampleFacadeEjbLocal(de.symeda.sormas.backend.sample.SampleFacadeEjb.SampleFacadeEjbLocal) DistrictFacadeEjbLocal(de.symeda.sormas.backend.infrastructure.district.DistrictFacadeEjb.DistrictFacadeEjbLocal) TravelEntryFacade(de.symeda.sormas.api.travelentry.TravelEntryFacade) PointOfEntryService(de.symeda.sormas.backend.infrastructure.pointofentry.PointOfEntryService) DashboardFacade(de.symeda.sormas.api.dashboard.DashboardFacade) DeletionConfigurationService(de.symeda.sormas.backend.deletionconfiguration.DeletionConfigurationService) UserService(de.symeda.sormas.backend.user.UserService) ContinentService(de.symeda.sormas.backend.infrastructure.continent.ContinentService) UserRoleConfigFacadeEjbLocal(de.symeda.sormas.backend.user.UserRoleConfigFacadeEjb.UserRoleConfigFacadeEjbLocal) SormasToSormasEncryptionFacadeEjb(de.symeda.sormas.backend.sormastosormas.crypto.SormasToSormasEncryptionFacadeEjb) SormasToSormasEventDtoValidator(de.symeda.sormas.backend.sormastosormas.entities.event.SormasToSormasEventDtoValidator) PersonFacade(de.symeda.sormas.api.person.PersonFacade) SymptomsFacade(de.symeda.sormas.api.symptoms.SymptomsFacade) FacilityFacade(de.symeda.sormas.api.infrastructure.facility.FacilityFacade) EventParticipantFacadeEjbLocal(de.symeda.sormas.backend.event.EventParticipantFacadeEjb.EventParticipantFacadeEjbLocal) ActionFacadeEjb(de.symeda.sormas.backend.action.ActionFacadeEjb) OutbreakFacadeEjbLocal(de.symeda.sormas.backend.outbreak.OutbreakFacadeEjb.OutbreakFacadeEjbLocal) OutbreakFacade(de.symeda.sormas.api.outbreak.OutbreakFacade) EpiDataFacadeEjb(de.symeda.sormas.backend.epidata.EpiDataFacadeEjb) TestReportFacade(de.symeda.sormas.api.labmessage.TestReportFacade) PersonFacadeEjbLocal(de.symeda.sormas.backend.person.PersonFacadeEjb.PersonFacadeEjbLocal) BAGExportFacadeEjb(de.symeda.sormas.backend.bagexport.BAGExportFacadeEjb) TravelEntryFacadeEjb(de.symeda.sormas.backend.travelentry.TravelEntryFacadeEjb) UserFacadeEjbLocal(de.symeda.sormas.backend.user.UserFacadeEjb.UserFacadeEjbLocal) EntityManager(javax.persistence.EntityManager) UserRoleConfigFacade(de.symeda.sormas.api.user.UserRoleConfigFacade) UserFacade(de.symeda.sormas.api.user.UserFacade) UserRightsFacade(de.symeda.sormas.api.user.UserRightsFacade) SormasToSormasShareRequestFacadeEJBLocal(de.symeda.sormas.backend.sormastosormas.share.sharerequest.SormasToSormasShareRequestFacadeEJB.SormasToSormasShareRequestFacadeEJBLocal) ContactService(de.symeda.sormas.backend.contact.ContactService) WeeklyReportFacade(de.symeda.sormas.api.report.WeeklyReportFacade) AreaFacadeEjbLocal(de.symeda.sormas.backend.infrastructure.area.AreaFacadeEjb.AreaFacadeEjbLocal) SubcontinentFacadeEjb(de.symeda.sormas.backend.infrastructure.subcontinent.SubcontinentFacadeEjb) GeoShapeProviderEjbLocal(de.symeda.sormas.backend.geo.GeoShapeProviderEjb.GeoShapeProviderEjbLocal) EventService(de.symeda.sormas.backend.event.EventService) GeocodingService(de.symeda.sormas.backend.geocoding.GeocodingService) SymptomsService(de.symeda.sormas.backend.symptoms.SymptomsService) ClinicalVisitService(de.symeda.sormas.backend.clinicalcourse.ClinicalVisitService) SormasToSormasLabMessageDtoValidator(de.symeda.sormas.backend.sormastosormas.entities.labmessage.SormasToSormasLabMessageDtoValidator) CaseStatisticsFacadeEjbLocal(de.symeda.sormas.backend.caze.CaseStatisticsFacadeEjb.CaseStatisticsFacadeEjbLocal) CommunityFacadeEjbLocal(de.symeda.sormas.backend.infrastructure.community.CommunityFacadeEjb.CommunityFacadeEjbLocal) SormasToSormasContactFacadeEjbLocal(de.symeda.sormas.backend.sormastosormas.entities.contact.SormasToSormasContactFacadeEjb.SormasToSormasContactFacadeEjbLocal) VaccinationFacade(de.symeda.sormas.api.vaccination.VaccinationFacade) SormasToSormasCaseFacadeEjbLocal(de.symeda.sormas.backend.sormastosormas.entities.caze.SormasToSormasCaseFacadeEjb.SormasToSormasCaseFacadeEjbLocal) SormasToSormasCaseDtoValidator(de.symeda.sormas.backend.sormastosormas.entities.caze.SormasToSormasCaseDtoValidator) TreatmentFacadeEjbLocal(de.symeda.sormas.backend.therapy.TreatmentFacadeEjb.TreatmentFacadeEjbLocal) UserRole(de.symeda.sormas.api.user.UserRole) EventFacadeEjbLocal(de.symeda.sormas.backend.event.EventFacadeEjb.EventFacadeEjbLocal) TreatmentFacade(de.symeda.sormas.api.therapy.TreatmentFacade) DocumentService(de.symeda.sormas.backend.document.DocumentService) CountryFacadeEjb(de.symeda.sormas.backend.infrastructure.country.CountryFacadeEjb) DashboardFacadeEjb(de.symeda.sormas.backend.dashboard.DashboardFacadeEjb) LabMessageService(de.symeda.sormas.backend.labmessage.LabMessageService) ReceivedEventProcessor(de.symeda.sormas.backend.sormastosormas.entities.event.ReceivedEventProcessor) SormasToSormasFacadeEjbLocal(de.symeda.sormas.backend.sormastosormas.SormasToSormasFacadeEjb.SormasToSormasFacadeEjbLocal) SormasToSormasContactDtoValidator(de.symeda.sormas.backend.sormastosormas.entities.contact.SormasToSormasContactDtoValidator) WeeklyReportFacadeEjbLocal(de.symeda.sormas.backend.report.WeeklyReportFacadeEjb.WeeklyReportFacadeEjbLocal) List(java.util.List) ReceivedCaseProcessor(de.symeda.sormas.backend.sormastosormas.entities.caze.ReceivedCaseProcessor) ExternalSurveillanceToolFacade(de.symeda.sormas.api.externalsurveillancetool.ExternalSurveillanceToolFacade) SormasToSormasShareInfoFacadeEjbLocal(de.symeda.sormas.backend.sormastosormas.share.shareinfo.SormasToSormasShareInfoFacadeEjb.SormasToSormasShareInfoFacadeEjbLocal) SormasToSormasCaseFacade(de.symeda.sormas.api.sormastosormas.caze.SormasToSormasCaseFacade) HospitalizationFacade(de.symeda.sormas.api.hospitalization.HospitalizationFacade) VaccinationFacadeEjb(de.symeda.sormas.backend.vaccination.VaccinationFacadeEjb) SormasToSormasShareInfoService(de.symeda.sormas.backend.sormastosormas.share.shareinfo.SormasToSormasShareInfoService) ConfigFacade(de.symeda.sormas.api.ConfigFacade) PathogenTestFacadeEjbLocal(de.symeda.sormas.backend.sample.PathogenTestFacadeEjb.PathogenTestFacadeEjbLocal) CustomizableEnumFacade(de.symeda.sormas.api.customizableenum.CustomizableEnumFacade) FacilityFacadeEjbLocal(de.symeda.sormas.backend.infrastructure.facility.FacilityFacadeEjb.FacilityFacadeEjbLocal) TestReportFacadeEjb(de.symeda.sormas.backend.labmessage.TestReportFacadeEjb) TreatmentService(de.symeda.sormas.backend.therapy.TreatmentService) ExternalShareInfoFacadeEjbLocal(de.symeda.sormas.backend.share.ExternalShareInfoFacadeEjb.ExternalShareInfoFacadeEjbLocal) SormasToSormasEncryptionFacade(de.symeda.sormas.api.sormastosormas.SormasToSormasEncryptionFacade) DefaultEntitiesCreator(de.symeda.sormas.backend.common.DefaultEntitiesCreator) CampaignDiagramDefinitionFacadeEjb(de.symeda.sormas.backend.campaign.diagram.CampaignDiagramDefinitionFacadeEjb) ClinicalVisitFacade(de.symeda.sormas.api.clinicalcourse.ClinicalVisitFacade) ClinicalVisitFacadeEjbLocal(de.symeda.sormas.backend.clinicalcourse.ClinicalVisitFacadeEjb.ClinicalVisitFacadeEjbLocal) PathogenTestService(de.symeda.sormas.backend.sample.PathogenTestService) SormasToSormasLabMessageFacadeEjbLocal(de.symeda.sormas.backend.sormastosormas.entities.labmessage.SormasToSormasLabMessageFacadeEjb.SormasToSormasLabMessageFacadeEjbLocal) EventDocumentFacade(de.symeda.sormas.api.docgeneneration.EventDocumentFacade) RegionService(de.symeda.sormas.backend.infrastructure.region.RegionService) SubcontinentService(de.symeda.sormas.backend.infrastructure.subcontinent.SubcontinentService) AreaFacade(de.symeda.sormas.api.infrastructure.area.AreaFacade) PathogenTestFacade(de.symeda.sormas.api.sample.PathogenTestFacade) SystemEventFacadeEjb(de.symeda.sormas.backend.systemevent.SystemEventFacadeEjb) ClinicalCourseFacadeEjbLocal(de.symeda.sormas.backend.clinicalcourse.ClinicalCourseFacadeEjb.ClinicalCourseFacadeEjbLocal) BaseBeanTest(info.novatec.beantest.api.BaseBeanTest) ExternalSurveillanceToolGatewayFacadeEjbLocal(de.symeda.sormas.backend.externalsurveillancetool.ExternalSurveillanceToolGatewayFacadeEjb.ExternalSurveillanceToolGatewayFacadeEjbLocal) PointOfEntryFacadeEjbLocal(de.symeda.sormas.backend.infrastructure.pointofentry.PointOfEntryFacadeEjb.PointOfEntryFacadeEjbLocal) CampaignFormMetaFacade(de.symeda.sormas.api.campaign.form.CampaignFormMetaFacade) Disease(de.symeda.sormas.api.Disease) DiseaseConfiguration(de.symeda.sormas.backend.disease.DiseaseConfiguration) Before(org.junit.Before)

Example 3 with DiseaseConfiguration

use of de.symeda.sormas.backend.disease.DiseaseConfiguration in project SORMAS-Project by hzi-braunschweig.

the class AbstractBeanTest method createDiseaseConfigurations.

@Before
public void createDiseaseConfigurations() {
    List<DiseaseConfiguration> diseaseConfigurations = getDiseaseConfigurationService().getAll();
    List<Disease> configuredDiseases = diseaseConfigurations.stream().map(c -> c.getDisease()).collect(Collectors.toList());
    Arrays.stream(Disease.values()).filter(d -> !configuredDiseases.contains(d)).forEach(d -> {
        DiseaseConfiguration configuration = DiseaseConfiguration.build(d);
        getDiseaseConfigurationService().ensurePersisted(configuration);
    });
}
Also used : EventParticipantFacade(de.symeda.sormas.api.event.EventParticipantFacade) Arrays(java.util.Arrays) I18nProperties(de.symeda.sormas.api.i18n.I18nProperties) PathogenTestFacadeEjb(de.symeda.sormas.backend.sample.PathogenTestFacadeEjb) ImmunizationFacade(de.symeda.sormas.api.immunization.ImmunizationFacade) CommunityFacadeEjbLocal(de.symeda.sormas.backend.infrastructure.community.CommunityFacadeEjb.CommunityFacadeEjbLocal) BOMInputStream(org.apache.commons.io.input.BOMInputStream) RegionFacade(de.symeda.sormas.api.infrastructure.region.RegionFacade) UserRole(de.symeda.sormas.api.user.UserRole) EventFacadeEjbLocal(de.symeda.sormas.backend.event.EventFacadeEjb.EventFacadeEjbLocal) CurrentUserService(de.symeda.sormas.backend.user.CurrentUserService) CommunityFacade(de.symeda.sormas.api.infrastructure.community.CommunityFacade) CountryFacadeEjb(de.symeda.sormas.backend.infrastructure.country.CountryFacadeEjb) Reader(java.io.Reader) CharsetDecoder(java.nio.charset.CharsetDecoder) DistrictFacadeEjbLocal(de.symeda.sormas.backend.infrastructure.district.DistrictFacadeEjb.DistrictFacadeEjbLocal) Collectors(java.util.stream.Collectors) Language(de.symeda.sormas.api.Language) TravelEntryFacade(de.symeda.sormas.api.travelentry.TravelEntryFacade) StandardCharsets(java.nio.charset.StandardCharsets) ImmunizationFacadeEjb(de.symeda.sormas.backend.immunization.ImmunizationFacadeEjb) CaseImportFacade(de.symeda.sormas.api.caze.caseimport.CaseImportFacade) List(java.util.List) Query(javax.persistence.Query) UserService(de.symeda.sormas.backend.user.UserService) CaseFacadeEjbLocal(de.symeda.sormas.backend.caze.CaseFacadeEjb.CaseFacadeEjbLocal) DiseaseConfiguration(de.symeda.sormas.backend.disease.DiseaseConfiguration) ContactFacade(de.symeda.sormas.api.contact.ContactFacade) CSVUtils(de.symeda.sormas.api.utils.CSVUtils) CountryFacade(de.symeda.sormas.api.infrastructure.country.CountryFacade) ContactFacadeEjbLocal(de.symeda.sormas.backend.contact.ContactFacadeEjb.ContactFacadeEjbLocal) DiseaseConfigurationService(de.symeda.sormas.backend.disease.DiseaseConfigurationService) CSVReader(com.opencsv.CSVReader) PersonFacade(de.symeda.sormas.api.person.PersonFacade) CaseImportFacadeEjbLocal(de.symeda.sormas.backend.caze.caseimport.CaseImportFacadeEjb.CaseImportFacadeEjbLocal) SampleFacade(de.symeda.sormas.api.sample.SampleFacade) FacilityFacade(de.symeda.sormas.api.infrastructure.facility.FacilityFacade) EventParticipantFacadeEjbLocal(de.symeda.sormas.backend.event.EventParticipantFacadeEjb.EventParticipantFacadeEjbLocal) FacilityFacadeEjbLocal(de.symeda.sormas.backend.infrastructure.facility.FacilityFacadeEjb.FacilityFacadeEjbLocal) SampleFacadeEjb(de.symeda.sormas.backend.sample.SampleFacadeEjb) PersonFacadeEjbLocal(de.symeda.sormas.backend.person.PersonFacadeEjb.PersonFacadeEjbLocal) Before(org.junit.Before) EventFacade(de.symeda.sormas.api.event.EventFacade) TravelEntryFacadeEjb(de.symeda.sormas.backend.travelentry.TravelEntryFacadeEjb) UserDto(de.symeda.sormas.api.user.UserDto) CaseFacade(de.symeda.sormas.api.caze.CaseFacade) DistrictFacade(de.symeda.sormas.api.infrastructure.district.DistrictFacade) Mockito.when(org.mockito.Mockito.when) EntityManager(javax.persistence.EntityManager) InputStreamReader(java.io.InputStreamReader) PointOfEntryFacade(de.symeda.sormas.api.infrastructure.pointofentry.PointOfEntryFacade) Disease(de.symeda.sormas.api.Disease) PathogenTestFacade(de.symeda.sormas.api.sample.PathogenTestFacade) RegionFacadeEjbLocal(de.symeda.sormas.backend.infrastructure.region.RegionFacadeEjb.RegionFacadeEjbLocal) BufferedReader(java.io.BufferedReader) BaseBeanTest(info.novatec.beantest.api.BaseBeanTest) PointOfEntryFacadeEjbLocal(de.symeda.sormas.backend.infrastructure.pointofentry.PointOfEntryFacadeEjb.PointOfEntryFacadeEjbLocal) InputStream(java.io.InputStream) Disease(de.symeda.sormas.api.Disease) DiseaseConfiguration(de.symeda.sormas.backend.disease.DiseaseConfiguration) Before(org.junit.Before)

Aggregations

Disease (de.symeda.sormas.api.Disease)3 Language (de.symeda.sormas.api.Language)3 I18nProperties (de.symeda.sormas.api.i18n.I18nProperties)3 UserRole (de.symeda.sormas.api.user.UserRole)3 DiseaseConfiguration (de.symeda.sormas.backend.disease.DiseaseConfiguration)3 DiseaseConfigurationService (de.symeda.sormas.backend.disease.DiseaseConfigurationService)3 FacilityFacadeEjbLocal (de.symeda.sormas.backend.infrastructure.facility.FacilityFacadeEjb.FacilityFacadeEjbLocal)3 ConfigFacadeEjbLocal (de.symeda.sormas.backend.common.ConfigFacadeEjb.ConfigFacadeEjbLocal)2 ContactService (de.symeda.sormas.backend.contact.ContactService)2 DeletionConfigurationService (de.symeda.sormas.backend.deletionconfiguration.DeletionConfigurationService)2 ImportFacadeEjbLocal (de.symeda.sormas.backend.importexport.ImportFacadeEjb.ImportFacadeEjbLocal)2 CommunityService (de.symeda.sormas.backend.infrastructure.community.CommunityService)2 CountryService (de.symeda.sormas.backend.infrastructure.country.CountryService)2 DistrictService (de.symeda.sormas.backend.infrastructure.district.DistrictService)2 FacilityService (de.symeda.sormas.backend.infrastructure.facility.FacilityService)2 PointOfEntryService (de.symeda.sormas.backend.infrastructure.pointofentry.PointOfEntryService)2 RegionService (de.symeda.sormas.backend.infrastructure.region.RegionService)2 UserService (de.symeda.sormas.backend.user.UserService)2 Arrays (java.util.Arrays)2 List (java.util.List)2