85 lines
3.0 KiB
PHP
85 lines
3.0 KiB
PHP
<?php
|
|
require_once 'Framework/Modele.php';
|
|
|
|
class Prescription extends Modele {
|
|
|
|
public function getprescription($numeroPrescription)
|
|
{
|
|
$sql = 'call sp_p_get_prescription(?)';
|
|
|
|
$prescription = $this->executerRequete($sql, array($numeroPrescription));
|
|
|
|
return $prescription->fetch(PDO::FETCH_ASSOC);
|
|
}
|
|
|
|
public function getContexteAjaxPrescription($numeroPrescription)
|
|
{
|
|
$_SESSION['p_numeroPrescription_C'] = $numeroPrescription;
|
|
}
|
|
|
|
public function getprescription_pha($numeroBonOrdonnance, $codePrestataireLivraison)
|
|
{
|
|
$sql = 'call sp_p_get_cons_pha(?, ?)';
|
|
|
|
$resultat = $this->executerRequete($sql, array($numeroBonOrdonnance, $codePrestataireLivraison));
|
|
|
|
$ligne = $resultat->fetch(PDO::FETCH_ASSOC);
|
|
|
|
$_SESSION['p_numeroFeuilleMaladie_C'] = $ligne['numeroFeuilleMaladie'];
|
|
|
|
$_SESSION['p_numeroBonConsultation_C'] = $ligne['numeroBonConsultation'];
|
|
$_SESSION['p_numeroBonOrdonnance_C'] = $ligne['numeroBonOrdonnance'];
|
|
$_SESSION['p_numeroBonHospitalisation_C'] = $ligne['numeroBonHospitalisation'];
|
|
$_SESSION['p_numeroBonOptique_C'] = $ligne['numeroBonOptique'];
|
|
$_SESSION['p_numeroBonExamen_C'] = $ligne['numeroBonExamen'];
|
|
$_SESSION['p_numeroBonKine_C'] = $ligne['numeroBonKine'];
|
|
|
|
$_SESSION['p_numeroPrescription_C'] = $ligne['numeroPrescription'];
|
|
$_SESSION['p_numeroOptique_C'] = $ligne['numeroOptique'];
|
|
$_SESSION['p_numeroExamen_C'] = $ligne['numeroExamen'];
|
|
$_SESSION['p_numeroPrescriptionKine_C'] = $ligne['numeroPrescriptionKine'];
|
|
|
|
$_SESSION['p_idFacture_C'] = $ligne['idFacture'];
|
|
$_SESSION['p_hospitalisation_C'] = $ligne['hospitalisation'];
|
|
if($_SESSION['p_hospitalisation_C']>0 && $_SESSION['p_appliquerTmHospit_C']>0)
|
|
{
|
|
$_SESSION['p_tm_C'] = "0";
|
|
}
|
|
$_SESSION['p_chirurgie_C'] = $ligne['chirurgie'];
|
|
|
|
return $ligne;
|
|
}
|
|
|
|
public function getdetailprescription_pha($numeroBonOrdonnance, $codePrestataireLivraison)
|
|
{
|
|
$sql = 'call sp_r_get_detail_prescription_pha(?, ?)';
|
|
|
|
$optique = $this->executerRequete($sql, array($numeroBonOrdonnance, $codePrestataireLivraison));
|
|
|
|
return $optique->fetchAll(PDO::FETCH_ASSOC);
|
|
}
|
|
|
|
public function enregistrerprescription($numeroBon, $codeMedecin, $codeGestionBon)
|
|
{
|
|
$idBeneficiaire = $_SESSION['p_idBeneficiaire_C'];
|
|
$numeroFeuilleMaladie = $_SESSION['p_numeroFeuilleMaladie_C'];
|
|
$numeroPrescription = $_SESSION['p_numeroPrescription_C'];
|
|
$user = $_SESSION['p_login'];
|
|
$fusionConsOrd = $_SESSION['p_fusionConsOrd'];
|
|
|
|
$sql = 'call sp_p_enregistrer_prescription(?, ?, ?, ?, ?, ?, ?, ?)';
|
|
|
|
$this->executerRequete($sql, array($idBeneficiaire, $numeroFeuilleMaladie, $numeroPrescription, $numeroBon,
|
|
$codeMedecin, $user, $codeGestionBon, $fusionConsOrd));
|
|
}
|
|
|
|
public function noprescription()
|
|
{
|
|
$numeroFeuilleMaladie = $_SESSION['p_numeroFeuilleMaladie_C'];
|
|
|
|
$sql = 'call sp_p_no_prescription(?)';
|
|
|
|
$this->executerRequete($sql, array($numeroFeuilleMaladie));
|
|
}
|
|
|
|
} |