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)); }
public DementiaConfigurationVo save(DementiaConfigurationVo dementiaConfigToSave) throws StaleObjectException, UniqueKeyViolationException { if (dementiaConfigToSave == null) throw new CodingRuntimeException("Cannot save null DementiaConfiguration "); if (!dementiaConfigToSave.isValidated()) throw new DomainRuntimeException("DementiaConfiguration Not Validated."); if (isDementiaConfigurationRecorded(dementiaConfigToSave)) //WDEV-18743 throw new UniqueKeyViolationException("A dementia configuration record has already been saved. The screen will be refreshed."); DomainFactory factory = getDomainFactory(); DementiaConfiguration domainDementiaConfig = DementiaConfigurationVoAssembler.extractDementiaConfiguration(factory, dementiaConfigToSave); factory.save(domainDementiaConfig); return DementiaConfigurationVoAssembler.create(domainDementiaConfig); }
private boolean save() { DementiaConfigurationVo dementiaConfigToSave = populateDataFromScreen(form.getLocalContext().getcurrentDementiaConfig()); if (dementiaConfigToSave==null) { engine.showMessage("Please use the script to introduce the record in DB!"); open(); return false; } String[] errors = dementiaConfigToSave.validate(validateColourConfigHours(dementiaConfigToSave.getColourConfig())); if (errors != null && errors.length > 0) { engine.showErrors(errors); return false; } try { form.getLocalContext().setcurrentDementiaConfig(domain.save(dementiaConfigToSave)); } catch (StaleObjectException e) { engine.showMessage(ims.configuration.gen.ConfigFlag.UI.STALE_OBJECT_MESSAGE.getValue()); open(); return false; } return true; }
public DementiaConfigurationVo save(DementiaConfigurationVo dementiaConfigToSave) throws ims.domain.exceptions.StaleObjectException { if (dementiaConfigToSave == null) throw new CodingRuntimeException("Cannot save null DementiaConfiguration "); if (!dementiaConfigToSave.isValidated()) throw new DomainRuntimeException("DementiaConfiguration Not Validated."); DomainFactory factory = getDomainFactory(); DementiaConfiguration domainDementiaConfig = DementiaConfigurationVoAssembler.extractDementiaConfiguration(factory, dementiaConfigToSave); factory.save(domainDementiaConfig); return DementiaConfigurationVoAssembler.create(domainDementiaConfig); }
public ims.admin.vo.DementiaConfigurationVo getDementiaConfig() { DomainFactory factory = getDomainFactory(); StringBuffer hql = new StringBuffer(); hql.append("from DementiaConfiguration as dementiaConfig"); List<?> list = factory.find(hql.toString()); if (list == null || list.size() == 0) return null; return DementiaConfigurationVoAssembler.create((DementiaConfiguration) list.get(0)); }
private boolean save() { DementiaConfigurationVo dementiaConfigToSave = populateDataFromScreen(form.getLocalContext().getcurrentDementiaConfig()); String[] errors = dementiaConfigToSave.validate(validateColourConfigHours(dementiaConfigToSave.getColourConfig())); if (errors != null && errors.length > 0) { engine.showErrors(errors); return false; } try { form.getLocalContext().setcurrentDementiaConfig(domain.save(dementiaConfigToSave)); } catch (StaleObjectException e) { engine.showMessage(ims.configuration.gen.ConfigFlag.UI.STALE_OBJECT_MESSAGE.getValue()); open(); return false; } catch (UniqueKeyViolationException ex)//WDEV-18743 { engine.showMessage(ex.getMessage()); open(); return false; } return true; }
private boolean isDementiaConfigurationRecorded(DementiaConfigurationVo dementiaConfigToSave) { String hql = "select dcfg from DementiaConfiguration as dcfg where dcfg.id <> " + dementiaConfigToSave.getID_DementiaConfiguration(); List<?> results = getDomainFactory().find(hql); if (results != null && results.size() > 0) { return true; } return false; }
public DementiaConfigurationVo getDementiaConfiguration() { DementiaConfiguration implDementia = (DementiaConfiguration) getDomainImpl(DementiaConfigurationImpl.class); return implDementia.getDementiaConfig(); }