Search in sources :

Example 1 with DiseaseConfigurationDtoHelper

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

the class SynchronizeDataAsync method repullData.

@AddTrace(name = "repullDataTrace")
private void repullData() throws DaoException, NoConnectionException, ServerConnectionException, ServerCommunicationException {
    PersonDtoHelper personDtoHelper = new PersonDtoHelper();
    CaseDtoHelper caseDtoHelper = new CaseDtoHelper();
    ImmunizationDtoHelper immunizationDtoHelper = new ImmunizationDtoHelper();
    EventDtoHelper eventDtoHelper = new EventDtoHelper();
    EventParticipantDtoHelper eventParticipantDtoHelper = new EventParticipantDtoHelper();
    SampleDtoHelper sampleDtoHelper = new SampleDtoHelper();
    PathogenTestDtoHelper pathogenTestDtoHelper = new PathogenTestDtoHelper();
    AdditionalTestDtoHelper additionalTestDtoHelper = new AdditionalTestDtoHelper();
    ContactDtoHelper contactDtoHelper = new ContactDtoHelper();
    VisitDtoHelper visitDtoHelper = new VisitDtoHelper();
    TaskDtoHelper taskDtoHelper = new TaskDtoHelper();
    WeeklyReportDtoHelper weeklyReportDtoHelper = new WeeklyReportDtoHelper();
    AggregateReportDtoHelper aggregateReportDtoHelper = new AggregateReportDtoHelper();
    PrescriptionDtoHelper prescriptionDtoHelper = new PrescriptionDtoHelper();
    TreatmentDtoHelper treatmentDtoHelper = new TreatmentDtoHelper();
    ClinicalVisitDtoHelper clinicalVisitDtoHelper = new ClinicalVisitDtoHelper();
    // order is important, due to dependencies (e.g. case & person)
    new UserRoleConfigDtoHelper().repullEntities(context);
    new DiseaseClassificationDtoHelper().repullEntities(context);
    new UserDtoHelper().repullEntities(context);
    new OutbreakDtoHelper().repullEntities(context);
    new DiseaseConfigurationDtoHelper().repullEntities(context);
    new CustomizableEnumValueDtoHelper().repullEntities(context);
    new FeatureConfigurationDtoHelper().repullEntities(context);
    personDtoHelper.repullEntities(context);
    caseDtoHelper.repullEntities(context);
    immunizationDtoHelper.repullEntities(context);
    eventDtoHelper.repullEntities(context);
    eventParticipantDtoHelper.repullEntities(context);
    sampleDtoHelper.repullEntities(context);
    pathogenTestDtoHelper.repullEntities(context);
    additionalTestDtoHelper.repullEntities(context);
    contactDtoHelper.repullEntities(context);
    visitDtoHelper.repullEntities(context);
    taskDtoHelper.repullEntities(context);
    weeklyReportDtoHelper.repullEntities(context);
    aggregateReportDtoHelper.repullEntities(context);
    prescriptionDtoHelper.repullEntities(context);
    treatmentDtoHelper.repullEntities(context);
    clinicalVisitDtoHelper.repullEntities(context);
    // Campaigns
    if (!DatabaseHelper.getFeatureConfigurationDao().isFeatureDisabled(FeatureType.CAMPAIGNS)) {
        final CampaignFormDataDtoHelper campaignFormDataDtoHelper = new CampaignFormDataDtoHelper();
        campaignFormDataDtoHelper.repullEntities(context);
    }
}
Also used : PersonDtoHelper(de.symeda.sormas.app.backend.person.PersonDtoHelper) ContactDtoHelper(de.symeda.sormas.app.backend.contact.ContactDtoHelper) EventDtoHelper(de.symeda.sormas.app.backend.event.EventDtoHelper) CaseDtoHelper(de.symeda.sormas.app.backend.caze.CaseDtoHelper) OutbreakDtoHelper(de.symeda.sormas.app.backend.outbreak.OutbreakDtoHelper) UserRoleConfigDtoHelper(de.symeda.sormas.app.backend.user.UserRoleConfigDtoHelper) UserDtoHelper(de.symeda.sormas.app.backend.user.UserDtoHelper) FeatureConfigurationDtoHelper(de.symeda.sormas.app.backend.feature.FeatureConfigurationDtoHelper) ClinicalVisitDtoHelper(de.symeda.sormas.app.backend.clinicalcourse.ClinicalVisitDtoHelper) VisitDtoHelper(de.symeda.sormas.app.backend.visit.VisitDtoHelper) TaskDtoHelper(de.symeda.sormas.app.backend.task.TaskDtoHelper) ImmunizationDtoHelper(de.symeda.sormas.app.backend.immunization.ImmunizationDtoHelper) SampleDtoHelper(de.symeda.sormas.app.backend.sample.SampleDtoHelper) ClinicalVisitDtoHelper(de.symeda.sormas.app.backend.clinicalcourse.ClinicalVisitDtoHelper) CustomizableEnumValueDtoHelper(de.symeda.sormas.app.backend.customizableenum.CustomizableEnumValueDtoHelper) CampaignFormDataDtoHelper(de.symeda.sormas.app.backend.campaign.data.CampaignFormDataDtoHelper) DiseaseConfigurationDtoHelper(de.symeda.sormas.app.backend.disease.DiseaseConfigurationDtoHelper) TreatmentDtoHelper(de.symeda.sormas.app.backend.therapy.TreatmentDtoHelper) WeeklyReportDtoHelper(de.symeda.sormas.app.backend.report.WeeklyReportDtoHelper) EventParticipantDtoHelper(de.symeda.sormas.app.backend.event.EventParticipantDtoHelper) DiseaseClassificationDtoHelper(de.symeda.sormas.app.backend.classification.DiseaseClassificationDtoHelper) PathogenTestDtoHelper(de.symeda.sormas.app.backend.sample.PathogenTestDtoHelper) AggregateReportDtoHelper(de.symeda.sormas.app.backend.report.AggregateReportDtoHelper) PrescriptionDtoHelper(de.symeda.sormas.app.backend.therapy.PrescriptionDtoHelper) AdditionalTestDtoHelper(de.symeda.sormas.app.backend.sample.AdditionalTestDtoHelper) AddTrace(com.google.firebase.perf.metrics.AddTrace)

