コード例 #1
0
<?php

/**
 * $Id$
 *  
 * @category Hospitalisation
 * @package  Mediboard
 * @author   SARL OpenXtrem <*****@*****.**>
 * @license  GNU General Public License, see http://www.gnu.org/licenses/gpl.html
 * @version  $Revision$
 * @link     http://www.mediboard.org
 */
CCanDo::checkRead();
$obs_id = CView::get("obs_id", "num");
CView::checkin();
$obs = new CObservationMedicale();
$obs->load($obs_id);
$obs->loadRefAlerte();
$obs->_ref_alerte->loadRefHandledUser();
$smarty = new CSmartyDP();
$smarty->assign("obs", $obs);
$smarty->display("inc_vw_alerte_obs.tpl");
コード例 #2
0
$transmission = new CTransmissionMedicale();
$transmissions = $transmission->loadList($whereTrans, "date");
$whereTrans = $where;
$whereTrans["date"] = "BETWEEN '{$datetime_delta}' AND '{$datetime_avg}'";
$whereTrans["object_id"] = "IS NOT NULL";
$transmission = new CTransmissionMedicale();
$transmissions = array_merge($transmissions, $transmission->loadList($whereTrans, "date"));
$whereTrans = $where;
$whereTrans["date"] = "BETWEEN '{$datetime_delta}' AND '{$datetime_avg}'";
$whereTrans[] = "object_id IS NULL and libelle_atc IS NULL";
$transmission = new CTransmissionMedicale();
$transmissions = array_merge($transmissions, $transmission->loadList($whereTrans, "date"));
CStoredObject::massLoadFwdRef($transmissions, "user_id");
array_multisort(CMbArray::pluck($transmissions, "date"), SORT_ASC, $transmissions);
// Observations
$observation = new CObservationMedicale();
$whereObs = $where;
$whereObs["date"] = "BETWEEN '{$datetime_delta}' AND '{$datetime_avg}'";
$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
コード例 #3
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 
 */
$user = CUser::get();
$sejours = CValue::get("sejours");
foreach ($sejours as $_sejour_id) {
    $observation = new CObservationMedicale();
    $observation->sejour_id = $_sejour_id;
    $observation->user_id = $user->_id;
    $observation->degre = "info";
    $observation->date = CMbDT::dateTime();
    $observation->text = "Visite effectuée";
    $msg = $observation->store();
    CAppUI::displayMsg($msg, "CObservationMedicale-msg-create");
}
echo CAppUI::getMsg();
CApp::rip();
コード例 #4
0
ファイル: vw_bilan_service.php プロジェクト: fbone/mediboard4
 $trans = new CTransmissionMedicale();
 $whereTrans = array();
 $whereTrans[] = "(degre = 'high' AND (date_max IS NULL OR date_max >= '{$dateTime_min}')) OR (date >= '{$dateTime_min}' AND date <= '{$dateTime_max}')";
 $whereTrans["sejour_id"] = CSQLDataSource::prepareIn($sejours_ids);
 $transmissions = $trans->loadList($whereTrans, "FIND_IN_SET(sejour_id, '" . implode(',', $sejours_ids) . "')");
 CMbObject::massLoadFwdRef($transmissions, "user_id");
 foreach ($transmissions as $_trans) {
     $_trans->loadRefUser();
     $_trans->loadTargetObject();
     if ($_trans->_ref_object) {
         $_trans->_ref_object->loadRefsFwd();
     }
     $_trans->_ref_sejour = $sejours[$_trans->sejour_id];
     $trans_and_obs[$_trans->_ref_sejour->patient_id][$_trans->date][] = $_trans;
 }
 $obs = new CObservationMedicale();
 $whereObs = array();
 $whereObs[] = "(degre = 'high') OR (date >= '{$dateTime_min}' AND date <= '{$dateTime_max}')";
 $whereObs["sejour_id"] = CSQLDataSource::prepareIn(array_keys($sejours));
 $observations = $obs->loadList($whereObs, "FIND_IN_SET(observation_medicale.sejour_id, '" . implode(',', $sejours_ids) . "')");
 CMbObject::massLoadFwdRef($observations, "user_id");
 foreach ($observations as $_obs) {
     $_obs->loadRefUser();
     $_obs->loadTargetObject();
     if ($_obs->_ref_object) {
         $_obs->_ref_object->loadRefsFwd();
     }
     $_obs->_ref_sejour = $sejours[$_obs->sejour_id];
     $trans_and_obs[$_obs->_ref_sejour->patient_id][$_obs->date][] = $_obs;
 }
 $cste = new CConstantesMedicales();
