if (!d[1].equals(""))
{
dateNkk.setTime(Long.valueOf(d[1]));
ngaykinhcuoi = dateFormat.format(dateNkk);
}
Fetal fetal = new Fetal();
fetal.setId(d[0]);
fetal.setNgaykinhcuoi(dateNkk);
fetal.setTime(Integer.valueOf(d[2]));
fetal.setPatient(patientId);
//fetal.setDisplayType(Utils.parseInt(d[3]));
list.add(fetal);
listFetal.addItem(d[2], d[0]);
}
}
//Window.alert(String.valueOf(listFetal.getItemCount()));
Fetal fetal = new Fetal();
fetal.setTime(listFetal.getItemCount());
fetal.setPatient(patientId);
list.add(fetal);
listFetal.addItem(String.valueOf(listFetal.getItemCount()+1) + " ("+ constants.formNew()+")", "");
//listFetal.setSelectedIndex(listFetal.getItemCount()-2);
if(listFetal.getItemCount() == 1){
listFetal.setSelectedIndex(0);
} else {
listFetal.setSelectedIndex(listFetal.getItemCount()-2);
}
//set current fetal value
Fetal currfetal = list.get(listFetal.getSelectedIndex());
ngaykinhcuoi.setValue(currfetal.getNgaykinhcuoi());
fetalId = currfetal.getId();
listAgeType.setSelectedIndex(0);
lastSelectedAgeType = 0;
onAgeTypeChange(null);
}