private void populateScreenFromData(DementiaConfigurationVo dementiaConfigurationVo) { clearScreen(); if (dementiaConfigurationVo == null) return; form.intAge().setValue(dementiaConfigurationVo.getAge()); form.intExcludeFAIRPeriod().setValue(dementiaConfigurationVo.getExcludeFAIRPeriod()); form.intStepOnePeriod().setValue(dementiaConfigurationVo.getStepOnePeriod()); form.intRemoveTimePeriod().setValue(dementiaConfigurationVo.getRemoveTimePeriod()); form.intAMTSThresholdScore().setValue(dementiaConfigurationVo.getAMTSThresholdScore()); populateAdmissionType(dementiaConfigurationVo.getAdmissionTypes()); DementiaColourConfigVoCollection collColourConfigVo = dementiaConfigurationVo.getColourConfig(); collColourConfigVo.sort(SortOrder.ASCENDING); populateColourConfigDynamicGrid(collColourConfigVo.sort(SortOrder.ASCENDING)); }
private void populateScreenFromData(DementiaConfigurationVo dementiaConfigurationVo) { clearScreen(); if (dementiaConfigurationVo == null) return; form.intAge().setValue(dementiaConfigurationVo.getAge()); form.intExcludeFAIRPeriod().setValue(dementiaConfigurationVo.getExcludeFAIRPeriod()); form.intStepOnePeriod().setValue(dementiaConfigurationVo.getStepOnePeriod()); form.intRemoveTimePeriod().setValue(dementiaConfigurationVo.getRemoveTimePeriod()); form.intAMTSThresholdScore().setValue(dementiaConfigurationVo.getAMTSThresholdScore()); populateAdmissionType(dementiaConfigurationVo.getAdmissionTypes()); DementiaColourConfigVoCollection collColourConfigVo = dementiaConfigurationVo.getColourConfig(); collColourConfigVo.sort(SortOrder.ASCENDING); form.cmbRecentlyAssessedColour().setValue(dementiaConfigurationVo.getRecentlyAssessed());//WDEV-18700 populateColourConfigDynamicGrid(collColourConfigVo.sort(SortOrder.ASCENDING)); }
private void populateColourConfigDynamicGrid(DementiaColourConfigVoCollection collColourConfigVo) { form.dyngrdColourConfig().getRows().clear(); for (int i = 0; collColourConfigVo != null && i < collColourConfigVo.size(); i++) { addRowToColourConfigGrid(collColourConfigVo.get(i)); } }
private void orderColourGridByStartHour() { DementiaColourConfigVoCollection collColourConfig = new DementiaColourConfigVoCollection(); for (int i = 0; i < form.dyngrdColourConfig().getRows().size(); i++) { collColourConfig.add((DementiaColourConfigVo)form.dyngrdColourConfig().getRows().get(i).getValue()); } collColourConfig.sort(SortOrder.ASCENDING); populateColourConfigDynamicGrid(collColourConfig); }
private String[] validateColourConfigHours(DementiaColourConfigVoCollection collColourConfig) { ArrayList<String> errors = new ArrayList<String>(); for (int i=0;i<collColourConfig.size();i++) { if (i<collColourConfig.size()-1 && collColourConfig.get(i+1).getFromHours().intValue()!=collColourConfig.get(i).getToHours().intValue()+1) { errors.add("Colour Configuration hour intervals are not consecutive!"); break; } if (collColourConfig.get(i).getFromHours().intValue()>=collColourConfig.get(i).getToHours().intValue()) { errors.add("Colour Configuration hour intervals are not consecutive!"); break; } } if (errors.size() > 0) { String[] UIErrors = new String[errors.size()]; errors.toArray(UIErrors); return UIErrors; } return null; }