/** * Prompt user for logout confirmation (unless suppressed). * * @see IUserContextEvent#pending */ @Override public void pending(ISurveyResponse response) { if (response.isSilent()) { response.accept(); } else { response.defer(); DialogUtil.confirm(LBL_LOGOUT_CONFIRMATION, LBL_LOGOUT_CONFIRMATION_CAPTION, "LOGOUT.CONFIRM", (confirm) -> { if (confirm) { response.accept(); } else { response.reject(LBL_LOGOUT_CANCEL); } }); } }
@Override public void merge(ISurveyResponse response) { responses.addAll(response.getResponses()); }
/** * Called if the controller is patient aware and the patient context is about to be changed. * Override to control the pending context change. * * @param response The survey response. */ protected void onPatientChanging(ISurveyResponse response) { response.accept(); }
private void setMarshaledContext(ContextItems marshaledContext, Iterator<IManagedContext<?>> iter, ISurveyResponse response, ISurveyCallback callback) { if (iter.hasNext()) { IManagedContext<?> managedContext = iter.next(); try { if (managedContext.setContextItems(marshaledContext)) { localChangeBegin(managedContext); localChangeEnd(managedContext, true, true, aresponse -> { response.merge(aresponse); setMarshaledContext(marshaledContext, iter, response, callback); }); } } catch (Exception e) { log.error("Error processing marshaled context change.", e); response.reject(e.toString()); setMarshaledContext(marshaledContext, iter, response, callback); } } else { execCallback(callback, response); } }
@Override public void pending(ISurveyResponse response) { response.accept(); }
/** * Updates the list when a patient selection is pending. */ @Override public void pending(ISurveyResponse response) { try { Patient patient = PatientContext.getPatientContext().getContextObject(true); if (patient != null) { addPatient(patient, true); saveList(false); } } catch (Throwable t) { log.error("Error updating patient list.", t); } response.accept(); } };