$blocage->loadRefLit()->loadRefChambre()->loadRefService();
    $where["lit_id"] = "= '{$blocage->lit_id}'";
    if (!$sejour->_id && $affectatione->loadObject($where)) {
        $affectatione->loadRefSejour();
        $affectatione->_ref_sejour->loadRefPatient();
        $jusqua = CMbDT::transform($affectatione->sortie, null, "%Hh%Mmin %d-%m-%Y") . " (" . $affectatione->_ref_sejour->_ref_patient->_view;
        $blocage->_ref_lit->_view .= " indisponible jusqu'à " . $jusqua . ")";
    }
}
$exchange_source = CExchangeSource::get("mediuser-" . CAppUI::$user->_id, "smtp");
$_functions = array();
if ($chir->_id) {
    $_functions = $chir->loadBackRefs("secondary_functions");
}
$op->loadRefChir2();
$op->loadRefChir3();
$op->loadRefChir4();
if (!$op->_id) {
    $op->_time_op = $op->temp_operation = "00:00:00";
    if ($hour_urgence && $min_urgence) {
        $time = "{$hour_urgence}:{$min_urgence}:00";
    } else {
        $time = str_pad($hours_urgence["deb"], 2, "0", STR_PAD_LEFT) . ":00:00";
    }
    $op->_time_urgence = $op->time_operation = $time;
}
// Création du template
$smarty = new CSmartyDP();
$smarty->assign("sejours_collision", $patient->getSejoursCollisions());
$smarty->assign("isPrescriptionInstalled", CModule::getActive("dPprescription"));
$smarty->assign("canSante400", CModule::getCanDo("dPsante400"));