/**
  * @see parent::isHandled()
  */
 static function isHandled(CMbObject $mbObject)
 {
     if (!CModule::getActive("dPhospi")) {
         return false;
     }
     return in_array($mbObject->_class, self::$handled);
 }
 /**
  * @see parent::updateFormFields
  */
 function updateFormFields()
 {
     parent::updateFormFields();
     $this->_parent_class = "CInteropSender";
     if (CModule::getActive("hprimxml")) {
         $this->_tag_hprimxml = CHPrimXML::getObjectTag($this->group_id);
     }
     if (CModule::getActive("phast")) {
         $this->_tag_phast = CPhast::getTagPhast($this->group_id);
     }
     if (CModule::getActive("hl7")) {
         $this->_tag_hl7 = CHL7::getObjectTag($this->group_id);
     }
 }
 function doStore()
 {
     parent::doStore();
     if (CModule::getActive("dPprescription") && !$this->_old->_id) {
         $p_to_c = new CPrescriptionProtocoleToConcept();
         $count_p_to_c = $p_to_c->countList();
         if ($count_p_to_c > 0) {
             /** @var CExObject $ex_object */
             $ex_object = $this->_obj;
             $all_fields = $ex_object->loadRefExClass()->loadRefsAllFields();
             $bool_concept_ids = array();
             foreach ($all_fields as $_field) {
                 if (strpos($_field->prop, "bool") === 0 && $_field->concept_id && $ex_object->{$_field->name} == "1") {
                     $bool_concept_ids[] = $_field->concept_id;
                 }
             }
             $bool_concept_ids = array_unique($bool_concept_ids);
             $where = array("concept_id" => $p_to_c->getDS()->prepareIn($bool_concept_ids));
             $protocole_ids = array_values(CMbArray::pluck($p_to_c->loadList($where), "protocole_id"));
             if (count($protocole_ids)) {
                 /** @var CSejour $sejour */
                 $sejour = $ex_object->getReferenceObject("CSejour");
                 if ($sejour && $sejour->_id) {
                     $prescription = $sejour->loadRefPrescriptionSejour();
                     if (!$prescription->_id) {
                         $prescription = new CPrescription();
                         $prescription->object_id = $sejour->_id;
                         $prescription->object_class = $sejour->_class;
                         $prescription->type = "sejour";
                         if ($msg = $prescription->store()) {
                             CAppUI::setMsg($msg, UI_MSG_WARNING);
                         }
                     }
                     $ops_ids = implode("-", CMbArray::pluck($sejour->loadRefsOperations(array("annulee" => "= '0'")), "operation_id"));
                     CAppUI::callbackAjax("window.opener.ExObject.checkOpsBeforeProtocole", $protocole_ids, $prescription->_id, $sejour->_id, $ops_ids);
                 }
             }
         }
     }
 }
 /**
  * Load unread messages
  *
  * @param null $user_id user to load, null = current
  *
  * @return CUserMessageDest[]
  */
 static function loadNewMessages($user_id = null)
 {
     $dests = array();
     if (CModule::getActive("messagerie")) {
         $dest = new self();
         if ($dest->_ref_module->mod_version < 0.3) {
             CAppUI::stepAjax("CModule%s-msg-pls_update_module", UI_MSG_WARNING, $dest->_ref_module->mod_name);
             return $dests;
         }
         $user = CMediusers::get($user_id);
         $where = array();
         $where["to_user_id"] = " = '{$user->_id}'";
         $where["datetime_sent"] = " IS NOT NULL";
         $where["datetime_read"] = " IS NULL";
         /** @var CUserMessageDest[] $dests */
         $dests = $dest->loadList($where);
         foreach ($dests as $_dest) {
             $_dest->loadRefFwd();
         }
     }
     return $dests;
 }
Exemple #5
0
<?php

/**
 * $Id$
 *
 * @package    Mediboard
 * @subpackage SSR
 * @author     SARL OpenXtrem <*****@*****.**>
 * @license    GNU General Public License, see http://www.gnu.org/licenses/gpl.html
 * @version    $Revision$
 */
