Source:
public PatientItem createPatientItem(int id, String firstName, String lastName, String phoneNumber, String city, String address, int userId, Date age, String sex, Integer weeksPregnant, Integer heightFeet, Integer heightInches, Float weight, String pathToPatientPhoto, Integer photoId, String ageClassification, Integer smoker, Integer diabetic, Integer alcohol) { if (StringUtils.isNullOrWhiteSpace(firstName) || StringUtils.isNullOrWhiteSpace(lastName) || StringUtils.isNullOrWhiteSpace(city)) { return null; } PatientItem patientItem = new PatientItem(); patientItem.setId(id); patientItem.setFirstName(firstName); patientItem.setLastName(lastName); patientItem.setYearsOld(dateUtils.getYearsInteger(age)); patientItem.setMonthsOld(dateUtils.getMonthsInteger(age)); patientItem.setCity(city); patientItem.setUserId(userId); if (StringUtils.isNotNullOrWhiteSpace(phoneNumber)) patientItem.setPhoneNumber(phoneNumber); if (StringUtils.isNotNullOrWhiteSpace(address)) patientItem.setAddress(address); if (StringUtils.isNotNullOrWhiteSpace(sex)) patientItem.setSex(sex); if (age != null) { patientItem.setAge(dateUtils.getAge(age)); patientItem.setBirth(age); patientItem.setFriendlyDateOfBirth(dateUtils.getFriendlyDate(age)); } if (StringUtils.isNotNullOrWhiteSpace(pathToPatientPhoto) && photoId != null) { patientItem.setPathToPhoto(pathToPatientPhoto); patientItem.setPhotoId(photoId); } if (weeksPregnant != null) patientItem.setWeeksPregnant(weeksPregnant); if (heightFeet != null) patientItem.setHeightFeet(heightFeet); else patientItem.setHeightFeet(0); if (heightInches != null) patientItem.setHeightInches(heightInches); else patientItem.setHeightInches(0); if (weight != null) patientItem.setWeight(weight); return patientItem; }

Target:
public PatientItem createPatientItem(int id, String firstName, String lastName, String phoneNumber, String city, String address, int userId, Date age, String sex, Integer weeksPregnant, Integer heightFeet, Integer heightInches, Float weight, String pathToPatientPhoto, Integer photoId, String ageClassification, Integer smoker, Integer diabetic, Integer alcohol) { if (StringUtils.isNullOrWhiteSpace(firstName) || StringUtils.isNullOrWhiteSpace(lastName) || StringUtils.isNullOrWhiteSpace(city)) { return null; } PatientItem patientItem = new PatientItem(); patientItem.setId(id); patientItem.setFirstName(firstName); patientItem.setLastName(lastName); patientItem.setYearsOld(dateUtils.getYearsInteger(age)); patientItem.setMonthsOld(dateUtils.getMonthsInteger(age)); patientItem.setCity(city); patientItem.setUserId(userId); if (StringUtils.isNotNullOrWhiteSpace(phoneNumber)) patientItem.setPhoneNumber(phoneNumber); if (StringUtils.isNotNullOrWhiteSpace(address)) patientItem.setAddress(address); if (StringUtils.isNotNullOrWhiteSpace(sex)) patientItem.setSex(sex); if (age != null) { patientItem.setAge(dateUtils.getAge(age)); patientItem.setBirth(age); patientItem.setFriendlyDateOfBirth(dateUtils.getFriendlyDate(age)); } if (StringUtils.isNotNullOrWhiteSpace(pathToPatientPhoto) && photoId != null) { patientItem.setPathToPhoto(pathToPatientPhoto); patientItem.setPhotoId(photoId); } if (weeksPregnant != null) patientItem.setWeeksPregnant(weeksPregnant); if (heightFeet != null) patientItem.setHeightFeet(heightFeet); else patientItem.setHeightFeet(0); if (heightInches != null) patientItem.setHeightInches(heightInches); else patientItem.setHeightInches(0); if (weight != null) patientItem.setWeight(weight); if (smoker != null) patientItem.setSmoker(smoker); if (diabetic != null) patientItem.setDiabetic(diabetic); if (alcohol != null) patientItem.setAlcohol(alcohol); return patientItem; }