class IncidentService extends RecordService {

    public Incident update(ItemValuesMap itemValues) throws IOException {
        Gson gson = new Gson();
        Blob blob = new Blob(gson.toJson(itemValues.getValues()).getBytes());

        Incident incident = incidentDao.getIncidentByUniqueId(itemValues.getAsString(INCIDENT_ID));
        incident.setLastUpdatedDate(new Date(Calendar.getInstance().getTimeInMillis()));
        incident.setContent(blob);
        incident.setName(getName(itemValues));
        incident.setSurvivorCode(getSurvivorCode(itemValues));
        incident.setTypeOfViolence(getTypeOfViolence(itemValues));
        incident.setLocation(getLocation(itemValues));
        int age = itemValues.getAsInt(AGE) != null ? itemValues.getAsInt(AGE) : EMPTY_AGE;
        incident.setAge(age);
        incident.setCaregiver(getCaregiverName(itemValues));
        incident.setSynced(false);

        if (itemValues.has(DATE_OF_INTERVIEW)) {
            incident.setRegistrationDate(Utils.getRegisterDateByYyyyMmDd(itemValues.getAsString(DATE_OF_INTERVIEW)));
        }
        return incidentDao.update(incident);
    }

    public  IncidentService();
    public  IncidentService(IncidentDao incidentDao);

}