Example 2 with DiseaseConfigurationDtoHelper

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

the class SynchronizeDataAsync method pullMissingAndDeleteInvalidInfrastructure.

@AddTrace(name = "pullMissingAndDeleteInvalidInfrastructureTrace")
private void pullMissingAndDeleteInvalidInfrastructure() throws NoConnectionException, ServerConnectionException, ServerCommunicationException, DaoException {
    // ATTENTION: Since we are working with UUID lists we have no type safety. Look for typos!
    Log.d(SynchronizeDataAsync.class.getSimpleName(), "pullMissingAndDeleteInvalidInfrastructure");
    // TODO get a count first and only retrieve all uuids when count is different?
    // users
    List<String> userUuids = executeUuidCall(RetroProvider.getUserFacade().pullUuids());
    DatabaseHelper.getUserDao().deleteInvalid(userUuids);
    // disease configurations
    List<String> diseaseConfigurationUuids = executeUuidCall(RetroProvider.getDiseaseConfigurationFacade().pullUuids());
    DatabaseHelper.getDiseaseConfigurationDao().deleteInvalid(diseaseConfigurationUuids);
    // Disease variants
    List<String> customizableEnumValueUuids = executeUuidCall(RetroProvider.getCustomizableEnumValueFacade().pullUuids());
    DatabaseHelper.getCustomizableEnumValueDao().deleteInvalid(customizableEnumValueUuids);
    // feature configurations
    List<String> featureConfigurationUuids = executeUuidCall(RetroProvider.getFeatureConfigurationFacade().pullUuids());
    DatabaseHelper.getFeatureConfigurationDao().deleteInvalid(featureConfigurationUuids);
    // user role config
    List<String> userRoleConfigUuids = executeUuidCall(RetroProvider.getUserRoleConfigFacade().pullUuids());
    DatabaseHelper.getUserRoleConfigDao().deleteInvalid(userRoleConfigUuids);
    // points of entry
    List<String> pointOfEntryUuids = executeUuidCall(RetroProvider.getPointOfEntryFacade().pullUuids());
    DatabaseHelper.getPointOfEntryDao().deleteInvalid(pointOfEntryUuids);
    // facilities
    List<String> facilityUuids = executeUuidCall(RetroProvider.getFacilityFacade().pullUuids());
    DatabaseHelper.getFacilityDao().deleteInvalid(facilityUuids);
    // communities
    List<String> communityUuids = executeUuidCall(RetroProvider.getCommunityFacade().pullUuids());
    DatabaseHelper.getCommunityDao().deleteInvalid(communityUuids);
    // districts
    List<String> districtUuids = executeUuidCall(RetroProvider.getDistrictFacade().pullUuids());
    DatabaseHelper.getDistrictDao().deleteInvalid(districtUuids);
    // regions
    List<String> regionUuids = executeUuidCall(RetroProvider.getRegionFacade().pullUuids());
    DatabaseHelper.getRegionDao().deleteInvalid(regionUuids);
    // areas
    List<String> areaUuids = executeUuidCall(RetroProvider.getAreaFacade().pullUuids());
    DatabaseHelper.getAreaDao().deleteInvalid(areaUuids);
    // countries
    List<String> countryUuids = executeUuidCall(RetroProvider.getCountryFacade().pullUuids());
    DatabaseHelper.getCountryDao().deleteInvalid(countryUuids);
    // subcontinents
    List<String> subcontinentUuids = executeUuidCall(RetroProvider.getSubcontinentFacade().pullUuids());
    DatabaseHelper.getSubcontinentDao().deleteInvalid(subcontinentUuids);
    // continents
    List<String> continentUuids = executeUuidCall(RetroProvider.getContinentFacade().pullUuids());
    DatabaseHelper.getContinentDao().deleteInvalid(continentUuids);
    // order is important, due to dependencies
    new ContinentDtoHelper().pullMissing(continentUuids);
    new SubcontinentDtoHelper().pullMissing(subcontinentUuids);
    new CountryDtoHelper().pullMissing(countryUuids);
    if (!DatabaseHelper.getFeatureConfigurationDao().isFeatureDisabled(FeatureType.INFRASTRUCTURE_TYPE_AREA)) {
        new AreaDtoHelper().pullMissing(areaUuids);
    }
    new RegionDtoHelper().pullMissing(regionUuids);
    new DistrictDtoHelper().pullMissing(districtUuids);
    new CommunityDtoHelper().pullMissing(communityUuids);
    new FacilityDtoHelper().pullMissing(facilityUuids);
    new PointOfEntryDtoHelper().pullMissing(pointOfEntryUuids);
    new UserRoleConfigDtoHelper().pullMissing(userRoleConfigUuids);
    new UserDtoHelper().pullMissing(userUuids);
    new DiseaseConfigurationDtoHelper().pullMissing(diseaseConfigurationUuids);
    new CustomizableEnumValueDtoHelper().pullMissing(customizableEnumValueUuids);
    new FeatureConfigurationDtoHelper().pullMissing(featureConfigurationUuids);
    if (!DatabaseHelper.getFeatureConfigurationDao().isFeatureDisabled(FeatureType.CAMPAIGNS)) {
        // campaigns
        List<String> campaignUuids = executeUuidCall(RetroProvider.getCampaignFacade().pullUuids());
        DatabaseHelper.getCampaignDao().deleteInvalid(campaignUuids);
        // campaignFormMetas
        List<String> campaignFormMetaUuids = executeUuidCall(RetroProvider.getCampaignFormMetaFacade().pullUuids());
        DatabaseHelper.getCampaignFormMetaDao().deleteInvalid(campaignFormMetaUuids);
        new CampaignFormMetaDtoHelper().pullMissing(campaignFormMetaUuids);
        new CampaignDtoHelper().pullMissing(campaignUuids);
    }
}
Also used : RegionDtoHelper(de.symeda.sormas.app.backend.region.RegionDtoHelper) DistrictDtoHelper(de.symeda.sormas.app.backend.region.DistrictDtoHelper) ContinentDtoHelper(de.symeda.sormas.app.backend.region.ContinentDtoHelper) CommunityDtoHelper(de.symeda.sormas.app.backend.region.CommunityDtoHelper) FacilityDtoHelper(de.symeda.sormas.app.backend.facility.FacilityDtoHelper) UserRoleConfigDtoHelper(de.symeda.sormas.app.backend.user.UserRoleConfigDtoHelper) UserDtoHelper(de.symeda.sormas.app.backend.user.UserDtoHelper) FeatureConfigurationDtoHelper(de.symeda.sormas.app.backend.feature.FeatureConfigurationDtoHelper) CustomizableEnumValueDtoHelper(de.symeda.sormas.app.backend.customizableenum.CustomizableEnumValueDtoHelper) DiseaseConfigurationDtoHelper(de.symeda.sormas.app.backend.disease.DiseaseConfigurationDtoHelper) CampaignFormMetaDtoHelper(de.symeda.sormas.app.backend.campaign.form.CampaignFormMetaDtoHelper) CampaignDtoHelper(de.symeda.sormas.app.backend.campaign.CampaignDtoHelper) AreaDtoHelper(de.symeda.sormas.app.backend.region.AreaDtoHelper) CountryDtoHelper(de.symeda.sormas.app.backend.region.CountryDtoHelper) PointOfEntryDtoHelper(de.symeda.sormas.app.backend.infrastructure.PointOfEntryDtoHelper) SubcontinentDtoHelper(de.symeda.sormas.app.backend.region.SubcontinentDtoHelper) AddTrace(com.google.firebase.perf.metrics.AddTrace)

