$show_annulees = CValue::getOrSession("show_annulees", 0);
// Plage de consultation selectionnée
$plageconsult_id = CValue::getOrSession("plageconsult_id", null);
$plageSel = new CPlageconsult();
if ($plageconsult_id === null && $chirSel && $is_in_period) {
    $nowTime = CMbDT::time();
    $where = array("chir_id = '{$chirSel}' OR remplacant_id = '{$chirSel}' OR pour_compte_id = '{$chirSel}'", "date" => "= '{$today}'", "debut" => "<= '{$nowTime}'", "fin" => ">= '{$nowTime}'");
    $plageSel->loadObject($where);
}
if (!$plageSel->plageconsult_id) {
    $plageSel->load($plageconsult_id);
} else {
    $plageconsult_id = $plageSel->plageconsult_id;
}
$plageSel->loadRefChir();
$plageSel->loadRefRemplacant();
$plageSel->loadRefPourCompte();
$plageSel->loadRefsNotes();
$plageSel->loadRefsBack($show_annulees, true, $show_payees);
if ($plageSel->_affected && count($plageSel->_ref_consultations)) {
    $firstconsult = reset($plageSel->_ref_consultations);
    $_firstconsult_time = substr($firstconsult->heure, 0, 5);
    $lastconsult = end($plageSel->_ref_consultations);
    $_lastconsult_time = substr($lastconsult->heure, 0, 5);
}
$consults = $plageSel->_ref_consultations;
CStoredObject::massLoadFwdRef($consults, "sejour_id");
$patients = CMbObject::massLoadFwdRef($consults, "patient_id");
CStoredObject::massCountBackRefs($patients, "notes");
CStoredObject::massLoadFwdRef($consults, "categorie_id");
// Détails sur les consultation affichées
Ejemplo n.º 2
0
<?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");