268 lines
10 KiB
PHP
268 lines
10 KiB
PHP
<?php
|
|
require_once 'Framework/Controleur.php';
|
|
require_once 'Modele/Detailprescription.php';
|
|
require_once 'Modele/Prescription_temp.php';
|
|
require_once 'Modele/Prestationactes.php';
|
|
require_once 'Modele/Demandesubstitution.php';
|
|
require_once 'Modele/Detailtarifacte.php';
|
|
require_once 'Modele/Garantiesbaremepriseencharge.php';
|
|
|
|
class ControleurAjaxdetailpharmacien extends Controleur {
|
|
private $prescription;
|
|
private $detailprescription;
|
|
private $prestation;
|
|
private $dmd;
|
|
private $acte;
|
|
private $garantie;
|
|
|
|
public function __construct() {
|
|
$this->prescription = new Prescription_temp();
|
|
$this->detailprescription = new Detailprescription();
|
|
$this->prestation = new Prestationactes();
|
|
$this->dmd = new Demandesubstitution();
|
|
$this->acte = new Detailtarifacte();
|
|
$this->garantie = new Garantiesbaremepriseencharge();
|
|
}
|
|
|
|
public function index()
|
|
{
|
|
$numeroFeuilleMaladie = $_SESSION['p_numeroFeuilleMaladie_C'];
|
|
$codePrestataire = $_SESSION['p_codePrestataire_C'];
|
|
$numeroBonOrdonnance = $_SESSION['p_numeroBonOrdonnance_C'];
|
|
$numeroPrescription = $_SESSION['p_numeroPrescription_C'];
|
|
|
|
$datePrestation = $_SESSION['datePrestation'];
|
|
$idBeneficiaire = $_SESSION['p_idBeneficiaire_C'];
|
|
$codeActe = "PH";
|
|
|
|
$codeGarantie = "PHA";
|
|
|
|
$this->garantie->getsourcebaremenew($idBeneficiaire, $codeActe, $datePrestation);
|
|
|
|
$baremesolde = $this->garantie->getbaremesoldeacte($idBeneficiaire,$codeActe,$codeGarantie,$datePrestation);
|
|
$statut = $this->garantie->getstatutacte($idBeneficiaire,$codeActe,$codeGarantie);
|
|
|
|
$dateFinDelaiCarenceActe = $_SESSION['p_bareme']['bareme_finDelaiCarence'];//$this->acte->getDateFinDelaiCarenceActe();
|
|
|
|
$soldeConsommation = $baremesolde['soldeConsommation'];
|
|
$soldeNbreTransaction = $baremesolde['soldeNbreTransaction'];
|
|
|
|
if($soldeConsommation < 0)
|
|
{
|
|
$soldeConsommation = 0;
|
|
}
|
|
|
|
if($soldeNbreTransaction < 0)
|
|
{
|
|
$soldeNbreTransaction = 0;
|
|
}
|
|
|
|
$prescription = $this->prescription->getprescription_pha($numeroBonOrdonnance);
|
|
|
|
$detailprescriptions = $this->detailprescription->getdetailprescription_pha($numeroBonOrdonnance);
|
|
|
|
$marges = $this->detailprescription->getMarges();
|
|
|
|
$detailnonlivres = $this->prescription->getdetailnonlivre();
|
|
|
|
|
|
$detaillivres = $this->prescription->getdetaillivrepha();
|
|
|
|
|
|
|
|
$garantieadherent_temp = $this->prestation->getgarantieadherent_temp($numeroFeuilleMaladie, $codePrestataire);
|
|
|
|
|
|
$idPrestationactes = $this->prescription->getIdPrestationactes();
|
|
|
|
$gar_codePeriodicite = $_SESSION['p_bareme']['gar_codePeriodiciteBeneficiaire'];
|
|
$gar_periodicite = $this->garantie->getlibelleperiodicite($gar_codePeriodicite);
|
|
$gar_periodiciteEng = $this->garantie->getlibelleperiodicite($gar_codePeriodicite);
|
|
|
|
|
|
$gar_codePeriodicitePlafond = $_SESSION['p_bareme']['gar_codePeriodicitePlafondBeneficiaire'];
|
|
$gar_periodicitePlafond = $this->garantie->getlibelleperiodicite($gar_codePeriodicitePlafond);
|
|
$gar_periodicitePlafondEng = $this->garantie->getlibelleperiodicite($gar_codePeriodicitePlafond);
|
|
|
|
|
|
$act_codePeriodicite = $_SESSION['p_bareme']['act_codePeriodiciteBeneficiaire'];
|
|
$act_periodicite = $this->garantie->getlibelleperiodicite($act_codePeriodicite);
|
|
$act_periodiciteEng = $this->garantie->getlibelleperiodicite($act_codePeriodicite);
|
|
|
|
$act_codePeriodicitePlafond = $_SESSION['p_bareme']['act_codePeriodicitePlafondBeneficiaire'];
|
|
$act_periodicitePlafond = $this->garantie->getlibelleperiodicite($act_codePeriodicitePlafond);
|
|
$act_periodicitePlafondEng = $this->garantie->getlibelleperiodicite($act_codePeriodicitePlafond);
|
|
|
|
$gar_nbreTransaction = $_SESSION['p_bareme']['gar_nbreTransactionBeneficiaire'];
|
|
$gar_forfaitPlafond = $_SESSION['p_bareme']['gar_forfaitPlafondBeneficiaire'];
|
|
|
|
$act_forfaitPlafond = $_SESSION['p_bareme']['act_forfaitPlafondBeneficiaire'];
|
|
$act_nbreTransaction = $_SESSION['p_bareme']['act_nbreTransactionBeneficiaire'];
|
|
|
|
$prixZero = $this->prescription->getNombrePrixZero($numeroPrescription);
|
|
|
|
$this->genererVueAjax(array('prescription' => $prescription, 'detailprescriptions' => $detailprescriptions,
|
|
'detailnonlivres' => $detailnonlivres, 'detaillivres' => $detaillivres, 'garantieadherent_temp' => $garantieadherent_temp,
|
|
'marges' => $marges,'idPrestationactes' => $idPrestationactes, 'soldeConsommation' => $soldeConsommation,
|
|
'soldeNbreTransaction' => $soldeNbreTransaction, 'statut' => $statut, 'prixZero' => $prixZero,
|
|
|
|
'gar_codePeriodicite' => $gar_codePeriodicite,'gar_periodicite' => $gar_periodicite,
|
|
'gar_periodiciteEng' => $gar_periodiciteEng,'gar_codePeriodicitePlafond' => $gar_codePeriodicitePlafond,
|
|
'gar_periodicitePlafond' => $gar_periodicitePlafond,'gar_periodicitePlafondEng' => $gar_periodicitePlafondEng,
|
|
'act_codePeriodicite' => $act_codePeriodicite,'act_periodicite' => $act_periodicite,
|
|
'act_periodiciteEng' => $act_periodiciteEng,'act_codePeriodicitePlafond' => $act_codePeriodicitePlafond,
|
|
'act_periodicitePlafond' => $act_periodicitePlafond,'act_periodicitePlafondEng' => $act_periodicitePlafondEng,
|
|
'gar_nbreTransaction' => $gar_nbreTransaction,'gar_forfaitPlafond' => $gar_forfaitPlafond,
|
|
'act_forfaitPlafond' => $act_forfaitPlafond,'act_nbreTransaction' => $act_nbreTransaction
|
|
));
|
|
}
|
|
|
|
public function ajoutermedicament()
|
|
{
|
|
$idMedicament = $this->requete->getParametreFormulaire("idMedicament");
|
|
|
|
$this->prescription->ajoutermedicament($idMedicament);
|
|
|
|
$this->executerAction("index");
|
|
}
|
|
|
|
public function ajoutermedicamenttous()
|
|
{
|
|
$this->prescription->ajoutermedicamenttous();
|
|
$this->executerAction("index");
|
|
}
|
|
|
|
public function retirermedicament()
|
|
{
|
|
$idMedicament = $this->requete->getParametreFormulaire("idMedicament");
|
|
|
|
$this->prescription->retirermedicament($idMedicament);
|
|
|
|
$this->executerAction("index");
|
|
}
|
|
|
|
public function retirermedicamenttous()
|
|
{
|
|
$this->prescription->retirermedicamenttous();
|
|
$this->executerAction("index");
|
|
}
|
|
|
|
public function enregistrerpharmacie()
|
|
{
|
|
$this->prescription->facturerpharmacie();
|
|
|
|
$this->executerAction("index");
|
|
}
|
|
|
|
public function annulersubstitutionmedicament()
|
|
{
|
|
$idDetail = $this->requete->getParametreFormulaire("idDetail");
|
|
|
|
$this->prescription->annulersubstitutionmedicament($idDetail);
|
|
|
|
$this->executerAction("index");
|
|
}
|
|
|
|
public function enregistrersubstitutionmedicament()
|
|
{
|
|
$idMedicament = $this->requete->getParametreFormulaire("idMedicament");
|
|
$prixTarif = $this->requete->getParametreFormulaire("prixTarif", "numerique");
|
|
$idSubstitut = $this->requete->getParametreFormulaire("idSubstitut");
|
|
$prixSubstitut = $this->requete->getParametreFormulaire("prixSubstitut", "numerique");
|
|
$qteMedicamentSubstitut = $this->requete->getParametreFormulaire("qteMedicamentSubstitut","numerique");
|
|
|
|
$nvellePosologie = $this->requete->getParametreFormulaire("nvellePosologie");
|
|
|
|
$codeMedicamentPrescrit = $this->dmd->getCodeMedicament($idMedicament);
|
|
$codeMedicamentSubstitution = $this->dmd->getCodeMedicament($idSubstitut);
|
|
|
|
//var_dump($codeMedicamentPrescrit, $prixTarif, $codeMedicamentSubstitution, $prixSubstitut,
|
|
//$nvellePosologie, $qteMedicamentSubstitut);
|
|
//die();
|
|
|
|
$this->prescription->enregistrersubstitutionmedicament($codeMedicamentPrescrit, $prixTarif, $codeMedicamentSubstitution, $prixSubstitut,
|
|
$nvellePosologie, $qteMedicamentSubstitut);
|
|
|
|
$this->executerAction("index");
|
|
}
|
|
|
|
public function ajoutermedicamentprescription()
|
|
{
|
|
$codeMedicament = $this->requete->getParametreFormulaire("codeMedicament");
|
|
|
|
$this->detailprescription->ajoutermedicamentpha($codeMedicament);
|
|
|
|
$this->executerAction("index");
|
|
}
|
|
|
|
public function majquantitepha()
|
|
{
|
|
$idMedicament = $this->requete->getParametre("idMedicament");
|
|
$quantite = $this->requete->getParametreFormulaire("quantite", "numerique");
|
|
|
|
$this->detailprescription->majquantitepha($idMedicament, $quantite);
|
|
|
|
$this->executerAction("index");
|
|
}
|
|
|
|
public function demanderaccordpha()
|
|
{
|
|
$idMedicament = $this->requete->getParametreFormulaire("idMedicament");
|
|
|
|
$this->detailprescription->demanderaccordpha($idMedicament);
|
|
|
|
$this->executerAction("index");
|
|
}
|
|
|
|
public function majprixcso()
|
|
{
|
|
$idMedicament = $this->requete->getParametre("idMedicament");
|
|
$prix = $this->requete->getParametreFormulaire("prix", "numerique");
|
|
|
|
// $this->detailprescription->majquantitepha($idMedicament, $quantite);
|
|
$this->detailprescription->majprixcso($idMedicament, $prix);
|
|
|
|
$this->executerAction("index");
|
|
}
|
|
|
|
public function majprixpha()
|
|
{
|
|
$idMedicament = $this->requete->getParametre("idMedicament");
|
|
$prix = $this->requete->getParametreFormulaire("prix", "numerique");
|
|
|
|
$this->detailprescription->majprixpha($idMedicament, $prix);
|
|
|
|
$this->executerAction("index");
|
|
}
|
|
|
|
public function majprixmanuelpha()
|
|
{
|
|
$numeroBonOrdonnance = $_SESSION['p_numeroBonOrdonnance_C'];
|
|
$idLivre = $this->requete->getParametreFormulaire("idLivre", "numerique");
|
|
$valeurActeManuel = $this->requete->getParametreFormulaire("valeurActeManuel", "numerique");
|
|
$prixManuel = $this->requete->getParametreFormulaire("prixManuel", "numerique");
|
|
$montantTm = $this->requete->getParametreFormulaire("montantTm", "numerique");
|
|
$montantArembourser = $this->requete->getParametreFormulaire("montantArembourser", "numerique");
|
|
|
|
$this->prescription->majprixmanuelpha($idLivre, $valeurActeManuel, $prixManuel, $montantTm, $montantArembourser);
|
|
|
|
$this->executerAction("index");
|
|
|
|
//$prescription = $this->prescription->getprescription_pha($numeroBonOrdonnance);
|
|
|
|
//$this->genererVueAjax(array('prescription' => $prescription));
|
|
}
|
|
|
|
public function tableaulivre()
|
|
{
|
|
$numeroBonOrdonnance = $_SESSION['p_numeroBonOrdonnance_C'];
|
|
|
|
$prescription = $this->prescription->getprescription_pha($numeroBonOrdonnance);
|
|
$detaillivres = $this->prescription->affiche_detailpha();
|
|
|
|
$this->genererVueAjax(array('prescription' => $prescription,'detaillivres' => $detaillivres));
|
|
}
|
|
|
|
}
|
|
|