示例#1
0
    public function historiaTratamientos($idProgramacion)
    {
        $oLActoMedico = new LActoMedico();
        $medicamentoso = $oLActoMedico->listaHistoriaTratamientoMedicamentoso($idProgramacion, "1");
        $practicaMedica = $oLActoMedico->listaHistoriaTratamientoSgtCita($idProgramacion, "2");
        $cadena = "";
        if ($medicamentoso) {
            $idReceta = $medicamentoso[0]['iIdReceta'];
            $idRecetaAux = 0;
            $cadena .= '<fieldset style=" margin:5px;">
                        <legend> Tratamiento con medicamentos </legend>';
            foreach ($medicamentoso as $i => $value) {
                $idReceta = $medicamentoso[$i]['iIdReceta'];
                $fechaVencimiento = $medicamentoso[$i]['vencimiento'];
                if ($idReceta != $idRecetaAux) {
                    $cadena .= '<fieldset style="border:0px solid;padding-left: 5px;  font-size: 16px;">
                        <legend> Receta ' . $idReceta . ' - Vencimiento: ' . $fechaVencimiento . ' <a onclick="javascript:imprimirRecetaUnicaEstandarizada(' . $idReceta . ');" href="javascript:;">
                                    <img alt="" title="Receta Medica Estandarizada" src="../../../imagen/btn/ImprimirReceta.png" id="btnImprimirRecetaUnica">
                                    </a></legend>
                        <table class="tablaDiagnostico" width="700px;" border="0" cellpadding="0" cellspacing="2" align="center">
                            <tr>
                                <td width="35%" height="30" bgcolor="#E8EEFD" align="center"><strong>Medicamento</strong></td>
                                <td width="10%" bgcolor="#E8EEFD" align="center"><strong>Presentaci&oacute;n</strong></td>
                                <td width="5%" bgcolor="#E8EEFD" align="center"><strong>Cantidad</strong></td>
                                <td width="50%" bgcolor="#E8EEFD" align="center">
                                    <strong>Indicaciones
                                    
                                    </strong>
                                </td>
                            </tr>';
                }
                $cadena .= '<tr><td>' . htmlentities($medicamentoso[$i][2]) . '</td><td>' . htmlentities($medicamentoso[$i][5]) . '</td><td>' . htmlentities($medicamentoso[$i][3]) . '</td><td>' . htmlentities($medicamentoso[$i][4]) . '</td></tr>';
                $idRecetaAux = $idReceta;
                $j = $i + 1;
                if (isset($medicamentoso[$j]['iIdReceta'])) {
                    if ($medicamentoso[$j]['iIdReceta'] != $idReceta) {
                        $cadena .= '</table></fieldset><br>';
                    }
                } else {
                    $cadena .= '</table></fieldset>';
                }
            }
            $cadena .= '</fieldset>';
        }
        if ($practicaMedica) {
            //$cadena.='<br><h2 align="center" >'.$medico_instalacion.'</h2><br>';
            if (false) {
                $idReceta = $practicaMedica[0]['iIdReceta'];
                $cadena .= '<fieldset style=" margin:5px;">
                        <legend> Pr&aacute;cticas M&eacute;dicas 
  <a onclick="javascript:imprimirOrdenMedica(' . $idReceta . ');" href="javascript:;">
                                    <img alt="" title="Receta Orden Médica" src="../../../imagen/btn/ImprimirReceta.png" id="btnImprimirRecetaUnica">
                                    </a>                        
</legend>
                        <div style="margin-left: 1%; margin-right: 1%;">';
                //$cadena.="<h2 align='center'> Pr&aacute;cticas M&eacute;dicas </h2><br>";
                $cadena .= '<fieldset style="padding-left: 5px;  font-size: 16px;">
                        <table class="tablaDiagnostico" width="700px;" border="0" cellpadding="0" cellspacing="2" align="center">
                            <tr>
                                <td width="40%" height="30" bgcolor="#E8EEFD" align="center"><strong>Nombre</strong></td>
                                <td width="10%" bgcolor="#E8EEFD" align="center"><strong>Cod. Segus</strong></td>
                                <td width="50%" bgcolor="#E8EEFD" align="center">
                                    <strong>Observaci&oacute;n</strong>
                                  
                                    </td>
                            </tr>';
                foreach ($practicaMedica as $i => $value) {
                    $cadena .= '<tr><td>' . htmlentities($practicaMedica[$i][2]) . '</td><td>' . htmlentities($practicaMedica[$i][5]) . '</td><td>' . htmlentities($practicaMedica[$i][3]) . '</td></tr>';
                }
                $cadena .= '</table></fieldset><br>';
                $cadena .= '</div></fieldset><br>';
            } else {
                $contadorPracticaMedica = count($practicaMedica);
                $idReceta = 0;
                for ($x = 0; $x <= $contadorPracticaMedica - 1; $x++) {
                    if ($practicaMedica[$x][6] != $practicaMedica[$x + 1][6]) {
                        $idReceta = $practicaMedica[$x][6];
                        $cadena .= '<br><fieldset style=" margin:5px;">';
                        $cadena .= ' <legend> Pr&aacute;cticas M&eacute;dicas 
      <a onclick="javascript:imprimirOrdenMedica(' . $idReceta . ');" href="javascript:;">
                                    <img alt="" title="Receta Orden Médica" src="../../../imagen/btn/ImprimirReceta.png" id="btnImprimirRecetaUnica">
                                </a>                             
</legend>';
                        $cadena .= '<div style="margin-left: 1%; margin-right: 1%;">';
                        $cadena .= '<fieldset style="border:0px solid;padding-left: 5px;  font-size: 16px;">';
                        $cadena .= '<table class="tablaDiagnostico" width="700px;" border="0" cellpadding="0" cellspacing="2" align="center">
                            <tr bgcolor="#E8EEFD">
                                <td   align="center"><strong>Nombre</strong></td>
                                <td  align="center"><strong>Cod. Segus</strong></td>
                                <td  align="center"><strong>Observaci&oacute;n</strong></td>
                                <td>
                          
                                </td>
                            </tr>';
                        foreach ($practicaMedica as $i => $value) {
                            if ($practicaMedica[$i][6] == $idReceta) {
                                $idTratamiento = $practicaMedica[$i]['idTratamiento'];
                                $cadena .= '<tr><td>' . htmlentities($practicaMedica[$i][2]) . '</td>
                            <td>&nbsp;' . htmlentities($practicaMedica[$i][5]) . '</td>
                            <td>&nbsp;' . htmlentities($practicaMedica[$i][3]) . '</td> 
                            </tr>';
                            }
                        }
                        $cadena .= '</table>';
                        $cadena .= '</fieldset><br>';
                        $cadena .= '<div></fieldset>';
                    }
                }
            }
        }
        return $cadena;
    }