/**
  * @see parent::store()
  */
 function store()
 {
     if (!$this->_id) {
         $this->group_id = CGroups::loadCurrent()->_id;
     }
     return parent::store();
 }
 /**
  * @see parent::generateEnteteMessageAcquittement()
  */
 function generateEnteteMessageAcquittement($statut, $codes = null, $commentaires = null)
 {
     $echg_hprim = $this->_ref_echange_hprim;
     $identifiant = $echg_hprim->_id ? str_pad($echg_hprim->_id, 6, '0', STR_PAD_LEFT) : "ES{$this->now}";
     $acquittementsServeurActivitePmsi = $this->addElement($this, $this->acquittement, null, "http://www.hprim.org/hprimXML");
     $this->addAttribute($acquittementsServeurActivitePmsi, "version", CAppUI::conf("hprimxml {$this->evenement} version"));
     $enteteMessageAcquittement = $this->addElement($acquittementsServeurActivitePmsi, "enteteMessage");
     $this->addAttribute($enteteMessageAcquittement, "statut", $statut);
     $this->addElement($enteteMessageAcquittement, "identifiantMessage", $identifiant);
     $this->addDateTimeElement($enteteMessageAcquittement, "dateHeureProduction");
     $emetteur = $this->addElement($enteteMessageAcquittement, "emetteur");
     $agents = $this->addElement($emetteur, "agents");
     $this->addAgent($agents, "application", "MediBoard", "Gestion des Etablissements de Santé");
     $group = CGroups::loadCurrent();
     $group->loadLastId400();
     $this->addAgent($agents, $this->getAttSysteme(), CAppUI::conf('mb_id'), $group->text);
     $echg_hprim->loadRefsInteropActor();
     // Pour un acquittement l'emetteur du message devient destinataire
     $destinataire = $this->addElement($enteteMessageAcquittement, "destinataire");
     $agents = $this->addElement($destinataire, "agents");
     $this->addAgent($agents, "application", $echg_hprim->_ref_sender->nom, $echg_hprim->_ref_sender->libelle);
     /* @todo Doit-on gérer le système du destinataire ? */
     //$this->addAgent($agents, "système", $group->_id, $group->text);
     $this->addElement($enteteMessageAcquittement, "identifiantMessageAcquitte", $this->_identifiant_acquitte);
 }
Пример #3
0
 /**
  * Construit le tag d'une venue en fonction des variables de configuration
  *
  * @param string $group_id Permet de charger l'id externe d'une venue pour un établissement donné si non null
  *
  * @return string
  */
 static function getTagVisitNumber($group_id = null)
 {
     // Pas de tag venue
     if (null == ($tag_visit_number = CAppUI::conf("smp tag_visit_number"))) {
         return;
     }
     // Permettre des id externes en fonction de l'établissement
     $group = CGroups::loadCurrent();
     if (!$group_id) {
         $group_id = $group->_id;
     }
     return str_replace('$g', $group_id, $tag_visit_number);
 }
Пример #4
0
 function doStore()
 {
     parent::doStore();
     $dialog = CValue::post("dialog");
     if ($dialog) {
         $this->redirectStore .= "&a=pat_selector&dialog=1&name=" . $this->_obj->nom . "&firstName=" . $this->_obj->prenom . "&useVitale=" . $this->_obj->_bind_vitale;
         if (CAppUI::conf("dPpatients CPatient auto_selected_patient", CGroups::loadCurrent())) {
             $this->redirectStore .= "&patient_id=" . $this->_obj->patient_id;
         }
     } else {
         $this->redirectStore .= "&m=dPpatients&tab=vw_idx_patients&id=" . $this->_obj->patient_id;
     }
 }