Example 3 with DiseaseConfigurationDtoHelper

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

the class SynchronizeDataAsync method pullInitialInfrastructure.

@AddTrace(name = "pullInitialInfrastructureTrace")
private void pullInitialInfrastructure() throws DaoException, ServerCommunicationException, ServerConnectionException, NoConnectionException {
    new ContinentDtoHelper().pullEntities(false, context);
    new SubcontinentDtoHelper().pullEntities(false, context);
    new CountryDtoHelper().pullEntities(false, context);
    if (!DatabaseHelper.getFeatureConfigurationDao().isFeatureDisabled(FeatureType.INFRASTRUCTURE_TYPE_AREA)) {
        new AreaDtoHelper().pullEntities(false, context);
    }
    new RegionDtoHelper().pullEntities(false, context);
    new DistrictDtoHelper().pullEntities(false, context);
    new CommunityDtoHelper().pullEntities(false, context);
    new FacilityDtoHelper().pullEntities(false, context);
    new PointOfEntryDtoHelper().pullEntities(false, context);
    new UserDtoHelper().pullEntities(false, context);
    new DiseaseClassificationDtoHelper().pullEntities(false, context);
    new DiseaseConfigurationDtoHelper().pullEntities(false, context);
    new CustomizableEnumValueDtoHelper().pullEntities(false, context);
    // user role configurations may be removed, so have to pull the deleted uuids
    // this may be applied to other entities later as well
    Date latestChangeDate = DatabaseHelper.getUserRoleConfigDao().getLatestChangeDate();
    List<String> userRoleConfigUuids = executeUuidCall(RetroProvider.getUserRoleConfigFacade().pullDeletedUuidsSince(latestChangeDate != null ? latestChangeDate.getTime() : 0));
    DatabaseHelper.getUserRoleConfigDao().delete(userRoleConfigUuids);
    new UserRoleConfigDtoHelper().pullEntities(false, context);
    Date featureConfigurationChangeDate = DatabaseHelper.getFeatureConfigurationDao().getLatestChangeDate();
    List<String> featureConfigurationConfigUuids = executeUuidCall(RetroProvider.getFeatureConfigurationFacade().pullDeletedUuidsSince(featureConfigurationChangeDate != null ? featureConfigurationChangeDate.getTime() : 0));
    DatabaseHelper.getFeatureConfigurationDao().delete(featureConfigurationConfigUuids);
    new FeatureConfigurationDtoHelper().pullEntities(false, context);
    if (!DatabaseHelper.getFeatureConfigurationDao().isFeatureDisabled(FeatureType.CAMPAIGNS)) {
        new CampaignFormMetaDtoHelper().pullEntities(false, context);
        new CampaignDtoHelper().pullEntities(false, context);
    }
    ConfigProvider.setInitialSyncRequired(false);
}
Also used : RegionDtoHelper(de.symeda.sormas.app.backend.region.RegionDtoHelper) DistrictDtoHelper(de.symeda.sormas.app.backend.region.DistrictDtoHelper) ContinentDtoHelper(de.symeda.sormas.app.backend.region.ContinentDtoHelper) CommunityDtoHelper(de.symeda.sormas.app.backend.region.CommunityDtoHelper) FacilityDtoHelper(de.symeda.sormas.app.backend.facility.FacilityDtoHelper) UserDtoHelper(de.symeda.sormas.app.backend.user.UserDtoHelper) UserRoleConfigDtoHelper(de.symeda.sormas.app.backend.user.UserRoleConfigDtoHelper) FeatureConfigurationDtoHelper(de.symeda.sormas.app.backend.feature.FeatureConfigurationDtoHelper) Date(java.util.Date) CustomizableEnumValueDtoHelper(de.symeda.sormas.app.backend.customizableenum.CustomizableEnumValueDtoHelper) DiseaseConfigurationDtoHelper(de.symeda.sormas.app.backend.disease.DiseaseConfigurationDtoHelper) CampaignFormMetaDtoHelper(de.symeda.sormas.app.backend.campaign.form.CampaignFormMetaDtoHelper) CampaignDtoHelper(de.symeda.sormas.app.backend.campaign.CampaignDtoHelper) AreaDtoHelper(de.symeda.sormas.app.backend.region.AreaDtoHelper) DiseaseClassificationDtoHelper(de.symeda.sormas.app.backend.classification.DiseaseClassificationDtoHelper) CountryDtoHelper(de.symeda.sormas.app.backend.region.CountryDtoHelper) PointOfEntryDtoHelper(de.symeda.sormas.app.backend.infrastructure.PointOfEntryDtoHelper) SubcontinentDtoHelper(de.symeda.sormas.app.backend.region.SubcontinentDtoHelper) AddTrace(com.google.firebase.perf.metrics.AddTrace)

