/** * Links a shortcut icon (aka "favicon") * Only to be called while in the HTML header * * @param string $file The path to the favicon file * @param string $type The favicon mime type * * @return string An HTML tag to load the favicon */ static function loadFile($file, $type = "image/ico") { if (CAppUI::pref("moduleFavicon")) { global $m; $file = "./modules/{$m}/images/icon.png"; return self::getTag("link", array("type" => "image/png", "rel" => "shortcut icon", "href" => "{$file}?" . self::getBuild())); } return self::getTag("link", array("type" => $type, "rel" => "shortcut icon", "href" => "{$file}?" . self::getBuild())); }
/** * Sets user defined session life time * * @return void */ static function setUserDefinedLifetime() { // Update session lifetime $pref = intval(CAppUI::pref("sessionLifetime")) * 60; // If default pref, we use the PHP default value $session_gc_maxlifetime = self::getPhpSessionLifeTime(); $session_lifetime = $session_gc_maxlifetime; if ($pref && $pref <= $session_gc_maxlifetime) { $session_lifetime = $pref; } self::updateLifetime($session_lifetime); }
/** * @param integer $field_id * * @return CExClassFieldTranslation */ static function tr($field_id) { static $cache = array(); $lang = CAppUI::pref("LOCALE"); if (isset($cache[$lang][$field_id])) { return $cache[$lang][$field_id]; } $trans = new self(); $trans->lang = $lang; $trans->ex_class_field_id = $field_id; if ($trans->loadMatchingObject()) { $cache[$lang][$field_id] = $trans; } return $trans; }
/** * Load enum translations * * @return CExClassFieldEnumTranslation[] */ function loadRefEnumTranslations() { $trans = new CExClassFieldEnumTranslation(); $trans->lang = CAppUI::pref("LOCALE"); $trans->ex_class_field_id = $this->_id; return $trans->loadMatchingList(); }
<?php /** * $Id$ * * @category DPpatients * @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 */ if (!CAppUI::pref("allowed_modify_identity_status")) { CAppUI::redirect("m=system&a=access_denied"); } $number_day = CValue::getOrSession("_number_day", 8); $number_day = $number_day ?: 8; $now = CValue::getOrSession("_date_end", CMbDT::date()); $before = CMbDT::date("-{$number_day} DAY", $now); $csv = new CCSVFile(); $line = array("Date", CAppUI::tr("CPatient.status.PROV"), CAppUI::tr("CPatient.status.DPOT"), CAppUI::tr("CPatient.status.ANOM"), CAppUI::tr("CPatient.status.CACH"), CAppUI::tr("CPatient.status.VALI")); $csv->writeLine($line); $results = CPatientStateTools::getPatientStateByDate($before, $now); $values = array(); for ($i = $number_day; $i >= 0; $i--) { $values[CMbDT::date("-{$i} DAY", $now)] = array("PROV" => 0, "DPOT" => 0, "ANOM" => 0, "CACH" => 0, "VALI" => 0); } foreach ($results as $_result) { $values[$_result["date"]][$_result["state"]] = $_result["total"]; } foreach ($values as $_date => $_value) {
} if (!$patient_id) { $patient->nom = $name; $patient->prenom = $firstName; $patient->assure_nom = $name; $patient->assure_prenom = $firstName; $patient->unescapeValues(); if ($naissance_day && $naissance_month && $naissance_year) { $patient->naissance = sprintf('%04d-%02d-%02d', $naissance_year, $naissance_month, $naissance_day); } if (CAppUI::conf("dPpatients CPatient default_value_allow_sms", CGroups::loadCurrent())) { $patient->allow_sms_notification = 1; } } // Peut etre pas besoin de verifier si on n'utilise pas VitaleVision if ($useVitale && CAppUI::pref('LogicielLectureVitale') == 'none' && CModule::getActive("fse")) { $patVitale = new CPatient(); $cv = CFseFactory::createCV(); if ($cv) { $cv->getPropertiesFromVitale($patVitale, CValue::sessionAbs('administrative_data')); $patVitale->nullifyEmptyFields(); $patient->extendsWith($patVitale); $patient->updateFormFields(); $patient->_bind_vitale = "1"; } } if ($covercard && CModule::getActive("covercard")) { $covercardExec = CCoverCard::process($covercard); if ($covercardExec->queryNumber) { CCoverCard::updatePatientFromCC($patient, $covercardExec); }
CValue::setSession("selClass", null); CValue::setSession("selKey", null); } else { $patient->load($patient_id); } $patient_nom = trim(CValue::getOrSession("nom")); $patient_prenom = trim(CValue::getOrSession("prenom")); $patient_ville = CValue::get("ville"); $patient_cp = CValue::get("cp"); $patient_day = CValue::getOrSession("Date_Day"); $patient_month = CValue::getOrSession("Date_Month"); $patient_year = CValue::getOrSession("Date_Year"); $patient_naissance = "{$patient_year}-{$patient_month}-{$patient_day}"; $patient_ipp = CValue::get("patient_ipp"); $patient_nda = CValue::get("patient_nda"); $useVitale = CValue::get("useVitale", CModule::getActive("fse") && CAppUI::pref('LogicielLectureVitale') != 'none' ? 1 : 0); $prat_id = CValue::get("prat_id"); $patient_sexe = CValue::get("sexe"); $useCovercard = CValue::get("usecovercard", CModule::getActive("fse") && CModule::getActive("covercard") ? 1 : 0); $patient_nom_search = null; $patient_prenom_search = null; // Save history $params = array("new" => $new, "patient_id" => $patient_id, "nom" => $patient_nom, "prenom" => $patient_prenom, "ville" => $patient_ville, "cp" => $patient_cp, "Date_Day" => $patient_day, "Date_Month" => $patient_month, "Date_Year" => $patient_year, "patient_ipp" => $patient_ipp, "patient_nda" => $patient_nda, "prat_id" => $prat_id, "sexe" => $patient_sexe); CViewHistory::save($patient, CViewHistory::TYPE_SEARCH, $params); $patVitale = new CPatient(); // Liste des praticiens $prats = $mediuser->loadPraticiens(); // Création du template $smarty = new CSmartyDP(); $smarty->assign("dPsanteInstalled", CModule::getInstalled("dPsante400")); $smarty->assign("nom", $patient_nom);
// Selection de la date $date = CValue::getOrSession("date", CMbDT::date()); $date_tolerance = CAppUI::conf("dPurgences date_tolerance"); $date_before = CMbDT::date("-{$date_tolerance} DAY", $date); $date_after = CMbDT::date("+1 DAY", $date); // L'utilisateur doit-il voir les informations médicales $user = CMediusers::get(); $medicalView = $user->isMedical(); $group = CGroups::loadCurrent(); $listPrats = $user->loadPraticiens(PERM_READ, $group->service_urgences_id); $sejour = new CSejour(); $where = array(); $ljoin["rpu"] = "sejour.sejour_id = rpu.sejour_id"; $ljoin["patients"] = "sejour.patient_id = patients.patient_id"; $where[] = "sejour.entree BETWEEN '{$date}' AND '{$date_after}' \n OR (sejour.sortie_reelle IS NULL AND sejour.entree BETWEEN '{$date_before}' AND '{$date_after}' AND sejour.annule = '0')"; $where[] = CAppUI::pref("showMissingRPU") ? "sejour.type = 'comp' OR rpu.rpu_id IS NOT NULL" : "rpu.rpu_id IS NOT NULL"; $where["sejour.group_id"] = "= '{$group->_id}'"; $where["sejour.UHCD"] = "= '1'"; if ($uhcd_affichage == "prendre_en_charge") { $ljoin["consultation"] = "consultation.sejour_id = sejour.sejour_id"; $where["consultation.consultation_id"] = "IS NULL"; } if ($uhcd_affichage == "presents") { $where["sejour.sortie_reelle"] = "IS NULL"; $where["sejour.annule"] = " = '0'"; if (CAppUI::conf("dPurgences create_sejour_hospit")) { $where["rpu.mutation_sejour_id"] = "IS NULL"; } } if ($uhcd_affichage == "annule") { $where["sejour.sortie_reelle"] = "IS NOT NULL";
<?php /** * $Id$ * * @package Mediboard * @subpackage Cabinet * @author SARL OpenXtrem <*****@*****.**> * @license GNU General Public License, see http://www.gnu.org/licenses/gpl.html * @version $Revision$ */ $module = CModule::getInstalled(basename(dirname(__FILE__))); if (CAppUI::pref("new_semainier") == "1") { $module->registerTab("vw_planning_new", TAB_READ); $module->registerTab("vw_journee_new", TAB_READ); } else { $module->registerTab("vw_planning", TAB_READ); $module->registerTab("vw_journee", TAB_READ); } $module->registerTab("edit_planning", TAB_READ); $module->registerTab("edit_consultation", TAB_EDIT); //$module->registerTab("vw_dossier" , TAB_EDIT); $module->registerTab("form_print_plages", TAB_READ); $module->registerTab("vw_compta", TAB_EDIT); $module->registerTab("vw_factures", TAB_ADMIN); $module->registerTab("vw_edit_tarifs", TAB_EDIT); $module->registerTab("vw_categories", TAB_EDIT); $module->registerTab("vw_banques", TAB_ADMIN); $module->registerTab("vw_stats", TAB_ADMIN); if (CModule::getActive("fse")) { $module->registerTab("vw_fse", TAB_READ);
/** * create the CFiles attached to the mail * * @param CMailAttachments[] $attachList The list of CMailAttachment * @param CPop $popClient the CPop client * * @return void */ function attachFiles($attachList, $popClient) { //size limit $size_required = CAppUI::pref("getAttachmentOnUpdate"); if ($size_required == "") { $size_required = 0; } foreach ($attachList as $_attch) { $_attch->mail_id = $this->_id; $_attch->loadMatchingObject(); if (!$_attch->_id) { $_attch->store(); } //si preference taille ok OU que la piece jointe est incluse au texte => CFile if ($_attch->bytes <= $size_required || $_attch->disposition == "INLINE") { $file = new CFile(); $file->setObject($_attch); $file->author_id = CAppUI::$user->_id; if (!$file->loadMatchingObject()) { $file_pop = $popClient->decodeMail($_attch->encoding, $popClient->openPart($this->uid, $_attch->getpartDL())); $file->file_name = $_attch->name; //apicrypt attachment if (strpos($_attch->name, ".apz") !== false) { $file_pop = CApicrypt::uncryptAttachment($popClient->source->object_id, $file_pop); } //file type detection $first = is_array($file_pop) ? reset($file_pop) : $file_pop; $mime = $this->extensionDetection($first); //file name $infos = pathinfo($_attch->name); $extension = $infos['extension']; $mime_extension = strtolower(end(explode("/", $mime))); if (strtolower($extension) != $mime_extension) { $file->file_name = $infos['filename'] . "." . $mime_extension; } $file->file_type = $mime ? $mime : $_attch->getType($_attch->type, $_attch->subtype); $file->fillFields(); $file->updateFormFields(); $file->putContent($file_pop); $file->store(); } } } }
$elt->consultation = 1; if ($elt->countMatchingList()) { $display_elt = true; } } } } $consult->loadPosition(); // Création du template $smarty = new CSmartyDP(); $smarty->assign("listCat", $listCat); $smarty->assign("categories", $categories); $smarty->assign("plageConsult", $plageConsult); $smarty->assign("consult", $consult); $smarty->assign("following_consultations", $following_consultations); $smarty->assign("today_ref_multiple", CAppUI::pref("today_ref_consult_multiple")); $smarty->assign("chir", $chir); $smarty->assign("_functions", $_functions); $smarty->assign("pat", $pat); $smarty->assign("listPraticiens", $listPraticiens); $smarty->assign("listFunctions", $listFunctions); $smarty->assign("correspondantsMedicaux", $correspondantsMedicaux); $smarty->assign("medecin_adresse_par", $medecin_adresse_par); $smarty->assign("today", $today); $smarty->assign("date_planning", $date_planning); $smarty->assign("_function_id", $_function_id); $smarty->assign("line_element_id", $line_element_id); $smarty->assign("nb_plages", $nb_plages); $smarty->assign("dialog", $dialog); $smarty->assign("modal", $modal); $smarty->assign("callback", $callback);
if ($query_report) { CSQLDataSource::$report = false; CSQLDataSource::displayReport(); } CApp::$chrono->stop(); CApp::preparePerformance(); // Unlocalized strings if (!$suppressHeaders || $ajax) { CAppUI::$unlocalized = array_map("utf8_encode", CAppUI::$unlocalized); $unloc = new CSmartyDP("modules/system"); $unloc->display("inc_unlocalized_strings.tpl"); } // Inclusion du footer if (!$suppressHeaders) { //$address = get_remote_address(); if ($infosystem = CAppUI::pref("INFOSYSTEM")) { $latest_cache_key = "{$user->_guid}-latest_cache"; $latest_cache = array("meta" => array("module" => $m, "action" => $action, "user" => $user->_view), "totals" => Cache::$totals, "hits" => Cache::$hits); SHM::put($latest_cache_key, $latest_cache, true); } $tplFooter = new CSmartyDP("style/{$uistyle}"); $tplFooter->assign("offline", false); $tplFooter->assign("performance", CApp::$performance); $tplFooter->assign("infosystem", $infosystem); $tplFooter->assign("errorMessage", CAppUI::getMsg()); $tplFooter->assign("navigatory_history", CViewHistory::getHistory()); $tplFooter->display("footer.tpl"); } // Ajax performance if ($ajax) { $tplAjax = new CSmartyDP("modules/system");
$list[$value["favoris_code"]] = $code; } } sort($list); } /** * Statistiques */ if ($mode == "stats") { // Appel de la fonction listant les codes les plus utilisés pour un praticien $actes = new CActeCCAM(); $codes = $actes->getFavoris($_user_id, $object_class); foreach ($codes as $key => $value) { // Attention à bien cloner le code CCAM car on rajoute une champ à la volée $code = CDatedCodeCCAM::get($value["code_acte"]); if (CAppUI::pref('actes_comp_supp_favoris', 0) || !CAppUI::pref('actes_comp_supp_favoris', 0) && !in_array($code->chapitres[0]['db'], array('18.', '19.'))) { $code->occ = $value["nb_acte"]; $list[$value["code_acte"]] = $code; } } if ($order == "alpha") { sort($list); } } } if ($type == "cim10") { /** * Favoris */ if ($mode == "favoris") { $sql = "select favoris_code\r\n from cim10favoris\r\n where favoris_user = '******'\r\n order by favoris_code";
<?php /** * $Id: do_traitement_aed.php 19219 2013-05-21 12:26:07Z phenxdesign $ * * @package Mediboard * @subpackage Patients * @author SARL OpenXtrem <*****@*****.**> * @license GNU General Public License, see http://www.gnu.org/licenses/gpl.html * @version $Revision: 19219 $ */ $autoadd_default = CAppUI::pref("AUTOADDSIGN", true); $del = $_POST["del"]; // Sejour // si on a un sejour et que l'option d'ajout automatique est activée if (isset($_POST["_sejour_id"]) && $autoadd_default && $_POST["_sejour_id"] != "") { $doSejour = new CDoObjectAddEdit("CTraitement", "traitement_id"); // Ajout de l'antecedent dans le sejour $_POST["dossier_medical_id"] = CDossierMedical::dossierMedicalId($_POST["_sejour_id"], "CSejour"); $doSejour->redirectStore = null; $doSejour->redirect = null; $doSejour->doIt(); } $_POST["del"] = $del; // Patient $doPatient = new CDoObjectAddEdit("CTraitement", "traitement_id"); if ($_POST["del"] != 1 && isset($_POST["_patient_id"])) { $_POST["dossier_medical_id"] = CDossierMedical::dossierMedicalId($_POST["_patient_id"], "CPatient"); } $_POST["ajax"] = 1; $doPatient->doIt();
$where = array(); if ($chir_id) { $chir = new CMediusers(); $chir->load($chir_id); $chir->loadRefFunction(); $functions_ids = array($chir->function_id); $chir->loadBackRefs("secondary_functions"); if (count($chir->_back["secondary_functions"])) { $functions_ids = array_merge($functions_ids, CMbArray::pluck($chir->_back["secondary_functions"], "function_id")); } $where[] = "(protocole.chir_id = '{$chir->_id}' OR protocole.function_id " . CSQLDataSource::prepareIn($functions_ids) . ")"; } elseif ($function_id) { $where["protocole.function_id"] = "= '{$function_id}'"; } else { $curr_user = CMediusers::get(); $use_edit = CAppUI::pref("useEditAutocompleteUsers"); $prats = $curr_user->loadPraticiens($use_edit ? PERM_EDIT : PERM_READ); $fncs = $curr_user->loadFonctions($use_edit ? PERM_EDIT : PERM_READ); $where[] = "(protocole.chir_id " . CSQLDataSource::prepareIn(CMbArray::pluck($prats, "user_id")) . " OR protocole.function_id " . CSQLDataSource::prepareIn(array_keys($fncs)) . ")"; } if ($for_sejour !== null) { $where["for_sejour"] = "= '{$for_sejour}'"; } if ($keywords == "") { $keywords = "%"; } $order = "libelle, libelle_sejour, codes_ccam"; /** @var CProtocole[] $matches */ $matches = $object->getAutocompleteListWithPerms(PERM_READ, $keywords, $where, $limit, null, $order); if (CAppUI::conf("dPbloc CPlageOp systeme_materiel")) { foreach ($matches as $protocole) {
$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); $smarty->assign("mins", $mins); $smarty->assign("examComp", new CExamComp()); $smarty->assign("techniquesComp", new CTechniqueComp()); $smarty->display("../../dPcabinet/templates/edit_consultation.tpl"); } else { if (CAppUI::pref("MODCONSULT")) { $where = array(); $where["entree"] = "<= '" . CMbDT::dateTime() . "'"; $where["sortie"] = ">= '" . CMbDT::dateTime() . "'"; $where["function_id"] = "IS NOT NULL"; $affectation = new CAffectation(); /** @var CAffectation[] $blocages_lit */ $blocages_lit = $affectation->loadList($where); $where["function_id"] = "IS NULL"; foreach ($blocages_lit as $blocage) { $blocage->loadRefLit()->loadRefChambre()->loadRefService(); $where["lit_id"] = "= '{$blocage->lit_id}'"; if ($affectation->loadObject($where)) { $sejour = $affectation->loadRefSejour(); $patient = $sejour->loadRefPatient(); $blocage->_ref_lit->_view .= " indisponible jusqu'à " . CMbDT::transform($affectation->sortie, null, "%Hh%Mmin %d-%m-%Y");
/** * Charge les actes CCAM codables en fonction des code CCAM fournis * * @param integer $praticien_id L'id du praticien auquel seront liés les actes * * @return void */ function loadPossibleActes($praticien_id = 0) { $this->preparePossibleActes(); $depassement_affecte = false; $depassement_anesth_affecte = false; $this->guessActesAssociation(); // Check if depassement is already set $this->loadRefsActesCCAM(); foreach ($this->_ref_actes_ccam as $_acte) { if ($_acte->code_activite == 1 && $_acte->montant_depassement) { $depassement_affecte = true; } if ($_acte->code_activite == 4 && $_acte->montant_depassement) { $depassement_anesth_affecte = true; } } // existing acts may only be affected once to possible acts $used_actes = array(); if ($praticien_id) { $praticien = CMediusers::get($praticien_id); $executant_id = $praticien_id; } else { $praticien = $this->loadRefPraticien(); $executant_id = 0; } $praticien->loadRefDiscipline(); $this->loadRefPatient()->evalAge(); $this->loadExtCodesCCAM(); foreach ($this->_ext_codes_ccam as $code_ccam) { foreach ($code_ccam->activites as $activite) { foreach ($activite->phases as $phase) { $possible_acte = new CActeCCAM(); $possible_acte->montant_depassement = ""; $possible_acte->code_acte = $code_ccam->code; $possible_acte->code_activite = $activite->numero; $possible_acte->_anesth = $activite->numero == 4; $possible_acte->code_phase = $phase->phase; $possible_acte->execution = CAppUI::pref("use_acte_date_now") ? CMbDT::dateTime() : $this->_acte_execution; // Affectation du dépassement au premier acte de chirugie if (!$depassement_affecte and $possible_acte->code_activite == 1) { $possible_acte->montant_depassement = $this->_acte_depassement; $depassement_affecte = true; } // Affectation du dépassement au premier acte d'anesthésie if (!$depassement_anesth_affecte and $possible_acte->code_activite == 4) { $possible_acte->montant_depassement = $this->_acte_depassement_anesth; $depassement_anesth_affecte = true; } if (!$praticien_id) { $executant_id = CAppUI::pref("user_executant") ? CMediusers::get()->_id : $this->getExecutantId($possible_acte->code_activite); } $possible_acte->executant_id = $executant_id; $possible_acte->object_class = $this->_class; $possible_acte->object_id = $this->_id; if ($possible_acte->code_activite == 4) { $possible_acte->extension_documentaire = $this->getExtensionDocumentaire($possible_acte->executant_id); } /* Gestion du champ remboursé */ if ($code_ccam->remboursement == 1) { /* Cas ou l'acte est remboursable */ $possible_acte->rembourse = '1'; } else { /* Cas ou l'acte est non */ $possible_acte->rembourse = '0'; } $possible_acte->updateFormFields(); $possible_acte->loadRefExecutant(); $possible_acte->loadRefCodeCCAM(); if (CAppUI::conf('dPccam CCodeCCAM use_new_association_rules')) { $possible_acte->loadRefCodageCCAM(); } $possible_acte->getAnesthAssocie(); // Affect a loaded acte if exists foreach ($this->_ref_actes_ccam as $_acte) { if ($_acte->code_acte == $possible_acte->code_acte && $_acte->code_activite == $possible_acte->code_activite && $_acte->code_phase == $possible_acte->code_phase) { if (!isset($used_actes[$_acte->acte_id])) { $possible_acte = $_acte; $used_actes[$_acte->acte_id] = true; break; } } } if ($possible_acte->_id) { $possible_acte->getTarif(); } else { $possible_acte->getTarifSansAssociationNiCharge(); } // Keep references ! $phase->_connected_acte = $possible_acte; $listModificateurs = $phase->_connected_acte->modificateurs; if (!$possible_acte->_id) { $possible_acte->facturable = '1'; $possible_acte->checkFacturable(); if (CAppUI::conf('dPccam CCodeCCAM use_new_association_rules')) { CCodageCCAM::precodeModifiers($phase->_modificateurs, $possible_acte, $this); $possible_acte->getMontantModificateurs($phase->_modificateurs); } else { $possible_acte->getMontantModificateurs($phase->_modificateurs); foreach ($phase->_modificateurs as $modificateur) { $modificateur->_checked = $this->checkModificateur($modificateur->code, CMbDT::time($phase->_connected_acte->execution)); } } } else { // Récupération des modificateurs codés foreach ($phase->_modificateurs as $modificateur) { /* Dans le cas des modificateurs doubles, les 2 composantes peuvent être séparées (IJKO dans le cas de IO par exemple) */ if ($modificateur->_double == "2") { $position = strpos($listModificateurs, $modificateur->code[0]) !== false && strpos($listModificateurs, $modificateur->code[1]) !== false; } else { $position = strpos($listModificateurs, $modificateur->code); } if ($position !== false) { if ($modificateur->_double == "1") { $modificateur->_checked = $modificateur->code; } elseif ($modificateur->_double == "2") { $modificateur->_checked = $modificateur->code . $modificateur->_double; } else { $modificateur->_checked = null; } } else { $modificateur->_checked = null; } } /* Vérification et précodage des modificateurs */ if (CAppUI::conf('dPccam CCodeCCAM use_new_association_rules')) { CCodageCCAM::precodeModifiers($phase->_modificateurs, $possible_acte, $this); } $possible_acte->getMontantModificateurs($phase->_modificateurs); } } } } }
<?php /** * dPboard * * @category Board * @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 */ CAppUI::requireModuleFile("dPboard", "inc_board"); $date = CValue::getOrSession("date", CMbDT::date()); $prec = CMbDT::date("-1 day", $date); $suiv = CMbDT::date("+1 day", $date); $vue = CValue::getOrSession("vue2", CAppUI::pref("AFFCONSULT", 0)); global $smarty; // Variables de templates $smarty->assign("date", $date); $smarty->assign("prec", $prec); $smarty->assign("suiv", $suiv); $smarty->assign("vue", $vue); $smarty->display("vw_day.tpl");
/** * @see parent::check() */ function check() { // Standard check if ($msg = parent::check()) { return $msg; } // Creation d'un patient $manage_identity_status = CAppUI::conf("dPpatients CPatient manage_identity_status", CGroups::loadCurrent()); if (!$this->_merging && !$manage_identity_status) { if ($this->loadMatchingPatient(true, false) > 0) { return "Doublons détectés"; } } if ($manage_identity_status && $this->status == "VALI" && !CAppUI::pref("allowed_identity_status")) { if ($this->fieldModified("nom") || $this->fieldModified("prenom") || $this->fieldModified("naissance") || $this->fieldModified("nom_jeune_fille")) { return "Vous n'avez pas les droits pour modifier les traits strict du patient"; } } return null; }
static function getServicesIdsPref($services_ids = array()) { // Détection du changement d'établissement $group_id = CValue::get("g"); if (!$services_ids || $group_id) { $group_id = $group_id ? $group_id : CGroups::loadCurrent()->_id; $pref_services_ids = json_decode(CAppUI::pref("services_ids_hospi")); // Si la préférence existe, alors on la charge if (isset($pref_services_ids->{"g{$group_id}"})) { $services_ids = $pref_services_ids->{"g{$group_id}"}; $services_ids = explode("|", $services_ids); CMbArray::removeValue("", $services_ids); } else { $service = new CService(); $where = array(); $where["group_id"] = "= '" . CGroups::loadCurrent()->_id . "'"; $where["cancelled"] = "= '0'"; $services_ids = array_keys($service->loadListWithPerms(PERM_READ, $where, "externe, nom")); } } if (is_array($services_ids)) { CMbArray::removeValue("", $services_ids); } global $m; $save_m = $m; foreach (array("dPhospi", "dPadmissions") as $_module) { $m = $_module; CValue::setSession("services_ids", $services_ids); } $m = $save_m; return $services_ids; }
if ($mode == 'draft') { $_usermessage->_ref_dest_user = reset($_usermessage->_ref_destinataires); } foreach ($destinataires as $key => $_dest) { if (in_array($mode, array("inbox", "archive"))) { $_usermessage->_mode = "in"; if ($_dest->to_user_id != $user->_id) { unset($destinataires[$key]); continue; } } if (in_array($mode, array("sentbox", "draft"))) { $_usermessage->_mode = "out"; if ($_dest->from_user_id != $user->_id) { unset($destinataires[$key]); continue; } } $_dest->loadRefFrom()->loadRefFunction(); $_dest->loadRefTo()->loadRefFunction(); } } // smarty $smarty = new CSmartyDP(); $smarty->assign("usermessages", $usermessages); $smarty->assign("unread", $unread); $smarty->assign("total", $total_found); $smarty->assign("page", $page); $smarty->assign("mode", $mode); $smarty->assign('inputMode', CAppUI::pref('inputMode')); $smarty->display("inc_list_usermessages.tpl");
} else { $sejourReq->addOrder("patients.nom"); $sejourReq->addOrder("patients.prenom"); $sejourReq->addOrder("DATE(sejour.{$filter->_horodatage})"); } $sejours = $sejours->loadListByReq($sejourReq); $listDays = array(); $listPrats = array(); // Liste des services $service = new CService(); $where = array(); $where["group_id"] = "= '{$group->_id}'"; $where["cancelled"] = "= '0'"; $order = "nom"; $services = $service->loadListWithPerms(PERM_READ, $where, $order); $prestation_id = CAppUI::pref("prestation_id_hospi"); if (CAppUI::conf("dPhospi prestations systeme_prestations", $group) == "standard" || $prestation_id == "all") { $prestation_id = ""; } $prestation = new CPrestationJournaliere(); $prestation->load($prestation_id); CMbObject::massLoadFwdRef($sejours, "patient_id"); CMbObject::massLoadFwdRef($sejours, "praticien_id"); // ATTENTION ne pas supprimer le "&" car pose des problemes foreach ($sejours as $key => &$sejour) { /** @var CSejour $sejour*/ $sejour->loadRefsAffectations(); $sejour->loadRefsOperations(); $sejour->loadRefPatient(); $sejour->_ref_first_affectation->loadRefLit()->loadRefChambre(); $affectation = $sejour->_ref_first_affectation;
/** * Creates a JSON locales file * * @param array $locales The locales array * @param string $label The locales label * * @return string The path to the JSON locales file */ static function getLocaleFile($locales = null, $label = null) { $language = CAppUI::pref("LOCALE"); $path = self::getLocaleFilePath($language, $label); if (!is_file($path)) { self::writeLocaleFile($language, $locales, $label); } return $path; }
$where["group_id"] = "= '{$group_id}'"; $where["cancelled"] = "= '0'"; $where["secteur_id"] = "IS NULL"; $order = "externe, nom"; $service = new CService(); $all_services = $service->loadList($where, $order); unset($where["secteur_id"]); $services_allowed = $service->loadListWithPerms(PERM_READ, $where, $order); $where = array(); $where["group_id"] = "= '{$group_id}'"; $secteur = new CSecteur(); $secteurs = $secteur->loadList($where, "nom"); foreach ($secteurs as $_secteur) { $_secteur->loadRefsServices(); $keys2 = array_keys($_secteur->_ref_services); $_secteur->_all_checked = count($_secteur->_ref_services) > 0 ? array_values(array_intersect($services_ids, $keys2)) == $keys2 : false; } $services_ids_hospi = CAppUI::pref("services_ids_hospi"); if (!$services_ids_hospi) { $services_ids_hospi = "{}"; } $smarty = new CSmartyDP("modules/dPhospi"); $smarty->assign("view", $view); $smarty->assign("services_ids_hospi", $services_ids_hospi); $smarty->assign("services_ids", $services_ids); $smarty->assign("all_services", $all_services); $smarty->assign("services_allowed", $services_allowed); $smarty->assign("group_id", $group_id); $smarty->assign("secteurs", $secteurs); $smarty->assign("ajax_request", $ajax_request); $smarty->display("inc_select_services.tpl");
/** * Charge l'exécution * * @return void */ function loadExecution() { /** @var CCodable $object */ $object = $this->loadTargetObject(); $object->getActeExecution(); $this->execution = CAppUI::pref("use_acte_date_now") ? CMbDT::dateTime() : $object->_acte_execution; }
/** * Check the modifiers of the given act * * @param CObject &$modifiers The modifiers to check * @param CActeCCAM &$act The dateTime of the execution of the act * @param CCodable $codable The codable * * @return void */ public static function precodeModifiers(&$modifiers, &$act, $codable) { $date = CMbDT::date(null, $act->execution); $time = CMbDT::time(null, $act->execution); $act->loadRefExecutant(); $act->_ref_executant->loadRefDiscipline(); $discipline = $act->_ref_executant->_ref_discipline; $patient = $codable->loadRefPatient(); $patient->evalAge(); $checked = 0; $spe_gyneco = $spe_gyneco = array('GYNECOLOGIE MEDICALE, OBSTETRIQUE', 'GYNECOLOGIE-OBSTETRIQUE', 'MEDECINE DE LA REPRODUCTION ET GYNECOLOGIE MEDICAL'); $spe_gen_pediatre = array("MEDECINE GENERALE", "PEDIATRIE"); $count_exclusive_modifiers = self::countExclusiveModifiers($act); $store_act = 0; $modifiers_to_add = ""; $achieved = CMbDate::achievedDurations($patient->naissance, CMbDT::date(null, $act->execution)); $patient_age = $achieved["year"]; foreach ($modifiers as $_modifier) { switch ($_modifier->code) { case 'A': $checked = $patient_age < 4 || $patient_age >= 80; $_modifier->_state = $checked ? 'prechecked' : 'not_recommended'; break; case 'E': $checked = $patient->_annees < 5; $_modifier->_state = $checked ? 'prechecked' : 'not_recommended'; break; case 'F': $checked = ($count_exclusive_modifiers == 1 && $_modifier->_checked || $count_exclusive_modifiers == 0) && (CMbDT::transform('', $act->execution, '%w') == 0 || CMbDate::isHoliday($date)) && ($time > '08:00:00' && $time < '20:00:00'); if ($checked) { $_modifier->_state = 'prechecked'; } elseif ($count_exclusive_modifiers == 1 && $_modifier->_checked || $count_exclusive_modifiers > 0) { $_modifier->_state = 'forbidden'; } else { $_modifier->_state = 'not_recommended'; } break; case "J": $checked = $codable->_class == 'COperation' && CAppUI::pref('precode_modificateur_J'); $_modifier->_state = $checked ? 'prechecked' : null; break; case 'K': $checked = !$act->montant_depassement && ($act->_ref_executant->secteur == 1 || $act->_ref_executant->secteur == 2 && $patient->cmu || $act->_ref_executant->contrat_acces_soins || $act->_ref_executant->option_coordination); if ($checked) { $_modifier->_state = 'prechecked'; } elseif (!in_array($discipline, $spe_gyneco)) { $_modifier->_state = 'not_recommended'; } if (self::isModifierchecked('K', $act) && !$act->montant_depassement) { $checked = true; } break; case 'L': if (self::isModifierchecked('L', $act)) { $_modifier->_state = 'prechecked'; $checked = true; } break; case 'M': $checked = 0; if (!in_array($discipline->text, $spe_gen_pediatre)) { $_modifier->_state = 'not_recommended'; } break; case 'N': $checked = $patient->_annees < 13; $_modifier->_state = $checked ? 'prechecked' : 'not_recommended'; break; case 'P': $checked = ($count_exclusive_modifiers == 1 && $_modifier->_checked || $count_exclusive_modifiers == 0) && in_array($discipline->text, $spe_gen_pediatre) && ($time > "20:00:00" && $time < "23:59:59"); if ($checked) { $_modifier->_state = 'prechecked'; } elseif ($count_exclusive_modifiers == 1 && $_modifier->_checked || $count_exclusive_modifiers > 0) { $_modifier->_state = 'forbidden'; } else { $_modifier->_state = 'not_recommended'; } break; case 'R': if (self::isModifierchecked('R', $act)) { $_modifier->_state = 'prechecked'; $checked = true; } break; case 'S': $checked = (in_array($discipline->text, $spe_gen_pediatre) || $codable->_class == "COperation" && $codable->_lu_type_anesth) && ($time >= "00:00:00" && $time < "08:00:00") && ($count_exclusive_modifiers == 1 && $_modifier->_checked || $count_exclusive_modifiers == 0); if ($checked) { $_modifier->_state = 'prechecked'; } elseif ($count_exclusive_modifiers == 1 && $_modifier->_checked || $count_exclusive_modifiers > 0) { $_modifier->_state = 'forbidden'; } else { $_modifier->_state = 'not_recommended'; } break; case 'U': $checked = ($count_exclusive_modifiers == 1 && $_modifier->_checked || $count_exclusive_modifiers == 0) && !in_array($discipline->text, $spe_gen_pediatre) && ($time > '20:00:00' || $time < '08:00:00'); if ($checked) { $_modifier->_state = 'prechecked'; } elseif ($count_exclusive_modifiers == 1 && $_modifier->_checked || $count_exclusive_modifiers > 0) { $_modifier->_state = 'forbidden'; } else { $_modifier->_state = 'not_recommended'; } break; case "7": $checked = CAppUI::pref('precode_modificateur_7') && $codable->_class == 'COperation' && (isset($codable->anesth_id) || $act->_ref_executant->isAnesth()); if ($checked) { $_modifier->_state = 'prechecked'; } else { $_modifier->_state = $codable->_class == 'COperation' && (isset($codable->anesth_id) || $act->_ref_executant->isAnesth()) ? null : 'not_recommended'; } break; default: $checked = 0; break; } if (!$act->_id && !isset($_modifier->_checked)) { $_modifier->_checked = $checked; } } /* Handle the case where the mods S and U are both prechecked */ if (isset($modifiers['S']) && isset($modifiers['U'])) { $modS =& $modifiers['S']; $modU =& $modifiers['U']; if ($modS->_state == 'prechecked' && $modU->_state == 'prechecked') { $modU->_checked = 0; $modU->_state = 'forbidden'; } } }
/** * Génération de la source html pour la liste d'items * * @param array $items liste d'items * @param boolean $htmlescape [optional] * * @return string|null */ function makeList($items, $htmlescape = true) { if (!$items) { return null; } // Make a list out of a string if (!is_array($items)) { $items = array($items); } // Escape content if ($htmlescape) { $items = array_map(array("CMbString", "htmlEntities"), $items); } // HTML production switch ($default = CAppUI::pref("listDefault")) { case "ulli": $html = "<ul>"; foreach ($items as $item) { $html .= "<li>{$item}</li>"; } $html .= "</ul>"; break; case "br": $html = ""; $prefix = CAppUI::pref("listBrPrefix"); foreach ($items as $item) { $html .= "<br />{$prefix} {$item}"; } break; case "inline": $separator = CAppUI::pref("listInlineSeparator"); $html = implode(" {$separator} ", $items); break; default: $html = ""; trigger_error("Default style for list is unknown '{$default}'", E_USER_WARNING); break; } return $html; }
$patient = new CPatient(); $patient->load($patient_id); $patient->loadRefDossierMedical(); $dossier_medical = $patient->_ref_dossier_medical; $dossier_medical->loadRefsAntecedents(); $dossier_medical->loadRefsTraitements(); $applied_antecedents = array(); foreach ($dossier_medical->_ref_antecedents_by_type as $list) { foreach ($list as $a) { if (!isset($applied_antecedents[$a->type])) { $applied_antecedents[$a->type] = array(); } $applied_antecedents[$a->type][] = $a->rques; } } $order_mode_grille = CAppUI::pref("order_mode_grille"); $fill_pref = $order_mode_grille != ""; $order_decode = array(); if ($fill_pref) { $order_decode = get_object_vars(json_decode($order_mode_grille)); /** Suppression des types d'antécédents non cochés dans la configuration */ foreach ($order_decode as $key => $_order_decode) { if (!in_array($key, $antecedent->_specs["type"]->_list)) { unset($order_decode[$key]); } } $keys = array_keys($order_decode); foreach ($keys as $_key => $_value) { if ($_value == "_empty_") { $keys[$_key] = ""; }
* @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(); $nom = CValue::post("nom"); $email = CValue::post("email"); $subject = CValue::post("subject"); $body = CValue::post("body"); $object_guid = CValue::post("object_guid"); $object = CMbObject::loadFromGuid($object_guid); /** @var $exchange_source CSourceSMTP */ $exchange_source = CExchangeSource::get("mediuser-" . CMediusers::get()->_id, "smtp"); $exchange_source->init(); if (CAppUI::pref('hprim_med_header')) { $body = $object->makeHprimHeader($exchange_source->email, $email) . "\n" . $body; } try { $exchange_source->setRecipient($email, $nom); $exchange_source->setSubject($subject); $exchange_source->setBody(nl2br($body)); switch ($object->_class) { case "CCompteRendu": /** @var $object CCompteRendu */ $object->makePDFpreview(true); $file = $object->_ref_file; $exchange_source->addAttachment($file->_file_path, $file->file_name); break; case "CFile": /** @var $object CFile */
<?php /** * dPccam * * @category Ccam * @package Mediboard * @author SARL OpenXtrem <*****@*****.**> * @license GNU General Public License, see http://www.gnu.org/licenses/gpl.html * @version SVN: $Id: do_favoris_aed.php 19221 2013-05-21 14:24:43Z rhum1 $ * @link http://www.mediboard.org */ $do = new CDoObjectAddEdit("CFavoriCCAM", "favoris_id"); // Amélioration des textes if ($favori_user = CValue::post("favoris_user")) { $user = new CMediusers(); $user->load($favori_user); $for = " pour {$user->_view}"; $do->createMsg .= $for; $do->modifyMsg .= $for; $do->deleteMsg .= $for; } $do->redirect = null; $do->doIt(); if (CAppUI::pref("new_search_ccam") == 1) { echo CAppUI::getMsg(); CApp::rip(); }