$from_date = CAppUI::pref("today_ref_consult_multiple") ? CMbDT::date() : $consult->_date; $where["date"] = ">= '{$from_date}'"; $where["chrono"] = "< '48'"; $where["annule"] = "= '0'"; $following_consultations = $pat->loadRefsConsultations($where); unset($following_consultations[$consult->_id]); //removing the targeted consultation foreach ($following_consultations as $_consultation) { $_consultation->loadRefPraticien()->loadRefFunction(); $_consultation->canEdit(); } } // Affichage de l'autocomplete des éléments de prescription $display_elt = false; if (CModule::getActive("dPprescription")) { $consult->loadRefElementPrescription(); if ($consult->_id) { $task = $consult->loadRefTask(); if (!$task->_id || !$task->prescription_line_element_id) { $display_elt = true; } } else { if (!$line_element_id) { $elt = new CElementPrescription(); $elt->consultation = 1; if ($elt->countMatchingList()) { $display_elt = true; } } } }
$plage = new CPlageconsult(); if ($plageconsult_id) { $plage->load($plageconsult_id); $plage->loadRefsNotes(); $date = $plage->date; } else { $date = CValue::get("date", CMbDT::date()); } // consultation précise $consultation_target = new CConsultation(); if ($consult_id) { $consultation_target->load($consult_id); } elseif ($heure) { $consultation_target->heure = $heure; } $consultation_target->loadRefElementPrescription(); // Chargement des places disponibles $listPlace = array(); $listBefore = array(); $listAfter = array(); $next_plage = $previous_plage = new CPlageconsult(); $function_id = null; if ($plageconsult_id) { if (!$plage->plageconsult_id) { $plage->load($plageconsult_id); } $plage->loadRefsFwd(true); $function_id = $plage->_ref_chir->function_id; $plage->loadRefsConsultations(false, true, true); $plage->loadFillRate(); $plage->_ref_chir->loadRefFunction();
} //if multiple, no weekly planner if ($multipleMode) { $periods = array("day", "week", "month"); if ($period == "weekly") { $period = "month"; } } $consultation_ids = array(); // next consultations in editMultiple if ($consultation_id) { $consultation_ids = array(); $consultation_temp = new CConsultation(); $consultation_temp->load($consultation_id); $consultation_temp->loadRefPlageConsult()->loadRefChir(); $consultation_temp->loadRefElementPrescription(); // we add the first consult to the future json list (first element) if (!$consultation_temp->annule && ($consultation_temp->chrono = 16)) { $consultation_ids[] = array($consultation_temp->plageconsult_id, $consultation_temp->_id, $consultation_temp->_ref_plageconsult->date, $consultation_temp->heure, $consultation_temp->_ref_plageconsult->chir_id, utf8_encode($consultation_temp->_ref_plageconsult->_ref_chir->_view), $consultation_temp->annule, utf8_encode($consultation_temp->rques), $consultation_temp->element_prescription_id, utf8_encode($consultation_temp->element_prescription_id ? $consultation_temp->_ref_element_prescription->libelle : "")); } //edit mod if ($multiple_edit) { $plage_temp = $consultation_temp->_ref_plageconsult; $where_next = array(); $ljoin_next = array(); $limit = CAppUI::pref("NbConsultMultiple"); $date_ref = CAppUI::pref("today_ref_consult_multiple") ? CMbDT::date() : $plage_temp->date; $ljoin_next["plageconsult"] = "plageconsult.plageconsult_id = consultation.plageconsult_id"; $where_next["consultation.patient_id"] = "= '{$consultation_temp->patient_id}'"; $where_next["consultation.annule"] = "= '0'"; //only not cancelled