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);
}
}
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);
}
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());
}
}
Aggregations