コード例 #1
0
        }
        $line[] = $_consult->_ref_patient->_view;
        $view = "Consultation le " . CMbDT::format($_consult->_datetime, "%d/%m/%Y");
        if ($_consult->_ref_sejour && $_consult->_ref_sejour->libelle) {
            $view .= $_consult->_ref_sejour->libelle;
        }
        $line[] = $view;
        $line[] = !$_consult->_count_actes && !$_consult->_ext_codes_ccam ? "Aucun prévu" : $_consult->_actes_non_cotes . "acte(s)";
        $actes = "";
        foreach ($_consult->_ext_codes_ccam as $code) {
            $actes .= $actes == "" ? "" : "\n";
            $actes .= "{$code->code}";
        }
        $line[] = $actes;
        $actes_cotes = "";
        foreach ($_consult->_ref_actes_ccam as $_acte) {
            $code .= $actes_cotes == "" ? "" : "\n";
            $code .= $_acte->code_acte . "-" . $_acte->code_activite . "-" . $_acte->code_phase;
            if ($_acte->modificateurs) {
                $code .= " MD:" . $_acte->modificateurs;
            }
            if ($_acte->montant_depassement) {
                $code .= " DH:" . $_acte->montant_depassement;
            }
            $actes_cotes .= "{$code}";
        }
        $line[] = $actes_cotes;
        $csv->writeLine($line);
    }
    $csv->stream("export-intervention_non_cotes-" . $debut . "-" . $fin);
}
コード例 #2
0
 * @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");
