/**
  * Load context
  *
  * @return CConsultation|CSejour|CPatient
  */
 function loadRefContext()
 {
     if ($this->context_class && $this->context_id) {
         $this->_ref_context = new $this->context_class();
         $this->_ref_context = $this->_ref_context->getCached($this->context_id);
     }
 }
Exemple #2
0
 /**
  * @see parent::fillLimitedTemplate()
  */
 function fillLimitedTemplate(&$template)
 {
     $this->loadRefConsult();
     $this->_ref_consult->loadRefPraticien();
     $this->notify("BeforeFillLimitedTemplate", $template);
     // Duplication des champs de la consultation
     $template->addProperty("RPU - Consultation - Praticien nom", $this->_ref_consult->_ref_praticien->_user_first_name);
     $template->addProperty("RPU - Consultation - Praticien prénom", $this->_ref_consult->_ref_praticien->_user_last_name);
     $template->addProperty("RPU - Consultation - Motif", $this->_ref_consult->motif);
     $template->addProperty("RPU - Consultation - Remarques", $this->_ref_consult->rques);
     $template->addProperty("RPU - Consultation - Examen", $this->_ref_consult->examen);
     $template->addProperty("RPU - Consultation - Traitement", $this->_ref_consult->traitement);
     $template->addProperty("RPU - Diagnostic infirmier", $this->diag_infirmier);
     $template->addProperty("RPU - Prise en charge douleur", $this->pec_douleur);
     $template->addProperty("RPU - PeC Transport", $this->getFormattedValue("pec_transport"));
     $template->addProperty("RPU - Motif", $this->motif);
     $template->addProperty("RPU - CCMU", $this->getFormattedValue("ccmu"));
     $template->addProperty("RPU - Code GEMSA", $this->getFormattedValue("gemsa"));
     $template->addDateTimeProperty("RPU - Départ Radio", $this->radio_debut);
     $template->addDateTimeProperty("RPU - Retour Radio", $this->radio_fin);
     $template->addDateTimeProperty("RPU - Dépôt Biologie", $this->bio_depart);
     $template->addDateTimeProperty("RPU - Réception Biologie", $this->bio_retour);
     $template->addDateTimeProperty("RPU - Attente spécialiste", $this->specia_att);
     $template->addDateTimeProperty("RPU - Arrivée spécialiste", $this->specia_arr);
     $template->addProperty("RPU - Accident du travail", $this->getFormattedValue("date_at"));
     $libelle_at = $this->date_at ? "Accident du travail du " . $this->getFormattedValue("date_at") : "";
     $template->addProperty("RPU - Libellé accident du travail", $libelle_at);
     $template->addProperty("RPU - Sortie autorisée", $this->getFormattedValue("sortie_autorisee"));
     $lit = new C**t();
     if ($this->box_id) {
         $lit->load($this->box_id);
     }
     $template->addProperty("RPU - Box", $lit->_view);
     if (CAppUI::conf("dPurgences old_rpu") == "1") {
         if (CModule::getActive("sherpa")) {
             $template->addProperty("RPU - Soins pour trauma", $this->getFormattedValue("urtrau"));
             $template->addProperty("RPU - Cause du transfert", $this->getFormattedValue("urmuta"));
         }
         $template->addProperty("RPU - Type de pathologie", $this->getFormattedValue("type_pathologie"));
     } else {
         $template->addProperty("RPU - Orientation", $this->getFormattedValue("orientation"));
     }
     if (CModule::getActive("forms")) {
         CExObject::addFormsToTemplate($template, $this, "RPU");
     }
     $this->notify("AfterFillLimitedTemplate", $template);
 }
 /**
  * Return a object concern praticien and a patient in date
  *
  * @param Date   $date         Date
  * @param String $praticien_id Praticien id
  * @param String $patient_id   Patient id
  *
  * @return CConsultation|COperation|null
  */
 function getObject($date, $praticien_id, $patient_id)
 {
     $intervention = new COperation();
     $where = array("plagesop.date" => "= '{$date}'", "operations.chir_id" => "= '{$praticien_id}'", "sejour.patient_id" => "= '{$patient_id}'");
     $leftjoin = array("plagesop" => "operations.plageop_id = plagesop.plageop_id", "sejour" => "operations.sejour_id = sejour.sejour_id");
     $intervention->loadObject($where, "plagesop.debut DESC", null, $leftjoin);
     $object = $intervention;
     if (!$object->_id) {
         $consultation = new CConsultation();
         $where = array("plageconsult.date" => "= '{$date}'", "plageconsult.chir_id" => "= '{$praticien_id}'", "consultation.patient_id" => "= '{$patient_id}'");
         $leftjoin = array("plageconsult" => "consultation.plageconsult_id = plageconsult.plageconsult_id");
         $consultation->loadObject($where, "consultation.heure DESC", null, $leftjoin);
         $object = $consultation;
         if (!$object->_id) {
             return null;
         }
     }
     return $object;
 }