CCando::checkEdit();
$date = CValue::get("date", CMbDT::date());
$kine_id = CValue::getOrSession("kine_id", CAppUI::$instance->user_id);
// Chargement de la liste des utilisateurs
$user = new CMediusers();
$kines = CModule::getActive("dPprescription") ? CFunctionCategoryPrescription::getAllExecutants() : $user->loadKines();
$kine = new CMediusers();
$kine->load($kine_id);
$kine->loadRefIntervenantCdARR();
// Création du template
$smarty = new CSmartyDP();
$smarty->assign("kine", $kine);
$smarty->assign("kines", $kines);
$smarty->assign("kine_id", $kine_id);
$smarty->display("vw_kine_board.tpl");
        $patient->allow_sms_notification = 1;
    }
}
// Peut etre pas besoin de verifier si on n'utilise pas VitaleVision
if ($useVitale && CAppUI::pref('LogicielLectureVitale') == 'none' && CModule::getActive("fse")) {
    $patVitale = new CPatient();
    $cv = CFseFactory::createCV();
    if ($cv) {
        $cv->getPropertiesFromVitale($patVitale, CValue::sessionAbs('administrative_data'));
        $patVitale->nullifyEmptyFields();
        $patient->extendsWith($patVitale);
        $patient->updateFormFields();
        $patient->_bind_vitale = "1";
    }
}
if ($covercard && CModule::getActive("covercard")) {
    $covercardExec = CCoverCard::process($covercard);
    if ($covercardExec->queryNumber) {
        CCoverCard::updatePatientFromCC($patient, $covercardExec);
    }
}
// Chargement du nom_fr du pays de naissance
if ($patient_id) {
    $patient->updateNomPaysInsee();
}
$group = CGroups::loadCurrent();
// Création du template
$smarty = new CSmartyDP();
$smarty->assign("patient", $patient);
$smarty->assign("useVitale", $useVitale);
$smarty->assign('nom_jeune_fille_mandatory', CAppUI::conf("dPpatients CPatient nom_jeune_fille_mandatory", $group));
Exemple #7
0
    $tab_favoris += $tab_favoris_user_sans_cibles + $tab_favoris_function_sans_cibles + $tab_favoris_group_sans_cibles;
}
// On effectue la recherche automatique
if (isset($tab_favoris)) {
    try {
        $search = new CSearch();
        $results = $search->searchAuto($tab_favoris, $_ref_object);
    } catch (Exception $e) {
        CAppUI::displayAjaxMsg("search-not-connected", UI_MSG_ERROR);
        mbLog($e->getMessage());
    }
}
// Récupération des rss items pour le marquage pmsi (preuves de recherche PMSI)
$rss_items = array();
$items = array();
if ($contexte == "pmsi" && CModule::getActive("atih")) {
    $rss = new CRSS();
    $rss->sejour_id = $sejour_id;
    $rss->loadMatchingObject();
    $rss_items = $rss->loadRefsSearchItems();
    foreach ($rss_items as $_items) {
        $items[] = $_items->search_class . "-" . $_items->search_id;
    }
}
$smarty = new CSmartyDP();
$smarty->assign("sejour", $_ref_object);
$smarty->assign("sejour_id", $_ref_object->_id);
$smarty->assign("results", $results);
$smarty->assign("date", $date);
$smarty->assign("types", $types);
$smarty->assign("contexte", $contexte);
// Chargement des boxes d'urgences
$boxes = array();
foreach (CService::loadServicesUHCD() as $service) {
    foreach ($service->_ref_chambres as $chambre) {
        foreach ($chambre->_ref_lits as $lit) {
            $boxes[$lit->_id] = $lit;
        }
    }
}
// Si admin sur le module urgences, alors modification autorisée du diagnostic
// infirmier depuis la main courante.
$module = new CModule();
$module->mod_name = "dPurgences";
$module->loadMatchingObject();
$admin_urgences = $module->canAdmin();
// Création du template
$smarty = new CSmartyDP();
$smarty->assign("boxes", $boxes);
$smarty->assign("order_col", $order_col);
$smarty->assign("order_way", $order_way);
$smarty->assign("listPrats", $listPrats);
$smarty->assign("listSejours", $listSejours);
$smarty->assign("uhcd_affichage", $uhcd_affichage);
$smarty->assign("medicalView", $medicalView);
$smarty->assign("date", $date);
$smarty->assign("date_before", $date_before);
$smarty->assign("today", CMbDT::date());
$smarty->assign("isImedsInstalled", CModule::getActive("dPImeds") && CImeds::getTagCIDC(CGroups::loadCurrent()));
$smarty->assign("admin_urgences", $admin_urgences);
$smarty->assign("type", "UHCD");
$smarty->display("inc_main_courante.tpl");
    }
    function isAuthentificate()
    {
    }
    function getResponseTime()
    {
    }
    /**
     * Get child exchanges
     *
     * @return string[] Data format classes collection
     */
    static function getAll()
    {
        $sources = CApp::getChildClasses("CExchangeSource", true);
        return array_filter($sources, function ($v) {
            $s = new $v();
            return $s->_spec->key;
        });
    }
}
if (CModule::getActive("hl7")) {
    CExchangeSource::$typeToClass["mllp"] = "CSourceMLLP";
}
if (CModule::getActive("dicom")) {
    CExchangeSource::$typeToClass["dicom"] = "CSourceDicom";
}
if (CModule::getActive("mssante")) {
    CExchangeSource::$typeToClass["mssante"] = "CSourceMSSante";
    CExchangeSource::$multi_instance[] = "CSourceMSSante";
}
 * @license    GNU General Public License, see http://www.gnu.org/licenses/gpl.html
 */