コード例 #3
0
                    $object_view = "Consultation du " . CMbDT::dateToLocale($object->_ref_plageconsult->date) . " à " . CMbDT::format($object->heure, "%Hh:%M");
                    break;
                case "CSejour":
                    $object_view = "Séjour du " . CMbDT::dateToLocale(CMbDT::date($object->entree)) . "au " . CMbDT::dateToLocale(CMbDT::date($object->sortie));
                    break;
                case "COperation":
                    $object_view = "Intervention du " . CMbDT::dateToLocale(CMbDT::date($object->_datetime_best));
            }
        }
        $content_line = "";
        if (isset($_patient->_distant_line)) {
            $content_line = $_patient->_distant_line;
        }
        $data_line = array($_patient->_view . " (" . strtoupper($_patient->sexe) . ")", $_patient->_age_epoque, $dossier_medical, $object_view, $content_line->_view, $content_line->_ref_produit->_dci_view, $content_line->_ref_produit->_ref_ATC_5_code, $content_line->_ref_produit->_ref_ATC_5_libelle, $content_line->commentaire);
        $csv->writeLine($data_line);
    }
    $period = "du_" . ($from ? $from : "_") . "_au_" . ($to ? $to : "_");
    $csv->stream("dossiers_clinique_" . $period);
    CApp::rip();
}
// Création du template
$smarty = new CSmartyDP();
$smarty->assign("one_field", $one_field);
$smarty->assign("one_field_presc", $one_field_presc);
$smarty->assign("start", $start);
$smarty->assign("user_id", $user_id);
$smarty->assign("list_patient", $list_patient);
$smarty->assign("count_patient", $count_patient);
$smarty->assign("from", $from);
$smarty->assign("to", $to);
$smarty->display("inc_recherche_dossier_clinique_results.tpl");
コード例 #4
0
    $_patient = $_ex_object->getReferenceObject("CPatient");
    $_patient->loadIPP();
    $_objects["CPatient"] = $_patient;
    /** @var CSejour $_sejour */
    $_sejour = $_ex_object->getReferenceObject("CSejour");
    $_objects["CSejour"] = $_sejour;
    /** @var COperation $_interv */
    $_interv = $_ex_object->getReferenceObject("COperation");
    $_objects["COperation"] = $_interv;
    $_row = array();
    foreach ($fields as $_field) {
        list($_class, $_fieldname) = $_field;
        if (isset($_objects[$_class])) {
            $_row[] = $_objects[$_class]->getFormattedValue($_fieldname);
        } else {
            $_row[] = null;
        }
    }
    // Meta fields
    $_row[] = $_ex_object->getFormattedValue("datetime_create");
    $_row[] = $_ex_object->getFormattedValue("datetime_edit");
    $_row[] = $_ex_object->getFormattedValue("owner_id");
    foreach ($ex_class->loadRefsGroups() as $_group) {
        foreach ($_group->_ref_fields as $_field) {
            $_row[] = $_ex_object->getFormattedValue($_field->name);
        }
    }
    $csv->writeLine($_row);
}
$csv->stream($ex_class->name, true);
コード例 #5
0
ファイル: vw_bloc2.php プロジェクト: OpenXtrem/mediboard-test
    } else {
        $_operation->_ref_salle_prevue = $_operation->_ref_salle;
        $_operation->_ref_salle_reelle = $_operation->_ref_salle;
        $_operation->_deb_plage = $_operation->date;
        $_operation->_fin_plage = $_operation->date;
    }
}
if ($mode == "csv") {
    $csvName = "stats_bloc_" . $deblist . "_" . $finlist . "_" . $bloc_id;
    $csv = new CCSVFile();
    $title = array("Date", "Salle prévue", "Salle réelle", "Début vacation", "Fin vacation", "N° d\\'ordre prévu", "N° d\\'ordre réel", "Patient", "Prise en charge", "Chirurgien", "Anesthésiste", "Libellé", "DP", "CCAM", "Type d\\'anesthésie", "Code ASA", "Placement programme", "Entrée bloc", "Entrée salle", "Début d\\'induction", "Fin d\\'induction", "Début d\\'intervention", "Fin d\\'intervention", "Sortie salle", "Patient suivant", "Entrée reveil", "Sortie reveil");
    $csv->writeLine($title);
    foreach ($operations as $_operation) {
        $line_op = array(CMbDT::date($_operation->_datetime), $_operation->_ref_salle_prevue, $_operation->_ref_salle_reelle, $_operation->_deb_plage, $_operation->_fin_plage, $_operation->rank, $_operation->_rank_reel, $_operation->_ref_sejour->_ref_patient->_view . '(' . $_operation->_ref_sejour->_ref_patient->_age . ')', $_operation->_ref_sejour->type, $_operation->_ref_chir->_view, $_operation->_ref_anesth->_view, $_operation->libelle, $_operation->_ref_sejour->DP, $_operation->codes_ccam, $_operation->_lu_type_anesth, $_operation->ASA, $_operation->_ref_workflow->date_creation, $_operation->entree_bloc, $_operation->entree_salle, $_operation->induction_debut, $_operation->induction_fin, $_operation->debut_op, $_operation->fin_op, $_operation->sortie_salle, $_operation->_pat_next, $_operation->entree_reveil, $_operation->sortie_reveil_possible);
        $csv->writeLine($line_op);
    }
    $csv->stream($csvName);
    return;
} else {
    // Création du template
    $smarty = new CSmartyDP();
    $smarty->assign("deblist", $deblist);
    $smarty->assign("finlist", $finlist);
    $smarty->assign("blocs", $blocs);
    $smarty->assign("plages", $plages);
    $smarty->assign("operations", $operations);
    $smarty->assign("nb_interv", $nb_interv);
    $smarty->assign("bloc", $bloc);
    $smarty->assign("type", $type);
    $smarty->display("vw_bloc2.tpl");
}
コード例 #6
0
<?php

/**
 * $Id$
 *
 * @package    Mediboard
 * @subpackage developpement
 * @author     SARL OpenXtrem <*****@*****.**>
 * @license    GNU General Public License, see http://www.gnu.org/licenses/gpl.html
 * @version    $Revision$
 */
