$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 $user = $chir = CMediusers::get(); if ($chir->isPraticien() and !$chir_id) { $chir_id = $chir->user_id; } // Chargement du praticien $chir = new CMediusers(); if ($chir_id) { $testChir = new CMediusers(); $testChir->load($chir_id); if ($testChir->isPraticien()) { $chir = $testChir; } } $chir->loadRefFunction(); $prat = $chir; // Chargement du patient $patient = new CPatient(); if ($patient_id && !$operation_id && !$sejour_id) { $patient->load($patient_id); $patient->loadRefsSejours(); } // On récupère le séjour $sejour = new CSejour(); if ($sejour_id && !$operation_id) { $sejour->load($sejour_id);
// Création du template $smarty = new CSmartyDP(); $smarty->assign("date", $date); $smarty->assign("listPrat", $listPrat); $smarty->assign("listInterv", $listInterv); $smarty->assign("services", $services); $smarty->assign("selPrat", $selPrat); $smarty->assign("canceled", $canceled); $smarty->assign("sans_anesth", $sans_anesth); $smarty->assign("count_ops", $count_ops); $smarty->display("vw_idx_visite_anesth.tpl"); } else { // Selection des plages du praticien et de celles de sa spécialité $praticien_id = null; $function_ids = null; if ($selPraticien->isPraticien()) { $praticien_id = $selPraticien->user_id; $function_ids = CMbArray::pluck($selPraticien->loadBackRefs("secondary_functions"), "function_id"); $function_ids[] = $selPraticien->function_id; } // Planning du mois $month_min = CMbDT::format($date, "%Y-%m-01"); $month_max = CMbDT::format($date, "%Y-%m-31"); $sql = "SELECT plagesop.*, plagesop.date AS opdate,\r\n SEC_TO_TIME(SUM(TIME_TO_SEC(operations.temp_operation))) AS duree,\r\n COUNT(operations.operation_id) AS total,\r\n SUM(operations.rank_voulu > 0) AS planned_by_chir,\r\n COUNT(IF(operations.rank > 0, NULLIF(operations.rank, operations.rank_voulu), NULL)) AS order_validated,\r\n functions_mediboard.text AS nom_function, functions_mediboard.color as color_function\r\n FROM plagesop\r\n LEFT JOIN operations\r\n ON plagesop.plageop_id = operations.plageop_id\r\n AND operations.annulee = '0'\r\n AND operations.chir_id = '{$praticien_id}'\r\n LEFT JOIN functions_mediboard\r\n ON functions_mediboard.function_id = plagesop.spec_id\r\n WHERE (plagesop.chir_id = '{$praticien_id}' OR plagesop.spec_id " . CSQLDataSource::prepareIn($function_ids) . ")\r\n AND plagesop.date BETWEEN '{$month_min}' AND '{$month_max}'\r\n GROUP BY plagesop.plageop_id\r\n ORDER BY plagesop.date, plagesop.debut, plagesop.plageop_id"; $listPlages = array(); if ($praticien_id) { $listPlages = $ds->loadList($sql); } // Urgences du mois $sql = "SELECT operations.*, operations.date AS opdate,\r\n SEC_TO_TIME(SUM(TIME_TO_SEC(operations.temp_operation))) AS duree,\r\n COUNT(operations.operation_id) AS total\r\n FROM operations\r\n WHERE operations.annulee = '0'\r\n AND operations.chir_id = '{$praticien_id}'\r\n AND operations.plageop_id IS NULL\r\n AND operations.date BETWEEN '{$month_min}' AND '{$month_max}'\r\n GROUP BY operations.date\r\n ORDER BY operations.date"; $listUrgences = array();
* @subpackage SalleOp * @author SARL OpenXtrem <*****@*****.**> * @license GNU General Public License, see http://www.gnu.org/licenses/gpl.html * @version $Revision$ */ // Récupération des paramètres $date = CValue::getOrSession("date", CMbDT::date()); $salle_id = CValue::getOrSession("salle_id"); $bloc_id = CValue::getOrSession("bloc_id"); $type = CValue::getOrSession("type", "ouverture_salle"); // Récupération de l'utilisateur courant $user = CUser::get(); $currUser = new CMediusers(); $currUser->load($user->_id); $currUser->isAnesth(); $currUser->isPraticien(); $salle = new CSalle(); $salle->load($salle_id); $bloc = new CBlocOperatoire(); $bloc->load($bloc_id); // Vérification de la check list journalière $daily_check_lists = array(); $daily_check_list_types = array(); $require_check_list = CAppUI::conf("dPsalleOp CDailyCheckList active", CGroups::loadCurrent()) && $date >= CMbDT::date() && !$currUser->_is_praticien; if ($require_check_list) { if ($bloc->_id) { list($check_list_not_validated, $daily_check_list_types, $daily_check_lists) = CDailyCheckList::getCheckLists($bloc, $date, $type); } else { list($check_list_not_validated, $daily_check_list_types, $daily_check_lists) = CDailyCheckList::getCheckLists($salle, $date, $type); } if ($check_list_not_validated == 0) {
<?php /** * $Id$ * * @package Mediboard * @subpackage PlanningOp * @author SARL OpenXtrem <*****@*****.**> * @license GNU General Public License, see http://www.gnu.org/licenses/gpl.html * @version $Revision$ */ CCanDo::checkEdit(); $praticien = new CMediusers(); $praticien_id = CValue::get("praticien_id"); $praticien->load($praticien_id); if (!$praticien->canEdit() || !$praticien->isPraticien()) { $praticien_id = null; } $patient = new CPatient(); $patient_id = CValue::get("patient_id", CValue::post("patient_id")); $patient->nom = CValue::get("patient_nom", CValue::post("patient_nom")); $patient->prenom = CValue::get("patient_prenom", CValue::post("patient_prenom")); $patient->naissance = CValue::get("patient_date_naissance", CValue::post("patient_date_naissance")); $patient->sexe = CValue::get("patient_sexe", CValue::post("patient_sexe")); $patient->adresse = CValue::get("patient_adresse", CValue::post("patient_adresse")); $patient->cp = CValue::get("patient_code_postal", CValue::post("patient_code_postal")); $patient->ville = CValue::get("patient_ville", CValue::post("patient_ville")); $patient->tel = CValue::get("patient_telephone", CValue::post("patient_telephone")); $patient->tel2 = CValue::get("patient_mobile", CValue::post("patient_mobile")); $sejour = new CSejour(); $sejour_id = CValue::get("sejour_id", CValue::post("sejour_id"));