$service->load($filter->service_id); $services[$service->_id] = $service; unset($services[""]); // Ajustements kinés $kine = new CMediusers(); $kine->load($filter->referent_id); $kine->loadRefFunction(); $kines[$kine->_id] = $kine; unset($kines[""]); // Tris a posteriori : détruit les clés ! array_multisort(CMbArray::pluck($kines, "_view"), SORT_ASC, $kines); array_multisort(CMbArray::pluck($services, "_view"), SORT_ASC, $services); array_multisort(CMbArray::pluck($praticiens, "_view"), SORT_ASC, $praticiens); // Couleurs $libelles = CMbArray::pluck($sejours, "libelle"); $colors = CColorLibelleSejour::loadAllFor($libelles); // Création du template $smarty = new CSmartyDP(); $smarty->assign("date", $date); $smarty->assign("filter", $filter); $smarty->assign("colors", $colors); $smarty->assign("sejours", $sejours); $smarty->assign("sejours_by_kine", $sejours_by_kine); $smarty->assign("kines", $kines); $smarty->assign("praticiens", $praticiens); $smarty->assign("services", $services); $smarty->assign("show", $show); $smarty->assign("group_by", $group_by); $smarty->assign("show_cancelled_services", $show_cancelled_services); $smarty->assign("order_way", $order_way); $smarty->assign("order_col", $order_col);
$where = array(); $where["patient_id"] = " = '{$sejour->patient_id}'"; $where["type"] = " = 'ssr'"; $where["annule"] = " = '0'"; $where["sejour_id"] = " != '{$sejour->_id}'"; $where["sortie"] = " <= '{$sejour->entree}'"; /** @var CSejour[] $sejours */ $sejours = $sejour->loadList($where); foreach ($sejours as $_sejour) { $_sejour->loadRefBilanSSR()->loadRefPraticienDemandeur(); $_sejour->loadRefPraticien(1); $prescription = $_sejour->loadRefPrescriptionSejour(); $prescription->loadRefsLinesElementByCat(); foreach ($prescription->_ref_prescription_lines_element_by_cat as $_lines_by_chap) { foreach ($_lines_by_chap as $_lines_by_cat) { foreach ($_lines_by_cat as $_lines_by_elt) { foreach ($_lines_by_elt as $_line) { /* @var CPrescriptionLineElement $_line*/ $_line->getRecentModification(); } } } } } $colors = CColorLibelleSejour::loadAllFor(CMbArray::pluck($sejours, "libelle")); // Création du template $smarty = new CSmartyDP(); $smarty->assign("sejour", $sejour); $smarty->assign("sejours", $sejours); $smarty->assign("colors", $colors); $smarty->display("inc_vw_sejours_patient.tpl");
* $Id$ * * @package Mediboard * @subpackage PlanningOp * @author SARL OpenXtrem <*****@*****.**> * @license GNU General Public License, see http://www.gnu.org/licenses/gpl.html * @version $Revision$ */ CCanDo::checkAdmin(); // Tous les libelllés $query = new CRequest(); $query->addTable("sejour"); $query->addColumn("COUNT(libelle)", "libelle_count"); $query->addColumn("libelle"); $query->addWhereClause("type", "= 'ssr'"); $query->addOrder("libelle_count DESC"); $query->addGroup("libelle"); $sejour = new CSejour(); $ds = $sejour->_spec->ds; $libelle_counts = array(); foreach ($ds->loadList($query->makeSelect()) as $row) { $libelle_counts[$row["libelle"]] = $row["libelle_count"]; } unset($libelle_counts[""]); // Libellés disponibles $colors = CColorLibelleSejour::loadAllFor(array_keys($libelle_counts)); // Création du template $smarty = new CSmartyDP(); $smarty->assign("libelle_counts", $libelle_counts); $smarty->assign("colors", $colors); $smarty->display("vw_idx_colors.tpl");