当前位置: 首页>>代码示例>>PHP>>正文


PHP CMediusers类代码示例

本文整理汇总了PHP中CMediusers的典型用法代码示例。如果您正苦于以下问题:PHP CMediusers类的具体用法?PHP CMediusers怎么用?PHP CMediusers使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了CMediusers类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: graphConsultations

/**
 * Récupération des statistiques du nombre de consultations par mois
 * selon plusieurs filtres
 *
 * @param string $debut   Date de début
 * @param string $fin     Date de fin
 * @param int    $prat_id Identifiant du praticien
 *
 * @return array
 */
function graphConsultations($debut = null, $fin = null, $prat_id = 0)
{
    if (!$debut) {
        $debut = CMbDT::date("-1 YEAR");
    }
    if (!$fin) {
        $fin = CMbDT::date();
    }
    $rectif = CMbDT::transform("+0 DAY", $debut, "%d") - 1;
    $debutact = CMbDT::date("-{$rectif} DAYS", $debut);
    $rectif = CMbDT::transform("+0 DAY", $fin, "%d") - 1;
    $finact = CMbDT::date("-{$rectif} DAYS", $fin);
    $finact = CMbDT::date("+ 1 MONTH", $finact);
    $finact = CMbDT::date("-1 DAY", $finact);
    $pratSel = new CMediusers();
    $pratSel->load($prat_id);
    $ticks = array();
    $serie_total = array('label' => 'Total', 'data' => array(), 'markers' => array('show' => true), 'bars' => array('show' => false));
    for ($i = $debut; $i <= $fin; $i = CMbDT::date("+1 MONTH", $i)) {
        $ticks[] = array(count($ticks), CMbDT::transform("+0 DAY", $i, "%m/%Y"));
        $serie_total['data'][] = array(count($serie_total['data']), 0);
    }
    $ds = CSQLDataSource::get("std");
    $total = 0;
    $series = array();
    $query = "SELECT COUNT(consultation.consultation_id) AS total,\r\n    DATE_FORMAT(plageconsult.date, '%m/%Y') AS mois,\r\n    DATE_FORMAT(plageconsult.date, '%Y%m') AS orderitem\r\n    FROM consultation\r\n    INNER JOIN plageconsult\r\n    ON consultation.plageconsult_id = plageconsult.plageconsult_id\r\n    INNER JOIN users_mediboard\r\n    ON plageconsult.chir_id = users_mediboard.user_id\r\n    WHERE plageconsult.date BETWEEN '{$debutact}' AND '{$finact}'\r\n    AND consultation.annule = '0'";
    if ($prat_id) {
        $query .= "\nAND plageconsult.chir_id = '{$prat_id}'";
    }
    $query .= "\nGROUP BY mois ORDER BY orderitem";
    $serie = array('data' => array());
    $result = $ds->loadlist($query);
    foreach ($ticks as $i => $tick) {
        $f = true;
        foreach ($result as $r) {
            if ($tick[1] == $r["mois"]) {
                $serie["data"][] = array($i, $r["total"]);
                $serie_total["data"][$i][1] += $r["total"];
                $total += $r["total"];
                $f = false;
                break;
            }
        }
        if ($f) {
            $serie["data"][] = array(count($serie["data"]), 0);
        }
    }
    $series[] = $serie;
    // Set up the title for the graph
    $title = "Nombre de consultations";
    $subtitle = "- {$total} consultations -";
    if ($prat_id) {
        $subtitle .= " Dr {$pratSel->_view} -";
    }
    $options = CFlotrGraph::merge("bars", array('title' => utf8_encode($title), 'subtitle' => utf8_encode($subtitle), 'xaxis' => array('ticks' => $ticks), 'bars' => array('stacked' => true, 'barWidth' => 0.8)));
    return array('series' => $series, 'options' => $options);
}
开发者ID:OpenXtrem,项目名称:mediboard-test,代码行数:67,代码来源:graph_consultations.php

