Esempio n. 1
0
 /**
  * Récupération des alertes sur les interventions de la salle
  *
  * @return CAlert[]
  */
 function loadRefsAlertesIntervs()
 {
     $alerte = new CAlert();
     $ljoin = array();
     $ljoin["operations"] = "operations.operation_id = alert.object_id";
     $ljoin["plagesop"] = "plagesop.plageop_id = operations.plageop_id";
     $where = array();
     $where["alert.object_class"] = "= 'COperation'";
     $where["alert.tag"] = "= 'mouvement_intervention'";
     $where["alert.handled"] = "= '0'";
     $where[] = "operations.salle_id = '{$this->salle_id}'\r\n      OR plagesop.salle_id = '{$this->salle_id}'\r\n      OR (plagesop.salle_id IS NULL AND operations.salle_id IS NULL)";
     $order = "operations.date, operations.chir_id";
     return $this->_alertes_intervs = $alerte->loadList($where, $order, null, null, $ljoin);
 }
 static function massLoadRefAlerte(&$observations = array(), $handled = true)
 {
     $alerte = new CAlert();
     $where = array("object_class" => "= 'CObservationMedicale'", "object_id" => CSQLDataSource::prepareIn(CMbArray::pluck($observations, "_id")), "level" => "= 'medium'", "tag" => "= '" . self::$tag_alerte . "'");
     if (!$handled) {
         $where["handled"] = "= '0'";
     }
     $alertes = $alerte->loadList($where);
     CStoredObject::massLoadFwdRef($alertes, "handled_user_id");
     foreach ($alertes as $_alerte) {
         $observations[$_alerte->object_id]->_ref_alerte = $_alerte;
     }
     foreach ($observations as $_observation) {
         if (!$_observation->_ref_alerte) {
             $_observation->_ref_alerte = new CAlert();
         }
         $_observation->_ref_alerte->loadRefHandledUser();
     }
 }
Esempio n. 3
0
 /**
  * Chargement des alertes sur le bloc
  *
  * @return CAlert[]
  */
 function loadRefsAlertesIntervs()
 {
     $this->loadRefsSalles();
     $inSalles = CSQLDataSource::prepareIn(array_keys($this->_ref_salles));
     $alerte = new CAlert();
     $ljoin = array();
     $ljoin["operations"] = "operations.operation_id = alert.object_id";
     $ljoin["plagesop"] = "plagesop.plageop_id = operations.plageop_id";
     $where = array();
     $where["alert.object_class"] = "= 'COperation'";
     $where["alert.tag"] = "= 'mouvement_intervention'";
     $where["alert.handled"] = "= '0'";
     $where[] = "operations.salle_id " . $inSalles . " OR plagesop.salle_id " . $inSalles . " OR (plagesop.salle_id IS NULL AND operations.salle_id IS NULL)";
     $order = "operations.date, operations.chir_id";
     return $this->_alertes_intervs = $alerte->loadList($where, $order, null, null, $ljoin);
 }
Esempio n. 4
0
 /**
  * @see parent::loadAlertsNotHandled
  */
 function loadAlertsNotHandled($level = null, $tag = null, $perm = PERM_READ)
 {
     if ($tag == "observation") {
         $alert = new CAlert();
         $where = array("object_class" => "= 'CObservationMedicale'", "object_id" => CSQLDataSource::prepareIn($this->loadBackIds("observations")), "level" => "= 'medium'", "handled" => "= '0'", "tag" => "= '" . CObservationMedicale::$tag_alerte . "'");
         return $this->_refs_alerts_not_handled = $alert->loadList($where);
     }
     return parent::loadAlertsNotHandled($level, $tag, $perm);
 }