getFieldValue('uid'); if ($msg->sendRxMessage($_SESSION['final_rx_patient'], $empUID, $opticalRxs, $contactRxs)) { try { //Mark the original secure message as read, per issue #5947. $message = new MarkMessageReadMessage('cec_messaging'); $result = $message->markMessageRead($empUID, $messageId); } catch (Exception $e2) { //We don't care about these exceptions; if it can't mark the original message read, just log it and move on. klog('Exception occurred while marking secure message as read for final rx selection.' . dump($e2), KLogger::ERROR); } header('location:employee_portal_main.php?success=1'); } else { klog('sendRxMessage() for ' . $_SESSION['final_rx_patient'] . ' returned false', KLogger::ERROR); header("location:select_final_rx.php?patient=$patUID&message_id=$messageId&contacts=1&exam_lens=1&error=1"); } } catch (Exception $e) { klog('Exception occurred when submitting final rx for ' . $_SESSION['final_rx_patient'] . '.' . dump($e), KLogger::ERROR); header("location:select_final_rx.php?patient=$patUID&message_id=$messageId&contacts=1&exam_lens=1&error=2"); } } else { if ($patUID != null) { header("location:select_final_rx.php?patient=$patUID&message_id=$messageId&contacts=1&exam_lens=1&error=1"); } else { header("location:select_final_rx.php"); } } } //End if employee is logged in ?>