@Override public int updatePersonMeasure(int id, Measure measure) { Person person = Person.getPersonById(id); // Set person and healthProfile for measure measure.setPerson(person); measure.setHealthProfile(person.getHealthProfile()); Measure.updateMeasure(measure); return measure.getMid(); }
@Override public Measure savePersonMeasure(int id, Measure measure) { Person person = Person.getPersonById(id); // Set person and healthProfile for measure measure.setPerson(person); measure.setHealthProfile(person.getHealthProfile()); // If no created date, set the current date as measure created date if (measure.getCreated() == null) { measure.setCreated(new SimpleDateFormat("yyyy-MM-dd").format(new Date())); } return Measure.saveMeasure(measure); }