@php
/* 
JPSB, 26-Feb-2020, Formulario para mostrar un comparativo de un paciente de sistema con el paciente referido en la referencia médica
*/
    use App\Libraries\ejLib;
    $var = ejLib::getInstance();
    $soapclient = $var->getWs();
    $wsClave = $var->get_wsClave();

    $usuario = $_SESSION['operador'];
    
    $id_doc = $var->desencriptar_AES($usuario['id_doc'], $usuario['x']);

    $data = $soapclient->ConsultaExterna_get_referencia($_POST['id_solicitud'], $_POST['clues_origen'], $wsClave);
    $data = new SimpleXMLElement(utf8_encode($data));
    $solicitud = $data->respuesta;

    $data = $soapclient->BuscarPaciente_getLstPorClavePac($_POST['clave_pac'], $wsClave);
    $data = new SimpleXMLElement(utf8_encode($data));
    $paciente = $data->respuesta;

@endphp

<style type="text/css">
    .sep_10px{width: 100%; height: 10px;}
    .ln_green{border-color: green !important;}
    .bg_green{background-color: #1b631a44 !important;}
    .tc_green{color: #1b631a !important;}
</style>

    

    <div class="sep_10px"></div>
    <table align="center" style="width: 95%;"><tr><td>

        <div class="box box-primary">
              <div class="box-header with-border">
                  <h3 class="box-title">Comparar un usuario seleccionado con el usuario de referencia</h3>                  
              </div>

              <div class="box-body">
                  <div class="row">

                        <div class="col-sm-3">
                            <div class="input-group input-group-sm">
                                <span class="input-group-addon" id="sizing-addon3" style="background: #eee">Usuario</span>
                                <label class="form-control">Referido</label>
                            
                            </div>
                        </div>

                        <div class="col-sm-3">
                            <div class="input-group input-group-sm">
                                <span class="input-group-addon ln_green bg_green tc_green" id="sizing-addon3" >Usuario</span>
                                <label class="form-control ln_green tc_green">Seleccionado</label>                            
                            </div>
                        </div>                        
                  </div>                  
              </div>

              <div class="box-body">
                  <div class="row alinear_centrado">
                    <div class="page-headerL" id="">Datos de identidad del paciente</div>
                    <div class="row margenSuperior">

                      <div class="row alinear_centrado">
                        <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>
                            <div class="alinear_izquierda form-control">{{utf8_decode($solicitud->curp)}}</div>
                          </div>                        
                        </div>

                        <div class="col-sm-3">
                          <div class="input-group input-group-sm">
                            <span class="input-group-addon" id="sizing-addon3" style="background: #eee">Fecha de Nac.</span>
                            <div class="alinear_izquierda form-control">{{utf8_decode($solicitud->fecha_nac)}}</div>
                          </div>
                        </div>

                        <div class="col-sm-2">
                          <div class="input-group input-group-sm">
                            <span class="input-group-addon" id="sizing-addon3" style="background: #eee">Sexo </span>
                            <div class="alinear_izquierda form-control">{{utf8_decode($solicitud->nom_sexo)}}</div>
                          </div>
                        </div>

                        <div class="col-sm-3">
                          <div class="input-group input-group-sm">
                            <span class="input-group-addon" id="sizing-addon3" style="background: #eee">Nº Expediente</span>
                            <div class="alinear_izquierda form-control">{{utf8_decode($solicitud->numexpediente)}}</div>
                          </div>
                        </div>

                      </div>

                      <div class="row alinear_centrado">
                        <div class="col-sm-4">
                          <div class="input-group input-group-sm">
                            <span class="input-group-addon ln_green bg_green tc_green" id="sizing-addon3" style="background: #eee">CURP</span>
                            <label class="form-control ln_green tc_green">{{utf8_decode($paciente->curp)}}</label>
                          </div>                        
                        </div>

                        <div class="col-sm-3">
                          <div class="input-group input-group-sm">
                            <span class="input-group-addon ln_green bg_green tc_green" id="sizing-addon3" style="background: #eee">Fecha de Nac.</span>
                            <label class="form-control ln_green tc_green">{{utf8_decode($paciente->fecha_nac)}}</label>
                          </div>
                        </div>

                        <div class="col-sm-2">
                          <div class="input-group input-group-sm">
                            <span class="input-group-addon ln_green bg_green tc_green" id="sizing-addon3" style="background: #eee">Sexo </span>
                            <label class="form-control ln_green tc_green">{{utf8_decode($paciente->nom_sexo)}}</label>
                          </div>
                        </div>

                        <div class="col-sm-3">
                          <div class="input-group input-group-sm">
                            <span class="input-group-addon ln_green bg_green tc_green" id="sizing-addon3" style="background: #eee">Nº Expediente</span>
                            <label class="form-control ln_green tc_green">{{utf8_decode($paciente->numero_expe)}}</label>
                          </div>
                        </div>

                      </div>



                      <div class="row alinear_centrado">                        
                        <div class="col-sm-4">
                          <div class="input-group input-group-sm">
                            <span class="input-group-addon" id="sizing-addon3" style="background: #eee">Primer Apellido</span>
                            <div class="alinear_izquierda form-control">{{utf8_decode($solicitud->ap_1er)}}</div>
                          </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">Segundo Apellido</span>
                            <div class="alinear_izquierda form-control">{{utf8_decode($solicitud->ap_2do)}}</div>
                          </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">Nombre(s)</span>
                            <div class="alinear_izquierda form-control">{{utf8_decode($solicitud->nombre)}}</div>
                          </div>
                        </div>
                      </div>

                      <div class="row alinear_centrado">                        
                        <div class="col-sm-4">
                          <div class="input-group input-group-sm">
                            <span class="input-group-addon ln_green bg_green tc_green" id="sizing-addon3" style="background: #eee">Primer Apellido</span>
                            <div class="alinear_izquierda form-control ln_green tc_green">{{utf8_decode($paciente->primer_ap)}}</div>
                          </div>
                        </div>

                        <div class="col-sm-4">
                          <div class="input-group input-group-sm">                            
                            <span class="input-group-addon ln_green bg_green tc_green" id="sizing-addon3" style="background: #eee">Segundo Apellido</span>
                            <div class="alinear_izquierda form-control ln_green tc_green">{{utf8_decode($paciente->segundo_ap)}}</div>
                          </div>
                        </div>

                        <div class="col-sm-4">
                          <div class="input-group input-group-sm">
                            <span class="input-group-addon ln_green bg_green tc_green" id="sizing-addon3" style="background: #eee">Nombre(s)</span>
                            <div class="alinear_izquierda form-control ln_green tc_green">{{utf8_decode($paciente->nombre)}}</div>
                          </div>
                        </div>
                      </div>

                      <div class="row alinear_centrado">
                        <div class="col-sm-4">
                          <div class="input-group input-group-sm">
                            <span class="input-group-addon" id="sizing-addon3" style="background: #eee">Dificultad </span>
                            <div class="alinear_izquierda form-control">{{utf8_decode($solicitud->dificultad)}}</div>
                          </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">Grado de dificultad </span>
                            <div class="alinear_izquierda form-control">{{utf8_decode($solicitud->dificultad_grado)}}</div>
                          </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">Origen de dificultad </span>
                            <div class="alinear_izquierda form-control">{{utf8_decode($solicitud->dificultad_origen)}}</div>
                          </div>
                        </div>                        
                      </div>

                      <div class="row alinear_centrado">
                        <div class="col-sm-4">
                          <div class="input-group input-group-sm">
                            <span class="input-group-addon ln_green bg_green tc_green" id="sizing-addon3" style="background: #eee">Dificultad </span>
                            <div class="alinear_izquierda form-control ln_green tc_green">{{utf8_decode($paciente->dificultad)}}</div>
                          </div>
                        </div>

                        <div class="col-sm-4">
                          <div class="input-group input-group-sm">
                            <span class="input-group-addon ln_green bg_green tc_green" id="sizing-addon3" style="background: #eee">Grado de dificultad </span>
                            <div class="alinear_izquierda form-control ln_green tc_green">{{utf8_decode($paciente->dificultad_grado)}}</div>
                          </div>
                        </div>

                        <div class="col-sm-4">
                          <div class="input-group input-group-sm">
                            <span class="input-group-addon ln_green bg_green tc_green" id="sizing-addon3" style="background: #eee">Origen de dificultad </span>
                            <div class="alinear_izquierda form-control ln_green tc_green">{{utf8_decode($paciente->dificultad_origen)}}</div>
                          </div>
                        </div>                        
                      </div>

                    </div>
                  </div>
              </div>


              <div class="box-body" id="domicPac" name="domicPac">
                  <div class="row alinear_centrado">
                    <div class="page-headerL" id="">Datos domiciliarios del paciente</div>
                    <div class="row margenSuperior">
                    
                    <div class="row alinear_centrado">
                      <div class="col-sm-4">
                        <div class="input-group input-group-sm">
                          <span class="input-group-addon" id="sizing-addon3" style="background: #eee">Ent. Federativa </span>
                          <div class="alinear_izquierda form-control">{{utf8_decode($solicitud->nom_entidad_dom)}}</div>
                        </div>
                      </div>

                      <div class="col-sm-3">
                        <div class="input-group input-group-sm">
                          <span class="input-group-addon" id="sizing-addon3" style="background: #eee">Municipio </span>
                          <div class="alinear_izquierda form-control">{{utf8_decode($solicitud->nom_municipio_dom)}}</div>
                        </div>
                      </div>

                      <div class="col-sm-3">
                        <div class="input-group input-group-sm">
                          <span class="input-group-addon" id="sizing-addon3" style="background: #eee">Localidad </span>
                          <div class="alinear_izquierda form-control">{{utf8_decode($solicitud->nom_localidad_dom)}}</div>
                        </div>
                      </div>

                      <div class="col-sm-2">
                        <div class="input-group input-group-sm">
                          <span class="input-group-addon" id="sizing-addon3" style="background: #eee">C. P. </span>
                          <div class="alinear_izquierda form-control">{{utf8_decode($solicitud->codigo_postal)}}</div>
                        </div>
                      </div>
                    </div>

                    <div class="row alinear_centrado">
                      <div class="col-sm-4">
                        <div class="input-group input-group-sm">
                          <span class="input-group-addon ln_green bg_green tc_green" id="sizing-addon3" style="background: #eee">Ent. Federativa </span>
                          <div class="alinear_izquierda form-control ln_green tc_green">{{utf8_decode($paciente->nom_entidad_dom)}}</div>
                        </div>
                      </div>

                      <div class="col-sm-3">
                        <div class="input-group input-group-sm">
                          <span class="input-group-addon ln_green bg_green tc_green" id="sizing-addon3" style="background: #eee">Municipio </span>
                          <div class="alinear_izquierda form-control ln_green tc_green">{{utf8_decode($paciente->nom_municipio_dom)}}</div>
                        </div>
                      </div>

                      <div class="col-sm-3">
                        <div class="input-group input-group-sm">
                          <span class="input-group-addon ln_green bg_green tc_green" id="sizing-addon3" style="background: #eee">Localidad </span>
                          <div class="alinear_izquierda form-control ln_green tc_green">{{utf8_decode($paciente->nom_localidad_dom)}}</div>
                        </div>
                      </div>

                      <div class="col-sm-2">
                        <div class="input-group input-group-sm">
                          <span class="input-group-addon ln_green bg_green tc_green" id="sizing-addon3" style="background: #eee">C. P. </span>
                          <div class="alinear_izquierda form-control ln_green tc_green">{{utf8_decode($paciente->codigopostal)}}</div>
                        </div>
                      </div>
                    </div>

                    <div class="row alinear_centrado">
                      <div class="col-sm-4">
                        <div class="input-group input-group-sm">
                          <span class="input-group-addon" id="sizing-addon3" style="background: #eee">Asentamiento </span>
                          <div class="alinear_izquierda form-control">{{utf8_decode($solicitud->nom_asentamiento_dom)}}</div>
                        </div>
                      </div>

                      <div class="col-sm-3">
                        <div class="input-group input-group-sm">
                          <span class="input-group-addon" id="sizing-addon3" style="background: #eee">Tipo de Vialidad </span>
                          <div class="alinear_izquierda form-control">{{utf8_decode($solicitud->nom_vialidad_dom)}}</div>
                        </div>
                      </div>

                      <div class="col-sm-5">
                        <div class="input-group input-group-sm">
                          <span class="input-group-addon" id="sizing-addon3" style="background: #eee">Calle</span>
                          <div class="alinear_izquierda form-control">{{utf8_decode($solicitud->calle)}}</div>
                        </div>
                      </div>                      
                    </div>

                    <div class="row alinear_centrado">
                      <div class="col-sm-4">
                        <div class="input-group input-group-sm">
                          <span class="input-group-addon ln_green bg_green tc_green" id="sizing-addon3" style="background: #eee">Asentamiento </span>
                          <div class="alinear_izquierda form-control ln_green tc_green">{{utf8_decode($paciente->nom_asentamiento_dom)}}</div>
                        </div>
                      </div>

                      <div class="col-sm-3">
                        <div class="input-group input-group-sm">
                          <span class="input-group-addon ln_green bg_green tc_green" id="sizing-addon3" style="background: #eee">Tipo de Vialidad </span>
                          <div class="alinear_izquierda form-control ln_green tc_green">{{utf8_decode($paciente->nom_vialidad_dom)}}</div>
                        </div>
                      </div>

                      <div class="col-sm-5">
                        <div class="input-group input-group-sm">
                          <span class="input-group-addon ln_green bg_green tc_green" id="sizing-addon3" style="background: #eee">Calle</span>
                          <div class="alinear_izquierda form-control ln_green tc_green">{{utf8_decode($paciente->calledomicilio)}}</div>
                        </div>
                      </div>                      
                    </div>

                    <div class="row alinear_centrado">
                      <div class="col-sm-4">
                        <div class="input-group input-group-sm">
                          <span class="input-group-addon" id="sizing-addon3" style="background: #eee">Nº Exterior</span>
                          <div class="alinear_izquierda form-control">{{utf8_decode($solicitud->numexterior)}}</div>
                          <span class="input-group-addon" id="sizing-addon3" style="background: #eee">Letra</span>
                          <div class="alinear_izquierda form-control">{{utf8_decode($solicitud->letraexterior)}}</div>
                        </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">Nº Interior</span>
                          <div class="alinear_izquierda form-control">{{utf8_decode($solicitud->numinterior)}}</div>
                          <span class="input-group-addon" id="sizing-addon3" style="background: #eee">Letra</span>
                          <div class="alinear_izquierda form-control">{{utf8_decode($solicitud->letrainterior)}}</div>
                        </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">Teléfono</span> 
                          <div class="alinear_izquierda form-control">{{utf8_decode($solicitud->telefono)}}</div>
                        </div>
                      </div>                      
                    </div>

                    <div class="row alinear_centrado">
                      <div class="col-sm-4">
                        <div class="input-group input-group-sm">
                          <span class="input-group-addon ln_green bg_green tc_green" id="sizing-addon3" style="background: #eee">Nº Exterior</span>
                          <div class="alinear_izquierda form-control ln_green tc_green">{{utf8_decode($paciente->numext)}}</div>
                          <span class="input-group-addon ln_green bg_green tc_green" id="sizing-addon3" style="background: #eee">Letra</span>
                          <div class="alinear_izquierda form-control ln_green tc_green">{{utf8_decode($paciente->letraext)}}</div>
                        </div>                        
                      </div>

                      <div class="col-sm-4">
                        <div class="input-group input-group-sm">
                          <span class="input-group-addon ln_green bg_green tc_green" id="sizing-addon3" style="background: #eee">Nº Interior</span>
                          <div class="alinear_izquierda form-control ln_green tc_green">{{utf8_decode($paciente->numint)}}</div>
                          <span class="input-group-addon ln_green bg_green tc_green" id="sizing-addon3" style="background: #eee">Letra</span>
                          <div class="alinear_izquierda form-control ln_green tc_green">{{utf8_decode($paciente->letraint)}}</div>
                        </div>                        
                      </div>

                      <div class="col-sm-4">
                        <div class="input-group input-group-sm">
                          <span class="input-group-addon ln_green bg_green tc_green" id="sizing-addon3" style="background: #eee">Teléfono</span> 
                          <div class="alinear_izquierda form-control ln_green tc_green">{{utf8_decode($paciente->telpart)}}</div>
                        </div>
                      </div>                      
                    </div>

                    <div class="row alinear_centrado"> 
                      <div class="col-sm-4">
                        <div class="input-group input-group-sm">
                          <span class="input-group-addon" id="sizing-addon3" style="background: #eee">Celular</span>
                          <div class="alinear_izquierda form-control">{{utf8_decode($solicitud->celular)}}</div>
                        </div>
                      </div>

                      <div class="col-sm-6">
                        <div class="input-group input-group-sm">
                          <span class="input-group-addon" id="sizing-addon3" style="background: #eee">E-mail</span> 
                          <div class="alinear_izquierda form-control">{{utf8_decode($solicitud->email)}}</div>
                        </div>
                      </div>
                    </div>

                    <div class="row alinear_centrado"> 
                      <div class="col-sm-4">
                        <div class="input-group input-group-sm">
                          <span class="input-group-addon ln_green bg_green tc_green" id="sizing-addon3" style="background: #eee">Celular</span>
                          <div class="alinear_izquierda form-control ln_green tc_green">{{utf8_decode($paciente->telcel)}}</div>
                        </div>
                      </div>

                      <div class="col-sm-6">
                        <div class="input-group input-group-sm">
                          <span class="input-group-addon ln_green bg_green tc_green" id="sizing-addon3" style="background: #eee">E-mail</span> 
                          <div class="alinear_izquierda form-control ln_green tc_green">{{utf8_decode($paciente->email)}}</div>
                        </div>
                      </div>
                    </div>



                    </div>
                  </div>
              </div>


        </div>
    </td></tr>