/** Sets an attribute on a person. */ public static void setPersonAttributeValue( Patient patient, PersonAttributeType attrType, String value) { PersonService personService = Context.getPersonService(); PersonAttribute attribute = patient.getAttribute(attrType); if (attribute == null) { attribute = new PersonAttribute(); attribute.setAttributeType(attrType); attribute.setValue(value); patient.addAttribute(attribute); } else { attribute.setValue(value); } personService.savePerson(patient); }