Example 4 with DiseaseConfigurationDtoHelper

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

the class SynchronizeDataAsync method synchronizeChangedData.

@AddTrace(name = "synchronizeChangedDataTrace")
private void synchronizeChangedData() throws DaoException, NoConnectionException, ServerConnectionException, ServerCommunicationException {
    PersonDtoHelper personDtoHelper = new PersonDtoHelper();
    CaseDtoHelper caseDtoHelper = new CaseDtoHelper();
    ImmunizationDtoHelper immunizationDtoHelper = new ImmunizationDtoHelper();
    EventDtoHelper eventDtoHelper = new EventDtoHelper();
    EventParticipantDtoHelper eventParticipantDtoHelper = new EventParticipantDtoHelper();
    SampleDtoHelper sampleDtoHelper = new SampleDtoHelper();
    PathogenTestDtoHelper pathogenTestDtoHelper = new PathogenTestDtoHelper();
    AdditionalTestDtoHelper additionalTestDtoHelper = new AdditionalTestDtoHelper();
    ContactDtoHelper contactDtoHelper = new ContactDtoHelper();
    VisitDtoHelper visitDtoHelper = new VisitDtoHelper();
    TaskDtoHelper taskDtoHelper = new TaskDtoHelper();
    WeeklyReportDtoHelper weeklyReportDtoHelper = new WeeklyReportDtoHelper();
    AggregateReportDtoHelper aggregateReportDtoHelper = new AggregateReportDtoHelper();
    PrescriptionDtoHelper prescriptionDtoHelper = new PrescriptionDtoHelper();
    TreatmentDtoHelper treatmentDtoHelper = new TreatmentDtoHelper();
    ClinicalVisitDtoHelper clinicalVisitDtoHelper = new ClinicalVisitDtoHelper();
    // order is important, due to dependencies (e.g. case & person)
    new OutbreakDtoHelper().pullEntities(false, context);
    new DiseaseConfigurationDtoHelper().pullEntities(false, context);
    new CustomizableEnumValueDtoHelper().pullEntities(false, context);
    boolean personsNeedPull = personDtoHelper.pullAndPushEntities(context);
    boolean casesNeedPull = caseDtoHelper.pullAndPushEntities(context);
    boolean immunizationsNeedPull = immunizationDtoHelper.pullAndPushEntities(context);
    boolean eventsNeedPull = eventDtoHelper.pullAndPushEntities(context);
    boolean eventParticipantsNeedPull = eventParticipantDtoHelper.pullAndPushEntities(context);
    boolean samplesNeedPull = sampleDtoHelper.pullAndPushEntities(context);
    boolean sampleTestsNeedPull = pathogenTestDtoHelper.pullAndPushEntities(context);
    boolean additionalTestsNeedPull = additionalTestDtoHelper.pullAndPushEntities(context);
    boolean contactsNeedPull = contactDtoHelper.pullAndPushEntities(context);
    boolean visitsNeedPull = visitDtoHelper.pullAndPushEntities(context);
    boolean tasksNeedPull = taskDtoHelper.pullAndPushEntities(context);
    boolean weeklyReportsNeedPull = weeklyReportDtoHelper.pullAndPushEntities(context);
    boolean aggregateReportsNeedPull = aggregateReportDtoHelper.pullAndPushEntities(context);
    boolean prescriptionsNeedPull = prescriptionDtoHelper.pullAndPushEntities(context);
    boolean treatmentsNeedPull = treatmentDtoHelper.pullAndPushEntities(context);
    boolean clinicalVisitsNeedPull = clinicalVisitDtoHelper.pullAndPushEntities(context);
    casesNeedPull |= clinicalVisitsNeedPull;
    if (personsNeedPull)
        personDtoHelper.pullEntities(true, context);
    if (casesNeedPull)
        caseDtoHelper.pullEntities(true, context);
    if (immunizationsNeedPull)
        immunizationDtoHelper.pullEntities(true, context);
    if (eventsNeedPull)
        eventDtoHelper.pullEntities(true, context);
    if (eventParticipantsNeedPull)
        eventParticipantDtoHelper.pullEntities(true, context);
    if (samplesNeedPull)
        sampleDtoHelper.pullEntities(true, context);
    if (sampleTestsNeedPull)
        pathogenTestDtoHelper.pullEntities(true, context);
    if (additionalTestsNeedPull)
        additionalTestDtoHelper.pullEntities(true, context);
    if (contactsNeedPull)
        contactDtoHelper.pullEntities(true, context);
    if (visitsNeedPull)
        visitDtoHelper.pullEntities(true, context);
    if (tasksNeedPull)
        taskDtoHelper.pullEntities(true, context);
    if (weeklyReportsNeedPull)
        weeklyReportDtoHelper.pullEntities(true, context);
    if (aggregateReportsNeedPull)
        aggregateReportDtoHelper.pullEntities(true, context);
    if (prescriptionsNeedPull)
        prescriptionDtoHelper.pullEntities(true, context);
    if (treatmentsNeedPull)
        treatmentDtoHelper.pullEntities(true, context);
    if (clinicalVisitsNeedPull)
        clinicalVisitDtoHelper.pullEntities(true, context);
    // Campaigns
    if (!DatabaseHelper.getFeatureConfigurationDao().isFeatureDisabled(FeatureType.CAMPAIGNS)) {
        final CampaignFormDataDtoHelper campaignFormDataDtoHelper = new CampaignFormDataDtoHelper();
        if (campaignFormDataDtoHelper.pullAndPushEntities(context))
            campaignFormDataDtoHelper.pullEntities(true, context);
    }
}
Also used : PersonDtoHelper(de.symeda.sormas.app.backend.person.PersonDtoHelper) ContactDtoHelper(de.symeda.sormas.app.backend.contact.ContactDtoHelper) EventDtoHelper(de.symeda.sormas.app.backend.event.EventDtoHelper) CaseDtoHelper(de.symeda.sormas.app.backend.caze.CaseDtoHelper) OutbreakDtoHelper(de.symeda.sormas.app.backend.outbreak.OutbreakDtoHelper) ClinicalVisitDtoHelper(de.symeda.sormas.app.backend.clinicalcourse.ClinicalVisitDtoHelper) VisitDtoHelper(de.symeda.sormas.app.backend.visit.VisitDtoHelper) TaskDtoHelper(de.symeda.sormas.app.backend.task.TaskDtoHelper) ImmunizationDtoHelper(de.symeda.sormas.app.backend.immunization.ImmunizationDtoHelper) SampleDtoHelper(de.symeda.sormas.app.backend.sample.SampleDtoHelper) ClinicalVisitDtoHelper(de.symeda.sormas.app.backend.clinicalcourse.ClinicalVisitDtoHelper) CustomizableEnumValueDtoHelper(de.symeda.sormas.app.backend.customizableenum.CustomizableEnumValueDtoHelper) CampaignFormDataDtoHelper(de.symeda.sormas.app.backend.campaign.data.CampaignFormDataDtoHelper) DiseaseConfigurationDtoHelper(de.symeda.sormas.app.backend.disease.DiseaseConfigurationDtoHelper) TreatmentDtoHelper(de.symeda.sormas.app.backend.therapy.TreatmentDtoHelper) WeeklyReportDtoHelper(de.symeda.sormas.app.backend.report.WeeklyReportDtoHelper) EventParticipantDtoHelper(de.symeda.sormas.app.backend.event.EventParticipantDtoHelper) PathogenTestDtoHelper(de.symeda.sormas.app.backend.sample.PathogenTestDtoHelper) AggregateReportDtoHelper(de.symeda.sormas.app.backend.report.AggregateReportDtoHelper) PrescriptionDtoHelper(de.symeda.sormas.app.backend.therapy.PrescriptionDtoHelper) AdditionalTestDtoHelper(de.symeda.sormas.app.backend.sample.AdditionalTestDtoHelper) AddTrace(com.google.firebase.perf.metrics.AddTrace)

