Ejemplo n.º 1
0
 * @package    Mediboard
 * @subpackage Cabinet
 * @author     SARL OpenXtrem <*****@*****.**>
 * @license    GNU General Public License, see http://www.gnu.org/licenses/gpl.html
 * @version    $Revision: 24981 $
 */
CCanDo::checkEdit();
$pat_id = CValue::getOrSession("patSel");
// Liste des Praticiens
$listPrat = CConsultation::loadPraticiens(PERM_READ);
$patient = new CPatient();
$patient->load($pat_id);
// Chargement des références du patient
if ($pat_id) {
    // Infos patient complètes (tableau de droite)
    $patient->loadDossierComplet();
    $patient->countINS();
    /*
    foreach ($patient->_ref_consultations as $key => $value) {
      if (!array_key_exists($value->_ref_plageconsult->chir_id, $listPrat)) {
          unset($patient->_ref_consultations[$key]);
      }
    }
    
    foreach ($patient->_ref_sejours as $key => $sejour) {
      if (!array_key_exists($sejour->praticien_id, $listPrat)) {
        unset($patient->_ref_sejours[$key]);
      } else {
        $patient->_ref_sejours[$key]->loadRefsFwd();
        $patient->_ref_sejours[$key]->loadRefsOperations();
        foreach($patient->_ref_sejours[$key]->_ref_operations as $keyOp => $op) {
 * @package    Mediboard
 * @subpackage Patients
 * @author     SARL OpenXtrem <*****@*****.**>
 * @license    GNU General Public License, see http://www.gnu.org/licenses/gpl.html
 * @version    $Revision$
 */
CCanDo::checkRead();
$patient_id = CValue::getOrSession("patient_id", 0);
if (!$patient_id) {
    CAppUI::setMsg("Vous devez selectionner un patient", UI_MSG_ALERT);
    CAppUI::redirect("m=dPpatients&tab=0");
}
// Récuperation du patient sélectionné
$patient = new CPatient();
$patient->load($patient_id);
$patient->loadDossierComplet(PERM_READ);
$patient->loadRefDossierMedical();
$patient->_ref_dossier_medical->loadRefsAntecedents();
$patient->_ref_dossier_medical->loadRefsTraitements();
$patient->countINS();
$userSel = CMediusers::get();
// Suppression des consultations d'urgences
foreach ($patient->_ref_consultations as $keyConsult => $consult) {
    if ($consult->motif == "Passage aux urgences") {
        unset($patient->_ref_consultations[$keyConsult]);
    }
}
$can_view_dossier_medical = CModule::getCanDo('dPcabinet')->edit || CModule::getCanDo('dPbloc')->edit || CModule::getCanDo('dPplanningOp')->edit || $userSel->isFromType(array("Infirmière"));
// Création du template
$smarty = new CSmartyDP();
$smarty->assign("canCabinet", CModule::getCanDo("dPcabinet"));
CCanDo::checkRead();
$patient_id = CValue::getOrSession("patient_id", 0);
$vw_cancelled = CValue::get("vw_cancelled", 0);
// Récuperation du patient sélectionné
$patient = new CPatient();
if (CValue::get("new", 0)) {
    $patient->load(null);
    CValue::setSession("id", null);
} else {
    $patient->load($patient_id);
}
$nb_sejours_annules = 0;
$nb_ops_annulees = 0;
$nb_consults_annulees = 0;
if ($patient->_id) {
    $patient->loadDossierComplet(null, false);
    $patient->loadIPP();
    $patient->loadPatientLinks();
    $patient->countINS();
    if (CModule::getActive("fse")) {
        $cv = CFseFactory::createCV();
        if ($cv) {
            $cv->loadIdVitale($patient);
        }
    }
    if (!$vw_cancelled) {
        foreach ($patient->_ref_sejours as $_key => $_sejour) {
            foreach ($_sejour->_ref_operations as $_key_op => $_operation) {
                if ($_operation->annulee) {
                    unset($_sejour->_ref_operations[$_key_op]);
                    $nb_ops_annulees++;