Пример #5
0
function loadSejourNonAffectes($where)
{
    global $listChirs, $listPats, $listFunctions;
    $group = CGroups::loadCurrent();
    $leftjoin = array("affectation" => "sejour.sejour_id = affectation.sejour_id");
    $where["sejour.group_id"] = "= '{$group->_id}'";
    $where[] = "affectation.affectation_id IS NULL";
    $sejourNonAffectes = new CSejour();
    $sejourNonAffectes = $sejourNonAffectes->loadList($where, null, null, null, $leftjoin);
    foreach ($sejourNonAffectes as $keySejour => $valSejour) {
        $sejour =& $sejourNonAffectes[$keySejour];
    }
    return $sejourNonAffectes;
}
Пример #6
0
 /**
  * count list of Op not linked to a plage
  *
  * @param date      $start    date de début
  * @param date|null $end      date de fin
  * @param array     $chir_ids chir targeted
  *
  * @return int number of HP found
  */
 static function countForDates($start, $end = null, $chir_ids = array())
 {
     $d_start = $start;
     $d_end = $end ? $end : $start;
     $op = new COperation();
     $ljoin = array();
     $ljoin["sejour"] = "sejour.sejour_id = operations.sejour_id";
     $where = array();
     if (count($chir_ids)) {
         $where["chir_id"] = CSQLDataSource::prepareIn($chir_ids);
     }
     $where["operations.plageop_id"] = "IS NULL";
     $where["operations.date"] = "BETWEEN '{$d_start}' AND '{$d_end}'";
     $where["operations.annulee"] = "= '0'";
     $where["sejour.group_id"] = "= '" . CGroups::loadCurrent()->_id . "'";
     /** @var COperation[] $listHorsPlage */
     return $op->countList($where, null, $ljoin);
 }
 /**
  * @see parent::send()
  */
 function send(CCompteRendu $docItem)
 {
     $object = $docItem->loadTargetObject();
     if ($object instanceof CConsultAnesth) {
         $object = $object->loadRefConsultation();
     }
     if ($object instanceof CPatient) {
         CAppUI::stepAjax("Impossible d'ajouter un document lié directement à un patient", UI_MSG_ERROR);
     }
     $receiver_hl7v3 = new CReceiverHL7v3();
     $receiver_hl7v3->actif = 1;
     $receiver_hl7v3->group_id = CGroups::loadCurrent()->_id;
     /** @var CReceiverHL7v3[] $receivers */
     $receivers = $receiver_hl7v3->loadMatchingList();
     foreach ($receivers as $_receiver) {
         $request = $_receiver->sendEventProvideAndRegisterDocumentSetRequest($docItem);
         mbTrace($request);
     }
 }
