本文整理汇总了PHP中CSejour::loadRefEtablissement方法的典型用法代码示例。如果您正苦于以下问题:PHP CSejour::loadRefEtablissement方法的具体用法?PHP CSejour::loadRefEtablissement怎么用?PHP CSejour::loadRefEtablissement使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CSejour
的用法示例。
在下文中一共展示了CSejour::loadRefEtablissement方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: 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);
}
示例2: canAccess
/**
* check if we can access to the view following the configuration and already granted.
*
* @param CSejour $sejour sejour object
*
* @return bool
*/
static function canAccess($sejour)
{
$group = $sejour->loadRefEtablissement();
$user = CMediusers::get();
//check for config and elements
if (!$sejour->_id || !CAppUI::conf("admin CBrisDeGlace enable_bris_de_glace", $group) || $sejour->praticien_id == $user->_id || !$user->use_bris_de_glace) {
return true;
}
$today = CMbDT::date();
$bris = new self();
$where = array();
$where["date"] = " BETWEEN '{$today} 00:00:00' AND '{$today} 23:59:59'";
$where["object_class"] = " = 'CSejour'";
$where["object_id"] = " = '{$sejour->_id}'";
$where["user_id"] = " = '{$user->_id}'";
// no need of bris de glace
if ($bris->countList($where)) {
return true;
}
return false;
}
示例3: getPL
/**
* Get PL : person location
*
* @param CInteropReceiver $receiver Receiver
* @param CSejour $sejour Admit
* @param CAffectation $affectation Affectation
*
* @return array
*/
function getPL(CInteropReceiver $receiver, CSejour $sejour, CAffectation $affectation = null)
{
$group = $sejour->loadRefEtablissement();
$default_name = null;
if ($receiver && $receiver->_id && isset($receiver->_configs)) {
$default_name = $receiver->_configs["build_PV1_3_1_default"];
}
if (!$affectation) {
// Chargement de l'affectation courante
$affectation = $sejour->getCurrAffectation();
// Si on n'a pas d'affectation on va essayer de chercher la première
if (!$affectation->_id) {
$affectation = $sejour->loadRefFirstAffectation();
}
}
$affectation->loadRefLit()->loadRefChambre();
$current_uf = $sejour->getUFs(null, $affectation->_id);
$name = null;
if ($receiver && $receiver->_id && isset($receiver->_configs)) {
switch ($receiver->_configs["build_PV1_3_1"]) {
case "UF":
$name = $current_uf["hebergement"]->code;
break;
case "service":
if ($affectation->_id) {
$name = $affectation->loadRefService()->nom;
}
if (!$name) {
$name = $sejour->loadRefService()->nom;
}
break;
default:
}
}
$pl1 = $name ? $name : $default_name;
return array(array($pl1, $this->getPL2($receiver, $affectation), $this->getPL3($receiver, $affectation), $this->getGroupAssigningAuthority($sejour->loadRefEtablissement()), $this->getPL5($receiver), null, CHL7v2TableEntry::mapTo("307", $group->_id)));
}