/** * Return the instance OID * * @param CInteropReceiver $receiver Receiver * * @return String */ static function getOIDRoot($receiver = null) { if ($receiver) { $receiver->loadConfigValues(); } if ($receiver && $receiver->_configs["use_receiver_oid"]) { return $receiver->OID; } return CAppUI::conf("mb_oid"); }
/** * @see parent::getBackProps() */ function getBackProps() { $backProps = parent::getBackProps(); $backProps['object_configs'] = "CReceiverHPrimSanteConfig object_id"; $backProps['echanges'] = "CExchangeHprimSante receiver_id"; return $backProps; }
/** * Update the form (derived) fields plain fields * * @return void */ function updateFormFields() { parent::updateFormFields(); $this->_tag_hl7 = CHL7::getObjectTag($this->group_id); if (!$this->_configs) { $this->loadConfigValues(); } }
/** * Update the form (derived) fields plain fields * * @return void */ function updateFormFields() { parent::updateFormFields(); $this->code_syst = $this->code_syst ? $this->code_syst : $this->nom; $this->_tag_hprimxml = CHPrimXML::getObjectTag($this->group_id); }
/** * Update the form (derived) fields plain fields * * @return void */ function updateFormFields() { parent::updateFormFields(); }
/** * Get objects * * @return array CInteropReceiver/CInteropSender collection */ function getObjects() { $receiver = new CInteropReceiver(); $sender = new CInteropSender(); return array("CInteropReceiver" => $receiver->getObjects(), "CInteropSender" => $sender->getObjects()); }
/** * @see parent::getBackProps() */ function getBackProps() { $backProps = parent::getBackProps(); $backProps['echanges'] = "CEchangeHprim21 receiver_id"; return $backProps; }
/** * @see parent::getBackProps() */ function getBackProps() { $backProps = parent::getBackProps(); $backProps['echanges'] = "CSyslogExchange receiver_id"; return $backProps; }
/** * Trigger action on the right handler * * @param string $action Action name * @param CMbObject $mbObject Object * * @return void */ function sendFormatAction($action, CMbObject $mbObject) { if (!$action) { return; } $cn_receiver_guid = CValue::sessionAbs("cn_receiver_guid"); $receiver = new CInteropReceiver(); // Parcours des receivers actifs if (!$cn_receiver_guid) { // On est dans le cas d'un store d'un objet depuis MB if (!$mbObject->_eai_sender_guid) { $receivers = $receiver->getObjects(true); } else { $receivers = array(); /** @var CInteropSender $sender */ $sender = CMbObject::loadFromGuid($mbObject->_eai_sender_guid); // On utilise le routeur de l'EAI if (CAppUI::conf("eai use_routers")) { // Récupération des receivers de ttes les routes actives /** @var CEAIRoute[] $routes */ $where = array(); $where["active"] = " = '1'"; $routes = $sender->loadBackRefs("routes_sender", null, null, null, null, null, null, $where); foreach ($routes as $_route) { if (!$_route->active) { continue; } $receiver = $_route->loadRefReceiver(); $receivers[get_class($receiver)][] = $receiver; } } else { if (!$mbObject instanceof CPatient) { return; } $no_group = null; // Dans le cas des patients on va envoyer à tous les destinataires // On ne transmet pas le message aux destinataires du même établissement que celui de l'expéditeur if (!CAppUI::conf("eai send_messages_with_same_group")) { $no_group = $sender->group_id; } /* @todo ATTENTION PROBLEMATIQUE SI PATIENT != CASSE */ //$receivers = $receiver->getObjects(true, $no_group); } } } else { if ($cn_receiver_guid == "none") { return; } $receiver = CMbObject::loadFromGuid($cn_receiver_guid); if (!$receiver || !$receiver->_id) { return; } $receivers[$receiver->_class][] = $receiver; } foreach ($receivers as $_receivers) { if (!$_receivers) { continue; } /** @var CInteropReceiver $_receiver */ foreach ($_receivers as $_receiver) { // Destinataire non actif on envoi pas if (!$_receiver->actif) { continue; } $handler = $_receiver->getFormatObjectHandler($this); if (!$handler) { continue; } $_receiver->loadConfigValues(); $_receiver->loadRefsMessagesSupported(); // Affectation du receiver à l'objet $mbObject->_receiver = $_receiver; $handlers = !is_array($handler) ? array($handler) : $handler; // On parcours les handlers foreach ($handlers as $_handler) { // Récupère le handler du format $format_object_handler = new $_handler(); // Envoi l'action au handler du format try { $format_object_handler->{$action}($mbObject); } catch (Exception $e) { CAppUI::setMsg($e->getMessage(), UI_MSG_WARNING); } } } } }
$class = new $_under_class(); $class->countExchanges(); $exchanges_classes[$_exchange_class][] = $class; } if ($_exchange_class == "CExchangeAny") { $class = new CExchangeAny(); $class->countExchanges(); $exchanges_classes["CExchangeAny"][] = $class; } } $group = new CGroups(); $groups = $group->loadList(); foreach ($groups as $_group) { $_group->loadConfigValues(); } $receiver = new CInteropReceiver(); $receivers = $receiver->getObjects(); $tools = array("exchanges" => array("send", "inject_master_idex_missing", "reprocessing", "detect_collision"), "smp" => array("resend_exchange")); $exchange = new CExchangeDataFormat(); $exchange->_date_min = $date_min; $exchange->_date_max = $date_max; $movement = new CMovement(); // Création du template $smarty = new CSmartyDP(); $smarty->assign("exchange", $exchange); $smarty->assign("exchanges_classes", $exchanges_classes); $smarty->assign("groups", $groups); $smarty->assign("tools", $tools); $smarty->assign("receivers", $receivers); $smarty->assign("movement", $movement); $smarty->display("vw_tools.tpl");