$csv = new CCSVFile();
CApp::getMbClasses($instances);
foreach ($instances as $_class => $_instance) {
    if (!$_instance->_spec->table || !$_instance->_ref_module) {
        continue;
    }
    $_module = $_instance->_ref_module;
    $line = array($_class, CAppUI::tr($_class), $_instance->_spec->table, $_instance->_spec->key, $_module->mod_name, CAppUI::tr("module-{$_module->mod_name}-court"));
    $csv->writeLine($line);
}
$csv->stream("Class to table");
コード例 #7
0
    $list_traitant = $ds->loadHashList($query_traitant);
    foreach ($list_traitant as $_medecin_id => $_count) {
        if (array_key_exists($_medecin_id, $list_corresp)) {
            $list_corresp[$_medecin_id] += $_count;
        } else {
            $list_corresp[$_medecin_id] = $_count;
        }
    }
    arsort($list_corresp);
    $list = $list_corresp;
}
$where = array("medecin_id" => $ds->prepareIn(array_keys($list)));
$medecin = new CMedecin();
/** @var CMedecin[] $medecins */
$medecins = $medecin->loadList($where);
if ($csv) {
    $csvfile = new CCSVFile();
    $titles = array("Total", CAppUI::tr("CMedecin-nom"), CAppUI::tr("CMedecin-prenom"), CAppUI::tr("CMedecin-type"), CAppUI::tr("CMedecin-tel"), CAppUI::tr("CMedecin-fax"), CAppUI::tr("CMedecin-email"), CAppUI::tr("CMedecin-adresse"), CAppUI::tr("CMedecin-cp"), CAppUI::tr("CMedecin-adeli"), CAppUI::tr("CMedecin-rpps"));
    $csvfile->writeLine($titles);
    foreach ($list as $_medecin_id => $_count) {
        $_medecin = $medecins[$_medecin_id];
        $_line = array($_count, $_medecin->nom, $_medecin->prenom, $_medecin->type, $_medecin->tel, $_medecin->fax, $_medecin->email, $_medecin->adresse, $_medecin->cp, $_medecin->adeli, $_medecin->rpps);
        $csvfile->writeLine($_line);
    }
    $csvfile->stream("Médecins correspondants");
} else {
    $smarty = new CSmartyDP();
    $smarty->assign("medecins", $medecins);
    $smarty->assign("counts", $list);
    $smarty->display("inc_stats_medecins.tpl");
}
コード例 #8
0
    $ljoin["sallesbloc"] = "sallesbloc.salle_id = operations.salle_id";
    $where["sallesbloc.bloc_id"] = $ds->prepare("=?", $bloc_id);
}
if ($hors_plage) {
    $where["operations.plageop_id"] = "IS NULL";
}
if ($codes_ccam) {
    $where["operations.codes_ccam"] = $ds->prepare("LIKE %", "%{$codes_ccam}%");
}
/** @var COperation[] $interventions */
$interventions = $interv->loadList($where, null, null, "operation_id", $ljoin);
// Chargements de masse
$sejours = CMbObject::massLoadFwdRef($interventions, "sejour_id");
CMbObject::massLoadFwdRef($sejours, "patient_id");
CMbObject::massLoadFwdRef($sejours, "praticien_id");
CMbObject::massLoadFwdRef($interventions, "chir_id");
$columns = array("IPP", "Nom", "Nom naissance", "Prénom", "Date naissance", "Sexe", "Date intervention", "Libellé intervention", "Chirurgien nom", "Chirurgien prénom", "NDA", "Praticien nom", "Praticien prénom", "Date entrée", "Date sortie");
$csv = new CCSVFile();
$csv->writeLine($columns);
foreach ($interventions as $_intervention) {
    $_sejour = $_intervention->loadRefSejour();
    $_patient = $_sejour->loadRefPatient();
    $_praticien = $_sejour->loadRefPraticien();
    $_chir = $_intervention->loadRefChir();
    $_patient->loadIPP();
    $_sejour->loadNDA();
    $row = array($_patient->_IPP, $_patient->nom, $_patient->nom_jeune_fille, $_patient->prenom, $_patient->naissance, $_patient->sexe, $_intervention->libelle ?: $_intervention->codes_ccam, $_intervention->date, $_chir->_user_last_name, $_chir->_user_first_name, $_sejour->_NDA, $_praticien->_user_last_name, $_praticien->_user_first_name, $_sejour->entree, $_sejour->sortie);
    $csv->writeLine($row);
}
$csv->stream("Interventions {$date_min} - {$date_max}", true);
コード例 #9
0
 */
