Ejemplo n.º 1
0
//Répartition par journée
$values = array();
$ids = array();
if ($merge_patient) {
    $results = CPatientStateTools::getPatientMergeByDate($before, $now);
    for ($i = $number_day; $i >= 0; $i--) {
        $values["merged"][CMbDT::date("-{$i} DAYS", $now)] = 0;
    }
    foreach ($results as $_result) {
        $values["merged"][$_result["date"]] = array('count' => $_result["total"], 'ids' => $_result['ids']);
    }
} else {
    $results = CPatientStateTools::getPatientStateByDate($before, $now);
    foreach ($patient->_specs["status"]->_list as $_status) {
        for ($i = $number_day; $i >= 0; $i--) {
            $values[$_status][CMbDT::date("-{$i} DAYS", $now)] = 0;
        }
    }
    foreach ($results as $_result) {
        $values[$_result["state"]][$_result["date"]] = $_result["total"];
    }
}
$series2 = CPatientStateTools::createGraphBar($values, $number_day);
$smarty = new CSmartyDP();
$smarty->assign("graph", $series);
$smarty->assign("graph2", $series2);
$smarty->assign("total_patient", $count_patient);
$smarty->assign("_number_day", $number_day);
$smarty->assign("_date_end", $now);
$smarty->assign("_merge_patient", $merge_patient);
$smarty->display("patient_state/inc_stats_patient_state.tpl");
 * @category DPpatients
 * @package  Mediboard
 * @author   SARL OpenXtrem <*****@*****.**>
 * @license  GNU General Public License, see http://www.gnu.org/licenses/gpl.html
 * @version  $Revision$
 * @link     http://www.mediboard.org
 */
if (!CAppUI::pref("allowed_modify_identity_status")) {
    CAppUI::redirect("m=system&a=access_denied");
}
$number_day = CValue::getOrSession("_number_day", 8);
$number_day = $number_day ?: 8;
$now = CValue::getOrSession("_date_end", CMbDT::date());
$before = CMbDT::date("-{$number_day} DAY", $now);
$csv = new CCSVFile();
$line = array("Date", CAppUI::tr("CPatient.status.PROV"), CAppUI::tr("CPatient.status.DPOT"), CAppUI::tr("CPatient.status.ANOM"), CAppUI::tr("CPatient.status.CACH"), CAppUI::tr("CPatient.status.VALI"));
$csv->writeLine($line);
$results = CPatientStateTools::getPatientStateByDate($before, $now);
$values = array();
for ($i = $number_day; $i >= 0; $i--) {
    $values[CMbDT::date("-{$i} DAY", $now)] = array("PROV" => 0, "DPOT" => 0, "ANOM" => 0, "CACH" => 0, "VALI" => 0);
}
foreach ($results as $_result) {
    $values[$_result["date"]][$_result["state"]] = $_result["total"];
}
foreach ($values as $_date => $_value) {
    $line = array($_date);
    $line = array_merge($line, array_values($_value));
    $csv->writeLine($line);
}
$csv->stream("statut_patient_par_date");
Ejemplo n.º 3
0
<?php

/**
 * $Id$
 *  
 * @category DPpatients
 * @package  Mediboard
 * @author   SARL OpenXtrem <*****@*****.**>
 * @license  GNU General Public License, see http://www.gnu.org/licenses/gpl.html
 * @version  $Revision$
 * @link     http://www.mediboard.org
 */
CCanDo::checkAdmin();
$action = CValue::get("action");
$state = CValue::get("state");
switch ($action) {
    case "verifyStatus":
        $result = CPatientStateTools::verifyStatus();
        CAppUI::stepAjax("Il y a {$result} patients n'ayant pas de statut");
        break;
    case "createStatus":
        $result = CPatientStateTools::createStatus($state);
        CAppUI::stepAjax("Il y a {$result} patients dont le status a été créés");
        break;
    default:
        CAppUI::stepAjax("Action non spécifiée");
}
CAppUI::getMsg();