Exemple #1
0
    if ($line_element_id) {
        // RDV issu d'une ligne d'élément
        $consult->sejour_id = $sejour_id;
        $line = new CPrescriptionLineElement();
        $line->load($line_element_id);
        $func_categ = reset($line->_ref_element_prescription->_ref_category_prescription->loadBackRefs("functions_category", null, "1"));
        $plageconsult = new CPlageconsult();
        $where = $ljoin = array();
        $where["pour_tiers"] = "= '1'";
        $where["date"] = "BETWEEN '" . CMbDT::date() . "' AND '" . CMbDT::date("+3 month") . "'";
        if ($func_categ) {
            $_function_id = $func_categ->function_id;
            $where["users_mediboard.function_id"] = "= '{$_function_id}'";
            $ljoin["users_mediboard"] = "users_mediboard.user_id = plageconsult.chir_id";
        }
        $nb_plages = $plageconsult->countList($where, null, $ljoin);
    }
} else {
    // Consultation existante
    $consult->load($consultation_id);
    $canConsult = $consult->canDo();
    $canConsult->needsRead("consultation_id");
    $consult->loadRefConsultAnesth();
    $consult->loadRefsNotes();
    $consult->loadRefSejour();
    $consult->loadRefPlageConsult()->loadRefs();
    $chir = $consult->loadRefPraticien();
    $pat = $consult->loadRefPatient();
    $pat->loadIdVitale();
    // Correspondants médicaux
    $correspondants = $pat->loadRefsCorrespondants();
Exemple #2
0
}
$prat = new CMediusers();
$prat->load($chirSel);
$function_prat = $prat->loadRefFunction();
$user = new CMediusers();
$nbjours = 7;
$listPlageConsult = new CPlageconsult();
$listPlageOp = new CPlageOp();
$where = array();
$where["date"] = "= '{$fin}'";
$where["chir_id"] = " = '{$chirSel}'";
$operation = new COperation();
$operation->chir_id = $chirSel;
$operation->date = $fin;
// find for day number
if (!$listPlageConsult->countList($where) && !$listPlageOp->countList($where) && !$operation->countMatchingList()) {
    $nbjours--;
    // Aucune plage le dimanche, on peut donc tester le samedi.
    $dateArr = CMbDT::date("-1 day", $fin);
    $where["date"] = "= '{$dateArr}'";
    $operation->date = $dateArr;
    if (!$listPlageConsult->countList($where) && !$listPlageOp->countList($where) && !$operation->countMatchingList()) {
        $nbjours--;
    }
}
// Instanciation du planning
$planning = new CPlanningWeek($debut, $debut, $fin, $nbjours, false, null, null, true);
if ($user->load($chirSel)) {
    $planning->title = $user->load($chirSel)->_view;
} else {
    $planning->title = "";
$debut = CMbDT::date("next monday", $debut);
$fin = CMbDT::date("next sunday", $debut);
$bank_holidays = array_merge(CMbDate::getHolidays($debut), CMbDate::getHolidays($fin));
// Nombre de jours
$nbDays = 5;
$plage = new CPlageconsult();
$whereInterv = array();
$whereHP = array();
$where = array();
$whereInterv["chir_id"] = $whereHP["chir_id"] = " = '{$chir_id}'";
$where[] = "chir_id = '{$chir_id}' OR remplacant_id = '{$chir_id}'";
$where["date"] = $whereInterv["date"] = $whereHP["date"] = "= '{$fin}'";
if ($_line_element_id) {
    $where["pour_tiers"] = "= '1'";
}
if ($plage->countList($where)) {
    $nbDays = 7;
} else {
    $where["date"] = "= '" . CMbDT::date("-1 day", $fin) . "'";
    if ($plage->countList($where)) {
        $nbDays = 6;
    }
}
//Instanciation du planning
$planning = new CPlanningWeek($debut, $debut, $fin, $nbDays, false, $print ? "1000" : "auto");
$planning->title = $prat->_view;
$planning->guid = $prat->_guid;
$planning->hour_min = "07";
$planning->hour_max = "20";
$planning->pauses = array("07", "12", "19");
$whereHP["plageop_id"] = " IS NULL";
$debut = CValue::getOrSession("debut");
$debut = CMbDT::date("last sunday", $debut);
$fin = CMbDT::date("next sunday", $debut);
$debut = CMbDT::date("+1 day", $debut);
$prev = CMbDT::date("-1 week", $debut);
$next = CMbDT::date("+1 week", $debut);
$dateArr = CMbDT::date("+6 day", $debut);
$nbDays = 7;
$listPlage = new CPlageconsult();
$whereInterv = array();
$whereHP = array();
$where = array();
$where["date"] = $whereInterv["date"] = $whereHP["date"] = "= '{$dateArr}'";
$whereInterv["chir_id"] = $whereHP["chir_id"] = "= '{$chirSel}' ";
$where[] = "chir_id = '{$chirSel}' OR remplacant_id = '{$chirSel}'";
if (!$listPlage->countList($where)) {
    $nbDays--;
    // Aucune plage le dimanche, on peut donc tester le samedi.
    $dateArr = CMbDT::date("+5 day", $debut);
    $where["date"] = "= '{$dateArr}'";
    if (!$listPlage->countList($where)) {
        $nbDays--;
    }
}
$bank_holidays = array_merge(CMbDate::getHolidays($debut), CMbDate::getHolidays($fin));
// Planning Week
$planning = new CPlanningWeek($debut, $debut, $fin, $nbDays, false, "auto");
$user = new CMediusers();
$user->load($chirSel);
if ($user->_id) {
    $user->loadRefFunction();
Exemple #5
0
 * $Id$
 *
 * @package    Mediboard
 * @subpackage Cabinet
 * @author     SARL OpenXtrem <*****@*****.**>
 * @license    GNU General Public License, see http://www.gnu.org/licenses/gpl.html
 * @version    $Revision$
 */
CCanDo::checkAdmin();
$praticien_id = CValue::get("praticien_id");
$date = CValue::get("date", CMbDT::date("+5 year"));
$limit = CValue::get("limit", 100);
$plage = new CPlageconsult();
$plage->_spec->loggable = false;
$where = array();
if ($praticien_id) {
    $where["plageconsult.chir_id"] = "= '{$praticien_id}'";
}
$where["plageconsult.date"] = "> '{$date}'";
$count = $plage->countList($where);
CAppUI::setMsg("'{$count}' plages à supprimer après '{$date}'", UI_MSG_OK);
/** @var CPlageconsult[] $listPlages */
$listPlages = $plage->loadList($where, null, $limit);
foreach ($listPlages as $_plage) {
    if ($msg = $_plage->delete()) {
        CAppUI::setMsg("Plage non supprimée", UI_MSG_ERROR);
    } else {
        CAppUI::setMsg("Plage supprimée", UI_MSG_OK);
    }
}
echo CAppUI::getMsg();
Exemple #6
0
$date_min = CMbDT::date();
$date_max = CMbDT::date("+6 weeks");
$criteres = array();
$details = array();
$praticiens = $user->isPraticien() ? array($user) : $user->loadPraticiens(PERM_EDIT, $user->function_id);
$group = CGroups::loadCurrent();
$cidc = $group->loadLastId400("eCap")->id400;
foreach ($praticiens as $_praticien) {
    $_praticien->loadRefFunction()->loadRefGroup();
    //----- Level 1
    // Plages de consultations
    $where = array();
    $where["date"] = "BETWEEN '{$date_min}' AND '{$date_max}'";
    $where["chir_id"] = "= '{$_praticien->_id}'";
    $plage = new CPlageconsult();
    $criteres["level1"]["plages"][$_praticien->_id] = $plage->countList($where);
    // Connexion LDAP
    $idex = CIdSante400::getMatchFor($_praticien->_ref_user, "ldap");
    $criteres["level1"]["ldap"][$_praticien->_id] = $idex->_id ? true : false;
    // Critères eCap
    if (CModule::getActive("ecap")) {
        // Identifiants CPRT
        $idex = CIdSante400::getMatchFor($_praticien, "eCap CIDC:{$cidc}");
        $criteres["level1"]["cprt"][$_praticien->_id] = $idex->_id ? true : false;
        // Paramétrage eCap (appel d'un web service)
        $criteres["level1"]["ecap"][$_praticien->_id] = null;
    }
    // Vue offline paramétrée et accessible
    $criteres["level1"]["offline"][$_praticien->_id] = false;
    //----- Level 2
    // Aides à la saisie