本文整理汇总了PHP中CSQLDataSource::prepareIn方法的典型用法代码示例。如果您正苦于以下问题:PHP CSQLDataSource::prepareIn方法的具体用法?PHP CSQLDataSource::prepareIn怎么用?PHP CSQLDataSource::prepareIn使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CSQLDataSource
的用法示例。
在下文中一共展示了CSQLDataSource::prepareIn方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: deleteContentAndUpdateExchange
/**
* Delete content and update exchange
*
* @param CContentTabular $content_tabular Content tabular
* @param int $type_content_id Content ID
* @param date $date_max Date max
* @param int $max Max exchange
*
* @return int
*/
function deleteContentAndUpdateExchange(CContentTabular $content_tabular, $type_content_id, $date_max, $max)
{
$ds = $content_tabular->_spec->ds;
// Récupère les content Tabulé
$query = "SELECT cx.content_id\r\n FROM content_tabular AS cx, exchange_hl7v2 AS ec\r\n WHERE ec.`date_production` < '{$date_max}'\r\n AND ec.{$type_content_id} = cx.content_id\r\n LIMIT {$max};";
$ids = CMbArray::pluck($ds->loadList($query), "content_id");
// Suppression du contenu Tabulé
$query = "DELETE FROM content_tabular\r\n WHERE content_id " . CSQLDataSource::prepareIn($ids);
$ds->exec($query);
// Mise à jour des échanges
$query = "UPDATE exchange_hl7v2\r\n SET `{$type_content_id}` = NULL \r\n WHERE `{$type_content_id}` " . CSQLDataSource::prepareIn($ids);
$ds->exec($query);
$count = $ds->affectedRows();
return $count;
}
示例2: countForDates
/**
* count list of Op not linked to a plage
*
* @param date $start date de début
* @param date|null $end date de fin
* @param array $chir_ids chir targeted
*
* @return int number of HP found
*/
static function countForDates($start, $end = null, $chir_ids = array())
{
$d_start = $start;
$d_end = $end ? $end : $start;
$op = new COperation();
$ljoin = array();
$ljoin["sejour"] = "sejour.sejour_id = operations.sejour_id";
$where = array();
if (count($chir_ids)) {
$where["chir_id"] = CSQLDataSource::prepareIn($chir_ids);
}
$where["operations.plageop_id"] = "IS NULL";
$where["operations.date"] = "BETWEEN '{$d_start}' AND '{$d_end}'";
$where["operations.annulee"] = "= '0'";
$where["sejour.group_id"] = "= '" . CGroups::loadCurrent()->_id . "'";
/** @var COperation[] $listHorsPlage */
return $op->countList($where, null, $ljoin);
}
示例3: loadAllFor
static function loadAllFor($libelles)
{
$libelles = array_map("strtoupper", $libelles);
// Initialisation du tableau
$colors_by_libelle = array();
foreach ($libelles as $_libelle) {
$color = new self();
$color->libelle = $_libelle;
$colors_by_libelle[$_libelle] = $color;
}
$color = new self();
$where = array();
$libelles = array_map("addslashes", $libelles);
$where["libelle"] = CSQLDataSource::prepareIn($libelles);
foreach ($color->loadList($where) as $_color) {
$colors_by_libelle[$_color->libelle] = $_color;
}
return $colors_by_libelle;
}
示例4: countAlertesIntervsForSalles
/**
* count the number of alerts for this bloc
*
* @param array $key_ids list of salle keys
*
* @return int
*/
static function countAlertesIntervsForSalles($key_ids)
{
if (!count($key_ids)) {
return 0;
}
$inSalles = CSQLDataSource::prepareIn($key_ids);
$alerte = new CAlert();
$ljoin = array();
$ljoin["operations"] = "operations.operation_id = alert.object_id";
$ljoin["plagesop"] = "plagesop.plageop_id = operations.plageop_id";
$where = array();
$where["alert.object_class"] = "= 'COperation'";
$where["alert.tag"] = "= 'mouvement_intervention'";
$where["alert.handled"] = "= '0'";
$where[] = "operations.salle_id " . $inSalles . " OR plagesop.salle_id " . $inSalles . " OR (plagesop.salle_id IS NULL AND operations.salle_id IS NULL)";
return $alerte->countList($where, null, $ljoin);
}
示例5: elseif
$ljoin["facture_relance"] = "facture_relance.object_id = facture_etablissement.facture_id";
$where["facture_relance.object_class"] = " = 'CFactureEtablissement'";
}
$where["{$type_date_search}"] = "BETWEEN '{$date_min}' AND '{$date_max}'";
if (($etat_cloture == "1" || $search_easy == 3) && $type_date_search != "cloture") {
$where["cloture"] = "IS NULL";
} elseif (($etat_cloture == "2" || $search_easy == 2) && $type_date_search != "cloture") {
$where["cloture"] = "IS NOT NULL";
}
if ($no_finish_reglement || $search_easy == 6) {
$where["patient_date_reglement"] = "IS NOT NULL";
}
if ($chirSel == -1) {
$where["praticien_id"] = CSQLDataSource::prepareIn(array_keys($listChir));
} else {
$where["praticien_id"] = $chirSel ? " = '{$chirSel}'" : CSQLDataSource::prepareIn(array_keys($listChir));
}
if ($patient_id) {
$where["patient_id"] = " = '{$patient_id}' ";
}
if ($num_facture) {
$where["facture_id"] = " = '{$num_facture}' ";
}
if ($numero && !CAppUI::conf("dPfacturation Other use_search_easy") && ($etat_relance || $search_easy == 7)) {
$where["facture_relance.numero"] = " = '{$numero}'";
}
if ($search_easy == 5) {
$where["annule"] = " = '1'";
}
if ($search_easy == 1) {
$where["definitive"] = " = '1'";
示例6: CFunctions
$function_id = $user->function_id;
// Liste des fonctions disponibles
$functions = new CFunctions();
$order = "text";
$functions = $functions->loadListWithPerms(PERM_EDIT, null, $order);
// Chargement du catalogue demandé
$catalogue = new CCatalogueLabo();
$catalogue->load(CValue::getOrSession("catalogue_labo_id"));
if ($catalogue->_id && $catalogue->getPerm(PERM_EDIT)) {
$catalogue->loadRefs();
$function_id = $catalogue->function_id;
} else {
$catalogue = new CCatalogueLabo();
}
// Chargement de tous les catalogues
$where = array();
$where["pere_id"] = "IS NULL";
$where[] = "function_id IS NULL OR function_id " . CSQLDataSource::prepareIn(array_keys($functions));
$order = "identifiant";
$listCatalogues = $catalogue->loadList($where, $order);
foreach ($listCatalogues as &$_catalogue) {
$_catalogue->loadRefsDeep();
}
// Création du template
$smarty = new CSmartyDP();
$smarty->assign("canSante400", CModule::getCanDo("dPsante400"));
$smarty->assign("listCatalogues", $listCatalogues);
$smarty->assign("catalogue", $catalogue);
$smarty->assign("function_id", $function_id);
$smarty->assign("functions", $functions);
$smarty->display("vw_edit_catalogues.tpl");
示例7: CReglement
// Consultations gratuites
if (!CValue::getOrSession("cs")) {
$where[] = "du_patient + du_tiers > 0";
}
if ($date) {
//CSQLDataSource::$trace = true;
$ljoin["facture_liaison"] = "facture_liaison.facture_id = facture_etablissement.facture_id";
$ljoin["sejour"] = "facture_liaison.object_id = sejour.sejour_id";
$where["facture_liaison.facture_class"] = " = 'CFactureEtablissement'";
$where["facture_liaison.object_class"] = " = 'CSejour'";
$where["sejour.sortie"] = " LIKE '%{$date}%'";
}
// Filtre sur les praticiens
$chir_id = CValue::getOrSession("chir");
$listPrat = CConsultation::loadPraticiensCompta($chir_id);
$where["facture_etablissement.praticien_id"] = CSQLDataSource::prepareIn(array_keys($listPrat));
// Initialisation du tableau de reglements
$reglement = new CReglement();
$recapReglement["total"] = array("nb_sejours" => "0", "reste_patient" => "0", "reste_tiers" => "0", "du_patient" => "0", "du_tiers" => "0", "nb_reglement_patient" => "0", "nb_reglement_tiers" => "0", "nb_impayes_tiers" => "0", "nb_impayes_patient" => "0", "secteur1" => "0", "secteur2" => "0");
foreach (array_merge($reglement->_specs["mode"]->_list, array("")) as $_mode) {
$recapReglement[$_mode] = array("du_patient" => "0", "du_tiers" => "0", "nb_reglement_patient" => "0", "nb_reglement_tiers" => "0");
}
// Reglements via les factures d'établissement
$where["cloture"] = "IS NOT NULL";
$where["facture_etablissement.patient_id"] = "IS NOT NULL";
$order = "ouverture, praticien_id";
//mbTrace(count($where));
$facture = new CFactureEtablissement();
$listFactures = $facture->loadGroupList($where, $order, null, "facture_id", $ljoin);
$listPlages = array();
foreach ($listFactures as $_facture) {
示例8: array
$where["bloc_id"] = "= '{$bloc_id}'";
$salles = $salle->loadListWithPerms(PERM_READ, $where);
// Récupération des opérations
$ljoin = array();
$ljoin["plagesop"] = "operations.plageop_id = plagesop.plageop_id";
$where = array();
$in_salles = CSQLDataSource::prepareIn(array_keys($salles));
$where[] = "plagesop.salle_id {$in_salles} OR operations.salle_id {$in_salles}";
$where["materiel"] = "!= ''";
$where[] = " operations.date BETWEEN '{$date_min}' AND '{$date_max}'";
if ($praticien_id) {
$where["operations.chir_id"] = " = '{$praticien_id}'";
} elseif ($function_id) {
$mediuser = new CMediusers();
$users = $mediuser->loadProfessionnelDeSante(PERM_READ, $function_id);
$where["operations.chir_id"] = CSQLDataSource::prepareIn(array_keys($users));
}
$order = "operations.date, rank";
$operation = new COperation();
$ops = $operation->loadList($where, $order, null, "operation_id", $ljoin);
$operations = array();
$commande = new CCommandeMaterielOp();
foreach ($commande->_specs["etat"]->_list as $spec) {
$operations[$spec] = array();
}
foreach ($ops as $_op) {
/** @var COperation $_op */
$_op->loadRefPatient();
$_op->loadRefChir()->loadRefFunction();
$_op->loadRefPlageOp();
$_op->loadExtCodesCCAM();
示例9: CFunctions
* @author SARL OpenXtrem <dev@openxtrem.com>
* @license GNU General Public License, see http://www.gnu.org/licenses/gpl.html
* @version $Revision: 19285 $
*/
CCanDo::checkRead();
$user = CMediusers::get();
// Chargement des fontions
$function = new CFunctions();
$listFunctions = $function->loadListWithPerms(PERM_EDIT);
// Chargement du pack demandé
$pack = new CPackExamensLabo();
$pack->load(CValue::getOrSession("pack_examens_labo_id"));
if ($pack->_id && $pack->getPerm(PERM_EDIT)) {
$pack->loadRefs();
} else {
$pack = new CPackExamensLabo();
}
//Chargement de tous les packs
$where = array("function_id IS NULL OR function_id " . CSQLDataSource::prepareIn(array_keys($listFunctions)));
$where["obsolete"] = " = '0'";
$order = "libelle";
$listPacks = $pack->loadList($where, $order);
foreach ($listPacks as $key => $curr_pack) {
$listPacks[$key]->loadRefs();
}
// Création du template
$smarty = new CSmartyDP();
$smarty->assign("listFunctions", $listFunctions);
$smarty->assign("listPacks", $listPacks);
$smarty->assign("pack", $pack);
$smarty->display("vw_edit_packs.tpl");
示例10: CAffectation
}
$affectation = new CAffectation();
$affectations = $affectation->loadList($where, $order, null, null, $ljoin);
$_sejours = CStoredObject::massLoadFwdRef($affectations, "sejour_id");
$services = $services + CStoredObject::massLoadFwdRef($affectations, "service_id");
$patients = CStoredObject::massLoadFwdRef($_sejours, "patient_id");
CPatient::massCountPhotoIdentite($patients);
foreach ($affectations as $_affectation_imc) {
/* @var CAffectation $_affectation_imc*/
if (CAppUI::conf("dPhospi vue_temporelle show_imc_patient", "CService-" . $_affectation_imc->service_id)) {
$_affectation_imc->loadRefSejour()->loadRefPatient()->loadRefLatestConstantes(null, array("poids", "taille"));
}
}
// Préchargement des users
$user = new CUser();
$where = array("user_id" => CSQLDataSource::prepareIn(CMbArray::pluck($_sejours, "praticien_id")));
$users = $user->loadList($where);
$praticiens = CStoredObject::massLoadFwdRef($_sejours, "praticien_id");
CStoredObject::massLoadFwdRef($praticiens, "function_id");
CStoredObject::massCountBackRefs($affectations, "affectations_enfant");
$_operations = CStoredObject::massLoadBackRefs($sejours, "operations", "date ASC");
CStoredObject::massLoadFwdRef($_operations, "plageop_id");
loadVueTempo($sejours, $suivi_affectation, null, $operations, $date_min, $date_max, $period, $prestation_id, $functions_filter, $filter_function, $sejours_non_affectes);
if (CAppUI::conf("dPadmissions show_deficience")) {
CStoredObject::massLoadBackRefs($patients, "dossier_medical");
$dossiers = CMbArray::pluck($sejours, "_ref_patient", "_ref_dossier_medical");
CDossierMedical::massCountAntecedentsByType($dossiers, "deficience");
}
loadVueTempo($affectations, $suivi_affectation, null, $operations, $date_min, $date_max, $period, $prestation_id, $functions_filter, $filter_function, $sejours_non_affectes);
if (count($affectations) && CAppUI::conf("dPadmissions show_deficience")) {
$dossiers = CMbArray::pluck($affectations, "_ref_sejour", "_ref_patient", "_ref_dossier_medical");
示例11: loadRefsForDay
/**
* Charge la liste de plages et opérations pour un jour donné
* Analogue à CMediusers::loadRefsForDay
*
* @param string $date Date to look for
* @param bool $second_chir Use chir_2, chir_3 and chir_4
*
* @return void
*/
function loadRefsForDay($date, $second_chir = false)
{
// Liste des utilisateurs
$user = new CMediusers();
$listPrats = $user->loadPraticiens(PERM_READ);
// Liste des fonctions
$function = new CFunctions();
$listFunctions = $function->loadListWithPerms(PERM_READ);
// Plages d'opérations
$plage = new CPlageOp();
$conf_chambre_operation = $plage->conf("chambre_operation");
$ljoin = array();
$add_where = "";
$add_or_where = "";
if ($second_chir) {
$ljoin["operations"] = "plagesop.plageop_id = operations.plageop_id";
$prepare_prats = CSQLDataSource::prepareIn(array_keys($listPrats));
$add_where = "operations.chir_id " . $prepare_prats . " OR operations.chir_2_id " . $prepare_prats . " OR operations.chir_3_id " . $prepare_prats . " OR operations.chir_4_id " . $prepare_prats;
$add_or_where = " OR {$add_where}";
}
$where = array();
$where["plagesop.date"] = "= '{$date}'";
$where["plagesop.salle_id"] = "= '{$this->_id}'";
$where[] = "`plagesop`.`chir_id` " . CSQLDataSource::prepareIn(array_keys($listPrats)) . " OR `plagesop`.`spec_id` " . CSQLDataSource::prepareIn(array_keys($listFunctions)) . $add_or_where;
$order = "debut";
$this->_ref_plages = $plage->loadList($where, $order, null, "plageop_id", $ljoin);
// Chargement d'optimisation
CMbObject::massLoadFwdRef($this->_ref_plages, "chir_id");
CMbObject::massLoadFwdRef($this->_ref_plages, "anesth_id");
CMbObject::massLoadFwdRef($this->_ref_plages, "spec_id");
CMbObject::massLoadFwdRef($this->_ref_plages, "salle_id");
CMbObject::massCountBackRefs($this->_ref_plages, "notes");
CMbObject::massCountBackRefs($this->_ref_plages, "affectations_personnel");
foreach ($this->_ref_plages as $_plage) {
/** @var CPlageOp $_plage */
$_plage->loadRefChir();
$_plage->loadRefAnesth();
$_plage->loadRefSpec();
$_plage->loadRefSalle();
$_plage->makeView();
$_plage->loadRefsOperations();
$_plage->loadRefsNotes();
$_plage->loadAffectationsPersonnel();
$_plage->_unordered_operations = array();
// Chargement d'optimisation
CMbObject::massLoadFwdRef($_plage->_ref_operations, "chir_id");
$sejours = CMbObject::massLoadFwdRef($_plage->_ref_operations, "sejour_id");
CMbObject::massLoadFwdRef($sejours, "patient_id");
foreach ($_plage->_ref_operations as $operation) {
$operation->loadRefAnesth();
$operation->loadRefChirs();
$operation->loadRefPatient();
$operation->loadExtCodesCCAM();
$operation->loadRefPlageOp();
if ($conf_chambre_operation) {
$operation->loadRefAffectation();
}
// Extraire les interventions non placées
if ($operation->rank == 0) {
$_plage->_unordered_operations[$operation->_id] = $operation;
unset($_plage->_ref_operations[$operation->_id]);
}
}
}
// Interventions déplacés
$deplacee = new COperation();
$ljoin = array();
$ljoin["plagesop"] = "operations.plageop_id = plagesop.plageop_id";
$where = array();
$where["operations.plageop_id"] = "IS NOT NULL";
$where["plagesop.salle_id"] = "!= operations.salle_id";
$where["plagesop.date"] = "= '{$date}'";
$where["operations.salle_id"] = "= '{$this->_id}'";
$where[] = "`plagesop`.`chir_id` " . CSQLDataSource::prepareIn(array_keys($listPrats)) . " OR `plagesop`.`spec_id` " . CSQLDataSource::prepareIn(array_keys($listFunctions)) . $add_or_where;
$order = "operations.time_operation";
$this->_ref_deplacees = $deplacee->loadList($where, $order, null, "operation_id", $ljoin);
// Chargement d'optimisation
CMbObject::massLoadFwdRef($this->_ref_deplacees, "chir_id");
$sejours_deplacees = CMbObject::massLoadFwdRef($this->_ref_deplacees, "sejour_id");
CMbObject::massLoadFwdRef($sejours_deplacees, "patient_id");
foreach ($this->_ref_deplacees as $_deplacee) {
/** @var COperation $_deplacee */
$_deplacee->loadRefChirs();
$_deplacee->loadRefPatient();
$_deplacee->loadExtCodesCCAM();
$_deplacee->loadRefPlageOp();
}
// Hors plage
$urgence = new COperation();
$ljoin = array();
$ljoin["plagesop"] = "operations.plageop_id = plagesop.plageop_id";
//.........这里部分代码省略.........
示例12: elseif
}
// filtre sur les types de sortie
$filterType = "";
if ($type == "ambucomp") {
$filterType = "AND (`sejour`.`type` = 'ambu' OR `sejour`.`type` = 'comp')";
} elseif ($type) {
if ($type !== 'tous') {
$filterType = "AND `sejour`.`type` = '{$type}'";
}
} else {
$filterType = "AND `sejour`.`type` != 'urg' AND `sejour`.`type` != 'seances'";
}
// filtre sur les services
if (count($services_ids) && $enabled_service) {
$leftjoinService = "LEFT JOIN affectation\n ON affectation.sejour_id = sejour.sejour_id AND affectation.sortie = sejour.sortie";
$filterService = "AND affectation.service_id " . CSQLDataSource::prepareIn($services_ids);
} else {
$leftjoinService = $filterService = "";
}
// filtre sur le praticiens
if ($prat_id) {
$filterPrat = "AND sejour.praticien_id = '{$prat_id}'";
} else {
$filterPrat = "";
}
if ($only_confirmed) {
$filterConfirmed = "AND sejour.confirme IS NOT NULL";
} else {
$filterConfirmed = "";
}
$group = CGroups::loadCurrent();
示例13: date
$tab_start[$j] = date("t", mktime(0, 0, 0, $i, 1, $year));
$j++;
}
} else {
list($a, $m, $j) = explode("-", $filter->date_debut);
$debut_periode = "{$a}-{$m}-01";
$fin_periode = CMbDT::transform('+1 month', $debut_periode, '%Y-%m-%d');
$fin_periode = CMbDT::transform('-1 day', $fin_periode, '%Y-%m-%d');
}
$tableau_periode = array();
for ($i = 0; $i < CMbDT::daysRelative($debut_periode, $fin_periode) + 1; $i++) {
$tableau_periode[$i] = CMbDT::transform('+' . $i . 'day', $debut_periode, '%Y-%m-%d');
}
$where = array();
$where[] = "((date_debut >= '{$debut_periode}' AND date_debut <= '{$fin_periode}'" . ")OR (date_fin >= '{$debut_periode}' AND date_fin <= '{$fin_periode}')" . "OR (date_debut <='{$debut_periode}' AND date_fin >= '{$fin_periode}'))";
$where["user_id"] = CSQLDataSource::prepareIn(array_keys($mediusers), $filter->user_id);
$plageconge = new CPlageConge();
$plagesconge = array();
$orderby = "user_id";
/** @var CPlageConge[] $plagesconge */
$plagesconge = $plageconge->loadList($where, $orderby);
$tabUser_plage = array();
$tabUser_plage_indices = array();
foreach ($plagesconge as $_plage) {
$_plage->loadRefUser();
$_plage->_ref_user->loadRefFunction();
$_plage->_deb = CMbDT::daysRelative($debut_periode, $_plage->date_debut);
$_plage->_fin = CMbDT::daysRelative($_plage->date_debut, $_plage->date_fin) + 1;
$_plage->_duree = CMbDT::daysRelative($_plage->date_debut, $_plage->date_fin) + 1;
}
$smarty = new CSmartyDP();
示例14: CSejour
// Patients non placés
$sejour = new CSejour();
$ljoinNP = array();
$ljoinNP["affectation"] = "sejour.sejour_id = affectation.sejour_id";
$ljoinNP["patients"] = "sejour.patient_id = patients.patient_id";
$ljoinNP["users"] = "sejour.praticien_id = users.user_id";
$whereNP = array();
$whereNP["sejour.group_id"] = "= '{$group->_id}'";
$whereNP["sejour.type"] = CSQLDataSource::prepareIn($types_hospi, $type_hospi);
$whereNP["affectation.affectation_id"] = "IS NULL";
$whereNP["affectation.lit_id"] = "IS NULL";
$whereNP["sejour.annule"] = "= '0'";
if (count($services_ids)) {
// Tenir compte des affectations sans lit_id (dans le couloir du service)
unset($whereNP["affectation.affectation_id"]);
$whereNP[] = "((sejour.service_id " . CSQLDataSource::prepareIn($services_ids) . " OR sejour.service_id IS NULL) AND affectation.affectation_id IS NULL) OR " . "(affectation.lit_id IS NULL AND affectation.service_id " . CSQLDataSource::prepareIn($services_ids) . ")";
}
if ($praticien->_id) {
$whereNP["sejour.praticien_id"] = "= '{$praticien->_id}'";
}
$order = $orderNP = null;
if ($order_col == "_patient") {
$order = $orderNP = "patients.nom {$order_way}, patients.prenom, sejour.entree";
}
if ($order_col == "_praticien") {
$order = $orderNP = "users.user_last_name {$order_way}, users.user_first_name";
}
if ($order_col == "_chambre") {
$ljoin["lit"] = "lit.lit_id = affectation.lit_id";
$ljoin["chambre"] = "chambre.chambre_id = lit.chambre_id";
$order = "chambre.nom {$order_way}, patients.nom, patients.prenom, sejour.entree";
示例15: CRequest
$sejourReq = new CRequest();
$sejourReq->addLJoinClause("patients", "patients.patient_id = sejour.patient_id");
$sejourReq->addLJoinClause("users", "users.user_id = sejour.praticien_id");
$sejourReq->addWhereClause("sejour.{$filter->_horodatage}", "BETWEEN '{$filter->_date_min}' AND '{$filter->_date_max}'");
$sejourReq->addWhereClause("sejour.group_id", "= '{$group->_id}'");
$sejourReq->addWhereClause("sejour.annule", "= '0'");
// On supprime les sejours d'urgence
$sejourReq->addWhereClause("sejour.type", "!= 'urg'");
// Clause de filtre par spécialité / chir
if ($filter->_specialite or $filter->praticien_id) {
$speChirs = new CMediusers();
$speChirs = $speChirs->loadList(array("function_id" => "= '{$filter->_specialite}'"));
if (count($filter->praticien_id)) {
$sejourReq->addWhereClause("sejour.praticien_id", CSQLDataSource::prepareIn($filter->praticien_id));
} else {
$sejourReq->addWhereClause("sejour.praticien_id", CSQLDataSource::prepareIn(array_keys($speChirs)));
}
}
if ($filter->_filter_type) {
$sejourReq->addWhereClause("sejour.type", "= '{$filter->_filter_type}'");
}
if ($filter->convalescence == "o") {
$sejourReq->addWhereClause(null, "(sejour.convalescence IS NOT NULL AND sejour.convalescence != '')");
}
if ($filter->convalescence == "n") {
$sejourReq->addWhereClause(null, "(sejour.convalescence IS NULL OR sejour.convalescence = '')");
}
if ($filter->consult_accomp) {
$sejourReq->addWhereClause(null, "(sejour.consult_accomp = '" . $filter->consult_accomp . "')");
}
$sejourReq->addOrder("DATE(sejour.{$filter->_horodatage})");