unset($codes_favoris[$key]); } // Seek sur les codes, avec ou non l'inclusion de tous les codes $code = new CCodeCIM10(); $where = null; if (!$_all_codes && (count($codes_stats) || count($codes_favoris))) { $codes_keys = array_keys(array_merge($codes_stats, $codes_favoris)); $where = "master.abbrev " . $ds->prepareIn($codes_keys); } if (!$_all_codes && count($codes_stats) == 0 && count($codes_favoris) == 0) { // Si pas de stat et pas de favoris, et que la recherche se fait sur ceux-ci, // alors le tableau de résultat est vide $codes = array(); } else { // Sinon recherche de codes $codes = $code->findCodes($_keywords_code, $_keywords_code, CCodeCIM10::LANG_FR, null, $where); } foreach ($codes as $value) { $val_code = $value["code"]; $code_cim10 = CCodeCIM10::get($val_code); $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);
if (CValue::session("code") || CValue::session("keys")) { $level1 = ""; CValue::setSession("level1"); } if (!$level1) { $level2 = ""; CValue::setSession("level2"); } $cim10 = new CCodeCIM10(); $listLevel1 = $cim10->getSommaire($lang); $listLevel2 = array(); $master = array(); $keys = trim($keys); $code = trim($code); if ($code || $keys) { $master = $cim10->findCodes($code, $keys, $lang); } elseif ($level2) { $listLevel2 = $cim10->getSubCodes($level1, $lang); $master = $cim10->getSubCodes($level2, $lang); } elseif ($level1) { $listLevel2 = $cim10->getSubCodes($level1, $lang); $master = $listLevel2; } $numresults = count($master); // Création du template $smarty = new CSmartyDP(); $smarty->assign("cim10", $cim10); $smarty->assign("lang", $lang); $smarty->assign("code", $code); $smarty->assign("keys", $keys); $smarty->assign("level1", $level1);
<?php /** * 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 */ $keywords = CValue::post("keywords_code"); if ($keywords == '') { $keywords = '%%'; } $code = new CCodeCIM10(); $codes = $code->findCodes($keywords, $keywords, CCodeCIM10::LANG_FR, 6); $smarty = new CSmartyDP(); $smarty->assign("codes", $codes); $smarty->assign("nodebug", true); $smarty->assign("keywords", $keywords); $smarty->assign("sejour_id", CValue::get("sejour_id")); $smarty->display("inc_code_cim10_autocomplete.tpl");