Пример #1
0
 /**
  * @see parent::getValue()
  */
 function getValue($object, $smarty = null, $params = array())
 {
     $value = $object->{$this->fieldName};
     if (isset($params["advanced"]) && $params["advanced"]) {
         $message = new CHPrim21Message();
         $message->parse($value);
         return $message->flatten(true);
     }
     return CHPrim21Message::highlight($value);
 }
Пример #2
0
 function handle($msg_hpr)
 {
     $this->message = new CHPrim21Message();
     $this->message->parse($msg_hpr);
     return $this->message->toXML(get_class($this), false, CApp::$encoding);
 }
Пример #3
0
 /**
  * @return CHPrim21Message
  */
 function parseMessage($string, $parse_body = true, $actor = null)
 {
     $hpr_message = new CHPrim21Message();
     if (!$this->_id && $actor) {
         $this->sender_id = $actor->_id;
         $this->sender_class = $actor->_class;
     }
     $hpr_message->parse($string, $parse_body);
     return $hpr_message;
 }
 * Affichage en ajax des messages Hprim21
 *
 * @category Hprim21
 * @package  Mediboard
 * @author   SARL OpenXtrem <*****@*****.**>
 * @license  GNU General Public License; see http://www.gnu.org/licenses/gpl.html
 * @version  SVN: $Id:$
 * @link     http://www.mediboard.org
 */
CCanDo::checkRead();
$message_string = CValue::post("message");
if (!$message_string) {
    return;
}
$message_string = stripslashes($message_string);
CValue::setSession("message", $message_string);
try {
    $message = new CHPrim21Message();
    $message->parse($message_string);
    $message->_errors_msg = !$message->isOK(CHL7v2Error::E_ERROR);
    $message->_warnings_msg = !$message->isOK(CHL7v2Error::E_WARNING);
    $message->_xml = CMbString::highlightCode("xml", $message->toXML()->saveXML());
} catch (CHL7v2Exception $e) {
    CAppUI::stepMessage(UI_MSG_ERROR, $e->getMessage() . " (" . $e->extraData . ")");
    return;
}
// Création du template
$smarty = new CSmartyDP();
$smarty->assign("message", $message);
$smarty->assign("key", "input");
$smarty->display("inc_display_hprim_message.tpl");