/** * Charge les services d'UHCD de l'établissement courant * * @return CService[] */ static function loadServicesImagerie() { $service = new CService(); $service->group_id = CGroups::loadCurrent()->_id; $service->radiologie = "1"; $service->cancelled = "0"; /** @var CService[] $services */ $services = $service->loadMatchingList(); foreach ($services as $_service) { $chambres = $_service->loadRefsChambres(); foreach ($chambres as $_chambre) { $_chambre->loadRefsLits(); } } return $services; }
foreach ($series as $_key => $_serie) { if ($_serie['subtotal'] == 0) { unset($series[$_key]); } } $series = array_values($series); break; // Nombre de mutations // Nombre de mutations case "mutations_count": $data[$axe] = array("options" => array("title" => utf8_encode("Nombre de mutations")), "series" => array()); $series =& $data[$axe]['series']; $service = new CService(); $service->group_id = CGroups::loadCurrent()->_id; $service->cancelled = 0; $services = $service->loadMatchingList("nom"); $services["none"] = new CService(); $services["none"]->_view = "Non renseigné"; $where["sejour.mode_sortie"] = "= 'mutation'"; $key = 0; foreach ($services as $_id => $_service) { $series[$key] = array('data' => array(), 'label' => utf8_encode($_service->_view)); $sub_total = 0; foreach ($dates as $i => $_date) { $_date_next = CMbDT::date("+1 {$period}", $_date); $where['sejour.entree'] = "BETWEEN '{$_date}' AND '{$_date_next}'"; $where['sejour.service_sortie_id'] = $_id === "none" ? "IS NULL" : "= '{$_id}'"; $count = $sejour->countList($where, null, $ljoin); $total += $count; $sub_total += $count; $series[$key]['data'][$i] = array($i, intval($count));
/** * Load Sejour for technicien at a date * * @param int $technicien_id Le technicien concerné * @param date $date La date de référence * @param bool $show_cancelled_services Afficher ou non les services inactifs * * @return CSejour[] */ static function loadSejoursSSRfor($technicien_id, $date, $show_cancelled_services = true) { $group = CGroups::loadCurrent(); // Masquer les services inactifs if (!$show_cancelled_services) { $service = new CService(); $service->group_id = $group->_id; $service->cancelled = "1"; $services = $service->loadMatchingList(); $where[] = "sejour.service_id IS NULL OR sejour.service_id " . CSQLDataSource::prepareNotIn(array_keys($services)); } $where["type"] = "= 'ssr'"; $where["group_id"] = "= '{$group->_id}'"; $where["annule"] = "= '0'"; $where["bilan_ssr.technicien_id"] = $technicien_id ? "= '{$technicien_id}'" : "IS NULL"; $leftjoin["bilan_ssr"] = "bilan_ssr.sejour_id = sejour.sejour_id"; return CSejour::loadListForDate($date, $where, "entree_reelle", null, null, $leftjoin); }
<?php /** * $Id$ * * @package Mediboard * @subpackage Hospi * @author SARL OpenXtrem <*****@*****.**> * @license GNU General Public License, see http://www.gnu.org/licenses/gpl.html * @version $Revision$ */ CCanDo::checkAdmin(); $service = new CService(); $service->group_id = CGroups::loadCurrent()->_id; $service->cancelled = 0; $order = "nom ASC"; $services = $service->loadMatchingList($order); $sejour = new CSejour(); $types_admission = $sejour->_specs["type"]->_locales; // Création du template $smarty = new CSmartyDP(); $smarty->assign("types_admission", $types_admission); $smarty->assign("services", $services); $smarty->display("configure.tpl");
} if ($order_col == "praticien_id") { $order = "sejour.praticien_id {$order_way}, patients.nom, patients.prenom"; } if ($order_col == "libelle") { $order = "sejour.libelle {$order_way}, patients.nom, patients.prenom"; } if ($order_col == "service_id") { $order = "sejour.service_id {$order_way}, patients.nom, patients.prenom"; } // Masquer les services inactifs if (!$show_cancelled_services) { $service = new CService(); $service->group_id = $group->_id; $service->cancelled = "1"; $services = $service->loadMatchingList(); $where[] = " sejour.service_id IS NULL OR sejour.service_id " . CSQLDataSource::prepareNotIn(array_keys($services)); } $sejours = CSejour::loadListForDate($date, $where, $order, null, null, $ljoin); // Filtre sur les services $services = array(); $praticiens = array(); $kines = array(); $sejours_by_kine = array("" => array()); CStoredObject::massLoadFwdRef($sejours, "praticien_id"); CStoredObject::massLoadBackRefs($sejours, "bilan_ssr"); // Filtres des séjours foreach ($sejours as $_sejour) { // Filtre sur service $service = $_sejour->loadFwdRef("service_id", true); $services[$service->_id] = $service;