示例2: store

 /**
  * @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;
     }
 }
开发者ID:OpenXtrem,项目名称:mediboard_save,代码行数:28,代码来源:CAlert.class.php

示例3: logForSejour

 /**
  * 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);
 }
开发者ID:fbone,项目名称:mediboard4,代码行数:38,代码来源:CLogAccessMedicalData.class.php

示例4: loadRefMetaObject

 /**
  * Load object
  *
  * @return CMbObject|CMediusers
  */
 function loadRefMetaObject()
 {
     $this->_ref_metaobject = CMbMetaObject::loadFromGuid("{$this->object_class}-{$this->object_id}");
     if ($this->object_class == "CMediusers") {
         $this->_ref_mediuser = $this->_ref_metaobject;
         $this->_ref_mediuser->loadRefFunction();
     }
     return $this->_ref_metaobject;
 }
开发者ID:fbone,项目名称:mediboard4,代码行数:14,代码来源:CSourcePOP.class.php

示例5: getFieldAndObjectStatic

 /**
  * 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);
 }
开发者ID:OpenXtrem,项目名称:mediboard-test,代码行数:18,代码来源:CExClassConstraint.class.php

示例6: store

 /**
  * @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;
     }
 }
开发者ID:OpenXtrem,项目名称:mediboard-test,代码行数:16,代码来源:CCommandeMaterielOp.class.php

示例7: store

 /**
  * @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();
 }
开发者ID:fbone,项目名称:mediboard4,代码行数:16,代码来源:CTraitement.class.php

示例8: createEmployes

 /**
  * Crée les employés du cabinet
  *
  * @return bool
  */
 protected function createEmployes()
 {
     $param = new CParamsPaie();
     $params = $param->loadList();
     if (!is_array($params)) {
         return true;
     }
     foreach ($params as $key => $curr_param) {
         $user = new CMediusers();
         $user->load($params[$key]->employecab_id);
         $employe = new CEmployeCab();
         $employe->function_id = $user->function_id;
         $employe->nom = $user->_user_last_name;
         $employe->prenom = $user->_user_first_name;
         $employe->function = $user->_user_type;
         $employe->adresse = $user->_user_adresse;
         $employe->cp = $user->_user_cp;
         $employe->ville = $user->_user_ville;
         $employe->store();
         $params[$key]->employecab_id = $employe->employecab_id;
         $params[$key]->store();
     }
     return true;
 }
开发者ID:fbone,项目名称:mediboard4,代码行数:29,代码来源:setup.php

示例9: setDestinationActiveParticipant

 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();
 }
开发者ID:fbone,项目名称:mediboard4,代码行数:15,代码来源:CSyslogZV1Supplier.class.php

示例10: loadSalutations

 /**
  * 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');
     }
 }
开发者ID:fbone,项目名称:mediboard4,代码行数:24,代码来源:CPerson.class.php

示例11: loadAllSalutations

 /**
  * 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);
 }
开发者ID:fbone,项目名称:mediboard4,代码行数:29,代码来源:CSalutation.class.php

示例12: extractData

 /**
  * @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";
 }
开发者ID:fbone,项目名称:mediboard4,代码行数:27,代码来源:CXDSFactoryCDA.class.php

示例13: getPerm

 /**
  * @see parent::getPerm()
  */
 function getPerm($perm)
 {
     if (!isset($this->_ref_object->_id)) {
         $this->loadRefsFwd();
     }
     return $this->public ? $this->_ref_object->getPerm($perm) : $this->_ref_object->getPerm($perm) && $this->_ref_user->getPerm(PERM_EDIT);
 }
开发者ID:OpenXtrem,项目名称:mediboard-test,代码行数:10,代码来源:CNote.class.php

示例14: getPerm

 /**
  * Permission generic check
  * 
  * @param int $permType Type of permission : PERM_READ|PERM_EDIT|PERM_DENY
  * 
  * @return boolean
  */
 function getPerm($permType)
 {
     if (!$this->_ref_user) {
         $this->loadRefsFwd();
     }
     return $this->_ref_user->getPerm($permType);
 }
开发者ID:fbone,项目名称:mediboard4,代码行数:14,代码来源:CAideSaisie.class.php

示例15: getPerm

 /**
  * @see parent::getPerm()
  */
 function getPerm($permType)
 {
     if (!$this->_ref_chir || !$this->_ref_function) {
         $this->loadRefsFwd();
     }
     return $this->_ref_chir->getPerm($permType) || $this->_ref_function->getPerm($permType);
 }
开发者ID:OpenXtrem,项目名称:mediboard-test,代码行数:10,代码来源:CTarif.class.php


注:本文中的CMediusers类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。