コード例 #1
0
 /**
  * @see parent::store()
  */
 function store()
 {
     $this->completeField("handled");
     if (!$this->creation_date) {
         $this->creation_date = CMbDT::dateTime();
         if ($this->_id) {
             $this->creation_date = $this->loadFirstLog()->date;
         }
     }
     if ($this->fieldModified("handled", "1") || $this->handled && !$this->handled_date && !$this->handled_user_id) {
         $this->handled_date = CMbDT::dateTime();
         $this->handled_user_id = CMediusers::get()->_id;
         if ($this->handled) {
             $last_log = $this->loadLastLog();
             $this->handled_date = $last_log->date;
             $this->handled_user_id = $last_log->user_id;
         }
     }
     if ($this->fieldModified("handled", "0")) {
         $this->handled_date = $this->handled_user_id = "";
     }
     if ($msg = parent::store()) {
         return $msg;
     }
 }
コード例 #2
0
 /**
  * logSejourAccess
  *
  * @param CSejour $sejour
  *
  * @return bool has the access been logged
  */
 static function logForSejour($sejour)
 {
     $group = $sejour->loadRefEtablissement();
     if (!CAppUI::conf("admin CLogAccessMedicalData enable_log_access", $group) || !$sejour->_id) {
         return false;
     }
     $user = CMediusers::get();
     $conf = CAppUI::conf("admin CLogAccessMedicalData round_datetime", $group);
     $datetime = CMbDT::dateTime();
     switch ($conf) {
         case '1m':
             // minute
             $datetime = CMbDT::format($datetime, "%y-%m-%d %H:%M:00");
             break;
         case '10m':
             // 10 minutes
             $minute = CMbDT::format($datetime, "%M");
             $minute = str_pad(floor($minute / 10) * 10, 2, 0, STR_PAD_RIGHT);
             $datetime = CMbDT::format($datetime, "%y-%m-%d %H:{$minute}:00");
             break;
         case '1d':
             // 1 day
             $datetime = CMbDT::format($datetime, "%y-%m-%d 00:00:00");
             break;
         default:
             // 1 hour
             $datetime = CMbDT::format($datetime, "%y-%m-%d %H:00:00");
             break;
     }
     return self::logintoDb($user->_id, $sejour->_class, $sejour->_id, $datetime, $group->_id);
 }
コード例 #3
0
 /**
  * Get field and object corresponding to $field field
  *
  * @param CMbObject $object Object
  * @param string    $field  Field name
  *
  * @return array
  */
 static function getFieldAndObjectStatic(CMbObject $object, $field)
 {
     if (strpos($field, "CONNECTED_USER") === 0) {
         $object = CMediusers::get();
         if ($field != "CONNECTED_USER") {
             $field = substr($field, 15);
         }
     }
     return array($object, $field);
 }
コード例 #4
0
 /**
  * @see parent::store()
  */
 function store()
 {
     // Save owner and creation date
     if (!$this->_id) {
         if (!$this->creation_date) {
             $this->creation_date = CMbDT::dateTime();
         }
         if (!$this->owner_id) {
             $this->owner_id = CMediusers::get()->_id;
         }
     }
     return parent::store();
 }
コード例 #5
0
 /**
  * @see parent::store()
  */
 function store()
 {
     $this->completeField("operation_id");
     if ($this->_id && $this->etat != "a_commander") {
         if (CMediusers::get()->_id == $this->loadRefOperation()->chir_id) {
             $this->etat = "modify";
         }
     }
     // Standard storage
     if ($msg = parent::store()) {
         return $msg;
     }
 }
