Search in sources :

Example 6 with TaskDtoHelper

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

Aggregations

TaskDtoHelper (de.symeda.sormas.app.backend.task.TaskDtoHelper)6 AddTrace (com.google.firebase.perf.metrics.AddTrace)4 CaseDtoHelper (de.symeda.sormas.app.backend.caze.CaseDtoHelper)4 ClinicalVisitDtoHelper (de.symeda.sormas.app.backend.clinicalcourse.ClinicalVisitDtoHelper)4 ContactDtoHelper (de.symeda.sormas.app.backend.contact.ContactDtoHelper)4 EventDtoHelper (de.symeda.sormas.app.backend.event.EventDtoHelper)4 EventParticipantDtoHelper (de.symeda.sormas.app.backend.event.EventParticipantDtoHelper)4 ImmunizationDtoHelper (de.symeda.sormas.app.backend.immunization.ImmunizationDtoHelper)4 PersonDtoHelper (de.symeda.sormas.app.backend.person.PersonDtoHelper)4 AggregateReportDtoHelper (de.symeda.sormas.app.backend.report.AggregateReportDtoHelper)4 WeeklyReportDtoHelper (de.symeda.sormas.app.backend.report.WeeklyReportDtoHelper)4 AdditionalTestDtoHelper (de.symeda.sormas.app.backend.sample.AdditionalTestDtoHelper)4 PathogenTestDtoHelper (de.symeda.sormas.app.backend.sample.PathogenTestDtoHelper)4 SampleDtoHelper (de.symeda.sormas.app.backend.sample.SampleDtoHelper)4 PrescriptionDtoHelper (de.symeda.sormas.app.backend.therapy.PrescriptionDtoHelper)4 TreatmentDtoHelper (de.symeda.sormas.app.backend.therapy.TreatmentDtoHelper)4 VisitDtoHelper (de.symeda.sormas.app.backend.visit.VisitDtoHelper)4 CampaignFormDataDtoHelper (de.symeda.sormas.app.backend.campaign.data.CampaignFormDataDtoHelper)3 TaskDto (de.symeda.sormas.api.task.TaskDto)2 DaoException (de.symeda.sormas.app.backend.common.DaoException)2