示例#1
0
/**
 * @package Mediboard
 * @subpackage hl7
 * @version $Revision: 15455 $
 * @author SARL OpenXtrem
 * @license GNU General Public License, see http://www.gnu.org/licenses/gpl.html
 */
$er7 = CValue::post("er7");
$query = CValue::post("query");
$hl7_message = new CHL7v2Message();
$hl7_message->parse($er7);
$xml = $hl7_message->toXML();
if ($query) {
    $xpath = new CMbXPath($xml);
    $results = @$xpath->query("//{$query}");
    $nodes = array();
    // Création du template
    $smarty = new CSmartyDP();
    if ($results) {
        foreach ($results as $result) {
            $nodes[] = CMbString::highlightCode("xml", $xml->saveXML($result));
        }
    }
    $smarty->assign("nodes", $nodes);
    $smarty->display("inc_er7_xml_result.tpl");
} else {
    ob_clean();
    header("Content-Type: text/xml");
    echo $xml->saveXML();
    CApp::rip();
}
 * $Id$
 *
 * @category Hprimsante
 * @package  Mediboard
 * @author   SARL OpenXtrem <*****@*****.**>
 * @license  GNU General Public License, see http://www.gnu.org/licenses/gpl.html
 * @version  $Revision$
 * @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 CHPrimSanteMessage();
    $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");
 /**
  * Trace a query applying syntax coloring
  * 
  * @param string $query  Query to execute
  * @param array  $values Values to prepare
  * 
  * @return void
  */
 static function traceQuery($query, $values = array())
 {
     self::$last_query = $query;
     self::$last_values = $values;
     // Verbose
     if (!self::$verbose) {
         return;
     }
     // Inject values into query
     foreach ($values as $_value) {
         $_value = str_replace("'", "\\'", $_value);
         $query = preg_replace("/\\?/", "'{$_value}'", $query, 1);
     }
     echo utf8_decode(CMbString::highlightCode("sql", $query, false, "white-space: pre-wrap;"));
 }
示例#4
0
 /**
  * Displays the SQL report
  *
  * @return void
  */
 static function displayReport()
 {
     $totals = array();
     $distribution = array();
     foreach (self::$report_data as $_hash => $_data) {
         $totals[$_hash] = array_sum(CMbArray::pluck($_data, 0));
         $_distribution = array("", "", "", "", "", "", "", "", "");
         foreach ($_data as $_pair) {
             $duration = $_pair[0] * 1000;
             $log = (int) floor(log10($duration) + 0.5);
             if (!isset($_distribution[$log])) {
                 $_distribution[$log] = "";
             }
             $_distribution[$log] .= "#";
         }
         $distribution[$_hash] = $_distribution;
     }
     arsort($totals);
     foreach ($totals as $_hash => $_total) {
         CAppUI::stepMessage(UI_MSG_OK, "Query was called %d times for %01.3fms", count(self::$report_data[$_hash]), $_total);
         echo utf8_decode(CMbString::highlightCode("sql", self::$report_data[$_hash][0][1], false, "white-space: pre-wrap;"));
         $_dist = $distribution[$_hash];
         // No input for 1µs and 10µs magnitudes (< 31.6µs)
         $lines = array("100µs {$_dist['2']}", "  1ms {$_dist['3']}", " 10ms {$_dist['4']}", "100ms {$_dist['5']}", "   1s {$_dist['6']}", "  10s {$_dist['7']}");
         echo "<pre>" . implode("\n", $lines) . "</pre>";
     }
 }
示例#5
0
 /**
  * Affiche le message au format xml
  *
  * @param String $message message
  *
  * @return String
  */
 static function showxml($message)
 {
     return CMbString::highlightCode("xml", $message);
 }
         $doc = $msg_segment_group->toXML();
         if (count($msg_segment_group->children) > $limit_size) {
             $doc->formatOutput = true;
             $msg_segment_group->_xml = "<pre>" . CMbString::htmlEntities($doc->saveXML()) . "</pre>";
         } else {
             $msg_segment_group->_xml = CMbString::highlightCode("xml", $doc->saveXML());
         }
     }
     $ack_segment_group = $exchange->getACK();
     if ($ack_segment_group) {
         $doc = $ack_segment_group->toXML();
         if (count($ack_segment_group->children) > $limit_size) {
             $doc->formatOutput = true;
             $ack_segment_group->_xml = "<pre>" . CMbString::htmlEntities($doc->saveXML()) . "</pre>";
         } else {
             $ack_segment_group->_xml = CMbString::highlightCode("xml", $doc->saveXML());
         }
     }
     $smarty->assign("msg_segment_group", $msg_segment_group);
     $smarty->assign("ack_segment_group", $ack_segment_group);
     $smarty->assign("limit_size", $limit_size);
     $smarty->display("inc_exchange_tabular_details.tpl");
     break;
 case $exchange instanceof CEchangeXML:
     $smarty->display("inc_exchange_xml_details.tpl");
     break;
 case $exchange instanceof CExchangeDicom:
     $exchange->decodeContent();
     $smarty->display("inc_exchange_dicom_details.tpl");
     break;
 default:
示例#7
0
 /**
  * @see parent::getValue()
  */
 function getValue($object, $smarty = null, $params = array())
 {
     return utf8_decode(CMbString::highlightCode("xml", $object->{$this->fieldName}, false));
 }
示例#8
0
 /**
  * @see parent::getValue()
  */
 function getValue($object, $smarty = null, $params = array())
 {
     $propValue = $object->{$this->fieldName};
     $propValue = !empty($params['export']) ? var_export($propValue, true) : $propValue;
     return utf8_decode(CMbString::highlightCode("php", $propValue, false));
 }
示例#9
0
<?php

/**
 * $Id$
 *
 *  Affiche le code xml du datatype choisi
 *
 * @category CDA
 * @package  Mediboard
 * @author   SARL OpenXtrem <*****@*****.**>
 * @license  GNU General Public License, see http://www.gnu.org/licenses/gpl.html 
 * @link     http://www.mediboard.org */
$name = CValue::get("name");
echo CMbString::purifyHTML("<h1>{$name}</h1>");
echo CMbString::highlightCode("xml", CCdaTools::showNodeXSD($name, "modules/cda/resources/datatypes-base_original.xsd"));
<?php

/* $Id $ */
/**
 * @package Mediboard
 * @subpackage hl7
 * @version $Revision:$
 * @author SARL OpenXtrem
 * @license GNU General Public License, see http://www.gnu.org/licenses/gpl.html
 */
CCanDo::checkAdmin();
$path = CValue::get("path");
echo CMbString::purifyHTML("<h1>{$path}</h1>");
echo CMbString::highlightCode("xml", file_get_contents($path));