use of com.odysseusinc.arachne.portal.model.Country in project ArachneCentralAPI by OHDSI.
the class CountryDTOToCountryConverter method convert.
@Override
public Country convert(CountryDTO dto) {
Country country = new Country();
country.setId(dto.getId());
country.setName(dto.getName());
country.setIsoCode(dto.getIsoCode());
return country;
}
use of com.odysseusinc.arachne.portal.model.Country in project ArachneCentralAPI by OHDSI.
the class BaseUserServiceImpl method baseUpdate.
private U baseUpdate(U forUpdate, U user) {
final Date date = new Date();
forUpdate.setId(user.getId());
if (user.getFirstname() != null) {
forUpdate.setFirstname(user.getFirstname());
}
if (user.getMiddlename() != null) {
forUpdate.setMiddlename(user.getMiddlename());
}
if (user.getLastname() != null) {
forUpdate.setLastname(user.getLastname());
}
forUpdate.setEnabled(user.getEnabled() != null ? user.getEnabled() : forUpdate.getEnabled());
forUpdate.setUpdated(date);
if (user.getProfessionalType() != null) {
ProfessionalType professionalType = professionalTypeService.getById(user.getProfessionalType().getId());
if (professionalType != null) {
forUpdate.setProfessionalType(professionalType);
}
}
if (user.getPhone() != null) {
forUpdate.setPhone(user.getPhone());
}
if (user.getMobile() != null) {
forUpdate.setMobile(user.getMobile());
}
if (user.getAddress1() != null) {
forUpdate.setAddress1(user.getAddress1());
}
if (user.getAddress2() != null) {
forUpdate.setAddress2(user.getAddress2());
}
if (user.getCity() != null) {
forUpdate.setCity(user.getCity());
}
if (user.getZipCode() != null) {
forUpdate.setZipCode(user.getZipCode());
}
if (user.getCountry() != null) {
Country country = countryRepository.findOne(user.getCountry().getId());
if (country != null) {
forUpdate.setCountry(country);
}
}
if (user.getStateProvince() != null) {
StateProvince stateProvince = stateProvinceRepository.findOne(user.getStateProvince().getId());
if (stateProvince != null) {
forUpdate.setStateProvince(stateProvince);
}
}
if (user.getAffiliation() != null) {
forUpdate.setAffiliation(user.getAffiliation());
}
if (user.getPersonalSummary() != null) {
forUpdate.setPersonalSummary(user.getPersonalSummary());
}
if (user.getContactEmail() != null) {
forUpdate.setContactEmail(user.getContactEmail());
}
if (user.getTenants() != null) {
forUpdate.setTenants(user.getTenants());
}
return forUpdate;
}
Aggregations