function writeBALall($tabIdPatient)
 {
     global $fusion;
     global $table_patient_manuel;
     global $table_patient_automatique;
     //newfct(gen_affiche_tableau,$tabIdPatient);
     for ($ind = 0; $ind <= 1; $ind++) {
         if ($ind == 0) {
             //controleActesPresents
             $this->controleActesPresents($tabIdPatient[$ind + 1]);
             //
             unset($paramRq);
             $paramRq[cw] = "idEvent=" . $tabIdPatient[$ind + 1] . " and idDomaine=" . CCAM_IDDOMAINE;
             $req = new clResultQuery();
             $res = $req->Execute("Fichier", "CCAM_getActesDiagsCotation", $paramRq, "ResultQuery");
             $dateDemande = $res["dateDemande"][0];
             //eko($res);
             // Mise à jour des données de $tabIdPatient[$ind]
             // Prendre le nom du medecin et son code ADELI de $tabIdPatient[$ind+1]
             // On prend le nom du medecin du patient
             $param[cw] = "WHERE idpatient='" . $tabIdPatient[$ind + 1] . "'";
             $param[table] = $table_patient_manuel;
             $req = new clResultQuery();
             $res = $req->Execute("Fichier", "getPatients", $param, "ResultQuery");
             // On prend le numero ADELI
             unset($param);
             $param[nomitem] = $res["medecin_urgences"][0];
             $req = new clResultQuery();
             $res2 = $req->Execute("Fichier", "getMatriculeMedecin", $param, "ResultQuery");
             $Medecin_urgences = $res["medecin_urgences"][0];
             $Matricule = $res2["matricule"][0];
             // Mise à jour de la fiche patient $tabIdPatient[$ind] seulement pour l'acte ATU
             $paramModif["envoi_nomIntervenant"] = $Medecin_urgences;
             $paramModif["envoi_matriculeIntervenant"] = $Matricule;
             $paramModif["dateDemande"] = $dateDemande;
             $requete = new clRequete(CCAM_BDD, "ccam_cotation_actes", $paramModif);
             $sql = $requete->updRecord("idEvent=" . $tabIdPatient[$ind] . " and idDomaine=" . CCAM_IDDOMAINE);
             unset($paramRq);
             $paramRq[cw] = "idEvent=" . $tabIdPatient[$ind] . " and idDomaine=" . CCAM_IDDOMAINE;
             $req = new clResultQuery();
             $res = $req->Execute("Fichier", "CCAM_getActesDiagsCotation", $paramRq, "ResultQuery");
             //eko($table_patient_automatique);
             if ($table_patient_automatique == PSORTIS) {
                 $type = "suppression";
                 $this->contenuBAL($res, $type);
             }
             //Suppression dans la table ccam_cotation_actes (patient pastel pour le Ch-Hyeres)
             $requete = new clRequete(CCAM_BDD, "ccam_cotation_actes", array());
             $sql = $requete->delRecord("idEvent=" . $tabIdPatient[$ind] . " and idDomaine=" . CCAM_IDDOMAINE);
         } else {
             //Récup des infos de pastel pour maj identité patient manuel
             if ($this->patientSorti($tabIdPatient[$ind])) {
                 $table = "Sortis";
             } else {
                 $table = "";
             }
             $patient = new clPatient($tabIdPatient[$ind], $table);
             unset($param);
             $param[numSejour] = $patient->getNSej();
             $param[idu] = $patient->getIDU();
             $param[ipp] = $patient->getILP();
             $param[nomu] = $patient->getNom();
             $param[pren] = $patient->getPrenom();
             $param[sexe] = $patient->getSexe();
             $param[dtnai] = substr($patient->getDateNaissance(), 0, 10);
             //eko($param);
             $requete = new clRequete(CCAM_BDD, "ccam_cotation_actes", $param);
             $sql = $requete->updRecord("idEvent=" . $tabIdPatient[$ind] . " and idDomaine=" . CCAM_IDDOMAINE);
             if ($table) {
                 //Le patient manuel maintenant fusionné était sorti, on peut donc maintenant envoyer ses actes à la BAL
                 /*$lesion=$this->lesion($tabIdPatient[$ind]);
                    $tabAsso=$this->tabAsso($tabIdPatient[$ind],$lesion);
                    
                    unset($paramRq);
                  	$paramRq[cw]="idEvent=$tabIdPatient[$ind] and idDomaine=".CCAM_IDDOMAINE;
                  	$req=new clResultQuery;
                  	$res=$req->Execute("Fichier","CCAM_getActesDiagsCotation",$paramRq,"ResultQuery");
                  	//eko($res[INDIC_SVC]);
                    $type="creation";
                    $this->contenuBAL($res,$type,$tabAsso);*/
                 $this->writeBALSorti("", $tabIdPatient[$ind]);
             }
         }
         //eko("ind:$ind-idPatient:".$tabIdPatient[$ind]);
     }
 }
