$user = new CUser(); $user->user_last_name = $last_name; $user->user_first_name = $first_name; $user->loadMatchingObjectEsc(); if (!$user->_id) { $results[$i]['error'] = 'Utilisateur non trouvé'; continue; } foreach ($results[$i]["code"] as $_code) { switch ($nomenclature) { case "ccam": $object = new CFavoriCCAM(); $object->object_class = $object_class; break; case "cim10": $object = new CFavoriCIM10(); } $object->favoris_user = $user->_id; $object->favoris_code = $_code; $object->loadMatchingObjectEsc(); $msg = ""; if (!$object->_id) { $msg = $object->store(); if ($msg) { CAppUI::setMsg($msg, UI_MSG_ERROR); $results[$i]["error"] = $msg; $i++; continue; } CAppUI::setMsg("Favori créé", UI_MSG_OK); }
$list[$val_code] = $code_cim10; $nb_code = 0; if (isset($codes_stats[$val_code])) { $nb_code = $codes_stats[$val_code]->occ; } elseif (isset($codes_favoris[$val_code])) { $nb_code = 0.5; } $list[$val_code]->nb_acte = $nb_code; } $sorter = CMbArray::pluck($list, "nb_acte"); array_multisort($sorter, SORT_DESC, $list); $listByProfile[$profile]["favoris"] = $codes_favoris; $listByProfile[$profile]["stats"] = $codes_stats; $listByProfile[$profile]["list"] = $list; } $tag_tree = CFavoriCIM10::getTree($user->_id); $smarty = new CSmartyDP(); $smarty->assign("listByProfile", $listByProfile); $smarty->assign("users", $users); $smarty->assign("object_class", $object_class); $smarty->assign("_keywords_code", $_keywords_code); $smarty->assign("_all_codes", $_all_codes); $smarty->assign("tag_tree", $tag_tree); $smarty->assign("tag_id", $tag_id); if ($only_list) { $smarty->display("inc_code_selector_cim10.tpl"); } else { $smarty->assign("chir", $chir); $smarty->assign("anesth", $anesth); $smarty->display("code_selector_cim10.tpl"); }
/** * dPcim10 * * @category Cim10 * @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(); $user = CUser::get(); $lang = CValue::getOrSession("lang", CCodeCIM10::LANG_FR); $tag_id = CValue::getOrSession("tag_id"); // Recherche des codes favoris $favori = new CFavoriCIM10(); $where = array(); $where["favoris_user"] = "******"; $ljoin = array(); if ($tag_id) { $ljoin["tag_item"] = "tag_item.object_id = favoris_id AND tag_item.object_class = 'CFavoriCIM10'"; $where["tag_item.tag_id"] = "= '{$tag_id}'"; } /** @var CFavoriCIM10[] $favoris */ $favoris = $favori->loadList($where, "favoris_code", null, null, $ljoin); $codes = array(); foreach ($favoris as $_favori) { $favoris_code = $_favori->favoris_code; $_favori->loadRefsTagItems(); $code = CCodeCIM10::get($favoris_code); $code->_favoris_id = $_favori->favoris_id;