Пример #1
0
 * @version    $Revision: 20186 $
 */
$date = CValue::getOrSession("date");
// Chargement des praticiens
$med = new CMediusers();
$listPrat = $med->loadPraticiens(PERM_READ);
$dateEntree = CMbDT::dateTime("23:59:00", $date);
$dateSortie = CMbDT::dateTime("00:01:00", $date);
$hierEntree = CMbDT::date("- 1 day", $dateEntree);
$hierEntree = CMbDT::dateTime("23:59:00", $hierEntree);
// Chargement des services
$service = new CService();
$whereServices = array();
$whereServices["group_id"] = "= '" . CGroups::loadCurrent()->_id . "'";
$whereServices["cancelled"] = "= '0'";
$services = $service->loadListWithPerms(PERM_READ, $whereServices, "nom");
// Initialisations
$totalHospi = 0;
$totalAmbulatoire = 0;
$totalMedecin = 0;
$total_prat = array();
foreach ($listPrat as $key => $prat) {
    $totalPrat[$prat->_id]["prat"] = $prat;
    $totalPrat[$prat->_id]["hospi"] = 0;
    $totalPrat[$prat->_id]["ambu"] = 0;
    $totalPrat[$prat->_id]["total"] = 0;
}
$sejour = new CSejour();
$whereSejour = array();
$whereSejour["sejour.group_id"] = "= '" . CGroups::loadCurrent()->_id . "'";
$whereSejour["sejour.entree_reelle"] = "IS NOT NULL";
 /**
  * Get servoces list
  *
  * @return CService[]
  */
 static function getServicesList()
 {
     $service = new CService();
     $where = array();
     if (CAppUI::conf("dPstock host_group_id")) {
         $where["group_id"] = "IS NOT NULL";
     }
     return $service->loadListWithPerms(PERM_READ, $where, "nom");
 }
Пример #3
0
 static function getServicesIdsPref($services_ids = array())
 {
     // Détection du changement d'établissement
     $group_id = CValue::get("g");
     if (!$services_ids || $group_id) {
         $group_id = $group_id ? $group_id : CGroups::loadCurrent()->_id;
         $pref_services_ids = json_decode(CAppUI::pref("services_ids_hospi"));
         // Si la préférence existe, alors on la charge
         if (isset($pref_services_ids->{"g{$group_id}"})) {
             $services_ids = $pref_services_ids->{"g{$group_id}"};
             $services_ids = explode("|", $services_ids);
             CMbArray::removeValue("", $services_ids);
         } else {
             $service = new CService();
             $where = array();
             $where["group_id"] = "= '" . CGroups::loadCurrent()->_id . "'";
             $where["cancelled"] = "= '0'";
             $services_ids = array_keys($service->loadListWithPerms(PERM_READ, $where, "externe, nom"));
         }
     }
     if (is_array($services_ids)) {
         CMbArray::removeValue("", $services_ids);
     }
     global $m;
     $save_m = $m;
     foreach (array("dPhospi", "dPadmissions") as $_module) {
         $m = $_module;
         CValue::setSession("services_ids", $services_ids);
     }
     $m = $save_m;
     return $services_ids;
 }
Пример #4
0
 * @version    $Revision$
 */
CCanDo::checkRead();
$group = CGroups::loadCurrent();
$ds = CSQLDataSource::get("std");
$service_id = CValue::getOrSession("service_id", 0);
$bloc_id = CValue::getOrSession("bloc_id", 0);
$date_suivi = CValue::getOrSession("date_suivi", CMbDT::date());
$listOps = array();
// Liste des services
$service = new CService();
$where = array();
$where["group_id"] = "= '{$group->_id}'";
$where["cancelled"] = "= '0'";
$order = "nom";
$services = $service->loadListWithPerms(PERM_READ, $where, $order);
// Liste des blocs
$bloc = new CBlocOperatoire();
$where = array();
$where["group_id"] = "= '{$group->_id}'";
$order = "nom";
$blocs = $bloc->loadListWithPerms(PERM_READ, $where, $order);
// Listes des interventions
$operation = new COperation();
$ljoin = array("plagesop" => "`operations`.`plageop_id` = `plagesop`.`plageop_id`", "sallesbloc" => "`operations`.`salle_id` = `sallesbloc`.`salle_id`", "sejour" => "`operations`.`sejour_id` = `sejour`.`sejour_id`");
$where = array();
$where[] = "`plagesop`.`date` = '{$date_suivi}' OR `operations`.`date` = '{$date_suivi}'";
if ($bloc_id) {
    $where["sallesbloc.bloc_id"] = "= '{$bloc_id}'";
}
$where["operations.annulee"] = "= '0'";
Пример #5
0
 *	@package Mediboard
 *	@subpackage soins
 *	@version $Revision$
 *  @author SARL OpenXtrem
 *  @license GNU General Public License, see http://www.gnu.org/licenses/gpl.html 
 */
global $m;
CCanDo::checkEdit();
$service_id = CValue::getOrSession('service_id');
$endowment_id = CValue::getOrSession('endowment_id');
// Services list
$service = new CService();
$where = array();
$where["group_id"] = "= '" . CGroups::loadCurrent()->_id . "'";
$where["cancelled"] = "= '0'";
$list_services = $service->loadListWithPerms(PERM_READ, $where);
if ($m == "dPurgences") {
    foreach ($list_services as $_id => $_service) {
        if (!$_service->urgence) {
            unset($list_services[$_id]);
        }
    }
}
if (count($list_services) == 0) {
    CAppUI::stepMessage(UI_MSG_WARNING, "Vous n'avez accès à aucun service pour effectuer des commandes");
    return;
}
// Création du template
$smarty = new CSmartyDP("modules/soins");
$smarty->assign('service_id', $service_id);
$smarty->assign('list_services', $list_services);