コード例 #6
0
 public function setDestinationActiveParticipant()
 {
     $destination_active_participant = $this->msg_xml->addElement($this->audit_message, 'ActiveParticipant');
     $MSH = $this->hl7_xml->queryNode("MSH", null, $foo, true);
     $receiving_facility = $this->hl7_xml->queryTextNode("MSH.5/HD.1", $MSH);
     $receiving_application = $this->hl7_xml->queryTextNode("MSH.6/HD.1", $MSH);
     $this->msg_xml->addAttribute($destination_active_participant, 'UserID', "{$receiving_facility}|{$receiving_application}");
     $this->msg_xml->addAttribute($destination_active_participant, 'AlternativeUserID', CMediusers::get()->_id);
     $this->msg_xml->addAttribute($destination_active_participant, 'UserName', trim(CMediusers::get()));
     $this->msg_xml->addAttribute($destination_active_participant, 'UserIsRequestor', "false");
     $this->msg_xml->addAttribute($destination_active_participant, 'NetworkAccessPointID', $this->hostname);
     $this->msg_xml->addAttribute($destination_active_participant, 'NetworkAccessPointTypeCode', "2");
     $this->destination_active_participant = $destination_active_participant;
     $this->setDestinationActiveParticipantRoleIDCode();
 }
コード例 #7
0
ファイル: CPerson.class.php プロジェクト: fbone/mediboard4
 /**
  * Set starting and closing formulas
  *
  * @param integer|null $user_id Given owner id
  *
  * @return null
  */
 function loadSalutations($user_id = null)
 {
     if (!$this->_id) {
         return null;
     }
     $salutation = new CSalutation();
     $salutation->owner_id = $user_id ? $user_id : CMediusers::get()->_id;
     $salutation->object_class = $this->_class;
     $salutation->object_id = $this->_id;
     if ($salutation->loadMatchingObject()) {
         $this->_starting_formula = $salutation->starting_formula;
         $this->_closing_formula = $salutation->closing_formula;
     } else {
         $this->_starting_formula = CAppUI::tr('CSalutation-starting_formula|default');
         $this->_closing_formula = CAppUI::tr('CSalutation-closing_formula|default');
     }
 }
コード例 #8
0
 /**
  * Load all salutation from a given class
  *
  * @param string       $object_class Target object class
  * @param integer|null $object_id    Target object ID
  * @param int          $perm         Permission needed on owners
  * @param integer|null $owner_id     Specific owner ID
  *
  * @return CSalutation[]
  */
 static function loadAllSalutations($object_class, $object_id = null, $perm = PERM_EDIT, $owner_id = null)
 {
     if (!$owner_id) {
         $users = new CMediusers();
         $users = $users->loadListWithPerms($perm, array('actif' => "= '1'"));
         $user_ids = $users ? CMbArray::pluck($users, '_id') : array(CMediusers::get()->_id);
         unset($users);
     } else {
         $user_ids = array($owner_id);
     }
     /** @var CSalutation $salutation */
     $salutation = new self();
     $ds = $salutation->_spec->ds;
     $where = array('owner_id' => $ds->prepareIn($user_ids), 'object_class' => $ds->prepare('= ?', $object_class));
     if ($object_id) {
         $where['object_id'] = $ds->prepare('= ?', $object_id);
     }
     return $salutation->loadList($where);
 }
コード例 #9
0
 /**
  * @see parent::extractData
  */
 function extractData()
 {
     /** @var CCDAFactory $factory */
     $factory = $this->mbObject;
     $this->document = $factory->mbObject;
     $this->targetObject = $factory->targetObject;
     $this->id_classification = 0;
     $this->id_external = 0;
     $mediuser = CMediusers::get();
     $specialty = $mediuser->loadRefOtherSpec();
     $group = $mediuser->loadRefFunction()->loadRefGroup();
     $identifiant = CXDSTools::getIdEtablissement(true, $group) . "/{$mediuser->_id}";
     $this->specialty = $specialty->code . "^" . $specialty->libelle . "^" . $specialty->oid;
     $this->xcn_mediuser = CXDSTools::getXCNMediuser($identifiant, $mediuser->_p_last_name, $mediuser->_p_first_name);
     $this->xon_etablissement = CXDSTools::getXONetablissement($group->text, CXDSTools::getIdEtablissement(false, $group));
     $this->xpath = new CMbXPath($factory->dom_cda);
     $this->xpath->registerNamespace("cda", "urn:hl7-org:v3");
     $this->patient_id = $this->getID($factory->patient, $factory->receiver);
     $this->ins_patient = $this->getIns($factory->patient);
     $uuid = CMbSecurity::generateUUID();
     $this->uuid["registry"] = $uuid . "1";
     $this->uuid["extrinsic"] = $uuid . "2";
     $this->uuid["signature"] = $uuid . "3";
 }
