$where["affectation.sortie"] = ">= '{$datetime_min}'"; $where["affectation.service_id"] = " = '{$service_id}'"; } else { $where["affectation.affectation_id"] = "IS NULL"; $where["sejour.group_id"] = "= '{$group->_id}'"; } $where["prescription.type"] = "= 'sejour'"; $sejours = $sejour->loadList($where, null, null, "sejour.sejour_id", $ljoin); } CStoredObject::massLoadFwdRef($sejours, "patient_id"); CStoredObject::massLoadBackRefs($sejours, "operations", "date ASC"); $dates = array(); $date_temp = CMbDT::date($datetime_min); $date_max = CMbDT::date($datetime_max); CPrescription::$mode_plan_soins = true; CPrescription::$show_inactive = false; $freq_poste = CAppUI::conf("soins plan_soins freq_postes", $group->_guid); $postes = array(); $periods = array(); $moments = array(); $dates_plan_soin = array(); $periods = ""; while ($date_temp <= $date_max) { $dates[$date_temp] = $date_temp; $date_temp = CMbDT::date("+1 day", $date_temp); } $colspan = 0; switch ($freq_poste) { case "1": case "2": case "4":