prestation/Controleur/ControleurAjaxselectactesmedicauxproforma.php
2025-12-05 10:42:46 +00:00

135 lines
4.7 KiB
PHP
Executable File

<?php
require_once 'Framework/Controleur.php';
require_once 'Modele/Detailtarifacte.php';
require_once 'Modele/Prestationactes.php';
class ControleurAjaxselectactesmedicauxproforma extends Controleur {
private $acte;
private $prestation;
public function __construct() {
$this->acte = new Detailtarifacte();
$this->prestation = new Prestationactes();
}
public function index() {
$codeFamilleActe = $this->requete->getParametreFormulaire("codeFamilleActe");
$numeroFeuilleMaladie = $_SESSION['p_numeroFeuilleMaladie_C'];
$codePrestataire = $_SESSION['p_codePrestataire_C'];
$avisHospit = $this->prestation->getAvisHospitalisation($numeroFeuilleMaladie);
$prolongHospit = $this->prestation->getProlongationHospitalisation();
$this->acte->getTicketModerateurBareme($avisHospit['codeTypeHospitalisation']);
//
$tm = ($_SESSION['p_tm_TP']>"0") ? $_SESSION['p_tm_TP'] : $_SESSION['p_tm_C'];
if (is_array($prolongHospit) && count($prolongHospit) > "0"){
//$duree = ($prolongHospit['dureeCorrigeeProlongation'] > "0") ? $prolongHospit['dureeCorrigeeProlongation'] : $prolongHospit['dureeProlongation'];
if(is_array($prolongHospit) && $prolongHospit['dureeCorrigeeProlongation'] > "0") {
$duree = $prolongHospit['dureeCorrigeeProlongation'];
}else{
if(is_array($prolongHospit)) {
$duree = $prolongHospit['dureeProlongation'];
}else{
$duree ="0";
}
}
}else{
if(is_array($avisHospit) && $avisHospit['dureeCorrigee'] > "0") {
$duree = $avisHospit['dureeCorrigee'];
}else{
if(is_array($avisHospit)) {
$duree = $avisHospit['duree'];
}else{
$duree ="0";
}
}
}
if($tm > "100"){
$tm = $tm * $duree;
}
$actes = $this->acte->geatactesexamensselection($codeFamilleActe);
$prestations = $this->prestation->getactesmedicauxfeuilleproforma($numeroFeuilleMaladie, $codePrestataire);
//var_dump($prestations);
$prestations_total = $this->prestation->getactesmedicauxfeuilleproforma_total($numeroFeuilleMaladie, $codePrestataire);
$this->genererVueAjax(array('actes' => $actes, 'prestations' => $prestations, 'prestations_total' => $prestations_total,
'tm' => $tm, 'prolongHospit' => $prolongHospit));
}
public function enregistreractemedical()
{
$codeActe = $this->requete->getParametreFormulaire("codeActe");
$codeAvisHopitalisation = $this->requete->getParametreFormulaire("codeAvisHopitalisation");
$codeMedecin = $this->requete->getParametreFormulaire("codeMedecin");
$prixActe = $this->requete->getParametreFormulaire("prixActe", "numerique");
$valeurActe = $prixActe ;
$quantite = "1"; //$this->requete->getParametreFormulaire("quantite", "numerique");
$montantTm = $this->requete->getParametreFormulaire("montantTm", "numerique");
$aRembourser = $this->requete->getParametreFormulaire("aRembourser", "numerique");
$ententePrealable = $this->requete->getParametreFormulaire("ententePrealable");
$autorisation = "0";
$prixTarif = $prixActe ;
$numeroAvisProlongation = $this->requete->getParametreFormulaire("numeroAvisProlongation");
$this->prestation->enregistreractemedicalproforma($codeActe, $codeMedecin, $quantite, $prixActe, $valeurActe, $montantTm, $aRembourser,
$ententePrealable, $autorisation, $prixTarif, $codeAvisHopitalisation, $numeroAvisProlongation);
$this->executerAction("index");
}
public function supprimeracte()
{
$idProforma = $this->requete->getParametre("idProforma");
$codeTypePrestation = $this->requete->getParametre("codeTypePrestation");
$this->prestation->supprimeracteselectproforma($idProforma, $codeTypePrestation);
$this->executerAction("index");
}
public function majquantite()
{
$idProforma = $this->requete->getParametre("idProforma");
$quantite = $this->requete->getParametreFormulaire("quantite", "numerique");
$this->prestation->majquantiteproforma($idProforma, $quantite);
$this->executerAction("index");
}
public function validerproforma()
{
$codeAvisHopitalisation = $this->requete->getParametreFormulaire("codeAvisHopitalisation");
$numeroAvisProlongation = $this->requete->getParametreFormulaire("numeroAvisProlongation");
$this->prestation->validerproforma($codeAvisHopitalisation, $numeroAvisProlongation);
}
//17-10-2022
public function majprixacte()
{
$idProforma = $this->requete->getParametre("idProforma");
$prix = $this->requete->getParametreFormulaire("prix", "numerique");
$this->prestation->majprixacteproforma($idProforma, $prix);
$this->executerAction("index");
}
}