foreach ($administrations as $_administration) {
    $_administration->loadRefsFwd();
    $perops[$_administration->dateTime][$_administration->_guid] = $_administration;
}
foreach ($operation->_ref_anesth_perops as $_perop) {
    $perops[$_perop->datetime][$_perop->_guid] = $_perop;
}
$constantes = array("pouls", "ta_gauche", "frequence_respiratoire", "score_sedation", "spo2", "diurese");
foreach ($sejour->_list_constantes_medicales as $_constante_medicale) {
    foreach ($constantes as $_constante) {
        $perops[$_constante_medicale->datetime][$_constante_medicale->_guid][$_constante] = $_constante_medicale->{$_constante};
    }
}
if ($prescription_id) {
    // Chargements des perfusions pour afficher les poses et les retraits
    $prescription_line_mix = new CPrescriptionLineMix();
    $prescription_line_mix->prescription_id = $prescription_id;
    $prescription_line_mix->perop = 1;
    /** @var CPrescriptionLineMix[] $mixes */
    $mixes = $prescription_line_mix->loadMatchingList();
    foreach ($mixes as $_mix) {
        $_mix->loadRefsLines();
        if ($_mix->date_pose && $_mix->time_pose) {
            $perops[$_mix->_pose][$_mix->_guid] = $_mix;
        }
        if ($_mix->date_retrait && $_mix->time_retrait) {
            $perops[$_mix->_retrait][$_mix->_guid] = $_mix;
        }
    }
}
ksort($perops);
Exemplo n.º 2
0
<?php

/* $Id: $ */
/**
 * @package Mediboard
 * @subpackage soins
 * @version $Revision: $
 * @author SARL OpenXtrem
 * @license GNU General Public License, see http://www.gnu.org/licenses/gpl.html 
 */
CCanDo::checkEdit();
$line_id = CValue::get("line_id");
$line_item_id = CValue::get("line_item_id");
$mode_protocole = CValue::get("mode_protocole");
$line = new CPrescriptionLineMix();
$line->load($line_id);
$line->calculQuantiteTotal();
$line_item = new CPrescriptionLineMixItem();
$line_item = $line->_ref_lines[$line_item_id];
$line_item->loadRefsFwd();
$line_item->_unite_administration = $line_item->_ref_produit->libelle_unite_presentation;
// Le tableau d'unité peut contenir des caractères spéciaux à encoder en utf8
function utf8enc($array)
{
    if (!is_array($array)) {
        return;
    }
    $helper = array();
    foreach ($array as $key => $value) {
        $helper[utf8_encode($key)] = is_array($value) ? utf8enc($value) : utf8_encode($value);
    }
Exemplo n.º 3
0
$observations = $observation->loadList($whereObs, "date");
CStoredObject::massLoadFwdRef($observations, "user_id");
// Consultations
$consultation = new CConsultation();
$whereConsult = $where;
$whereConsult["plageconsult.date"] = "BETWEEN '{$datetime_delta}' AND '{$datetime_avg}'";
$ljoin = array("plageconsult" => "plageconsult.plageconsult_id = consultation.plageconsult_id");
$consultations = $consultation->loadList($whereConsult, "plageconsult.date", null, null, $ljoin);
CStoredObject::massLoadFwdRef($consultations, "plageconsult_id");
$smarty_cstes = new CSmartyDP("modules/dPpatients");
$smarty_cstes->assign("empty_lines", 2);
$smarty_cstes->assign("offline", 1);
// Constantes des 12 dernières heures
$where_cste = array("datetime" => "BETWEEN '" . CMbDT::subDateTime("12:00:00", $datetime_avg) . "' AND '{$datetime_avg}'");
CPrescriptionLine::$_offline_lite = true;
CPrescriptionLineMix::$_offline_lite = true;
CPrescription::$_offline_lite = true;
foreach ($sejours as $_sejour) {
    $patient = $_sejour->loadRefPatient();
    $_sejour->loadRefPraticien();
    $_sejour->loadJourOp($date);
    if ($service_id == "urgence") {
        $_sejour->_veille = CMbDT::date($_sejour->entree) != $date;
        $_sejour->loadRefRPU()->loadRefIDEResponsable();
    }
    $patients_offline[$patient->_guid]["sejour"] = $_sejour;
    // Transmissions
    $patients_offline[$patient->_guid]["transmissions"] = array();
    // Regroupement par cible
    $trans_sejour = array();
    foreach ($transmissions as $_trans) {
Exemplo n.º 4
0
     $where_line["prescription_line_element.praticien_id"] = " = '{$user_id}'";
     $ljoin_line["prescription"] = "prescription.prescription_id = prescription_line_element.prescription_id";
     $ljoin_line["sejour"] = "prescription.object_id = sejour.sejour_id";
     $lines = $line->loadList($where_line, null, null, null, $ljoin_line);
     foreach ($lines as $_line) {
         $_line->loadRefPrescription();
         $_sejour = $_line->_ref_prescription->_ref_object;
         if (!isset($sejours[$_sejour->_id])) {
             $sejours[$_sejour->_id] = $_sejour;
         }
     }
     // Lignes mixes
     $where_line["prescription_line_mix.variante_for_id"] = "IS NULL";
     $where_line["prescription_line_mix.variante_active"] = " = '1'";
     $ljoin_line = array();
     $line_mix = new CPrescriptionLineMix();
     unset($where_line["prescription_line_element.praticien_id"]);
     $where["prescription_line_mix.praticien_id"] = " = '{$user_id}'";
     unset($where_line["signee"]);
     $ljoin_line["prescription"] = "prescription.prescription_id = prescription_line_mix.prescription_id";
     $ljoin_line["sejour"] = "prescription.object_id = sejour.sejour_id";
     $lines = $line_mix->loadList($where_line, null, null, null, $ljoin_line);
     foreach ($lines as $_line) {
         $_line->loadRefPrescription();
         $_sejour = $_line->_ref_prescription->_ref_object;
         if (!isset($sejours[$_sejour->_id])) {
             $sejours[$_sejour->_id] = $_sejour;
         }
     }
 } else {
     $sejours = array();