garant/Controleur/ControleurLaboratoire.php
2025-12-05 10:57:03 +00:00

81 lines
2.6 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';
class ControleurLaboratoire extends Controleur {
private $beneficiaire;
private $prescription;
private $detailprescription;
private $prestation;
private $finger;
public function __construct() {
$this->menuvue = new Menuvueutilisateur();
$this->menuvue->getMenuVue('Laboratoire');
$this->prescription = new Examen_temp();
$this->detailprescription = new Detailexamem();
$this->prestation = new Prestationactes();
$this->beneficiaire = new Beneficiaire();
viderContexte();
$_SESSION['okId'] = "-1";
$this->finger = new Finger();
$_SESSION['codeTypeFacture_C'] = "LAB";
}
public function index()
{
$garantieadherent_temp = null;
$codePrestataire = $_SESSION['codePrestataire_C'];
$numeroBonExamen = $_SESSION['numeroBonExamen_C'];
if($numeroBonExamen=="-1")
{
$this->genererVue();
}
else
{
$resultat = $this->beneficiaire->getBeneficiaireOrdonnanceLab($numeroBonExamen);
$idBeneficiaire = $resultat['idBeneficiaire'];
$beneficiaire = $this->beneficiaire->getContexteBeneficiaireId($idBeneficiaire);
$this->prescription->initexamen_lab($numeroBonExamen);
$numeroExamen = $_SESSION['numeroExamen_C'];
$prescription = $this->prescription->getprescription_lab($numeroBonExamen);
$detailprescriptions = $this->detailprescription->getdetailprescription_lab($numeroBonExamen);
$detailnonlivres = $this->prescription->getdetailnonlivre();
$detaillivres = $this->prescription->getdetaillivre();
$user_id = $_SESSION['user_id_C'];
$this->finger->vider_finger_temp($user_id);
$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);
}
$this->genererVue(array('prescription' => $prescription, 'detailprescriptions' => $detailprescriptions,
'detailnonlivres' => $detailnonlivres, 'detaillivres' => $detaillivres, 'garantieadherent_temp' => $garantieadherent_temp));
}
}
}