Пример #1
0
 /**
  * Génére un xml d'après un jeu de valeurs
  *
  * @param String $file chemin du fichier
  * @param String $path Chemin du répertoire
  *
  * @return void
  */
 static function jvToXML($file, $path)
 {
     $name = self::deleteDate(basename($file));
     $csv = new CCSVFile($file);
     $csv->jumpLine(3);
     $xml = new CXDSXmlJvDocument();
     while ($line = $csv->readLine()) {
         list($oid, $code, $code_xds, ) = $line;
         $xml->appendLine($oid, $code, $code_xds);
     }
     $xml->save("{$path}/{$name}.xml");
 }
 *  
 * @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);
}
Пример #3
0
/**
 * import the patient file
 *
 * @param string   $file        path to the file
 * @param int      $start       start int
 * @param int      $count       number of iterations
 * @param resource $file_import file for report
 *
 * @return null
 */
function importFile($file, $start, $count, $file_import)
{
    $fp = fopen($file, 'r');
    $csv_file = new CCSVFile($fp);
    $csv_file->column_names = $csv_file->readLine();
    if ($start == 0) {
        $start++;
    } elseif ($start > 1) {
        $csv_file->jumpLine($start);
    }
    $group_id = CGroups::loadCurrent()->_id;
    $treated_line = 0;
    while ($treated_line < $count) {
        $treated_line++;
        $patient = new CPatient();
        $_patient = $csv_file->readLine(true);
        if (!$_patient) {
            CAppUI::stepAjax('Importation terminée', UI_MSG_OK);
            CApp::rip();
        }
        $patient->bind($_patient);
        $patient->loadFromIPP($group_id);
        if ($patient->_id) {
            $start++;
            continue;
        }
        $nom = $_patient['nom'] ? $_patient['nom'] : $_patient['nom_jeune_fille'];
        if (!$patient->nom) {
            if ($patient->nom_jeune_fille) {
                $patient->nom = $patient->nom_jeune_fille;
            } else {
                CMbDebug::log("Ligne #{$start} : Pas de nom");
                $start++;
                continue;
            }
        }
        $naissance = null;
        if ($patient->naissance) {
            $naissance = preg_replace('/(\\d{2})\\/(\\d{2})\\/(\\d{4})/', '\\3-\\2-\\1', $patient->naissance);
            $patient->naissance = $naissance;
        }
        $patient->repair();
        if (!$patient->naissance) {
            CMbDebug::log($_patient);
            CMbDebug::log("Ligne #{$start} : Date de naissance invalide ({$_patient['naissance']})");
            $start++;
            continue;
        }
        $patient->loadMatchingPatient();
        if (!$patient->_id) {
            $patient->bind($_patient);
            $patient->nom = $nom;
            $patient->naissance = $naissance;
            $patient->tel = preg_replace("/[^0-9]/", "", $patient->tel);
            $patient->tel_autre = preg_replace("/[^0-9]/", "", $patient->tel_autre);
            $patient->sexe = strtolower($patient->sexe);
            $patient->repair();
            if ($msg = $patient->store()) {
                CMbDebug::log($patient, null, true);
                CMbDebug::log("Ligne #{$start} :{$msg}");
                $start++;
                continue;
            }
        }
        $ipp = CIdSante400::getMatch($patient->_class, CPatient::getTagIPP($group_id), $patient->_IPP, $patient->_id);
        if ($ipp->_id && $ipp->id400 != $patient->_IPP) {
            CMbDebug::log("Ligne #{$start} : Ce patient possède déjà un IPP ({$ipp->id400})");
            $start++;
            continue;
        }
        if (!$ipp->_id) {
            if ($msg = $ipp->store()) {
                CMbDebug::log("Ligne #{$start} :{$msg}");
                $start++;
                continue;
            }
        }
        CAppUI::setMsg('CPatient-msg-create', UI_MSG_OK);
    }
    echo CAppUI::getMsg();
}
}
$consultations = CModelObject::naturalSort($consultations, array("_date"));
if (!$export) {
    $smarty = new CSmartyDP();
    $smarty->assign("totals", $totals);
    $smarty->assign("interventions", $interventions);
    $smarty->assign("consultations", $consultations);
    $smarty->assign("debut", $debut);
    $smarty->assign("fin", $fin);
    $smarty->assign("all_prats", $all_prats);
    $smarty->assign("board", CValue::get("board", 0));
    $smarty->assign('interv_with_no_codes', $interv_with_no_codes);
    $smarty->assign('display_not_exported', CValue::get('display_not_exported', 0));
    $smarty->display("../../dPboard/templates/inc_list_interv_non_cotees.tpl");
} else {
    $csv = new CCSVFile();
    $line = array("Praticiens", "Patient", "Evènement", "Actes Non cotés", "Codes prévus", "Actes cotés");
    if (!$all_prats) {
        unset($line[0]);
    }
    $csv->writeLine($line);
    foreach ($interventions as $_interv) {
        $line = array();
        if ($all_prats) {
            $chir = $_interv->_ref_chir->_view;
            if ($_interv->_ref_anesth->_id) {
                $chir .= "\n" . $_interv->_ref_anesth->_view;
            }
            $line[] = $chir;
        }
        $line[] = $_interv->_ref_patient->_view;
Пример #5
0
    $_ex->load();
    $_ex->updateCreationFields();
    $guid = "{$_ex->object_class}-{$_ex->object_id}";
    if (!isset($ref_objects_cache[$guid])) {
        $_ex->loadTargetObject();
        $ref_objects_cache[$guid] = $_ex->_ref_object;
    } else {
        $_ex->_ref_object = $ref_objects_cache[$guid];
    }
    if ($_ex->additional_id) {
        $_ex->loadRefAdditionalObject();
    }
    $ex_objects[$_ex->_id] = $_ex;
}
krsort($ex_objects);
$csv = new CCSVFile();
$get_field = function ($class, $field) {
    return CAppUI::tr($class) . " - " . CAppUI::tr("{$class}-{$field}");
};
$fields = array(array("CPatient", "_IPP"), array("CPatient", "nom"), array("CPatient", "nom_jeune_fille"), array("CPatient", "prenom"), array("CPatient", "prenom_2"), array("CPatient", "prenom_3"), array("CPatient", "prenom_4"), array("CPatient", "naissance"), array("CPatient", "sexe"), array("CSejour", "_NDA"), array("CSejour", "rques"), array("CSejour", "praticien_id"), array("CSejour", "type"), array("CSejour", "entree"), array("CSejour", "sortie"), array("CSejour", "annule"), array("CSejour", "DP"), array("CSejour", "DR"), array("COperation", "chir_id"), array("COperation", "anesth_id"), array("COperation", "salle_id"), array("COperation", "date"), array("COperation", "libelle"), array("COperation", "cote"), array("COperation", "temp_operation"), array("COperation", "codes_ccam"));
$meta_fields = array(array("CExObject", "datetime_create"), array("CExObject", "datetime_edit"), array("CExObject", "owner_id"));
$row = array();
foreach ($fields as $_field) {
    $row[] = $get_field($_field[0], $_field[1]);
}
foreach ($meta_fields as $_field) {
    $row[] = $get_field($_field[0], $_field[1]);
}
foreach ($ex_class->loadRefsGroups() as $_group) {
    foreach ($_group->_ref_fields as $_field) {
        $row[] = $_group->name . " - " . CAppUI::tr("CExObject_{$ex_class->_id}-{$_field->name}");
Пример #6
0
    CApp::rip();
}
$files = glob("{$path}/*.jv");
$lineCount = 0;
foreach ($files as $_file) {
    $name = basename($_file);
    $name = substr($name, strpos($name, "_") + 1);
    $table = substr($name, 0, strrpos($name, "."));
    $table = strtolower($table);
    if (!$ds) {
        CAppUI::stepAjax("Import impossible - Source non présente", UI_MSG_ERROR);
        continue;
    }
    $ds->query("CREATE TABLE IF NOT EXISTS `{$table}` (\r\n                `table_id` INT (11) UNSIGNED NOT NULL auto_increment PRIMARY KEY,\r\n                `code` VARCHAR (255) NOT NULL,\r\n                `oid` VARCHAR (255) NOT NULL,\r\n                `libelle` VARCHAR (255) NOT NULL,\r\n                INDEX (`table_id`)\r\n              )/*! ENGINE=MyISAM */;");
    $ds->query("DELETE FROM `{$table}`");
    $csv = new CCSVFile($_file);
    $csv->jumpLine(3);
    while ($line = $csv->readLine()) {
        list($oid, $code, $libelle) = $line;
        if (strpos($code, "/") === false || $oid === "1.2.250.1.213.1.1.4.6") {
            continue;
        }
        $query = "INSERT INTO `{$table}`(\r\n        `code`, `oid`, `libelle`)\r\n        VALUES (?1, ?2, ?3);";
        $query = $ds->prepare($query, $code, $oid, $libelle);
        $result = $ds->query($query);
        if (!$result) {
            $msg = $ds->error();
            CAppUI::displayAjaxMsg("Erreur de requête SQL: {$msg}", UI_MSG_ERROR);
            CApp::rip();
        }
        $lineCount++;
            }
        }
        $list_patient[] = $pat;
    }
    // Le count total
    $request->select = array("count(*)");
    $request->limit = null;
    $count_patient = $ds->loadResult($request->makeSelect());
    if (!$commentaire && $one_field_presc) {
        $request_b->select = array("count(*)");
        $request_b->limit = null;
        $count_patient += $ds->loadResult($request_b->makeSelect());
    }
}
if ($export) {
    $csv = new CCSVFile();
    $titles = array("Patient", "Age à l'époque", "Dossier Médical", "Evenement", "Prescription", "DCI", "Code ATC", "Libellé ATC", "Commentaire / Motif");
    $csv->writeLine($titles);
    foreach ($list_patient as $_patient) {
        $dossier_medical = "";
        if (isset($_patient->_ref_antecedent)) {
            $dossier_medical .= "Antécédents :\n {$_patient->_ref_traitement}->_view";
        } elseif (isset($_patient->_refs_antecedents) && count($_patient->_refs_antecedents)) {
            $dossier_medical .= "Antécédents :\n";
            foreach ($_patient->_refs_antecedents as $_antecedent) {
                if ($_antecedent->type == "alle") {
                    continue;
                }
                $dossier_medical .= $_antecedent->_view . "\n";
            }
        }
 * @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
 */
$mode_class = CValue::get("mode_class");
$file = CValue::read($_FILES, "import");
$smarty = new CSmartyDP();
$smarty->assign("mode_class", $mode_class);
if (!$file) {
    $smarty->display("inc_import_mode_entree_sortie_sejour.tpl");
    CApp::rip();
}
$group_id = CGroups::loadCurrent()->_id;
$csv = new CCSVFile($file["tmp_name"], CCSVFile::PROFILE_EXCEL);
$csv->readLine();
while ($line = $csv->readLine()) {
    list($code, $libelle, $mode, $actif) = $line;
    /** @var CModeEntreeSejour|CModeSortieSejour $mode_entree_sortie */
    $mode_entree_sortie = new $mode_class();
    $mode_entree_sortie->code = $code;
    $mode_entree_sortie->libelle = $libelle;
    $mode_entree_sortie->mode = $mode;
    $mode_entree_sortie->group_id = $group_id;
    $mode_entree_sortie->loadMatchingObject();
    $mode_entree_sortie->actif = $actif;
    if ($msg = $mode_entree_sortie->store()) {
        CAppUI::displayAjaxMsg($msg, UI_MSG_WARNING);
        continue;
    }
Пример #9
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");
    $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");
}
Пример #11
0
    // Ajustements ad hoc
    if ($plage = $_operation->_ref_plageop) {
        $_operation->_ref_salle_prevue = $plage->_ref_salle;
        $_operation->_ref_salle_reelle = $_operation->_ref_salle;
        $_operation->_deb_plage = $plage->debut;
        $_operation->_fin_plage = $plage->fin;
    } 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);
if ($bloc_id) {
    $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);
 * @version    $Revision$
 */
$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));
Пример #14
0
<?php