Example 5 with DiseaseConfigurationDtoHelper

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

the class InfrastructureHelper method handlePulledInfrastructureData.

public static void handlePulledInfrastructureData(InfrastructureSyncDto infrastructureData) throws DaoException, NoConnectionException, ServerConnectionException, ServerCommunicationException {
    new ContinentDtoHelper().handlePulledList(DatabaseHelper.getContinentDao(), infrastructureData.getContinents());
    new SubcontinentDtoHelper().handlePulledList(DatabaseHelper.getSubcontinentDao(), infrastructureData.getSubcontinents());
    new CountryDtoHelper().handlePulledList(DatabaseHelper.getCountryDao(), infrastructureData.getCountries());
    if (!DatabaseHelper.getFeatureConfigurationDao().isFeatureDisabled(FeatureType.INFRASTRUCTURE_TYPE_AREA)) {
        new AreaDtoHelper().handlePulledList(DatabaseHelper.getAreaDao(), infrastructureData.getAreas());
    }
    new RegionDtoHelper().handlePulledList(DatabaseHelper.getRegionDao(), infrastructureData.getRegions());
    new DistrictDtoHelper().handlePulledList(DatabaseHelper.getDistrictDao(), infrastructureData.getDistricts());
    new CommunityDtoHelper().handlePulledList(DatabaseHelper.getCommunityDao(), infrastructureData.getCommunities());
    new FacilityDtoHelper().handlePulledList(DatabaseHelper.getFacilityDao(), infrastructureData.getFacilities());
    new PointOfEntryDtoHelper().handlePulledList(DatabaseHelper.getPointOfEntryDao(), infrastructureData.getPointsOfEntry());
    new UserDtoHelper().handlePulledList(DatabaseHelper.getUserDao(), infrastructureData.getUsers());
    new DiseaseClassificationDtoHelper().handlePulledList(DatabaseHelper.getDiseaseClassificationCriteriaDao(), infrastructureData.getDiseaseClassifications());
    new DiseaseConfigurationDtoHelper().handlePulledList(DatabaseHelper.getDiseaseConfigurationDao(), infrastructureData.getDiseaseConfigurations());
    DatabaseHelper.getUserRoleConfigDao().delete(infrastructureData.getDeletedUserRoleConfigurationUuids());
    new UserRoleConfigDtoHelper().handlePulledList(DatabaseHelper.getUserRoleConfigDao(), infrastructureData.getUserRoleConfigurations());
    DatabaseHelper.getFeatureConfigurationDao().delete(infrastructureData.getDeletedFeatureConfigurationUuids());
    new FeatureConfigurationDtoHelper().handlePulledList(DatabaseHelper.getFeatureConfigurationDao(), infrastructureData.getFeatureConfigurations());
    if (!DatabaseHelper.getFeatureConfigurationDao().isFeatureDisabled(FeatureType.CAMPAIGNS)) {
        new CampaignDtoHelper().handlePulledList(DatabaseHelper.getCampaignDao(), infrastructureData.getCampaigns());
        new CampaignFormMetaDtoHelper().handlePulledList(DatabaseHelper.getCampaignFormMetaDao(), infrastructureData.getCampaignFormMetas());
    }
}
Also used : RegionDtoHelper(de.symeda.sormas.app.backend.region.RegionDtoHelper) DistrictDtoHelper(de.symeda.sormas.app.backend.region.DistrictDtoHelper) ContinentDtoHelper(de.symeda.sormas.app.backend.region.ContinentDtoHelper) CommunityDtoHelper(de.symeda.sormas.app.backend.region.CommunityDtoHelper) FacilityDtoHelper(de.symeda.sormas.app.backend.facility.FacilityDtoHelper) UserDtoHelper(de.symeda.sormas.app.backend.user.UserDtoHelper) UserRoleConfigDtoHelper(de.symeda.sormas.app.backend.user.UserRoleConfigDtoHelper) FeatureConfigurationDtoHelper(de.symeda.sormas.app.backend.feature.FeatureConfigurationDtoHelper) DiseaseConfigurationDtoHelper(de.symeda.sormas.app.backend.disease.DiseaseConfigurationDtoHelper) CampaignFormMetaDtoHelper(de.symeda.sormas.app.backend.campaign.form.CampaignFormMetaDtoHelper) CampaignDtoHelper(de.symeda.sormas.app.backend.campaign.CampaignDtoHelper) AreaDtoHelper(de.symeda.sormas.app.backend.region.AreaDtoHelper) DiseaseClassificationDtoHelper(de.symeda.sormas.app.backend.classification.DiseaseClassificationDtoHelper) CountryDtoHelper(de.symeda.sormas.app.backend.region.CountryDtoHelper) SubcontinentDtoHelper(de.symeda.sormas.app.backend.region.SubcontinentDtoHelper)

