本文整理汇总了PHP中CMbDT::subTime方法的典型用法代码示例。如果您正苦于以下问题:PHP CMbDT::subTime方法的具体用法?PHP CMbDT::subTime怎么用?PHP CMbDT::subTime使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CMbDT
的用法示例。
在下文中一共展示了CMbDT::subTime方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: foreach
$liaison_sejour = "";
foreach ($sejour->loadAllLiaisonsForDay($date_planning) as $_liaison) {
$liaison_sejour .= $_liaison;
$liaison_sejour .= " | ";
}
$offset_bottom = 0;
$offset_top = 0;
//best time (horaire voulu / time_operation)
$horaire = CMbDT::time($_operation->_datetime_best);
$debut = "{$i} {$horaire}";
$debut_op = $horaire;
$fin_op = $_operation->sortie_salle ? $_operation->sortie_salle : CMbDT::addTime($_operation->temp_operation, $horaire);
$duree = CMbDT::minutesRelative($horaire, $fin_op);
// pré op
if ($_operation->presence_preop) {
$hour_debut_preop = CMbDT::subTime($_operation->presence_preop, $_operation->time_operation);
$offset_top = CMbDT::minutesRelative($hour_debut_preop, $_operation->time_operation);
$duree = $duree + $offset_top;
$debut = "{$i} {$hour_debut_preop}";
}
//post op
if ($_operation->presence_postop) {
$hour_fin_postop = CMbDT::addTime($_operation->presence_postop, $fin_op);
// Si l'heure de fin postop est inférieure à la fin de l'intervention, alors on est à la journée suivante
// On simule une fin à 23h59 afin de rester dans la même journée
$save_hour_fin_postop = "";
if ($hour_fin_postop < $fin_op) {
$save_hour_fin_postop = $hour_fin_postop;
$hour_fin_postop = "23:59:59";
}
$offset_bottom = CMbDT::minutesRelative($fin_op, $hour_fin_postop);
示例2: updateHeureUS
function updateHeureUS()
{
$this->_heure_us = $this->duree_preop ? CMbDT::subTime($this->duree_preop, $this->time_operation) : $this->time_operation;
}
示例3: loadRefConsult
/**
* Load ref consult
*
* @return CConsultation
*/
function loadRefConsult()
{
// Chargement de la consultation ATU
if (!$this->_ref_sejour) {
$this->loadRefSejour();
}
$sejour =& $this->_ref_sejour;
$sejour->loadRefsConsultations();
if (!CAppUI::conf("dPurgences create_sejour_hospit") && $this->mutation_sejour_id) {
$this->loadRefSejourMutation()->loadRefsConsultations();
$this->_ref_consult = $this->_ref_sejour_mutation->_ref_consult_atu;
} else {
$this->_ref_consult = $this->_ref_sejour->_ref_consult_atu;
}
// Calcul du l'attente
$this->_attente = $this->_presence;
if ($this->_ref_consult->_id) {
$entree = CMbDT::time($this->_ref_sejour->_entree);
$this->_attente = CMbDT::subTime(CMbDT::transform($entree, null, "%H:%M:00"), CMbDT::transform(CMbDT::time($this->_ref_consult->heure), null, "%H:%M:00"));
}
$this->_can_leave_level = $sejour->sortie_reelle ? "" : "ok";
if (!$sejour->sortie_reelle) {
if (!$this->_ref_consult->_id) {
$this->_can_leave_level = "warning";
}
// En consultation
if ($this->_ref_consult->chrono != 64) {
$this->_can_leave = -1;
$this->_can_leave_level = "warning";
} else {
if (CMbDT::time($sejour->sortie_prevue) > CMbDT::time()) {
$this->_can_leave_since = true;
$this->_can_leave = CMbDT::timeRelative(CMbDT::time(), CMbDT::time($sejour->sortie_prevue));
} else {
$this->_can_leave_about = true;
$this->_can_leave = CMbDT::timeRelative(CMbDT::time($sejour->sortie_prevue), CMbDT::time());
}
if (CAppUI::conf("dPurgences rpu_warning_time") < $this->_can_leave) {
$this->_can_leave_level = "warning";
}
if (CAppUI::conf("dPurgences rpu_warning_time") < $this->_can_leave) {
$this->_can_leave_level = "error";
}
}
}
return $this->_ref_consult;
}
示例4: reorderOp
/**
* Mise à jour des horaires en fonction de l'ordre des operations,
* et mise a jour des rank, de sorte qu'ils soient consecutifs
*
* @param int $action action
*
* @return bool
*/
function reorderOp($action = null)
{
$this->completeField("debut", "temps_inter_op", "date");
if (!count($this->_ref_operations)) {
$with_cancelled = CAppUI::conf("dPplanningOp COperation save_rank_annulee_validee");
$this->loadRefsOperations($with_cancelled, "rank, rank_voulu, horaire_voulu", true);
}
$new_time = $this->debut;
$plage_multipraticien = $this->spec_id && !$this->unique_chir;
$prev_op = new COperation();
$i = 0;
foreach ($this->_ref_operations as $op) {
// Intervention deja validée ou si on veut valider
if ($op->rank || $action & self::RANK_VALIDATE) {
$op->rank = ++$i;
// Creation des pauses si plage multi-praticien
if ($plage_multipraticien && $action & self::RANK_VALIDATE) {
if ($prev_op->_id) {
$op->time_operation = max($new_time, $op->horaire_voulu);
$prev_op->pause = CMbDT::subTime($new_time, $op->time_operation);
$prev_op->store(false);
} else {
$op->time_operation = $new_time;
}
$prev_op = $op;
} else {
$op->time_operation = $new_time;
}
// Pour faire suivre un changement de salle
if ($this->salle_id && $this->fieldModified("salle_id")) {
$op->salle_id = $this->salle_id;
}
} elseif (!$plage_multipraticien && $action & self::RANK_REORDER && ($op->horaire_voulu || $this->_reorder_up_to_interv_id)) {
// Plage monopraticien
$op->rank_voulu = ++$i;
$op->horaire_voulu = $new_time;
}
if ($this->_reorder_up_to_interv_id == $op->_id) {
$this->_reorder_up_to_interv_id = null;
}
$op->updateFormFields();
$op->store(false);
// Durée de l'operation
// + durée entre les operations
// + durée de pause
$new_time = CMbDT::addTime($op->temp_operation, $new_time);
$new_time = CMbDT::addTime($this->temps_inter_op, $new_time);
$new_time = CMbDT::addTime($op->pause, $new_time);
}
return true;
}
示例5: mappingIntervention
/**
* 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);
}
示例6: elseif
if ($count == 0) {
CAppUI::stepAjax("L'utilisateur '{$ADELI}' n'a pas été retrouvé dans Mediboard", UI_MSG_WARNING);
$results["count_erreur"]++;
continue;
} elseif ($count > 1) {
$mediusers = $mediuser->loadList($where, null, null, null, $ljoin);
$list_view = implode(", ", CMbArray::pluck($mediusers, "_view"));
CAppUI::stepAjax("Plusieurs utilisateurs correspondent à cette recherche (ADELI = {$ADELI}): %s", UI_MSG_WARNING, $list_view);
$results["count_erreur"]++;
continue;
}
$mediuser->loadObject($where, null, null, $ljoin);
// Traitement de la date/heure début, et durée de l'opération
$date_op = CMbDT::date($date_debut);
$time_op = CMbDT::time($date_debut);
$temps_op = CMbDT::subTime(CMbDT::time($date_debut), CMbDT::time($date_fin));
// Recherche de la salle
$salle = new CSalle();
$where = array("nom" => "= '{$nom_salle}'", "bloc_id" => CSQLDataSource::prepareIn(array_keys($blocs)));
if (!$salle->loadObject($where)) {
CAppUI::stepAjax("La salle '{$nom_salle}' n'a pas été retrouvée dans Mediboard", UI_MSG_WARNING);
$results["count_erreur"]++;
continue;
}
// Recherche d'une éventuelle PlageOp
$plageOp = new CPlageOp();
$plageOp->chir_id = $mediuser->_id;
$plageOp->salle_id = $salle->_id;
$plageOp->date = $date_op;
foreach ($plageOp->loadMatchingList() as $_plage) {
// Si notre intervention est dans la plage Mediboard
示例7: checkUpdateTimeAmbu
/**
* check if this need to update 'entree_prevue' and/or 'sortie_prevue' data in db for ambulatoire sejour
*
* @return bool does this need to be updated
*/
function checkUpdateTimeAmbu()
{
$do_store_sejour = false;
// check for conf and if sejour type is 'ambu'
if (!CAppUI::conf('dPplanningOp CSejour entree_pre_op_ambu', CGroups::loadCurrent()->_guid) || $this->type != 'ambu') {
return $do_store_sejour;
}
$this->loadRefsOperations();
// we need only one operation = ambu
if (count($this->_ref_operations) == 1) {
/** @var COperation $interv */
$interv = reset($this->_ref_operations);
if ($interv->time_operation == '00:00:00') {
$interv->time_operation = null;
}
if (isset($interv->presence_preop) && (isset($interv->horaire_voulu) || isset($interv->time_operation))) {
$entree_prevue = $interv->date . ' ' . CMbDT::subTime($interv->presence_preop, CValue::first($interv->time_operation, $interv->horaire_voulu));
if ($this->entree_prevue != $entree_prevue) {
$this->entree_prevue = $entree_prevue;
$do_store_sejour = true;
}
}
if (isset($interv->presence_postop) && isset($interv->temp_operation) && (isset($interv->horaire_voulu) || isset($interv->time_operation))) {
$time_postop = CMbDT::addTime($interv->temp_operation, $interv->presence_postop);
$sortie_prevue = $interv->date . ' ' . CMbDT::addTime($time_postop, CValue::first($interv->time_operation, $interv->horaire_voulu));
if ($this->sortie_prevue != $sortie_prevue) {
$this->sortie_prevue = $sortie_prevue;
$do_store_sejour = true;
}
}
if ($do_store_sejour) {
$this->updateFormFields();
}
return $do_store_sejour;
}
return null;
}
示例8: foreach
$group = CGroups::loadCurrent();
$order = "service.nom, sejour.entree_reelle";
$where["sortie_prevue"] = "BETWEEN '{$limit1}' AND '{$limit2}'";
$where["type"] = " = '{$type}'";
$where["sejour.annule"] = " = '0'";
$where["sejour.group_id"] = " = '{$group->_id}'";
/** @var CSejour[] $sejours */
$sejours = $sejour->loadList($where, $order, null, null, $ljoin);
CMbObject::massLoadFwdRef($sejours, "patient_id");
CMbObject::massLoadFwdRef($sejours, "praticien_id");
foreach ($sejours as $key => $_sejour) {
$_sejour->loadRefPatient();
$_sejour->loadRefPraticien();
$_sejour->loadRefsAffectations("sortie ASC");
$_sejour->loadRefsOperations();
$_sejour->_duree = CMbDT::subTime(CMbDT::time($_sejour->entree_reelle), CMbDT::time($_sejour->sortie_reelle));
$_sejour->_ref_last_operation->loadRefSortieLocker()->loadRefFunction();
$affectation = $_sejour->_ref_last_affectation;
if ($affectation->_id) {
$affectation->loadReflit();
$affectation->_ref_lit->loadCompleteView();
}
foreach ($_sejour->_ref_affectations as $_affect) {
$_affect->loadRefLit();
$_affect->_ref_lit->loadCompleteView();
}
}
// Création du template
$smarty = new CSmartyDP();
$smarty->assign("service_id", $service_id);
$smarty->assign("sejours", $sejours);