CCanDo::checkEdit();
$user_id = CCanDo::edit() ? CValue::getOrSession("user_id", "default") : null;
$user = CUser::get($user_id);
$prof = $user->profile_id ? CUser::get($user->profile_id) : new CUser();
if ($user_id == "default") {
    $user->_id = null;
}
$prefvalues = array("default" => CPreferences::get(null, true), "template" => $user->profile_id ? CPreferences::get($user->profile_id, true) : array(), "user" => $user->_id !== "" ? CPreferences::get($user->_id, true) : array());
// common sera toujours au debut
$prefs = array("common" => array());
// Classement par module et par permission fonctionnelle
CPreferences::loadModules(true);
foreach (CPreferences::$modules as $modname => $prefnames) {
    $module = CModule::getActive($modname);
    $canRead = $module ? CPermModule::getPermModule($module->_id, PERM_READ, $user_id) : false;
    if ($modname == "common" || $user_id == "default" || $canRead) {
        $prefs[$modname] = array();
        foreach ($prefnames as $prefname) {
            $prefs[$modname][$prefname] = array("default" => CMbArray::extract($prefvalues["default"], $prefname), "template" => CMbArray::extract($prefvalues["template"], $prefname), "user" => CMbArray::extract($prefvalues["user"], $prefname));
        }
    }
}
// Warning: user clone necessary!
// Some module index change $user global
$user_clone = $user;
// Chargement des modules
$modules = CPermModule::getVisibleModules();
foreach ($modules as $module) {
    // Module might not be present
<?php

/**
 * $Id$
 *
 * @package    Mediboard
 * @subpackage SalleOp
 * @author     SARL OpenXtrem <*****@*****.**>
 * @license    GNU General Public License, see http://www.gnu.org/licenses/gpl.html
 * @version    $Revision$
 */
// @todo bloc n'est pas forcément actif
global $can;
$can->read |= CModule::getActive("dPbloc")->_can->read;
$can->needsRead();
$operation_id = CValue::getOrSession("operation_id", null);
$operation = new COperation();
$operation->load($operation_id);
$operation->loadRefsAnesthPerops();
$operation->loadRefsFwd();
$operation->loadRefsActesCCAM();
foreach ($operation->_ref_actes_ccam as $keyActe => $acte) {
    $acte =& $operation->_ref_actes_ccam[$keyActe];
    $acte->loadRefsFwd();
}
if (CAppUI::conf('dPccam CCodeCCAM use_new_association_rules')) {
    $operation->guessActesAssociation();
} else {
    foreach ($operation->_ref_actes_ccam as $acte) {
        $acte->guessAssociation();
    }
 /**
  * @see parent::doStore()
  */
 function doStore()
 {
     $upload = null;
     if (CValue::POST("_from_yoplet") == 1) {
         /** @var CFile $obj */
         $obj = $this->_obj;
         $array_file_name = array();
         $path = CAppUI::conf("dPfiles yoplet_upload_path");
         if (!$path) {
             $path = "tmp";
         }
         // On retire les backslashes d'escape
         $file_name = stripslashes($this->request['_file_path']);
         // Récupération du nom de l'image en partant de la fin de la chaîne
         // et en rencontrant le premier \ ou /
         preg_match('@[\\\\/]([^\\\\/]*)$@i', $file_name, $array_file_name);
         $file_name = $array_file_name[1];
         $extension = strrchr($file_name, '.');
         $_rename = $this->request['_rename'] ? $this->request['_rename'] : 'upload';
         $file_path = "{$path}/" . $this->request['_checksum'];
         $obj->file_name = $_rename == 'upload' ? $file_name : $_rename . $extension;
         $obj->_old_file_path = $this->request['_file_path'];
         $obj->doc_size = filesize($file_path);
         $obj->author_id = CAppUI::$user->_id;
         if (CModule::getActive("cda")) {
             $obj->type_doc = $this->request["type_doc"];
         }
         $obj->fillFields();
         $obj->updateFormFields();
         $obj->file_type = CMbPath::guessMimeType($file_name);
         if ($msg = $obj->store()) {
             CAppUI::setMsg($msg, UI_MSG_ERROR);
         } else {
             $obj->forceDir();
             $obj->moveFile($file_path);
         }
         return parent::doStore();
     }
     $_file_category_id = CValue::post("_file_category_id");
     $language = CValue::post("language");
     $type_doc = CValue::post("type_doc");
     $named = CValue::post("named");
     $rename = CValue::post("_rename");
     CValue::setSession("_rename", $rename);
     if (isset($_FILES["formfile"])) {
         $aFiles = array();
         $upload =& $_FILES["formfile"];
         foreach ($upload["error"] as $fileNumber => $etatFile) {
             if (!$named) {
                 $rename = $rename ? $rename . strrchr($upload["name"][$fileNumber], '.') : "";
             }
             if ($upload["name"][$fileNumber]) {
                 $aFiles[] = array("_mode" => "file", "name" => $upload["name"][$fileNumber], "type" => CMbPath::guessMimeType($upload["name"][$fileNumber]), "tmp_name" => $upload["tmp_name"][$fileNumber], "error" => $upload["error"][$fileNumber], "size" => $upload["size"][$fileNumber], "language" => $language, "type_doc" => $type_doc, "file_category_id" => $_file_category_id, "object_id" => CValue::post("object_id"), "object_class" => CValue::post("object_class"), "_rename" => $rename);
             }
         }
         // Pasted images, via Data uri
         if (!empty($_POST["formdatauri"])) {
             $data_uris = $_POST["formdatauri"];
             $data_names = $_POST["formdatauri_name"];
             foreach ($data_uris as $fileNumber => $fileContent) {
                 $parsed = $this->parseDataUri($fileContent);
                 $_name = $data_names[$fileNumber];
                 if (!$named) {
                     $ext = strrchr($_name, '.');
                     if ($ext === false) {
                         $ext = "." . substr(strrchr($parsed["mime"], '/'), 1);
                         $_name .= $ext;
                     }
                     $rename = $rename ? $rename . $ext : "";
                 }
                 $temp = tempnam(sys_get_temp_dir(), "up_");
                 file_put_contents($temp, $parsed["data"]);
                 if ($data_names[$fileNumber]) {
                     $aFiles[] = array("_mode" => "datauri", "name" => $_name, "type" => $parsed["mime"], "tmp_name" => $temp, "error" => 0, "size" => strlen($parsed["data"]), "language" => $language, "type_doc" => $type_doc, "file_category_id" => $_file_category_id, "object_id" => CValue::post("object_id"), "object_class" => CValue::post("object_class"), "_rename" => $rename);
                 }
             }
         }
         $merge_files = CValue::post("_merge_files");
         if ($merge_files) {
             $pdf = new CMbPDFMerger();
             $this->_obj = new $this->_obj->_class();
             /** @var CFile $obj */
             $obj = $this->_obj;
             $file_name = "";
             $nb_converted = 0;
             foreach ($aFiles as $key => $file) {
                 $converted = 0;
                 if ($file["error"] == UPLOAD_ERR_NO_FILE) {
                     continue;
                 }
                 if ($file["error"] != 0) {
                     CAppUI::setMsg(CAppUI::tr("CFile-msg-upload-error-" . $file["error"]), UI_MSG_ERROR);
                     continue;
                 }
                 // Si c'est un pdf, on le rajoute sans aucun traitement
                 if (substr(strrchr($file["name"], '.'), 1) == "pdf") {
                     $file_name .= substr($file["name"], 0, strpos($file["name"], '.'));
                     $pdf->addPDF($file["tmp_name"], 'all');
                     $nb_converted++;
                     $converted = 1;
                 } else {
                     if ($obj->isPDFconvertible($file["name"]) && $obj->convertToPDF($file["tmp_name"], $file["tmp_name"] . "_converted")) {
                         $pdf->addPDF($file["tmp_name"] . "_converted", 'all');
                         $file_name .= substr($file["name"], 0, strpos($file["name"], '.'));
                         $nb_converted++;
                         $converted = 1;
                     } else {
                         $other_file = new CFile();
                         $other_file->bind($file);
                         $other_file->file_name = $file["name"];
                         $other_file->file_type = $file["type"];
                         $other_file->doc_size = $file["size"];
                         $other_file->fillFields();
                         $other_file->private = CValue::post("private");
                         if (false == ($res = $other_file->moveTemp($file))) {
                             CAppUI::setMsg("Fichier non envoyé", UI_MSG_ERROR);
                             continue;
                         }
                         $other_file->author_id = CAppUI::$user->_id;
                         if ($msg = $other_file->store()) {
                             CAppUI::setMsg("Fichier non enregistré: {$msg}", UI_MSG_ERROR);
                             continue;
                         }
                         CAppUI::setMsg("Fichier enregistré", UI_MSG_OK);
                     }
                 }
                 // Pour le nom du pdf de fusion, on concatène les noms des fichiers
                 if ($key != count($aFiles) - 1 && $converted) {
                     $file_name .= "-";
                 }
             }
             // Si des fichiers ont été convertis et ajoutés à PDFMerger,
             // création du cfile.
             if ($nb_converted) {
                 $obj->file_name = $file_name . ".pdf";
                 $obj->file_type = "application/pdf";
                 $obj->author_id = CAppUI::$user->_id;
                 $obj->private = CValue::post("private");
                 $obj->object_id = CValue::post("object_id");
                 $obj->object_class = CValue::post("object_class");
                 $obj->updateFormFields();
                 $obj->fillFields();
                 $obj->forceDir();
                 $tmpname = tempnam("/tmp", "pdf_");
                 $pdf->merge('file', $tmpname);
                 $obj->doc_size = strlen(file_get_contents($tmpname));
                 $obj->moveFile($tmpname);
                 //rename($tmpname, $obj->_file_path . "/" .$obj->file_real_filename);
                 if ($msg = $obj->store()) {
                     CAppUI::setMsg("Fichier non enregistré: {$msg}", UI_MSG_ERROR);
                 } else {
                     CAppUI::setMsg("Fichier enregistré", UI_MSG_OK);
                 }
             }
         } else {
             foreach ($aFiles as $file) {
                 if ($file["error"] == UPLOAD_ERR_NO_FILE) {
                     continue;
                 }
                 if ($file["error"] != 0) {
                     CAppUI::setMsg(CAppUI::tr("CFile-msg-upload-error-" . $file["error"]), UI_MSG_ERROR);
                     continue;
                 }
                 // Reinstanciate
                 $this->_obj = new $this->_obj->_class();
                 /** @var CFile $obj */
                 $obj = $this->_obj;
                 $obj->bind($file);
                 $obj->file_name = empty($file["_rename"]) ? $file["name"] : $file["_rename"];
                 $obj->file_type = $file["type"];
                 if ($obj->file_type == "application/x-download") {
                     $obj->file_type = CMbPath::guessMimeType($obj->file_name);
                 }
                 $obj->doc_size = $file["size"];
                 $obj->fillFields();
                 $obj->private = CValue::post("private");
                 if ($file["_mode"] == "file") {
                     $res = $obj->moveTemp($file);
                 } else {
                     $res = $obj->moveFile($file["tmp_name"]);
                 }
                 if (false == $res) {
                     CAppUI::setMsg("Fichier non envoyé", UI_MSG_ERROR);
                     continue;
                 }
                 // File owner on creation
                 if (!$obj->file_id) {
                     $obj->author_id = CAppUI::$user->_id;
                 }
                 if ($msg = $obj->store()) {
                     CAppUI::setMsg("Fichier non enregistré: {$msg}", UI_MSG_ERROR);
                     continue;
                 }
                 CAppUI::setMsg("Fichier enregistré", UI_MSG_OK);
             }
         }
         // Redaction du message et renvoi
         if (CAppUI::isMsgOK() && $this->redirectStore) {
             $this->redirect =& $this->redirectStore;
         }
         if (!CAppUI::isMsgOK() && $this->redirectError) {
             $this->redirect =& $this->redirectError;
         }
     } else {
         parent::doStore();
     }
 }
Exemple #13
0
<?php

/**
 * $Id: vw_all_perms.php 27868 2015-04-04 16:59:04Z mytto $
 *
 * @category Admin
 * @package  Mediboard
 * @author   SARL OpenXtrem <*****@*****.**>
 * @license  GNU General Public License, see http://www.gnu.org/licenses/gpl.html
 * @version  $Revision: 27868 $
 * @link     http://www.mediboard.org
 */
CCanDo::checkRead();
CView::enforceSlave();
// Liste des modules
$listModules = CModule::getActive();
// Liste des utilisateurs
$listFunctions = CGroups::loadCurrent()->loadFunctions(PERM_READ);
foreach ($listFunctions as &$curr_function) {
    $curr_function->loadRefsUsers();
}
// Matrice des droits
$perms = array(PERM_DENY => "interdit", PERM_READ => "lecture", PERM_EDIT => "ecriture");
$views = array(PERM_DENY => "caché", PERM_READ => "menu", PERM_EDIT => "administration");
$icons = array(PERM_DENY => "empty", PERM_READ => "read", PERM_EDIT => "edit");
$where = array();
$whereGeneral = array("mod_id" => "IS NULL");
$matrice = array();
foreach ($listFunctions as $curr_func) {
    foreach ($curr_func->_ref_users as $curr_user) {
        $curr_user->loadRefProfile();
 /**
  * @see parent::store()
  */
 function store()
 {
     $is_new = !$this->_id;
     if ($msg = parent::store()) {
         return $msg;
     }
     if ($is_new) {
         CConfiguration::clearDataCache();
         if (CModule::getActive("dPprescription")) {
             CConfigService::emptySHM();
             CConfigMomentUnitaire::emptySHM();
         }
     }
     return null;
 }
 /**
  * Load active module
  *
  * @param string $name Name of the module
  *
  * @return CModule
  */
 function loadRefModule($name)
 {
     return $this->_ref_module = CModule::getActive($name);
 }
Exemple #16
0
$where["consultation.du_tiers"] = "> 0";
$where["consultation.tiers_date_reglement"] = "IS NULL";
$where["plageconsult.date"] = "BETWEEN '{$filter->_date_min}' AND '{$filter->_date_max}'";
// Filtre sur les praticiens
$chir_id = CValue::getOrSession("chir");
$listPrat = CConsultation::loadPraticiensCompta($chir_id);
$where["plageconsult.chir_id"] = CSQLDataSource::prepareIn(array_keys($listPrat));
$order = "plageconsult.date";
/** @var CConsultation[] $listConsults */
$listConsults = $consult->loadList($where, $order, null, null, $ljoin);
$total = array("nb" => 0, "value" => 0);
foreach ($listConsults as $consult) {
    $consult->loadRefsFwd();
    $consult->loadRefsReglements();
    // Chargment de la FSE
    if (CModule::getActive("fse")) {
        if ($fse = CFseFactory::createFSE()) {
            $fse->loadIdsFSE($consult);
        }
    }
    // Retour Noemie déjà traité
    $hasNoemie = !$consult->_current_fse || $consult->_current_fse->hasNoemie();
    if ($hasNoemie) {
        unset($listConsults[$consult->_id]);
        continue;
    }
    // Nouveau règelement pour le formulaire
    $consult->_new_reglement_tiers = new CReglement();
    $consult->_new_reglement_tiers->setObject($consult);
    $consult->_new_reglement_tiers->mode = "virement";
    $consult->_new_reglement_tiers->montant = $consult->_du_restant_tiers;
 * @license  GNU General Public License, see http://www.gnu.org/licenses/gpl.html
 * @version  $Revision$
 * @link     http://www.mediboard.org
 */
CCanDo::checkEdit();
$sejour_id = CValue::get("sejour_id");
$sejour = new CSejour();
$sejour->load($sejour_id);
$sejour->loadExtDiagnostics();
$sejour->loadDiagnosticsAssocies();
$sejour->loadRelPatient();
$sejour->_ref_patient->loadRefDossierMedical();
$rss = null;
$cim_das = array();
$cim_das_patient = array();
if (CModule::getActive("atih") && CAppUI::conf("dPpmsi use_cim_pmsi")) {
    $rss = new CRSS();
    $rss->sejour_id = $sejour_id;
    $rss->loadMatchingObject();
    $rss->loadRefDiagnostics();
    $cim_dp = CCIM10::get($sejour->DP);
    $cim_dr = CCIM10::get($sejour->DR);
    $code = null;
    foreach ($sejour->_diagnostics_associes as $_da) {
        $code = CCIM10::get($_da);
        if ($code->type != 3) {
            $cim_das[preg_replace("/\\./", "", $_da)] = true;
        } else {
            $cim_das[preg_replace("/\\./", "", $_da)] = false;
        }
    }
 * @version  $Revision: 28865 $
 * @link     http://www.mediboard.org
 */
CCanDo::checkAdmin();
/** @var int $step */
$step = CView::get("step", "num default|100000");
/** @var int $offset */
$offset = CView::get("offset", "num default|1");
/** @var bool $execute */
$execute = CView::get("execute", "bool default|0", true);
/** @var bool $auto */
$auto = CView::get("auto", "bool", true);
CView::checkin();
$copies = array(array("CConstantesMedicales", "user_id", "user_id"), array("CConstantesMedicales", "date", "creation_date"), array("CAlert", "date", "creation_date"), array("CCompteRendu", "date", "creation_date"), array("CAntecedent", "user_id", "owner_id"), array("CAntecedent", "date", "creation_date"), array("CTraitement", "user_id", "owner_id"), array("CTraitement", "date", "creation_date"), array("CProductDelivery", "user_id", "preparateur_id"), array("CProductDeliveryTrace", "user_id", "preparateur_id"), array("CRefusDispensation", "user_id", "preparateur_id"));
// Ajout des classes de formulaires
if (CModule::getActive("forms")) {
    $ex_class = new CExClass();
    $ex_class_ids = $ex_class->loadIds();
    foreach ($ex_class_ids as $_id) {
        $copies[] = array("CExObject_{$_id}", "user_id", "owner_id");
        $copies[] = array("CExObject_{$_id}", "date", "datetime_create");
        $copies[] = array("CExObject_{$_id}", "date", function (CSQLDataSource $ds, $log) use($_id) {
            $query = "UPDATE `ex_link`\n                  SET `datetime_create` = ?1,\n                      `owner_id` = ?2\n                  WHERE\n                      `ex_object_id` = ?3 AND\n                      `ex_class_id`  = ?4 AND\n                      `datetime_create` IS NULL;";
            return $ds->prepare($query, $log["date"], $log["user_id"], $log["object_id"], $_id);
        });
    }
}
/**
 * Create user authentication entry
 *
 * @param CSQLDataSource $ds   Data source
Exemple #19
0
 /**
  * Bind the tarif to the codable
  *
  * @return null|string
  */
 function bindTarif()
 {
     if ($this->_class != "COperation") {
         $this->completeField("praticien_id");
     }
     $this->_bind_tarif = false;
     $this->loadRefPraticien();
     // Chargement du tarif
     $tarif = new CTarif();
     $tarif->load($this->_tarif_id);
     if ($this->_class != "CConsultation") {
         $this->tarif = $this->tarif ? "composite" : $tarif->description;
     }
     // Mise à jour de codes CCAM prévus, sans information serialisée complémentaire
     $this->_codes_ccam = array();
     foreach ($tarif->_codes_ccam as $_code_ccam) {
         $this->_codes_ccam[] = substr($_code_ccam, 0, 7);
     }
     $this->codes_ccam = implode("|", $this->_codes_ccam);
     $this->exec_tarif = $this->_acte_execution ? $this->_acte_execution : $this->getActeExecution();
     if ($msg = $this->store()) {
         return $msg;
     }
     // Precodage des actes NGAP avec information sérialisée complète
     $this->_tokens_ngap = $tarif->codes_ngap;
     if ($msg = $this->precodeActe("_tokens_ngap", "CActeNGAP", $this->_ref_praticien->_id)) {
         return $msg;
     }
     $this->codes_ccam = $tarif->codes_ccam;
     // Precodage des actes CCAM avec information sérialisée complète
     if ($msg = $this->precodeCCAM($this->_ref_praticien->_id)) {
         return $msg;
     }
     $this->codes_ccam = implode("|", $this->_codes_ccam);
     if (CModule::getActive("tarmed")) {
         $this->_tokens_tarmed = $tarif->codes_tarmed;
         if ($msg = $this->precodeActe("_tokens_tarmed", "CActeTarmed", $this->_ref_praticien->_id)) {
             return $msg;
         }
         $this->_tokens_caisse = $tarif->codes_caisse;
         if ($msg = $this->precodeActe("_tokens_caisse", "CActeCaisse", $this->_ref_praticien->_id)) {
             return $msg;
         }
     }
     return null;
 }
    $session_lifetime = (int) ($gc_maxlifetime / 60);
}
$session_lifetime_values = array("", 5, 10, 15, 20, 25, 30, 45, 60, 120, 180, 240, 300);
$session_lifetime_enum = implode("|", $session_lifetime_values);
if ($session_lifetime) {
    $session_lifetime_enum = array();
    foreach ($session_lifetime_values as $_enum) {
        if ($_enum <= $session_lifetime) {
            $session_lifetime_enum[] = $_enum;
        }
    }
    if (!empty($session_lifetime_enum)) {
        $session_lifetime_enum = implode("|", $session_lifetime_enum);
    }
}
$smarty = new CSmartyDP();
// Tasking
if (CModule::getActive("tasking")) {
    $tasking = CTaskingTicket::getPrefs($prefs, $user);
    $smarty->assign("owners", $tasking["owners"]);
    $smarty->assign("request_ticket", $tasking["request_ticket"]);
}
$smarty->assign("user", $user);
$smarty->assign("prof", $prof);
$smarty->assign("user_id", $user_id);
$smarty->assign("locales", $locales);
$smarty->assign("styles", $styles);
$smarty->assign("modules", $modules);
$smarty->assign("prefs", $prefs);
$smarty->assign("session_lifetime_enum", $session_lifetime_enum);
$smarty->display("edit_prefs.tpl");
Exemple #21
0
 /**
  * Return idex type if it's special (e.g. IPP/...)
  *
  * @param CIdSante400 $idex Idex
  *
  * @return string|null
  */
 function getSpecialIdex(CIdSante400 $idex)
 {
     // L'identifiant externe est l'IPP
     if ($idex->tag == self::getTagIPP()) {
         return "IPP";
     }
     if (CModule::getActive("mvsante")) {
         return CMVSante::getSpecialIdex($idex);
     }
     return null;
 }
Exemple #22
0
<?php

/**
 * $Id: index.php 27581 2015-03-17 16:46:49Z armengaudmc $
 *
 * @package    Mediboard
 * @subpackage PMSI
 * @author     SARL OpenXtrem <*****@*****.**>
 * @license    GNU General Public License, see http://www.gnu.org/licenses/gpl.html
 * @version    $Revision: 27581 $
 */
$module = CModule::getInstalled(basename(dirname(__FILE__)));
if (CAppUI::conf("dPpmsi display see_recept_dossier", CGroups::loadCurrent())) {
    $module->registerTab("vw_recept_dossiers", TAB_READ);
}
$module->registerTab("vw_dossier_pmsi", TAB_EDIT);
$module->registerTab("vw_current_dossiers", TAB_READ);
$module->registerTab("vw_print_planning", TAB_READ);
if (CAppUI::conf("ref_pays") == "2") {
    $module->registerTab("vw_idx_sortie", TAB_READ);
}
if (CModule::getActive("atih")) {
    $module->registerTab("vw_traitement_dossiers", TAB_EDIT);
    $module->registerTab("vw_statistics_pmsi", TAB_ADMIN);
}
$module->registerTab('vw_cim10_explorer', TAB_READ);
Exemple #23
0
    $patient->load($patient_id);
}
$patient_nom = trim(CValue::getOrSession("nom"));
$patient_prenom = trim(CValue::getOrSession("prenom"));
$patient_ville = CValue::get("ville");
$patient_cp = CValue::get("cp");
$patient_day = CValue::getOrSession("Date_Day");
$patient_month = CValue::getOrSession("Date_Month");
$patient_year = CValue::getOrSession("Date_Year");
$patient_naissance = "{$patient_year}-{$patient_month}-{$patient_day}";
$patient_ipp = CValue::get("patient_ipp");
$patient_nda = CValue::get("patient_nda");
$useVitale = CValue::get("useVitale", CModule::getActive("fse") && CAppUI::pref('LogicielLectureVitale') != 'none' ? 1 : 0);
$prat_id = CValue::get("prat_id");
$patient_sexe = CValue::get("sexe");
$useCovercard = CValue::get("usecovercard", CModule::getActive("fse") && CModule::getActive("covercard") ? 1 : 0);
$patient_nom_search = null;
$patient_prenom_search = null;
// Save history
$params = array("new" => $new, "patient_id" => $patient_id, "nom" => $patient_nom, "prenom" => $patient_prenom, "ville" => $patient_ville, "cp" => $patient_cp, "Date_Day" => $patient_day, "Date_Month" => $patient_month, "Date_Year" => $patient_year, "patient_ipp" => $patient_ipp, "patient_nda" => $patient_nda, "prat_id" => $prat_id, "sexe" => $patient_sexe);
CViewHistory::save($patient, CViewHistory::TYPE_SEARCH, $params);
$patVitale = new CPatient();
// Liste des praticiens
$prats = $mediuser->loadPraticiens();
// Création du template
$smarty = new CSmartyDP();
$smarty->assign("dPsanteInstalled", CModule::getInstalled("dPsante400"));
$smarty->assign("nom", $patient_nom);
$smarty->assign("prenom", $patient_prenom);
$smarty->assign("naissance", $patient_naissance);
$smarty->assign("ville", $patient_ville);
Exemple #24
0
/**
 * $Id$
 *  
 * @package    Mediboard
 * @subpackage messagerie
 * @author     SARL OpenXtrem <*****@*****.**>
 * @license    GNU General Public License, see http://www.gnu.org/licenses/gpl.html
 * @version    $Revision$
 * @link       http://www.mediboard.org
 */
$user = CMediusers::get();
$source_smtp = CExchangeSource::get("mediuser-" . $user->_id, "smtp", true, null, false);
$source_pop = new CSourcePOP();
$source_pop->object_class = $user->_class;
$source_pop->object_id = $user->_id;
$source_pop->name = 'SourcePOP-' . $user->_id . '-' . ($source_pop->countMatchingList() + 1);
$mssante = false;
if (CModule::getActive('mssante') && CModule::getCanDo('mssante')->read) {
    $mssante = true;
}
$apicrypt = false;
if (CModule::getActive('apicrypt') && CModule::getCanDo('apicrypt')->read) {
    $apicrypt = true;
}
$smarty = new CSmartyDP();
$smarty->assign('source_smtp', $source_smtp);
$smarty->assign('source_pop', $source_pop);
$smarty->assign('mssante', $mssante);
$smarty->assign('apicrypt', $apicrypt);
$smarty->display('inc_add_account.tpl');
CCanDo::checkEdit();
$consult_id = CValue::getOrSession("selConsult");
$user_id = CValue::getOrSession("chirSel");
$_is_anesth = CValue::get("_is_anesth");
// Utilisateur sélectionné
$user = CMediusers::get($user_id);
$canUser = $user->canDo();
$canUser->needsEdit();
// Liste des praticiens
$listPrats = CConsultation::loadPraticiens(PERM_EDIT);
// Consultation courante
$consult = new CConsultation();
$consult->load($consult_id);
$consult->loadRefConsultAnesth();
CCanDo::checkObject($consult);
$canConsult = $consult->canDo();
$canConsult->needsEdit();
$consult->loadRefPatient();
$consult->_ref_patient->loadRefPhotoIdentite();
$consult->loadRefPraticien()->loadRefFunction();
$consult->loadRefSejour();
if (CModule::getActive("maternite")) {
    $consult->loadRefGrossesse();
}
// Création du template
$smarty = new CSmartyDP();
$smarty->assign("_is_anesth", $_is_anesth);
$smarty->assign("consult", $consult);
$smarty->assign("consult_anesth", $consult->_ref_consult_anesth);
$smarty->assign("listPrats", $listPrats);
$smarty->display("inc_finish_banner.tpl");
$interv = new COperation();
$interv->load($operation_id);
$interv->loadRefSejour()->loadRefPatient()->loadRefLatestConstantes();
$interv->loadRefPlageOp();
$interv->_ref_sejour->_ref_patient->loadRefDossierMedical();
$consult_anesth = $interv->loadRefsConsultAnesth();
$group = CGroups::loadCurrent();
$pack = $interv->loadRefGraphPack();
list($graphs, $yaxes_count, $time_min, $time_max, $time_debut_op_iso, $time_fin_op_iso) = CObservationResultSet::buildGraphs($interv, $pack->_id);
$time_debut_op = CMbDate::toUTCTimestamp($time_debut_op_iso);
$time_fin_op = CMbDate::toUTCTimestamp($time_fin_op_iso);
$evenements = CObservationResultSet::buildEventsGrid($interv, $time_debut_op_iso, $time_fin_op_iso, $time_min, $time_max);
$now = 100 * (CMbDate::toUTCTimestamp(CMbDT::dateTime()) - $time_min) / ($time_max - $time_min);
$graph_packs = CSupervisionGraphPack::getAllFor($group);
$concentrators = null;
if (CModule::getActive("patientMonitoring")) {
    $concentrator = new CMonitoringConcentrator();
    $concentrators = $concentrator->loadList();
}
// Création du template
$smarty = new CSmartyDP();
$smarty->assign("pack", $pack);
$smarty->assign("interv", $interv);
$smarty->assign("graphs", $graphs);
$smarty->assign("evenements", $evenements);
$smarty->assign("time_debut_op", $time_debut_op);
$smarty->assign("time_fin_op", $time_fin_op);
$smarty->assign("yaxes_count", $yaxes_count);
$smarty->assign("consult_anesth", $consult_anesth);
$smarty->assign("now", $now);
$smarty->assign("time_debut_op_iso", $time_debut_op_iso);
$op->loadRefChir2();
$op->loadRefChir3();
$op->loadRefChir4();
if (!$op->_id) {
    $op->_time_op = $op->temp_operation = "00:00:00";
    if ($hour_urgence && $min_urgence) {
        $time = "{$hour_urgence}:{$min_urgence}:00";
    } else {
        $time = str_pad($hours_urgence["deb"], 2, "0", STR_PAD_LEFT) . ":00:00";
    }
    $op->_time_urgence = $op->time_operation = $time;
}
// Création du template
$smarty = new CSmartyDP();
$smarty->assign("sejours_collision", $patient->getSejoursCollisions());
$smarty->assign("isPrescriptionInstalled", CModule::getActive("dPprescription"));
$smarty->assign("canSante400", CModule::getCanDo("dPsante400"));
$smarty->assign("urgInstalled", CModule::getInstalled("dPurgences"));
$smarty->assign("heure_sortie_ambu", $heure_sortie_ambu);
$smarty->assign("heure_sortie_autre", $heure_sortie_autre);
$smarty->assign("heure_entree_veille", $heure_entree_veille);
$smarty->assign("heure_entree_jour", $heure_entree_jour);
$smarty->assign("op", $op);
$smarty->assign("plage", $op->plageop_id ? $op->_ref_plageop : new CPlageOp());
$smarty->assign("sejour", $sejour);
$smarty->assign("chir", $chir);
$smarty->assign("praticien", $prat);
$smarty->assign("patient", $patient);
$smarty->assign("sejours", $sejours);
$smarty->assign("ufs", CUniteFonctionnelle::getUFs());
$smarty->assign("_functions", $_functions);
    $etat_dents = $dossier_medical->loadRefsEtatsDents();
    foreach ($etat_dents as $etat) {
        $list_etat_dents[$etat->dent] = $etat->etat;
    }
    $dossier_medical->loadRefsAllergies();
    $dossier_medical->loadRefsAntecedents();
    $dossier_medical->countAntecedents(false);
    $dossier_medical->countAllergies();
}
$sejour = $consult->loadRefSejour();
// Chargement du sejour
if ($sejour->_id) {
    // Cas des urgences
    $rpu = $sejour->loadRefRPU();
}
$isPrescriptionInstalled = CModule::getActive("dPprescription");
// Création du template
$smarty = new CSmartyDP();
$smarty->assign("consult", $consult);
$smarty->assign("isPrescriptionInstalled", $isPrescriptionInstalled);
$smarty->assign("listPrats", $listPrats);
if ($isPrescriptionInstalled) {
    $smarty->assign("line", new CPrescriptionLineMedicament());
    CPrescription::$_load_lite = true;
    $consult->_ref_sejour->loadRefPrescriptionSejour();
    $consultAnesth->loadRefSejour()->loadRefPrescriptionSejour();
    CPrescription::$_load_lite = false;
}
$smarty->assign("represcription", CValue::get("represcription", 0));
$smarty->assign("date", $date);
$smarty->assign("hour", $hour);
            $_line_dmi->loadRefPraticien();
            $_line_dmi->loadRefProductOrderItemReception()->loadRefOrderItem()->loadReference()->loadRefSociete();
        }
    }
}
ksort($dossier);
// Constantes du séjour
$where = array();
if ($datetime_min) {
    $where["datetime"] = " >= '{$datetime_min}'";
}
$sejour->loadListConstantesMedicales($where);
$constantes_grid = CConstantesMedicales::buildGrid($sejour->_list_constantes_medicales, false);
$praticien = new CMediusers();
// Création du template
$smarty = new CSmartyDP();
$smarty->assign("sejour", $sejour);
$smarty->assign("dossier", $dossier);
$smarty->assign("list_lines", $list_lines);
$smarty->assign("constantes_medicales_grid", $constantes_grid);
if (CModule::getActive("dPprescription")) {
    $smarty->assign("prescription", $prescription);
}
$smarty->assign("formulaires", $formulaires);
$smarty->assign("praticien", $praticien);
$smarty->assign("offline", $offline);
$smarty->assign("embed", $embed);
$smarty->assign("in_modal", $in_modal);
$smarty->assign("fiches_anesthesies", $fiches_anesthesies);
$smarty->assign("atc_classes", $atc_classes);
$smarty->display("print_dossier_soins.tpl");
 function loadXML($source, $options = null, $returnErrors = false)
 {
     $source = $this->getUTF8($source);
     if (CModule::getActive("eai") && CAppUI::conf("eai convert_encoding")) {
         $source = preg_replace("/ encoding=[\"']utf-?8[\"']/i", ' encoding="iso-8859-1"', $source);
     }
     if (!$returnErrors) {
         return parent::loadXML($source, $options);
     }
     // Enable user error handling
     libxml_use_internal_errors(true);
     parent::loadXML($source, $options);
     return $this->libxml_display_errors(false);
 }