/**
 * $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++;
    }
}
 /**
  * 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);
 }
Example #3
0
 /**
  * Compte les observations de visite du praticien responsable
  *
  * @param date       $date A une date donnée, maintenant si null
  * @param CMediusers $user User courant
  *
  * @return int
  */
 function countNotificationVisite($date = null, $user)
 {
     if (!$date) {
         $date = CMbDT::date();
     }
     $observation = new CObservationMedicale();
     $where = array();
     $where["sejour_id"] = " = '{$this->_id}'";
     $where["user_id"] = " = '{$user->user_id}'";
     $where["degre"] = " = 'info'";
     $where["date"] = " LIKE '{$date}%'";
     return $observation->countList($where);
 }