executerRequete($sql, array($numeroPrescription)); return $resultat->fetchAll(PDO::FETCH_ASSOC); } public function getdetailprescription_pha($numeroBonOrdonnance) { $sql = 'call sp_p_get_detail_prescription_pha(?)'; $resultat = $this->executerRequete($sql, array($numeroBonOrdonnance)); return $resultat->fetchAll(PDO::FETCH_ASSOC); } public function getmedicamentsremplaces($numeroBonOrdonnance) { $numeroBonOrdonnance = $_SESSION['numeroBonOrdonnance_C']; $sql = 'call sp_p_get_medicaments_remplaces(?)'; $resultat = $this->executerRequete($sql, array($numeroBonOrdonnance)); return $resultat->fetchAll(PDO::FETCH_ASSOC); } public function getmotifmedicamentfeuille($numeroFeuilleMaladie) { if (isset($_SESSION['lang']) && $_SESSION['lang']=="en_US") { $sql = "SELECT DISTINCT D.`codeReponseEntentePrealable`, D.`motifReel`, D.motifRefusAssure FROM p_demandeententeprealablepha D WHERE A.numeroFeuilleMaladie=? AND D.codeReponseEntentePrealable != '2' ORDER BY D.codeReponseEntentePrealable;"; } else { $sql = "SELECT DISTINCT D.`codeReponseEntentePrealable`, D.`motifReel`, D.motifRefusAssure FROM p_demandeententeprealablepha D WHERE D.numeroFeuilleMaladie=? AND D.codeReponseEntentePrealable != '2' ORDER BY D.codeReponseEntentePrealable;"; } $resultat = $this->executerRequete($sql, array($numeroFeuilleMaladie)); return $resultat->fetchAll(PDO::FETCH_ASSOC); } public function getnumeroprescription($numeroFeuilleMaladie){ $sql = 'SELECT numeroPrescription FROM p_prescription WHERE numeroFeuilleMaladie = ?;'; $resultat = $this->executerRequete($sql, array($numeroFeuilleMaladie))->fetch(PDO::FETCH_ASSOC); return $resultat['numeroPrescription']; } public function getprescription($numeroPrescription) { $sql = 'call sp_p_get_prescription(?)'; $prescription = $this->executerRequete($sql, array($numeroPrescription)); return $prescription->fetch(PDO::FETCH_ASSOC); } public function getParamMontantTotalMedicament() { $codeSociete = $_SESSION['codeSociete']; $sql = 'SELECT montantTotalMedicament FROM `societeuser` WHERE `codeSociete` = ?;'; $resultat = $this->executerRequete($sql, array($codeSociete))->fetch(PDO::FETCH_ASSOC); return $resultat['montantTotalMedicament']; } public function majquantiteprod($idMedicament, $quantite) { $tm = "0"; $user = $_SESSION['login']; $sql = 'call sp_p_maj_quantite_medicament_prod(?, ?, ?, ?)'; $this->executerRequete($sql, array($idMedicament, $quantite, $tm, $user)); } public function supprimer($idMedicament) { $sql = 'call sp_p_supprimer_medicament_prescription(?)'; $this->executerRequete($sql, array($idMedicament)); } public function getdetailprescriptionExamen($numeroExamen) { $sql = 'call sp_r_get_detail_prescription_examen(?)'; $resultat = $this->executerRequete($sql, array($numeroExamen)); return $resultat->fetchAll(PDO::FETCH_ASSOC); } public function validermedicament($idMedicament,$numeroFeuilleMaladie,$p_choix) { $user = $_SESSION['login']; $sql = 'call sp_p_valider_prescription_medicament(?,?,?)'; $this->executerRequete($sql, array($idMedicament,$numeroFeuilleMaladie,$user)); } public function annulervalidermedicament($idMedicament,$numeroFeuilleMaladie,$p_choix) { $user = $_SESSION['login']; $sql = 'call sp_p_annuler_validation_prescription_medicament(?,?,?)'; $this->executerRequete($sql, array($idMedicament,$numeroFeuilleMaladie,$user)); } public function refusermedicament($idMedicament,$numeroFeuilleMaladie,$p_choix) { $user = $_SESSION['login']; $sql = 'call sp_p_refuser_prescription_medicament(?,?,?)'; $this->executerRequete($sql, array($idMedicament,$numeroFeuilleMaladie,$user)); } public function annulerrefusmedicament($idMedicament,$numeroFeuilleMaladie,$p_choix) { $user = $_SESSION['login']; $sql = 'call sp_p_annuler_refus_prescription_medicament(?,?,?)'; $this->executerRequete($sql, array($idMedicament,$numeroFeuilleMaladie,$user)); } public function validertousmedicaments($numeroFeuilleMaladie,$p_choix) { $user = $_SESSION['login']; $sql = 'call sp_p_valider_toutes_prescription_medicament(?,?)'; $this->executerRequete($sql, array($numeroFeuilleMaladie,$user)); } public function refusertousmedicaments($numeroFeuilleMaladie,$p_choix) { $user = $_SESSION['login']; $sql = 'call sp_p_refuser_toutes_prescription_medicament(?,?)'; $this->executerRequete($sql, array($numeroFeuilleMaladie,$user)); } public function annulervalidertousmedicament($numeroFeuilleMaladie) { $sql = 'call sp_p_annuler_valider_toutes_prescriptions_medicament(?);'; $this->executerRequete($sql, array($numeroFeuilleMaladie)); } public function annulerrefusertousmedicaments($numeroFeuilleMaladie,$p_choix) { $sql = 'call sp_p_annuler_refuser_toutes_prescription_medicament(?);'; $this->executerRequete($sql, array($numeroFeuilleMaladie)); } public function getdetailprescriptionseance($numeroFeuilleMaladie) { $sql = 'call sp_p_get_detail_seance(?);'; $resultat = $this->executerRequete($sql, array($numeroFeuilleMaladie)); return $resultat->fetchAll(PDO::FETCH_ASSOC); } public function gettotalseance() { $numeroFeuilleMaladie = $_SESSION['numeroFeuilleMaladie_C']; $codePrestataire = $_SESSION['codePrestataire_C']; $sql = 'SELECT IFNULL(SUM(fraisReel),"0") AS fraisReel_total, IFNULL(SUM(montantTm),"0") AS montantTm_total, IFNULL(SUM(montantArembourser),"0") AS montantArembourser_total, IFNULL(SUM(fraisReelBase),"0") AS fraisReelBase_total, IFNULL(SUM(depassement),"0") AS depassement_total FROM vw_p_prestationseances WHERE numeroFeuilleMaladie=(?) AND codePrestataire=(?)'; $resultat = $this->executerRequete($sql, array($numeroFeuilleMaladie,$codePrestataire)); return $resultat->fetch(PDO::FETCH_ASSOC); } }