protected void populateScreenFromData(ims.core.vo.PatientKioskSettingsVo value) { clearScreen(); super.populateScreenFromData(value); form.grdMessages().getRows().clear(); PatientKioskMessageVoCollection msgsVoColl = value.getMessages(); if (msgsVoColl != null) { for (int i=0; i<msgsVoColl.size();i++) { grdMessagesRow row = form.grdMessages().getRows().newRow(); if (msgsVoColl.get(i).getMessageTypeIsNotNull()) row.setColMessageType(msgsVoColl.get(i).getMessageType().getText()); if (msgsVoColl.get(i).getMessageTextIsNotNull()) row.setColMessageText(msgsVoColl.get(i).getMessageText()); row.setTooltip(setToolTips(msgsVoColl.get(i).getMessageType())); } } }
private int getDelay() { PatientKioskConfig impl = (PatientKioskConfig) getDomainImpl(PatientKioskConfigImpl.class); PatientKioskSettingsVo patientKioskSettings = impl.getPatientKioskSettings(null); Integer delayInMinutes = 0; if(patientKioskSettings != null && patientKioskSettings.getAllowedDelayIsNotNull()) { delayInMinutes = patientKioskSettings.getAllowedDelay(); } return delayInMinutes; }
public boolean save() throws PresentationLogicException { PatientKioskSettingsVo saveVo = form.getLocalContext().getSelectedKioskSettings(); saveVo = populateDataFromScreenMsg(); String[] errors = saveVo.validate(validateUIRules()); if(errors != null && errors.length > 0) { engine.showErrors("Errors",errors); return false; } try { saveVo = domain.savePatientKioskSettings(saveVo); } catch (DomainInterfaceException err) { engine.showMessage("Domain Interface Exception " + err.toString()); return false; } catch (StaleObjectException e) { engine.showMessage("Data has been modified by another user - screen will be refreshed"); form.setMode(FormMode.VIEW); return false; } form.getLocalContext().setSelectedKioskSettings(saveVo); form.getLocalContext().setSelectedKioskMessages(saveVo.getMessages()); form.setMode(FormMode.VIEW); return true; }
protected ims.core.vo.PatientKioskSettingsVo populateDataFromScreenMsg() { PatientKioskSettingsVo newVo = form.getLocalContext().getSelectedKioskSettings(); newVo = super.populateDataFromScreen(newVo); newVo.setMessages(getSettingsMessages()); return newVo; }
/** * Returns the patient kiosk settings */ public ims.core.vo.PatientKioskSettingsVo getPatientKioskSettings(String kioskId) { if (kioskId != null) this.createSystemLogEntry(SystemLogType.KIOSK, SystemLogLevel.INFORMATION, "Get Kiosk Settings (kiosk ID: " + kioskId + ")"); DomainFactory factory = getDomainFactory(); PatientKioskSettingsVoCollection psVoColl = new PatientKioskSettingsVoCollection(); psVoColl = PatientKioskSettingsVoAssembler.createPatientKioskSettingsVoCollectionFromPatientKioskSettings(factory.find("from PatientKioskSettings")); if (psVoColl != null && psVoColl.size() != 0) return PatientKioskSettingsVoAssembler.createPatientKioskSettingsVoCollectionFromPatientKioskSettings(factory.find("from PatientKioskSettings")).get(0); else { // return default values PatientKioskSettingsVo defaultPSVo = new PatientKioskSettingsVo(); defaultPSVo.setWebServiceUrl(""); defaultPSVo.setAppUpdateUrl(""); defaultPSVo.setTimeout(2); defaultPSVo.setTheme(PatientKioskTheme.BLUE); defaultPSVo.setAutoInstallUpdates(true); defaultPSVo.setAllowedDelay(0); defaultPSVo.setShowAppointments(false); // messages defaultPSVo.setMessages(getDefaultKioskMessages()); return defaultPSVo; } }
public ims.core.vo.PatientKioskSettingsVo savePatientKioskSettings(ims.core.vo.PatientKioskSettingsVo settings) throws ims.domain.exceptions.DomainInterfaceException, ims.domain.exceptions.StaleObjectException { if (settings == null) throw new DomainInterfaceException("Can not save an empty Patient Kiosk settings."); DomainFactory factory = getDomainFactory(); PatientKioskSettings psVo = PatientKioskSettingsVoAssembler.extractPatientKioskSettings(factory, settings); factory.save(psVo); return PatientKioskSettingsVoAssembler.create(psVo); }