function runCheck() { global $options; $nom1 = $options->getOption("sansContrainte1"); $val1 = $options->getOption("sansContrainteVal1"); $nom2 = $options->getOption("sansContrainte2"); $val2 = $options->getOption("sansContrainteVal2"); $nom3 = $options->getOption("sansContrainte3"); $val3 = $options->getOption("sansContrainteVal3"); if (!$this->checkSansContrainte($nom1, $val1) and !$this->checkSansContrainte($nom2, $val2) and !$this->checkSansContrainte($nom3, $val3)) { $this->check("recours_categorie", "CategorieRecours", "Catégorie de recours", ERR_RECOURS_CATEGORIE); $this->check("code_gravite", "CodeGravite", "Code Gravité", ERR_CODE_GRAVITE); $this->check("dt_examen", "DateExamen", "Date d'examen", ERR_DATE_EXAMEN); $this->check("dest_attendue", "DestAttendue", "Destination attendue", ERR_DEST_ATTENDUE); $this->check("dest_souhaitee", "DestSouhaitee", "Destination souhaitée", ERR_DEST_SOUHAITEE); $this->check("ide", "IDE", "IDE", ERR_IDE); $this->check("medecin_urgences", "Medecin", "Médecin", ERR_MEDECIN); $this->check("motif_transfert", "MotifTransfert", "Motif de transfert", ERR_MOTIF_TRANSFERT, "type_destination", "T"); $this->check("moyen_transport", "MoyenTransport", "Moyen de transport", ERR_MOYEN_TRANSPORT, "type_destination", "T"); $this->check("dest_pmsi", "DestPMSI", "Destination PMSI", ERR_DEST_PMSI, "type_destination"); $this->check("orientation", "Orientation", "Orientation", ERR_ORIENTATION, "type_destination"); $this->check("motif_recours", "Recours", "Recours", ERR_RECOURS); $this->check("salle_examen", "Salle", "Salle d'examen", ERR_SALLE_EXAMEN); $this->check("provenance", "Provenance", "Provenance", ERR_PROVENANCE); $this->check("tiss", "TISS", "TISS", ERR_TISS); if ($options->getOption("GestionAdresseur")) { $this->check("adresseur", "Adresseur", "Adresseur", ERR_ADRESSEUR); } if ($options->getOption("GestionModeAdmission")) { $this->check("mode_admission", "ModeAdmission", "Mode d'admission", ERR_MODE_ADMISSION); } if ($options->getOption("GestionCCMU")) { $this->check("ccmu", "CCMU", "Code CCMU", ERR_CCMU); } if ($options->getOption("GestionGEMSA")) { $this->check("gemsa", "GEMSA", "GEMSA", ERR_GEMSA); } if ($options->getOption("GestionTraumato")) { $this->check("traumato", "Traumato", "Traumato", ERR_TRAUMATO); } if ($options->getOption("CCAMExterne")) { } // Récupération des contraintes liées aux actes et aux diagnostics $contrainteActesDiag = new clCCAMCotationActesDiags($this->paramCCAM); $tabContraintesActesDiag = $contrainteActesDiag->getContraintes(); if ($this->patient->getTypeDestination() != 'H' and $this->patient->getUF() != $options->getOption('numUFUHCD') and $this->patient->getUF() != $options->getOption('numUFSC') and $this->patient->getUF() != $options->getOption('numUFUHCDrepere')) { if (is_array($tabContraintesActesDiag[acte])) { $this->bool = 0; $this->messages[$tabContraintesActesDiag[acte][nom]] = $tabContraintesActesDiag[acte][description]; } } if (is_array($tabContraintesActesDiag[diag])) { $this->bool = 0; $this->messages[$tabContraintesActesDiag[diag][nom]] = $tabContraintesActesDiag[diag][description]; } if (is_array($tabContraintesActesDiag[consultation])) { $this->bool = 0; $this->messages[$tabContraintesActesDiag[consultation][nom]] = $tabContraintesActesDiag[consultation][description]; } if ($this->patient->getTypeDestination() != 'H' and $this->patient->getUF() != $options->getOption('numUFUHCD') and $this->patient->getUF() != $options->getOption('numUFSC') and $this->patient->getUF() != $options->getOption('numUFUHCDrepere')) { if (!$this->checkCora()) { $this->bool = 0; $this->messages['CORA'] = 'Les actes doivent etre saisis dans CORA.'; } } //contraintes "plugin" $this->checkCustom(); } return $this->bool; }
function remplissageAutomatique($nom, $val) { global $options; //eko ( $nom ) ; // Récupération des options sur les critères de remplissage. $nom1 = $options->getOption('1critereRemplissage'); $val1 = $options->getOption('1valeurRemplissage'); $nom2 = $options->getOption('2critereRemplissage'); $val2 = $options->getOption('2valeurRemplissage'); $nom3 = $options->getOption('3critereRemplissage'); $val3 = $options->getOption('3valeurRemplissage'); $n = 0; // On détermine quel critère est validé. if ($nom1 == $nom and $val1 == $val) { $n = 1; } if ($nom2 == $nom and $val2 == $val) { $n = 2; } if ($nom3 == $nom and $val3 == $val) { $n = 3; } //eko($n); //eko ( $nom1.' '.$val1 ) ; //eko ( $nom.' '.$val ) ; // Si un critère est validé alors on lance la procédure de remplissage. if ($n == 1) { $tab = array('medecin_urgences', 'ide', 'salle_examen', 'ccmu', 'gemsa', 'traumato', 'dest_souhaitee', 'dest_attendue', 'moyen_transport', 'motif_transfert', 'recours_code', 'recours_categorie', 'type_destination', 'motif_recours', 'code_gravite', 'provenance', 'adresseur', 'mode_admission', 'code_gravite'); //eko ( $tab ) ; while (list($key, $val) = each($tab)) { $this->setRemplissage($n, $val); } $this->patient = new clPatient($this->idpatient, $this->type); //Gestion de la consultation non facturable //eko($this->paramCCAM); /* $this->paramCCAM["lieuInterv"]="CONSULT LIBERALE"; $this->paramCCAM["nomIntervenant"]=$options->getOption('1Remplissage_medecin_urgences'); $this->paramCCAM["matriculeIntervenant"]=$options->getOption('codeAdeliChefService'); */ $this->paramCCAM["lieuInterv"] = $this->patient->getSalleExamen(); $this->paramCCAM["nomIntervenant"] = $this->patient->getMedecin(); $this->paramCCAM["matriculeIntervenant"] = $options->getOption('codeAdeliChefService'); $cotationActes = new clCCAMCotationActesDiags($this->paramCCAM); $codeActe = $options->getOption('1actesRemplissage'); if ($codeActe) { $cotationActes->consultNonFacturable($codeActe); } if ($options->getOption($n . 'diagRemplissage')) { $_POST['idListeSelection1'] = $options->getOption($n . 'diagRemplissage'); $cotationActes->addActesPatient(); } if ($this->remplissageAuto) { global $session; global $stopAffichage; $stopAffichage = 1; header('Location:?navi=' . $session->genNavi($session->getNavi(0), $session->getNavi(1), $session->getNavi(2))); } } /*if ( $n == 2 ) { $this->patient->setAttribut ( "Medecin", $options -> getOption ( '2Remplissage_medecin_urgences' ) ); }*/ }
$paramCCAM[idEvent]=$res[DISCR][$i]; $ccam=new clCCAMCotationActesDiags($paramCCAM); $cw="and type='ACTE' and codeActe not like 'NGAP%' and codeActe not like 'CONS%' and idEvent<=19493"; $ccam->writeBALSorti($cw); echo "Fin de traitement pour discr=".$res[DISCR][$i]."<br>"; }*/ //Reprise des données pour les consultations spécialisées $res = $req->Execute("Fichier", "CCAM_repriseBALpatientCons", $paramRq, "ResultQuery"); //print affTab($res[INDIC_SVC]); unset($tabIdEvent); for ($i = 0; isset($res[DISCR][$i]); $i++) { $idEvent = $res[DISCR][$i]; $id = $res[ID][$i]; unset($paramCCAM); $paramCCAM[idEvent] = $idEvent; $ccam = new clCCAMCotationActesDiags($paramCCAM); $tabSpecialite = $ccam->tabSpecialite(); //Mise à jour de l'UF de consult spécialisée dans ccam_cotation_actes unset($contenuMBTV2); $contenuMBTV2 = explode("|", $res[CONTENU][$i]); $codeActe = $contenuMBTV2[11]; $codeAdeli = $contenuMBTV2[18]; unset($paramRq); $paramRq[cw] = "categorie='ListeMédecins' and code='{$codeAdeli}' and idDomaine=" . CCAM_IDDOMAINE; $res3 = $req->Execute("Fichier", "CCAM_getSpeMedecin", $paramRq, "ResultQuery"); $libelleSpe = $res3[nomliste][0]; //echo "rq:".$res3[INDIC_SVC][15]."<br>idEvent:$idEvent-codeActe:$codeActe-libSpe:$libelleSpe<br>"; unset($param); if ($libelleSpe) { if ($tabSpecialite["{$libelleSpe}"]) { $param[numUFexec] = $tabSpecialite["{$libelleSpe}"];
function replayNsejWithDelete($nsej) { global $session; global $fusion; global $options; global $patient; $req = new clResultQuery(); $param['table'] = PSORTIS; $param['cw'] = "WHERE nsej IN ({$nsej})"; $res = $req->Execute("Fichier", "getPatients", $param, "ResultQuery"); //print affTab ( $res['INDIC_SVC'] ) ; for ($i = 0; isset($res['idu'][$i]); $i++) { //print ($res['idu'][$i]) ; $this->patient = new clPatient($res['idpatient'][$i], "Sortis"); $patient = $this->patient; $this->defineParamCCAM(); $fusion = 0; //print affTab ( $this->paramCCAM ) ; $cot = new clCCAMCotationActesDiags($this->paramCCAM); $cot->deleteBAL(); } if ($options->getOption('HprimXML_Actif')) { $hprim = new clHprimXML(); $this->af .= $hprim->getAffichage(); } for ($i = 0; isset($res['idu'][$i]); $i++) { //print ($res['idu'][$i]) ; $this->patient = new clPatient($res['idpatient'][$i], "Sortis"); $patient = $this->patient; $this->defineParamCCAM(); $fusion = 0; //print affTab ( $this->paramCCAM ) ; $cot = new clCCAMCotationActesDiags($this->paramCCAM); $cot->writeBALSorti(); } if ($options->getOption('HprimXML_Actif')) { $hprim = new clHprimXML(); $this->af .= $hprim->getAffichage(); } }
function genFusion() { global $errs; global $options; global $session; global $fusion; global $table_patient_manuel; global $table_patient_automatique; $auto = $session->getNavi(5); $tabauto = $session->getNavi(6); $manu = $session->getNavi(3); $tabmanu = $session->getNavi(4); if ($auto and $tabauto and $manu and $tabmanu) { // En fonction de son état (Presents ou Sortis), on en déduit sa table. //$param['table'] = $tabauto ; $param['table'] = PSORTIS; $param['cw'] = "WHERE idpatient='" . $auto . "'"; // Lancement de la requête pour récupérer toutes ses informations. $req = new clResultQuery(); $res = $req->Execute("Fichier", "getPatients", $param, "ResultQuery"); //print affTab ( $res['INDIC_SVC'] ) ; $table_patient_automatique = $param['table']; // On vérifie que le patient automatique existe. if ($res['INDIC_SVC'][2] < 1) { $param['table'] = PPRESENTS; $param['cw'] = "WHERE idpatient='" . $auto . "'"; // Lancement de la requête pour récupérer toutes ses informations. $req = new clResultQuery(); $res = $req->Execute("Fichier", "getPatients", $param, "ResultQuery"); //print affTab ( $res['INDIC_SVC'] ) ; $table_patient_automatique = $param['table']; } // On récupère l'idpatient et la table actuelle du patient manuel sélectionné. $param2['table'] = PSORTIS; $param2['cw'] = "WHERE idpatient='" . $manu . "'"; // Lancement de la requête pour récupérer toutes ses informations. $req2 = new clResultQuery(); $ras = $req2->Execute("Fichier", "getPatients", $param2, "ResultQuery"); //print affTab ( $ras['INDIC_SVC'] ) ; $table_patient_manuel = $param2['table']; if ($ras['INDIC_SVC'][2] < 1) { // On récupère l'idpatient et la table actuelle du patient manuel sélectionné. $param2['table'] = PPRESENTS; $param2['cw'] = "WHERE idpatient='" . $manu . "'"; // Lancement de la requête pour récupérer toutes ses informations. $req2 = new clResultQuery(); $ras = $req2->Execute("Fichier", "getPatients", $param2, "ResultQuery"); //print affTab ( $ras['INDIC_SVC'] ) ; $table_patient_manuel = $param2['table']; } // On vérifie que le patient automatique existe. if ($res['INDIC_SVC'][2] < 1) { $this->erreurs .= "Le patient automatique (idpatient=\"{$auto}\") est introuvable dans la table des patients {$tabauto}. Problème signalé."; $errs->addErreur("clFusion : Le patient automatique (idpatient=\"{$auto}\") est introuvable dans la table des patients {$tabauto}."); // On vérifie que le patient manuel existe. } elseif ($ras['INDIC_SVC'][2] < 1) { $this->erreurs .= "Le patient manuel (idpatient=\"{$manu}\") est introuvable dans la table des patients {$tabmanu}. Problème signalé."; $errs->addErreur("clFusion : Le patient manuel (idpatient=\$manu\") est introuvable dans la table des patients {$tabmanu}."); } else { $data['idu'] = $res['idu'][0]; $data['ilp'] = $res['ilp'][0]; $data['nsej'] = $res['nsej'][0]; $data['uf'] = $res['uf'][0]; $data['nom'] = $res['nom'][0]; $data['prenom'] = $res['prenom'][0]; $data['sexe'] = $res['sexe'][0]; $data['dt_naissance'] = $res['dt_naissance'][0]; $data['adresse_libre'] = $res['adresse_libre'][0]; $data['adresse_cp'] = $res['adresse_cp'][0]; $data['adresse_ville'] = $res['adresse_ville'][0]; $data['telephone'] = $res['telephone'][0]; $data['prevenir'] = $res['prevenir'][0]; $data['medecin_traitant'] = $res['medecin_nom'][0]; $data['dt_admission'] = $res['dt_admission'][0]; if ($res['mode_admission'][0]) { $data['mode_admission'] = $res['mode_admission'][0]; } $data['iduser'] = "******"; $data['manuel'] = 0; // Appel de la classe Requete. $requete = new clRequete(BDD, $param2['table'], $data); // Exécution de la requete. $requete->updRecord("idpatient='" . $manu . "'"); // Appel de la classe Requete. $requete = new clRequete(BDD, $param['table']); // Exécution de la requete. $requete->delRecord("idpatient='" . $auto . "'"); $this->infos .= "Fusion du patient (" . $res['sexe'][0] . ") " . ucfirst(strtolower($res['prenom'][0])) . " " . strtoupper($res['nom'][0]) . " effectuée.<br />"; // Mise à jour de la table radios $dataf['idpatient'] = $ras['idpatient'][0]; $requete = new clRequete(BDD, 'radios', $dataf); // Exécution de la requete. $requete->updRecord("idpatient='" . $res['idpatient'][0] . "'"); unset($dataf); // Mise à jour de la table formx : FX_BDD $dataf['ids'] = $res['idu'][0]; $requete = new clRequete(FX_BDD, 'formx', $dataf); // Exécution de la requete. $requete->updRecord("ids='" . $ras['idu'][0] . "'"); $requete = new clRequete(FX_BDD, 'formx_globvars', $dataf); // Exécution de la requete. $requete->updRecord("ids='" . $ras['idu'][0] . "'"); if ($options->getOption("Module_CCAM")) { $fusion = 1; $ccam = new clCCAMCotationActesDiags(array()); $ccam->writeBALall(array($auto, $manu)); } } } }
function genFusion() { global $errs; global $options; global $fusion; global $table_patient_manuel; global $table_patient_automatique; // On vérifie qu'un patient manuel et un patient automatique ont bien été sélectionné. if (!$_POST['manuel'] or !$_POST['automatique']) { // Affichage d'un message d'erreur si ce n'est pas bon. $this->erreurs .= "Deux patients doivent être sélectionnés pour lancer le processus de fusion des patients."; } else { // On récupère l'idpatient et la table actuelle du patient automatique sélectionné. $auto = explode("|", $_POST['automatique']); // En fonction de son état (Presents ou Sortis), on en déduit sa table. if ($auto[1] == "Presents") { $param['table'] = PPRESENTS; } else { $param['table'] = PSORTIS; } $param['cw'] = "WHERE idpatient='" . $auto[0] . "'"; // Lancement de la requête pour récupérer toutes ses informations. $req = new clResultQuery(); $res = $req->Execute("Fichier", "getPatients", $param, "ResultQuery"); $table_patient_automatique = $param['table']; // On récupère l'idpatient et la table actuelle du patient manuel sélectionné. $manu = explode("|", $_POST['manuel']); // En fonction de son état (Presents ou Sortis), on en déduit sa table. if ($manu[1] == "Presents") { $param2['table'] = PPRESENTS; } else { $param2['table'] = PSORTIS; } $param2['cw'] = "WHERE idpatient='" . $manu[0] . "'"; // Lancement de la requête pour récupérer toutes ses informations. $req2 = new clResultQuery(); $ras = $req2->Execute("Fichier", "getPatients", $param2, "ResultQuery"); $table_patient_manuel = $param2['table']; // On vérifie que le patient automatique existe. if ($res['INDIC_SVC'][2] < 1) { $this->erreurs .= "Le patient automatique (idpatient=\"" . $_POST['automatique'] . "\") est introuvable dans la table des patients " . $auto[1] . ". Problème signalé."; $errs->addErreur("clFusion : Le patient automatique (idpatient=\"" . $_POST['automatique'] . "\") est introuvable dans la table des patients " . $auto[1] . "."); // On vérifie que le patient manuel existe. } elseif ($ras['INDIC_SVC'][2] < 1) { $this->erreurs .= "Le patient manuel (idpatient=\"" . $manu[0] . "\") est introuvable dans la table des patients " . $manu[1] . ". Problème signalé."; $errs->addErreur("clFusion : Le patient manuel (idpatient=\"" . $manu[0] . "\") est introuvable dans la table des patients " . $manu[1] . "."); } else { $data['idu'] = $res['idu'][0]; $data['ilp'] = $res['ilp'][0]; $data['nsej'] = $res['nsej'][0]; $data['uf'] = $res['uf'][0]; $data['nom'] = $res['nom'][0]; $data['prenom'] = $res['prenom'][0]; $data['sexe'] = $res['sexe'][0]; $data['dt_naissance'] = $res['dt_naissance'][0]; $data['adresse_libre'] = $res['adresse_libre'][0]; $data['adresse_cp'] = $res['adresse_cp'][0]; $data['adresse_ville'] = $res['adresse_ville'][0]; $data['telephone'] = $res['telephone'][0]; $data['prevenir'] = $res['prevenir'][0]; $data['medecin_traitant'] = $res['medecin_nom'][0]; $data['dt_admission'] = $res['dt_admission'][0]; if ($res['mode_admission'][0]) { $data['mode_admission'] = $res['mode_admission'][0]; } $data['iduser'] = "******"; $data['manuel'] = 0; // Appel de la classe Requete. $requete = new clRequete(BDD, $param2['table'], $data); // Exécution de la requete. $requete->updRecord("idpatient='" . $manu[0] . "'"); // Appel de la classe Requete. $requete = new clRequete(BDD, $param['table']); // Exécution de la requete. $requete->delRecord("idpatient='" . $auto[0] . "'"); $this->infos .= "Fusion du patient (" . $res['sexe'][0] . ") " . ucfirst(strtolower($res['prenom'][0])) . " " . strtoupper($res['nom'][0]) . " effectuée.<br />"; if ($options->getOption("Module_CCAM")) { $fusion = 1; $ccam = new clCCAMCotationActesDiags(array()); $ccam->writeBALall(array($auto[0], $manu[0])); } } } }