* @subpackage PlanningOp
 * @author     SARL OpenXtrem <*****@*****.**>
 * @license    GNU General Public License, see http://www.gnu.org/licenses/gpl.html
 * @version    $Revision$
 */
global $can, $m, $tab;
CCanDo::checkRead();
$hors_plage = new CIntervHorsPlage();
if (!$hors_plage->canRead()) {
    $can->redirect();
}
// Toutes les salles des blocs
$listBlocs = CGroups::loadCurrent()->loadBlocs(PERM_READ);
// Les salles autorisées
$salle = new CSalle();
$listSalles = $salle->loadListWithPerms(PERM_READ);
// Liste des Etablissements selon Permissions
$etablissements = CMediusers::loadEtablissements(PERM_READ);
// Chargement des prestations
$prestations = CPrestation::loadCurrentList();
$operation_id = CValue::getOrSession("operation_id");
$chir_id = CAppUI::conf("dPplanningOp COperation use_session_praticien") ? CValue::getOrSession("chir_id") : CValue::get("chir_id");
$sejour_id = CValue::get("sejour_id");
$hour_urgence = CValue::get("hour_urgence");
$min_urgence = CValue::get("min_urgence");
$date_urgence = CValue::get("date_urgence");
$salle_id = CValue::get("salle_id");
$patient_id = CValue::get("pat_id");
$grossesse_id = CValue::get("grossesse_id");
$consult_related_id = CValue::get("consult_related_id");
// L'utilisateur est-il un praticien
Esempio n. 2
0
if (CAppUI::conf("dPsalleOp COperation modif_salle")) {
    $listBlocs = $group->loadBlocs(PERM_READ, null, "nom");
    // Chargement de la liste des salles de chaque bloc
    foreach ($listBlocs as $_bloc) {
        $_bloc->loadRefsSalles();
    }
}
// Chargement des Anesthésistes
$anesth = new CMediusers();
$listAnesths = $anesth->loadAnesthesistes(PERM_READ);
// Chargement des Chirurgiens
$chir = new CMediusers();
$listChirs = $chir->loadPraticiens(PERM_READ);
$salle = new CSalle();
$where = array("bloc_id" => "='{$bloc->_id}'");
$bloc->_ref_salles = $salle->loadListWithPerms(PERM_READ, $where, "nom");
$total_salles = count($bloc->_ref_salles);
$page_size = CAppUI::conf("dPbloc mode_presentation salles_count", $group);
$page_count = null;
$current_page = null;
if ($page) {
    $page_count = ceil($total_salles / $page_size);
    $current_page = ($page - 1) % $page_count;
    $slice = $current_page * $page_size;
    $bloc->_ref_salles = array_slice($bloc->_ref_salles, $slice, $page_size, true);
}
$systeme_materiel_expert = CAppUI::conf("dPbloc CPlageOp systeme_materiel") == "expert";
foreach ($bloc->_ref_salles as &$salle) {
    /** @var CSalle $salle */
    $salle->loadRefsForDay($date_suivi);
    if ($systeme_materiel_expert) {
Esempio n. 3
0
 * @package    Mediboard
 * @subpackage dPbloc
 * @author     SARL OpenXtrem <*****@*****.**>
 * @license    GNU General Public License, see http://www.gnu.org/licenses/gpl.html
 * @version    $Revision: 27325 $
 */
CCanDo::checkEdit();
$bloc_id = CValue::getOrSession("bloc_id");
$date_min = CValue::getOrSession("_date_min", CMbDT::date("-7 day"));
$date_max = CValue::getOrSession("_date_max", CMbDT::date());
$praticien_id = CValue::getOrSession("praticien_id");
$function_id = CValue::getOrSession("function_id");
// Récupération des salles
$salle = new CSalle();
$where["bloc_id"] = "= '{$bloc_id}'";
$salles = $salle->loadListWithPerms(PERM_READ, $where);
// Récupération des opérations
$ljoin = array();
$ljoin["plagesop"] = "operations.plageop_id = plagesop.plageop_id";
$where = array();
$in_salles = CSQLDataSource::prepareIn(array_keys($salles));
$where[] = "plagesop.salle_id {$in_salles}  OR operations.salle_id {$in_salles}";
$where["materiel"] = "!= ''";
$where[] = " operations.date BETWEEN '{$date_min}' AND '{$date_max}'";
if ($praticien_id) {
    $where["operations.chir_id"] = " = '{$praticien_id}'";
} elseif ($function_id) {
    $mediuser = new CMediusers();
    $users = $mediuser->loadProfessionnelDeSante(PERM_READ, $function_id);
    $where["operations.chir_id"] = CSQLDataSource::prepareIn(array_keys($users));
}
Esempio n. 4
0
 * @author   SARL OpenXtrem <*****@*****.**>
 * @license  GNU General Public License, see http://www.gnu.org/licenses/gpl.html
 * @version  $Revision:$
 * @link     http://www.mediboard.org
 */
CCanDo::checkRead();
$ds = CSQLDataSource::get("std");
$date = CValue::getOrSession("date", CMbDT::date());
// Toutes les salles des blocs
$listBlocs = CGroups::loadCurrent()->loadBlocs(PERM_READ, true, "nom", array("type" => "= 'obst'"));
// Les salles autorisées
$salle = new CSalle();
$ljoin = array("bloc_operatoire" => "sallesbloc.bloc_id = bloc_operatoire.bloc_operatoire_id");
$where = array("bloc_operatoire.type" => "= 'obst'");
/** @var CSalle[] $listSalles */
$listSalles = $salle->loadListWithPerms(PERM_READ, $where, null, null, null, $ljoin);
// Chargement des Chirurgiens
$chir = new CMediusers();
$listChirs = $chir->loadPraticiens(PERM_READ);
// Listes des interventions hors plage
$operation = new COperation();
$ljoin = array();
$ljoin["sejour"] = "operations.sejour_id = sejour.sejour_id";
$ljoin["grossesse"] = "sejour.grossesse_id = grossesse.grossesse_id";
$where = array();
// Interv ou travail qui commence le jour choisi et n'a pas terminé d'accoucher
$where[] = "operations.date = '{$date}' OR (\n  grossesse.datetime_debut_travail IS NOT NULL AND\n  DATE(grossesse.datetime_debut_travail) < '{$date}' AND\n  grossesse.datetime_accouchement IS NULL\n)";
$where["operations.chir_id"] = CSQLDataSource::prepareIn(array_keys($listChirs));
$where["sejour.grossesse_id"] = "IS NOT NULL";
/** @var CStoredObject[] $urgences */
$urgences = $operation->loadGroupList($where, "salle_id, chir_id", null, null, $ljoin);