$chir_id = CValue::get("chir_id");
$function_id = CValue::get("function_id");
$function = new CFunctions();
$function->load($function_id);
$chir = new CMediusers();
$chir->load($chir_id);
$protocole = new CProtocole();
$protocole->chir_id = $chir_id ? $chir_id : null;
$protocole->function_id = $function_id ? $function_id : null;
/** @var CProtocole[] $protocoles */
$protocoles = $protocole->loadMatchingList("libelle");
if (!$function->_id) {
    $function = $chir->loadRefFunction();
}
$csv = new CCSVFile();
$line = array("Nom de la fonction", "Nom du praticien", "Prénom du praticien", "Motif d'hospitalisation", "Libellé du séjour", "Durée d'intervention", "Actes CCAM", "Diagnostic", "Type d'hospitalisation", "Durée d'hospitalisation", "Durée USCPO", "Durée préop", "Présence préop", "Présence postop", "UF d'hébergement", "UF de soins", "UF médicale", "Facturable", "Médical", "Exam. extempo. prévu", "Côté", "Bilan préop", "Matériel à prévoir", "Examens per-op", "Dépassement d'honoraires", "Forfait clinique", "Fournitures", "Remarques sur l'intervention", "Convalescence", "Remarques sur le séjour", "Septique", "Durée en heure d'hospitalisation", "Pathologie", "Type de prise en charge");
$csv->writeLine($line);
CMbObject::massLoadFwdRef($protocoles, "chir_id");
CMbObject::massLoadFwdRef($protocoles, "function_id");
foreach ($protocoles as $_protocole) {
    $_protocole->loadRefUfHebergement();
    $_protocole->loadRefUfMedicale();
    $_protocole->loadRefUfSoins();
    $_protocole->loadRefChir();
    $_protocole->loadRefFunction();
    $_line = array($_protocole->_ref_function->text, $_protocole->_ref_chir->_user_last_name, $_protocole->_ref_chir->_user_first_name, $_protocole->libelle, $_protocole->libelle_sejour, CMbDT::transform($_protocole->temp_operation, null, "%H:%M"), $_protocole->codes_ccam, $_protocole->DP, $_protocole->type, $_protocole->duree_hospi, $_protocole->duree_uscpo, $_protocole->duree_preop ? CMbDT::transform($_protocole->duree_preop, null, "%H:%M") : "", $_protocole->presence_preop ? CMbDT::transform($_protocole->presence_preop, null, "%H:%M") : "", $_protocole->presence_postop ? CMbDT::transform($_protocole->presence_postop, null, "%H:%M") : "", $_protocole->_ref_uf_hebergement->code, $_protocole->_ref_uf_medicale->code, $_protocole->_ref_uf_soins->code, $_protocole->facturable, $_protocole->for_sejour, $_protocole->exam_extempo, $_protocole->cote, $_protocole->examen, $_protocole->materiel, $_protocole->exam_per_op, $_protocole->depassement, $_protocole->forfait, $_protocole->fournitures, $_protocole->rques_operation, $_protocole->convalescence, $_protocole->rques_sejour, $_protocole->septique, $_protocole->duree_heure_hospi, $_protocole->pathologie, $_protocole->type_pec);
    $csv->writeLine($_line);
}
$csv->stream("export-protocoles-" . ($chir_id ? $chir->_view : $function->text));
コード例 #10
0
 * @link     http://www.mediboard.org
 */
CCanDo::checkEdit();
$only_with_emails = CValue::get("only_with_emails", 1);
$csv = new CCSVFile();
$medecin = new CMedecin();
$ds = $medecin->getDS();
$line = array_keys($medecin->getPlainFields());
$csv->writeLine($line);
$where = array();
if ($only_with_emails) {
    $where[] = "email IS NOT NULL OR email_apicrypt IS NOT NULL";
}
$request = new CRequest();
$request->addWhere($where);
// Disable query buffer, to save memory
if ($ds instanceof CPDOMySQLDataSource) {
    $ds->link->setAttribute(PDO::MYSQL_ATTR_USE_BUFFERED_QUERY, false);
}
$query = $request->makeSelect($medecin);
$res = $ds->exec($query);
while ($data = $ds->fetchAssoc($res)) {
    $_new_data = array();
    foreach ($line as $_field) {
        $_new_data[] = $data[$_field];
    }
    $csv->writeLine($_new_data);
}
$name = "Correspondants médicaux - " . CMbDT::dateTime();
$csv->stream($name, true);
コード例 #11
0
ファイル: export_csv_array.php プロジェクト: fbone/mediboard4
<?php

/**
 * $Id$
 *
 * @package    Mediboard
 * @subpackage System
 * @author     SARL OpenXtrem <*****@*****.**>
 * @license    GNU General Public License, see http://www.gnu.org/licenses/gpl.html
 * @version    $Revision$
 */
$data = CValue::post("data");
$filename = CValue::post("filename", "data");
$data = stripslashes($data);
$data = json_decode(utf8_encode($data), true);
$csv = new CCSVFile(null, "excel");
foreach ($data as $_line) {
    $csv->writeLine($_line);
}
$csv->stream($filename);
CApp::rip();