Пример #8
0
 /**
  * Get import function
  *
  * @return CFunctions
  */
 function getImportFunction()
 {
     static $function;
     if ($function) {
         return $function;
     }
     $function_name = CAppUI::conf($this->_import_function_name_conf);
     $function = new CFunctions();
     $function->text = $function_name;
     $function->loadMatchingObjectEsc();
     if (!$function->_id) {
         $function->group_id = CGroups::loadCurrent()->_id;
         $function->type = "cabinet";
         $function->compta_partagee = 0;
         $function->color = "#CCCCCC";
         if ($msg = $function->store()) {
             CAppUI::setMsg($msg, UI_MSG_WARNING);
         }
     }
     return $function;
 }
 /**
  * @see parent::generateEnteteMessageAcquittement
  */
 function generateEnteteMessageAcquittement($statut, $codes = null, $commentaires = null)
 {
     $commentaires = strip_tags($commentaires);
     $echg_hprim = $this->_ref_echange_hprim;
     $identifiant = isset($echg_hprim->_id) ? str_pad($echg_hprim->_id, 6, '0', STR_PAD_LEFT) : "ES{$this->now}";
     $acquittementsPatients = $this->addElement($this, "acquittementsPatients", null, "http://www.hprim.org/hprimXML");
     $enteteMessageAcquittement = $this->addElement($acquittementsPatients, "enteteMessageAcquittement");
     $this->addAttribute($enteteMessageAcquittement, "statut", $statut);
     $this->addElement($enteteMessageAcquittement, "identifiantMessage", $identifiant);
     $this->addDateTimeElement($enteteMessageAcquittement, "dateHeureProduction");
     $emetteur = $this->addElement($enteteMessageAcquittement, "emetteur");
     $agents = $this->addElement($emetteur, "agents");
     $this->addAgent($agents, "application", "MediBoard", "Gestion des Etablissements de Santé");
     $group = CGroups::loadCurrent();
     $group->loadLastId400();
     $this->addAgent($agents, $this->getAttSysteme(), CAppUI::conf('mb_id'), $group->text);
     if (!$echg_hprim->_ref_sender) {
         $echg_hprim->loadRefsInteropActor();
     }
     // Pour un acquittement l'emetteur du message devient destinataire
     $destinataire = $this->addElement($enteteMessageAcquittement, "destinataire");
     $agents = $this->addElement($destinataire, "agents");
     $this->addAgent($agents, "application", $echg_hprim->_ref_sender->nom, $echg_hprim->_ref_sender->libelle);
     /* @todo Doit-on gérer le système du destinataire ? */
     //$this->addAgent($agents, "système", $group->_id, $group->text);
     $this->addElement($enteteMessageAcquittement, "identifiantMessageAcquitte", $this->_identifiant_acquitte);
     if ($statut == "OK") {
         if (is_array($codes)) {
             $_codes = $_libelle_codes = "";
             foreach ($codes as $code) {
                 $_codes .= $code;
                 $_libelle_codes .= CAppUI::tr("hprimxml-error-{$code}");
             }
             $this->addObservation($enteteMessageAcquittement, $_codes, $_libelle_codes, $commentaires);
         } else {
             $this->addObservation($enteteMessageAcquittement, $codes, CAppUI::tr("hprimxml-error-{$codes}"), $commentaires);
         }
     }
 }
 /**
  * Trigger after event store
  *
  * @param CMbObject $mbObject Object
  *
  * @return void
  */
 function onAfterStore(CMbObject $mbObject)
 {
     if (!$this->isHandled($mbObject)) {
         return;
     }
     $receiver = $mbObject->_receiver;
     if (CGroups::loadCurrent()->_id != $receiver->group_id) {
         return;
     }
     if (!$receiver->isMessageSupported("CHPrimXMLEvenementsServeurIntervention")) {
         return;
     }
     /** @var COperation $operation */
     $operation = $mbObject;
     $sejour = $operation->_ref_sejour;
     $sejour->loadNDA($receiver->group_id);
     $patient = $sejour->loadRefPatient();
     $patient->loadIPP($receiver->group_id);
     // Chargement des actes du codable
     $operation->loadRefsActes();
     $this->sendEvenementPMSI("CHPrimXMLEvenementsServeurIntervention", $operation);
 }
 /**
  * Charge les listes de choix d'une classe pour un utilisateur, sa fonction et son établissement
  *
  * @param int    $user_id           identifiant de l'utilisateur
  * @param string $modeleType        classe ciblée
  * @param string $other_function_id autre fonction
  *
  * @return void
  */
 function loadHelpers($user_id, $modeleType, $other_function_id = "")
 {
     $compte_rendu = new CCompteRendu();
     $ds = $compte_rendu->getDS();
     // Chargement de l'utilisateur courant
     $currUser = CMediusers::get($user_id);
     $order = "name";
     // Where user_id
     $whereUser = array();
     $whereUser["user_id"] = $ds->prepare("= %", $user_id);
     $whereUser["class"] = $ds->prepare("= %", $compte_rendu->_class);
     // Where function_id
     $whereFunc = array();
     $whereFunc["function_id"] = $other_function_id ? "IN ({$currUser->function_id}, {$other_function_id})" : $ds->prepare("= %", $currUser->function_id);
     $whereFunc["class"] = $ds->prepare("= %", $compte_rendu->_class);
     // Where group_id
     $whereGroup = array();
     $group = CGroups::loadCurrent();
     $whereGroup["group_id"] = $ds->prepare("= %", $group->_id);
     $whereGroup["class"] = $ds->prepare("= %", $compte_rendu->_class);
     // Chargement des aides
     $aide = new CAideSaisie();
     /** @var CAideSaisie $aidesUser */
     $aidesUser = $aide->loadList($whereUser, $order, null, "aide_id");
     /** @var CAideSaisie $aidesFunc */
     $aidesFunc = $aide->loadList($whereFunc, $order, null, "aide_id");
     /** @var CAideSaisie $aidesGroup */
     $aidesGroup = $aide->loadList($whereGroup, $order, null, "aide_id");
     $this->helpers["Aide de l'utilisateur"] = array();
     foreach ($aidesUser as $aideUser) {
         if ($aideUser->depend_value_1 == $modeleType || $aideUser->depend_value_1 == "") {
             $this->helpers["Aide de l'utilisateur"][CMbString::htmlEntities($aideUser->name)] = CMbString::htmlEntities($aideUser->text);
         }
     }
     $this->helpers["Aide de la fonction"] = array();
     foreach ($aidesFunc as $aideFunc) {
         if ($aideFunc->depend_value_1 == $modeleType || $aideFunc->depend_value_1 == "") {
             $this->helpers["Aide de la fonction"][CMbString::htmlEntities($aideFunc->name)] = CMbString::htmlEntities($aideFunc->text);
         }
     }
     $this->helpers["Aide de l'établissement"] = array();
     foreach ($aidesGroup as $aideGroup) {
         if ($aideGroup->depend_value_1 == $modeleType || $aideGroup->depend_value_1 == "") {
             $this->helpers["Aide de l'établissement"][CMbString::htmlEntities($aideGroup->name)] = CMbString::htmlEntities($aideGroup->text);
         }
     }
 }
 /**
  * Get group host
  *
  * @param bool $get_id Only get the ID, not the object
  *
  * @return CGroups|int|null
  */
 static function getHostGroup($get_id = true)
 {
     if (isset(self::$_host_group)) {
         return $get_id ? self::$_host_group->_id : self::$_host_group;
     }
     $host_group_id = CAppUI::conf("dPstock host_group_id");
     if (!$host_group_id) {
         $host_group_id = CGroups::loadCurrent()->_id;
     }
     $group = new CGroups();
     $group->load($host_group_id);
     self::$_host_group = $group;
     if ($get_id) {
         return $group->_id;
     }
     return $group;
 }
