/** * @see parent::getPerm() */ function getPerm($permType) { if (!$this->_ref_operation) { $this->loadRefOperation(); } return $this->_ref_operation->getPerm($permType); }
/** * count list of Op not linked to a plage * * @param date $start date de début * @param date|null $end date de fin * @param array $chir_ids chir targeted * * @return int number of HP found */ static function countForDates($start, $end = null, $chir_ids = array()) { $d_start = $start; $d_end = $end ? $end : $start; $op = new COperation(); $ljoin = array(); $ljoin["sejour"] = "sejour.sejour_id = operations.sejour_id"; $where = array(); if (count($chir_ids)) { $where["chir_id"] = CSQLDataSource::prepareIn($chir_ids); } $where["operations.plageop_id"] = "IS NULL"; $where["operations.date"] = "BETWEEN '{$d_start}' AND '{$d_end}'"; $where["operations.annulee"] = "= '0'"; $where["sejour.group_id"] = "= '" . CGroups::loadCurrent()->_id . "'"; /** @var COperation[] $listHorsPlage */ return $op->countList($where, null, $ljoin); }
/** * $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 $acte) { $acte->loadRefsFwd(); } $operation->loadAffectationsPersonnel(); if (CAppUI::conf('dPccam CCodeCCAM use_new_association_rules')) { $operation->guessActesAssociation(); } else { foreach ($operation->_ref_actes_ccam as $acte) { $acte->guessAssociation(); } }
$chir = $sejour->_ref_praticien; } // On ne change a priori pas le praticien du séjour $sejour->_ref_praticien->canDo(); $prat = $sejour->_ref_praticien; $patient = $sejour->_ref_patient; } $grossesse = new CGrossesse(); if ($grossesse_id && !$sejour_id && !$operation_id) { $grossesse->load($grossesse_id); $sejour->grossesse_id = $grossesse->_id; $sejour->_ref_grossesse = $grossesse; $patient = $grossesse->loadRefParturiente(); } // On récupère l'opération $op = new COperation(); $op->load($operation_id); if ($op->_id) { $op->loadRefSejour(); if (CAppUI::conf("dPplanningOp COperation use_session_praticien")) { CValue::setSession("chir_id", $op->chir_id); } if (CBrisDeGlace::isBrisDeGlaceRequired()) { $canAccess = CAccessMedicalData::checkForSejour($op->_ref_sejour); if (!$canAccess) { if (!$op->canDo()->read) { global $m, $tab; CAppUI::setMsg("Vous n'avez pas accés à cette intervention hors plage", UI_MSG_WARNING); CAppUI::redirect("m={$m}&tab={$tab}&operation_id=0"); } }
<?php /** * $Id:$ * * @package Mediboard * @subpackage bloodSalvage * @author SARL OpenXtrem <*****@*****.**> * @license GNU General Public License, see http://www.gnu.org/licenses/gpl.html * @version $Revision:$ */ CAppUI::requireModuleFile("bloodSalvage", "inc_personnel"); $selOp = new COperation(); $blood_salvage = new CBloodSalvage(); $date = CValue::getOrSession("date", CMbDT::date()); $op = CValue::getOrSession("op"); if ($op) { $selOp->load($op); $selOp->loadRefs(); $where = array(); $where["operation_id"] = "='{$selOp->_id}'"; $blood_salvage->loadObject($where); $blood_salvage->loadRefsFwd(); $blood_salvage->loadRefPlageOp(); } $smarty = new CSmartyDP(); $smarty->assign("date", $date); $smarty->assign("blood_salvage", $blood_salvage); $smarty->assign("selOp", $selOp); $smarty->display("vw_bloodSalvage_sspi.tpl");
?> </td> <td> <script> var arModules = ['main']; </script> <select name="MODULE_ID" id="__module_id_select"> <option value="main" <?php echo $str_MODULE_ID == 'main' ? 'selected' : ''; ?> ><?php echo GetMessage('KERNEL'); ?> </option> <?php $modules = COperation::GetAllowedModules(); foreach ($modules as $MID) { if ($MID == "main") { continue; } if (!($m = CModule::CreateModuleObject($MID))) { continue; } ?> <script>arModules.push('<?php echo $MID; ?> ');</script> <option value="<?php echo htmlspecialcharsbx($MID); ?>
if (!$mess) { $mess = strtoupper($b); } ?> arBingings.<?php echo $mid; ?> .<?php echo $b; ?> = "<?php echo $mess; ?> ";<?php } $arOperations[COperation::GetLangTitle($arOperation["NAME"])] = array('ID' => $arOperation["ID"], 'NAME' => $arOperation["NAME"], 'BINDING' => $arOperation["BINDING"], 'MODULE_ID' => $arOperation["MODULE_ID"], 'DESCRIPTION' => COperation::GetLangDescription($arOperation["NAME"], $arOperation["DESCRIPTION"])); } ?> </script><?php ksort($arOperations); ?> <tr class="adm-detail-required-field"> <td width="40%"><?php echo GetMessage('NAME'); ?> </td> <td width="60%"><input type="text" name="NAME" size="40" maxlength="100" value="<?php echo CTask::GetLangTitle($str_NAME); ?> "></td> </tr>
global $m, $tab; $module = CValue::get("module"); if (!$module) { $module = $m; } $canUnlockActes = $module == "dPpmsi" || CModule::getCanDo("dPsalleOp")->admin; if (null == ($object_class = CValue::get("object_class"))) { CAppUI::stepMessage(UI_MSG_WARNING, "{$tab}-msg-mode-missing"); return; } $unlock_dossier = CValue::get("unlock_dossier", 0); $NDA = ""; $IPP = ""; switch ($object_class) { case "COperation": $object = new COperation(); // Chargement de l'opération et génération du document $operation_id = CValue::post("mb_operation_id", CValue::getOrSession("object_id")); if ($object->load($operation_id)) { $object->loadRefs(); $codes = explode("|", $object->codes_ccam); $actes = CMbArray::pluck($object->_ref_actes_ccam, "code_acte"); foreach ($object->_ref_actes_ccam as $acte_ccam) { $acte_ccam->loadRefsFwd(); } // Suppression des actes non codés if (CAppUI::conf("dPsalleOp CActeCCAM del_actes_non_cotes")) { foreach ($codes as $_key => $_code) { $key = array_search($_code, $actes); if ($key === false) { unset($codes[$_key]);
/** * $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(); } }
public static function GeneratePHPInstall($arValues) { $str = ''; $arDefValues = $arValues["default"]["options"]; $arInfo = CControllerGroupSettings::GetData(); if(isset($arValues["default"]["modules"])) { $vArr = ''; foreach($arInfo as $module_id=>$arProp) { if($module_id == 'main') continue; if(in_array($module_id, $arValues["default"]["modules"])) $vArr .= '"'.$module_id.'"=>"Y", '; else $vArr .= '"'.$module_id.'"=>"N", '; } $str .= 'CControllerClient::SetModules(Array('.$vArr.'));'."\r\n"; } else $str .= 'CControllerClient::RestoreModules();'."\r\n"; foreach($arInfo as $mname=>$arProp) { if(!is_array($arProp["options"]) || count($arProp["options"])<=0) continue; $arOptions = $arProp["options"]; foreach($arOptions as $id=>$arOptionParams) { if(isset($arDefValues[$mname][$id])) $str .= 'CControllerClient::SetOptionString("'.EscapePHPString($mname).'", "'.EscapePHPString($id).'", "'.EscapePHPString($arDefValues[$mname][$id]).'");'."\r\n"; elseif(substr($id, 0, 2)!='__') $str .= 'CControllerClient::RestoreOption("'.EscapePHPString($mname).'", "'.EscapePHPString($id).'");'."\r\n"; } } $arSecurity = $arValues["default"]["security"]; if($arSecurity["limit_admin"] == "Y") $str .= 'CControllerClient::SetOptionString("main", "~controller_limited_admin", "Y");'."\r\n"; else $str .= 'CControllerClient::SetOptionString("main", "~controller_limited_admin", "N");'."\r\n"; $subordinate_id = COperation::GetIDByName('edit_subordinate_users'); $arGroups = Array(); $arUniqTasks = Array(); if(is_array($arSecurity["groups"])) { foreach($arSecurity["groups"] as $group_id=>$arPermissions) { $arDefinedPermissions = Array(); $arUnDefinedPermissions = Array(); $bSubOrdGroups = false; foreach($arInfo as $module_id=>$arProp) { if(isset($arPermissions[$module_id])) { $arDefinedPermissions[$module_id] = $arPermissions[$module_id]; $task_id = $arPermissions[$module_id]; if(strlen($task_id)>1 && (!is_array($arUniqTasks[$module_id]) || !in_array($task_id, $arUniqTasks[$module_id]))) { $arUniqTasks[$module_id][] = $task_id; $dbr_task = CTask::GetList(Array(), Array('NAME'=>$task_id, 'MODULE_ID'=>$module_id, "BINDING" => 'module')); if($ar_task = $dbr_task->Fetch()) { if($module_id == 'main' || $ar_task['SYS']!='Y') { $arOperations = CTask::GetOperations($ar_task["ID"], true); if($ar_task['SYS']!='Y') { $str .= 'CControllerClient::SetTaskSecurity('.CControllerGroupSettings::__PHPToString($task_id).', '.CControllerGroupSettings::__PHPToString($module_id).', '.CControllerGroupSettings::__PHPToString($arOperations).', '.CControllerGroupSettings::__PHPToString($ar_task["LETTER"]).');'."\r\n"; } if($module_id == 'main' && in_array('edit_subordinate_users', $arOperations)) { $bSubOrdGroups = true; } } } } } else $arUnDefinedPermissions[] = $module_id; } $str .= 'CControllerClient::RestoreGroupSecurity('.CControllerGroupSettings::__PHPToString($group_id).', '.CControllerGroupSettings::__PHPToString($arUnDefinedPermissions).');'."\r\n"; if($bSubOrdGroups) { $arSGroupsTmp = preg_split("/[\r\n,;]+/", $arSecurity["subord_groups"][$group_id]); $arSGroups = array(); foreach($arSGroupsTmp as $sGroupTmp) { $sGroupTmp = trim($sGroupTmp); if ($sGroupTmp != '') $arSGroups[] = $sGroupTmp; } $str .= 'CControllerClient::SetGroupSecurity('.CControllerGroupSettings::__PHPToString($group_id).', '.CControllerGroupSettings::__PHPToString($arDefinedPermissions).', '.CControllerGroupSettings::__PHPToString($arSGroups).');'."\r\n"; } else $str .= 'CControllerClient::SetGroupSecurity('.CControllerGroupSettings::__PHPToString($group_id).', '.CControllerGroupSettings::__PHPToString($arDefinedPermissions).');'."\r\n"; $arGroups[] = $group_id; } } $str .= 'CControllerClient::RestoreSecurity('.CControllerGroupSettings::__PHPToString($arGroups).');'."\r\n"; $arThirdSettings = CControllerGroupSettings::Get3rdPartyOptions(); foreach($arThirdSettings as $obOption) { $str .= $obOption->GetOptionPHPCode($arValues); } return $str; }
* @license GNU General Public License, see http://www.gnu.org/licenses/gpl.html * @version $Revision$ */ CCanDo::checkRead(); $operation = new COperation(); $max_uscpo = $operation->_specs["duree_uscpo"]->max; $default_week = $operation->conf("default_week_stat_uscpo"); /** @var date $date_min */ /** @var date $date_max */ $date_min = CValue::getOrSession("date_min", CMbDT::date($default_week == "last" ? "-1 week" : null)); $date_max = CValue::getOrSession("date_max", CMbDT::date($default_week == "next" ? "+1 week" : null)); $service_id = CValue::getOrSession("service_id", ""); if ($date_min > $date_max) { list($date_min, $date_max) = array($date_max, $date_min); } $operation = new COperation(); $where = array(); $ljoin = array(); $where["duree_uscpo"] = "> 0"; $where["annulee"] = "!= '1'"; $where[] = "operations.passage_uscpo = '1' or operations.passage_uscpo IS NULL"; if ($service_id) { $ljoin["sejour"] = "sejour.sejour_id = operations.sejour_id"; $where["sejour.service_id"] = "= '{$service_id}'"; } $day = $date_min; $dates = array(); $series = array(); $serie = array('data' => array(), 'label' => utf8_encode("Nombre de nuits prévues")); $today = CMbDT::date(); while ($day <= $date_max) {
$tabOperationExpect[] = $operations[$date['id']]; } if ($estEnSalle || $estSortieSalle || $estSalleReveil) { $tabOperationCurrent = $operations[$date['id']]; } if ($estSortieSalleReveil) { $tabOperationDone[] = $operations[$date['id']]; } } uasort($tabOperationExpect, 'cmp_dateDesc'); uasort($tabOperationDone, 'cmp_dateAsc'); $operation = null; if ($operation_id != null) { $operations = array(); // Récuperation du sejour sélectionné $operation = new COperation(); $operation->load($operation_id); $operation->loadRefsFwd(); $estEnSalle = $operation->entree_salle && $operation->sortie_salle == null; $estSortieSalle = $operation->sortie_salle && $operation->entree_reveil == null; $estSalleReveil = $operation->sortie_salle && $operation->entree_reveil; $estSortieSalleReveil = $operation->entree_salle && $operation->sortie_salle && $operation->entree_reveil && $operation->sortie_reveil_possible; if ($operation->entree_salle == null) { $diagramme['bloc']['type'] = "expect"; } if ($estEnSalle || $estSortieSalle || $estSalleReveil) { $diagramme['bloc']['type'] = "current"; } if ($estSortieSalleReveil) { $diagramme['bloc']['type'] = "done"; }
<?php /** * $Id$ * * @package Mediboard * @subpackage PlanningOp * @author SARL OpenXtrem <*****@*****.**> * @license GNU General Public License, see http://www.gnu.org/licenses/gpl.html * @version $Revision$ */ $user = CUser::get(); $operation_id = CValue::get("operation_id"); $operation = new COperation(); $operation->load($operation_id); $operation->loadRefAffectation(); $operation->loadRefsFwd(1); $operation->loadRefsConsultAnesth(); $operation->_ref_sejour->loadRefsFwd(); $operation->_ref_sejour->loadRefsConsultAnesth(); // Récupération de l'utilisateur courant $currUser = CMediusers::get(); $currUser->isAnesth(); // Chargement des anesthésistes $listAnesths = new CMediusers(); $listAnesths = $listAnesths->loadAnesthesistes(PERM_DENY); // Création du template $smarty = new CSmartyDP(); $smarty->assign("currUser", $currUser); $smarty->assign("user_id", $user->_id); $smarty->assign("listAnesths", $listAnesths);
// Sélection du praticien $mediuser = CMediusers::get(); $listPrat = $mediuser->loadPraticiens(PERM_EDIT); foreach ($listPrat as $_prat) { $_prat->loadRefFunction(); } $selPrat = CValue::getOrSession("selPrat", $mediuser->isPraticien() ? $mediuser->user_id : null); $selPraticien = new CMediusers(); $selPraticien->load($selPrat); $group = CGroups::loadCurrent(); if ($selPraticien->isAnesth()) { // Selection des différentes interventions de la journée par service $count_ops = array("ambu" => 0, "comp" => 0, "hors_plage" => 0); $service = new CService(); $services = $service->loadGroupList(); $interv = new COperation(); $order = "operations.chir_id, operations.time_operation"; $ljoin = array("plagesop" => "plagesop.plageop_id = operations.plageop_id", "sejour" => "sejour.sejour_id = operations.sejour_id", "affectation" => "affectation.sejour_id = sejour.sejour_id\r\n AND '{$date}' BETWEEN DATE(affectation.entree)\r\n AND DATE(affectation.sortie)", "lit" => "lit.lit_id = affectation.lit_id", "chambre" => "chambre.chambre_id = lit.chambre_id", "service" => "service.service_id = chambre.service_id"); $where_anesth = "operations.anesth_id = '{$selPraticien->_id}' OR plagesop.anesth_id = '{$selPraticien->_id}'"; if ($sans_anesth) { $where_anesth .= " OR operations.anesth_id IS NULL OR plagesop.anesth_id IS NULL"; } $whereAmbu = array("operations.date" => "= '{$date}'", "sejour.type" => "= 'ambu'", "sejour.group_id" => "= '{$group->_id}'"); $whereAmbu[] = $where_anesth; if (!$canceled) { $whereAmbu["operations.annulee"] = " = '0'"; } $whereHospi = array("operations.date" => "= '{$date}'", "sejour.type" => "= 'comp'", "sejour.group_id" => "= '{$group->_id}'"); $whereHospi[] = $where_anesth; if (!$canceled) { $whereHospi["operations.annulee"] = " = '0'";
$dateArr = CMbDT::date("+{$i} day", $date); $listDays[$dateArr] = $dateArr; } // Création du tableau de visualisation $affichages = array(); foreach ($listDays as $keyDate => $valDate) { foreach (CPlageOp::$hours as $keyHours => $valHours) { foreach (CPlageOp::$minutes as $keyMins => $valMins) { // Initialisation du tableau $affichages["{$keyDate}-{$valHours}:{$valMins}:00"] = "empty"; $affichages["{$keyDate}-HorsPlage"] = array(); } } } $listPlages = array(); $operation = new COperation(); $nbIntervHorsPlage = 0; $listPlage = new CPlageOp(); $nbIntervNonPlacees = 0; foreach ($listDays as $keyDate => $valDate) { // Récupération des plages par jour $where = array(); $where["date"] = "= '{$keyDate}'"; $where["salle_id"] = "= '{$salle->_id}'"; $order = "debut"; $listPlages[$keyDate] = $listPlage->loadList($where, $order); // Récupération des interventions hors plages du jour $where = array(); $where["date"] = "= '{$keyDate}'"; $where["annulee"] = "= '0'"; $where["salle_id"] = "= '{$salle->_id}'";
<?php /** * $Id$ * * @package Mediboard * @subpackage SalleOp * @author SARL OpenXtrem <*****@*****.**> * @license GNU General Public License, see http://www.gnu.org/licenses/gpl.html * @version $Revision$ */ $operation_id = CValue::get("operation_id"); $op = new COperation(); $op->load($operation_id); $smarty = new CSmartyDP(); $smarty->assign("op", $op); $smarty->display("inc_info_bacterio.tpl");
$ljoin = array(); $ljoin["plagesop"] = "operations.plageop_id = plagesop.plageop_id"; $where = array(); $in_salles = CSQLDataSource::prepareIn(array_keys($salles)); $where[] = "plagesop.salle_id {$in_salles} OR operations.salle_id {$in_salles}"; $where["materiel"] = "!= ''"; $where[] = " operations.date BETWEEN '{$date_min}' AND '{$date_max}'"; if ($praticien_id) { $where["operations.chir_id"] = " = '{$praticien_id}'"; } elseif ($function_id) { $mediuser = new CMediusers(); $users = $mediuser->loadProfessionnelDeSante(PERM_READ, $function_id); $where["operations.chir_id"] = CSQLDataSource::prepareIn(array_keys($users)); } $order = "operations.date, rank"; $operation = new COperation(); $ops = $operation->loadList($where, $order, null, "operation_id", $ljoin); $operations = array(); $commande = new CCommandeMaterielOp(); foreach ($commande->_specs["etat"]->_list as $spec) { $operations[$spec] = array(); } foreach ($ops as $_op) { /** @var COperation $_op */ $_op->loadRefPatient(); $_op->loadRefChir()->loadRefFunction(); $_op->loadRefPlageOp(); $_op->loadExtCodesCCAM(); $_op->loadRefCommande(); if (!$_op->_ref_commande_mat->_id && !$_op->annulee) { $operations["a_commander"][$_op->_id] = $_op;
:</td> <td nowrap> <?php $arr = array("reference" => array(GetMessage("TASK_FILTER_ANY"), GetMessage("MAIN_YES"), GetMessage("MAIN_NO")), "reference_id" => array("", "Y", "N")); echo SelectBoxFromArray("find_sys", $arr, htmlspecialcharsbx($find_sys)); ?> </td> </tr> <tr> <td nowrap><?php echo GetMessage("TASK_FILTER_BINDING"); ?> :</td> <td nowrap> <?php $bindings = COperation::GetBindingList(); $arRef = array(GetMessage("TASK_FILTER_ANY")); $arRefId = array(''); for ($i = 0, $l = count($bindings); $i < $l; $i++) { $b = $bindings[$i]; $text = GetMessage('TASK_BINDING_' . strtoupper($b)); if (!$text) { $text = strtoupper($b); } $arRef[] = $text; $arRefId[] = $b; } $arr = array("reference" => $arRef, "reference_id" => $arRefId); echo SelectBoxFromArray("find_binding", array("reference" => $arRef, "reference_id" => $arRefId), htmlspecialcharsbx($find_binding)); ?> </td>
$GROUP_DEFAULT_RIGHT = COption::GetOptionString($module_id, "GROUP_DEFAULT_RIGHT", "D"); $GROUP_DEFAULT_TASK = CTask::GetIdByLetter($GROUP_DEFAULT_RIGHT,$module_id,'module'); if ($GROUP_DEFAULT_TASK) COption::SetOptionString($module_id, "GROUP_DEFAULT_TASK", $GROUP_DEFAULT_TASK); } ?> <tr> <td width="50%"><b><?php echo GetMessage("MAIN_BY_DEFAULT"); ?> </b></td> <td width="50%"> <script>var arSubordTasks = [];</script> <? $arTasksInModule = CTask::GetTasksInModules(true,$module_id,'module'); $nID = COperation::GetIDByName('edit_subordinate_users'); $arTasks = $arTasksInModule['main']; echo SelectBoxFromArray("GROUP_DEFAULT_TASK", $arTasks, htmlspecialcharsbx($GROUP_DEFAULT_TASK)); $show_subord = false; $arTaskIds = $arTasks['reference_id']; $arSubordTasks = Array(); $l = count($arTaskIds); for ($i=0;$i<$l;$i++) { $arOpInTask = CTask::GetOperations($arTaskIds[$i]); if (in_array($nID,$arOpInTask)) { $arSubordTasks[] = $arTaskIds[$i]; ?><script> arSubordTasks.push(<?php
function GetIDByName($name) { $err_mess = CAllOperation::err_mess() . "<br>Function: GetIDByName<br>Line: "; $z = COperation::GetList(array('MODULE_ID' => 'asc'), array("NAME" => $name)); if ($r = $z->Fetch()) { return $r['ID']; } return false; }
* $Id: vw_anesthesie.php 24175 2014-07-28 09:17:55Z aurelie17 $ * * @package Mediboard * @subpackage SalleOp * @author SARL OpenXtrem <*****@*****.**> * @license GNU General Public License, see http://www.gnu.org/licenses/gpl.html * @version $Revision: 24175 $ */ CCanDo::checkRead(); $ds = CSQLDataSource::get("std"); $op = CValue::getOrSession("op"); $date = CValue::getOrSession("date", CMbDT::date()); $consultAnesth = new CConsultAnesth(); $consult = new CConsultation(); $userSel = new CMediusers(); $operation = new COperation(); $operation->load($op); $operation->loadRefChir(); $operation->loadRefSejour(); $consult_anesth = $operation->loadRefsConsultAnesth(); if ($consult_anesth->_id) { $consult_anesth->loadRefConsultation(); $consult = $consult_anesth->_ref_consultation; $consult->_ref_consult_anesth = $consultAnesth; $consult->loadRefPlageConsult(); $consult->loadRefsDocItems(); $consult->loadRefPatient(); $prat_id = $consult->_ref_plageconsult->chir_id; $consult_anesth->loadRefs(); // On charge le praticien $userSel->load($prat_id);
<?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::checkRead(); $operation = new COperation(); $sejour = new CSejour(); if ($sejour_id = CValue::get("sejour_id")) { $sejour->load($sejour_id); $sejour->loadNDA(); $sejour->loadRefsFwd(); $patient =& $sejour->_ref_patient; $patient->loadRefs(); // Si le modèle est redéfini, on l'utilise $model = CCompteRendu::getSpecialModel($sejour->_ref_praticien, "COperation", "[FICHE DHE]"); if ($model->_id) { CCompteRendu::streamDocForObject($model, $sejour, "CDomPDFConverter"); } } if ($operation_id = CValue::get("operation_id")) { $operation->load($operation_id); $operation->loadRefsFwd(); $sejour = $operation->_ref_sejour; $operation->_ref_sejour->loadRefsFwd();
<?php /** * $Id$ * * @package Mediboard * @subpackage SalleOp * @author SARL OpenXtrem <*****@*****.**> * @license GNU General Public License, see http://www.gnu.org/licenses/gpl.html * @version $Revision$ */ $operation_id = CValue::getOrSession("operation_id"); $operation = new COperation(); $operation->load($operation_id); $operation->loadRefsAnesthPerops(); // Création du template $smarty = new CSmartyDP(); $smarty->assign("operation", $operation); $smarty->display("inc_list_anesth_perops.tpl");
*/ if ($all_prats) { $prats = $user->loadPraticiens(PERM_READ); $in_prats = CSQLDataSource::prepareIn(array_keys($prats)); $where[] = "operations.chir_id " . $in_prats . " OR operations.chir_2_id " . $in_prats . " OR operations.chir_3_id " . $in_prats . " OR operations.chir_4_id " . $in_prats; $where[] = "operations.anesth_id IS NULL OR operations.anesth_id {$in_prats}"; } else { $where_chir = "operations.chir_id = '{$user->_id}' OR operations.chir_2_id = '{$user->_id}'\n OR operations.chir_3_id = '{$user->_id}' OR operations.chir_4_id = '{$user->_id}'"; if ($user->isAnesth()) { $where[] = "{$where_chir} OR\n operations.anesth_id = '{$user->_id}' OR\n (operations.anesth_id IS NULL && plagesop.anesth_id = '{$user->_id}')"; } else { $where[] = $where_chir; } } /** @var COperation[] $interventions */ $operation = new COperation(); if (!$interv_with_no_codes) { $where[] = "LENGTH(codes_ccam) > 0"; } $interventions = $operation->loadList($where, null, null, null, $ljoin); $totals["interventions"] = count($interventions); $where = array(); if (!$all_prats) { //$where["executant_id"] = "= '$user->_id'"; $where["code_activite"] = $user->_is_anesth ? "= '4'" : "!= '4'"; } CStoredObject::massCountBackRefs($interventions, "actes_ccam", $where); // Préparation des interventions CDatedCodeCCAM::$cache_layers = Cache::INNER_OUTER; foreach ($interventions as $key => $_interv) { $_interv->loadExtCodesCCAM();
$userGroupID = ""; $dbGroup = CGroup::GetList($by = "", $order = "", array("STRING_ID" => "sale_administrator")); if ($arGroup = $dbGroup->Fetch()) { $userGroupID = $arGroup["ID"]; } else { $group = new CGroup(); $arFields = array("ACTIVE" => "Y", "C_SORT" => 200, "NAME" => GetMessage("SALE_WIZARD_ADMIN_SALE"), "DESCRIPTION" => GetMessage("SALE_WIZARD_ADMIN_SALE_DESCR"), "USER_ID" => array(), "STRING_ID" => "sale_administrator"); $userGroupID = $group->Add($arFields); } if (IntVal($userGroupID) > 0) { WizardServices::SetFilePermission(array($siteID, "/bitrix/admin"), array($userGroupID => "R")); WizardServices::SetFilePermission(array($siteID, "/bitrix/admin"), array($userGroupID => "R")); $new_task_id = CTask::Add(array("NAME" => GetMessage("SALE_WIZARD_ADMIN_SALE"), "DESCRIPTION" => GetMessage("SALE_WIZARD_ADMIN_SALE_DESCR"), "LETTER" => "Q", "BINDING" => "module", "MODULE_ID" => "main")); if ($new_task_id) { $arOps = array(); $rsOp = COperation::GetList(array(), array("NAME" => "cache_control|view_own_profile|edit_own_profile")); while ($arOp = $rsOp->Fetch()) { $arOps[] = $arOp["ID"]; } CTask::SetOperations($new_task_id, $arOps); } $rsTasks = CTask::GetList(array(), array("MODULE_ID" => "main", "SYS" => "N", "BINDIG" => "module", "LETTER" => "Q")); if ($arTask = $rsTasks->Fetch()) { CGroup::SetModulePermission($userGroupID, $arTask["MODULE_ID"], $arTask["ID"]); } CMain::SetGroupRight("sale", $userGroupID, "U"); $rsTasks = CTask::GetList(array(), array("MODULE_ID" => "catalog", "SYS" => "Y", "BINDIG" => "module", "LETTER" => "T")); while ($arTask = $rsTasks->Fetch()) { CGroup::SetModulePermission($userGroupID, $arTask["MODULE_ID"], $arTask["ID"]); } }
<?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"); $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();
<?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");
/** * Charge la liste de plages et opérations pour un jour donné * Analogue à CMediusers::loadRefsForDay * * @param string $date Date to look for * @param bool $second_chir Use chir_2, chir_3 and chir_4 * * @return void */ function loadRefsForDay($date, $second_chir = false) { // Liste des utilisateurs $user = new CMediusers(); $listPrats = $user->loadPraticiens(PERM_READ); // Liste des fonctions $function = new CFunctions(); $listFunctions = $function->loadListWithPerms(PERM_READ); // Plages d'opérations $plage = new CPlageOp(); $conf_chambre_operation = $plage->conf("chambre_operation"); $ljoin = array(); $add_where = ""; $add_or_where = ""; if ($second_chir) { $ljoin["operations"] = "plagesop.plageop_id = operations.plageop_id"; $prepare_prats = CSQLDataSource::prepareIn(array_keys($listPrats)); $add_where = "operations.chir_id " . $prepare_prats . " OR operations.chir_2_id " . $prepare_prats . " OR operations.chir_3_id " . $prepare_prats . " OR operations.chir_4_id " . $prepare_prats; $add_or_where = " OR {$add_where}"; } $where = array(); $where["plagesop.date"] = "= '{$date}'"; $where["plagesop.salle_id"] = "= '{$this->_id}'"; $where[] = "`plagesop`.`chir_id` " . CSQLDataSource::prepareIn(array_keys($listPrats)) . " OR `plagesop`.`spec_id` " . CSQLDataSource::prepareIn(array_keys($listFunctions)) . $add_or_where; $order = "debut"; $this->_ref_plages = $plage->loadList($where, $order, null, "plageop_id", $ljoin); // Chargement d'optimisation CMbObject::massLoadFwdRef($this->_ref_plages, "chir_id"); CMbObject::massLoadFwdRef($this->_ref_plages, "anesth_id"); CMbObject::massLoadFwdRef($this->_ref_plages, "spec_id"); CMbObject::massLoadFwdRef($this->_ref_plages, "salle_id"); CMbObject::massCountBackRefs($this->_ref_plages, "notes"); CMbObject::massCountBackRefs($this->_ref_plages, "affectations_personnel"); foreach ($this->_ref_plages as $_plage) { /** @var CPlageOp $_plage */ $_plage->loadRefChir(); $_plage->loadRefAnesth(); $_plage->loadRefSpec(); $_plage->loadRefSalle(); $_plage->makeView(); $_plage->loadRefsOperations(); $_plage->loadRefsNotes(); $_plage->loadAffectationsPersonnel(); $_plage->_unordered_operations = array(); // Chargement d'optimisation CMbObject::massLoadFwdRef($_plage->_ref_operations, "chir_id"); $sejours = CMbObject::massLoadFwdRef($_plage->_ref_operations, "sejour_id"); CMbObject::massLoadFwdRef($sejours, "patient_id"); foreach ($_plage->_ref_operations as $operation) { $operation->loadRefAnesth(); $operation->loadRefChirs(); $operation->loadRefPatient(); $operation->loadExtCodesCCAM(); $operation->loadRefPlageOp(); if ($conf_chambre_operation) { $operation->loadRefAffectation(); } // Extraire les interventions non placées if ($operation->rank == 0) { $_plage->_unordered_operations[$operation->_id] = $operation; unset($_plage->_ref_operations[$operation->_id]); } } } // Interventions déplacés $deplacee = new COperation(); $ljoin = array(); $ljoin["plagesop"] = "operations.plageop_id = plagesop.plageop_id"; $where = array(); $where["operations.plageop_id"] = "IS NOT NULL"; $where["plagesop.salle_id"] = "!= operations.salle_id"; $where["plagesop.date"] = "= '{$date}'"; $where["operations.salle_id"] = "= '{$this->_id}'"; $where[] = "`plagesop`.`chir_id` " . CSQLDataSource::prepareIn(array_keys($listPrats)) . " OR `plagesop`.`spec_id` " . CSQLDataSource::prepareIn(array_keys($listFunctions)) . $add_or_where; $order = "operations.time_operation"; $this->_ref_deplacees = $deplacee->loadList($where, $order, null, "operation_id", $ljoin); // Chargement d'optimisation CMbObject::massLoadFwdRef($this->_ref_deplacees, "chir_id"); $sejours_deplacees = CMbObject::massLoadFwdRef($this->_ref_deplacees, "sejour_id"); CMbObject::massLoadFwdRef($sejours_deplacees, "patient_id"); foreach ($this->_ref_deplacees as $_deplacee) { /** @var COperation $_deplacee */ $_deplacee->loadRefChirs(); $_deplacee->loadRefPatient(); $_deplacee->loadExtCodesCCAM(); $_deplacee->loadRefPlageOp(); } // Hors plage $urgence = new COperation(); $ljoin = array(); $ljoin["plagesop"] = "operations.plageop_id = plagesop.plageop_id"; $where = array(); $where["operations.date"] = "= '{$date}'"; $where["operations.plageop_id"] = "IS NULL"; $where["operations.salle_id"] = "= '{$this->_id}'"; if ($second_chir) { $where[] = $add_where; } else { $where["operations.chir_id"] = CSQLDataSource::prepareIn(array_keys($listPrats)); } $order = "time_operation, chir_id"; $this->_ref_urgences = $urgence->loadList($where, $order, null, "operation_id"); // Chargement d'optimisation CMbObject::massLoadFwdRef($this->_ref_urgences, "chir_id"); $sejours_urgences = CMbObject::massLoadFwdRef($this->_ref_urgences, "sejour_id"); CMbObject::massLoadFwdRef($sejours_urgences, "patient_id"); foreach ($this->_ref_urgences as $_urgence) { /** @var COperation $_urgence */ $_urgence->loadRefChirs(); $_urgence->loadRefPatient(); $_urgence->loadExtCodesCCAM(); $_urgence->loadRefPlageOp(); if ($conf_chambre_operation) { $_urgence->loadRefAffectation(); } } }
* @license GNU General Public License, see http://www.gnu.org/licenses/gpl.html * @version SVN: $Id:$ * @link http://www.mediboard.org */ CCanDo::checkRead(); $date = CValue::get("date"); $bloc_id = CValue::get("bloc_id"); $bloc = new CBlocOperatoire(); $bloc->load($bloc_id); $in_salles = CSQLDataSource::prepareIn($bloc->loadBackIds("salles")); $ljoin["plagesop"] = "operations.plageop_id = plagesop.plageop_id"; $where[] = "operations.salle_id {$in_salles} OR plagesop.salle_id {$in_salles}"; $where[] = "operations.date = '{$date}'"; $where["labo"] = "= 1"; $order = "entree_salle, time_operation"; $operation = new COperation(); /** @var COperation[] $operations */ $operations = $operation->loadList($where, $order, null, null, $ljoin); CMbObject::massLoadFwdRef($operations, "plageop_id"); $chirs = CMbObject::massLoadFwdRef($operations, "chir_id"); CMbObject::massLoadFwdRef($chirs, "function_id"); $sejours = CMbObject::massLoadFwdRef($operations, "sejour_id"); CMbObject::massLoadFwdRef($sejours, "patient_id"); foreach ($operations as $_operation) { $_operation->loadRefPatient(); $_operation->loadRefPlageOp(); $_operation->updateSalle(); $_operation->loadRefChir()->loadRefFunction(); $_operation->loadExtCodesCCAM(); } // Création du template
/** * Return a object concern praticien and a patient in date * * @param Date $date Date * @param String $praticien_id Praticien id * @param String $patient_id Patient id * * @return CConsultation|COperation|null */ function getObject($date, $praticien_id, $patient_id) { $intervention = new COperation(); $where = array("plagesop.date" => "= '{$date}'", "operations.chir_id" => "= '{$praticien_id}'", "sejour.patient_id" => "= '{$patient_id}'"); $leftjoin = array("plagesop" => "operations.plageop_id = plagesop.plageop_id", "sejour" => "operations.sejour_id = sejour.sejour_id"); $intervention->loadObject($where, "plagesop.debut DESC", null, $leftjoin); $object = $intervention; if (!$object->_id) { $consultation = new CConsultation(); $where = array("plageconsult.date" => "= '{$date}'", "plageconsult.chir_id" => "= '{$praticien_id}'", "consultation.patient_id" => "= '{$patient_id}'"); $leftjoin = array("plageconsult" => "consultation.plageconsult_id = plageconsult.plageconsult_id"); $consultation->loadObject($where, "consultation.heure DESC", null, $leftjoin); $object = $consultation; if (!$object->_id) { return null; } } return $object; }