<?php /** * $Id$ * * @package Mediboard * @subpackage SSR * @author SARL OpenXtrem <*****@*****.**> * @license GNU General Public License, see http://www.gnu.org/licenses/gpl.html * @version $Revision$ */ $bilan = new CBilanSSR(); if ($bilan->sejour_id = CValue::post("sejour_id")) { if ($bilan->loadMatchingObject()) { $_POST["bilan_id"] = $bilan->_id; } } $do = new CDoObjectAddEdit("CBilanSSR"); $do->doIt();
} } /** @var CSejour[] $sejours */ $sejours = array(); $_sejours = array(); $count_evts = array(); $sejours_count = 0; // Pour chaque plage de conge, recherche foreach ($plages_conge as $_plage_conge) { $kine = $_plage_conge->loadRefUser(); $_sejours = array(); $date_min = max($monday, $_plage_conge->date_debut); $date_max = CMbDT::date("+1 DAY", min($sunday, $_plage_conge->date_fin)); // Cas des remplacements kinés if ($type == "kine" && !$_plage_conge->_activite) { $_sejours = CBilanSSR::loadSejoursSurConges($_plage_conge, $monday, $sunday); } // Cas des transferts de rééducateurs if ($type == "reeducateur") { $evenement = new CEvenementSSR(); $where = array(); $where["debut"] = " BETWEEN '{$date_min}' AND '{$date_max}'"; $where["therapeute_id"] = " = '{$_plage_conge->user_id}'"; /** @var CEvenementSSR[] $evenements */ $evenements = $evenement->loadList($where); foreach ($evenements as $_evenement) { $sejour = $_evenement->loadRefSejour(); $bilan = $sejour->loadRefBilanSSR(); $bilan->loadRefTechnicien(); $_sejours[$sejour->_id] = $sejour; }
$prats = $user->loadPraticiens(PERM_READ); $service = new CService(); $where = array("group_id" => "= '{$group_id}'"); $order = "nom"; $services = $service->loadListWithPerms(PERM_READ, $where, $order); $sejour = new CSejour(); $sejour->load($sejour_id); $sejour->loadRefsNotes(); $sejour->loadRefsDocItems(); if ($sejour_id && !$sejour->_id) { CAppUI::setMsg(CAppUI::tr("CSejour-unavailable"), UI_MSG_WARNING); CAppUI::redirect("m=ssr&tab=vw_aed_sejour&sejour_id=0"); } $fiche_autonomie = new CFicheAutonomie(); $patient = new CPatient(); $bilan = new CBilanSSR(); $prescription = null; $lines = array(); $medecin_adresse_par = ""; $correspondantsMedicaux = array(); if ($sejour->_id) { $sejour->loadRefPatient(); $sejour->loadNDA(); // Chargement du patient $patient = $sejour->_ref_patient; $patient->loadIPP(); $patient->loadRefsCorrespondants(); if ($sejour->adresse_par_prat_id && $sejour->adresse_par_prat_id != $patient->_ref_medecin_traitant->_id) { $medecin_adresse_par = new CMedecin(); $medecin_adresse_par->load($sejour->adresse_par_prat_id); }
* @subpackage SSR * @author SARL OpenXtrem <*****@*****.**> * @license GNU General Public License, see http://www.gnu.org/licenses/gpl.html * @version $Revision$ */ CCanDo::checkRead(); // Plateaux disponibles $show_cancelled_services = CValue::getOrSession("show_cancelled_services"); $technicien_id = CValue::get("technicien_id"); $service_id = CValue::getOrSession("service_id"); $date = CValue::getOrSession("date", CMbDT::date()); $technicien = new CTechnicien(); $technicien->load($technicien_id); $technicien->loadRefKine(); $kine_id = $technicien->_ref_kine->_id; $sejours = CBilanSSR::loadSejoursSSRfor($technicien_id, $date, $show_cancelled_services); $services = array(); $all_sejours = array(); foreach ($sejours as $_sejour) { // Filtre sur service $service = $_sejour->loadFwdRef("service_id"); $services[$service->_id] = $service; if (!$technicien_id && $service_id && $_sejour->service_id != $service_id) { unset($sejours[$_sejour->_id]); continue; } $all_sejours[] = $_sejour; $_sejour->checkDaysRelative($date); $_sejour->loadRefPatient(1); $_sejour->loadRefBilanSSR()->getDateEnCours($date); }
} // Séjour unique if ($sejour_id) { // Chargement du séjour $sejour = new CSejour(); $sejour->load($sejour_id); $sejours[$sejour->_id] = $sejour; // Chargement d'un remplacement possible $replacement = $sejour->loadRefReplacement($conge_id); if ($replacement->_id) { $replacement->loadRefsNotes(); $replacement->loadRefReplacer()->loadRefFunction(); } } else { // Chargement des séjours $sejours = CBilanSSR::loadSejoursSurConges($conge, $monday, $sunday); $patients = CMbObject::massLoadFwdRef($sejours, "patient_id"); // Pas de remplacement pour une collection de séjours $replacement = new CReplacement(); } // Chargement des praticiens $user = new CMediusers(); $user->load($conge->user_id); $user->loadRefFunction(); $users = $user->loadUsers(PERM_READ, $user->function_id); // Séjours des patients $therapeutes = array(); $all_sejours = array(); foreach ($sejours as $_sejour) { $patient = $_sejour->loadRefPatient(); foreach ($patient->loadRefsSejours() as $_other_sejour) {
$sejours = array(); /** @var CReplacement[][] $replacements */ $replacements = array(); /** @var CSejour[] $all_sejours */ $all_sejours = array(); $plateau = new CPlateauTechnique(); $plateau->group_id = $group->_id; /** @var CPlateauTechnique[] $plateaux */ $plateaux = $plateau->loadMatchingList(); foreach ($plateaux as $_plateau) { foreach ($_plateau->loadRefsTechniciens() as $_technicien) { $_technicien->loadRefCongeDate($date); $_technicien->loadRefKine(); $kine_id = $_technicien->_ref_kine->_id; // Chargement des sejours du technicien $sejours[$_technicien->_id] = CBilanSSR::loadSejoursSSRfor($_technicien->_id, $date); /** @var CSejour $_sejour */ foreach ($sejours[$_technicien->_id] as $_sejour) { $_sejour->checkDaysRelative($date); $_sejour->loadRefPatient(1); $_sejour->loadRefBilanSSR(); $all_sejours[] = $_sejour; } // Chargement de ses remplacements $replacement = new CReplacement(); $replacements[$_technicien->_id] = $replacement->loadListFor($kine_id, $date); /** @var CReplacement $_replacement */ foreach ($replacements[$_technicien->_id] as $_replacement) { // Détail sur le congé $_replacement->loadRefConge(); $_replacement->_ref_conge->loadRefUser();