Example #1
0
 function genAffichage()
 {
     global $session;
     global $stopAffichage;
     $stopAffichage = 1;
     $idpass = $session->getNavi(2);
     $req = new clResultQuery();
     // On vérifie que l'entrée n'existe pas déjà dans la table des patients présents.
     $param2['table'] = PPRESENTS;
     $param2['cw'] = "WHERE nsej='" . $idpass . "'";
     $ras = $req->Execute("Fichier", "getPatients", $param2, "ResultQuery");
     // On vérifie que l'entrée n'existe pas déjà dans la table des patients sortis.
     $param3['table'] = PSORTIS;
     $param3['cw'] = "WHERE nsej='" . $idpass . "'";
     $rus = $req->Execute("Fichier", "getPatients", $param3, "ResultQuery");
     if ($ras['INDIC_SVC'][2]) {
         $type = "Presents";
         $table = PPRESENTS;
         $idpatient = $ras['idpatient'][0];
         $ok = 1;
     } elseif ($rus['INDIC_SVC'][2]) {
         $type = "Sortis";
         $table = PSORTIS;
         $idpatient = $rus['idpatient'][0];
         $ok = 1;
     }
     if ($ok) {
         $patient = new clFichePatient($type, $table, $idpatient, 1);
         switch ($session->getNavi(1)) {
             case 'EtatCivil':
                 $this->af .= $patient->EtatCivil();
                 break;
             case 'HistoriquePassage':
                 $this->af .= $patient->Historique();
                 break;
             case 'HistoriqueDocuments':
                 $this->af .= $patient->HistoriqueDocs();
                 break;
             case 'Messages':
                 $this->af .= $patient->viewMessages();
                 break;
             case 'DocumentsEdites':
                 $this->af .= $patient->Documents();
                 break;
             case 'DiagnosticsActes':
                 $this->af .= $patient->getActesDiagnostics();
                 break;
             case 'Informations':
                 $this->af .= $patient->Informations();
                 break;
             default:
                 $stopAffichage = 0;
                 break;
         }
     }
 }
Example #2
0
 function genListe()
 {
     global $session;
     global $options;
     // On regarde si on veut basculer un patient attendus en patient présent.
     if ($session->getNavi(1) == "basculerPatient" and $session->getDroit("Liste_Attendus", "m")) {
         $this->attenduToPresent();
     }
     // On regarde si on veut supprimer un patient attendu de la liste.
     if ($session->getNavi(1) == "delPatient" and $session->getDroit("Liste_Attendus", "d")) {
         $this->delPatient();
     }
     if ($_POST['Annuler'] or $_POST['Annuler_x']) {
         header('Location:' . URLNAVI . $session->genNavi($session->getNavi(0)));
     }
     if (($_POST['Ajouter'] or $_POST['Ajouter_x']) and $this->type == "Attendus") {
         header('Location:' . URLNAVI . $session->genNavi($session->getNavi(0), 'addPatientAttendu'));
     }
     if ($_POST['Ajouter'] or $_POST['Ajouter_x']) {
         header('Location:' . URLNAVI . $session->genNavi($session->getNavi(0), 'addPatientPresent'));
     }
     // On vérifie si l'ajout manuel d'un patient attendu est demandé.
     if (($_POST['Ajouter'] or $_POST['Ajouter_x'] or $session->getNavi(1) == "addPatientAttendu" and !$_POST['Annuler'] and !$_POST['Annuler_x']) and ($session->getDroit("Liste_" . $this->type, "w") and $options->getOption("AjoutManuel") or $session->getDroit("Liste_" . $this->type, "w") and $this->type == "Attendus")) {
         if ($this->type == "Attendus") {
             $this->addPatientAttendu();
         }
     }
     // On vérifie si l'ajout manuel d'un patient présent est demandé.
     if (($_POST['Ajouter'] or $_POST['Ajouter_x'] or $session->getNavi(1) == "addPatientPresent" and !$_POST['Annuler'] and !$_POST['Annuler_x']) and ($session->getDroit("Liste_" . $this->type, "w") and $options->getOption("AjoutManuel") or $session->getDroit("Liste_" . $this->type, "w") and $this->type == "Presents")) {
         if ($this->type == "Presents" or $this->type == "UHCD") {
             $this->addPatientPresent();
         }
     }
     // On vérifie si une modification de patient est demandée.
     if ($session->getNavi(1) == "modPatientAttendu" and $session->getDroit("Liste_" . $this->type, "m") and !$_POST['Annuler'] and !$_POST['Annuler_x']) {
         $this->modPatientAttendu();
     }
     // On vérifie si le retour d'un patient est en cours.
     if ($_POST['RetourPatient'] and $session->getDroit("Liste_" . $this->type, "m")) {
         $this->retourPatient();
     }
     $tmp = "RIEN";
     // On regarde si on veut voir la fiche d'un patient.
     if ($session->getNavi(1) == "FichePatient") {
         $fichePatient = new clFichePatient($this->type, $this->table, $session->getNavi(2));
         $tmp = $fichePatient->getAffichage();
         if ($tmp != "RIEN") {
             $this->af .= $tmp;
         }
         // Sinon, on génère la liste de tous les patients.
     }
     if ($tmp == "SORTIE") {
         header('Location:' . URLNAVI . $session->genNavi($session->getNavi(0)));
     }
     if ($tmp == "RIEN") {
         // Vérification du droit de lecture sur la liste de patients.
         if ($session->getDroit("Liste_" . $this->type, "r")) {
             if ($this->type == "Presents" or $this->type == "UHCD" or $this->type == "Attendus" or $this->type == "Pédiatrie") {
                 $this->genInformationsPassages();
             } else {
                 $this->filtreRecherche();
             }
             $this->genListePatient(1);
             if ($this->type == "Presents") {
                 $this->genListePatient(2);
             }
         }
     }
 }