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

142 lines
7.0 KiB
PHP

<?php
$numeroBonOrdonnance = $_SESSION['p_numeroBonOrdonnance_C'];
$numeroPrescription = $_SESSION['p_numeroPrescription_C'] ;
$estRempalace = false;
$accesAjoutPh = ($_SESSION['p_accesAjoutPh_C']==1) ;
$accesAjoutPhClient = ($_SESSION['p_accesAjoutPhClient']==1) ;
$ajoutPrescription = ($_SESSION['p_ajoutPrescription_C']==1) ;
$modeSaisieFacture = $_SESSION['p_modeSaisieFacture'];
$actVisible = $_SESSION['p_actVisible'];
$hospitalisation = $_SESSION['p_hospitalisation_C'];
$nbMedicamentSaisie = $prescription['nbMedicamentSaisie'];
//echo $prescription['bonCaduc'];
$idPrestationactes = "0";
?>
<div id="ordonnance">
<?php if( ($this->nettoyer($prescription['bonCaduc'])=="0" or $modeSaisieFacture==1) && ($nbMedicamentSaisie<$_SESSION['p_nbMedicamentMax'] or $hospitalisation=="1") ) : ?>
<table class="table table-responsive table-condensed" style='font-size:10pt;' >
<tbody>
<tr>
<?php if($ajoutPrescription) : ?>
<td> <button type="button" class="form-control btn btn-primary" data-bs-toggle="modal" data-bs-target="#popRechercheMedicament" style='font-size:10pt;' ><?= _("Ajouter Médicament...") ?></button> </td>
<?php else: ?>
<td> <button type="button" class="form-control btn btn-primary" style='font-size:10pt;' disabled ><?= _("Ajouter Médicament...") ?></button> </td>
<?php endif; ?>
<td width="10%" > </td>
<?php if($accesAjoutPh) : ?>
<td> <button type="button" class="form-control btn btn-primary" data-bs-toggle="modal" data-bs-target="#popCreerMedicament" style='font-size:10pt;' ><?= _("Créer Médicament...") ?></button> </td>
<?php else: ?>
<td> <button type="button" class="form-control btn btn-primary" style='font-size:10pt;' disabled ><?= _("Créer Médicament...") ?></button> </td>
<?php endif; ?>
<td width="10%" > </td>
<td> <INPUT class="form-control btn btn-info" value="<?= _("GED Ordonnance...") ?>" onclick="javascript:pop_ged_pharmacie();" style='font-size:10pt;' > </td>
</tr>
</tbody>
</table>
<?php else: ?>
<?php if ($nbMedicamentSaisie>=$_SESSION['p_nbMedicamentMax'] && $hospitalisation!="1"): ?>
<div class="alert alert-danger" style="height:38px; padding:5px;">
<H4> <?= _("Attention! Maximum de médicaments atteint!") ?></H4>
</div>
<?php endif; ?>
<?php endif; ?>
<table class="table table-striped table-hover table-bordered table-condensed table-responsive" style='font-size:9pt;'>
<thead>
<tr>
<th style="text-align:center"> Subtitut </th>
<th style="text-align:center"> <?= _("Médicaments prescrits") ?> </th>
<th style="text-align:center"> Forme </th>
<th style="text-align:center"> Tarif Pubic </th>
<th style="text-align:center"> Posologie </th>
<th style="text-align:center"> <?= _("Bon") ?> </th>
<th style="text-align:center" > <?= _("Accord") ?> </th>
</tr>
</thead>
<tbody>
<?php foreach ($detailprescriptions as $detailprescription):
$idMedicament = $this->nettoyer($detailprescription['idMedicament']);
$livre = $this->nettoyer($detailprescription['livre']);
$substituable = $this->nettoyer($detailprescription['substituable']);
$substitue = $this->nettoyer($detailprescription['substitue']);
$nomSubstitut = $this->nettoyer($detailprescription['nomSubstitut']);
$libelleMedicament = $this->nettoyer($detailprescription['libelleMedicament']);
$codeMedicament = $this->nettoyer($detailprescription['codeMedicament']);
$ajPharmacie = $this->nettoyer($detailprescription['ajPharmacie']);
$ententePrealable1 = $this->nettoyer($detailprescription['ententePrealable']);
$barree = $this->nettoyer($detailprescription['barree']);
$tarifPublic = $this->nettoyer($detailprescription['tarifPublic']);
$tarifPublicSubstitut = $this->nettoyer($detailprescription['tarifPublicSubstitut']);
$codeMedicamentSubstitut = $this->nettoyer($detailprescription['codeMedicamentSubstitut']);
$nomMedicamentSubstitut = $this->nettoyer($detailprescription['nomMedicamentSubstitut']);
if($actVisible!="1")
{
$libelleMedicament = $codeMedicament;
$nomSubstitut = $codeMedicament;
}
$forme = $this->nettoyer($detailprescription['forme']);
$formeSubstitut = $this->nettoyer($detailprescription['formeSubstitut']);
$posologie = $this->nettoyer($detailprescription['posologie']);
if (est_anglophone()){
$forme = $this->nettoyer($detailprescription['formeEng']);
$formeSubstitut = $this->nettoyer($detailprescription['formeSubstitutEng']);
}
$idDemandeSubstitution = $this->nettoyer($detailprescription['idDemandeSubstitution']);
$nvellePosologie = $this->nettoyer($detailprescription['nvellePosologie']);
?>
<?php if($ententePrealable1=='2' || $ententePrealable1=='3'): ?>
<tr valign="top" style="background-color: yellow;">
<?php elseif($ententePrealable1=='1'): ?>
<tr valign="top" style="background-color: #00ff00;">
<?php elseif($ententePrealable1=='9'): ?>
<tr valign="top" style="background-color: red;color:white;">
<?php else: ?>
<tr valign="top">
<?php endif; ?>
<?php if($idPrestationactes == "0") : ?>
<td width="5%" align='center'> <input type="button" value=" ... " onClick="javascript:substituer_medicament('<?= $idMedicament ?>','<?= $posologie ?>', '<?= $idDemandeSubstitution ?>');"></td>
<?php else: ?>
<td width="5%" align='center'> </td>
<?php endif; ?>
<?php if($substituable=="1") : ?>
<td align='center' style="background-color: yellow;"> <?= $libelleMedicament . " => " . $nomSubstitut ?> </td>
<?php elseif($codeMedicamentSubstitut>""): ?>
<td align='center'> <input type="button" value="<?= $nomMedicamentSubstitut ?>" onClick="javascript:alert('<?= $libelleMedicament ?>');"></td>
<td align='center'> <input type="button" value="<?= $formeSubstitut ?>" onClick="javascript:alert('<?= $forme ?>');"></td>
<td align='center'> <input type="button" value="<?= $tarifPublicSubstitut ?>" onClick="javascript:alert('<?= $tarifPublic ?>');"></td>
<?php else: ?>
<td align='center'> <?= $libelleMedicament ?> </td>
<td align='center'> <?= $forme ?> </td>
<td align='center'> <?= $tarifPublic ?> </td>
<?php endif; ?>
<?php if($nvellePosologie >""): ?>
<td align='center'> <input type="button" value="<?= $nvellePosologie ?>" onClick="javascript:alert('<?= $posologie ?>');"></td>
<?php else: ?>
<td align='center'> <?= $posologie ?> </td>
<?php endif; ?>
<td align='center'> <?= $this->nettoyer($detailprescription['numeroBonOrdonnance']) ?> </td>
<?php if($ententePrealable1<>"0"): ?>
<td align='center'> <input type="checkbox" checked disabled></td>
<?php else: ?>
<td align='center'> <input type="checkbox" disabled></td>
<?php endif; ?>
</tr>
<?php endforeach; ?>
</tbody>
</table>
</div>