*
 * @package    Mediboard
 * @subpackage dPbloc
 * @author     SARL OpenXtrem <*****@*****.**>
 * @license    GNU General Public License, see http://www.gnu.org/licenses/gpl.html
 * @version    $Revision:$
 */
CCanDo::checkEdit();
$plageop_id = CValue::get("plageop_id");
$list_type = CValue::get("list_type", "left");
$anesth = new CTypeAnesth();
$anesth = $anesth->loadGroupList();
// Infos sur la plage opératoire
$plage = new CPlageOp();
$plage->load($plageop_id);
$plage->loadRefsFwd();
$intervs = $plage->loadRefsOperations(true, "rank, rank_voulu, horaire_voulu", true, $list_type != "left");
$chirs = CMbObject::massLoadFwdRef($intervs, "chir_id");
CMbObject::massLoadFwdRef($chirs, "function_id");
$sejours = CMbObject::massLoadFwdRef($intervs, "sejour_id");
CMbObject::massLoadFwdRef($sejours, "patient_id");
foreach ($intervs as $_interv) {
    $_interv->loadRefsFwd();
    $_interv->_ref_chir->loadRefFunction();
    $_interv->_ref_sejour->loadRefsFwd();
    $_interv->_count_affectations_personnel = $_interv->countBackRefs("affectations_personnel");
    $patient = $_interv->_ref_sejour->_ref_patient;
    $patient->loadRefDossierMedical();
    $patient->_ref_dossier_medical->countAllergies();
}
// liste des plages du praticien