Search in sources :

Example 1 with PersonDtoHelper

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

use of de.symeda.sormas.app.backend.person.PersonDtoHelper 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);
    }
}
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) 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) CampaignFormDataDtoHelper(de.symeda.sormas.app.backend.campaign.data.CampaignFormDataDtoHelper) 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) PrescriptionDtoHelper(de.symeda.sormas.app.backend.therapy.PrescriptionDtoHelper) AggregateReportDtoHelper(de.symeda.sormas.app.backend.report.AggregateReportDtoHelper) AdditionalTestDtoHelper(de.symeda.sormas.app.backend.sample.AdditionalTestDtoHelper) AddTrace(com.google.firebase.perf.metrics.AddTrace)

Example 3 with PersonDtoHelper

use of de.symeda.sormas.app.backend.person.PersonDtoHelper 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);
}
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) 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) 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)

Example 4 with PersonDtoHelper

use of de.symeda.sormas.app.backend.person.PersonDtoHelper 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)

Example 5 with PersonDtoHelper

use of de.symeda.sormas.app.backend.person.PersonDtoHelper in project SORMAS-Project by hzi-braunschweig.

the class LbdsIntentSender method getNewPersonsToSendLbds.

public static List<PersonDto> getNewPersonsToSendLbds() {
    List<CaseDataDto> casesToSend = getNewCasesToSendLbds();
    PersonDao personDao = DatabaseHelper.getPersonDao();
    LbdsSyncDao lbdsSyncDao = DatabaseHelper.getLbdsSyncDao();
    PersonDtoHelper personDtoHelper = new PersonDtoHelper();
    List<PersonDto> personsToSend = new ArrayList<>();
    for (CaseDataDto caze : casesToSend) {
        Person person = personDao.queryUuid(caze.getPerson().getUuid());
        if ((!person.isNew()) || lbdsSyncDao.hasBeenSuccessfullySent(person)) {
            continue;
        }
        PersonDto personDto = personDtoHelper.adoToDto(person);
        try {
            LbdsDtoHelper.stripLbdsDto(personDto);
        } catch (IllegalAccessException | IntrospectionException | InvocationTargetException e) {
            throw new IllegalArgumentException("LBDS preparation failed for person " + person.getUuid(), e);
        }
        personsToSend.add(personDto);
    }
    return personsToSend;
}
Also used : PersonDtoHelper(de.symeda.sormas.app.backend.person.PersonDtoHelper) CaseDataDto(de.symeda.sormas.api.caze.CaseDataDto) PersonDto(de.symeda.sormas.api.person.PersonDto) ArrayList(java.util.ArrayList) IntrospectionException(com.googlecode.openbeans.IntrospectionException) InvocationTargetException(java.lang.reflect.InvocationTargetException) PersonDao(de.symeda.sormas.app.backend.person.PersonDao) LbdsSyncDao(de.symeda.sormas.app.backend.lbds.LbdsSyncDao) Person(de.symeda.sormas.app.backend.person.Person)

Aggregations

PersonDtoHelper (de.symeda.sormas.app.backend.person.PersonDtoHelper)7 CaseDtoHelper (de.symeda.sormas.app.backend.caze.CaseDtoHelper)5 AddTrace (com.google.firebase.perf.metrics.AddTrace)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 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 TaskDtoHelper (de.symeda.sormas.app.backend.task.TaskDtoHelper)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 Person (de.symeda.sormas.app.backend.person.Person)3 CaseDataDto (de.symeda.sormas.api.caze.CaseDataDto)2