if (getDeathDate() != null && today.getTime().after(getDeathDate())) { today.setTime(getDeathDate());
validateDeathDate(errors, person.getDeathDate(), person.getBirthdate());
deathdateEstimated = person.getDeathdateEstimated(); dead = person.getDead(); deathDate = person.getDeathDate(); causeOfDeath = person.getCauseOfDeath(); causeOfDeathNonCoded = person.getCauseOfDeathNonCoded();
public static OpenMRSPerson openMRSToMRSPerson(Person person) { Set<PersonName> personNames = person.getNames(); PersonName personName = getFirstName(personNames); final List<OpenMRSAttribute> attributes = project(person.getAttributes(), OpenMRSAttribute.class, on(PersonAttribute.class).getAttributeType().toString(), on(PersonAttribute.class).getValue()); List<MRSAttribute> personAttributes = new ArrayList<MRSAttribute>(); personAttributes.addAll(attributes); OpenMRSPerson mrsPerson = new OpenMRSPerson().firstName(personName.getGivenName()).middleName(personName.getMiddleName()) .lastName(personName.getFamilyName()).birthDateEstimated(person.getBirthdateEstimated()).gender(person.getGender()).age(person.getAge()) .address(getAddress(person)).attributes(personAttributes).dateOfBirth(new DateTime(person.getBirthdate())).dead(person.isDead()).deathDate(new DateTime(person.getDeathDate())); if (person.getId() != null) { mrsPerson.id(Integer.toString(person.getId())); } return mrsPerson; }
@Override public void validateDefaultRepresentation() throws Exception { super.validateDefaultRepresentation(); assertPropEquals("gender", getObject().getGender()); assertPropEquals("age", getObject().getAge()); assertPropEquals("birthdate", getObject().getBirthdate()); assertPropEquals("birthdateEstimated", getObject().getBirthdateEstimated()); assertPropEquals("dead", getObject().getDead()); assertPropEquals("deathDate", getObject().getDeathDate()); assertPropPresent("causeOfDeath"); assertPropPresent("preferredName"); assertPropPresent("preferredAddress"); assertPropPresent("attributes"); assertPropEquals("voided", getObject().getVoided()); }
@Override public void validateFullRepresentation() throws Exception { super.validateFullRepresentation(); assertPropEquals("gender", getObject().getGender()); assertPropEquals("age", getObject().getAge()); assertPropEquals("birthdate", getObject().getBirthdate()); assertPropEquals("birthdateEstimated", getObject().getBirthdateEstimated()); assertPropEquals("dead", getObject().getDead()); assertPropEquals("deathDate", getObject().getDeathDate()); assertPropPresent("causeOfDeath"); assertPropPresent("preferredName"); assertPropPresent("preferredAddress"); assertPropPresent("names"); assertPropPresent("addresses"); assertPropPresent("attributes"); assertPropEquals("voided", getObject().getVoided()); assertPropPresent("auditInfo"); }