$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
$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();
$listChir = CConsultation::loadPraticiens(PERM_EDIT);
if (!$userSel->isMedical()) {
    CAppUI::setMsg("Vous devez selectionner un professionnel de santé", UI_MSG_ALERT);
    CAppUI::redirect("m=dPcabinet&tab=0");
}
$canUserSel->needsEdit();
$selConsult = CValue::getOrSession("selConsult", 0);
$dossier_anesth_id = CValue::getOrSession("dossier_anesth_id", 0);
if (isset($_GET["date"])) {
    $selConsult = null;
    CValue::setSession("selConsult", 0);
}
$anesth = new CTypeAnesth();
$anesth = $anesth->loadGroupList();
// Consultation courante
$consult = new CConsultation();
$consult->_ref_chir = $userSel;
if ($selConsult) {
    $consult->load($selConsult);
    CCanDo::checkObject($consult);
    $canConsult = $consult->canDo();
    $canConsult->needsEdit();
    $consult->loadRefConsultAnesth();
    $consult->loadRefPlageConsult();
    if (isset($consult->_refs_dossiers_anesth[$dossier_anesth_id])) {
        $consult->_ref_consult_anesth = $consult->_refs_dossiers_anesth[$dossier_anesth_id];
        $consult->_ref_consult_anesth->loadRefs();
        $sejour =& $consult->_ref_consult_anesth->_ref_sejour;
        if ($consult->_ref_consult_anesth->_ref_operation->operation_id) {
            if ($consult->_ref_consult_anesth->_ref_operation->passage_uscpo === null) {
                $consult->_ref_consult_anesth->_ref_operation->passage_uscpo = "";
$slot_id = CValue::get("slot_id");
$heure = CValue::get("heure");
$multiple = CValue::get("multipleMode", false);
$display_nb_consult = CAppUI::conf("dPcabinet display_nb_consult");
$quotas = null;
// Récupération des consultations de la plage séléctionnée
$plage = new CPlageconsult();
if ($plageconsult_id) {
    $plage->load($plageconsult_id);
    $plage->loadRefsNotes();
    $date = $plage->date;
} else {
    $date = CValue::get("date", CMbDT::date());
}
// consultation précise
$consultation_target = new CConsultation();
if ($consult_id) {
    $consultation_target->load($consult_id);
} elseif ($heure) {
    $consultation_target->heure = $heure;
}
$consultation_target->loadRefElementPrescription();
// Chargement des places disponibles
$listPlace = array();
$listBefore = array();
$listAfter = array();
$next_plage = $previous_plage = new CPlageconsult();
$function_id = null;
if ($plageconsult_id) {
    if (!$plage->plageconsult_id) {
        $plage->load($plageconsult_id);
<?php

/**
 * $Id: httpreq_vw_list_techniques_comp.php 24480 2014-08-20 10:51:06Z flaviencrochard $
 *
 * @package    Mediboard
 * @subpackage Cabinet
 * @author     SARL OpenXtrem <*****@*****.**>
 * @license    GNU General Public License, see http://www.gnu.org/licenses/gpl.html
 * @version    $Revision: 24480 $
 */
CCanDo::checkEdit();
$selConsult = CValue::getOrSession("selConsult", 0);
$dossier_anesth_id = CValue::getOrSession("dossier_anesth_id", 0);
$consult = new CConsultation();
$consult->load($selConsult);
$consult->loadRefConsultAnesth($dossier_anesth_id);
$consult->_ref_consult_anesth->loadRefsBack();
// Création du template
$smarty = new CSmartyDP();
$smarty->assign("consult_anesth", $consult->_ref_consult_anesth);
$smarty->display("inc_consult_anesth/techniques_comp.tpl");
<?php

/**
 * $Id$
 * 
 * @package    Mediboard
 * @subpackage dPcabinet
 * @author     SARL OpenXtrem <*****@*****.**>
 * @license    GNU General Public License, see http://www.gnu.org/licenses/gpl.html
 * @version    $Revision$
 */
$consultation_id = CValue::post("consultation_id");
$plageconsult_id = CValue::post("plageconsult_id");
$heure = CValue::post("heure");
$consult = new CConsultation();
$consult->load($consultation_id);
$new_consult = new CConsultation();
$new_consult->plageconsult_id = $plageconsult_id;
$new_consult->heure = $heure;
$new_consult->chrono = CConsultation::PLANIFIE;
$new_consult->patient_id = $consult->patient_id;
$new_consult->categorie_id = $consult->categorie_id;
$msg = $new_consult->store();
if ($msg) {
    CAppUI::setMsg($msg, UI_MSG_ERROR);
} else {
    CAppUI::setMsg(CAppUI::tr("CConsultation-msg-create"), UI_MSG_OK);
}
echo CAppUI::getMsg();
CApp::rip();
 * @author     SARL OpenXtrem <*****@*****.**>
 * @license    GNU General Public License, see http://www.gnu.org/licenses/gpl.html
 * @version    $Revision: 19484 $
 */
CCanDo::checkEdit();
$consult_id = CValue::getOrSession("selConsult");
$user_id = CValue::getOrSession("chirSel");
$_is_anesth = CValue::get("_is_anesth");
// Utilisateur sélectionné
$user = CMediusers::get($user_id);
$canUser = $user->canDo();
$canUser->needsEdit();
// Liste des praticiens
$listPrats = CConsultation::loadPraticiens(PERM_EDIT);
// Consultation courante
$consult = new CConsultation();
$consult->load($consult_id);
$consult->loadRefConsultAnesth();
CCanDo::checkObject($consult);
$canConsult = $consult->canDo();
$canConsult->needsEdit();
$consult->loadRefPatient();
$consult->_ref_patient->loadRefPhotoIdentite();
$consult->loadRefPraticien()->loadRefFunction();
$consult->loadRefSejour();
if (CModule::getActive("maternite")) {
    $consult->loadRefGrossesse();
}
// Création du template
$smarty = new CSmartyDP();
$smarty->assign("_is_anesth", $_is_anesth);
<?php

/**
 * $Id$
 *
 * @package    Mediboard
 * @subpackage Cabinet
 * @author     SARL OpenXtrem <*****@*****.**>
 * @license    GNU General Public License, see http://www.gnu.org/licenses/gpl.html
 * @version    $Revision$
 */
CCanDo::checkRead();
$consultation_id = CValue::getOrSession("consultation_id");
$dossier_anesth_id = CValue::getOrSession("dossier_anesth_id");
// Chargement de la consultation
$consult = new CConsultation();
$consult->load($consultation_id);
$consult->loadRefPlageConsult();
$consult->loadRefsFichesExamen();
$consult->_is_anesth = $consult->_ref_chir->isAnesth();
// Création du template
$smarty = new CSmartyDP();
$smarty->assign("consult", $consult);
$smarty->assign("dossier_anesth_id", $dossier_anesth_id);
$smarty->display("inc_examens_comp.tpl");
Exemple #11
0
$three_month_deb = CMbDT::date("-3 month", $month_fin);
$month_fin = CMbDT::date("-1 day", $month_fin);
$filter = new CConsultation();
$filter->_date_min = CMbDT::date();
$filter->_date_max = CMbDT::date("+ 0 day");
$filter->_etat_paiement = CValue::getOrSession("_etat_paiement", 0);
$filter->_type_affichage = CValue::getOrSession("_type_affichage", 0);
$filter_reglement = new CReglement();
$filter_reglement->mode = CValue::getOrSession("mode", 0);
// L'utilisateur est-il praticien ?
$mediuser = CMediusers::get();
$mediuser->loadRefFunction();
$is_praticien = $mediuser->isPraticien();
$is_admin = in_array(CUser::$types[$mediuser->_user_type], array("Administrator"));
$is_admin_or_secretaire = in_array(CUser::$types[$mediuser->_user_type], array("Administrator", "Secrétaire"));
$listPrat = CConsultation::loadPraticiensCompta();
$bloc = new CBlocOperatoire();
$blocs = $bloc->loadGroupList();
// Création du template
$smarty = new CSmartyDP();
$smarty->assign("filter", $filter);
$smarty->assign("filter_reglement", $filter_reglement);
$smarty->assign("mediuser", $mediuser);
$smarty->assign("is_praticien", $is_praticien);
$smarty->assign("is_admin_or_secretaire", $is_admin_or_secretaire);
$smarty->assign("listPrat", $listPrat);
$smarty->assign("now", $now);
$smarty->assign("yesterday", $yesterday);
$smarty->assign("week_deb", $week_deb);
$smarty->assign("week_fin", $week_fin);
$smarty->assign("month_deb", $month_deb);
Exemple #12
0
// function selected
$function_id = CValue::getOrSession("function_id");
$listFnc = array();
if ($function_id) {
    $listChir = CConsultation::loadPraticiens(PERM_EDIT, $function_id, null, true);
    foreach ($listChir as $_chir) {
        $_chir->loadRefFunction();
    }
} else {
    $listChir = CConsultation::loadPraticiens(PERM_EDIT);
}
// Liste des consultations a avancer si desistement
$ds = $plage->getDS();
$now = CMbDT::date();
// get desistements
$count_si_desistement = CConsultation::countDesistementsForDay($function_id ? array_keys($listChir) : array($chirSel), $now);
// Liste des praticiens
$fnc = new CFunctions();
$listFnc = $fnc->loadListWithPerms(PERM_READ, array("group_id" => " = '{$group->_id}' "), 'text');
$mediuser = new CMediusers();
foreach ($listFnc as $id => $_fnc) {
    $users = $mediuser->loadProfessionnelDeSanteByPref(PERM_READ, $_fnc->_id, null, true);
    if (!count($users)) {
        unset($listFnc[$id]);
    }
}
// if only one function and function_id
if (count($listFnc) == 1 && !$chirSel) {
    $function_id = reset($listFnc)->_id;
}
// Période
<?php

/**
 * $Id$
 *
 * @package    Mediboard
 * @subpackage Cabinet
 * @author     SARL OpenXtrem <*****@*****.**>
 * @license    GNU General Public License, see http://www.gnu.org/licenses/gpl.html
 * @version    $Revision$
 */
CCanDo::checkRead();
$consult_id = CValue::get("consult_id");
$sejour_id = CValue::get("sejour_id");
$consult = new CConsultation();
$consult->load($consult_id);
$consult->canDo();
if (!$consult->_id) {
    CAppUI::stepAjax(CAppUI::tr("CConsultation.none"));
    CApp::rip();
}
$patient = $consult->loadRefPatient();
$dossier_medical = $patient->loadRefDossierMedical();
$consult_anesth = $consult->loadRefConsultAnesth();
$consult->loadExtCodesCCAM();
$consult->getAssociationCodesActes();
$consult->loadPossibleActes();
$consult->_ref_chir->loadRefFunction();
$list_etat_dents = array();
if ($dossier_medical->_id) {
    $dossier_medical->canDo();
<?php

/**
 * $Id: do_change_prat_pec.php 24015 2014-07-17 08:47:12Z flaviencrochard $
 *
 * @package    Mediboard
 * @subpackage dPcabinet
 * @author     SARL OpenXtrem <*****@*****.**>
 * @license    GNU General Public License, see http://www.gnu.org/licenses/gpl.html
 * @version    $Revision: 24015 $
 */
$prat_id = CValue::post("prat_id");
$consult = new CConsultation();
$consult->load(CValue::post("consultation_id"));
$consult->loadRefPlageConsult();
$_datetime = $consult->_datetime;
if (!isset($current_m)) {
    $current_m = CValue::post("current_m", "dPcabinet");
}
$day_now = CMbDT::format($_datetime, "%Y-%m-%d");
$time_now = CMbDT::format($_datetime, "%H:%M:00");
$hour_now = CMbDT::format($_datetime, "%H:00:00");
$hour_next = CMbDT::time("+1 HOUR", $hour_now);
$plage = new CPlageconsult();
$plageBefore = new CPlageconsult();
$plageAfter = new CPlageconsult();
// Cas ou une plage correspond
$where = array();
$where["chir_id"] = "= '{$prat_id}'";
$where["date"] = "= '{$day_now}'";
$where["debut"] = "<= '{$time_now}'";
$filter->_non_pourvues = CValue::get("_non_pourvues", 1);
$filter->_print_ipp = CValue::get("_print_ipp", CAppUI::conf("dPcabinet CConsultation show_IPP_print_consult"));
$chir = CValue::getOrSession("chir");
$show_lit = false;
// On selectionne les plages
$plage = new CPlageconsult();
$where = array();
if ($filter->plageconsult_id) {
    $plage->load($filter->plageconsult_id);
    $filter->_date_min = $filter->_date_max = $plage->date;
    $filter->_ref_plageconsult = $plage;
    $where["plageconsult_id"] = "= '{$filter->plageconsult_id}'";
} else {
    $where["date"] = "BETWEEN '{$filter->_date_min}' AND '{$filter->_date_max}'";
    // Liste des praticiens
    $listPrat = CConsultation::loadPraticiens(PERM_EDIT);
    $where["chir_id"] = CSQLDataSource::prepareIn(array_keys($listPrat), $chir);
}
$order = array();
$order[] = "date";
$order[] = "chir_id";
$order[] = "debut";
/** @var CPlageconsult[] $listPlage */
$listPlage = $plage->loadList($where, $order);
// Pour chaque plage on selectionne les consultations
foreach ($listPlage as $plage) {
    $plage->listPlace = array();
    $plage->listPlace2 = array();
    $plage->listBefore = array();
    $plage->listAfter = array();
    $plage->listHorsPlace = array();
<?php

/**
 * $Id$
 *
 * @package    Mediboard
 * @subpackage Cabinet
 * @author     SARL OpenXtrem <*****@*****.**>
 * @license    GNU General Public License, see http://www.gnu.org/licenses/gpl.html
 * @version    $Revision$
 */
CCanDo::checkEdit();
$selConsult = CValue::getOrSession("selConsult", 0);
$consult = new CConsultation();
$consult->load($selConsult);
$consult->loadRefsBack();
// Création du template
$smarty = new CSmartyDP();
$smarty->assign("consult", $consult);
$smarty->display("exam_comp.tpl");
Exemple #17
0
}
// Chargement des categories
$categorie = new CConsultationCategorie();
$whereCategorie["function_id"] = " = '{$chir->function_id}'";
$orderCategorie = "nom_categorie ASC";
/** @var CConsultationCategorie[] $categories */
$categories = $categorie->loadList($whereCategorie, $orderCategorie);
// Creation du tableau de categories simplifié pour le traitement en JSON
$listCat = array();
foreach ($categories as $_categorie) {
    $listCat[$_categorie->_id] = array("nom_icone" => $_categorie->nom_icone, "duree" => $_categorie->duree, "commentaire" => utf8_encode($_categorie->commentaire));
}
// Ajout du motif de la consultation passé en parametre
if (!$consult->_id && $consult_urgence_id) {
    // Chargement de la consultation de passage aux urgences
    $consultUrgence = new CConsultation();
    $consultUrgence->load($consult_urgence_id);
    $consultUrgence->loadRefSejour();
    $consultUrgence->_ref_sejour->loadRefRPU();
    $consult->motif = "Reconvocation suite à un passage aux urgences, {$consultUrgence->_ref_sejour->_ref_rpu->motif}";
}
// Locks sur le rendez-vous
$consult->_locks = null;
$today = CMbDT::date();
if ($consult->_id) {
    if ($consult->_datetime < $today) {
        $consult->_locks[] = "datetime";
    }
    if ($consult->chrono == CConsultation::TERMINE && !$consult->annule) {
        $consult->_locks[] = "termine";
    }
Exemple #18
0
<?php

/**
 * $Id: vw_dossier.php 24981 2014-09-26 09:53:05Z nicolasld $
 *
 * @package    Mediboard
 * @subpackage Cabinet
 * @author     SARL OpenXtrem <*****@*****.**>
 * @license    GNU General Public License, see http://www.gnu.org/licenses/gpl.html
 * @version    $Revision: 24981 $
 */
CCanDo::checkEdit();
$pat_id = CValue::getOrSession("patSel");
// Liste des Praticiens
$listPrat = CConsultation::loadPraticiens(PERM_READ);
$patient = new CPatient();
$patient->load($pat_id);
// Chargement des références du patient
if ($pat_id) {
    // Infos patient complètes (tableau de droite)
    $patient->loadDossierComplet();
    $patient->countINS();
    /*
    foreach ($patient->_ref_consultations as $key => $value) {
      if (!array_key_exists($value->_ref_plageconsult->chir_id, $listPrat)) {
          unset($patient->_ref_consultations[$key]);
      }
    }
    
    foreach ($patient->_ref_sejours as $key => $sejour) {
      if (!array_key_exists($sejour->praticien_id, $listPrat)) {
Exemple #19
0
 /**
  * Charge les consultations du patient
  *
  * @param array|null $where [optional] Clauses SQL
  *
  * @return CConsultation[]
  */
 function loadRefsConsultations($where = null)
 {
     $consultation = new CConsultation();
     $group_id = CGroups::loadCurrent()->_id;
     $curr_user = CAppUI::$user;
     if ($this->_id) {
         if ($where === null) {
             $where = array();
         }
         if (!$curr_user->isAdmin()) {
             $where[] = "functions_mediboard.consults_partagees = '1' ||\r\n                    (functions_mediboard.consults_partagees = '0' && functions_mediboard.function_id = '{$curr_user->function_id}')";
         }
         $where["patient_id"] = "= '{$this->_id}'";
         if (CAppUI::conf("dPpatients CPatient multi_group") == "hidden") {
             $where["functions_mediboard.group_id"] = "= '{$group_id}'";
         }
         $order = "plageconsult.date DESC, consultation.heure DESC";
         $leftjoin = array();
         $leftjoin["plageconsult"] = "consultation.plageconsult_id = plageconsult.plageconsult_id";
         $leftjoin["users_mediboard"] = "plageconsult.chir_id = users_mediboard.user_id";
         $leftjoin["functions_mediboard"] = "users_mediboard.function_id = functions_mediboard.function_id";
         return $this->_ref_consultations = $consultation->loadList($where, $order, null, null, $leftjoin);
     }
     return $this->_ref_consultations = array();
 }
 /**
  * Récupération du séjour par le numéro de visite
  *
  * @param CSejour $newVenue Admit
  * @param array   $data     Datas
  *
  * @return bool
  */
 function getSejourByVisitNumber(CSejour $newVenue, $data)
 {
     $sender = $this->_ref_sender;
     $venueVN = CValue::read($data['admitIdentifiers'], "VN");
     $where = $ljoin = array();
     $where["id_sante400.tag"] = " = '{$sender->_tag_visit_number}'";
     $where["id_sante400.id400"] = " = '{$venueVN}'";
     switch ($this->queryTextNode("PV1.2", $data["PV1"])) {
         // Identifie la venue pour actes et consultation externe
         case 'O':
             $consultation = new CConsultation();
             $ljoin["id_sante400"] = "id_sante400.object_id = consultation.consultation_id";
             $where["id_sante400.object_class"] = " = 'CConsultation'";
             $where["consultation.type"] = " != 'chimio'";
             $consultation->loadObject($where, null, null, $ljoin);
             // Nécessaire pour savoir quel objet créé en cas de besoin
             $this->_object_found_by_vn = $consultation;
             if (!$consultation->_id) {
                 return false;
             }
             $newVenue->load($consultation->sejour_id);
             return true;
             // Identifie une séance
         // Identifie une séance
         case 'R':
             $consultation = new CConsultation();
             $ljoin["id_sante400"] = "id_sante400.object_id = consultation.consultation_id";
             $where["id_sante400.object_class"] = " = 'CConsultation'";
             $where["consultation.type"] = " = 'chimio'";
             $consultation->loadObject($where, null, null, $ljoin);
             // Nécessaire pour savoir quel objet créé en cas de besoin
             $this->_object_found_by_vn = $consultation;
             if (!$consultation->_id) {
                 return false;
             }
             $newVenue->load($consultation->sejour_id);
             return true;
             // Identifie le n° de passage aux urgences
         // Identifie le n° de passage aux urgences
         case 'E':
             $rpu = new CRPU();
             $ljoin["id_sante400"] = "id_sante400.object_id = rpu.rpu_id";
             $where["id_sante400.object_class"] = " = 'CRPU'";
             $rpu->loadObject($where, null, null, $ljoin);
             // Nécessaire pour savoir quel objet créé en cas de besoin
             $this->_object_found_by_vn = $rpu;
             if (!$rpu->_id) {
                 return false;
             }
             $newVenue->load($rpu->sejour_id);
             return true;
             // Identifie le séjour ou hospitalisation à domicile
         // Identifie le séjour ou hospitalisation à domicile
         default:
             $idexVisitNumber = CIdSante400::getMatch("CSejour", $sender->_tag_visit_number, $venueVN);
             $this->_object_found_by_vn = $newVenue;
             if (!$idexVisitNumber->_id) {
                 return false;
             }
             $newVenue->load($idexVisitNumber->object_id);
             $this->_object_found_by_vn = $newVenue;
             return true;
     }
 }
    $filter->_type_affichage = 1;
}
if ($filter->_type_affichage == "totaux") {
    $filter->_type_affichage = 0;
}
$ljoin = array();
$where = array();
// Filtre sur les dates
$where["reglement.date"] = "BETWEEN '{$filter->_date_min}' AND '{$filter->_date_max} 23:59:59'";
// Filtre sur les modes de paiement
if ($filter->_mode_reglement) {
    $where["reglement.mode"] = "= '{$filter->_mode_reglement}'";
}
// Filtre sur les praticiens
$chir_id = CValue::getOrSession("chir");
$listPrat = CConsultation::loadPraticiensCompta($chir_id);
// Chargement des règlements via les factures
$ljoin["facture_cabinet"] = "reglement.object_id = facture_cabinet.facture_id";
if (!$all_group_compta) {
    $where["facture_cabinet.group_id"] = "= '" . CGroups::loadCurrent()->_id . "'";
}
$where["facture_cabinet.praticien_id"] = CSQLDataSource::prepareIn(array_keys($listPrat));
$where["reglement.object_class"] = " = 'CFactureCabinet'";
$reglement = new CReglement();
/** @var CReglement[] $reglements */
$reglements = $reglement->loadList($where, " facture_cabinet.facture_id, reglement.date", null, null, $ljoin);
$reglement = new CReglement();
// Calcul du récapitulatif
// Initialisation du tableau de reglements
$recapReglement["total"] = array("nb_consultations" => "0", "du_patient" => "0", "du_tiers" => "0", "nb_reglement_patient" => "0", "nb_reglement_tiers" => "0", "secteur1" => "0", "secteur2" => "0", "secteur3" => "0", "du_tva" => "0");
foreach (array_merge($reglement->_specs["mode"]->_list, array("")) as $_mode) {
<?php

/**
 * $Id$
 *
 * @package    Mediboard
 * @subpackage Cabinet
 * @author     SARL OpenXtrem <*****@*****.**>
 * @license    GNU General Public License, see http://www.gnu.org/licenses/gpl.html
 * @version    $Revision$
 */
CCanDo::checkRead();
$consult_id = CValue::get("consult_id");
$group_id = CGroups::loadCurrent()->_id;
$consult = new CConsultation();
$consult->load($consult_id);
$consult->loadRefPlageConsult();
// next consultations
$dateW = $consult->_ref_plageconsult->date;
$whereN = array();
$ljoin = array();
$ljoin["plageconsult"] = "plageconsult.plageconsult_id = consultation.plageconsult_id";
$whereN["patient_id"] = " = '{$consult->patient_id}'";
$whereN["plageconsult.date"] = " >= '{$dateW}'";
$whereN["heure"] = " >= '{$consult->heure}'";
/** @var CConsultation[] $consults */
$consults = $consult->loadListWithPerms(PERM_READ, $whereN, null, null, null, $ljoin);
foreach ($consults as $_consult) {
    $_consult->loadRefPraticien()->loadRefFunction();
    $_consult->loadRefSejour();
}
Exemple #23
0
<?php

/**
 * $Id$
 *  
 * @category Urgences
 * @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();
$consult_id = CValue::get("consult_id");
$consult = new CConsultation();
$consult->load($consult_id);
$consult->loadRefPlageConsult();
$sejour = $consult->loadRefSejour();
$rpu = $sejour->loadRefRPU();
$services = array();
$list_mode_sortie = null;
if ($rpu && $rpu->_id) {
    // Mise en session du rpu_id
    $_SESSION["dPurgences"]["rpu_id"] = $rpu->_id;
    $rpu->loadRefSejourMutation();
    $affectation = $sejour->loadRefCurrAffectation();
    $affectation->loadRefService();
    // Urgences pour un séjour "urg"
    if ($sejour->type == "urg") {
        $services = CService::loadServicesUrgence();
    }
$ljoin["plageconsult"] = "plageconsult.plageconsult_id = consultation.plageconsult_id";
$where = array();
$where["sejour.entree"] = " BETWEEN '{$debut}' AND '{$fin}'";
$where["sejour.annule"] = "= '0'";
$where["consultation.annule"] = "= '0'";
if (!$interv_with_no_codes) {
    $where[] = "LENGTH(consultation.codes_ccam) > 0";
}
if ($all_prats) {
    $prats = $user->loadPraticiens(PERM_READ);
    $where["plageconsult.chir_id"] = CSQLDataSource::prepareIn(array_keys($prats));
} else {
    $where["plageconsult.chir_id"] = "= '{$user->_id}'";
}
/* @var CConsultation[] $consultations*/
$consultation = new CConsultation();
$consultations = $consultation->loadList($where, null, null, null, $ljoin);
$totals["consultations"] = count($consultations);
/** @var CPlageConsult[] $plages */
$plages = CStoredObject::massLoadFwdRef($consultations, "plageconsult_id");
CStoredObject::massLoadFwdRef($consultations, "sejour_id");
CStoredObject::massLoadFwdRef($consultations, "patient_id");
// Pré-chargement des users
$where = array("user_id" => CSQLDataSource::prepareIn(CMbArray::pluck($plages, "chir_id")));
$user->loadList($where);
/** @var CMediusers[] $chirs */
$chirs = CStoredObject::massLoadFwdRef($plages, "chir_id");
CStoredObject::massLoadFwdRef($chirs, "function_id");
CStoredObject::massLoadBackRefs($consultations, "actes_ccam");
foreach ($consultations as $key => $_consult) {
    // Chargemement des codes CCAM
<?php

/**
 * Liste des consultations du jour du tableau de bord
 *
 * @category Maternite
 * @package  Mediboard
 * @author   SARL OpenXtrem <*****@*****.**>
 * @license  GNU General Public License, see http://www.gnu.org/licenses/gpl.html
 * @version  SVN: $Id:$
 * @link     http://www.mediboard.org
 */
CCanDo::checkRead();
$date = CValue::get("date", CMbDT::date());
$group = CGroups::loadCurrent();
$consultation = new CConsultation();
$where = array();
$where["consultation.grossesse_id"] = "IS NOT NULL";
$where["plageconsult.date"] = "= '{$date}'";
$where["group_id"] = " = '{$group->_id}'";
$ljoin = array();
$ljoin["plageconsult"] = "plageconsult.plageconsult_id = consultation.plageconsult_id";
$ljoin["users_mediboard"] = "plageconsult.chir_id = users_mediboard.user_id";
$ljoin["functions_mediboard"] = "functions_mediboard.function_id = users_mediboard.function_id";
$order = "heure ASC";
/** @var CConsultation[] $listConsults */
$listConsults = $consultation->loadList($where, $order, null, null, $ljoin);
$plage = CMbObject::massLoadFwdRef($listConsults, "plageconsult_id");
CMbObject::massLoadFwdRef($plage, "chir_id");
CMbObject::massLoadFwdRef($listConsults, "sejour_id");
$grossesses = CMbObject::massLoadFwdRef($listConsults, "grossesse_id");
    CPrescription::$_load_lite = false;
}
$smarty->assign("represcription", CValue::get("represcription", 0));
$smarty->assign("date", $date);
$smarty->assign("hour", $hour);
$smarty->assign("vue", $vue);
$smarty->assign("today", $today);
$smarty->assign("now", $now);
$smarty->assign("_is_anesth", $consult->_is_anesth);
$smarty->assign("consult_anesth", $consultAnesth);
$smarty->assign("_is_dentiste", $consult->_is_dentiste);
$smarty->assign("current_m", $current_m);
$smarty->assign("userSel", $userSel);
$smarty->assign("dossier_medical", $dossier_medical);
$smarty->assign("antecedents", $dossier_medical->_ref_antecedents_by_type);
$smarty->assign("tabs_count", CConsultation::makeTabsCount($consult, $dossier_medical, $consultAnesth, $sejour, $list_etat_dents));
$smarty->assign("list_etat_dents", $list_etat_dents);
if ($consult->_is_dentiste) {
    $devenirs_dentaires = $consult->_ref_patient->loadRefsDevenirDentaire();
    foreach ($devenirs_dentaires as &$devenir_dentaire) {
        $etudiant = $devenir_dentaire->loadRefEtudiant();
        $etudiant->loadRefFunction();
        $actes_dentaires = $devenir_dentaire->countRefsActesDentaires();
    }
    $smarty->assign("devenirs_dentaires", $devenirs_dentaires);
}
if (count($consult->_refs_dossiers_anesth)) {
    $secs = range(0, 60 - 1, 1);
    $mins = range(0, 15 - 1, 1);
    $patient->loadRefLatestConstantes();
    $smarty->assign("secs", $secs);
    $where = array();
    $where["chir_id"] = "= '{$chir->_id}'";
    $tarifs["user"] = $tarif->loadList($where, $order);
    foreach ($tarifs["user"] as $_tarif) {
        /**@var CTarif $_tarif */
        $_tarif->getPrecodeReady();
    }
    $where = array();
    $where["function_id"] = "= '{$chir->function_id}'";
    $tarifs["func"] = $tarif->loadList($where, $order);
    foreach ($tarifs["func"] as $_tarif) {
        $_tarif->getPrecodeReady();
    }
    if (CAppui::conf("dPcabinet Tarifs show_tarifs_etab")) {
        $where = array();
        $where["group_id"] = "= '" . CGroups::loadCurrent()->_id . "'";
        $tarifs["group"] = $tarif->loadList($where, $order);
        foreach ($tarifs["group"] as $_tarif) {
            $_tarif->getPrecodeReady();
        }
    }
    $consult = new CConsultation();
    if ($consult_id) {
        $consult->load($consult_id);
    }
    $smarty = new CSmartyDP();
    $smarty->assign("consult", $consult);
    $smarty->assign("sejour", $sejour);
    $smarty->assign("tarifs", $tarifs);
    $smarty->display("inc_tarifs_sejour.tpl");
}
Exemple #28
0
/**
 * $Id: print_noemie.php 21346 2013-12-10 14:07:50Z rhum1 $
 *
 * @package    Mediboard
 * @subpackage Cabinet
 * @author     SARL OpenXtrem <*****@*****.**>
 * @license    GNU General Public License, see http://www.gnu.org/licenses/gpl.html
 * @version    $Revision: 21346 $
 */
CCanDo::checkRead();
// Récupération des paramètres
$filter = new CPlageconsult();
$filter->_date_min = CValue::getOrSession("_date_min", CMbDT::date());
$filter->_date_max = CValue::getOrSession("_date_max", CMbDT::date());
$consult = new CConsultation();
$where = array();
$ljoin["plageconsult"] = "consultation.plageconsult_id = plageconsult.plageconsult_id";
$where["consultation.du_tiers"] = "> 0";
$where["consultation.tiers_date_reglement"] = "IS NULL";
$where["plageconsult.date"] = "BETWEEN '{$filter->_date_min}' AND '{$filter->_date_max}'";
// Filtre sur les praticiens
$chir_id = CValue::getOrSession("chir");
$listPrat = CConsultation::loadPraticiensCompta($chir_id);
$where["plageconsult.chir_id"] = CSQLDataSource::prepareIn(array_keys($listPrat));
$order = "plageconsult.date";
/** @var CConsultation[] $listConsults */
$listConsults = $consult->loadList($where, $order, null, null, $ljoin);
$total = array("nb" => 0, "value" => 0);
foreach ($listConsults as $consult) {
    $consult->loadRefsFwd();
<?php

/**
 * $Id$
 *
 * @package    Mediboard
 * @subpackage Cabinet
 * @author     SARL OpenXtrem <*****@*****.**>
 * @license    GNU General Public License, see http://www.gnu.org/licenses/gpl.html
 * @version    $Revision$
 */
CCanDo::checkRead();
$consult_id = CValue::get("consult_id");
$consult = new CConsultation();
$consult->_id = $consult_id;
$consult->load();
$consult->loadRefPatient();
$consult->loadRefGrossesse();
$type = "";
switch ($consult->type_assurance) {
    case "classique":
        $type = "assurance_classique";
        break;
    case "at":
        $type = "accident_travail";
        break;
    case "smg":
        $type = "soins_medicaux_gratuits";
        break;
    case "maternite":
        $type = "maternite";
if (CAppUI::conf('dPccam CCodeCCAM use_new_association_rules')) {
    // Chargement des règles de codage
    $consult->loadRefsCodagesCCAM();
    foreach ($consult->_ref_codages_ccam as $_codages_by_prat) {
        foreach ($_codages_by_prat as $_codage) {
            $_codage->loadPraticien()->loadRefFunction();
            $_codage->loadActesCCAM();
            $_codage->getTarifTotal();
            foreach ($_codage->_ref_actes_ccam as $_acte) {
                $_acte->getTarif();
            }
        }
    }
}
$sejour = $consult->loadRefSejour();
if ($sejour->_id) {
    $sejour->loadExtDiagnostics();
    $sejour->loadDiagnosticsAssocies();
}
$listPrats = $listChirs = CConsultation::loadPraticiens(PERM_EDIT);
$listAnesths = CMediusers::get()->loadAnesthesistes();
$user = CMediusers::get();
$user->isPraticien();
$smarty = new CSmartyDP();
$smarty->assign("consult", $consult);
$smarty->assign("acte_ngap", $acte_ngap);
$smarty->assign("listPrats", $listPrats);
$smarty->assign("listChirs", $listChirs);
$smarty->assign("listAnesths", $listAnesths);
$smarty->assign('user', $user);
$smarty->display("inc_vw_actes.tpl");