/** * Load the linked acts of the given act * * @return CActeCCAM[] */ public function loadActesCCAM() { if ($this->_ref_actes_ccam) { return $this->_ref_actes_ccam; } $act = new CActeCCAM(); $where = array(); $where['object_class'] = " = '{$this->codable_class}'"; $where['object_id'] = " = {$this->codable_id}"; $where['executant_id'] = " = {$this->praticien_id}"; $where['code_activite'] = $this->activite_anesth ? " = 4" : " != 4"; $where['execution'] = " BETWEEN '{$this->date} 00:00:00' AND '{$this->date} 23:59:59'"; $this->_ref_actes_ccam = $act->loadList($where, "code_association"); foreach ($this->_ref_actes_ccam as $_acte) { if (in_array($_acte->code_acte, $this->_check_failed_acts)) { unset($this->_ref_actes_ccam[$_acte->_id]); continue; } $_acte->loadRefCodeCCAM(); } return $this->_ref_actes_ccam; }
// Recuperation de l'operation // Chargement de l'objet $object = new $object_class(); $object->load($object_id); $object->loadView(); $operations[$object->_id] = $object; } else { // On parcourt les actes ccam $acte_ccam = new CActeCCAM(); $where = array(); if ($praticien_id) { $where["executant_id"] = " = '{$praticien_id}'"; } $where["execution"] = "LIKE '{$date}%'"; $where["object_class"] = " = 'COperation'"; $actes = $acte_ccam->loadList($where); foreach ($actes as $_acte) { // Si l'operation n'est pas deja stockée, on la charge et on la stocke if (!array_key_exists($_acte->object_id, $operations)) { $_acte->loadRefObject(); $operations[$_acte->object_id] = $_acte->_ref_object; } // Sinon, on stocke directement l'acte dans l'operation $operations[$_acte->object_id]->_ref_actes_ccam[$_acte->_id] = $_acte; $operations[$_acte->object_id]->loadRefsFwd(); } } // Parcours du tableau d'operations, et stockage dans un tableau de salle foreach ($operations as $op) { // Classement des actes par executant foreach ($op->_ref_actes_ccam as $acte_ccam) {
/** * Charge les autre actes du même codable * * @param bool $same_executant Seulement les actes du même exécutant si vrai * @param bool $only_facturable Seulement les actes facturables si vrai * @param bool $same_activite Seulement les actes ayant la même activité (4 ou (1,2,3,5)) * @param bool $same_day Seulement les actes fait le même jour * * @return CActeCCAM[] */ function getLinkedActes($same_executant = true, $only_facturable = true, $same_activite = false, $same_day = false) { $acte = new CActeCCAM(); $where = array(); $where["acte_id"] = "<> '{$this->_id}'"; $where["object_class"] = "= '{$this->object_class}'"; $where["object_id"] = "= '{$this->object_id}'"; if ($only_facturable) { $where["facturable"] = "= '1'"; } if ($same_executant) { $where["executant_id"] = "= '{$this->executant_id}'"; } if ($same_activite) { if ($this->code_activite == 4) { $where['code_activite'] = " = 4"; } else { $where['code_activite'] = " IN(1, 2, 3, 5)"; } } if ($same_day) { $begin = CMbDT::format($this->execution, '%Y-%m-%d 00:00:00'); $end = CMbDT::format($this->execution, '%Y-%m-%d 23:59:59'); $where['execution'] = " BETWEEN '{$begin}' AND '{$end}'"; } $this->_linked_actes = $acte->loadList($where); return $this->_linked_actes; }
* @subpackage ccam * @author SARL OpenXtrem <*****@*****.**> * @license GNU General Public License, see http://www.gnu.org/licenses/gpl.html * @version $Revision$ * @link http://www.mediboard.org */ $start_time = microtime(true); CCanDo::checkAdmin(); $date = CValue::get('date'); $step = CValue::get('step', 100); $codable_class = CValue::get('codable_class'); $start = CValue::getOrSession('start_update_montant', 0); $act = new CActeCCAM(); $where = array(); $where['execution'] = " > '{$date} 00:00:00'"; $where['code_association'] = ' > 1'; if ($codable_class) { $where['object_class'] = " = '{$codable_class}'"; } $total = $act->countList($where); /** @var CActeCCAM[] $acts */ $acts = $act->loadList($where, 'execution DESC', "{$start}, {$step}"); foreach ($acts as $_act) { $_act->_calcul_montant_base = 1; $_act->store(); } CValue::setSession('start_update_montant', $start + $step); $smarty = new CSmartyDP(); $smarty->assign('total', $total); $smarty->assign('current', $start + $step); $smarty->display('inc_status_update_montant.tpl');