Search in sources :

Example 1 with Location

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

the class ExposureDtoHelper method fillInnerFromAdo.

@Override
protected void fillInnerFromAdo(ExposureDto target, Exposure source) {
    if (source.getLocation() != null) {
        Location location = DatabaseHelper.getLocationDao().queryForId(source.getLocation().getId());
        target.setLocation(locationDtoHelper.adoToDto(location));
    } else {
        target.setLocation(null);
    }
    if (source.getContactToCase() != null) {
        Contact contactToCase = DatabaseHelper.getContactDao().queryForId(source.getContactToCase().getId());
        target.setContactToCase(ContactDtoHelper.toReferenceDto(contactToCase));
    } else {
        target.setContactToCase(null);
    }
    if (source.getReportingUser() != null) {
        User reportingUser = DatabaseHelper.getUserDao().queryForId(source.getReportingUser().getId());
        target.setReportingUser(UserDtoHelper.toReferenceDto(reportingUser));
    } else {
        target.setReportingUser(null);
    }
    target.setAnimalCondition(source.getAnimalCondition());
    target.setTypeOfAnimal(source.getTypeOfAnimal());
    target.setTypeOfAnimalDetails(source.getTypeOfAnimalDetails());
    target.setExposureRole(source.getExposureRole());
    target.setAnimalContactType(source.getAnimalContactType());
    target.setAnimalContactTypeDetails(source.getAnimalContactTypeDetails());
    target.setAnimalMarket(source.getAnimalMarket());
    target.setAnimalVaccinated(source.getAnimalVaccinated());
    target.setContactToBodyFluids(source.getContactToBodyFluids());
    target.setDeceasedPersonIll(source.getDeceasedPersonIll());
    target.setDeceasedPersonName(source.getDeceasedPersonName());
    target.setDeceasedPersonRelation(source.getDeceasedPersonRelation());
    target.setDescription(source.getDescription());
    target.setEatingRawAnimalProducts(source.getEatingRawAnimalProducts());
    target.setEndDate(source.getEndDate());
    target.setExposureType(source.getExposureType());
    target.setExposureTypeDetails(source.getExposureTypeDetails());
    target.setGatheringDetails(source.getGatheringDetails());
    target.setGatheringType(source.getGatheringType());
    target.setHabitationDetails(source.getHabitationDetails());
    target.setHabitationType(source.getHabitationType());
    target.setHandlingAnimals(source.getHandlingAnimals());
    target.setHandlingSamples(source.getHandlingSamples());
    target.setIndoors(source.getIndoors());
    target.setLongFaceToFaceContact(source.getLongFaceToFaceContact());
    target.setOtherProtectiveMeasures(source.getOtherProtectiveMeasures());
    target.setProtectiveMeasuresDetails(source.getProtectiveMeasuresDetails());
    target.setOutdoors(source.getOutdoors());
    target.setPercutaneous(source.getPercutaneous());
    target.setPhysicalContactDuringPreparation(source.getPhysicalContactDuringPreparation());
    target.setPhysicalContactWithBody(source.getPhysicalContactWithBody());
    target.setShortDistance(source.getShortDistance());
    target.setProbableInfectionEnvironment(source.isProbableInfectionEnvironment());
    target.setStartDate(source.getStartDate());
    target.setWearingMask(source.getWearingMask());
    target.setWearingPpe(source.getWearingPpe());
    target.setTypeOfPlace(source.getTypeOfPlace());
    target.setTypeOfPlaceDetails(source.getTypeOfPlaceDetails());
    target.setMeansOfTransport(source.getMeansOfTransport());
    target.setMeansOfTransportDetails(source.getMeansOfTransportDetails());
    target.setConnectionNumber(source.getConnectionNumber());
    target.setSeatNumber(source.getSeatNumber());
    target.setWorkEnvironment(source.getWorkEnvironment());
    target.setBodyOfWater(source.getBodyOfWater());
    target.setWaterSource(source.getWaterSource());
    target.setWaterSourceDetails(source.getWaterSourceDetails());
    target.setProphylaxis(source.getProphylaxis());
    target.setProphylaxisDate(source.getProphylaxisDate());
    target.setRiskArea(source.getRiskArea());
    target.setLargeAttendanceNumber(source.getLargeAttendanceNumber());
}
Also used : User(de.symeda.sormas.app.backend.user.User) Location(de.symeda.sormas.app.backend.location.Location) Contact(de.symeda.sormas.app.backend.contact.Contact)

Example 2 with Location

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

the class EventParticipantEditFragment method onLayoutBinding.

@Override
public void onLayoutBinding(FragmentEventParticipantEditLayoutBinding contentBinding) {
    setUpControlListeners(contentBinding);
    contentBinding.setData(record);
    contentBinding.setVaccinationStatusClass(VaccinationStatus.class);
    InfrastructureFieldsDependencyHandler.instance.initializeRegionFields(contentBinding.eventParticipantResponsibleRegion, initialRegions, record.getResponsibleRegion(), contentBinding.eventParticipantResponsibleDistrict, initialDistricts, record.getResponsibleDistrict(), null, null, null);
    Location eventLocation = record.getEvent().getEventLocation();
    contentBinding.eventParticipantResponsibleRegion.setRequired(eventLocation.getRegion() == null || eventLocation.getDistrict() == null);
    contentBinding.eventParticipantResponsibleDistrict.setRequired(eventLocation.getRegion() == null || eventLocation.getDistrict() == null);
}
Also used : Location(de.symeda.sormas.app.backend.location.Location)

Example 3 with Location

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

the class EventParticipantNewFragment method onLayoutBinding.

