use of de.symeda.sormas.app.backend.immunization.ImmunizationDtoHelper 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.immunization.ImmunizationDtoHelper in project SORMAS-Project by hzi-braunschweig.
the class SynchronizeDataAsync method pushNewPullMissingAndDeleteInvalidData.
@AddTrace(name = "pushNewPullMissingAndDeleteInvalidDataTrace")
private void pushNewPullMissingAndDeleteInvalidData() throws NoConnectionException, ServerConnectionException, ServerCommunicationException, DaoException {
// ATTENTION: Since we are working with UUID lists we have no type safety. Look for typos!
Log.d(SynchronizeDataAsync.class.getSimpleName(), "pushNewPullMissingAndDeleteInvalidData");
// order is important, due to dependencies (e.g. case & person)
// first push everything that has been CREATED by the user - otherwise this data my lose it's references to other entities.
// Example: Case is created using an existing person, meanwhile user loses access to the person
pushNewData();
// weekly reports and entries
List<String> weeklyReportUuids = executeUuidCall(RetroProvider.getWeeklyReportFacade().pullUuids());
DatabaseHelper.getWeeklyReportDao().deleteInvalid(weeklyReportUuids);
// aggregate reports
List<String> aggregateReportUuids = executeUuidCall(RetroProvider.getAggregateReportFacade().pullUuids());
DatabaseHelper.getAggregateReportDao().deleteInvalid(aggregateReportUuids);
// tasks
List<String> taskUuids = executeUuidCall(RetroProvider.getTaskFacade().pullUuids());
DatabaseHelper.getTaskDao().deleteInvalid(taskUuids);
// visits
List<String> visitUuids = executeUuidCall(RetroProvider.getVisitFacade().pullUuids());
DatabaseHelper.getVisitDao().deleteInvalid(visitUuids);
// contacts
List<String> contactUuids = executeUuidCall(RetroProvider.getContactFacade().pullUuids());
DatabaseHelper.getContactDao().deleteInvalid(contactUuids);
// sample tests
List<String> sampleTestUuids = executeUuidCall(RetroProvider.getSampleTestFacade().pullUuids());
DatabaseHelper.getSampleTestDao().deleteInvalid(sampleTestUuids);
// additional tests
List<String> additionalTestUuids = executeUuidCall(RetroProvider.getAdditionalTestFacade().pullUuids());
DatabaseHelper.getAdditionalTestDao().deleteInvalid(additionalTestUuids);
// samples
List<String> sampleUuids = executeUuidCall(RetroProvider.getSampleFacade().pullUuids());
DatabaseHelper.getSampleDao().deleteInvalid(sampleUuids);
// event participants
List<String> eventParticipantUuids = executeUuidCall(RetroProvider.getEventParticipantFacade().pullUuids());
DatabaseHelper.getEventParticipantDao().deleteInvalid(eventParticipantUuids);
// events
List<String> eventUuids = executeUuidCall(RetroProvider.getEventFacade().pullUuids());
DatabaseHelper.getEventDao().deleteInvalid(eventUuids);
// treatments
List<String> treatmentUuids = executeUuidCall(RetroProvider.getTreatmentFacade().pullUuids());
DatabaseHelper.getTreatmentDao().deleteInvalid(treatmentUuids);
// prescriptions
List<String> prescriptionUuids = executeUuidCall(RetroProvider.getPrescriptionFacade().pullUuids());
DatabaseHelper.getPrescriptionDao().deleteInvalid(prescriptionUuids);
// clinical visits
List<String> clinicalVisitUuids = executeUuidCall(RetroProvider.getClinicalVisitFacade().pullUuids());
DatabaseHelper.getClinicalVisitDao().deleteInvalid(clinicalVisitUuids);
// immunizations
List<String> immunizationUuids = executeUuidCall(RetroProvider.getImmunizationFacade().pullUuids());
DatabaseHelper.getImmunizationDao().deleteInvalid(immunizationUuids);
// cases
List<String> caseUuids = executeUuidCall(RetroProvider.getCaseFacade().pullUuids());
DatabaseHelper.getCaseDao().deleteInvalid(caseUuids);
// persons
List<String> personUuids = executeUuidCall(RetroProvider.getPersonFacade().pullUuids());
DatabaseHelper.getPersonDao().deleteInvalid(personUuids);
// outbreak
List<String> outbreakUuids = executeUuidCall(RetroProvider.getOutbreakFacade().pullActiveUuids());
DatabaseHelper.getOutbreakDao().deleteInvalid(outbreakUuids);
// order is important, due to dependencies (e.g. case & person)
new PersonDtoHelper().pullMissing(personUuids);
new CaseDtoHelper().pullMissing(caseUuids);
new ImmunizationDtoHelper().pullMissing(caseUuids);
new PrescriptionDtoHelper().pullMissing(prescriptionUuids);
new TreatmentDtoHelper().pullMissing(treatmentUuids);
new EventDtoHelper().pullMissing(eventUuids);
new EventParticipantDtoHelper().pullMissing(eventParticipantUuids);
new SampleDtoHelper().pullMissing(sampleUuids);
new AdditionalTestDtoHelper().pullMissing(additionalTestUuids);
new PathogenTestDtoHelper().pullMissing(sampleTestUuids);
new ContactDtoHelper().pullMissing(contactUuids);
new VisitDtoHelper().pullMissing(visitUuids);
new TaskDtoHelper().pullMissing(taskUuids);
new WeeklyReportDtoHelper().pullMissing(weeklyReportUuids);
new AggregateReportDtoHelper().pullMissing(aggregateReportUuids);
new PrescriptionDtoHelper().pullMissing(prescriptionUuids);
new TreatmentDtoHelper().pullMissing(treatmentUuids);
new ClinicalVisitDtoHelper().pullMissing(clinicalVisitUuids);
// CampaignData
if (!DatabaseHelper.getFeatureConfigurationDao().isFeatureDisabled(FeatureType.CAMPAIGNS)) {
final CampaignFormDataDtoHelper campaignFormDataDtoHelper = new CampaignFormDataDtoHelper();
campaignFormDataDtoHelper.pushEntities(true);
final List<String> campaignFormDataUuids = executeUuidCall(RetroProvider.getCampaignFormDataFacade().pullUuids());
DatabaseHelper.getCampaignFormDataDao().deleteInvalid(campaignFormDataUuids);
campaignFormDataDtoHelper.pullMissing(campaignFormDataUuids);
}
}
use of de.symeda.sormas.app.backend.immunization.ImmunizationDtoHelper in project SORMAS-Project by hzi-braunschweig.
the class SynchronizeDataAsync method pushNewData.
@AddTrace(name = "pushNewDataTrace")
private void pushNewData() throws ServerCommunicationException, ServerConnectionException, DaoException, NoConnectionException {
new PersonDtoHelper().pushEntities(true);
new CaseDtoHelper().pushEntities(true);
new ImmunizationDtoHelper().pushEntities(true);
new EventDtoHelper().pushEntities(true);
new EventParticipantDtoHelper().pushEntities(true);
new SampleDtoHelper().pushEntities(true);
new PathogenTestDtoHelper().pushEntities(true);
new AdditionalTestDtoHelper().pushEntities(true);
new ContactDtoHelper().pushEntities(true);
new VisitDtoHelper().pushEntities(true);
new TaskDtoHelper().pushEntities(true);
new WeeklyReportDtoHelper().pushEntities(true);
new AggregateReportDtoHelper().pushEntities(true);
new PrescriptionDtoHelper().pushEntities(true);
new TreatmentDtoHelper().pushEntities(true);
new ClinicalVisitDtoHelper().pushEntities(true);
}
use of de.symeda.sormas.app.backend.immunization.ImmunizationDtoHelper 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