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