コード例 #10
0
ファイル: object_merger.php プロジェクト: fbone/mediboard4
 * $Id: object_merger.php 22331 2014-03-06 11:13:46Z charlyecho $
 *
 * @package    Mediboard
 * @subpackage System
 * @author     SARL OpenXtrem <*****@*****.**>
 * @license    GNU General Public License, see http://www.gnu.org/licenses/gpl.html
 * @version    $Revision: 22331 $
 */
$objects_class = CValue::getOrSession('objects_class');
$readonly_class = CValue::get('readonly_class');
$objects_id = CValue::get('objects_id');
$mode = CValue::get('mode');
if (!is_array($objects_id)) {
    $objects_id = explode("-", $objects_id);
}
$user = CMediusers::get();
CMbArray::removeValue("", $objects_id);
$objects = array();
$result = null;
$checkMerge = null;
$statuses = array();
$merge_type = null;
if (class_exists($objects_class) && count($objects_id)) {
    foreach ($objects_id as $object_id) {
        /** @var CMbObject $object */
        $object = new $objects_class();
        $merge_type = $object->_spec->merge_type;
        if ($merge_type == 'none') {
            CAppUI::stepAjax("Merging_%sclass_is_forbidden_by_spec", UI_MSG_ERROR, CAppUI::tr($object->_class));
        }
        // the CMbObject is loaded
コード例 #11
0
<?php

/**
 * $Id: ajax_edit_source_mediuser.php 27587 2015-03-18 09:31:32Z aurelie17 $
 *
 * @package    Mediboard
 * @subpackage mediusers
 * @author     SARL OpenXtrem <*****@*****.**>
 * @license    GNU General Public License, see http://www.gnu.org/licenses/gpl.html
 * @version    $Revision: 27587 $
 */
CCanDo::checkRead();
$user_id = CValue::getOrSession("user_id");
$mediuser = CMediusers::get($user_id);
// Source File system d'envoi
$fs_source_envoi = CExchangeSource::get("envoi-tarmed-{$mediuser->_guid}", "file_system", true, null, false);
// Source File system d'envoi
$fs_source_reception = CExchangeSource::get("reception-tarmed-{$mediuser->_guid}", "file_system", true, null, false);
$fs_sources_tarmed = array("fs_source_envoi" => array($fs_source_envoi), "fs_source_reception" => array($fs_source_reception));
// Création du template
$smarty = new CSmartyDP();
$smarty->assign("fs_sources_tarmed", $fs_sources_tarmed);
$smarty->display("sources_archive.tpl");
コード例 #12
0
ファイル: CActe.class.php プロジェクト: fbone/mediboard4
 /**
  * Charge les exécutants possibles
  *
  * @return CMediusers[]|null Exécutants possible, null si exécutant déterminé
  */
 function loadListExecutants()
 {
     $user = CMediusers::get();
     $this->_list_executants = $user->loadProfessionnelDeSante(PERM_READ);
     // No executant guess for the existing acte
     if ($this->executant_id || $this->_id) {
         return null;
     }
     // User executant
     if (CAppUI::pref("user_executant")) {
         $this->executant_id = $user->_id;
         return null;
     }
     // Referring pratician executant
     $praticien = $this->loadRefPraticien();
     if ($praticien && $praticien->_id) {
         $this->executant_id = $praticien->_id;
         return null;
     }
     return $this->_list_executants;
 }
コード例 #13
0
ファイル: do_mozaic_doc.php プロジェクト: fbone/mediboard4
// get data uri
foreach ($data as $_key => &$_data) {
    $file = new CFile();
    $file->load($_data["file_id"]);
    $file->getDataURI();
    $_data["file_uri"] = $file->_data_uri;
}
//user
$user = CMediusers::get($user_id);
// file
$file = new CFile();
$file->setObject($context);
$file->file_name = CAppUI::tr("CFile-create-mozaic") . " de " . CAppUI::tr($context->_class) . " du " . CMbDT::dateToLocale(CMbDT::date()) . ".pdf";
$file->file_type = "application/pdf";
$file->file_category_id = $cat_id;
$file->author_id = CMediusers::get()->_id;
$file->fillFields();
$file->updateFormFields();
$file->forceDir();
$file->store();
$cr = new CCompteRendu();
$cr->_page_format = "A4";
$cr->_orientation = "portrait";
// use template for header and footer
$template_header = new CTemplateManager();
$context->fillTemplate($template_header);
$header = CCompteRendu::getSpecialModel($user, "CPatient", "[ENTETE MOZAIC]");
if ($header->_id) {
    $header->loadContent();
    $template_header->renderDocument($header->_source);
} else {
コード例 #14
0
ファイル: CUserMail.class.php プロジェクト: fbone/mediboard4
 /**
  * Load the sent mails for an account
  *
  * @param int $account_id The account id
  * @param int $start      The start
  * @param int $limit      The number of mails to load
  *
  * @return CUserMail[]
  */
 public static function loadSent($account_id, $start, $limit)
 {
     $source_smtp = CExchangeSource::get('mediuser-' . CMediusers::get()->_id, "smtp");
     if ($source_smtp->_id) {
         $where[] = "(account_id = '{$account_id}' AND account_class = 'CSourcePOP') OR (account_id = '{$source_smtp->_id}' AND account_class = 'CSourceSMTP')";
     } else {
         $where['account_id'] = "= '{$account_id}'";
         $where['account_class'] = "= 'CSourcePOP'";
     }
     $where['sent'] = " = '1' ";
     $order = "date_inbox DESC";
     $limit = "{$start}, {$limit}";
     $mail = new CUserMail();
     return $mail->loadList($where, $order, $limit);
 }
コード例 #15
0
 */
CCanDo::checkRead();
$patient_id = CValue::getOrSession("patient_id", 0);
if (!$patient_id) {
    CAppUI::setMsg("Vous devez selectionner un patient", UI_MSG_ALERT);
    CAppUI::redirect("m=dPpatients&tab=0");
}
// Récuperation du patient sélectionné
$patient = new CPatient();
$patient->load($patient_id);
$patient->loadDossierComplet(PERM_READ);
$patient->loadRefDossierMedical();
$patient->_ref_dossier_medical->loadRefsAntecedents();
$patient->_ref_dossier_medical->loadRefsTraitements();
$patient->countINS();
$userSel = CMediusers::get();
// Suppression des consultations d'urgences
foreach ($patient->_ref_consultations as $keyConsult => $consult) {
    if ($consult->motif == "Passage aux urgences") {
        unset($patient->_ref_consultations[$keyConsult]);
    }
}
$can_view_dossier_medical = CModule::getCanDo('dPcabinet')->edit || CModule::getCanDo('dPbloc')->edit || CModule::getCanDo('dPplanningOp')->edit || $userSel->isFromType(array("Infirmière"));
// Création du template
$smarty = new CSmartyDP();
$smarty->assign("canCabinet", CModule::getCanDo("dPcabinet"));
$smarty->assign("canPlanningOp", CModule::getCanDo("dPplanningOp"));
$smarty->assign("patient", $patient);
$smarty->assign("can_view_dossier_medical", $can_view_dossier_medical);
$smarty->assign("isImedsInstalled", CModule::getActive("dPImeds") && CImeds::getTagCIDC(CGroups::loadCurrent()));
$smarty->display("inc_vw_full_patients.tpl");
コード例 #16
0
ファイル: vw_idx_sortie.php プロジェクト: fbone/mediboard4
$selSortis = CValue::getOrSession("selSortis", "0");
$order_col = CValue::getOrSession("order_col", "patient_id");
$order_way = CValue::getOrSession("order_way", "ASC");
$date = CValue::getOrSession("date", CMbDT::date());
$type = CValue::getOrSession("type");
$service_id = CValue::getOrSession("service_id");
$prat_id = CValue::getOrSession("prat_id");
$period = CValue::getOrSession("period");
$filterFunction = CValue::getOrSession("filterFunction");
$date_actuelle = CMbDT::dateTime("00:00:00");
$date_demain = CMbDT::dateTime("00:00:00", "+ 1 day");
$hier = CMbDT::date("- 1 day", $date);
$demain = CMbDT::date("+ 1 day", $date);
$service_id = CService::getServicesIdsPref($service_id);
// Récupération de la liste des praticiens
$prat = CMediusers::get();
$prats = $prat->loadPraticiens();
$sejour = new CSejour();
$sejour->_type_admission = $type;
$sejour->praticien_id = $prat_id;
// Création du template
$smarty = new CSmartyDP();
$smarty->assign("sejour", $sejour);
$smarty->assign("date_demain", $date_demain);
$smarty->assign("date_actuelle", $date_actuelle);
$smarty->assign("date", $date);
$smarty->assign("selSortis", $selSortis);
$smarty->assign("order_way", $order_way);
$smarty->assign("order_col", $order_col);
$smarty->assign("prats", $prats);
$smarty->assign("hier", $hier);
コード例 #17
0
ファイル: CCodable.class.php プロジェクト: fbone/mediboard4
 /**
  * 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);
                 }
             }
         }
     }
 }
コード例 #18
0
 * @subpackage PlanningOp
 * @author     SARL OpenXtrem <*****@*****.**>
 * @license    GNU General Public License, see http://www.gnu.org/licenses/gpl.html
 * @version    $Revision$
 */
$user = CUser::get();
$operation_id = CValue::get("operation_id");
$operation = new COperation();
$operation->load($operation_id);
$operation->loadRefAffectation();
$operation->loadRefsFwd(1);
$operation->loadRefsConsultAnesth();
$operation->_ref_sejour->loadRefsFwd();
$operation->_ref_sejour->loadRefsConsultAnesth();
// Récupération de l'utilisateur courant
$currUser = CMediusers::get();
$currUser->isAnesth();
// Chargement des anesthésistes
$listAnesths = new CMediusers();
$listAnesths = $listAnesths->loadAnesthesistes(PERM_DENY);
// Création du template
$smarty = new CSmartyDP();
$smarty->assign("currUser", $currUser);
$smarty->assign("user_id", $user->_id);
$smarty->assign("listAnesths", $listAnesths);
$smarty->assign("isPrescriptionInstalled", CModule::getActive("dPprescription"));
$smarty->assign("isImedsInstalled", CModule::getActive("dPImeds") && CImeds::getTagCIDC(CGroups::loadCurrent()));
$smarty->assign("operation", $operation);
$smarty->assign("anesth_perop", new CAnesthPerop());
$smarty->assign("create_dossier_anesth", 0);
$smarty->display("edit_visite_anesth.tpl");
コード例 #19
0
ファイル: CPatient.class.php プロジェクト: fbone/mediboard4
 /**
  * Find patient phoning similar
  *
  * @param string $date restrict to a venue collide date
  *
  * @return CPatient[] Array of phoning patients
  */
 function getPhoning($date = null)
 {
     $whereNom[] = "nom_soundex2    LIKE '{$this->nom_soundex2}%'";
     $whereNom[] = "nomjf_soundex2  LIKE '{$this->nom_soundex2}%'";
     if ($this->nomjf_soundex2) {
         $whereNom[] = "nom_soundex2    LIKE '{$this->nomjf_soundex2}%'";
         $whereNom[] = "nomjf_soundex2  LIKE '{$this->nomjf_soundex2}%'";
     }
     $where[] = implode(" OR ", $whereNom);
     $where["prenom_soundex2"] = "LIKE '{$this->prenom_soundex2}%'";
     $where["patients.patient_id"] = "!= '{$this->_id}'";
     $join = null;
     if ($date) {
         $join["sejour"] = "sejour.patient_id = patients.patient_id";
         $min = CMbDT::dateTime("-1 DAY", $date);
         $max = CMbDT::dateTime("+1 DAY", $date);
         // Ne pas utiliser de OR entree_prevue / entree_reelle ici: problèmes de performance
         $where["sejour.entree"] = "BETWEEN '{$min}' AND '{$max}'";
     }
     if (CAppUI::conf('dPpatients CPatient function_distinct')) {
         $function_id = CMediusers::get()->function_id;
         $where["function_id"] = "= '{$function_id}'";
     }
     return $this->loadList($where, null, null, "patients.patient_id", $join);
 }
コード例 #20
0
 /**
  * @see parent::store()
  */
 function store()
 {
     // S'il ne reste plus qu'un seul champ et que sa valeur est passée à vide,
     // alors on supprime la constante.
     if ($this->_id && ($this->fieldModified("taille") || $this->fieldModified("poids")) || !$this->_id && ($this->taille || $this->poids)) {
         $this->completeField("patient_id");
         DSHM::remKeys("alertes-*-CPatient-" . $this->patient_id);
     }
     if ($this->_id) {
         $this->loadOldObject();
         /* Pour permettre la suppression du poids et de _poids_g */
         if (!$this->_poids_g && $this->_old->poids) {
             $this->poids = $this->_poids_g;
         }
         if (!$this->poids && $this->_old->poids) {
             $this->_poids_g = $this->poids;
         }
         if ($this->poids != $this->_old->poids && $this->_poids_g != $this->poids * 1000) {
             $this->_poids_g = $this->poids * 1000;
         }
     }
     if (!$this->_id) {
         if (!$this->user_id) {
             $this->user_id = CMediusers::get()->_id;
         }
         if (!$this->creation_date) {
             $this->creation_date = CMbDT::dateTime();
         }
         if ($this->datetime == 'now') {
             $this->datetime = $this->creation_date;
         }
     }
     if (!$this->_id && !$this->_new_constantes_medicales) {
         $this->updatePlainFields();
         $constante = new CConstantesMedicales();
         $constante->patient_id = $this->patient_id;
         $constante->context_class = $this->context_class;
         $constante->context_id = $this->context_id;
         if ($constante->loadMatchingObject()) {
             foreach (CConstantesMedicales::$list_constantes as $type => $params) {
                 if (empty($this->{$type}) && !empty($constante->{$type})) {
                     $this->{$type} = $constante->{$type};
                 }
             }
             $this->_id = $constante->_id;
         }
     }
     return parent::store();
 }
コード例 #21
0
// 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");
$grossesse_id = CValue::get("grossesse_id");
$consult_related_id = CValue::get("consult_related_id");
// L'utilisateur est-il un praticien
$user = $chir = CMediusers::get();
if ($chir->isPraticien() and !$chir_id) {
    $chir_id = $chir->user_id;
}
// Chargement du praticien
$chir = new CMediusers();
if ($chir_id) {
    $testChir = new CMediusers();
    $testChir->load($chir_id);
    if ($testChir->isPraticien()) {
        $chir = $testChir;
    }
}
$chir->loadRefFunction();
$prat = $chir;
// Chargement du patient
コード例 #22
0
 * @license    GNU General Public License, see http://www.gnu.org/licenses/gpl.html
 * @version    $Revision: 23335 $
 */
CCanDo::check();
$ds = CSQLDataSource::get("ccamV2");
$object_id = CValue::get("object_id");
$object_class = CValue::get("object_class");
$code = CValue::post("code");
$executant_id = CValue::post("executant_id");
// Chargement de l'object
/** @var CCodable $object */
$object = new $object_class();
$object->load($object_id);
// Chargement de ses actes NGAP
$object->countActes();
$praticien = CMediusers::get($executant_id);
$praticien->loadRefFunction();
$praticien->spec_cpam_id ? $spe_undefined = false : ($spe_undefined = true);
$praticien->spec_cpam_id ? $spe = $praticien->spec_cpam_id : ($spe = 1);
// Creation de la requete permettant de retourner tous les codes correspondants
if ($code) {
    $sql = "SELECT c.`code`, c.`libelle`, c.`lettre_cle`, t.`tarif`\r\n  FROM `codes_ngap` as c, `tarif_ngap` as t, `specialite_to_tarif_ngap` as s\r\n  WHERE c.`code` LIKE ?1 AND t.`code` = c.`code` AND t.`zone` = ?2 AND s.`specialite` = ?3 AND t.`tarif_ngap_id` = s.`tarif_id`";
    if (!$object->_count_actes) {
        $sql .= " AND c.`lettre_cle` = '1' ";
    }
}
$sql = $ds->prepare($sql, addslashes($code) . '%', CActeNGAP::getZone($praticien->_ref_function), $spe);
$result = $ds->loadList($sql, null);
// Création du template
$smarty = new CSmartyDP();
$smarty->debugging = false;
コード例 #23
0
 /**
  * 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'&eacute;tablissement"] = array();
     foreach ($aidesGroup as $aideGroup) {
         if ($aideGroup->depend_value_1 == $modeleType || $aideGroup->depend_value_1 == "") {
             $this->helpers["Aide de l'&eacute;tablissement"][CMbString::htmlEntities($aideGroup->name)] = CMbString::htmlEntities($aideGroup->text);
         }
     }
 }
コード例 #24
0
$next_month_fin = CMbDT::date("+1 month", $month_fin);
$next_month_fin = CMbDT::date("-1 day", $next_month_fin);
$listPrat = new CMediusers();
$listPrat = $listPrat->loadPraticiens(PERM_READ);
$listSpec = new CFunctions();
$listSpec = $listSpec->loadSpecialites(PERM_READ, 1);
$bloc = new CBlocOperatoire();
$group = CGroups::loadCurrent();
$where = array();
$where["group_id"] = "= '{$group->_id}'";
/** @var CBlocOperatoire[] $listBlocs */
$listBlocs = $bloc->loadListWithPerms(PERM_READ, $where, "nom");
foreach ($listBlocs as &$bloc) {
    $bloc->loadRefsSalles();
}
$praticien = CMediusers::get();
// Création du template
$smarty = new CSmartyDP("modules/dPbloc");
$smarty->assign("praticien", $praticien);
$smarty->assign("chir", $praticien->user_id);
$smarty->assign("filter", $filter);
$smarty->assign("filterSejour", $filterSejour);
$smarty->assign("now", $now);
$smarty->assign("tomorrow", $tomorrow);
$smarty->assign("j2", $j2);
$smarty->assign("j3", $j3);
$smarty->assign("next_week_deb", $next_week_deb);
$smarty->assign("next_week_fin", $next_week_fin);
$smarty->assign("week_deb", $week_deb);
$smarty->assign("week_fin", $week_fin);
$smarty->assign("month_deb", $month_deb);
コード例 #25
0
ファイル: ajax_lock_sortie.php プロジェクト: fbone/mediboard4
<?php

/**
 * $Id$
 *  
 * @category SalleOp
 * @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();
$curr_user = CMediusers::get();
$anesths = $curr_user->loadAnesthesistes();
$smarty = new CSmartyDP();
$smarty->assign("anesths", $anesths);
$smarty->display("inc_lock_sortie.tpl");
コード例 #26
0
 * @subpackage SSR
 * @author     SARL OpenXtrem <*****@*****.**>
 * @license    GNU General Public License, see http://www.gnu.org/licenses/gpl.html
 * @version    $Revision:$
 */
CCanDo::checkRead();
$prescription_id = CValue::get("prescription_id");
$category_id = CValue::get("category_id");
$full_line_id = CValue::get("full_line_id");
$order = "debut ASC";
$ljoin["element_prescription"] = "prescription_line_element.element_prescription_id = element_prescription.element_prescription_id";
$where["prescription_id"] = " = '{$prescription_id}'";
$where["element_prescription.category_prescription_id"] = " = '{$category_id}'";
$lines = array();
$line = new CPrescriptionLineElement();
$_lines[$category_id] = $line->loadList($where, $order, null, null, $ljoin);
foreach ($_lines[$category_id] as $_line) {
    /* @var CPrescriptionLineElement $_line*/
    $_line->getRecentModification();
    $lines[$category_id][$_line->element_prescription_id][] = $_line;
}
$current_user = CMediusers::get();
$can_edit_prescription = $current_user->isPraticien() || $current_user->isAdmin();
// Création du template
$smarty = new CSmartyDP();
$smarty->assign("full_line_id", $full_line_id);
$smarty->assign("lines", $lines);
$smarty->assign("category_id", $category_id);
$smarty->assign("nodebug", true);
$smarty->assign("can_edit_prescription", $can_edit_prescription);
$smarty->display("inc_list_lines.tpl");
コード例 #27
0
 *
 * @package    Mediboard
 * @subpackage PlanningOp
 * @author     SARL OpenXtrem <*****@*****.**>
 * @license    GNU General Public License, see http://www.gnu.org/licenses/gpl.html
 * @version    $Revision: 24664 $
 */
global $dialog;
if ($dialog) {
    CCanDo::checkRead();
} else {
    CCanDo::checkEdit();
}
// L'utilisateur est-il chirurgien?
$chir_id = CValue::getOrSession("chir_id");
$mediuser = CMediusers::get($chir_id);
if (!$mediuser->isPraticien()) {
    $mediuser = new CMediusers();
}
$function_id = CValue::getOrSession("function_id");
$type = CValue::getOrSession("type", "interv");
$page = CValue::get("page");
$sejour_type = CValue::get("sejour_type");
$step = 30;
$protocole = new CProtocole();
$where = array();
$chir = new CMediusers();
$chir->load($chir_id);
if ($chir->_id) {
    $chir->loadRefFunction();
    $functions = array($chir->function_id);
コード例 #28
0
 * @package    Mediboard
 * @subpackage Patients
 * @author     SARL OpenXtrem <*****@*****.**>
 * @license    GNU General Public License, see http://www.gnu.org/licenses/gpl.html
 * @version    $Revision$
 */
$salutation_id = CValue::get('salutation_id');
$object_class = CValue::get('object_class');
$object_id = CValue::get('object_id');
$salutation = new CSalutation();
$salutation->load($salutation_id);
if (!$salutation_id) {
    if (!$object_class || !in_array('CStoredObject', class_parents($object_class))) {
        CAppUI::stepAjax('common-error-Invalid class name', UI_MSG_ERROR);
    }
    $object = CStoredObject::loadFromGuid("{$object_class}-{$object_id}");
    if (!$object || !$object->_id) {
        CAppUI::stepAjax('common-error-Invalid object', UI_MSG_ERROR);
    }
    $salutation->owner_id = CMediusers::get()->_id;
    $salutation->object_class = $object_class;
    $salutation->object_id = $object_id;
}
$salutation->loadRefOwner();
$salutation->loadTargetObject();
$users = new CMediusers();
$users = $users->loadListWithPerms(PERM_EDIT, array('actif' => "= '1'"));
$smarty = new CSmartyDP();
$smarty->assign("salutation", $salutation);
$smarty->assign("object_class", $object_class);
$smarty->display("vw_edit_salutation.tpl");
コード例 #29
0
ファイル: ajax_send_mail.php プロジェクト: fbone/mediboard4
 * @category CompteRendu
 * @package  Mediboard
 * @author   SARL OpenXtrem <*****@*****.**>
 * @license  GNU General Public License, see http://www.gnu.org/licenses/gpl.html
 * @version  SVN: $Id:\$
 * @link     http://www.mediboard.org
 */
CCanDo::checkRead();
$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;
コード例 #30
0
<?php

/**
 * $Id: httpreq_vw_choix_anesth.php 24175 2014-07-28 09:17:55Z aurelie17 $
 *
 * @package    Mediboard
 * @subpackage Cabinet
 * @author     SARL OpenXtrem <*****@*****.**>
 * @license    GNU General Public License, see http://www.gnu.org/licenses/gpl.html
 * @version    $Revision: 24175 $
 */
CCanDo::checkRead();
// Utilisateur sélectionné ou utilisateur courant
$prat_id = CValue::getOrSession("chirSel", 0);
$userSel = CMediusers::get($prat_id);
$userSel->loadRefs();
$canUserSel = $userSel->canDo();
// Vérification des droits sur les praticiens
$listChir = CConsultation::loadPraticiens(PERM_EDIT);
if (!$userSel->isMedical()) {
    CAppUI::setMsg("Vous devez selectionner un professionnel de santé", UI_MSG_ALERT);
    CAppUI::redirect("m=dPcabinet&tab=0");
}
$canUserSel->needsEdit();
$selConsult = CValue::getOrSession("selConsult", 0);
$dossier_anesth_id = CValue::getOrSession("dossier_anesth_id", 0);
if (isset($_GET["date"])) {
    $selConsult = null;
    CValue::setSession("selConsult", 0);
}
$anesth = new CTypeAnesth();