templates/historia_clinica/index.html.twig line 1

Open in your IDE?
  1. {% extends 'base.html.twig' %}
  2. {% block title %}HistoriaClinica index{% endblock %}
  3. {% block body %}
  4.     <h3>Atención Médica</h3>
  5.     <div class="col-md-12">
  6.         {{ include('preparacion/buscar_pac.html.twig', {'button_label': 'Buscar'}) }}
  7.     </div>
  8.     <div class="table-responsive">
  9.     <table class="table">
  10.         <thead>
  11.             <tr>
  12.                 <th>No</th>
  13.                 <th>{{ knp_pagination_sortable(agendas, 'Hora', 'a.inicio') }}</th>
  14.                 <th>{{ knp_pagination_sortable(agendas, 'Paciente', 'paciente') }}</th>
  15.                 <th>{{ knp_pagination_sortable(agendas, 'Doctor/Enfer.', 'doctor') }}</th>
  16.                 <th>{{ knp_pagination_sortable(agendas, 'Sala', 'sala') }}</th>
  17.                 <th>{{ knp_pagination_sortable(agendas, 'Tipo', 'procedimiento') }}</th>
  18.                 <th>Estado</th>
  19.                 <th>Acciones</th>
  20.             </tr>
  21.         </thead>
  22.         <tbody>
  23.          <tbody>{% set cont = 1 %}
  24.         {% for agenda in agendas %}
  25.             {% set pxs = agenda.agenda.getAgendaProcedimientos() %}
  26.             <tr>
  27.                 <td>{{ page + cont }}</td>
  28.                  <td>{{ agenda.inicio|date('Y-m-d') }}<br>{{ agenda.inicio|date('H:i:s') }}</td>
  29.                 <td>{{ agenda.paciente}}<input type="hidden" id="pac{{ agenda.agenda.id }}" value="{{ agenda.paciente}}"></td>
  30.                 <td>{{ agenda.doctor}} </td>
  31.                 <td>{{ agenda.sala }}<br>{{ agenda.agenda.sala.unidad.nombre }}</td>
  32.                 <td>{{ agenda.procedimiento }}<br>{% for px in pxs %} {{ px.procedimiento.nombre }}<br> {% endfor %}{{ agenda.agenda.especialidad.nombre }}</td>
  33.                 <!--td>{{ agenda.procedimiento }}<br></td-->
  34.                 <td>
  35.                     {% if(agenda.agenda.preparacion==null)%}
  36.                         <label class="badge bg-danger">PENDIENTE<br>PREPARACION</label>
  37.                     {% else%}
  38.                         {% if(agenda.agenda.preparacion.estado==1)%}
  39.                             <label class="badge bg-danger">PASE<br>PREPARACION</label>
  40.                         {% elseif(agenda.agenda.preparacion.estado==2)%}
  41.                             {% if(agenda.agenda.historiaClinica==null)%}
  42.                                 <label class="badge bg-danger">ATENCION</label>   
  43.                             {% else %}
  44.                                 {% if(agenda.agenda.historiaClinica.estado==1)%}
  45.                                     <label class="badge bg-warning">PASAR<br></label>
  46.                                 {% else %}
  47.                                     <label class="badge bg-success">ATENDIDO</label>
  48.                                 {% endif %}    
  49.                             {% endif %}    
  50.                         {% endif%}      
  51.                     {% endif%}
  52.                 </td>
  53.                 <td>
  54.                     {% if(agenda.agenda.preparacion==null)%}
  55.                     {% else%}
  56.                         {% if(agenda.agenda.preparacion.estado==2)%}
  57.                             {% if(agenda.agenda.historiaclinica==null)%}
  58.                                 <a class="btn btn-outline-danger btn-fw btn-sm" href="javascript:pasar_doctor({{agenda.agenda.id}})">{{ agenda.agenda.procedimiento.nombre }}</a>   
  59.                             {% else %}
  60.                                 {% if(agenda.agenda.historiaclinica.estado>0)%}
  61.                                     {% if(agenda.agenda.sala.unidad.nombre == 'PROCEDIMIENTOS ENDOSCOPICOS') %}
  62.                                         <a class="btn btn-outline-warning btn-fw btn-sm" href="{{ path('estudio_nuevo_unico', {'id_historia': agenda.agenda.historiaClinica.id}) }}">{{ agenda.agenda.procedimiento.nombre }}</a>
  63.                                     {% else %}
  64.                                         <a class="btn btn-outline-warning btn-fw btn-sm" href="{{ path('historia_clinica_edit_new', {'id': agenda.agenda.historiaClinica.id}) }}">{{ agenda.agenda.procedimiento.nombre }}</a>
  65.                                     {% endif %}
  66.                                 {% endif %}    
  67.                             {% endif %}    
  68.                         {% endif%}      
  69.                     {% endif%}
  70.                 </td>
  71.             </tr>{% set cont = cont + 1 %}
  72.         {% else %}
  73.             <tr>
  74.                 <td colspan="16">no records found</td>
  75.             </tr>
  76.         {% endfor %}
  77.         </tbody>
  78.     </table>
  79.     </div>
  80.     {# display navigation #}
  81.     <div class="navigation">
  82.         {{ knp_pagination_render(agendas,'', {'inicio': inicio, 'fin': fin}) }}
  83.     </div>
  84.     <script type="text/javascript">
  85.         function pasar_doctor(id){
  86.             var paciente = $('#pac'+id).val()
  87.             //var confirmar = confirm("Desea Pasar a Consulta al paciente: "+paciente);
  88.             var confirmar = true;
  89.             if(confirmar){
  90.                 $.ajax({  
  91.                     url:        '{{asset("index.php/historiaclinica/historiaclinica/new")}}/'+id,  
  92.                     type:       'GET',   
  93.                     dataType:   'json',  
  94.                     async:      true,  
  95.                    
  96.                     success: function(data, status) { 
  97.                         if(data.estado == 'ok'){
  98.                             location.href = '{{asset("index.php/historiaclinica")}}/'+data.historiaclinica+'/edit/new';    
  99.                         }else{
  100.                             location.reload();    
  101.                         }
  102.                         
  103.                             
  104.                         
  105.                     },  
  106.                     error : function(xhr, textStatus, errorThrown) { 
  107.                         console.log(xhr, textStatus, errorThrown);
  108.                         alert('Ajax request failed.');  
  109.                     }  
  110.                 });
  111.             }
  112.         }
  113.     </script>
  114. {% endblock %}