prestation/Vue/Prescriptionexamen/index.php
2025-12-01 18:54:33 +00:00

492 lines
22 KiB
PHP

<?php
$this->titre = "INTER-SANTE - Prescription Examens";
$numeroBonExamen = $examen['numeroBonExamen'];
$numeroExamen = $examen['numeroExamen'];
$ententePrealable = $examen['ententePrealable'];
//$_SESSION["ententePrealable"] = $ententePrealable;
$facture = $examen['facture'];
$_SESSION['p_numeroBonExamen_C']= $numeroBonExamen;
$_SESSION['p_numeroExamen_C'] = $numeroExamen;
$badcodeGestionBon = "1";
$tab_gestion_bon = array("0", "1", "2");
if (in_array($codeGestionBon, $tab_gestion_bon))
{
$badcodeGestionBon = "0";
}
$actVisible = $_SESSION['p_actVisible'];
if (isset($_SESSION['p_lang']) && $_SESSION['p_lang']=="en_US")
{
$libelleCarence = "Wait Period";
}
else
{
$libelleCarence = "Carence";
}
$agePrescription = $this->nettoyer($examen['agePrescription']);
$bonCaduc = $this->nettoyer($examen['bonCaduc']);
$modeSaisieFacture = $_SESSION['p_modeSaisieFacture'];
if($modeSaisieFacture=="1")
{
$bonCaduc = "0";
}
$motifExam = $examen['motifExamen'];
?>
<div id="div_prescription">
<script type="text/javascript">
</script>
<input class="sr-only" id="badcodeGestionBon" name="badcodeGestionBon" type="text" value= "<?= $badcodeGestionBon ?>" >
<input class="sr-only" id="bonCaduc" name="bonCaduc" type="text" value= "<?= $bonCaduc ?>" >
<input class="sr-only" id="nomForm" name="nomForm" type="text" value= "prescriptionexamens">
<input class="sr-only" id="ententePrealable" name="ententePrealable" type="text" value= "<?= $ententePrealable ?>">
<input class="sr-only" id="montantTotalExamen" name="montantTotalExamen" type="text" value= "<?= $montantTotalExamen ?>">
<input class="sr-only" id="codeReponseEntentePrealable" name="codeReponseEntentePrealable" type="text" value= "<?= $codeReponseEntentePrealable ?>">
<input class="sr-only" type="text" id="prescriptionSiCritereBareme" name="prescriptionSiCritereBareme" value="<?= $_SESSION['p_prescriptionSiCritereBareme_C'] ?>" >
<div id="div_contestation"></div>
<?php if ($numeroBonExamen<="0" && $badcodeGestionBon=="1") : ?>
<div class="alert alert-danger" style="height:40px; padding:5px; text-align:center;" >
<H4> <?= _("REVOIR LE TYPE DE GESTION DES BONS") ?> </H4>
</div>
<?php else: ?>
<button class="sr-only" id="btn_pop_tarif" name="btn_pop_tarif" type="button" data-bs-toggle="modal" data-bs-target="#popTarif" style='font-size:10pt;' > </button>
<input class="sr-only" id="codeTypePrestation" name="codeTypePrestation" type="text" value="EXAM">
<input class="sr-only" id="facture" name="facture" type="text" value= "<?= $facture ?>" >
<input class="sr-only" id="numeroBonExamen" name="numeroBonExamen" type="text" value= "<?= $numeroBonExamen ?>" >
<input class="sr-only" id="codeMedecin" name="codeMedecin" type="text" value= "<?= $examen['codeMedecin'] ?>">
<input class="sr-only" type="text" id="nbBonsOrd" name="nbBonsOrd" Value="<?= $nbBonsOrd ?>" >
<input class="sr-only" type="text" id="codeGestionBon" name="codeGestionBon" Value="<?= $codeGestionBon ?>" >
<input class="sr-only" type="text" id="demandeTraite" name="demandeTraite" Value="<?= $demandeTraite ?>" >
<input class="sr-only" type="text" id="nbreEntentePrealable" name="nbreEntentePrealable" Value="<?= $nbreEntentePrealable ?>" >
<?php if ($numeroBonExamen>"0") : ?>
<legend><?= _("Prescription Examens") ?></legend>
<?php else: ?>
<legend> <?= _("Nouvelle prescription Examens") ?> </legend>
<?php endif; ?>
<div id="div_findelaicarence">
</div>
<table class="table table-responsive table-condensed" style='font-size:9pt;' >
<tbody>
<!--
<tr>
<td width="5%" > <?= _("Souscripteur") ?> </td>
<td width="20%">
<INPUT style='text-align:center; font-size:9pt;' class="form-control" TYPE="text" id="nomClient" name="nomClient"
value="<?= $_SESSION['p_nomClient_C'] ?>" onChange="" readonly >
</td>
<td width="5%" align="center" > <?= _("Adhérent") ?> </td>
<td width="20%" > <INPUT class="form-control" TYPE="text" value="<?= $_SESSION['p_adherent_C']; ?>" readonly style="text-align: center; font-size:9pt;" > </td>
<td width="5%" align="center"> <?= _("Patient") ?> </td>
<td width="25%"> <INPUT class="form-control" TYPE="text" value="<?= $_SESSION['p_beneficiaire_C']; ?>" readonly style='font-size:9pt;'> </td>
<td width="7%" align="center"> <?= _("Tél. Patient") ?> </td>
<td width="13%"> <INPUT class="form-control" TYPE="text" value="<?= $_SESSION['p_telephonePortableBeneficiaire_C']; ?>" readonly style='font-size:9pt;'> </td>
</tr>
-->
<tr>
<td >
<INPUT style='font-size:12pt; font-weight: bold; background-color:#f5deb3 !important; color:#a0522d; text-align:center;' class="form-control" TYPE="text" id="nomClient" name="nomClient"
value="<?= 'TAUX DE COUVERTURE : '.$tauxCouverture ?>" onChange="" readonly >
</td>
</tr>
</tbody>
</table>
<div id="div_statutacte">
</div>
<INPUT id="dateSurvenance" name="dateSurvenance" class="sr-only" TYPE="text" value="<?= dateLang($this->nettoyer($examen['datePrescription'])) ?>" readonly >
<div id="div_messages" style="margin-top:10px;">
</div>
<table class="table table-responsive table-condensed" style='font-size:10pt;'>
<tbody>
<tr>
<td width="15%" > Date </td>
<td width="20%" > <INPUT id="datePrescription" name="datePrescription" class="form-control" TYPE="text" value="<?= dateLang($this->nettoyer($examen['datePrescription'])) ?>" readonly style="text-align: center; font-size:10pt;" > </td>
<td width="7%" align="center" class="required"> <?= _("Praticien") ?> </td>
<td colspan="3">
<?php if ($numeroBonExamen>"0" or $facture=="1") : ?>
<INPUT class="form-control" TYPE="text" value="<?= $this->nettoyer($examen['medecinPrescription']) ?>" readonly style='font-size:10pt;'>
<?php else: ?>
<SELECT id="medecinPrescription" class="form-control selectpicker" data-live-search="true" NAME="medecinPrescription" style='font-size:10pt;' required>
<?php liste_options($medecins,$examen['codeMedecin'],true); ?>
</SELECT>
<?php endif; ?>
</td>
<td align="center"> <?= _("No Bon") ?> </td>
<td width="10%" > <input class="form-control" style="text-align: center; font-size:10pt; background-color:blue !important;color:white;" type="number" id="numeroBon" name="numeroBon" value="<?= $numeroBonExamen ?>" readonly > </td>
</tr>
<!--
<tr>
<td > <?= _("Bons Disponible") ?> </td>
<td > <input class="form-control" style="text-align: center; font-size:10pt;" Value="<?= $nbBonsOrd ?>" readonly > </td>
<td align="center"> <?= _("No Bon") ?> </td>
<td width="20%" > <input class="form-control" style="text-align: center; font-size:10pt; background-color:blue !important;color:white;" type="number" id="numeroBon" name="numeroBon" value="<?= $numeroBonExamen ?>" readonly > </td>
<td width="5%" align="center" > <?= _("Gestion") ?> </td>
<td>
<?php if($badcodeGestionBon=="1") : ?>
<input class="form-control" style="text-align: center; font-size:10pt; background-color: red;color:white;" Value="<?= _("INCONNU") ?>" readonly >
<?php else: ?>
<input class="form-control" style="text-align: center; font-size:10pt;" Value="<?= $typeGestionbon ?>" readonly >
<?php endif; ?>
</td>
</tr>
-->
<tr>
<?php if($facture=="1" || $bonCaduc=="1"): ?>
<td width="15%" class="required"> <?= _("Renseignement Clinique") ?> </td>
<td colspan="7"><input id="motifExamen" name="motifExamen" style="font-size:10pt;" class="form-control" value="<?= $motifExam ?>" type="text" disabled></td>
<?php elseif(empty($motifExam) || $numeroBonExamen=="0") : ?>
<td width="15%" class="required"> <?= _("Renseignement Clinique") ?> </td>
<td colspan="7"><input id="motifExamen" name="motifExamen" style="font-size:10pt;" class="form-control" value="" type="text" onChange="javascript:verification_contestation();" autofocus required placeholder="<?= _("Obligatoire pour enregistrer la prescription..."); ?>" ></td>
<?php else: ?>
<td width="15%" class="required"> <?= _("Renseignement Clinique") ?> </td>
<td colspan="7"><input id="motifExamen" name="motifExamen" style="font-size:10pt;" class="form-control" value="<?= $motifExam ?>" type="text" onChange="javascript:majMotifExamen();" required ></td>
<?php endif; ?>
</tr>
</tbody>
</table>
<div id="infosbon">
<?php if($codeGestionBon!="0"): ?>
<?php if ($numeroBonExamen>"0") : ?>
<?php if ($facture=="1"): ?>
<div class="alert alert-danger" style="height:40px; padding:5px; text-align:center;" >
<H4> <?= _("Dejà facturée !") ?> </H4>
</div>
<?php else: ?>
<?php if($bonCaduc=="1") : ?>
<div class="alert alert-danger" style="height:40px; padding:5px; text-align:center; margin-bottom:5px;" >
<H4> <?= " Age => ".$agePrescription . " "._("jours") . " => " . _("BON CADUC") ?> </H4>
</div>
<?php else: ?>
<?php if(!empty($motifExam) && $demandeTraite=="0") : ?>
<table class="table table-responsive table-condensed" style='font-size:10pt;'>
<tbody>
<tr>
<td >
<div class="frmSearch" style="position: relative;">
<input id="searchInput" name="searchInput" style="font-size:11pt; padding-left: 35px;" class="form-control" type="text" placeholder="<?= _("Effectuer une recherche d'examen...") ?>" autofocus required AUTOCOMPLETE="OFF">
<i class="fas fa-search" style="position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: #999;"></i>
<div id="div_selection"></div>
</div>
</td>
</tr>
</tbody>
</table>
<?php endif; ?>
<?php endif; ?>
<?php endif; ?>
<?php else: ?>
<input class="sr-only" type="text" id="codeEtatBon" name="codeEtatBon" value="1">
<input class="sr-only" type="text" id="numeroBonSave" name="numeroBonSave" value="1">
<input class="sr-only" type="text" id="numeroBon" name="numeroBon" value="1">
<?php if($codeGestionBon=="1" && $nbBonsOrd<1): ?>
<div class="alert alert-danger" style="height:40px; padding:5px; text-align:center;" >
<H4> <?= _("STOCK DE BON EPUISE") ?> </H4>
</div>
<?php else: ?>
<?php if ($facture=="1"): ?>
<div class="alert alert-danger" style="height:40px; padding:5px; text-align:center;" >
<H4> <?= _("Dejà facturée !") ?> </H4>
</div>
<?php elseif($bonCaduc=="1"): ?>
<div class="alert alert-danger" style="height:40px; padding:5px; text-align:center; margin-bottom:5px;" >
<H4> <?= " Age => ".$agePrescription . " "._("jours") . " => " . _("BON CADUC") ?> </H4>
</div>
<?php endif; ?>
<?php endif; ?>
<?php endif; ?>
<?php else: ?>
<input class="sr-only" type="text" id="codeEtatBon" name="codeEtatBon" value="">
<input class="sr-only" type="text" id="numeroBonSave" name="numeroBonSave" value="0">
<?php if ($numeroBonExamen>"0") : ?>
<table class="table table-responsive table-condensed" style='font-size:10pt;'>
<tbody>
<tr>
<td width="10%" > <?= _("No Bon") ?> </td>
<td width="24%" > <input class="form-control" style="text-align: center; font-size:10pt; background-color:blue;color:white;" type="number" id="numeroBon" name="numeroBon" value="<?= $numeroBonExamen ?>" readonly > </td>
</tr>
<tr>
<?php if ($facture=="1"): ?>
<td >
<div class="alert alert-danger" style="height:40px; padding:5px; text-align:center;" >
<H4> <?= _("Dejà facturée !") ?> </H4>
</div>
</td>
<?php elseif($bonCaduc=="1"): ?>
<td >
<div class="alert alert-danger" style="height:40px; padding:5px; text-align:center; margin-bottom:5px;" >
<H4> <?= " Age => ".$agePrescription . " "._("jours") . " => " . _("BON CADUC") ?> </H4>
</div>
</td>
<?php endif; ?>
</tr>
<tr>
<td >
<div class="frmSearch" style="position: relative;">
<input id="searchInput" name="searchInput" style="font-size:11pt; padding-left: 35px;" class="form-control" type="text" placeholder="<?= _("Effectuer une recherche d'examen...") ?>" autofocus required AUTOCOMPLETE="OFF">
<i class="fas fa-search" style="position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: #999;"></i>
<div id="div_selection"></div>
</div>
</td>
</tr>
</tbody>
</table>
<?php else: ?>
<table class="table table-responsive table-condensed" style='font-size:10pt;'>
<tbody>
<?php if($nbBonsOrd<1): ?>
<tr>
<input class="sr-only" type="number" id="numeroBon" name="numeroBon" required AUTOCOMPLETE="OFF" >
<td>
<div class="alert alert-danger" style="height:40px; padding:5px; text-align:center;" >
<H4> <?= _("STOCK DE BON EPUISE") ?> </H4>
</div>
</td>
</tr>
<?php else: ?>
<tr>
<td width="10%" > <?= _("No Bon") ?> </td>
<?php if ($facture=="1"): ?>
<td width="24%" > <input class="form-control" style="text-align: center; font-size:10pt; background-color:blue;color:white;" type="number" id="numeroBon" name="numeroBon" value="<?= $numeroBonExamen ?>" readonly > </td>
<?php elseif($bonCaduc!="1"): ?>
<td width="24%" > <input class="form-control" style="text-align: center; font-size:10pt;" type="number" id="numeroBon" name="numeroBon" required AUTOCOMPLETE="OFF"
onChange="ajaxinfosbonprescriptionexamen();" onkeypress="javascript:ctrlkeypress_numeroBon(event);" autofocus ></td>
<?php else: ?>
<td width="24%" > <input class="form-control" style="text-align: center; font-size:10pt;" type="number" id="numeroBon" name="numeroBon" readonly ></td>
<?php endif; ?>
<td width="15%" > </td>
<td><input id="btn_enreg" name="btn_enreg" class = "form-control btn btn-primary" type="button" value="<?= _("Enregistrer") ?>" disabled style='font-size:10pt;' ></td>
</tr>
<?php endif; ?>
</tbody>
</table>
<?php endif; ?>
<?php endif; ?>
<?php if (isset($msgErreur)): ?>
<div id ="msgErreur" class="alert alert-danger" style="height:38px; padding:5px;" >
<H4><?= $msgErreur ?></H4>
</div>
<?php endif; ?>
</div>
<?php if ($numeroBonExamen>"0") : ?>
<?php if($facture=="0" || $bonCaduc=="0") : ?>
<div id="div_legende_couleur" style="width:100%; margin: 5px;">
<table class="table-responsive" style="width:50%; margin:auto;">
<tbody>
<tr>
<td style="font-weight:bold; text-align:left; background-color:#f8f8ff; text-decoration-line: underline;"> <?= _("Légende").":"; ?></td>
<td style="font-weight:bold; background-color:#f8f8ff; text-align:right;"> <?= _("Attente réponse:") ?></td>
<td width="4%" style="background-color:yellow"></td>
<td width="2%" style="background-color:#f8f8ff;"></td>
<td style="font-weight:bold; background-color:#f8f8ff; text-align:right;"><?= _("Accord assureur:") ?></td>
<td width="4%" style="background-color: #00ff00"></td>
<td width="2%" style="background-color:#f8f8ff;"></td>
<td style="font-weight:bold; background-color:#f8f8ff; text-align:right;"><?= _("Non garanti / refus:") ?></td>
<td width="4%" style="background-color: red;"></td>
</tr>
</tbody>
</table>
</div>
<?php endif; ?>
<?php endif; ?>
<div id="examens">
<?php
$fraisTotal = $this->nettoyer($detail_total['fraisReel_total']);
//var_dump($fraisTotal);
?>
<input class="sr-only" type="text" id="fraisTotal" name="fraisTotal" value="<?= $fraisTotal ?>" >
<?php if ($numeroBonExamen>"0") : ?>
<div >
<input class="form-control" style="text-align: center; font-size: 12pt;font-weight: bold;" type="text" value="<?= _("Liste des examens prescrits") ?>" readonly > </td>
</div>
<?php $nbExamens = 0; ?>
<table class="table table-striped table-bordered table-hover table-condensed table-responsive" style="font-size:11pt;">
<thead>
<tr>
<th style="text-align:center" > <?= _("Garanties") ?> </th>
<th style="text-align:center" > <?= _("Examens ou Radios") ?> </th>
<th width="5%" style="text-align:center" > <?= _("Accord") ?> </th>
<th width="5%" style="text-align:center"> <?= _("Suppr") ?> </th>
</tr>
</thead>
<tbody>
<?php
$existeEntentePrealable = '0';
$envoyeSms = '0';
foreach ($detailexamens as $detailexamen):
$idExamen = $this->nettoyer($detailexamen['id']);
$livre = $this->nettoyer($detailexamen['livre']);
$ententePrealable = $this->nettoyer($detailexamen['ententePrealable']);
$ajLabo = $this->nettoyer($detailexamen['ajLabo']);
$envoyeSms = $this->nettoyer($detailexamen['envoyeSms']);
$nbExamens++;
if($ententePrealable == "2"){
$existeEntentePrealable = $ententePrealable;
}
$envoyeSms++;
?>
<tr valign="top">
<td > <?= $this->nettoyer($detailexamen['libelleFamilleActe']) ?> </td>
<td >
<?php if($actVisible=="1"): ?>
<?= $this->nettoyer($detailexamen['libelleActe']) ?>
<?php else: ?>
<?= $this->nettoyer($detailexamen['codeActe']) ?>
<?php endif; ?>
</td>
<?php if($ententePrealable<>"0"): ?>
<?php if($ententePrealable=='2'): ?>
<td align='center' style="background-color: yellow;"> <input type="checkbox" checked disabled> </td>
<?php elseif($ententePrealable=='1'): ?>
<td align='center' style="background-color: #00ff00;"> <input type="checkbox" checked disabled> </td>
<?php elseif($ententePrealable=='9'): ?>
<td align='center' style="background-color: red;color:white;"> <input type="checkbox" checked disabled> </td>
<?php else: ?>
<td align='center'> <input type="checkbox" checked disabled> </td>
<?php endif; ?>
<?php else: ?>
<td align='center' > <input type="checkbox" disabled></td>
<?php endif; ?>
<?php if ($facture=="1"): ?>
<td> </td>
<?php else: ?>
<?php if (($ententePrealable=='2' || $ententePrealable=='0') && $livre!="1" && $ajLabo!="1" && $bonCaduc!="1") : ?>
<td>
<button type="button" class="form-control btn btn-danger" onClick="javascript:supprimer_examen('<?= $idExamen ?>');">
<i class="fa fa-times" aria-hidden="true"></i>
</button>
</td>
<?php else: ?>
<td> </td>
<?php endif; ?>
<?php endif; ?>
</tr>
<?php endforeach; ?>
</tbody>
</table>
<input class="sr-only" type="text" id="nbExamens" name="nbExamens" value="<?= $nbExamens ?>" >
<input class="sr-only" type="text" id="existeEntentePrealable" name="existeEntentePrealable" value="<?= $existeEntentePrealable ?>" >
<input class="sr-only" type="text" id="envoyeSms" name="envoyeSms" value="<?= $envoyeSms ?>" >
<?php endif; ?>
</div>
<?php endif; ?>
<?php if($facture=="1" || $bonCaduc=="1"): ?>
<div id="div_ged_0"></div>
<?php elseif($numeroBonExamen>"0"): ?>
<div id="div_ged_0" style="margin-top:20px;">
<form enctype="multipart/form-data" action="Prescriptionexamen" method="post">
<div >
<input class="form-control" style="text-align: center; font-size: 12pt;font-weight: bold;" type="text" value="<?= _("Gestion Electronique des Documents (GED)") ?>" readonly > </td>
</div>
<table class="table table-responsive table-condensed" style='font-size:10pt;'>
<tbody>
<tr>
<td width="15%"> <?= _("Document") ?> </td>
<td> <input style="font-size: 15px; height: 40px" class="form-control btn btn-info" name="fichier_upload" type="file" id="fichier_upload" /> </td>
<td> </td>
<td> <input style='font-size:10pt;' class="form-control btn btn-primary" type="submit" name="submit" value="<?= _("Envoyer") ?>" /> </td>
<td> </td>
<td > <button style='font-size:10pt;' type="button" class="form-control btn btn-primary" onclick="javascript:prescription_examen();"><?= _("Actualiser...") ?></button> </td>
</tr>
</tbody>
</table>
</form>
<?php if((isset($msgErreurGed)) && ($msgErreurGed>" ")) : ?>
<INPUT style='font-size:12pt; color:red; text-align:center;' class="form-control" type="text" value="<?= $msgErreurGed ?>" readonly >
<?php endif; ?>
<table class="table table-striped table-hover table-condensed table-responsive" style="font-size:9pt;" >
<thead>
<th width="12%" style='text-align:center'> Date </th>
<th style='text-align:center'> <?= _("Document GED") ?></th>
<th width="11%" style='text-align:center'> <?= _("Télécharger") ?> </th>
</thead>
<tbody>
<?php foreach ($geds as $ged):
$idGed=$this->nettoyer($ged['idGed']);
$cheminFichier = $this->nettoyer($ged['cheminFichier']);
?>
<tr valign="top">
<td align='center'><?= dateheureLang($this->nettoyer($ged['dateSysteme'])) ?></td>
<td align='center'><?= $this->nettoyer($ged['nomOrigine']) ?></td>
<td align="center">
<a style="font-size:10pt;" href="<?= $cheminFichier ?>" target="_blank" > <?= _("Télécharger") ?> </a>
</td>
</tr>
<?php endforeach; ?>
</tbody>
</table>
</div>
<?php endif; ?>
</div>