$smarty->assign("sejours_collision", $patient->getSejoursCollisions()); $smarty->assign("isPrescriptionInstalled", CModule::getActive("dPprescription")); $smarty->assign("canSante400", CModule::getCanDo("dPsante400")); $smarty->assign("urgInstalled", CModule::getInstalled("dPurgences")); $smarty->assign("heure_sortie_ambu", $heure_sortie_ambu); $smarty->assign("heure_sortie_autre", $heure_sortie_autre); $smarty->assign("heure_entree_veille", $heure_entree_veille); $smarty->assign("heure_entree_jour", $heure_entree_jour); $smarty->assign("op", $op); $smarty->assign("plage", $op->plageop_id ? $op->_ref_plageop : new CPlageOp()); $smarty->assign("sejour", $sejour); $smarty->assign("chir", $chir); $smarty->assign("praticien", $prat); $smarty->assign("patient", $patient); $smarty->assign("sejours", $sejours); $smarty->assign("ufs", CUniteFonctionnelle::getUFs()); $smarty->assign("_functions", $_functions); $smarty->assign("modurgence", 1); $smarty->assign("date_min", CMbDT::date()); $smarty->assign("date_max", CMbDT::date("+" . CAppUI::conf("dPplanningOp COperation nb_jours_urgence") . " days", CMbDT::date())); $smarty->assign("listAnesthType", $listAnesthType); $smarty->assign("anesthesistes", $anesthesistes); $smarty->assign("listServices", $services); $smarty->assign("etablissements", $etablissements); $smarty->assign("hours", $hours); $smarty->assign("mins", $mins); $smarty->assign("hours_duree", $hours_duree); $smarty->assign("hours_urgence", $hours_urgence); $smarty->assign("mins_duree", $mins_duree); $smarty->assign("prestations", $prestations); $smarty->assign("blocages_lit", $blocages_lit);
<?php /** * $Id:$ * * @package Mediboard * @subpackage Hospi * @author SARL OpenXtrem <*****@*****.**> * @license GNU General Public License, see http://www.gnu.org/licenses/gpl.html * @version $Revision:$ */ CCanDo::checkEdit(); // Récupération des paramètres $object_guid = CValue::get("object_guid"); $object = CMbObject::loadFromGuid($object_guid); $affectations_uf = $object->loadBackRefs("ufs"); foreach ($affectations_uf as $_affect_uf) { $_affect_uf->loadRefUniteFonctionnelle(); } $uf = new CUniteFonctionnelle(); $uf->group_id = CGroups::loadCurrent()->_id; $ufs = $uf->loadMatchingList('libelle'); // Création du template $smarty = new CSmartyDP(); $smarty->assign("object", $object); $smarty->assign("ufs", $ufs); $smarty->assign("affectations_uf", $affectations_uf); $smarty->display("httpreq_vw_object_ufs.tpl");
/** * Récupération de la location du patient * * @param DOMNode $node PV1 Node * @param CAffectation $affectation Affectation * @param CSejour $newVenue Séjour * * @return void */ function getPL(DOMNode $node, CAffectation $affectation, CSejour $newVenue = null) { $sender = $this->_ref_sender; // Récupération de la chambre $nom_chambre = $this->queryTextNode("PL.2", $node); $chambre = new CChambre(); // Récupération du lit $nom_lit = $this->queryTextNode("PL.3", $node); $lit = new C**t(); switch ($sender->_configs["handle_PV1_3"]) { // idex du service case 'idex': $chambre_id = CIdSante400::getMatch("CChambre", $sender->_tag_chambre, $nom_chambre)->object_id; $chambre->load($chambre_id); $lit_id = CIdSante400::getMatch("C**t", $sender->_tag_lit, $nom_lit)->object_id; $lit->load($lit_id); break; // Dans tous les cas le nom du lit est celui que l'on reçoit du flux // Dans tous les cas le nom du lit est celui que l'on reçoit du flux default: $where = $ljoin = array(); $ljoin["service"] = "service.service_id = chambre.service_id"; $where["chambre.nom"] = " = '{$nom_chambre}'"; $where["chambre.annule"] = " = '0'"; $where["group_id"] = " = '{$sender->group_id}'"; $chambre->escapeValues(); $chambre->loadObject($where, null, null, $ljoin); $chambre->unescapeValues(); $where = $ljoin = array(); $ljoin["chambre"] = "chambre.chambre_id = lit.chambre_id"; $ljoin["service"] = "service.service_id = chambre.service_id"; $where["lit.nom"] = " = '{$nom_lit}'"; $where["lit.annule"] = " = '0'"; $where["service.cancelled"] = " = '0'"; $where["group_id"] = " = '{$sender->group_id}'"; if ($chambre->_id) { $where["chambre.chambre_id"] = " = '{$chambre->_id}'"; } $lit->escapeValues(); $lit->loadObject($where, null, null, $ljoin); $lit->unescapeValues(); break; } // Affectation du lit $affectation->lit_id = $lit->_id; // Affectation de l'UF hébergement $date_deb = $affectation->_id ? CMbDT::date($affectation->sortie) : CMbDT::date($newVenue->sortie); $date_fin = $affectation->_id ? CMbDT::date($affectation->entree) : CMbDT::date($newVenue->entree); $uf = CUniteFonctionnelle::getUF($this->queryTextNode("PL.1", $node), "hebergement", $newVenue->group_id, $date_deb, $date_fin); if (!$uf->_id) { return; } $affectation->uf_hebergement_id = $uf->_id; // Affectation du service (couloir) if (!$affectation->lit_id) { $affectation_uf = new CAffectationUniteFonctionnelle(); $affectation_uf->uf_id = $uf->_id; $affectation_uf->object_class = "CService"; $affectation_uf->loadMatchingObject(); $affectation->service_id = $affectation_uf->object_id; } }
/** * $Id$ * * @package Mediboard * @subpackage Hospi * @author SARL OpenXtrem <*****@*****.**> * @license GNU General Public License, see http://www.gnu.org/licenses/gpl.html * @version $Revision$ */ CCanDo::checkEdit(); // Récupération des paramètres $object_guid = CValue::get("object_guid"); $object = CMbObject::loadFromGuid($object_guid); /** @var CAffectationUniteFonctionnelle[] $affectations_uf */ $affectations_uf = $object->loadBackRefs("ufs"); CMbObject::massLoadFwdRef($affectations_uf, "uf_id"); $ufs_selected = array("medicale" => false, "hebergement" => false, "soins" => false); foreach ($affectations_uf as $key => $_affectation_uf) { $_affectation_uf->loadRefUniteFonctionnelle(); //Utilisation d'un seul type d'uf par service/chambre/lit? $ufs_selected[$_affectation_uf->_ref_uf->_id] = true; $ufs_selected[$_affectation_uf->_ref_uf->type] = true; } $ufs = CUniteFonctionnelle::getUFs($object->_class); // Création du template $smarty = new CSmartyDP(); $smarty->assign("object", $object); $smarty->assign("ufs", $ufs); $smarty->assign("affectations_uf", $affectations_uf); $smarty->assign("ufs_selected", $ufs_selected); $smarty->display("inc_affectation_uf.tpl");
// Chargement des services $service = new CService(); /** @var CService[] $services */ $services = $service->loadListWithPerms(PERM_READ, $where, "nom"); foreach ($services as $_service) { // Chargement des chambres et lits foreach ($_service->loadRefsChambres() as $_chambre) { $_chambre->loadRefsLits(true); } } $smarty->assign("services", $services); $smarty->display("inc_vw_idx_services.tpl"); } if ($type_name == "UF") { // Chargement de l'uf à ajouter/éditer $uf = new CUniteFonctionnelle(); $uf->group_id = $group->_id; $uf->load($uf_id); $uf->loadRefUm(); $uf->loadRefsNotes(); // Récupération des ufs $order = "group_id, code"; $ufs = array("hebergement" => $uf->loadGroupList(array("type" => "= 'hebergement'"), $order), "medicale" => $uf->loadGroupList(array("type" => "= 'medicale'"), $order), "soins" => $uf->loadGroupList(array("type" => "= 'soins'"), $order)); // Récupération des Unités Médicales (pmsi) $ums = array(); $ums_infos = array(); $um = new CUniteMedicale(); if (CSQLDataSource::get("sae") && CModule::getActive("atih")) { $um_infos = new CUniteMedicaleInfos(); $ums = $um->loadListUm(); $group = CGroups::loadCurrent();
* @author SARL OpenXtrem <*****@*****.**> * @license GNU General Public License, see http://www.gnu.org/licenses/gpl.html * @version $Revision$ */ CCanDo::checkAdmin(); $use_uf = CValue::get("uf_id"); $uf_id = CValue::getOrSession("uf_id"); $use_prestation = CValue::get("prestation_id"); $prestation_id = CValue::getOrSession("prestation_id"); $group = CGroups::loadCurrent(); // Liste des Etablissements $etablissements = CMediusers::loadEtablissements(PERM_READ); $praticiens = CAppUI::$user->loadPraticiens(); if ($use_uf != null) { // Chargement de l'uf à ajouter/éditer $uf = new CUniteFonctionnelle(); $uf->group_id = $group->_id; $uf->load($uf_id); $uf->loadRefUm(); $uf->loadRefsNotes(); // Récupération des Unités Médicales (pmsi) $ums = array(); $ums_infos = array(); $um = new CUniteMedicale(); if (CSQLDataSource::get("sae") && CModule::getActive("atih")) { $um_infos = new CUniteMedicaleInfos(); $ums = $um->loadListUm(); $group = CGroups::loadCurrent(); $where["group_id"] = " = '{$group->_id}'"; $where["mode_hospi"] = " IS NOT NULL"; $where["nb_lits"] = " IS NOT NULL";
<?php /** * $Id: vw_stats_uf.php 26535 2014-12-22 14:02:01Z aurelie17 $ * * @package Mediboard * @subpackage Hospi * @author SARL OpenXtrem <*****@*****.**> * @license GNU General Public License, see http://www.gnu.org/licenses/gpl.html * @version $Revision: 26535 $ */ CCanDo::checkRead(); $uf_id = CValue::getOrSession("uf_id"); $uf = new CUniteFonctionnelle(); $uf->load($uf_id); if ($uf->type == "hebergement") { $type_affectations = array("C**t" => array(), "CChambre" => array(), "CService" => array()); } elseif ($uf->type == "soins") { $type_affectations = array("CService" => array()); } elseif ($uf->type == "medicale") { $type_affectations = array("CMediusers" => array(), "CFunctions" => array()); } foreach ($type_affectations as $type => $tab_type) { $affect = new CAffectationUniteFonctionnelle(); $affect->uf_id = $uf_id; $affect->object_class = $type; $affectations = $affect->loadMatchingList(); foreach ($affectations as $_affect) { /* @var CAffectationUniteFonctionnelle $_affect*/ $_affect->loadTargetObject(); }
// UF Médicale if ($uf_medicale = $results[$i]["uf_medicale"]) { $uf = new CUniteFonctionnelle(); $uf->code = $uf_medicale; $uf->type = "medicale"; $uf->loadMatchingObject(); if ($uf->_id) { $protocole->uf_medicale_id = $uf->_id ? $uf->_id : ""; } else { $results[$i]["errors"][] = "UF médicale non trouvée"; $unfound["uf_medicale"][$uf_medicale] = true; } } // UF Soins if ($uf_soins = $results[$i]["uf_soins"]) { $uf = new CUniteFonctionnelle(); $uf->code = $uf_soins; $uf->type = "soins"; $uf->loadMatchingObject(); if ($uf->_id) { $protocole->uf_soins_id = $uf->_id ? $uf->_id : ""; } else { $results[$i]["errors"][] = "UF de soins non trouvée"; $unfound["uf_soins"][$uf_soins] = true; } } // Field check final if (!$protocole->for_sejour && ($protocole->libelle == "" && $protocole->codes_ccam == "" || $protocole->duree_hospi === "" || $protocole->temp_operation == "") || $protocole->for_sejour && ($protocole->duree_hospi === "" || !isset($protocole->facturable))) { $results[$i]["errors"][] = "Champs manquants"; } // No store on errors