$operation_id = CValue::getOrSession("operation_id"); $create_dossier_anesth = CValue::get("create_dossier_anesth", 1); $multi = CValue::get("multi"); $offline = CValue::get("offline"); $display = CValue::get("display"); $pdf = CValue::get("pdf", 1); $lines = array(); $lines_per_op = array(); // Consultation courante $dossier_anesth = new CConsultAnesth(); if (!$dossier_anesth_id) { $where = array(); $where["operation_id"] = " = '{$operation_id}'"; $dossier_anesth->loadObject($where); } else { $dossier_anesth->load($dossier_anesth_id); } if (!$dossier_anesth->_id) { $selOp = new COperation(); $selOp->load($operation_id); $selOp->loadRefsFwd(); $selOp->_ref_sejour->loadRefsFwd(); $selOp->_ref_sejour->loadRefsConsultAnesth(); $selOp->_ref_sejour->_ref_consult_anesth->loadRefsFwd(); $patient = $selOp->_ref_sejour->_ref_patient; $patient->loadRefsConsultations(); // Chargement des praticiens $listAnesths = array(); if ($offline == "false") { $anesths = new CMediusers(); $listAnesths = $anesths->loadAnesthesistes(PERM_READ);
<?php /** * $Id: $ * * @package Mediboard * @subpackage Cabinet * @author SARL OpenXtrem <*****@*****.**> * @license GNU General Public License, see http://www.gnu.org/licenses/gpl.html * @version $Revision: $ */ $consult_id = CValue::get("consult_id"); $patient_id = CValue::get("patient_id"); $consult_anesth = new CConsultAnesth(); $consult_anesth->load($consult_id); $patient = new CPatient(); $patient->load($patient_id); $dossier_medical = $patient->loadRefDossierMedical(); $consult_anesth->apfel_femme = 0; $consult_anesth->apfel_atcd_nvp = 0; $consult_anesth->apfel_morphine = 0; $consult_anesth->apfel_non_fumeur = 1; // Femme if ($patient->sexe === "f") { $consult_anesth->apfel_femme = 1; } // Non fumeur if (count($dossier_medical->_codes_cim)) { $is_fumeur = 0; foreach ($dossier_medical->_codes_cim as $_code_cim) { if (preg_match("/^(F17|T652|Z720|Z864|Z587)/", $_code_cim)) {
/** * Duplication de dossier d'anesthésie * * @category Cabinet * @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 */ $dossier_anesth_id = CValue::post("_consult_anesth_id"); $sejour_id = CValue::post("sejour_id"); $operation_id = CValue::post("operation_id"); $redirect = CValue::post("redirect", 1); $consult_anesth = new CConsultAnesth(); $consult_anesth->load($dossier_anesth_id); $consult_anesth->_id = $consult_anesth->operation_id = $consult_anesth->sejour_id = null; if ($sejour_id) { $consult_anesth->sejour_id = $sejour_id; } if ($operation_id) { $consult_anesth->operation_id = $operation_id; } $msg = $consult_anesth->store(); $represcription = 0; if ($msg) { CAppUI::setMsg($msg); } else { CAppUI::setMsg(CAppUI::tr("CConsultAnesth-msg-duplicate")); //Création de la prescription de séjour selon pref user if ($consult_anesth->sejour_id && CAppUI::pref("show_replication_duplicate")) {
$query .= "GROUP BY `consultation_anesth`.`operation_id`\n HAVING total > 1\n ORDER BY `consultation_anesth`.`operation_id` DESC"; $dossier = new CConsultAnesth(); $ds = $dossier->_spec->ds; $result = $ds->loadHashAssoc($query); $count = count($result); CAppUI::setMsg("{$count} dossier(s) restants en doublon avant traitement", UI_MSG_OK); $log = new CUserLog(); foreach ($result as $_doublon) { if ($limit < 1) { break; } $_doublon_ids = explode(",", $_doublon["doublons"]); foreach ($_doublon_ids as $_doublon_id) { $infoAnesth = false; $consultAnesth = new CConsultAnesth(); $consultAnesth->load($_doublon_id); $consultAnesth->loadLogs(); foreach ($consultAnesth->_ref_logs as $_log) { if ($_log->type != "create" && $_log->fields != "operation_id" && $_log->fields != "operation_id sejour_id") { $infoAnesth = $_log->fields; } } if (count($consultAnesth->_ref_logs) < 3 && !$infoAnesth) { if ($msg = $consultAnesth->delete()) { CAppUI::setMsg($msg, UI_MSG_WARNING); } else { CAppUI::setMsg("Dossier supprimés", UI_MSG_OK); $limit--; } break; }