/** * Count the exchanges for the all sejours * * @param CMbObject[] $objects CMbObject * @param String $type Type * @param String $subtype Sous type * * @return void */ static function massCountExchanges($objects, $type = null, $subtype = null) { if (!count($objects)) { return null; } $object = current($objects); $object_ids = CMbArray::pluck($objects, $object->_spec->key); $object_ids = array_unique($object_ids); CMbArray::removeValue("", $object_ids); if (!count($object_ids)) { return null; } $where = array("object_id" => CSQLDataSource::prepareIn($object_ids), "object_class" => "= '{$object->_class}'"); if ($type) { $where["type"] = "= '{$type}'"; } if ($subtype) { $where["sous_type"] = "= '{$subtype}'"; } $count_exchanges = array(); foreach (CExchangeDataFormat::getAll() as $_data_format) { /** @var CExchangeDataFormat $data_format */ $data_format = new $_data_format(); if (!$data_format->hasTable()) { continue; } $table_exchange = $data_format->_spec->table; $count_exchanges[$table_exchange] = $data_format->countMultipleList($where, null, "object_id", null, array("object_id")); } foreach ($count_exchanges as $_exchange => $_counts) { foreach ($_counts as $_value) { $total = $_value["total"]; $object_id = $_value["object_id"]; if (!isset($objects[$object_id]->_nb_exchanges_by_format[$_exchange])) { $objects[$object_id]->_nb_exchanges_by_format[$_exchange] = 0; } $objects[$object_id]->_nb_exchanges_by_format[$_exchange] += $total; $objects[$object_id]->_nb_exchanges += $total; } } }
* @category EAI * @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::checkAdmin(); $count = CValue::getOrSession("count", 30); $date_production = CValue::getOrSession("date_production", CMbDT::date()); $group_id = CValue::getOrSession("group_id", CGroups::loadCurrent()->_id); $filter = new CExchangeDataFormat(); $filter->date_production = $date_production; $filter->group_id = $group_id; $exchanges_classes = array(); foreach (CExchangeDataFormat::getAll() as $key => $_exchange_class) { foreach (CApp::getChildClasses($_exchange_class, true) as $_child_key => $_child_class) { $exchanges_classes[$_exchange_class][] = $_child_class; } if ($_exchange_class == "CExchangeAny") { $exchanges_classes[$_exchange_class][] = $_exchange_class; } } $criteres = array('no_date_echange', 'emetteur', 'destinataire', 'message_invalide', 'acquittement_invalide'); $smarty = new CSmartyDP(); $smarty->assign("count", $count); $smarty->assign("date_production", $date_production); $smarty->assign("filter", $filter); $smarty->assign("exchanges_classes", $exchanges_classes); $smarty->assign("criteres", $criteres); $smarty->display("vw_stats.tpl");
if ($actor instanceof CInteropSender) { $formats_xml = CExchangeDataFormat::getAll("CEchangeXML"); foreach ($formats_xml as &$_format_xml) { /** @var CEchangeXML $_format_xml */ $_format_xml = new $_format_xml(); $temp = $_format_xml->getMessagesSupported($actor_guid, false, null, true); $messages_xml = array_merge($messages_xml, $temp); } $formats_tabular = CExchangeDataFormat::getAll("CExchangeTabular"); foreach ($formats_tabular as &$_format_tabular) { /** @var CExchangeTabular $_format_tabular */ $_format_tabular = new $_format_tabular(); $temp = $_format_tabular->getMessagesSupported($actor_guid, false, null, true); $messages_tabular = array_merge($messages_tabular, $temp); } $formats_binary = CExchangeDataFormat::getAll("CExchangeBinary"); foreach ($formats_binary as &$_format_binary) { /** @var CExchangeBinary $_format_binary */ $_format_binary = new $_format_binary(); $temp = $_format_binary->getMessagesSupported($actor_guid, false, null, true); $messages_binary = array_merge($messages_binary, $temp); } } else { if ($actor instanceof CInteropReceiver) { $exchanges = $actor->makeBackSpec("echanges"); $actor->_backSpecs["echanges"]; $data_format = new $exchanges->class(); if ($data_format instanceof CExchangeTabular) { $formats_tabular[] = $data_format; $temp = $data_format->getMessagesSupported($actor_guid, false, null, true); $messages_tabular = array_merge($messages_tabular, $temp);
* @category EAI * @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(); $actor_guid = CValue::getOrSession("actor_guid"); $formats_xml = CExchangeDataFormat::getAll("CEchangeXML"); foreach ($formats_xml as &$_format_xml) { $_format_xml = new $_format_xml(); $_format_xml->getConfigs($actor_guid); } $formats_tabular = CExchangeDataFormat::getAll("CExchangeTabular"); foreach ($formats_tabular as &$_format_tabular) { $_format_tabular = new $_format_tabular(); $_format_tabular->getConfigs($actor_guid); } $formats_binary = CExchangeDataFormat::getAll('CExchangeBinary'); foreach ($formats_binary as &$_format_binary) { $_format_binary = new $_format_binary(); $_format_binary->getConfigs($actor_guid); } // Création du template $smarty = new CSmartyDP(); $smarty->assign("actor_guid", $actor_guid); $smarty->assign("formats_xml", $formats_xml); $smarty->assign("formats_tabular", $formats_tabular); $smarty->assign('formats_binary', $formats_binary); $smarty->display("inc_configs_formats.tpl");
/** * Get messages supported by family * * @return array */ function getMessagesSupportedByFamily() { $family = array(); foreach (CExchangeDataFormat::getAll() as $_data_format_class) { $_data_format = new $_data_format_class(); $temp = $_data_format->getFamily(); $family = array_merge($family, $temp); } if (empty($family)) { return $this->_ref_msg_supported_family; } $supported = $this->loadRefsMessagesSupported(); foreach ($family as $_family => $_root_class) { $root = new $_root_class(); foreach ($root->getEvenements() as $_evt => $_evt_class) { foreach ($supported as $_msg_supported) { if (!$_msg_supported->active) { continue; } if ($_msg_supported->message != $_evt_class) { continue; } $messages = $this->_spec->messages; if (isset($messages[$root->type])) { $this->_ref_msg_supported_family = array_merge($this->_ref_msg_supported_family, $messages[$root->type]); continue 3; } } } } return $this->_ref_msg_supported_family; }
/** * Message understood ? * * @param string $data Data * @param CInteropSender $actor Actor data * @param mixed $contexts Used with Dicom, the presentation contexts * * @return bool Understood ? */ static function understand($data, $actor = null, $contexts = null) { foreach (CExchangeDataFormat::getAll() as $_exchange_class) { foreach (CApp::getChildClasses($_exchange_class, true) as $_data_format) { /** * @var CExchangeDataFormat $data_format */ $data_format = new $_data_format(); // Test si le message est compris if ($contexts) { $understand = $data_format->understand($data, $actor, $contexts); } else { $understand = $data_format->understand($data, $actor); } if ($understand) { return $data_format; } } } return null; }