<?php

/**
 * $Id$
 *
 * @package    Mediboard
 * @subpackage SSR
 * @author     SARL OpenXtrem <*****@*****.**>
 * @license    GNU General Public License, see http://www.gnu.org/licenses/gpl.html
 * @version    $Revision$
 */
CCanDo::checkEdit();
// RHS concernés
$rhs = new CRHS();
$rhs->load(CValue::get("rhs_id"));
$rhs->loadRefDependances();
$rhs->loadRefSejour();
if (!$rhs->_ref_dependances->_id) {
    $rhs->_ref_dependances->rhs_id = $rhs->_id;
    $rhs->_ref_dependances->store();
}
// Création du template
$smarty = new CSmartyDP();
$smarty->assign("rhs", $rhs);
$smarty->display("inc_edit_dependances_rhs.tpl");
Exemplo n.º 2
0
<?php

/**
 * $Id$
 *
 * @package    Mediboard
 * @subpackage SSR
 * @author     SARL OpenXtrem <*****@*****.**>
 * @license    GNU General Public License, see http://www.gnu.org/licenses/gpl.html
 * @version    $Revision$
 */
CCanDo::checkEdit();
// Utilisateur courant
$user = CMediusers::get();
// RHS concernés
$rhs = new CRHS();
$rhs->load(CValue::get("rhs_id"));
if (!$rhs->_id) {
    CAppUI::stepAjax("RHS inexistant", UI_MSG_ERROR);
}
$rhs->loadRefsNotes();
// Recalcul
if (CValue::get("recalculate")) {
    $rhs->recalculate();
}
// Liste des catégories d'activité
if ($rhs->_id) {
    $rhs->loadRefSejour();
    $dependances = $rhs->loadRefDependances();
    if (!$dependances->_id) {
        $dependances->store();
 * $Id$
 *
 * @package    Mediboard
 * @subpackage SSR
 * @author     SARL OpenXtrem <*****@*****.**>
 * @license    GNU General Public License, see http://www.gnu.org/licenses/gpl.html
 * @version    $Revision$
 */
CCanDo::checkRead();
$sejour_ids = explode("-", CValue::get("sejour_ids"));
$date_monday = CValue::get("date_monday");
$all_rhs = CValue::get("all_rhs");
$where["sejour_id"] = CSQLDataSource::prepareIn($sejour_ids);
$where["date_monday"] = $all_rhs ? ">= '{$date_monday}'" : "= '{$date_monday}'";
$order = "sejour_id, date_monday";
$rhs = new CRHS();
/** @var CRHS[] $sejours_rhs */
$sejours_rhs = $rhs->loadList($where, $order);
// Liste des catégories d'activité
$type_activite = new CTypeActiviteCdARR();
$types_activite = $type_activite->loadList();
$totaux = array();
foreach ($sejours_rhs as $_rhs) {
    // Dépendances
    $dependances = $_rhs->loadRefDependances();
    if (!$dependances->_id) {
        $dependances->store();
    }
    $_rhs->loadRefSejour();
    $_rhs->buildTotaux();
}
Exemplo n.º 4
0
 /**
  * Charge le RHS correspondant à l'évenement
  *
  * @return CRHS
  */
 function getRHS()
 {
     $rhs = new CRHS();
     $rhs->sejour_id = $this->sejour_id;
     $rhs->date_monday = CMbDT::date("last monday", CMbDT::date("+1 day", CMbDT::date($this->debut)));
     $rhs->loadMatchingObject();
     return $rhs;
 }
<?php

/**
 * $Id$
 *
 * @package    Mediboard
 * @subpackage SSR
 * @author     SARL OpenXtrem <*****@*****.**>
 * @license    GNU General Public License, see http://www.gnu.org/licenses/gpl.html
 * @version    $Revision$
 */
CCanDo::checkRead();
$rhs_date_monday = CValue::get('rhs_date_monday');
$date = CMbDT::date();
$rhs = new CRHS();
$join['sejour'] = "sejour.sejour_id = rhs.sejour_id";
$join['patients'] = "patients.patient_id = sejour.patient_id";
$where['sejour.annule'] = " = '0'";
$where['date_monday'] = " = '{$rhs_date_monday}'";
$order = "nom, prenom";
/** @var CRHS[] $sejours_rhs */
$sejours_rhs = $rhs->loadList($where, $order, null, null, $join);
foreach ($sejours_rhs as $_rhs) {
    $_rhs->loadRefsNotes();
    $sejour = $_rhs->loadRefSejour();
    $sejour->_ref_patient->loadIPP();
}
$where['rhs.facture'] = " = '0'";
$count_sej_rhs_no_charge = $rhs->countList($where, null, $join);
// Création du template
$smarty = new CSmartyDP();
Exemplo n.º 6
0
 /**
  * Ajout d'un chapitre d'un acte de rééducation
  *
  * @param DOMNode $elParent Node
  * @param CRHS    $mbRhs    RHS
  *
  * @return void
  */
 function addChapitreActeReeducation(DOMNode $elParent, CRHS $mbRhs)
 {
     $totauxType = $mbRhs->countTypeActivite();
     foreach ($totauxType as $mnemonique => $_total_type) {
         if (!$_total_type) {
             continue;
         }
         $chapitreActeReeducation = $this->addElement($elParent, "chapitreActeReeducation");
         $this->addAttribute($chapitreActeReeducation, "mnemonique", strtolower($mnemonique));
         $this->addElement($chapitreActeReeducation, "duree", $_total_type);
         $this->addElement($chapitreActeReeducation, "commentaire", CActiviteCdARR::get($mnemonique)->libelle);
     }
 }
Exemplo n.º 7
0
<?php

/**
 * $Id$
 *
 * @package    Mediboard
 * @subpackage SSR
 * @author     SARL OpenXtrem <*****@*****.**>
 * @license    GNU General Public License, see http://www.gnu.org/licenses/gpl.html
 * @version    $Revision$
 */
CCanDo::checkEdit();
// Séjour concernés
$rhs = new CRHS();
$rhs->load(CValue::get("rhs_id"));
if (!$rhs->_id) {
    CAppUI::stepAjax("RHS inexistant", UI_MSG_ERROR);
}
$rhs->loadRefsNotes();
$rhs->buildTotaux();
// Création du template
$smarty = new CSmartyDP();
$smarty->assign("rhs", $rhs);
$smarty->display("inc_totaux_rhs.tpl");
Exemplo n.º 8
0
<?php

/**
 * $Id$
 *
 * @package    Mediboard
 * @subpackage SSR
 * @author     SARL OpenXtrem <*****@*****.**>
 * @license    GNU General Public License, see http://www.gnu.org/licenses/gpl.html
 * @version    $Revision$
 */
$sejour_ids = CValue::post("sejour_ids");
$date_monday = CValue::post("date_monday");
$all_rhs = CValue::post("all_rhs");
$where["sejour_id"] = CSQLDataSource::prepareIn($sejour_ids);
$where["date_monday"] = $all_rhs ? ">= '{$date_monday}'" : "= '{$date_monday}'";
$order = "sejour_id, date_monday";
$rhs = new CRHS();
/** @var CRHS[] $rhss */
$rhss = $rhs->loadList($where, $order);
if (count($rhss)) {
    foreach ($rhss as $_rhs) {
        $_rhs->facture = CValue::post("facture");
        $msg = $_rhs->store();
        CAppUI::displayMsg($msg, "CRHS-msg-modify");
    }
} else {
    CAppui::setMsg("CRHS.none", UI_MSG_WARNING);
}
echo CAppUI::getMsg();
CApp::rip();
Exemplo n.º 9
0
 *
 * @package    Mediboard
 * @subpackage SSR
 * @author     SARL OpenXtrem <*****@*****.**>
 * @license    GNU General Public License, see http://www.gnu.org/licenses/gpl.html
 * @version    $Revision$
 */
CCanDo::checkRead();
// Séjour concernés
$sejour = new CSejour();
$sejour->load(CValue::get("sejour_id"));
if (!$sejour->_id) {
    CAppUI::stepAjax("Séjour inexistant", UI_MSG_ERROR);
}
if ($sejour->type != "ssr") {
    CAppUI::stepAjax("Le séjour sélectionné n'est pas un séjour de type SSR (%s)", UI_MSG_ERROR, $sejour->type);
}
// Chargment du bilan
$bilan = $sejour->loadRefBilanSSR();
// Liste des RHSs du séjour
$_rhs = new CRHS();
$rhss = CRHS::getAllRHSsFor($sejour);
foreach ($rhss as $_rhs) {
    $_rhs->loadRefSejour();
}
// Création du template
$smarty = new CSmartyDP();
$smarty->assign("sejour", $sejour);
$smarty->assign("bilan", $bilan);
$smarty->assign("rhss", $rhss);
$smarty->display("inc_cotation_rhs.tpl");
Exemplo n.º 10
0
 /**
  * Charge la chronologie de relevés de dépendances autout du RHS
  *
  * @return CDependancesRHS[]
  */
 function loadDependancesChronology()
 {
     $sejour = $this->loadRefSejour();
     $all_rhs = CRHS::getAllRHSsFor($sejour);
     $empty = new CDependancesRHS();
     $empty->habillage = 0;
     $empty->deplacement = 0;
     $empty->alimentation = 0;
     $empty->continence = 0;
     $empty->comportement = 0;
     $empty->relation = 0;
     $chrono = array("-2" => $empty, "-1" => $empty, "+0" => $empty, "+1" => $empty, "+2" => $empty);
     foreach ($chrono as $ref => &$dep) {
         $date = CMbDT::date("{$ref} WEEKS", $this->date_monday);
         if (array_key_exists($date, $all_rhs)) {
             $_rhs = $all_rhs[$date];
             $_rhs->loadRefDependances();
             $dep = $_rhs->_ref_dependances;
         }
     }
     return $this->_ref_dependances_chonology = $chrono;
 }