Пример #13
0
 * $Id$
 *
 * @package    Mediboard
 * @subpackage PlanningOp
 * @author     SARL OpenXtrem <*****@*****.**>
 * @license    GNU General Public License, see http://www.gnu.org/licenses/gpl.html
 * @version    $Revision$
 */
global $can, $m, $tab;
CCanDo::checkRead();
$hors_plage = new CIntervHorsPlage();
if (!$hors_plage->canRead()) {
    $can->redirect();
}
// Toutes les salles des blocs
$listBlocs = CGroups::loadCurrent()->loadBlocs(PERM_READ);
// Les salles autorisées
$salle = new CSalle();
$listSalles = $salle->loadListWithPerms(PERM_READ);
// Liste des Etablissements selon Permissions
$etablissements = CMediusers::loadEtablissements(PERM_READ);
// Chargement des prestations
$prestations = CPrestation::loadCurrentList();
$operation_id = CValue::getOrSession("operation_id");
$chir_id = CAppUI::conf("dPplanningOp COperation use_session_praticien") ? CValue::getOrSession("chir_id") : CValue::get("chir_id");
$sejour_id = CValue::get("sejour_id");
$hour_urgence = CValue::get("hour_urgence");
$min_urgence = CValue::get("min_urgence");
$date_urgence = CValue::get("date_urgence");
$salle_id = CValue::get("salle_id");
$patient_id = CValue::get("pat_id");
Пример #14
0
// Chargement des boxes d'urgences
$boxes = array();
foreach (CService::loadServicesUHCD() as $service) {
    foreach ($service->_ref_chambres as $chambre) {
        foreach ($chambre->_ref_lits as $lit) {
            $boxes[$lit->_id] = $lit;
        }
    }
}
// Si admin sur le module urgences, alors modification autorisée du diagnostic
// infirmier depuis la main courante.
$module = new CModule();
$module->mod_name = "dPurgences";
$module->loadMatchingObject();
$admin_urgences = $module->canAdmin();
// Création du template
$smarty = new CSmartyDP();
$smarty->assign("boxes", $boxes);
$smarty->assign("order_col", $order_col);
$smarty->assign("order_way", $order_way);
$smarty->assign("listPrats", $listPrats);
$smarty->assign("listSejours", $listSejours);
$smarty->assign("uhcd_affichage", $uhcd_affichage);
$smarty->assign("medicalView", $medicalView);
$smarty->assign("date", $date);
$smarty->assign("date_before", $date_before);
$smarty->assign("today", CMbDT::date());
$smarty->assign("isImedsInstalled", CModule::getActive("dPImeds") && CImeds::getTagCIDC(CGroups::loadCurrent()));
$smarty->assign("admin_urgences", $admin_urgences);
$smarty->assign("type", "UHCD");
$smarty->display("inc_main_courante.tpl");
Пример #15
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) {
    $recapReglement[$_mode] = array("du_patient" => "0", "du_tiers" => "0", "nb_reglement_patient" => "0", "nb_reglement_tiers" => "0");
}
$listReglements = array();
$listConsults = array();
Пример #16
0
/**
 * import the patient file
 *
 * @param string   $file        path to the file
 * @param int      $start       start int
 * @param int      $count       number of iterations
 * @param resource $file_import file for report
 *
 * @return null
 */
