public function viewEprescribeAction()
 {
     $messagingId = $this->_getParam('messagingId');
     $messaging = new Messaging();
     $messaging->messagingId = $messagingId;
     $messaging->populate();
     $missingPON = '';
     if ($messaging->objectClass == 'MedicationRefillRequest' && preg_match('/\\(Invalid\\/Missing PON\\)/', $messaging->note)) {
         $missingPON = $messagingId;
     }
     $relatedMessage = '';
     $prettyPrint = __('There is no more information available about this message');
     //if (strtolower($messaging->messageType) == 'error' && strlen($messaging->rawMessage) > 0) {
     if (strlen($messaging->rawMessage) > 0) {
         $xml = new SimpleXMLElement($messaging->rawMessage);
         $relatesToMessageID = (string) $xml->Header->RelatesToMessageID;
         $tmpMsg = new Messaging();
         $tmpMsg->messagingId = $relatesToMessageID;
         $tmpMsg->populate();
         if (strtolower($tmpMsg->messageType) == 'newrx' && strlen($tmpMsg->rawMessage) > 0) {
             $tmlXmlMsg = new SimpleXMLElement($tmpMsg->rawMessage);
             $relatedMessage = Messaging::convertXMLMessage($tmlXmlMsg->Body->NewRx, $relatedMessage);
             $relatedMessage = implode("\n", $relatedMessage);
         }
         $prettyPrint = $this->_generateRefillRequestDetails($xml->Body, $tmp);
     }
     $this->view->prettyPrint = $prettyPrint;
     $this->view->missingPON = $missingPON;
     $this->view->messaging = $messaging;
     $this->view->relatedMessage = $relatedMessage;
     $this->render('view-eprescribe');
 }