// Chargements de chargement du patient
$patient->loadRefsSejours();
$patient->loadRefsFwd();
$patient->loadRefsCorrespondants();
$patient->loadRefsCorrespondantsPatient();
$correspondantsMedicaux = array();
if ($patient->_ref_medecin_traitant->_id) {
    $correspondantsMedicaux["traitant"] = $patient->_ref_medecin_traitant;
}
foreach ($patient->_ref_medecins_correspondants as $correspondant) {
    $correspondantsMedicaux["correspondants"][] = $correspondant->_ref_medecin;
}
$medecin_adresse_par = "";
if ($sejour->adresse_par_prat_id && $sejour->adresse_par_prat_id != $patient->_ref_medecin_traitant->_id) {
    $medecin_adresse_par = new CMedecin();
    $medecin_adresse_par->load($sejour->adresse_par_prat_id);
}
// Chargement des etablissements externes
$etab = new CEtabExterne();
$count_etab_externe = $etab->countList();
$sejours =& $patient->_ref_sejours;
$config = CAppUI::conf("dPplanningOp CSejour");
$hours = range($config["heure_deb"], $config["heure_fin"]);
$mins = range(0, 59, $config["min_intervalle"]);
$config = CAppUI::conf("dPplanningOp COperation");
$hours_duree = array("deb" => $config["duree_deb"], "fin" => $config["duree_fin"]);
$hours_urgence = array("deb" => $config["hour_urgence_deb"], "fin" => $config["hour_urgence_fin"]);
$mins_duree = $config["min_intervalle"];
$config = CAppUI::conf("dPplanningOp CSejour");
$heure_sortie_ambu = $config["heure_sortie_ambu"];
$heure_sortie_autre = $config["heure_sortie_autre"];
Esempio n. 2
0
<?php

/**
 * $Id$
 *
 * @package    Mediboard
 * @subpackage Patients
 * @author     SARL OpenXtrem <*****@*****.**>
 * @license    GNU General Public License, see http://www.gnu.org/licenses/gpl.html
 * @version    $Revision$
 */
CCanDo::checkRead();
$medecin_id = CValue::get("medecin_id");
$medecin = new CMedecin();
$medecin->load($medecin_id);
if (!$medecin || !$medecin->_id) {
    CAppUI::stepAjax('common-error-Invalid object', UI_MSG_ERROR);
}
$smarty = new CSmartyDP();
$smarty->assign("medecin", $medecin);
$smarty->assign("date", CMbDT::date());
$smarty->display("print_medecin.tpl");
Esempio n. 3
0
 function completeLabelFields(&$fields, $params)
 {
     $this->loadIPP();
     $medecin_traitant = new CMedecin();
     $medecin_traitant->load($this->medecin_traitant);
     $this->loadRefsCorrespondantsPatient();
     $prevenir = new CCorrespondantPatient();
     if (count($this->_ref_cp_by_relation["prevenir"])) {
         $prevenir = reset($this->_ref_cp_by_relation["prevenir"]);
     }
     $fields = array_merge($fields, array("DATE NAISS" => CMbDT::dateToLocale($this->naissance), "IPP" => $this->_IPP, "LIEU NAISSANCE" => $this->lieu_naissance, "NOM" => $this->nom, "NOM JF" => $this->nom_jeune_fille, "FORMULE NOM JF" => $this->sexe == "f" && $this->nom_jeune_fille ? "née {$this->nom_jeune_fille}" : "", "PRENOM" => $this->prenom, "SEXE" => strtoupper($this->sexe), "CIVILITE" => $this->civilite, "CIVILITE LONGUE" => $this->_civilite_long, "ACCORD GENRE" => $this->sexe == "f" ? "e" : "", "CODE BARRE IPP" => "@BARCODE_" . $this->_IPP . "@", "ADRESSE" => "{$this->adresse} \n{$this->cp} {$this->ville}", "MED. TRAITANT" => "Dr {$medecin_traitant->nom} {$medecin_traitant->prenom}", "TEL" => $this->getFormattedValue("tel"), "TEL PORTABLE" => $this->getFormattedValue("tel2"), "TEL ETRANGER" => $this->getFormattedValue("tel_autre"), "PAYS" => $this->getFormattedValue("pays"), "PREVENIR - NOM" => $prevenir->nom, "PREVENIR - PRENOM" => $prevenir->prenom, "PREVENIR - ADRESSE" => $prevenir->adresse, "PREVENIR - TEL" => $prevenir->getFormattedValue("tel"), "PREVENIR - PORTABLE" => $prevenir->getFormattedValue("mob"), "PREVENIR - CP VILLE" => "{$prevenir->cp} {$prevenir->ville}"));
     switch (CAppUI::conf("ref_pays")) {
         case 1:
             $fields["NUM SECU"] = $this->matricule;
             break;
         case 2:
             $fields["AVS"] = $this->getFormattedValue("avs");
     }
 }
 /**
  * Get doctor
  *
  * @param DOMNode $node Node
  *
  * @return int
  */
 function getMedecin(DOMNode $node)
 {
     $xcn1 = $this->queryTextNode("XCN.1", $node);
     $xcn2 = $this->queryTextNode("XCN.2/FN.1", $node);
     $xcn3 = $this->queryTextNode("XCN.3", $node);
     $medecin = new CMedecin();
     switch ($this->queryTextNode("XCN.13", $node)) {
         case "RPPS":
             $medecin->rpps = $xcn1;
             $medecin->loadMatchingObjectEsc();
             break;
         case "ADELI":
             $medecin->adeli = $xcn1;
             $medecin->loadMatchingObjectEsc();
             break;
         case "RI":
             // Gestion de l'identifiant MB
             if ($this->queryTextNode("XCN.9/CX.4/HD.2", $node) == CAppUI::conf("hl7 assigning_authority_universal_id")) {
                 $medecin->load($xcn1);
             }
         default:
     }
     // Si pas retrouvé par son identifiant
     if (!$medecin->_id) {
         $medecin->nom = $xcn2;
         $medecin->prenom = $xcn3;
         $medecin->loadMatchingObjectEsc();
         // Dans le cas où il n'est pas connu dans MB on le créé
         $medecin->store();
     }
     return $medecin->_id;
 }