/**
 * $Id: export_medecins_csv.php 28215 2015-05-07 12:20:27Z phenxdesign $
 *  
 * @category Patients
 * @package  Mediboard
 * @author   SARL OpenXtrem <*****@*****.**>
 * @license  GNU General Public License, see http://www.gnu.org/licenses/gpl.html
 * @version  $Revision: 28215 $
 * @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);
Пример #15
0
 * $Id$
 *  
 * @category dPurgences
 * @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
 */
$motif_path = "modules/dPurgences/resources/motif_sfmu.csv";
$motif_sfmu = new CMotifSFMU();
$ds = $motif_sfmu->getDS();
$ds->exec("TRUNCATE TABLE motif_sfmu");
CAppUI::stepAjax("motifs supprimés", UI_MSG_OK);
$handle = fopen($motif_path, "r");
$motif_csv = new CCSVFile($handle);
$motif_csv->jumpLine(1);
$count = 0;
$categorie = null;
while ($line = $motif_csv->readLine()) {
    list($libelle, $code) = $line;
    if (!$code) {
        $categorie = ucfirst(strtolower($libelle));
        continue;
    }
    $motif_sfmu = new CMotifSFMU();
    $motif_sfmu->code = $code;
    $motif_sfmu->libelle = $libelle;
    $motif_sfmu->categorie = $categorie;
    if ($msg = $motif_sfmu->store()) {
        CAppUI::stepAjax($msg, UI_MSG_ERROR);
Пример #16
0
<?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();