function importFile($file, $start, $count, $file_import)
{
    $fp = fopen($file, 'r');
    $csv_file = new CCSVFile($fp);
    $csv_file->column_names = $csv_file->readLine();
    if ($start == 0) {
        $start++;
    } elseif ($start > 1) {
        $csv_file->jumpLine($start);
    }
    $group_id = CGroups::loadCurrent()->_id;
    $treated_line = 0;
    while ($treated_line < $count) {
        $treated_line++;
        $patient = new CPatient();
        $_patient = $csv_file->readLine(true);
        if (!$_patient) {
            CAppUI::stepAjax('Importation terminée', UI_MSG_OK);
            CApp::rip();
        }
        $patient->bind($_patient);
        $patient->loadFromIPP($group_id);
        if ($patient->_id) {
            $start++;
            continue;
        }
        $nom = $_patient['nom'] ? $_patient['nom'] : $_patient['nom_jeune_fille'];
        if (!$patient->nom) {
            if ($patient->nom_jeune_fille) {
                $patient->nom = $patient->nom_jeune_fille;
            } else {
                CMbDebug::log("Ligne #{$start} : Pas de nom");
                $start++;
                continue;
            }
        }
        $naissance = null;
        if ($patient->naissance) {
            $naissance = preg_replace('/(\\d{2})\\/(\\d{2})\\/(\\d{4})/', '\\3-\\2-\\1', $patient->naissance);
            $patient->naissance = $naissance;
        }
        $patient->repair();
        if (!$patient->naissance) {
            CMbDebug::log($_patient);
            CMbDebug::log("Ligne #{$start} : Date de naissance invalide ({$_patient['naissance']})");
            $start++;
            continue;
        }
        $patient->loadMatchingPatient();
        if (!$patient->_id) {
            $patient->bind($_patient);
            $patient->nom = $nom;
            $patient->naissance = $naissance;
            $patient->tel = preg_replace("/[^0-9]/", "", $patient->tel);
            $patient->tel_autre = preg_replace("/[^0-9]/", "", $patient->tel_autre);
            $patient->sexe = strtolower($patient->sexe);
            $patient->repair();
            if ($msg = $patient->store()) {
                CMbDebug::log($patient, null, true);
                CMbDebug::log("Ligne #{$start} :{$msg}");
                $start++;
                continue;
            }
        }
        $ipp = CIdSante400::getMatch($patient->_class, CPatient::getTagIPP($group_id), $patient->_IPP, $patient->_id);
        if ($ipp->_id && $ipp->id400 != $patient->_IPP) {
            CMbDebug::log("Ligne #{$start} : Ce patient possède déjà un IPP ({$ipp->id400})");
            $start++;
            continue;
        }
        if (!$ipp->_id) {
            if ($msg = $ipp->store()) {
                CMbDebug::log("Ligne #{$start} :{$msg}");
                $start++;
                continue;
            }
        }
        CAppUI::setMsg('CPatient-msg-create', UI_MSG_OK);
    }
    echo CAppUI::getMsg();
}
Пример #17
0
 /**
  * Apply the mode of identito vigilance
  *
  * @param String $string                  String
  * @param Bool   $firstname               Apply the lower and the capitalize
  * @param string $mode_identito_vigilance Identito-vigilance mode
  * @param bool   $anonyme                 Is anonyme
  *
  * @return string
  */
 static function applyModeIdentitoVigilance($string, $firstname = false, $mode_identito_vigilance = null, $anonyme = false)
 {
     $mode = $mode_identito_vigilance ? $mode_identito_vigilance : CAppUI::conf("dPpatients CPatient mode_identito_vigilance", CGroups::loadCurrent());
     switch ($mode) {
         case "medium":
             $result = CMbString::removeBanCharacter($string, true);
             $result = $firstname ? CMbString::capitalize(CMbString::lower($result)) : CMbString::upper($result);
             break;
         case "strict":
             $result = CMbString::upper(CMbString::removeBanCharacter($string, $anonyme));
             break;
         default:
             $result = $firstname ? CMbString::capitalize(CMbString::lower($string)) : CMbString::upper($string);
     }
     return $result;
 }
Пример #18
0
<?php

/**
 * dPbloc
 *  
 * @category Bloc
 * @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::checkEdit();
$type_ressource_id = CValue::getOrSession("type_ressource_id");
$type_ressource = new CTypeRessource();
$type_ressource->group_id = CGroups::loadCurrent()->_id;
/** @var CTypeRessource[] $type_ressources */
$type_ressources = $type_ressource->loadMatchingList("libelle");
foreach ($type_ressources as $_type_ressource) {
    $_type_ressource->loadRefsRessources();
}
$smarty = new CSmartyDP();
$smarty->assign("type_ressource_id", $type_ressource_id);
$smarty->assign("type_ressources", $type_ressources);
$smarty->display("inc_list_type_ressources.tpl");
Пример #19
0
 /**
  * Récupération des salles activers pour les stats
  *
  * @param int $salle_id Limitation du retour à une seule salle
  * @param int $bloc_id  Limitation du retour à un seul bloc
  *
  * @return self[]
  */
 static function getSallesStats($salle_id = null, $bloc_id = null)
 {
     $group_id = CGroups::loadCurrent()->_id;
     $where = array();
     $where['stats'] = " = '1'";
     $ljoin = array();
     if ($salle_id) {
         $where['salle_id'] = " = '{$salle_id}'";
     } elseif ($bloc_id) {
         $where['bloc_id'] = "= '{$bloc_id}'";
     } else {
         $where['bloc_operatoire.group_id'] = "= '{$group_id}'";
         $ljoin['bloc_operatoire'] = 'bloc_operatoire.bloc_operatoire_id = sallesbloc.bloc_id';
     }
     $salle = new self();
     return $salle->loadList($where, null, null, null, $ljoin);
 }
