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