Search in sources :

Example 1 with OutbreakDtoHelper

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

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

AddTrace (com.google.firebase.perf.metrics.AddTrace)2 CampaignFormDataDtoHelper (de.symeda.sormas.app.backend.campaign.data.CampaignFormDataDtoHelper)2 CaseDtoHelper (de.symeda.sormas.app.backend.caze.CaseDtoHelper)2 ClinicalVisitDtoHelper (de.symeda.sormas.app.backend.clinicalcourse.ClinicalVisitDtoHelper)2 ContactDtoHelper (de.symeda.sormas.app.backend.contact.ContactDtoHelper)2 CustomizableEnumValueDtoHelper (de.symeda.sormas.app.backend.customizableenum.CustomizableEnumValueDtoHelper)2 DiseaseConfigurationDtoHelper (de.symeda.sormas.app.backend.disease.DiseaseConfigurationDtoHelper)2 EventDtoHelper (de.symeda.sormas.app.backend.event.EventDtoHelper)2 EventParticipantDtoHelper (de.symeda.sormas.app.backend.event.EventParticipantDtoHelper)2 ImmunizationDtoHelper (de.symeda.sormas.app.backend.immunization.ImmunizationDtoHelper)2 OutbreakDtoHelper (de.symeda.sormas.app.backend.outbreak.OutbreakDtoHelper)2 PersonDtoHelper (de.symeda.sormas.app.backend.person.PersonDtoHelper)2 AggregateReportDtoHelper (de.symeda.sormas.app.backend.report.AggregateReportDtoHelper)2 WeeklyReportDtoHelper (de.symeda.sormas.app.backend.report.WeeklyReportDtoHelper)2 AdditionalTestDtoHelper (de.symeda.sormas.app.backend.sample.AdditionalTestDtoHelper)2 PathogenTestDtoHelper (de.symeda.sormas.app.backend.sample.PathogenTestDtoHelper)2 SampleDtoHelper (de.symeda.sormas.app.backend.sample.SampleDtoHelper)2 TaskDtoHelper (de.symeda.sormas.app.backend.task.TaskDtoHelper)2 PrescriptionDtoHelper (de.symeda.sormas.app.backend.therapy.PrescriptionDtoHelper)2 TreatmentDtoHelper (de.symeda.sormas.app.backend.therapy.TreatmentDtoHelper)2