コード例 #5
0
    if ($degre == "urg") {
        $where["degre"] = "= 'high'";
    }
}
// Chargement des transmissions
if ($load_transmissions == "1") {
    $ljoin["sejour"] = "transmission_medicale.sejour_id = sejour.sejour_id";
    $ljoin["affectation"] = "sejour.sejour_id = affectation.sejour_id";
    $transmission = new CTransmissionMedicale();
    $transmissions = $transmission->loadList($where, null, null, "transmission_medicale_id", $ljoin);
}
// Chargement des observations
if ($load_observations == "1") {
    $ljoin["sejour"] = "observation_medicale.sejour_id = sejour.sejour_id";
    $ljoin["affectation"] = "sejour.sejour_id = affectation.sejour_id";
    $observation = new CObservationMedicale();
    $observations = $observation->loadList($where, null, null, "observation_medicale_id", $ljoin);
}
$cibles = array();
$trans_and_obs = array();
foreach ($transmissions as $_transmission) {
    $_transmission->loadRefsFwd();
    $_transmission->_ref_sejour->loadRefPatient();
    $_transmission->_ref_sejour->loadRefsAffectations();
    $_transmission->_ref_sejour->_ref_last_affectation->loadRefLit();
    $patient = $_transmission->_ref_sejour->_ref_patient;
    $lit = $_transmission->_ref_sejour->_ref_last_affectation->_ref_lit;
    if ($order_col == "patient_id") {
        $key = $patient->nom . $patient->prenom . $patient->_id . $_transmission->date;
    }
    if ($order_col == "date") {
コード例 #6
0
 /**
  * Compte les visites effectuées
  *
  * @return int
  */
 function countNotifSiblings()
 {
     $date = CMbDT::date($this->date);
     $observation = new CObservationMedicale();
     $where = array();
     $where["sejour_id"] = " = '{$this->sejour_id}'";
     $where["user_id"] = " = '{$this->user_id}'";
     $where["degre"] = " = 'info'";
     $where["date"] = " LIKE '{$date}%'";
     $where["text"] = " = 'Visite effectuée'";
     return $observation->countList($where);
 }
コード例 #7
0
<?php

/**
 * $Id: ajax_vw_dossier_suivi_lite.php 27632 2015-03-20 13:35:23Z flaviencrochard $
 *
 * @package    Mediboard
 * @subpackage soins
 * @author     SARL OpenXtrem <*****@*****.**>
 * @license    GNU General Public License, see http://www.gnu.org/licenses/gpl.html
 * @version    $Revision: 27632 $
 */
CSessionHandler::writeClose();
$sejour_id = CValue::get("sejour_id");
// Chargement des observations d'importance haute de moins de 7 jours
$observation = new CObservationMedicale();
$where = array();
$where["degre"] = " = 'high'";
$where["sejour_id"] = " = '{$sejour_id}'";
$where["date"] = " >= '" . CMbDT::dateTime("- 7 DAYS") . "'";
/* @var CObservationMedicale[] $observations */
$observations = $observation->loadList($where);
// Chargement des transmissions d'importance haute ou des macrocibles de moins de 7 jours
$transmission = new CTransmissionMedicale();
$where = array();
$where["date"] = " >= '" . CMbDT::dateTime("- 7 DAYS") . "'";
$where["sejour_id"] = " = '{$sejour_id}'";
$where[] = "degre = 'high' OR category_prescription.cible_importante = '1'";
if (CAppUI::conf("soins synthese transmission_date_limit", CGroups::loadCurrent()->_guid)) {
    $where[] = "date_max >= '" . CMbDT::dateTime() . "' OR date_max IS NULL";
}
$ljoin = array();
コード例 #8
0
ファイル: ajax_observation.php プロジェクト: fbone/mediboard4
<?php

/**
 * $Id$
 *
 * @package    Mediboard
 * @subpackage Hospi
 * @author     SARL OpenXtrem <*****@*****.**>
 * @license    GNU General Public License, see http://www.gnu.org/licenses/gpl.html
 * @version    $Revision$
 */
$observation_id = CValue::get("observation_id");
$sejour_id = CValue::get("sejour_id");
$user_id = CValue::get("user_id");
$observation = new CObservationMedicale();
if ($observation_id) {
    $observation->load($observation_id);
} else {
    $observation->sejour_id = $sejour_id;
    $observation->user_id = $user_id;
}
$smarty = new CSmartyDP();
$smarty->assign("observation", $observation);
$smarty->display("inc_observation.tpl");
コード例 #9
0
<?php

/**
 * $Id$
 *
 * @package    Mediboard
 * @subpackage Hospi
 * @author     SARL OpenXtrem <*****@*****.**>
 * @license    GNU General Public License, see http://www.gnu.org/licenses/gpl.html
 * @version    $Revision$
 */
$sejour_id = CValue::get("sejour_id");
$transmission = new CTransmissionMedicale();
$where = array("sejour_id" => "= '{$sejour_id}'");
$nb_trans_obs = $transmission->countList($where);
$observation = new CObservationMedicale();
$nb_trans_obs += $observation->countList($where);
$consultation = new CConsultation();
$where["annule"] = "= '0'";
$nb_trans_obs += $consultation->countList($where);
unset($where["annule"]);
// Compter les consultations d'anesthésie hors séjour
$sejour = new CSejour();
$sejour->load($sejour_id);
$patient = $sejour->loadRefPatient();
$consultations = $patient->loadRefsConsultations(array("annule" => "= '0'"));
CStoredObject::massCountBackRefs($consultations, "consult_anesth");
foreach ($consultations as $_consult) {
    if ($_consult->_count["consult_anesth"]) {
        $nb_trans_obs++;
    }
コード例 #10
0
ファイル: CSejour.class.php プロジェクト: fbone/mediboard4
 /**
  * Charge tout le suivi médical, composé d'observations, transmissions, consultations et prescriptions
  *
  * @param date $datetime_min Date de référence à partir de laquelle filtrer
  *
  * @return array
  */
 function loadSuiviMedical($datetime_min = null, $cible_trans = null, &$cibles = array(), &$last_trans_cible = array(), $user_id = null, &$users = array(), $print = 0)
 {
     if ($datetime_min) {
         $trans = new CTransmissionMedicale();
         $whereTrans = array();
         $whereTrans[] = "(degre = 'high' AND (date_max IS NULL OR date_max >= '{$datetime_min}')) OR (date >= '{$datetime_min}')";
         $whereTrans["sejour_id"] = " = '{$this->_id}'";
         $this->_back["transmissions"] = $trans->loadList($whereTrans, "date DESC, transmission_medicale_id DESC");
         $obs = new CObservationMedicale();
         $whereObs = array();
         $whereObs[] = "(degre = 'high') OR (date >= '{$datetime_min}')";
         $whereObs["sejour_id"] = " = '{$this->_id}'";
         $this->_back["observations"] = $obs->loadList($whereObs);
     } else {
         $this->loadBackRefs("observations");
         $this->loadBackRefs("transmissions", "date DESC, transmission_medicale_id DESC");
     }
     $consultations = $this->loadRefsConsultations();
     $this->_ref_suivi_medical = array();
     if (isset($this->_back["observations"])) {
         CObservationMedicale::massLoadRefAlerte($this->_back["observations"]);
         foreach ($this->_back["observations"] as $curr_obs) {
             /** @var CObservationMedicale $curr_obs */
             $curr_obs->loadRefsFwd();
             $users[$curr_obs->user_id] = $curr_obs->_ref_user;
             if ($user_id && $curr_obs->user_id != $user_id) {
                 continue;
             }
             $curr_obs->_ref_user->loadRefFunction();
             $curr_obs->canEdit();
             $this->_ref_suivi_medical[$curr_obs->date . $curr_obs->_id . "obs"] = $curr_obs;
         }
     }
     if (isset($this->_back["transmissions"])) {
         $trans_compact = CAppUI::conf("soins Transmissions trans_compact", CGroups::loadCurrent()) && !$print;
         $list_trans = array();
         /** @var CTransmissionMedicale $curr_trans **/
         foreach ($this->_back["transmissions"] as $curr_trans) {
             $curr_trans->loadRefsFwd();
             $users[$curr_trans->user_id] = $curr_trans->_ref_user;
             if ($user_id && $curr_trans->user_id != $user_id) {
                 continue;
             }
             $curr_trans->calculCibles($cibles);
             if ($cible_trans && $curr_trans->_cible != $cible_trans) {
                 continue;
             }
             $list_trans[] = $curr_trans;
             $curr_trans->canEdit();
             $curr_trans->loadRefUser();
             if ($curr_trans->libelle_ATC) {
                 if (!isset($last_trans_cible[$curr_trans->libelle_ATC])) {
                     $last_trans_cible[$curr_trans->libelle_ATC] = $curr_trans;
                 }
             } else {
                 if (!isset($last_trans_cible["{$curr_trans->object_class} {$curr_trans->object_id}"])) {
                     $last_trans_cible["{$curr_trans->object_class} {$curr_trans->object_id}"] = $curr_trans;
                 }
             }
         }
         foreach ($list_trans as $_trans) {
             $sort_key_pattern = "{$_trans->_class} {$_trans->user_id} {$_trans->object_id} {$_trans->object_class} {$_trans->libelle_ATC}";
             $sort_key = "{$_trans->date} {$sort_key_pattern}";
             $date_before = CMbDT::dateTime("-1 SECOND", $_trans->date);
             $sort_key_before = "{$date_before} {$sort_key_pattern}";
             $date_after = CMbDT::dateTime("+1 SECOND", $_trans->date);
             $sort_key_after = "{$date_after} {$sort_key_pattern}";
             if ($_trans->libelle_ATC && $last_trans_cible[$_trans->libelle_ATC] != $_trans && ($last_trans_cible[$_trans->libelle_ATC]->locked || $trans_compact && !array_key_exists($sort_key, $_trans) && !array_key_exists($sort_key_before, $this->_ref_suivi_medical) && !array_key_exists($sort_key_after, $this->_ref_suivi_medical)) || $_trans->object_id && ($last_trans_cible["{$_trans->object_class} {$_trans->object_id}"]->locked || $trans_compact && !array_key_exists($sort_key, $this->_ref_suivi_medical) && !array_key_exists($sort_key_before, $this->_ref_suivi_medical) && !array_key_exists($sort_key_after, $this->_ref_suivi_medical)) && $last_trans_cible["{$_trans->object_class} {$_trans->object_id}"] != $_trans) {
                 continue;
             }
             // Aggrégation à -1 sec
             if (array_key_exists($sort_key_before, $this->_ref_suivi_medical)) {
                 $sort_key = $sort_key_before;
             } else {
                 if (array_key_exists($sort_key_after, $this->_ref_suivi_medical)) {
                     $sort_key = $sort_key_after;
                 }
             }
             if (!isset($this->_ref_suivi_medical[$sort_key])) {
                 $this->_ref_suivi_medical[$sort_key] = array("data" => array(), "action" => array(), "result" => array());
             }
             if (!isset($this->_ref_suivi_medical[$sort_key][0])) {
                 $this->_ref_suivi_medical[$sort_key][0] = $_trans;
             }
             $this->_ref_suivi_medical[$sort_key][$_trans->type][] = $_trans;
         }
     }
     CStoredObject::massLoadBackRefs($consultations, "consult_anesth");
     foreach ($consultations as $_consultation) {
         $_consultation->canEdit();
         $_consultation->loadRefConsultAnesth();
         $unset = false;
         foreach ($_consultation->_refs_dossiers_anesth as $_dossier_anesth) {
             $_dossier_anesth->loadRefOperation();
             $_dossier_anesth->loadRefsTechniques();
             // Retrait des dossiers d'anesthésie non liés à une intervention du séjour
             if (!$_dossier_anesth->operation_id) {
                 $unset = true;
                 continue;
             }
         }
         if ($unset) {
             continue;
         }
         $_consultation->loadRefPlageConsult();
         $_consultation->loadRefPraticien()->loadRefFunction();
         $this->_ref_suivi_medical[$_consultation->_guid . $_consultation->_datetime] = $_consultation;
     }
     if (CModule::getActive("dPprescription") && $this->type == "urg" && CAppUI::conf("dPprescription CPrescription prescription_suivi_soins", CGroups::loadCurrent())) {
         $this->loadRefPrescriptionSejour();
         $prescription = $this->_ref_prescription_sejour;
         // Chargement des lignes de prescriptions d'elements
         $prescription->loadRefsLinesElement();
         $prescription->loadRefsLinesAllComments();
         foreach ($prescription->_ref_prescription_lines_all_comments as $_comment) {
             $_comment->canEdit();
             $_comment->countBackRefs("transmissions");
             $this->_ref_suivi_medical["{$_comment->debut} {$_comment->time_debut} {$_comment->_guid}"] = $_comment;
         }
         // Ajout des lignes de prescription dans la liste du suivi de soins
         foreach ($prescription->_ref_prescription_lines_element as $_line_element) {
             $_line_element->canEdit();
             $_line_element->countBackRefs("transmissions");
             $this->_ref_suivi_medical["{$_line_element->debut} {$_line_element->time_debut} {$_line_element->_guid}"] = $_line_element;
         }
     }
     krsort($this->_ref_suivi_medical);
     return $this->_ref_suivi_medical;
 }