Aggregations

DiseaseConfigurationDtoHelper (de.symeda.sormas.app.backend.disease.DiseaseConfigurationDtoHelper)5 AddTrace (com.google.firebase.perf.metrics.AddTrace)4 CustomizableEnumValueDtoHelper (de.symeda.sormas.app.backend.customizableenum.CustomizableEnumValueDtoHelper)4 FeatureConfigurationDtoHelper (de.symeda.sormas.app.backend.feature.FeatureConfigurationDtoHelper)4 UserDtoHelper (de.symeda.sormas.app.backend.user.UserDtoHelper)4 UserRoleConfigDtoHelper (de.symeda.sormas.app.backend.user.UserRoleConfigDtoHelper)4 CampaignDtoHelper (de.symeda.sormas.app.backend.campaign.CampaignDtoHelper)3 CampaignFormMetaDtoHelper (de.symeda.sormas.app.backend.campaign.form.CampaignFormMetaDtoHelper)3 DiseaseClassificationDtoHelper (de.symeda.sormas.app.backend.classification.DiseaseClassificationDtoHelper)3 FacilityDtoHelper (de.symeda.sormas.app.backend.facility.FacilityDtoHelper)3 AreaDtoHelper (de.symeda.sormas.app.backend.region.AreaDtoHelper)3 CommunityDtoHelper (de.symeda.sormas.app.backend.region.CommunityDtoHelper)3 ContinentDtoHelper (de.symeda.sormas.app.backend.region.ContinentDtoHelper)3 CountryDtoHelper (de.symeda.sormas.app.backend.region.CountryDtoHelper)3 DistrictDtoHelper (de.symeda.sormas.app.backend.region.DistrictDtoHelper)3 RegionDtoHelper (de.symeda.sormas.app.backend.region.RegionDtoHelper)3 SubcontinentDtoHelper (de.symeda.sormas.app.backend.region.SubcontinentDtoHelper)3 CampaignFormDataDtoHelper (de.symeda.sormas.app.backend.campaign.data.CampaignFormDataDtoHelper)2 CaseDtoHelper (de.symeda.sormas.app.backend.caze.CaseDtoHelper)2 ClinicalVisitDtoHelper (de.symeda.sormas.app.backend.clinicalcourse.ClinicalVisitDtoHelper)2