$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; if ($plageconsult_id) { if (!$plage->plageconsult_id) { $plage->load($plageconsult_id); } $plage->loadRefsFwd(true); $function_id = $plage->_ref_chir->function_id; $plage->loadRefsConsultations(false, true, true); $plage->loadFillRate(); $plage->_ref_chir->loadRefFunction(); for ($i = 0; $i < $plage->_total; $i++) { $minutes = $plage->_freq * $i; $listPlace[$i]["time"] = CMbDT::time("+ {$minutes} minutes", $plage->debut); $listPlace[$i]["consultations"] = array(); } foreach ($plage->_ref_consultations as $keyConsult => $valConsult) { $consultation =& $plage->_ref_consultations[$keyConsult]; $consultation->loadRefPatient(); // Chargement de la categorie $consultation->loadRefCategorie(); $keyPlace = CMbDT::timeCountIntervals($plage->debut, $consultation->heure, $plage->freq); if ($keyPlace < 0) { $listBefore[$keyPlace] =& $consultation;
// Chargement des plages disponibles /** @var CPlageconsult[] $listPlage */ $listPlage = $plage->loadList($where, $order, null, "plageconsult_id", $ljoin); if (!array_key_exists($plageconsult_id, $listPlage)) { $plage->_id = $plageconsult_id = null; } $currPlage = new CPlageconsult(); foreach ($listPlage as $currPlage) { if (!$plageconsult_id && $date == $currPlage->date) { $plageconsult_id = $currPlage->_id; } $currPlage->_ref_chir = $listPrat[$currPlage->chir_id]; $currPlage->loadCategorieFill(); $currPlage->loadRefsNotes(); $currPlage->countPatients(); $currPlage->loadRefsConsultations(false); $currPlage->loadDisponibilities(); } // Création du template $smarty = new CSmartyDP(); $smarty->assign("period", $period); $smarty->assign("periods", $periods); $smarty->assign("hour", $hour); $smarty->assign("hours", CPlageconsult::$hours); $smarty->assign("hide_finished", $hide_finished); $smarty->assign("date", $date); $smarty->assign("today", CMbDT::date()); $smarty->assign("refDate", $refDate); $smarty->assign("ndate", $ndate); $smarty->assign("pdate", $pdate); $smarty->assign("bank_holidays", $bank_holidays);
for ($i = 0; CMbDT::date("+{$i} day", $debut) != $fin; $i++) { $date = CMbDT::date("+{$i} day", $debut); if (in_array("consult", $export)) { $where = array(); $where["chir_id"] = "= '{$prat_id}'"; $where["date"] = "= '{$date}'"; /** @var CPlageconsult[] $plagesPerDayConsult */ $plagesPerDayConsult = $plageConsult->loadList($where); if ($details) { CMbObject::massLoadBackRefs($plagesPerDayConsult, "consultations"); } foreach ($plagesPerDayConsult as $key => $plageConsult) { $plageConsult->countPatients(); $plageConsult->loadFillRate(); if ($details) { $plageConsult->loadRefsConsultations(); } } $plagesConsult[$date] = $plagesPerDayConsult; } if (in_array("interv", $export)) { $where = array(); $where[] = "chir_id = '{$prat_id}' OR anesth_id = '{$prat_id}'"; $where["date"] = "= '{$date}'"; $where["salle_id"] = CSQLDataSource::prepareIn(array_keys($listSalles)); $plagesPerDayOp = $plageOp->loadList($where); $salles = CMbObject::massLoadFwdRef($plagesPerDayOp, "salle_id"); CMbObject::massLoadFwdRef($salles, "bloc_id"); CMbObject::massLoadBackRefs($plagesPerDayOp, "operations"); foreach ($plagesPerDayOp as $key => $plage) { $plage->loadRefSalle();
<?php /** * $Id$ * * @category Cabinet * @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(); $plage_id = CValue::get("plage_id"); $plage = new CPlageconsult(); $plage->load($plage_id); $plage->loadRefsNotes(); $plage->loadRefChir()->loadRefFunction(); $plage->loadRefRemplacant()->loadRefFunction(); foreach ($plage->loadRefsConsultations() as $_consult) { $_consult->loadRefPatient()->loadRefPhotoIdentite(); } $plage->loadDisponibilities(); // smarty $smarty = new CSmartyDP(); $smarty->assign("object", $plage); $smarty->display("inc_vw_plage_consult.tpl");