$date_transmission = CAppUI::conf("soins synthese transmission_date_limit", $group->_guid) ? CMbDT::dateTime() : null; $sejour->loadRefsTransmissions($cible_importante, true, false, null, $date_transmission); $sejour->loadRefsObservations(true); $sejour->loadRefsTasks(); $sejour->loadRefsNotes(); foreach ($sejour->_ref_tasks as $key => $_task) { if ($_task->realise) { unset($sejour->_ref_tasks[$key]); continue; } $_task->loadRefPrescriptionLineElement(); $_task->setDateAndAuthor(); $_task->loadRefAuthor(); $_task->loadRefAuthorRealise(); } CSejourTask::sortByDate($sejour->_ref_tasks); // Tri des transmissions par catégorie $transmissions = array(); foreach ($sejour->_ref_transmissions as $_trans) { $_trans->loadRefUser()->loadRefFunction(); $_trans->loadTargetObject(); $_trans->calculCibles(); $sort_key_pattern = "{$_trans->_class} {$_trans->user_id} {$_trans->object_id} {$_trans->object_class} {$_trans->libelle_ATC}"; $sort_key = "{$_trans->date} {$sort_key_pattern}"; $date_before = CMbDT::dateTime("-1 SECOND", $_trans->date); $sort_key_before = "{$date_before} {$sort_key_pattern}"; $date_after = CMbDT::dateTime("+1 SECOND", $_trans->date); $sort_key_after = "{$date_after} {$sort_key_pattern}"; // Aggrégation à -1 sec if (array_key_exists($sort_key_before, $transmissions)) { $sort_key = $sort_key_before;