/** * @see parent::updatePlainFields() */ function updatePlainFields() { parent::updatePlainFields(); if ($this->nom) { $this->nom = CMbString::upper($this->nom); } if ($this->nom_jeune_fille) { $this->nom_jeune_fille = CMbString::upper($this->nom_jeune_fille); } if ($this->prenom) { $this->prenom = CMbString::capitalize(CMbString::lower($this->prenom)); } }
/** * 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; }
/** * Chargement de l'utilisateur système * * @return CUser */ function loadRefUser() { $user = new CUser(); // Usefull hack for mass preloading if (self::$user_autoload) { $user = $user->getCached($this->user_id); } if ($user->_id) { $this->_user_type = $user->user_type; $this->_user_username = $user->user_username; $this->_user_password = $user->user_password; $this->_user_first_name = CMbString::capitalize($user->user_first_name); $this->_user_last_name = CMbString::upper($user->user_last_name); $this->_user_email = $user->user_email; $this->_user_phone = $user->user_phone; $this->_user_astreinte = $user->user_astreinte; $this->_user_adresse = $user->user_address1; $this->_user_cp = $user->user_zip; $this->_user_ville = $user->user_city; $this->_user_template = $user->template; $this->_profile_id = $user->profile_id; $this->_force_change_password = $user->force_change_password; // Encrypt this datas $this->checkConfidential(); $this->_view = "{$this->_user_last_name} {$this->_user_first_name}"; $this->_shortview = ""; // Initiales if (!($this->_shortview = $this->initials)) { $this->_shortview .= CMbString::makeInitials($this->_user_first_name, "-"); $this->_shortview .= CMbString::makeInitials($this->_user_last_name); } $this->_user_type_view = CValue::read(CUser::$types, $this->_user_type); } $this->_ref_user = $user; $this->mapPerson(); $this->updateSpecs(); return $this->_ref_user; }
$where = "WHERE {$column} LIKE '{$needle}'"; // France if (CAppUI::conf("dPpatients INSEE france")) { $nbPays++; $queryFrance = "SELECT commune, code_postal, departement, 'France' AS pays FROM communes_france {$where}"; } // Suisse if (CAppUI::conf("dPpatients INSEE suisse")) { $nbPays++; $querySuisse = "SELECT commune, code_postal, '' AS departement, 'Suisse' AS pays FROM communes_suisse {$where}"; } if (CAppUI::conf("dPpatients INSEE france")) { $france = $ds->loadList($queryFrance, intval($max / $nbPays)); $matches = array_merge($matches, $france); } if (CAppUI::conf("dPpatients INSEE suisse")) { $suisse = $ds->loadList($querySuisse, intval($max / $nbPays)); $matches = array_merge($matches, $suisse); } array_multisort(CMbArray::pluck($matches, "code_postal"), SORT_ASC, CMbArray::pluck($matches, "commune"), SORT_ASC, $matches); foreach ($matches as $key => $_match) { $matches[$key]["commune"] = CMbString::capitalize(CMbString::lower($matches[$key]["commune"])); $matches[$key]["departement"] = CMbString::capitalize(CMbString::lower($matches[$key]["departement"])); $matches[$key]["pays"] = CMbString::capitalize(CMbString::lower($matches[$key]["pays"])); } // Template $smarty = new CSmartyDP(); $smarty->assign("keyword", $keyword); $smarty->assign("matches", $matches); $smarty->assign("nodebug", true); $smarty->display("autocomplete_cp_commune.tpl");
/** * Mapping de l'intervention * * @param array $data Datas * @param COperation $operation Intervention * * @return array */ function mappingIntervention($data, COperation $operation) { // Intervention annulée ? if ($data['action'] == "suppression") { $operation->annulee = 1; return; } $node = $data['intervention']; $xpath = new CHPrimXPath($node->ownerDocument); $debut = $this->getDebutInterv($node); $fin = $this->getFinInterv($node); // Traitement de la date/heure début, et durée de l'opération $operation->temp_operation = CMbDT::subTime(CMbDT::time($debut), CMbDT::time($fin)); $operation->_time_op = null; // Si une intervention du passée if (CMbDT::date($debut) < CMbDT::date()) { // On affecte le début de l'opération if (!$operation->debut_op) { $operation->debut_op = CMbDT::time($debut); } // On affecte la fin de l'opération if (!$operation->fin_op) { $operation->fin_op = CMbDT::time($fin); } } else { $operation->_time_urgence = null; $operation->time_operation = CMbDT::time($debut); } $operation->libelle = CMbString::capitalize($xpath->queryTextNode("hprim:libelle", $node)); $operation->rques = CMbString::capitalize($xpath->queryTextNode("hprim:commentaire", $node)); // Côté $cote = array("D" => "droit", "G" => "gauche", "B" => "bilatéral", "T" => "total", "I" => "inconnu"); $code_cote = $xpath->queryTextNode("hprim:cote/hprim:code", $node); $operation->cote = isset($cote[$code_cote]) ? $cote[$code_cote] : ($operation->cote ? $operation->cote : "inconnu"); // Conventionnée ? $operation->conventionne = $xpath->queryTextNode("hprim:convention", $node); // Extemporané $indicateurs = $xpath->query("hprim:indicateurs/*", $node); foreach ($indicateurs as $_indicateur) { if ($xpath->queryTextNode("hprim:code", $_indicateur) == "EXT") { $operation->exam_extempo = true; } } // TypeAnesthésie $this->getTypeAnesthesie($node, $operation); $operation->duree_uscpo = $xpath->queryTextNode("hprim:dureeUscpo", $node); }
/** * @see parent::updateFormFields() */ function updateFormFields() { parent::updateFormFields(); $user_first_name = CMbString::capitalize($this->user_first_name); $user_last_name = CMbString::upper($this->user_last_name); $this->_view = "{$user_last_name} {$user_first_name}"; $this->_login_locked = $this->user_login_errors >= CAppUI::conf('admin CUser max_login_attempts'); $this->_user_type_view = CValue::read(self::$types, $this->user_type); $this->mapPerson(); }
try { $source_ldap = CLDAP::bind($user, $ldaprdn, $ldappass); $results = $source_ldap->ldap_search($source_ldap->_ldapconn, $filter); } catch (CMbException $e) { $e->stepAjax(UI_MSG_ERROR); } $nb_users = $results["count"]; unset($results["count"]); $users = array(); foreach ($results as $key => $_result) { $objectguid = CLDAP::getObjectGUID($_result); $users[$key]["objectguid"] = $objectguid; $users[$key]["user_username"] = CLDAP::getValue($_result, "samaccountname"); $users[$key]["user_first_name"] = CLDAP::getValue($_result, "givenname"); $users[$key]["user_last_name"] = CLDAP::getValue($_result, "sn"); $users[$key]["actif"] = CLDAP::getValue($_result, "useraccountcontrol") == 66048 ? 1 : 0; $idex = new CIdSante400(); $idex->tag = CAppUI::conf("admin LDAP ldap_tag"); $idex->id400 = $objectguid; $idex->object_class = "CUser"; $idex->loadMatchingObject(); $users[$key]["associate"] = $idex->_id ? $idex->object_id : null; } $smarty = new CSmartyDP(); $smarty->assign("users", $users); $smarty->assign("mediuser", $mediuser); $smarty->assign("nb_users", $nb_users); $smarty->assign("givenname", CMbString::capitalize($mediuser->_user_first_name)); $smarty->assign("sn", strtoupper($mediuser->_user_last_name)); $smarty->assign("samaccountname", strtolower($mediuser->_user_username)); $smarty->display("inc_search_user_ldap.tpl");
function addIntervention($elParent, COperation $operation, $referent = null, $light = false) { $identifiant = $this->addElement($elParent, "identifiant"); $this->addElement($identifiant, "emetteur", $operation->_id); $last_idex = $operation->_ref_last_id400; if (isset($last_idex->_id)) { $this->addElement($identifiant, "recepteur", $last_idex->id400); } $sejour = $operation->loadRefSejour(); if (!$operation->plageop_id) { $operation->completeField("date"); } // Calcul du début de l'intervention $mbOpDate = CValue::first($operation->_ref_plageop->date, $operation->date); $time_operation = $operation->time_operation == "00:00:00" ? null : $operation->time_operation; $mbOpHeureDebut = CValue::first($operation->debut_op, $operation->entree_salle, $time_operation, $operation->horaire_voulu, $operation->_ref_plageop->debut); $mbOpDebut = CMbRange::forceInside($sejour->entree, $sejour->sortie, "{$mbOpDate} {$mbOpHeureDebut}"); // Calcul de la fin de l'intervention $mbOpHeureFin = CValue::first($operation->fin_op, $operation->sortie_salle, CMbDT::addTime($operation->temp_operation, CMbDT::time($mbOpDebut))); $mbOpFin = CMbRange::forceInside($sejour->entree, $sejour->sortie, "{$mbOpDate} {$mbOpHeureFin}"); $debut = $this->addElement($elParent, "debut"); $this->addElement($debut, "date", CMbDT::date($mbOpDebut)); $this->addElement($debut, "heure", CMbDT::time($mbOpDebut)); $fin = $this->addElement($elParent, "fin"); $this->addElement($fin, "date", CMbDT::date($mbOpFin)); $this->addElement($fin, "heure", CMbDT::time($mbOpFin)); if ($light) { // Ajout des participants $mbParticipants = array(); foreach ($operation->_ref_actes_ccam as $acte_ccam) { $acte_ccam->loadRefExecutant(); $mbParticipant = $acte_ccam->_ref_executant; $mbParticipants[$mbParticipant->user_id] = $mbParticipant; } $participants = $this->addElement($elParent, "participants"); foreach ($mbParticipants as $mbParticipant) { $participant = $this->addElement($participants, "participant"); $medecin = $this->addElement($participant, "medecin"); $this->addProfessionnelSante($medecin, $mbParticipant); } // Libellé de l'opération $this->addTexte($elParent, "libelle", $operation->libelle, 80); } else { $this->addUniteFonctionnelle($elParent, $operation); // Uniquement le responsable de l’'intervention $participants = $this->addElement($elParent, "participants"); $participant = $this->addElement($participants, "participant"); $medecin = $this->addElement($participant, "medecin"); $this->addProfessionnelSante($medecin, $operation->loadRefChir()); // Libellé de l'opération $this->addTexte($elParent, "libelle", $operation->libelle, 4000); // Remarques sur l'opération $this->addTexte($elParent, "commentaire", CMbString::convertHTMLToXMLEntities("{$operation->materiel} - {$operation->rques}"), 4000); // Conventionnée ? $this->addElement($elParent, "convention", $operation->conventionne ? 1 : 0); // TypeAnesthésie : nomemclature externe (idex) if ($operation->type_anesth) { $tag_hprimxml = $this->_ref_receiver->_tag_hprimxml; $idexTypeAnesth = CIdSante400::getMatch("CTypeAnesth", $tag_hprimxml, null, $operation->type_anesth); $this->addElement($elParent, "typeAnesthesie", $idexTypeAnesth->id400); } // Indicateurs $indicateurs = $this->addElement($elParent, "indicateurs"); $dossier_medical = new CDossierMedical(); $dossier_medical->object_class = "CPatient"; $dossier_medical->object_id = $operation->loadRefPatient()->_id; $dossier_medical->loadMatchingObject(); $antecedents = $dossier_medical->loadRefsAntecedents(); foreach ($antecedents as $_antecedent) { $rques = CMbString::htmlspecialchars($_antecedent->rques); $rques = CMbString::convertHTMLToXMLEntities($rques); $this->addCodeLibelle($indicateurs, "indicateur", $_antecedent->_id, $rques); } // Extemporané if ($operation->exam_extempo) { $this->addCodeLibelle($indicateurs, "indicateur", "EXT", "Extemporané"); } // Recours / Durée USCPO $this->addElement($elParent, "recoursUscpo", $operation->duree_uscpo ? 1 : 0); $this->addElement($elParent, "dureeUscpo", $operation->duree_uscpo ? $operation->duree_uscpo : null); // Côté (droit|gauche|bilatéral|total|inconnu) // D - Droit // G - Gauche // B - Bilatéral // T - Total // I - Inconnu $cote = array("droit" => "D", "gauche" => "G", "bilatéral" => "B", "total" => "T", "inconnu" => "I", "haut" => "HT", "bas" => "BS"); $this->addCodeLibelle($elParent, "cote", $cote[$operation->cote], CMbString::capitalize($operation->cote)); } }
$bloc = new CBlocOperatoire(); $blocs = $bloc->loadGroupList(); if ($file && ($fp = fopen($file['tmp_name'], 'r'))) { // Object columns on the first line $cols = fgetcsv($fp, null, ";"); // Each line while ($line = fgetcsv($fp, null, ";")) { if (!isset($line[0]) || $line[0] == "") { continue; } // Parsing $NDA = trim($line[0]); $ADELI = trim($line[1]); $date_debut = CMbDT::dateTime(trim($line[2])); $date_fin = CMbDT::dateTime(trim($line[3])); $libelle = CMbString::capitalize(addslashes(trim($line[4]))); $nom_salle = addslashes(trim($line[5])); $cote = isset($line[6]) ? addslashes(trim($line[6])) : null; // Traitement du séjour $sejour = new CSejour(); $sejour->loadFromNDA($NDA); if (!$sejour->_id) { CAppUI::stepAjax("Le sejour n'a pas été retrouvé dans Mediboard par le NDA : '{$NDA}'", UI_MSG_WARNING); $results["count_nda_nt"]++; continue; } // Traitement du praticien responsable de l'intervention $mediuser = new CMediusers(); $where = array("users_mediboard.adeli" => "= '{$ADELI}'", "functions_mediboard.group_id" => "= '{$group_id}'"); $ljoin = array("functions_mediboard" => "functions_mediboard.function_id = users_mediboard.function_id"); $count = $mediuser->countList($where, null, $ljoin);