/** @var CDailyCheckList[] $list_check_lists */
$list_check_lists = $check_list->loadList($where, 'date DESC, date_validate DESC, object_class, object_id, type', "{$start},40", null, $ljoin);
$count_check_lists = $check_list->countList($where, null, $ljoin);
foreach ($list_check_lists as $_check_list) {
    $_check_list->loadRefListType();
    if ($_check_list->_ref_object) {
        $_check_list->_ref_object->loadRefsFwd();
    }
}
$check_list_filter = new CDailyCheckList();
$check_list_filter->object_class = $object_class;
$check_list_filter->object_id = $object_id;
$check_list_filter->_date_min = $date_min;
$check_list_filter->_date_max = $date_max;
$check_list_filter->_type = $_type;
$check_list_filter->type = $type;
$check_list_filter->loadRefsFwd();
$list_rooms = CDailyCheckList::getRooms();
$empty = new COperation();
$empty->updateFormFields();
$list_rooms["COperation"] = array($empty);
// Création du template
$smarty = new CSmartyDP();
$smarty->assign("list_check_lists", $list_check_lists);
$smarty->assign("count_check_lists", $count_check_lists);
$smarty->assign("list_rooms", $list_rooms);
$smarty->assign("check_list", $check_list);
$smarty->assign("object_guid", $object_guid);
$smarty->assign("check_list_filter", $check_list_filter);
$smarty->assign("start", $start);
$smarty->display("vw_daily_check_traceability.tpl");
 /**
  * Prepare the data to send from the given operation
  *
  * @param COperation   $operation        The operation
  * @param string       $encoding         The encoding
  * @param string       $modality         The target modality
  * @param string       $calling_ae_title The AE title who requested the worklist
  * @param CDicomConfig $dicom_config     The Exchange Dicom
  *
  * @return array
  */
 protected static function getDataFromOperation($operation, $encoding, $modality, $calling_ae_title, $dicom_config)
 {
     $patient = $operation->loadRefPatient();
     $operation->updateFormFields();
     $operation->loadRefPlageOp();
     $sejour = $operation->loadRefSejour();
     $chir = $operation->loadRefChir();
     $patient->loadIPP();
     $sejour->loadNDA();
     $libelle = "";
     if ($operation->libelle) {
         $libelle = substr($operation->libelle, 0, 64);
     } else {
         $libelle = "Pas de libellé";
     }
     $date = "";
     if ($operation->date) {
         $date = str_replace("-", "", $operation->date);
     } else {
         $date = str_replace("-", "", $operation->_ref_plageop->date);
     }
     $time = "";
     if ($operation->time_operation) {
         $time = str_replace(":", "", $operation->time_operation);
         $time .= ".000000";
     } else {
         $time = str_replace(':', '', CMbDT::time()) . '.000000';
     }
     $sejour_id = $sejour->_id;
     if ($sejour->_NDA) {
         $sejour_id = $sejour->_NDA;
     }
     $patient_id = $patient->_id;
     if ($patient->_IPP) {
         $patient_id = $patient->_IPP;
     }
     $age = intval(substr(trim($patient->_age), 0, 2));
     $chir_name = "{$chir->_user_last_name} {$chir->_user_first_name}";
     $data = array(0x8 => array(0x50 => self::encodeValue($sejour_id, $encoding)), 0x10 => array(0x10 => self::encodeValue("{$patient->nom}^{$patient->prenom}", $encoding), 0x20 => self::encodeValue("{$patient_id}", $encoding), 0x30 => self::encodeValue(str_replace("-", "", $patient->naissance), $encoding), 0x40 => self::encodeValue(strtoupper($patient->sexe), $encoding)), 0x20 => array(0xd => self::encodeValue($sejour_id, $encoding)), 0x38 => array(0x10 => self::encodeValue($sejour->_NDA, $encoding)), 0x40 => array(0x100 => array(array(array("group_number" => 0x8, "element_number" => 0x60, "value" => self::encodeValue($modality, $encoding)), array("group_number" => 0x40, "element_number" => 0x1, "value" => self::encodeValue($calling_ae_title, $encoding)), array("group_number" => 0x40, "element_number" => 0x2, "value" => self::encodeValue($date, $encoding)), array("group_number" => 0x40, "element_number" => 0x3, "value" => self::encodeValue($time, $encoding)), array("group_number" => 0x40, "element_number" => 0x6, "value" => self::encodeValue($chir_name, $encoding)), array("group_number" => 0x40, "element_number" => 0x7, "value" => self::encodeValue($libelle, $encoding)), array("group_number" => 0x40, "element_number" => 0x9, "value" => self::encodeValue($sejour_id, $encoding)))), 0x1001 => self::encodeValue($sejour_id, $encoding)));
     /* We had the field 0x0032,0x1032 if it's configured */
     if ($dicom_config->send_0032_1032) {
         if (!array_key_exists(0x32, $data)) {
             $data[0x32] = array();
         }
         $data[0x32][0x1032] = self::encodeValue($chir_name, $encoding);
         /* Add the field into the sequence of item 0x0040,0x0100 */
         /*$data[0x0040][0x0100][0][] = array(
             "group_number" => 0x0032,
             "element_number" => 0x1032, "value" => self::encodeValue($chir_name, $encoding)
           );*/
     }
     return $data;
 }
 * $Id$
 *
 * @package    Mediboard
 * @subpackage SalleOp
 * @author     SARL OpenXtrem <*****@*****.**>
 * @license    GNU General Public License, see http://www.gnu.org/licenses/gpl.html
 * @version    $Revision$
 */
CCanDo::checkEdit();
$operation_id = CValue::get("operation_id", 0);
$operation = new COperation();
$operation->load($operation_id);
if ($operation->_id) {
    $operation->loadRefPraticien();
    $operation->loadRefsActes();
    $operation->updateFormFields();
    // Récupération des tarifs
    /** @var CTarif $tarif */
    $tarif = new CTarif();
    $tarifs = array();
    $order = "description";
    $where = array();
    $where["chir_id"] = "= '{$operation->chir_id}'";
    $tarifs["user"] = $tarif->loadList($where, $order);
    foreach ($tarifs["user"] as $_tarif) {
        $_tarif->getPrecodeReady();
    }
    $where = array();
    $where["function_id"] = "= '{$operation->chir_id}'";
    $tarifs["func"] = $tarif->loadList($where, $order);
    foreach ($tarifs["func"] as $_tarif) {