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

132 lines
4.5 KiB
PHP
Executable File

<?php
require_once 'Framework/Controleur.php';
require_once 'Modele/Menuvueutilisateur.php';
require_once 'Modele/Beneficiaire.php';
require_once 'Modele/Detailexamem.php';
require_once 'Modele/Examen_temp.php';
require_once 'Modele/Prestationactes.php';
require_once 'Modele/Finger.php';
require_once 'Modele/Detailtarifacte.php';
class ControleurLaboratoirecso extends Controleur {
private $menuvue;
private $beneficiaire;
private $prescription;
private $detailprescription;
private $prestation;
private $finger;
private $acte;
public function __construct() {
$this->menuvue = new Menuvueutilisateur();
$this->menuvue->getMenuVue('Laboratoirecso');
$this->prescription = new Examen_temp();
$this->detailprescription = new Detailexamem();
$this->prestation = new Prestationactes();
$this->acte = new Detailtarifacte();
$this->beneficiaire = new Beneficiaire();
viderContexte();
$_SESSION['p_okId'] = "-1";
$this->finger = new Finger();
$_SESSION['p_codeTypeFacture_C'] = "LABCSO";
}
public function index()
{
$garantieadherent_temp = null;
$codePrestataire = $_SESSION['p_codePrestataire_C'];
$numeroBonExamen = $_SESSION['p_numeroBonExamen_C'];
if($numeroBonExamen=="-1")
{
$this->genererVue();
}
else
{
$resultat = $this->beneficiaire->getBeneficiaireOrdonnanceLabCsoExt($numeroBonExamen);
/*
if(!is_array($resultat)){
$existeBon = $this->beneficiaire->existeBonExamen($numeroBonExamen);
if($existeBon>"0"){
$_SESSION['p_numeroBonExamen_C'] = $numeroBonExamen;
$_SESSION['p_numeroExamen_C'] = $this->beneficiaire->getNumeroExamen($numeroBonExamen);
$_SESSION['p_numeroFeuilleMaladie_C'] = $this->beneficiaire->getNumeroFeuilleMaladie($numeroBonExamen);
$this->rediriger("Examensmedicaux");
}else{
$_SESSION['p_numeroBonExamen_C'] = "-1";
$this->rediriger("Laboratoirecso");
}
}
*/
$idBeneficiaire = $resultat['idBeneficiaire'];
$beneficiaire = $this->beneficiaire->getContexteBeneficiaireId($idBeneficiaire);
$this->prescription->initexamen_lab_cso_ext($numeroBonExamen);
$numeroExamen = $_SESSION['p_numeroExamen_C'];
$numeroFeuilleMaladie = $_SESSION['p_numeroFeuilleMaladie_C'];
$codePrestataire = $_SESSION['p_codePrestataire_C'];
$prescription = $this->prescription->getprescription_lab($numeroBonExamen);
$detailprescriptions = $this->detailprescription->getdetailprescription_lab($numeroBonExamen);
$detailnonlivres = $this->prescription->getdetailnonlivre();
$detaillivres = $this->prescription->getdetaillivre();
$user_id = $_SESSION['p_user_id_C'];
$this->finger->vider_finger_temp($user_id);
$situationExamen = $this->acte->getSituationGarantiesExamenBeneficiaire();
$groupeEXA = $this->detailprescription->getdetailgroupeexamenfeuille_total("EXA");
$groupeIMA = $this->detailprescription->getdetailgroupeexamenfeuille_total("IMA");
$groupeBIO = $this->detailprescription->getdetailgroupeexamenfeuille_total("BIO");
$plafondAtteint = $this->acte->verifiePlafondExamen($numeroExamen);
$facture = $prescription['facture'];
$numeroFeuilleMaladie = $prescription['numeroFeuilleMaladie'];
$numeroExamen = $prescription['numeroExamen'];
$this->prestation->vider_garantieadherent_temp($numeroFeuilleMaladie, $codePrestataire);
if($facture==0)
{
$garantieadherent_temp = $this->prestation->init_garantieadherent_temp_lab($numeroFeuilleMaladie, $codePrestataire);
}
$factures = $this->prescription->getfactures_examen($numeroBonExamen);
$factures_toal = $this->prescription->getfactures_total_examen($numeroBonExamen);
$datePrestation = $this->acte->getDatePrestation($numeroFeuilleMaladie);
$tm = $this->acte->ticketModerateurDefinitif("", "", $datePrestation);
$tauxCouverture = (100-$tm)."%";
$this->genererVue(array('prescription' => $prescription, 'detailprescriptions' => $detailprescriptions,
'detailnonlivres' => $detailnonlivres, 'detaillivres' => $detaillivres, 'garantieadherent_temp' => $garantieadherent_temp,
'factures' => $factures, 'factures_toal' => $factures_toal, 'tauxCouverture' => $tauxCouverture, 'plafondAtteint' => $plafondAtteint,
'groupeEXA' => $groupeEXA, 'groupeIMA' => $groupeIMA, 'groupeBIO' => $groupeBIO, 'situationExamen' => $situationExamen));
}
}
}