@php

  use App\Libraries\ejLib;
    $var = ejLib::getInstance();
    $soapclient = $var->getWs();
    $wsClave = $var->get_wsClave();

   /* $usuario = $_SESSION['operador'];
    $Centro_Sal = $var->desencriptar_AES($usuario['centro_sal'], $usuario['x']);
    $Centro_Sal = trim($Centro_Sal);
    $id_doc = trim( $var->desencriptar_AES($usuario['id_doc'], $usuario['x']) );
    $CLUES_Origen = '';
    $centro_salud = $soapclient->AdministrarCatalogos_get_CentroSalud($Centro_Sal, $CLUES_Origen,$wsClave);
    $CS  = new SimpleXMLElement(utf8_encode($centro_salud));
//print_r($id_doc); die();



    $Nombre =    $var->desencriptar_AES($usuario['nombre_user'], $usuario['x']);
    $Apellido1 = $var->desencriptar_AES($usuario['apellido_user_1er'], $usuario['x']);
    $Apellido2 = $var->desencriptar_AES($usuario['apellido_user_2do'], $usuario['x']);
    $Encargado = trim($Nombre).' '.trim($Apellido1).' '.trim($Apellido2);

    */
@endphp

<div class="row" id="objPrincipal_ExpCorrecto" name="objPrincipal_ExpCorrecto">
       <div class="box box-primary">
              <div class="box-header with-border">
                  <h3 class="box-title">Expediente Correcto</h3>
                  <div class="box-tools pull-right">
                      <button type="button" id="btnCollapse" name="btnCollapse" class="btn btn-box-tool" data-widget="collapse"><i class="fa fa-minus" ></i></button>
                      
                  </div>
              </div>

              <div class="box-body">
                  <div class="row" id="objExpedienteCorrecto" name="objExpedienteCorrecto">

                                        
                    <div class="col-sm-12">  
                      <div class="col-sm-4">
                        <div class="input-group input-group-sm">
                          <span class="input-group-addon" id="sizing-addon3" style="background: #eee">Clave Paciente</span>
                          <input type="text" id="txtClavePac" name="txtClavePac" class="form-control" width="100%" height="100%" disabled value="{!! utf8_decode(ltrim(rtrim($paciente->clave_pac))) !!}"> 
                         
                        </div>
                      </div>
                      <div class="col-sm-4">
                        <div class="input-group input-group-sm">
                          <span class="input-group-addon" id="sizing-addon3" style="background: #eee">Expediente</span>
                          <input type="text" id="txtNumExpe" name="txtNumExpe" class="form-control" width="100%" height="100%" disabled value="{!! utf8_decode(ltrim(rtrim($paciente->numero_expe))) !!}"> 
                        </div>
                      </div>

                       <div class="col-sm-4">
                        <div class="input-group input-group-sm">
                          <span class="input-group-addon" id="sizing-addon3" style="background: #eee">CURP</span>
                          <input type="text" id="txtCurp" name="txtCurp" class="form-control" width="100%" height="100%" disabled value="{!! utf8_decode(ltrim(rtrim($paciente->curp))) !!}"> 
                        </div>
                      </div>
                    </div>


                    <div class="col-sm-12">  
                       <div class="col-sm-8">
                        <div class="input-group input-group-sm">
                          <span class="input-group-addon" id="sizing-addon3" style="background: #eee">Nombre</span>
                          <input type="text" id="txtNombre" name="txtNombre" class="form-control" width="100%" height="100%" disabled value="{!! utf8_decode(ltrim(rtrim($paciente->nombre))).' '. utf8_decode(ltrim(rtrim($paciente->primer_ap))).' '. utf8_decode(ltrim(rtrim($paciente->segundo_ap)))   !!}">
                        </div>
                      </div>

                      <div class="col-sm-2">
                        <a href="#" id="btn_listar_notas" name="btn_listar_notas" class="btn btn-sm btn-primary" data-clave_pac="{!! utf8_decode(ltrim(rtrim($paciente->clave_pac))) !!}"><span class="fa fa-file-text" aria-hidden="true" title="Notas del paciente"></span> Ver Notas Asociadas</a>
                      </div>
                    </div> 

                     

                  </div>
                  <div style="width: 100%;" id="primary_Hoja_Frontal" name="primary_Hoja_Frontal"></div>
               <!--   <div class="modal fade" id="defaultModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" style="width: 100%;">
                    <div class="modal-dialog modal-lg" role="document">
                      <div id="modalContent" class="modal-content" style="height: 500px;">

                      </div>
                    </div>
                  </div> -->
                  <div id="searchContainer" name="searchContainer"></div>


            </div>
              </div>






     
</div> <!-- termina expedidnte correcto -->
<div class="row"> <!-- Expedidntes a unificar --> 
  <div class="box ">
    <div class="box-header with-border">
      <h3 class="box-title">Expedientes a unificar</h3>
    </div>

    <div class="box-body">
      <div class="row alinear_centrado">
        <div class="row margenSuperior">
          <div id="tblExpedientes_a_Unificar" name="tblExpedientes_a_Unificar" class="table-responsive">
            <table style="font-size: 12px; width: 98%; margin:auto;" class="table table-striped" id="tablaprueba">
              <tr>                          
                <th>Clave Paciente</th>
                <th>Expediente</th>        
                <th>Curp</th>
                <th>Nombre</th>  
                <th>Primer Apellido</th>   
                <th>Segundo Apellido</th>   
                <th>Total Consultas</th>   
                <th style="text-align: center; width: 100px;">Opciones</th>                          
              </tr>
                   <!-- registros -->
              <tbody>
                <tr>
                  <td></td>
                  <td></td>
                  <td></td>
                  <td></td>
                  <td></td>
                  <td></td>
                  <td></td>
                  <td style="text-align: center;"></td>
                </tr>
              </tbody> 
            </table>
            
             <a href="#" id="btn_agregar_expe" name="btn_listar_notas" class="btn btn-sm btn-info" style="float: right; margin: 20px;"><span class="fa fa-plus" aria-hidden="true" title="Agregar expediente a unificar"></span>
              &nbsp; Agregar</a>
             
              
          </div> <!-- termina tblExpedientes -->

                </div>     

                  
              </div>    
              </div>




          </div>
     
</div>

  <div style="width: 100%;" id="expeIncorrecto_Hoja_Frontal" name="expeIncorrecto_Hoja_Frontal"></div>

   <div class="row alinear_centrado" id="objOpciones" name="objOpciones">
    <button type="button" class="btn btn-success" id="unificar" name="unificar">Unificar</button>
     &nbsp;
   <button type="button" class="btn btn-secondary" id="cancelar" name="cancelar">Cancelar</button>
  </div>
   <div style="width: 100%;" id="resultadosContainerUnificacion" name="resultadosContainerUnificacion"></div>

<script type="text/javascript">

$(document).on('click', '#objBuscarNotasPaciente #resultadosContainer #cmd_get_nota', function () {    

  jqGetAjax_Modal("{!! url('/') !!}/Consulta_revisarNotas_NU_pdf","modalContent", {'folio': this.dataset.folio, 'centro_sal': this.dataset.centro_sal, 'imprimeObjeto': '1' }, 'defaultModal');
  SmoothScrollTo('#primary_Hoja_Frontal');

});

</script>