@Override
public void onLayoutBinding(FragmentEventParticipantNewLayoutBinding contentBinding) {
    contentBinding.setData(record);
    InfrastructureFieldsDependencyHandler.instance.initializeRegionFields(contentBinding.eventParticipantResponsibleRegion, initialRegions, record.getResponsibleRegion(), contentBinding.eventParticipantResponsibleDistrict, initialDistricts, record.getResponsibleDistrict(), null, null, null);
    Location eventLocation = record.getEvent().getEventLocation();
    contentBinding.eventParticipantResponsibleRegion.setRequired(eventLocation.getRegion() == null || eventLocation.getDistrict() == null);
    contentBinding.eventParticipantResponsibleDistrict.setRequired(eventLocation.getRegion() == null || eventLocation.getDistrict() == null);
}
Also used : Location(de.symeda.sormas.app.backend.location.Location)

Example 4 with Location

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

the class ActivityAsCaseDtoHelper method fillInnerFromAdo.

@Override
protected void fillInnerFromAdo(ActivityAsCaseDto target, ActivityAsCase source) {
    if (source.getLocation() != null) {
        Location location = DatabaseHelper.getLocationDao().queryForId(source.getLocation().getId());
        target.setLocation(locationDtoHelper.adoToDto(location));
    } else {
        target.setLocation(null);
    }
    if (source.getReportingUser() != null) {
        User reportingUser = DatabaseHelper.getUserDao().queryForId(source.getReportingUser().getId());
        target.setReportingUser(UserDtoHelper.toReferenceDto(reportingUser));
    } else {
        target.setReportingUser(null);
    }
    target.setStartDate(source.getStartDate());
    target.setEndDate(source.getEndDate());
    target.setDescription(source.getDescription());
    target.setActivityAsCaseType(source.getActivityAsCaseType());
    target.setActivityAsCaseTypeDetails(source.getActivityAsCaseTypeDetails());
    target.setRole(source.getRole());
    target.setTypeOfPlace(source.getTypeOfPlace());
    target.setTypeOfPlaceDetails(source.getTypeOfPlaceDetails());
    target.setMeansOfTransport(source.getMeansOfTransport());
    target.setMeansOfTransportDetails(source.getMeansOfTransportDetails());
    target.setConnectionNumber(source.getConnectionNumber());
    target.setSeatNumber(source.getSeatNumber());
    target.setWorkEnvironment(source.getWorkEnvironment());
    target.setGatheringDetails(source.getGatheringDetails());
    target.setGatheringType(source.getGatheringType());
    target.setHabitationDetails(source.getHabitationDetails());
    target.setHabitationType(source.getHabitationType());
}
Also used : User(de.symeda.sormas.app.backend.user.User) Location(de.symeda.sormas.app.backend.location.Location)

Example 5 with Location

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

the class JurisdictionHelper method createEventJurisdictionDto.

public static EventJurisdictionDto createEventJurisdictionDto(Event event) {
    if (event == null) {
        return null;
    }
    Location eventLocation = event.getEventLocation();
    if (eventLocation == null) {
        return null;
    }
    EventJurisdictionDto eventJurisdiction = new EventJurisdictionDto();
    if (event.getReportingUser() != null) {
        eventJurisdiction.setReportingUserUuid(event.getReportingUser().getUuid());
    }
    if (event.getResponsibleUser() != null) {
        eventJurisdiction.setResponsibleUserUuid(event.getResponsibleUser().getUuid());
    }
    if (eventLocation.getRegion() != null) {
        eventJurisdiction.setRegionUuid(eventLocation.getRegion().getUuid());
    }
    if (eventLocation.getDistrict() != null) {
        eventJurisdiction.setDistrictUuid(eventLocation.getDistrict().getUuid());
    }
    if (eventLocation.getCommunity() != null) {
        eventJurisdiction.setCommunityUuid(eventLocation.getCommunity().getUuid());
    }
    return eventJurisdiction;
}
Also used : EventJurisdictionDto(de.symeda.sormas.app.backend.event.EventJurisdictionDto) Location(de.symeda.sormas.app.backend.location.Location)

Aggregations

Location (de.symeda.sormas.app.backend.location.Location)15 User (de.symeda.sormas.app.backend.user.User)5 LocationDialog (de.symeda.sormas.app.component.dialog.LocationDialog)5 Contact (de.symeda.sormas.app.backend.contact.Contact)3 PersonContactDetail (de.symeda.sormas.app.backend.person.PersonContactDetail)3 ArrayList (java.util.ArrayList)3 MeansOfImmunization (de.symeda.sormas.api.immunization.MeansOfImmunization)2 LocationDto (de.symeda.sormas.api.location.LocationDto)2 PersonContactDetailDto (de.symeda.sormas.api.person.PersonContactDetailDto)2 ActivityAsCase (de.symeda.sormas.app.backend.activityascase.ActivityAsCase)2 Campaign (de.symeda.sormas.app.backend.campaign.Campaign)2 CampaignFormData (de.symeda.sormas.app.backend.campaign.data.CampaignFormData)2 CampaignFormMeta (de.symeda.sormas.app.backend.campaign.form.CampaignFormMeta)2 Case (de.symeda.sormas.app.backend.caze.Case)2 MaternalHistory (de.symeda.sormas.app.backend.caze.maternalhistory.MaternalHistory)2 PortHealthInfo (de.symeda.sormas.app.backend.caze.porthealthinfo.PortHealthInfo)2 DiseaseClassificationCriteria (de.symeda.sormas.app.backend.classification.DiseaseClassificationCriteria)2 ClinicalCourse (de.symeda.sormas.app.backend.clinicalcourse.ClinicalCourse)2 ClinicalVisit (de.symeda.sormas.app.backend.clinicalcourse.ClinicalVisit)2 HealthConditions (de.symeda.sormas.app.backend.clinicalcourse.HealthConditions)2