Esempio n. 1
0
 /**
  * Chargements des chambres du service
  *
  * @param bool $annule Charge les chambres desactivées aussi
  *
  * @return CChambre[]
  */
 function loadRefsChambres($annule = true)
 {
     $chambre = new CChambre();
     $where = array("service_id" => "= '{$this->_id}'");
     if (!$annule) {
         $where["annule"] = "= '0'";
     }
     $order = "ISNULL(rank), rank, nom";
     return $this->_ref_chambres = $this->_back["chambres"] = $chambre->loadList($where, $order);
 }
Esempio n. 2
0
//$date           = CValue::getOrSession("date", CMbDT::date());
$date = CMbDT::dateTime();
$date_tolerance = CAppUI::conf("dPurgences date_tolerance");
$date_before = CMbDT::date("-{$date_tolerance} DAY", $date);
$date_after = CMbDT::date("+1 DAY", $date);
//recherche des chambres d'urgences placées
$chambre = new CChambre();
$ljoin = array();
$ljoin["service"] = "service.service_id = chambre.service_id";
$ljoin["emplacement"] = "emplacement.chambre_id = chambre.chambre_id";
$where = array();
$where["annule"] = "= '0'";
$where[] = "service.urgence = '1' OR service.radiologie = '1'";
$where["service.group_id"] = "= '" . CGroups::loadCurrent()->_id . "'";
$where["emplacement.plan_x"] = "IS NOT NULL";
$chambres_urgences = $chambre->loadList($where, null, null, "chambre_id", $ljoin);
$where = array();
$where["annule"] = "= '0'";
$where["service.uhcd"] = "= '1'";
$where["service.group_id"] = "= '" . CGroups::loadCurrent()->_id . "'";
$where["emplacement.plan_x"] = "IS NOT NULL";
$chambres_uhcd = $chambre->loadList($where, null, null, "chambre_id", $ljoin);
$_chambres = $chambres_urgences;
foreach ($chambres_uhcd as $_chambre_uhcd) {
    $_chambres[$_chambre_uhcd->_id] = $_chambre_uhcd;
}
$lits = CMbObject::massLoadBackRefs($_chambres, "lits");
$conf_nb_colonnes = CAppUI::conf("dPhospi nb_colonnes_vue_topologique");
$grille = array("urgence" => array_fill(0, $conf_nb_colonnes, array_fill(0, $conf_nb_colonnes, 0)), "uhcd" => array_fill(0, $conf_nb_colonnes, array_fill(0, $conf_nb_colonnes, 0)));
$listSejours = array("uhcd" => array(), "urgence" => array());
$ljoin = array();