$do = CValue::get("do"); $calcul_planifs = CValue::get("calcul_planifs", 1); if (!$calcul_planifs) { CView::enforceSlave(); } $group = CGroups::loadCurrent(); if ($offline) { $by_patient = true; $do = 1; $dateTime_min = CMbDT::dateTime(" - " . CAppUI::conf("soins bilan hour_before", $group) . " HOURS"); $dateTime_max = CMbDT::dateTime(" + " . CAppUI::conf("soins bilan hour_after", $group) . " HOURS"); } else { $dateTime_min = CValue::getOrSession("_dateTime_min", "{$date} 00:00:00"); $dateTime_max = CValue::getOrSession("_dateTime_max", "{$date} 23:59:59"); } $categories = CCategoryPrescription::loadCategoriesByChap(null, "current", 1); $date_min = CMbDT::date($dateTime_min); $date_max = CMbDT::date($dateTime_max); if ($token_cat == "all") { $token_cat = "trans|med|inj|perf|aerosol"; foreach ($categories as $categories_by_chap) { foreach ($categories_by_chap as $category_id => $_categorie) { $token_cat .= "|{$category_id}"; } } } $elts = $cats = explode("|", $token_cat); CMbArray::removeValue("med", $elts); CMbArray::removeValue("perf", $elts); CMbArray::removeValue("inj", $elts); CMbArray::removeValue("trans", $elts);
foreach ($_elements_by_chap as $elements_cat) { foreach ($elements_cat as $_element) { $nb_lines_element += count($_element); } } } } $bed = $_prescription->_ref_object->_ref_curr_affectation->_ref_lit; $bedroom_name = $bed->_ref_chambre->nom . $bed->nom . $_prescription->_ref_object->_ref_curr_affectation->_id; $prescriptions_order[$bedroom_name] = $key; } // Tri par numéro de chambre ksort($prescriptions_order); $prescriptions = CMbArray::ksortByArray($prescriptions, $prescriptions_order); // Chargement des categories pour chaque chapitre $categories = CCategoryPrescription::loadCategoriesByChap(); $smarty = new CSmartyDP(); $smarty->assign("lines", $lines); $smarty->assign("patients", $patients); $smarty->assign("tabHours", $tabHours); $smarty->assign("prescriptions", $prescriptions); $smarty->assign("categories", $categories); $smarty->assign("tabHours", $tabHours); $smarty->assign("composition_dossier", $composition_dossier); $smarty->assign("bornes_composition_dossier", $bornes_composition_dossier); $smarty->assign("count_composition_dossier", $count_composition_dossier); $smarty->assign("operations", array()); $smarty->assign("nb_decalage", $nb_decalage); $smarty->assign("mode_dossier", $mode_dossier); $smarty->assign("nb_lines_element", $nb_lines_element); $smarty->assign("now", CMbDT::dateTime());