Пример #20
0
        // Total des hospitalisations (Ambu + autres)
        if ($_prat->_id == $_sejour->_ref_praticien->_id) {
            $totalPrat[$_prat->_id]["total"] = $totalPrat[$_prat->_id]["ambu"] + $totalPrat[$_prat->_id]["hospi"];
            $totalMedecin++;
        }
    }
}
// Calcul des patients par service
// Calcul du nombre d'affectations a la date $date
$affectation = new CAffectation();
$whereAffect = array();
$ljoin = array();
$whereAffect["affectation.entree"] = "<= '{$dateEntree}'";
$whereAffect["affectation.sortie"] = ">= '{$dateSortie}'";
$whereAffect["affectation.sejour_id"] = "!= '0'";
$whereAffect["sejour.group_id"] = "= '" . CGroups::loadCurrent()->_id . "'";
$ljoin["sejour"] = "sejour.sejour_id = affectation.sejour_id";
$groupAffect = "affectation.sejour_id";
$list_affectations = $affectation->loadList($whereAffect, null, null, $groupAffect, $ljoin);
$total_service = array();
foreach ($services as $_service) {
    $total_service[$_service->_id]["service"] = $_service;
    $total_service[$_service->_id]["total"] = 0;
}
foreach ($list_affectations as $key => $_affectation) {
    // Chargement des références nécessaire pour parcourir les affectations
    $_affectation->loadRefLit();
    $_affectation->_ref_lit->loadRefChambre();
    $_affectation->_ref_lit->_ref_chambre->loadRefsFwd();
    $_affectation->loadRefSejour();
    $_affectation->_ref_sejour->loadRefPraticien(1);
    $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");
}
/**
 * $Id$
 *
 * @category Admin
 * @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();
$do_import = CValue::get("do_import");
$start = CValue::getOrSession("start", 0);
$count = CValue::get("count", 5);
$group_id = CGroups::loadCurrent()->_id;
$user = new CUser();
// Requêtes
$ljoin["id_sante400"] = "`id_sante400`.`object_id` = `users`.`user_id`";
$ljoin["users_mediboard"] = "`users`.`user_id` = `users_mediboard`.`user_id`";
$ljoin["functions_mediboard"] = "`functions_mediboard`.`function_id` = `users_mediboard`.`function_id`";
$where = array();
$where["id_sante400.object_class"] = "= 'CUser'";
$where["id_sante400.tag"] = "= '" . CAppUI::conf("admin LDAP ldap_tag") . "'";
$where["id_sante400.id400"] = "IS NOT NULL";
$where["users.template"] = "= '0'";
$where["users_mediboard.actif"] = "= '1'";
$where["functions_mediboard.group_id"] = "= '{$group_id}'";
if (!$do_import) {
    $count_users_ldap = $user->countList($where, null, $ljoin);
    $ljoin = array();
Пример #23
0
 /**
  * Get object tag
  *
  * @param string $group_id Group
  *
  * @return string|null
  */
 static function getObjectTag($group_id = null)
 {
     // Permettre des idex en fonction de l'établissement
     if (!$group_id) {
         $group_id = CGroups::loadCurrent()->_id;
     }
     $cache = new Cache(get_called_class() . "::" . __FUNCTION__, array($group_id), Cache::INNER);
     if ($cache->exists()) {
         return $cache->get();
     }
     /** @var CMbObject $object */
     $object = new static();
     $tag = $object->getDynamicTag();
     return $cache->put(str_replace('$g', $group_id, $tag));
 }
Пример #24
0
<?php

/**
 * $Id: index.php 27581 2015-03-17 16:46:49Z armengaudmc $
 *
 * @package    Mediboard
 * @subpackage PMSI
 * @author     SARL OpenXtrem <*****@*****.**>
 * @license    GNU General Public License, see http://www.gnu.org/licenses/gpl.html
 * @version    $Revision: 27581 $
 */