Esempio n. 5
0
<?php

/**
 * $Id$
 *
 * @category Patients
 * @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::checkEdit();
$duplicate = CValue::get("duplicate", 0);
$medecin = new CMedecin();
$medecin->load(CValue::get("medecin_id"));
if ($duplicate) {
    $medecin->_id = null;
}
if (CAppUI::conf('dPpatients CPatient function_distinct') && $medecin->_id) {
    $current_user = CMediusers::get();
    $is_admin = $current_user->isAdmin();
    $same_function = $current_user->function_id == $medecin->function_id;
    if (!$is_admin && !$same_function) {
        CAppUI::redirect("m=system&a=access_denied");
    }
}
$medecin->loadSalutations();
$medecin->loadRefsNotes();
$smarty = new CSmartyDP();
$smarty->assign("object", $medecin);
 /**
  * @see parent::fillLimitedTemplate()
  */
 function fillLimitedTemplate(&$template)
 {
     $chir = $this->_ref_plageconsult->_ref_chir;
     // Ajout du praticien pour les destinataires possibles (dans l'envoi d'un email)
     $template->destinataires[] = array("nom" => "Dr " . $chir->_user_last_name . " " . $chir->_user_first_name, "email" => $chir->_user_email, "tag" => "Praticien");
     $this->updateFormFields();
     $this->loadRefsFwd();
     $this->notify("BeforeFillLimitedTemplate", $template);
     $template->addDateProperty("Consultation - date", $this->_ref_plageconsult->date);
     $template->addLongDateProperty("Consultation - date longue", $this->_ref_plageconsult->date);
     $template->addTimeProperty("Consultation - heure", $this->heure);
     $locExamFields = array("motif" => "motif", "rques" => "remarques", "examen" => "examen", "traitement" => "traitement", "histoire_maladie" => "histoire maladie", "conclusion" => "conclusion");
     foreach ($this->_exam_fields as $field) {
         $loc_field = $locExamFields[$field];
         $template->addProperty("Consultation - {$loc_field}", $this->{$field});
     }
     if (!in_array("traitement", $this->_exam_fields)) {
         $template->addProperty("Consultation - traitement", $this->traitement);
     }
     $medecin = new CMedecin();
     $medecin->load($this->adresse_par_prat_id);
     $nom = "{$medecin->nom} {$medecin->prenom}";
     $template->addProperty("Consultation - adressé par", $nom);
     $template->addProperty("Consultation - adressé par - adresse", "{$medecin->adresse}\n{$medecin->cp} {$medecin->ville}");
     $template->addProperty("Consultation - Accident du travail", $this->getFormattedValue("date_at"));
     $libelle_at = $this->date_at ? "Accident du travail du " . $this->getFormattedValue("date_at") : "";
     $template->addProperty("Consultation - Libellé accident du travail", $libelle_at);
     $this->loadRefsFiles();
     $list = CMbArray::pluck($this->_ref_files, "file_name");
     $template->addListProperty("Consultation - Liste des fichiers", $list);
     $template->addProperty("Consultation - Fin arrêt de travail", CMbDT::dateToLocale(CMbDT::date($this->fin_at)));
     $template->addProperty("Consultation - Prise en charge arrêt de travail", $this->getFormattedValue("pec_at"));
     $template->addProperty("Consultation - Reprise de travail", CMbDT::dateToLocale(CMbDT::date($this->reprise_at)));
     $template->addProperty("Consultation - Accident de travail sans arrêt de travail", $this->getFormattedValue("at_sans_arret"));
     $template->addProperty("Consultation - Arrêt maladie", $this->getFormattedValue("arret_maladie"));
     $this->loadRefsExamsComp();
     $exam = new CExamComp();
     foreach ($exam->_specs["realisation"]->_locales as $key => $locale) {
         $exams = isset($this->_types_examen[$key]) ? $this->_types_examen[$key] : array();
         $template->addListProperty("Consultation - Examens complémentaires - {$locale}", $exams);
     }
     if (CModule::getActive("forms")) {
         CExObject::addFormsToTemplate($template, $this, "Consultation");
     }
     // Séjour et/ou intervention créés depuis la consultation
     $sejour_relie = reset($this->loadBackRefs("sejours_lies"));
     $interv_reliee = reset($this->loadBackRefs("intervs_liees"));
     if ($interv_reliee) {
         $sejour_relie = $interv_reliee->loadRefSejour();
     } else {
         if (!$sejour_relie) {
             $sejour_relie = new CSejour();
         }
         if (!$interv_reliee) {
             $interv_reliee = new COperation();
         }
     }
     $interv_reliee->loadRefChir();
     $interv_reliee->loadRefPlageOp();
     $interv_reliee->loadRefSalle();
     $sejour_relie->loadRefPraticien();
     // Intervention reliée
     $template->addProperty("Consultation - Opération reliée - Chirurgien", $interv_reliee->_ref_chir->_view);
     $template->addProperty("Consultation - Opération reliée - Libellé", $interv_reliee->libelle);
     $template->addProperty("Consultation - Opération reliée - Salle", $interv_reliee->_ref_salle->nom);
     $template->addDateProperty("Consultation - Opération reliée - Date", $interv_reliee->_datetime_best);
     // Séjour relié
     $template->addDateProperty("Consultation - Séjour relié - Date entrée", $sejour_relie->entree);
     $template->addLongDateProperty("Consultation - Séjour relié - Date entrée (longue)", $sejour_relie->entree);
     $template->addTimeProperty("Consultation - Séjour relié - Heure entrée", $sejour_relie->entree);
     $template->addDateProperty("Consultation - Séjour relié - Date sortie", $sejour_relie->sortie);
     $template->addLongDateProperty("Consultation - Séjour relié - Date sortie (longue)", $sejour_relie->sortie);
     $template->addTimeProperty("Consultation - Séjour relié - Heure sortie", $sejour_relie->sortie);
     $template->addDateProperty("Consultation - Séjour relié - Date entrée réelle", $sejour_relie->entree_reelle);
     $template->addTimeProperty("Consultation - Séjour relié - Heure entrée réelle", $sejour_relie->entree_reelle);
     $template->addDateProperty("Consultation - Séjour relié - Date sortie réelle", $sejour_relie->sortie_reelle);
     $template->addTimeProperty("Consultation - Séjour relié - Heure sortie réelle", $sejour_relie->sortie_reelle);
     $template->addProperty("Consultation - Séjour relié - Praticien", "Dr " . $sejour_relie->_ref_praticien->_view);
     $template->addProperty("Consultation - Séjour relié - Libelle", $sejour_relie->getFormattedValue("libelle"));
     $this->notify("AfterFillLimitedTemplate", $template);
 }
<?php

/**
 * $Id$
 *
 * @package    Mediboard
 * @subpackage Patients
 * @author     SARL OpenXtrem <*****@*****.**>
 * @license    GNU General Public License, see http://www.gnu.org/licenses/gpl.html
 * @version    $Revision$
 */
$ds = CSQLDataSource::get("std");
$medecin1 = new CMedecin();
$medecin1->load($_POST["medecin1_id"]);
$medecin2 = new CMedecin();
$medecin2->load($_POST["medecin2_id"]);
$do = new CDoObjectAddEdit("CMedecin", "medecin_id");
$do->doBind();
// Création du nouveau medecin
if (intval(CValue::post("del"))) {
    $do->doDelete();
} else {
    $do->doStore();
}
/** @var CMedecin $newMedecin */
$newMedecin =& $do->_obj;
// Transfert de toutes les backrefs
if ($msg = $newMedecin->transferBackRefsFrom($medecin1)) {
    $do->errorRedirect($msg);
}
if ($msg = $newMedecin->transferBackRefsFrom($medecin2)) {