* @subpackage SSR
 * @author     SARL OpenXtrem <*****@*****.**>
 * @license    GNU General Public License, see http://www.gnu.org/licenses/gpl.html
 * @version    $Revision:$
 */
CCanDo::checkRead();
$prescription_id = CValue::get("prescription_id");
$category_id = CValue::get("category_id");
$full_line_id = CValue::get("full_line_id");
$order = "debut ASC";
$ljoin["element_prescription"] = "prescription_line_element.element_prescription_id = element_prescription.element_prescription_id";
$where["prescription_id"] = " = '{$prescription_id}'";
$where["element_prescription.category_prescription_id"] = " = '{$category_id}'";
$lines = array();
$line = new CPrescriptionLineElement();
$_lines[$category_id] = $line->loadList($where, $order, null, null, $ljoin);
foreach ($_lines[$category_id] as $_line) {
    /* @var CPrescriptionLineElement $_line*/
    $_line->getRecentModification();
    $lines[$category_id][$_line->element_prescription_id][] = $_line;
}
$current_user = CMediusers::get();
$can_edit_prescription = $current_user->isPraticien() || $current_user->isAdmin();
// Création du template
$smarty = new CSmartyDP();
$smarty->assign("full_line_id", $full_line_id);
$smarty->assign("lines", $lines);
$smarty->assign("category_id", $category_id);
$smarty->assign("nodebug", true);
$smarty->assign("can_edit_prescription", $can_edit_prescription);
$smarty->display("inc_list_lines.tpl");
示例#2
0
 if ($prescription->_id) {
     // Chargement des lignes non associées à des taches
     $where = array();
     $ljoin = array();
     $ljoin["element_prescription"] = "prescription_line_element.element_prescription_id = element_prescription.element_prescription_id";
     $ljoin["sejour_task"] = "sejour_task.prescription_line_element_id = prescription_line_element.prescription_line_element_id";
     $where["prescription_id"] = " = '{$prescription->_id}'";
     $where["element_prescription.rdv"] = " = '1'";
     $where["prescription_line_element.date_arret"] = " IS NULL";
     $where["active"] = " = '1'";
     $where[] = "sejour_task.sejour_task_id IS NULL";
     $where["child_id"] = " IS NULL";
     $line_element = new CPrescriptionLineElement();
     $sejour->_count_tasks_not_created = $line_element->countList($where, null, $ljoin);
     if ($print) {
         $sejour->_ref_tasks_not_created = $line_element->loadList($where, null, null, null, $ljoin);
     }
     if ($only_non_checked) {
         $prescription->countNoValideLines($user_id);
         if ($prescription->_counts_no_valide == 0) {
             unset($sejours[$sejour->_id]);
             continue;
         }
     }
     if (@CAppUI::conf("object_handlers CPrescriptionAlerteHandler")) {
         $prescription->_count_alertes = $prescription->countAlertsNotHandled("medium");
         $prescription->_count_urgences = $prescription->countAlertsNotHandled("high");
     } else {
         $prescription->countFastRecentModif();
     }
 }
$ljoin["affectation"] = "sejour.sejour_id = affectation.sejour_id";
$where = array();
$where["element_prescription_id"] = CSQLDataSource::prepareIn($categories_id);
if ($real_time) {
    $time = CMbDT::time();
    $where[] = "'{$date} {$time}' <= affectation.sortie && '{$date} {$time}' >= affectation.entree";
} else {
    $where[] = "'{$date}' <= affectation.sortie && '{$date_max}' >= affectation.entree";
}
$where["affectation.service_id"] = " = '{$service_id}'";
$where["inscription"] = " = '0'";
$where["active"] = " = '1'";
if ($premedication) {
    $where["premedication"] = " = '1'";
}
$lines = $line->loadList($where, null, null, null, $ljoin);
// Chargement du patient pour chaque sejour
$sejours = CMbArray::pluck($lines, "_ref_prescription", "_ref_object");
$patients = CMbObject::massLoadFwdRef($sejours, "patient_id");
$hidden_lines_count = 0;
$first_date = reset($_dates);
$prescriptions = array();
/* @var CPrescriptionLineElement[] $lines*/
foreach ($lines as $_line_element) {
    if ($hide_old_lines && $_line_element->_fin_reelle && $_line_element->_fin_reelle < CMbDT::dateTime() && $_line_element->_fin_reelle >= $first_date) {
        if ($_line_element->countAdministrations()) {
            $hidden_lines_count++;
        }
        unset($lines[$_line_element->_id]);
        continue;
    }
/* $Id: $ */
/**
 * @package Mediboard
 * @subpackage soins
 * @version $Revision: $
 * @author SARL OpenXtrem
 * @license GNU General Public License, see http://www.gnu.org/licenses/gpl.html 
 */
$sejour_id = CValue::getOrSession("sejour_id");
$sejour = new CSejour();
$sejour->load($sejour_id);
$sejour->loadRefPrescriptionSejour();
$prescription = $sejour->_ref_prescription_sejour;
$where = array();
$ljoin = array();
$ljoin["element_prescription"] = "prescription_line_element.element_prescription_id = element_prescription.element_prescription_id";
$ljoin["sejour_task"] = "sejour_task.prescription_line_element_id = prescription_line_element.prescription_line_element_id";
$where["prescription_id"] = " = '{$prescription->_id}'";
$where["element_prescription.rdv"] = " = '1'";
$where["sejour_task.sejour_task_id"] = "IS NULL";
$where["active"] = " = '1'";
$where["child_id"] = " IS NULL";
$where["date_arret"] = "IS NULL";
$where["time_arret"] = "IS NULL";
$line_element = new CPrescriptionLineElement();
$lines = $line_element->loadList($where, null, null, null, $ljoin);
// Smarty template
$smarty = new CSmartyDP();
$smarty->assign("lines", $lines);
$smarty->display("inc_vw_lines_without_task.tpl");