Search in sources :

Example 1 with DiseaseClassificationDtoHelper

use of de.symeda.sormas.app.backend.classification.DiseaseClassificationDtoHelper 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 DiseaseClassificationDtoHelper

use of de.symeda.sormas.app.backend.classification.DiseaseClassificationDtoHelper 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 3 with DiseaseClassificationDtoHelper

use of de.symeda.sormas.app.backend.classification.DiseaseClassificationDtoHelper 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

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