$module = CModule::getInstalled(basename(dirname(__FILE__)));
if (CAppUI::conf("dPpmsi display see_recept_dossier", CGroups::loadCurrent())) {
    $module->registerTab("vw_recept_dossiers", TAB_READ);
}
$module->registerTab("vw_dossier_pmsi", TAB_EDIT);
$module->registerTab("vw_current_dossiers", TAB_READ);
$module->registerTab("vw_print_planning", TAB_READ);
if (CAppUI::conf("ref_pays") == "2") {
    $module->registerTab("vw_idx_sortie", TAB_READ);
}
if (CModule::getActive("atih")) {
    $module->registerTab("vw_traitement_dossiers", TAB_EDIT);
    $module->registerTab("vw_statistics_pmsi", TAB_ADMIN);
}
$module->registerTab('vw_cim10_explorer', TAB_READ);
Пример #25
0
/**
 * $Id: index.php 28574 2015-06-11 08:24:59Z aurelie17 $
 *
 * @package    Mediboard
 * @subpackage dPfacturation
 * @author     SARL OpenXtrem <*****@*****.**>
 * @license    GNU General Public License, see http://www.gnu.org/licenses/gpl.html 
 * @version    $Revision: 28574 $
 */
$module = CModule::getInstalled(basename(dirname(__FILE__)));
if (CAppUI::conf("dPfacturation CFactureCabinet view_bill")) {
    $module->registerTab("vw_factures_cabinet", TAB_READ);
}
if (CAppUI::conf("dPfacturation CFactureEtablissement view_bill")) {
    $module->registerTab("vw_factures_etab", TAB_READ);
}
$module->registerTab("vw_compta", TAB_READ);
if (CAppUI::conf("dPfacturation Other use_view_chainage")) {
    $module->registerTab("vw_edit_tarifs", TAB_READ);
}
if (CAppUI::conf("dPfacturation CRetrocession use_retrocessions")) {
    $module->registerTab("vw_retrocessions", TAB_READ);
    $module->registerTab("vw_retrocession_regles", TAB_ADMIN);
}
if (CAppUI::conf("dPfacturation CReglement use_debiteur")) {
    $module->registerTab("vw_debiteurs", TAB_READ);
}
if (CAppUI::conf("ref_pays") == "2" && CAppUI::conf("dPfacturation Other see_reject_xml", CGroups::loadCurrent())) {
    $module->registerTab("vw_rejects_xml", TAB_READ);
}
Пример #26
0
 /**
  * Load list overlay for current group
  *
  * @param array  $where   Tableau de clauses WHERE MYSQL
  * @param string $order   paramètre ORDER SQL
  * @param null   $limit   paramètre LIMIT SQL
  * @param null   $groupby paramètre GROUP BY SQL
  * @param array  $ljoin   Tableau de clauses LEFT JOIN SQL
  *
  * @return self[]
  */
 function loadGroupList($where = array(), $order = 'nom', $limit = null, $groupby = null, $ljoin = array())
 {
     // Filtre sur l'établissement
     $g = CGroups::loadCurrent();
     $where["group_id"] = "= '{$g->_id}'";
     /** @var CBlocOperatoire[] $list */
     $list = $this->loadListWithPerms(PERM_READ, $where, $order, $limit, $groupby, $ljoin);
     foreach ($list as &$bloc) {
         $bloc->loadRefsSalles();
     }
     return $list;
 }
Пример #27
0
<?php

/**
 * $Id: form_print_planning.php 28638 2015-06-18 09:30:48Z flaviencrochard $
 *
 * @package    Mediboard
 * @subpackage Hospi
 * @author     SARL OpenXtrem <*****@*****.**>
 * @license    GNU General Public License, see http://www.gnu.org/licenses/gpl.html
 * @version    $Revision: 28638 $
 */