Пример #2
0
 function genPat($idpatient)
 {
     global $session;
     global $options;
     // Si un idpatient est tranmis, alors on récupère ses informations
     // à l'aide de la classe Patient.
     if ($idpatient) {
         //concerne la recuperation d'une instance de la classe FoRmX gerant les actions
         if ($options->getOption("use_formx")) {
             global $actions;
             $actions = new clFoRmX($idpatient, 'NO_POST_THREAT');
         }
         $patient = new clPatient($idpatient, $session->getNavi(5));
         $pat[NMA] = $patient->getNom();
         $pat[PRE] = $patient->getPrenom();
         $pat[DNA] = $patient->getDateNaissance();
         $pat[SEX] = $patient->getSexe();
         $date = new clDate($patient->getDateAdmission());
         $pat[DTA] = $date->getDate($options->getOption("Documents Date"));
         $pat[HEA] = $date->getDate("H:i");
         $pat[MED] = $patient->getMedecin();
         $pat[DHS] = $patient->getDateSortie();
         $pat[DHE] = $patient->getDateExamen();
         // Sinon, nous renseignons avec les valeurs par défaut.
     } else {
         $pat[NMA] = "Bon";
         $pat[PRE] = "Jean";
         $date = new clDate("1981-12-24 22:30:00");
         $pat[DNA] = $date->getDate($options->getOption("Documents Date"));
         $pat[SEX] = "1";
         $date = new clDate();
         $pat[DTA] = $date->getDate($options->getOption("Documents Date"));
         $pat[HEA] = $date->getDate("H:i");
         $pat[MED] = "Testeur";
         $pat[DHS] = $date->getDate($options->getOption("Documents Date"));
         $pat[DHE] = $date->getDate($options->getOption("Documents Date"));
     }
     // On renvoie le tableau généré.
     return $pat;
 }
Пример #3
0
 function genPat($idpatient)
 {
     global $session;
     global $options;
     // Si un idpatient est tranmis, alors on récupère ses informations
     // à l'aide de la classe Patient.
     if ($idpatient) {
         $patient = new clPatient($idpatient, $session->getNavi(5));
         $pat[NMA] = $patient->getNom();
         $pat[PRE] = $patient->getPrenom();
         $pat[DNA] = $patient->getDateNaissance();
         $pat[SEX] = $patient->getSexe();
         $date = new clDate($patient->getDateAdmission());
         $dateA = new clDate();
         $dateE = new clDate($patient->getDateExamen());
         $dateS = new clDate($patient->getDateSortie());
         $pat[DTA] = $date->getDate($options->getOption("Documents Date"));
         $pat[HEA] = $date->getDate("H:i");
         $pat[MED] = $patient->getMedecin();
         $pat[DHS] = $dateS->getDate($options->getOption("Documents Date"));
         $pat[DHE] = $dateE->getDate($options->getOption("Documents Date"));
         $pat[IPP] = $patient->getILP();
         $pat[SEJ] = $patient->getNSej();
         $pat[ADD] = $patient->getAdresse();
         $pat[CPO] = $patient->getCodePostal();
         $pat[VIL] = $patient->getVille();
         $pat[IDE] = $patient->getIDE();
         $pat[SAL] = $patient->getSalle();
         $pat[CCM] = $patient->getCCMU();
         $pat[GRA] = $patient->getCodeGravite();
         $pat[UF] = $patient->getUF();
         $pat[CRE] = $patient->getCategorieRecours();
         $pat[MRE] = $patient->getMotifRecours();
         $pat[COR] = $patient->getCodeRecours();
         $pat[DES] = $patient->getDestinationSouhaitee();
         $pat[DAT] = $patient->getDestinationAttendue();
         $pat[CDI] = $patient->getCategorieDiagnostic();
         $pat[DIA] = $patient->getLibelleDiagnostic();
         $pat[DIC] = $patient->getCodeDiagnostic();
         // Sinon, nous renseignons avec les valeurs par défaut.
     } else {
         $pat[NMA] = "Bon";
         $pat[PRE] = "Jean";
         $date = new clDate("1981-12-24 22:30:00");
         $pat[DNA] = $date->getDate($options->getOption("Documents Date"));
         $pat[SEX] = "1";
         $date = new clDate();
         $pat[DTA] = $date->getDate($options->getOption("Documents Date"));
         $pat[HEA] = $date->getDate("H:i");
         $pat[MED] = "Testeur";
         $pat[DHS] = $date->getDate($options->getOption("Documents Date"));
         $pat[DHE] = $date->getDate($options->getOption("Documents Date"));
         $pat[IPP] = "777777777";
         $pat[SEJ] = "666666666";
         $pat[ADD] = "Rue des patients";
         $pat[CPO] = "83400";
         $pat[VIL] = "PatientsVille";
         $pat[IDE] = "IDE";
         $pat[SAL] = "Salle";
         $pat[CCM] = "II";
         $pat[GRA] = "2";
         $pat[UF] = "2701";
         $pat[CRE] = "Catégorie de recours";
         $pat[MRE] = "Motif de recours";
         $pat[COR] = "CodeRecours";
         $pat[DES] = "Destination souhaitée";
         $pat[DAT] = "Destination attendue";
         $pat[CDI] = "Catégorie de diagnotic";
         $pat[DIA] = "Diagnostic";
         $pat[DIC] = "Code diagnostic";
     }
     // On renvoie le tableau généré.
     return $pat;
 }