153 lines
4.6 KiB
PHP
Executable File
153 lines
4.6 KiB
PHP
Executable File
<?php
|
|
require_once 'Framework/Controleur.php';
|
|
require_once 'Modele/Prescription.php';
|
|
require_once 'Modele/Detailprescription.php';
|
|
require_once 'Modele/Menuvueutilisateur.php';
|
|
require_once 'Modele/Garantiesbaremepriseencharge.php';
|
|
require_once 'Modele/Ouinon.php';
|
|
|
|
class ControleurAjaxdetailprescription extends Controleur {
|
|
private $prescription;
|
|
private $detailprescription;
|
|
private $garantie;
|
|
private $ouinonrenouvelable;
|
|
|
|
public function __construct() {
|
|
$this->prescription = new Prescription();
|
|
$this->detailprescription = new Detailprescription();
|
|
$this->garantie = new Garantiesbaremepriseencharge();
|
|
|
|
$this->ouinonrenouvelable = (new Ouinon())->getListe();
|
|
}
|
|
|
|
public function index()
|
|
{
|
|
$numeroPrescription = $_SESSION['p_numeroPrescription_C'];
|
|
|
|
$prescription = $this->prescription->getprescription($numeroPrescription);
|
|
$this->detailprescription->recapmedicament($numeroPrescription);
|
|
|
|
$detailprescriptions = $this->detailprescription->getdetailprescription($numeroPrescription);
|
|
|
|
$montantTotalMedicament = $this->prescription->getParamMontantTotalMedicament();
|
|
|
|
$codeActe = "PH";
|
|
|
|
$idBeneficiaire = $_SESSION['p_idBeneficiaire_C'];
|
|
|
|
$datePrestation = $_SESSION['datePrestation'];
|
|
//var_dump($datePrestation);
|
|
|
|
$this->garantie->getsourcebaremenew($idBeneficiaire, $codeActe, $datePrestation);
|
|
|
|
|
|
|
|
$this->genererVueAjax(array('prescription' => $prescription, 'detailprescriptions' => $detailprescriptions, 'montantTotalMedicament' => $montantTotalMedicament,
|
|
'ouinonrenouvelable' => $this->ouinonrenouvelable));
|
|
}
|
|
|
|
public function ajoutermedicament()
|
|
{
|
|
$codeMedicament = $this->requete->getParametreFormulaire("codeMedicament");
|
|
|
|
$this->detailprescription->ajoutermedicament($codeMedicament);
|
|
|
|
$this->executerAction("index");
|
|
}
|
|
|
|
public function majquantite()
|
|
{
|
|
$idMedicament = $this->requete->getParametre("idMedicament");
|
|
$quantite = $this->requete->getParametreFormulaire("quantite", "numerique");
|
|
|
|
$this->detailprescription->majquantite($idMedicament, $quantite);
|
|
|
|
$this->executerAction("index");
|
|
}
|
|
|
|
public function majposologie()
|
|
{
|
|
$idMedicament = $this->requete->getParametre("idMedicament");
|
|
$posologie = $this->requete->getParametreFormulaire("posologie");
|
|
|
|
$this->detailprescription->majposologie($idMedicament, $posologie);
|
|
|
|
$this->executerAction("index");
|
|
}
|
|
|
|
public function supprimer()
|
|
{
|
|
$idMedicament = $this->requete->getParametre("idMedicament");
|
|
|
|
$this->detailprescription->supprimer($idMedicament);
|
|
|
|
// $this->executerAction("index");
|
|
}
|
|
|
|
public function initremplacement()
|
|
{
|
|
$idMedicament = $this->requete->getParametre("idMedicament");
|
|
|
|
$_SESSION['p_idMedicament_a_remplacer'] = $idMedicament;
|
|
}
|
|
|
|
public function consulterremplacement()
|
|
{
|
|
$numeroBonOrdonnance = $_SESSION['p_numeroBonOrdonnance_C'];
|
|
|
|
$medicaments_remplaces = $this->detailprescription->getmedicamentsremplaces($numeroBonOrdonnance);
|
|
|
|
$this->genererVueAjax(array('medicaments_remplaces' => $medicaments_remplaces));
|
|
}
|
|
|
|
public function remplacermedicament()
|
|
{
|
|
$codeMedicamentNouv = $this->requete->getParametreFormulaire("codeMedicamentNouv");
|
|
|
|
$this->detailprescription->remplacermedicament($codeMedicamentNouv);
|
|
|
|
// $this->executerAction("index");
|
|
}
|
|
|
|
public function accordpharmacie()
|
|
{
|
|
|
|
$montantTotalMedicament = $this->prescription->getParamMontantTotalMedicament();
|
|
|
|
|
|
$this->detailprescription->majdetailprescriptionaccordprealable($montantTotalMedicament);
|
|
|
|
|
|
$this->executerAction("index");
|
|
}
|
|
|
|
public function majduree()
|
|
{
|
|
$idMedicament = $this->requete->getParametre("idMedicament");
|
|
$duree = $this->requete->getParametreFormulaire("duree", "numerique");
|
|
|
|
$this->detailprescription->majdureetraitement($idMedicament, $duree);
|
|
|
|
$this->executerAction("index");
|
|
}
|
|
|
|
public function majrenouvelable()
|
|
{
|
|
$idMedicament = $this->requete->getParametre("idMedicament");
|
|
$renouvelable = $this->requete->getParametreFormulaire("renouvelable");
|
|
|
|
$this->detailprescription->majrenouvelable($idMedicament, $renouvelable);
|
|
|
|
$this->executerAction("index");
|
|
}
|
|
|
|
public function majfrequence()
|
|
{
|
|
$idMedicament = $this->requete->getParametre("idMedicament");
|
|
$frequence = $this->requete->getParametreFormulaire("frequence", "numerique");
|
|
|
|
$this->detailprescription->majfrequence($idMedicament, $frequence);
|
|
|
|
$this->executerAction("index");
|
|
}
|
|
} |