CCanDo::checkRead();
$group = CGroups::loadCurrent();
$filter = new CSejour();
$today = CMbDT::date();
$filter->_date_min = CValue::getOrSession("_date_min", "{$today} 06:00:00");
$filter->_date_max = CValue::getOrSession("_date_max", "{$today} 21:00:00");
$filter->_horodatage = CValue::getOrSession("_horodatage", "entree_prevue");
$filter->_admission = CValue::getOrSession("_admission");
$filter->_service = CValue::getOrSession("_service");
$filter->praticien_id = CValue::getOrSession("praticien_id");
$filter->convalescence = CValue::getOrSession("convalescence");
$filter->_specialite = CValue::getOrSession("_specialite");
$filter->_filter_type = CValue::getOrSession("_filter_type");
$filter->_ccam_libelle = CValue::getOrSession("_ccam_libelle", "1");
$filter->_coordonnees = CValue::getOrSession("_coordonnees");
$filter->_notes = CValue::getOrSession("_notes");
$filter->_by_date = CValue::getOrSession("_by_date");
$listPrat = new CMediusers();
$listPrat = $listPrat->loadPraticiens(PERM_READ);
$listSpec = new CFunctions();
Пример #28
0
 * $Id: index.php 28582 2015-06-11 09:58:14Z flaviencrochard $
 *
 * @package    Mediboard
 * @subpackage Hospi
 * @author     SARL OpenXtrem <*****@*****.**>
 * @license    GNU General Public License, see http://www.gnu.org/licenses/gpl.html
 * @version    $Revision: 28582 $
 */
$module = CModule::getInstalled(basename(dirname(__FILE__)));
$module->registerTab("vw_placements", TAB_READ);
$module->registerTab("edit_sorties", TAB_READ);
$module->registerTab("vw_recherche", TAB_READ);
$module->registerTab("vw_suivi_bloc", TAB_READ);
$module->registerTab("form_print_planning", TAB_READ);
if (CAppUI::conf("dPhospi pathologies") || CAppUI::$user->isAdmin()) {
    $module->registerTab("vw_idx_pathologies", TAB_READ);
}
$module->registerTab("vw_idx_infrastructure", TAB_ADMIN);
$module->registerTab("vw_stats", CAppUI::conf("dPhospi stats_for_all") ? TAB_EDIT : TAB_ADMIN);
if (CAppUI::conf("dPhospi prestations systeme_prestations", CGroups::loadCurrent()) == "standard") {
    $module->registerTab("vw_prestations_standard", TAB_ADMIN);
} else {
    $module->registerTab("vw_prestations", TAB_ADMIN);
}
$module->registerTab("vw_etiquettes", TAB_ADMIN);
if (CModule::getInstalled("printing")) {
    $module->registerTab("vw_printers", TAB_READ);
}
if (CAppUI::conf("dPhospi use_vue_topologique")) {
    $module->registerTab("vw_plan_etage", TAB_READ);
}
Пример #29
0
 * $Id: inc_edit_planning.php 22873 2014-04-22 07:51:07Z mytto $
 *
 * @package    Mediboard
 * @subpackage dPbloc
 * @author     SARL OpenXtrem <*****@*****.**>
 * @license    GNU General Public License, see http://www.gnu.org/licenses/gpl.html
 * @version    $Revision: 22873 $
 */
$plageop_id = CValue::getOrSession("plageop_id");
$date = CValue::getOrSession("date", CMbDT::date());
$bloc_id = CValue::get("bloc_id");
// Informations sur la plage demandée
$plagesel = new CPlageOp();
$plagesel->load($plageop_id);
$plagesel->loadRefSalle();
$listBlocs = CGroups::loadCurrent()->loadBlocs(PERM_READ, null, "nom");
//curent bloc if $bloc_id
$bloc = new CBlocOperatoire();
$bloc->load($bloc_id);
$listSalles = $bloc->loadRefsSalles();
$arrKeySalle = array_keys($listSalles);
// cleanup listBlocs
foreach ($listBlocs as $key => $curr_bloc) {
    $salles = $curr_bloc->loadRefsSalles();
    foreach ($salles as $id => $_salle) {
        if (count($arrKeySalle) && !in_array($id, $arrKeySalle)) {
            unset($salles[$id]);
            continue;
        }
    }
    if (!count($salles)) {
<?php

/**
 * $Id: edit_charge_price_indicator.php 19840 2013-07-09 19:36:14Z phenxdesign $
 *
 * @package    Mediboard
 * @subpackage PlanningOp
 * @author     SARL OpenXtrem <*****@*****.**>
 * @license    GNU General Public License, see http://www.gnu.org/licenses/gpl.html
 * @version    $Revision: 19840 $
 */
CCanDo::checkAdmin();
$charge_id = CValue::get("charge_id");
$charge = new CChargePriceIndicator();
$charge->load($charge_id);
$charge->loadRefsNotes();
if (!$charge->_id) {
    $charge->group_id = CGroups::loadCurrent()->_id;
}
$smarty = new CSmartyDP();
$smarty->assign("charge", $charge);
$smarty->display("inc_edit_charge_price_indicator.tpl");