예제 #1
0
/**
 * Returns the CMbObject with given GET params keys, if it doesn't exist, a redirect is made
 *
 * @param string $class_key The class name of the object
 * @param string $id_key    The object ID
 * @param string $guid_key  The object GUID (classname-id)
 *
 * @return CMbObject The object loaded or nothing
 **/
function mbGetObjectFromGet($class_key, $id_key, $guid_key = null)
{
    $object_class = CValue::get($class_key);
    $object_id = CValue::get($id_key);
    $object_guid = "{$object_class}-{$object_id}";
    if ($guid_key) {
        $object_guid = CValue::get($guid_key, $object_guid);
    }
    $object = CMbObject::loadFromGuid($object_guid);
    // Redirection
    if (!$object || !$object->_id) {
        global $ajax;
        CAppUI::redirect("ajax={$ajax}" . "&suppressHeaders=1" . "&m=system" . "&a=object_not_found" . "&object_guid={$object_guid}");
    }
    return $object;
}
 /**
  * @see parent::onAfterMain()
  */
 function onAfterMain()
 {
     $cron_log_id = CValue::get("execute_cron_log_id");
     if (!$cron_log_id) {
         return;
     }
     //Mise à jour du statut du log suite à l'appel au script
     $cron_log = new CCronJobLog();
     $cron_log->load($cron_log_id);
     if (CCronJobLog::$log) {
         $cron_log->status = "error";
         $cron_log->error = CCronJobLog::$log;
         $cron_log->end_datetime = CMbDT::dateTime();
     } else {
         $cron_log->status = "finished";
         $cron_log->end_datetime = CMbDT::dateTime();
     }
     $cron_log->store();
 }
예제 #3
0
/**
 * Fonction de construction du cache d'info des durées
 * d'hospi et d'interv
 *
 * @param string $tableName   Nom de la table de cache
 * @param string $tableFields Champs de la table de cache
 * @param array  $queryFields Liste des champs du select
 * @param string $querySelect Chaine contenant les éléments SELECT à utiliser
 * @param array  $queryWhere  Chaine contenant les éléments WHERE à utiliser
 *
 * @return void
 */
function buildPartialTables($tableName, $tableFields, $queryFields, $querySelect, $queryWhere)
{
    $ds = CSQLDataSource::get("std");
    $joinedFields = join(", ", $queryFields);
    // Intervale de temps
    $intervalle = CValue::get("intervalle");
    switch ($intervalle) {
        case "month":
            $deb = CMbDT::date("-1 month");
            break;
        case "6month":
            $deb = CMbDT::date("-6 month");
            break;
        case "year":
            $deb = CMbDT::date("-1  year");
            break;
        default:
            $deb = CMbDT::date("-10 year");
    }
    $fin = CMbDT::date();
    // Suppression si existe
    $drop = "DROP TABLE IF EXISTS `{$tableName}`";
    $ds->exec($drop);
    // Création de la table partielle
    $create = "CREATE TABLE `{$tableName}` (" . "\n`chir_id` int(11) unsigned NOT NULL default '0'," . "{$tableFields}" . "\n`ccam` varchar(255) NOT NULL default ''," . "\nKEY `chir_id` (`chir_id`)," . "\nKEY `ccam` (`ccam`)" . "\n) /*! ENGINE=MyISAM */;";
    $ds->exec($create);
    // Remplissage de la table partielle
    $query = "INSERT INTO `{$tableName}` ({$joinedFields}, `chir_id`, `ccam`)\r\n    SELECT {$querySelect}\r\n    operations.chir_id,\r\n    operations.codes_ccam AS ccam\r\n    FROM operations\r\n    LEFT JOIN users\r\n    ON operations.chir_id = users.user_id\r\n    LEFT JOIN plagesop\r\n    ON operations.plageop_id = plagesop.plageop_id\r\n    WHERE operations.annulee = '0'\r\n    {$queryWhere}\r\n    AND operations.date BETWEEN '{$deb}' AND '{$fin}'\r\n    GROUP BY operations.chir_id, ccam\r\n    ORDER BY ccam;";
    $ds->exec($query);
    CAppUI::stepAjax("Nombre de valeurs pour la table '{$tableName}': " . $ds->affectedRows(), UI_MSG_OK);
    // Insert dans la table principale si vide
    if (!$ds->loadResult("SELECT COUNT(*) FROM temps_op")) {
        $query = "INSERT INTO temps_op ({$joinedFields}, `chir_id`, `ccam`)\r\n      SELECT {$joinedFields}, `chir_id`, `ccam`\r\n      FROM {$tableName}";
        $ds->exec($query);
    } else {
        $query = "UPDATE temps_op, {$tableName} SET ";
        foreach ($queryFields as $queryField) {
            $query .= "\ntemps_op.{$queryField} = {$tableName}.{$queryField}, ";
        }
        $query .= "temps_op.chir_id = {$tableName}.chir_id" . "\nWHERE temps_op.chir_id = {$tableName}.chir_id" . "\nAND temps_op.ccam = {$tableName}.ccam";
        $ds->exec($query);
    }
}
예제 #4
0
 /**
  * Redirection facility
  *  
  * @param string $action Action view     
  * @param string $params HTTP GET styled paramters
  * 
  * @return void
  */
 function redirect($action = "access_denied", $params = null)
 {
     global $actionType;
     // on passe a null soit "tab" soit "a" selon ou l'on se trouve
     CValue::setSession($actionType);
     if ($this->setValues) {
         if (is_scalar($this->setValues)) {
             CValue::setSession($this->setValues);
         } else {
             foreach ($this->setValues as $key => $value) {
                 CValue::setSession($key, $value);
             }
         }
     }
     $action_params = "";
     foreach (array("wsdl", "info", "ajax", "raw", "dialog") as $_action_type) {
         $_action_flag = CValue::get($_action_type);
         if ($_action_flag) {
             $action_params .= "&{$_action_type}={$_action_flag}";
         }
     }
     $context_param = $this->context ? "&context={$this->context}" : "";
     CAppUI::redirect("m=system&a={$action}" . $context_param . $action_params . $params);
 }
