use of de.symeda.sormas.app.backend.outbreak.OutbreakDtoHelper 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.outbreak.OutbreakDtoHelper 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);
}
}
Aggregations