예제 #5
0
<?php

/**
 * $Id: inc_edit_planning.php 22873 2014-04-22 07:51:07Z mytto $
 *
 * @package    Mediboard
 * @subpackage dPbloc
 * @author     SARL OpenXtrem <*****@*****.**>
 * @license    GNU General Public License, see http://www.gnu.org/licenses/gpl.html
 * @version    $Revision: 22873 $
 */
$plageop_id = CValue::getOrSession("plageop_id");
$date = CValue::getOrSession("date", CMbDT::date());
$bloc_id = CValue::get("bloc_id");
// Informations sur la plage demandée
$plagesel = new CPlageOp();
$plagesel->load($plageop_id);
$plagesel->loadRefSalle();
$listBlocs = CGroups::loadCurrent()->loadBlocs(PERM_READ, null, "nom");
//curent bloc if $bloc_id
$bloc = new CBlocOperatoire();
$bloc->load($bloc_id);
$listSalles = $bloc->loadRefsSalles();
$arrKeySalle = array_keys($listSalles);
// cleanup listBlocs
foreach ($listBlocs as $key => $curr_bloc) {
    $salles = $curr_bloc->loadRefsSalles();
    foreach ($salles as $id => $_salle) {
        if (count($arrKeySalle) && !in_array($id, $arrKeySalle)) {
            unset($salles[$id]);
            continue;
<?php

/**
 * $Id$
 *
 * @package    Mediboard
 * @subpackage dPfacturation
 * @author     SARL OpenXtrem <*****@*****.**>
 * @license    GNU General Public License, see http://www.gnu.org/licenses/gpl.html
 * @version    $Revision$
 */
$out = fopen('php://output', 'w');
header('Content-Type: application/csv');
header('Content-Disposition: attachment; filename="ExportCompta.xls"');
$facture_class = CValue::get("facture_class", 'CFactureEtablissement');
$factures_id = CValue::get("factures", array());
$factures_id = explode("|", $factures_id);
$where = array();
$where["facture_id"] = CSQLDataSource::prepareIn(array_values($factures_id));
$facture = new $facture_class();
$factures = $facture->loadList($where);
// Ligne d'entête
$fields = array();
$fields[] = "Date";
$fields[] = "Facture";
$fields[] = "Patient";
$fields[] = "Montant";
fputcsv($out, $fields, ';');
foreach ($factures as $_facture) {
    /* @var CFactureEtablissement $_facture*/
    $_facture->loadRefPatient();
<?php

/**
 * $Id$
 *
 * @category Soins
 * @package  Mediboard
 * @author   SARL OpenXtrem <*****@*****.**>
 * @license  GNU General Public License, see http://www.gnu.org/licenses/gpl.html
 * @version  $Revision$
 */
CCanDo::checkEdit();
$consult_id = CValue::get("consult_id", 0);
$sejour_id = CValue::get("sejour_id", 0);
$chir_id = CValue::get("chir_id", 0);
$sejour = new CSejour();
$sejour->load($sejour_id);
if ($sejour->_id) {
    $chir = new CMediusers();
    if ($chir_id) {
        $chir->load($chir_id);
    } else {
        $chir->load($sejour->praticien_id);
    }
    $sejour->loadRefPraticien();
    $sejour->loadRefsActes();
    $sejour->updateFormFields();
    $sejour->_datetime = CMbDT::dateTime();
    // Récupération des tarifs
    /** @var CTarif $tarif */
    $tarif = new CTarif();
// Initialisation des variables
$plageconsult_id = CValue::get("plageconsult_id");
$consult_id = CValue::get("consult_id");
$slot_id = CValue::get("slot_id");
$heure = CValue::get("heure");
$multiple = CValue::get("multipleMode", false);
$display_nb_consult = CAppUI::conf("dPcabinet display_nb_consult");
$quotas = null;
// Récupération des consultations de la plage séléctionnée
$plage = new CPlageconsult();
if ($plageconsult_id) {
    $plage->load($plageconsult_id);
    $plage->loadRefsNotes();
    $date = $plage->date;
} else {
    $date = CValue::get("date", CMbDT::date());
}
// consultation précise
$consultation_target = new CConsultation();
if ($consult_id) {
    $consultation_target->load($consult_id);
} elseif ($heure) {
    $consultation_target->heure = $heure;
}
$consultation_target->loadRefElementPrescription();
// Chargement des places disponibles
$listPlace = array();
$listBefore = array();
$listAfter = array();
$next_plage = $previous_plage = new CPlageconsult();
$function_id = null;
예제 #9
0
<?php

/**
 * View functions
 *
 * @category Mediusers
 * @package  Mediboard
 * @author   SARL OpenXtrem <*****@*****.**>
 * @license  GNU General Public License, see http://www.gnu.org/licenses/gpl.html
 * @version  SVN: $Id$
 * @link     http://www.mediboard.org
 */
CCanDo::checkRead();
$page = intval(CValue::get('page', 0));
$inactif = CValue::get("inactif", array());
$type = CValue::get("type");
// Création du template
$smarty = new CSmartyDP();
$smarty->assign("inactif", $inactif);
$smarty->assign("page", $page);
$smarty->assign("type", $type);
$smarty->display("vw_idx_functions.tpl");
<?php

/**
 * $Id$
 *
 * @package    Mediboard
 * @subpackage Stock
 * @author     SARL OpenXtrem <*****@*****.**>
 * @license    GNU General Public License, see http://www.gnu.org/licenses/gpl.html
 * @version    $Revision$
 */
CCanDo::checkEdit();
$service_id = CValue::get('service_id');
$keywords = CValue::get('keywords');
$limit = CValue::get('limit');
// Service's stocks
$where = array();
if ($service_id) {
    $where['product_stock_service.object_id'] = " = '{$service_id}'";
    $where['product_stock_service.object_class'] = " = 'CService'";
    // XXX
}
if ($keywords) {
    $where[] = "product.code LIKE '%{$keywords}%' OR \r\n              product.name LIKE '%{$keywords}%' OR \r\n              product.description LIKE '%{$keywords}%'";
}
$orderby = 'product.name ASC';
$leftjoin = array();
$leftjoin['product'] = 'product.product_id = product_stock_service.product_id';
// product to stock
$stock = new CProductStockService();
$list_stocks_count = $stock->countList($where, null, $leftjoin);
예제 #11
0
 * $Id$
 *
 * @category Admissions
 * @package  Mediboard
 * @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();
//Initialisations des variables
$date = CValue::getOrSession("date", CMbDT::date());
$today = CMbDT::date();
$hour = CMbDT::time(null);
$board = CValue::get("board", 1);
$boardItem = CValue::get("boardItem", 1);
$consult = new CConsultation();
// Récupération des fonctions
$cabinets = CMediusers::loadFonctions();
// Récupération de la liste des anesthésistes
$mediuser = new CMediusers();
$anesthesistes = $mediuser->loadAnesthesistes(PERM_READ);
if ($consult->consultation_id) {
    $date = $consult->_ref_plageconsult->date;
    CValue::setSession("date", $date);
}
// Récupération des plages de consultation du jour et chargement des références
$listPlages = array();
foreach ($anesthesistes as $anesth) {
    $listPlages[$anesth->_id]["anesthesiste"] = $anesth;
    $plage = new CPlageconsult();
<?php

/**
 * $Id$
 *
 * @package    Mediboard
 * @subpackage Cabinet
 * @author     SARL OpenXtrem <*****@*****.**>
 * @license    GNU General Public License, see http://www.gnu.org/licenses/gpl.html
 * @version    $Revision$
 */
CCanDo::checkRead();
$acte = new CActeNGAP();
$acte->quantite = CValue::get("quantite", "1");
$acte->code = CValue::get("code");
$acte->coefficient = CValue::get("coefficient", "1");
$acte->demi = CValue::get("demi");
$acte->complement = CValue::get("complement");
$acte->executant_id = CValue::get('executant_id');
$acte->gratuit = CValue::get('gratuit');
$acte->updateMontantBase();
$acte->getLibelle();
// Création du template
$smarty = new CSmartyDP();
$smarty->assign("acte", $acte);
$smarty->display("inc_vw_tarif_ngap.tpl");
예제 #13
0
<?php

/**
 * $Id$
 *
 * @package    Mediboard
 * @subpackage Qualite
 * @author     SARL OpenXtrem <*****@*****.**>
 * @license    GNU General Public License, see http://www.gnu.org/licenses/gpl.html
 * @version    $Revision$
 */
$ei_categorie_id = CValue::get("categorie_id");
$items = array();
if ($ei_categorie_id) {
    $where = array();
    $where["ei_categorie_id"] = " = '{$ei_categorie_id}'";
    $item = new CEiItem();
    $items = $item->loadList($where);
}
$smarty = new CSmartyDP();
$smarty->assign("items", $items);
$smarty->display("ajax_list_items.tpl");
<?php

/**
 * $Id$
 *
 * @package    Mediboard
 * @subpackage PlanningOp
 * @author     SARL OpenXtrem <*****@*****.**>
 * @license    GNU General Public License, see http://www.gnu.org/licenses/gpl.html
 * @version    $Revision$
 */
$type = CValue::get("type", 'check_entree');
$ds = CSQLDataSource::get("std");
$result = "";
switch ($type) {
    case 'check_entree':
        $message = " entrée(s) erronée(s)";
        $sql = "SELECT COUNT(*) AS total \n      FROM `sejour`\n      WHERE `sejour`.`entree` != IF(`sejour`.`entree_reelle`,`sejour`.`entree_reelle`,`sejour`.`entree_prevue`)";
        $result = $ds->loadResult($sql);
        break;
    case 'check_sortie':
        $message = " sortie(s) erronnée(s)";
        $sql = "SELECT COUNT(*) AS total \n      FROM `sejour`\n      WHERE `sejour`.`sortie` != IF(`sejour`.`sortie_reelle`,`sejour`.`sortie_reelle`,`sejour`.`sortie_prevue`)";
        $result = $ds->loadResult($sql);
        break;
    case 'fix_entree':
        $message = " entrée(s) corrigée(s)";
        $sql = "UPDATE `sejour` SET\n      `sejour`.`entree` = IF(`sejour`.`entree_reelle`,`sejour`.`entree_reelle`,`sejour`.`entree_prevue`)\n      WHERE `sejour`.`entree` != IF(`sejour`.`entree_reelle`,`sejour`.`entree_reelle`,`sejour`.`entree_prevue`)";
        $ds->query($sql);
        $result = $ds->affectedRows();
        break;
<?php

/**
 * $Id$
 *
 * @package    Mediboard
 * @subpackage SalleOp
 * @author     SARL OpenXtrem <*****@*****.**>
 * @license    GNU General Public License, see http://www.gnu.org/licenses/gpl.html
 * @version    $Revision$
 */
CCanDo::checkRead();
$operation_id = CValue::get("operation_id");
$operation = new COperation();
$operation->load($operation_id);
$sejour = $operation->loadRefSejour();
// Création du template
$smarty = new CSmartyDP();
$smarty->assign("sejour", $sejour);
$smarty->assign("operation", $operation);
$smarty->display("inc_vw_surveillance_perop_administration.tpl");
예제 #16
0
<?php

/**
 * $Id: object_merger.php 22331 2014-03-06 11:13:46Z charlyecho $
 *
 * @package    Mediboard
 * @subpackage System
 * @author     SARL OpenXtrem <*****@*****.**>
 * @license    GNU General Public License, see http://www.gnu.org/licenses/gpl.html
 * @version    $Revision: 22331 $
 */
$objects_class = CValue::getOrSession('objects_class');
$readonly_class = CValue::get('readonly_class');
$objects_id = CValue::get('objects_id');
$mode = CValue::get('mode');
if (!is_array($objects_id)) {
    $objects_id = explode("-", $objects_id);
}
$user = CMediusers::get();
CMbArray::removeValue("", $objects_id);
$objects = array();
$result = null;
$checkMerge = null;
$statuses = array();
$merge_type = null;
if (class_exists($objects_class) && count($objects_id)) {
    foreach ($objects_id as $object_id) {
        /** @var CMbObject $object */
        $object = new $objects_class();
        $merge_type = $object->_spec->merge_type;
        if ($merge_type == 'none') {
예제 #17
0
// Chargement du reglement
$reglement = new CReglement();
$reglement->load(CValue::get("reglement_id"));
if ($reglement->_id) {
    $reglement->loadRefsNotes();
    $object = $reglement->loadTargetObject(true);
} else {
    $object = mbGetObjectFromGet("object_class", "object_id", "object_guid");
    $reglement->setObject($object);
    $reglement->date = "now";
    $reglement->emetteur = CValue::get("emetteur");
    $reglement->mode = CValue::get("mode");
    $reglement->montant = CValue::get("montant");
}
// Chargement des banques
$banque = new CBanque();
$banques = $banque->loadList(null, "nom");
/** @var CFactureCabinet $facture */
$facture = $object;
if (CAppUI::conf("ref_pays") == 2) {
    $facture->loadRefsObjects();
    $facture->loadNumerosBVR();
}
// Création du template
$smarty = new CSmartyDP();
$smarty->assign("reglement", $reglement);
$smarty->assign("object", $object);
$smarty->assign("facture", $facture);
$smarty->assign("banques", $banques);
$smarty->assign("force_regle_acte", CValue::get("force_regle_acte"));
$smarty->display("edit_reglement.tpl");
예제 #18
0
 * @author     SARL OpenXtrem <*****@*****.**>
 * @license    GNU General Public License, see http://www.gnu.org/licenses/gpl.html
 * @version    $Revision$
 */
CCanDo::checkRead();
// Plateau du contexte
$plateau = new CPlateauTechnique();
$plateau->load(CValue::get("plateau_id"));
// Détails des techniciens
$date = CMbDT::date();
foreach ($plateau->loadRefsTechniciens(false) as $_technicien) {
    $_technicien->countSejoursDate($date);
}
// Technicien à editer
$technicien = new CTechnicien();
$technicien->load(CValue::get("technicien_id"));
$technicien->plateau_id = $plateau->_id;
$technicien->loadRefsNotes();
$technicien->loadRefPlateau();
$technicien->loadRefKine();
$technicien->countSejoursDate($date);
// Alter egos pour les transferts de séjours
$where["kine_id"] = "= '{$technicien->kine_id}'";
/** @var CTechnicien[] $alteregos */
$alteregos = $technicien->loadList($where);
unset($alteregos[$technicien->_id]);
foreach ($alteregos as $_alterego) {
    $_alterego->loadRefPlateau();
    $_alterego->loadRefKine();
}
// Kinés
<?php

/**
 * $Id$
 *
 * @category Admin
 * @package  Mediboard
 * @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();
$do_import = CValue::get("do_import");
$start = CValue::getOrSession("start", 0);
$count = CValue::get("count", 5);
$group_id = CGroups::loadCurrent()->_id;
$user = new CUser();
// Requêtes
$ljoin["id_sante400"] = "`id_sante400`.`object_id` = `users`.`user_id`";
$ljoin["users_mediboard"] = "`users`.`user_id` = `users_mediboard`.`user_id`";
$ljoin["functions_mediboard"] = "`functions_mediboard`.`function_id` = `users_mediboard`.`function_id`";
$where = array();
$where["id_sante400.object_class"] = "= 'CUser'";
$where["id_sante400.tag"] = "= '" . CAppUI::conf("admin LDAP ldap_tag") . "'";
$where["id_sante400.id400"] = "IS NOT NULL";
$where["users.template"] = "= '0'";
$where["users_mediboard.actif"] = "= '1'";
$where["functions_mediboard.group_id"] = "= '{$group_id}'";
if (!$do_import) {
    $count_users_ldap = $user->countList($where, null, $ljoin);
예제 #20
0
<?php

/**
 * $Id:$
 *
 * @package    Mediboard
 * @subpackage dPfacturation
 * @author     SARL OpenXtrem <*****@*****.**>
 * @license    GNU General Public License, see http://www.gnu.org/licenses/gpl.html
 * @version    $Revision:$
 */
CCanDo::checkEdit();
$date_min = CValue::getOrSession("_date_min", CMbDT::date());
$date_max = CValue::getOrSession("_date_max", CMbDT::date());
$type_journal = CValue::get("type_journal");
$date_min = CMbDT::dateTime($date_min);
$date_max = CMbDT::dateTime(CMbDT::date("+1 day", $date_max));
$ljoin = array();
$ljoin["facture_journal"] = "facture_journal.journal_id = files_mediboard.object_id";
$where = array();
$where["object_class"] = " = 'CJournalBill'";
$where["file_date"] = "BETWEEN '{$date_min}' AND '{$date_max}'";
$where["facture_journal.type"] = "= '{$type_journal}'";
$file = new CFile();
$files = $file->loadList($where, null, null, null, $ljoin);
foreach ($files as $_file) {
    $_file->canDo();
}
// Création du template
$smarty = new CSmartyDP();
$smarty->assign("files", $files);
예제 #21
0
/**
 * $Id$
 *
 * @package    Mediboard
 * @subpackage developpement
 * @author     SARL OpenXtrem <*****@*****.**>
 * @license    GNU General Public License, see http://www.gnu.org/licenses/gpl.html
 * @version    $Revision$
 */
CCanDo::checkRead();
if (!class_exists("CMbCodeSniffer")) {
    CAppUI::stepMessage(UI_MSG_WARNING, "CMbCodeSniffer-error-PEAR_needed");
    return;
}
$file = CValue::get("file");
$file = str_replace(":", "/", $file);
// Has to be a file, not a directory
if (!is_file($file)) {
    CAppUI::stepAjax("sniff-file-nofile-error", UI_MSG_ERROR, $file);
}
$sniffer = new CMbCodeSniffer();
$sniffer->process($file);
$sniffer->report($file);
$stats = $sniffer->stat($file);
$errors = reset($sniffer->getFilesErrors());
$alerts = $sniffer->getFlattenAlerts();
// Cuz sniffer changes work dir but restores it at destruction
// Be aware that unset() won't call __destruct() anyhow
$sniffer->__destruct();
// Création du template
예제 #22
0
<?php

/**
 * $Id: ajax_list_assurances.php 19840 2013-07-09 19:36:14Z phenxdesign $
 *
 * @package    Mediboard
 * @subpackage PlanningOp
 * @author     SARL OpenXtrem <*****@*****.**>
 * @license    GNU General Public License, see http://www.gnu.org/licenses/gpl.html
 * @version    $Revision: 19840 $
 */
CCanDo::checkRead();
$sejour_id = CValue::get("sejour_id");
$patient_id = CValue::get("patient_id");
// Chargement du patient
$patient = new CPatient();
$patient->load($patient_id);
$patient->loadRefsCorrespondantsPatient();
// On récupére le séjour
$sejour = new CSejour();
if ($sejour_id) {
    $sejour->load($sejour_id);
    // On vérifie que l'utilisateur a les droits sur le sejour
    if (!$sejour->_canRead) {
        global $m, $tab;
        CAppUI::setMsg("Vous n'avez pas accés à ce séjour", UI_MSG_WARNING);
        CAppUI::redirect("m={$m}&tab={$tab}&sejour_id=0");
    }
    $patient = $sejour->_ref_patient;
} else {
    $sejour->patient_id = $patient->_id;
예제 #23
0
/**
 * $Id$
 *
 * @package    Mediboard
 * @subpackage System
 * @author     SARL OpenXtrem <*****@*****.**>
 * @license    GNU General Public License, see http://www.gnu.org/licenses/gpl.html
 * @version    $Revision$
 */
CCanDo::checkAdmin();
ini_set("memory_limit", "2048M");
set_time_limit(3600);
$graphs = array();
$format = $format_regexp = null;
$formats = array("d/M/Y:H:i:s" => "/[0-9][0-9]\\/[A-Z][a-z][a-z]\\/[0-9][0-9][0-9][0-9]:[0-9][0-9]:[0-9][0-9]:[0-9][0-9]/", "D M d H:i:s Y" => "/[A-Z][a-z][a-z]\\s*[A-Z][a-z][a-z]\\s*[0-9]*\\s*[0-9][0-9]:[0-9][0-9]:[0-9][0-9]\\s*[0-9][0-9][0-9][0-9]/");
$mode = CValue::get("mode", "error_log");
$count_by_day = array();
$count_by_hour = array();
$count_by_ip = array();
$count_by_hour_ip = array();
$filename = "";
if (isset($_FILES["formfile"])) {
    $upload = $_FILES["formfile"];
    $filename = $_FILES["formfile"]["name"][0];
    $f = fopen($upload["tmp_name"][0], "r");
    while (!feof($f)) {
        $line = fgets($f);
        if (!$line || $line == "\n") {
            break;
        }
        if (!$format) {
예제 #24
0
            case "rpps":
                $rpps = $medecin->rpps;
                $medecin = $sibling;
                $medecin->rpps = $rpps;
        }
        $updates++;
    }
    // Sauvegarde
    $medecin->repair();
    if ($msg = $medecin->store()) {
        trigger_error("Error storing {$medecin->nom} {$medecin->prenom} ({$medecin->cp}) : {$msg}", E_USER_WARNING);
        $errors++;
    }
    $medecin->updateFormFields();
    $medecins[] = $medecin;
}
$chrono->stop();
CAppUI::stepAjax("Etape {$step} \n{$errors} erreurs d'enregistrements", $errors ? UI_MSG_OK : UI_MSG_ALERT);
// Création du template
$smarty = new CSmartyDP();
$smarty->assign("verbose", CValue::get("verbose"));
$smarty->assign("xpath_screwed", $xpath_screwed);
$smarty->assign("step", $step);
$smarty->assign("from", $from);
$smarty->assign("to", $to);
$smarty->assign("medecins", $medecins);
$smarty->assign("chrono", $chrono);
$smarty->assign("updates", $updates);
$smarty->assign("errors", $errors);
$smarty->assign("last_page", $last_page);
$smarty->display("import_medecin.tpl");
예제 #25
0
/**
 * $Id$
 *
 * @package    Mediboard
 * @subpackage dPstats
 * @author     SARL OpenXtrem <*****@*****.**>
 * @license    GNU General Public License, see http://www.gnu.org/licenses/gpl.html
 * @version    $Revision$
 */
CAppUI::requireLibraryFile("jpgraph/src/mbjpgraph");
CAppUI::requireLibraryFile("jpgraph/src/jpgraph_bar");
$debut = CValue::get("debut", CMbDT::date("-1 YEAR"));
$fin = CValue::get("fin", CMbDT::date());
$prat_id = CValue::get("prat_id", 0);
$service_id = CValue::get("service_id", 0);
$pratSel = new CMediusers();
$pratSel->load($prat_id);
$service = new CSalle();
$service->load($service_id);
$datax = array();
for ($i = $debut; $i <= $fin; $i = CMbDT::date("+1 MONTH", $i)) {
    $datax[] = CMbDT::transform("+0 DAY", $i, "%m/%Y");
}
$sql = "SELECT * FROM service WHERE";
if ($service_id) {
    $sql .= "\nAND id = '{$service_id}'";
}
$ds = CSQLDataSource::get("std");
$services = $ds->loadlist($sql);
$opbysalle = array();
global $dialog;
if ($dialog) {
    CCanDo::checkRead();
} else {
    CCanDo::checkEdit();
}
// L'utilisateur est-il chirurgien?
$chir_id = CValue::getOrSession("chir_id");
$mediuser = CMediusers::get($chir_id);
if (!$mediuser->isPraticien()) {
    $mediuser = new CMediusers();
}
$function_id = CValue::getOrSession("function_id");
$type = CValue::getOrSession("type", "interv");
$page = CValue::get("page");
$sejour_type = CValue::get("sejour_type");
$step = 30;
$protocole = new CProtocole();
$where = array();
$chir = new CMediusers();
$chir->load($chir_id);
if ($chir->_id) {
    $chir->loadRefFunction();
    $functions = array($chir->function_id);
    $chir->loadBackRefs("secondary_functions");
    foreach ($chir->_back["secondary_functions"] as $curr_sec_func) {
        $functions[] = $curr_sec_func->function_id;
    }
    $list_functions = implode(",", $functions);
    $where[] = "protocole.chir_id = '{$chir->_id}' OR protocole.function_id IN ({$list_functions})";
} else {
예제 #27
0
/**
 * $Id: ajax_login_as.php 20443 2013-09-23 13:48:21Z phenxdesign $
 *
 * @category Admin
 * @package  Mediboard
 * @author   SARL OpenXtrem <*****@*****.**>
 * @license  GNU General Public License, see http://www.gnu.org/licenses/gpl.html
 * @version  $Revision: 20443 $
 * @link     http://www.mediboard.org
 */
$user = CUser::get();
$username = trim(CValue::post('username'));
$password = trim(CValue::post('password'));
// If substitution happens when a session is locked
$is_locked = CValue::get("is_locked");
if ($is_locked) {
    $_SESSION['locked'] = false;
}
$ldap_connection = CAppUI::conf("admin LDAP ldap_connection");
$allow_login_as_ldap = CAppUI::conf("admin LDAP allow_login_as_admin");
if (!$username) {
    CAppUI::setMsg("Auth-failed-nousername", UI_MSG_ERROR);
} else {
    if ($user->user_type == 1 && (!$ldap_connection || $allow_login_as_ldap)) {
        // If admin: no need to give a password
        $_REQUEST['loginas'] = $username;
        CAppUI::login();
    } else {
        if (!$password) {
            CAppUI::setMsg("Auth-failed-nopassword", UI_MSG_ERROR);
/**
 * $Id$
 *
 * @package    Mediboard
 * @subpackage dPprescription
 * @author     SARL OpenXtrem <*****@*****.**>
 * @license     GNU General Public License, see http://www.gnu.org/licenses/gpl.html
 * @version    $Revision$
 */
$sejour_id = CValue::get("sejour_id");
$offline = CValue::get("offline");
$in_modal = CValue::get("in_modal");
$embed = CValue::get("embed");
$period = CValue::get("period");
$forms_limit = CValue::get("forms_limit");
if (!$sejour_id) {
    CAppUI::stepMessage(UI_MSG_WARNING, "Veuillez sélectionner un sejour pour visualiser le dossier complet");
    return;
}
$fiches_anesthesies = array();
$formulaires = null;
global $atc_classes;
$atc_classes = array();
$datetime_min = "";
if ($period) {
    $datetime_min = CMbDT::dateTime("- {$period} HOURS");
}
// Chargement du sejour
$sejour = new CSejour();
$sejour->load($sejour_id);
<?php

/**
 * $Id$
 *
 * @package    Mediboard
 * @subpackage Cabinet
 * @author     SARL OpenXtrem <*****@*****.**>
 * @license    GNU General Public License, see http://www.gnu.org/licenses/gpl.html
 * @version    $Revision$
 */
CCanDo::checkRead();
$consult_id = CValue::get("consult_id");
$consult = new CConsultation();
$consult->_id = $consult_id;
$consult->load();
$consult->loadRefPatient();
$consult->loadRefGrossesse();
$type = "";
switch ($consult->type_assurance) {
    case "classique":
        $type = "assurance_classique";
        break;
    case "at":
        $type = "accident_travail";
        break;
    case "smg":
        $type = "soins_medicaux_gratuits";
        break;
    case "maternite":
        $type = "maternite";
예제 #30
0
<?php

/**
 * $Id$
 *
 * @package    Mediboard
 * @subpackage Patients
 * @author     SARL OpenXtrem <*****@*****.**>
 * @license    GNU General Public License, see http://www.gnu.org/licenses/gpl.html
 * @version    $Revision$
 */
CCanDo::checkRead();
$medecin_id = CValue::get("medecin_id");
$medecin = new CMedecin();
$medecin->load($medecin_id);
if (!$medecin || !$medecin->_id) {
    CAppUI::stepAjax('common-error-Invalid object', UI_MSG_ERROR);
}
$smarty = new CSmartyDP();
$smarty->assign("medecin", $medecin);
$smarty->assign("date", CMbDT::date());
$smarty->display("print_medecin.tpl");