<?php $__env->startSection('titulo', 'Consultas'); ?>

<?php $__env->startSection('css'); ?>
	<?php echo Html::style('css/inscripcion-seguimiento.css'); ?>

<?php $__env->stopSection(); ?>

<?php $__env->startSection('botonera'); ?>
	<li class="form-group">
		<a href="<?php echo URL::to('admin'); ?>" class="btn btn-warning btn-right">Salir</a>
	</li>
<?php $__env->stopSection(); ?>

<?php $__env->startSection('content-extra'); ?>
	<div class="row bg-info content-extra">
		<div class="container">
			<?php if(isset($paciente)): ?>
				<?php echo Form::model($paciente, ['class' => 'form-horizontal', 'url' => '/consultas', 'method' => 'POST']); ?>

			<?php else: ?>
				<?php echo Form::open(['class' => 'form-horizontal', 'url' => '/consultas', 'method' => 'POST']); ?>

			<?php endif; ?>
				<div class="row">
					<div id="div-documento">
						<?php echo Form::label('documento', 'Documento:', ['class' => 'col-sm-1 control-label input-sm']); ?>

						<div class="col-sm-2">
							<?php echo Form::text('documento', null, ['class' => 'form-control input-sm']); ?>

						</div>
					</div>

					<?php echo Form::label('id', 'Paciente:', ['class' => 'col-sm-1 col-sm-1-original control-label input-sm']); ?>

					<div class="col-sm-3">
						<?php echo Form::select('id', $pacientes, null, ['class' => 'form-control input-sm']); ?>

					</div>

					<div class="col-sm-2">
						<?php echo Form::submit('Buscar', ['class' => 'btn btn-success btn-sm']); ?>

					</div>
				</div>
				<hr class="compacto">
				<div class="row">
					<?php echo Form::label('nacimiento', 'Fecha de Nacimiento:', ['class' => 'col-sm-1 control-label input-sm']); ?>

					<div class="col-sm-2">
						<?php echo Form::text('nacimiento', null, ['class' => 'form-control input-sm', 'readonly']); ?>

					</div>

					<?php echo Form::label('tipo_usuario', 'Tipo Usuario:', ['class' => 'col-sm-1 col-sm-1-original control-label input-sm']); ?>

					<div class="col-sm-2">
						<?php echo Form::select('tipo_usuario', [
							'' => '',
							'co' => 'Contributivo',
							'su' => 'Subsidiado',
							'vi' => 'Vinculado',
							'pa' => 'Particular',
							'ot' => 'Otro',
							'dc' => 'Desplazado Contributivo',
							'ds' => 'Desplazado Subsidiado',
							'dv' => 'Desplazado Vinculado'
						], null, ['class' => 'form-control input-sm', 'readonly', 'disabled']); ?>

					</div>

					<?php echo Form::label('estado_civil', 'Estado Civil:', ['class' => 'col-sm-1 col-sm-1-original control-label input-sm']); ?>

						<div class="col-sm-2">
							<?php echo Form::select('estado_civil', [
								'' => '',
								'so' => 'Soltero',
								'ca' => 'Casado',
								'vi' => 'Viudo',
								'se' => 'Separado',
								'un' => 'Union Libre',
								'ot' => 'Otro'
							], null, ['class' => 'form-control input-sm', 'readonly', 'disabled']); ?>

						</div>

					<?php echo Form::label('sexo', 'Sexo:', ['class' => 'col-sm-1 control-label input-sm col-sm-1-reducido']); ?>

						<div class="col-sm-2">
							<?php echo Form::select('sexo', [
								'' => '',
								'm' => 'Masculino',
								'f' => 'Femenino',
								'i' => 'Indeterminado'
							], null, ['class' => 'form-control input-sm', 'readonly']); ?>

						</div>

					<?php echo Form::label('ocupacion', 'Ocupación:', ['class' => 'col-sm-1 control-label input-sm']); ?>

						<div class="col-sm-2">
							<?php echo Form::text('ocupacion', null, ['class' => 'form-control input-sm', 'readonly']); ?>

						</div>
					<?php echo Form::label('direccion', 'Dirección:', ['class' => 'col-sm-1 col-sm-1-original control-label input-sm']); ?>

					<div class="col-sm-2">
						<?php echo Form::text('direccion', null, ['class' => 'form-control input-sm', 'readonly']); ?>

					</div>

					<?php echo Form::label('telefono_1', 'Tel 1:', ['class' => 'col-sm-1 col-sm-1-original control-label input-sm']); ?>

					<div class="col-sm-2">
						<?php echo Form::text('telefono_1', null, ['class' => 'form-control input-sm', 'readonly']); ?>

					</div>

					<?php echo Form::label('telefono_2', 'Tel 2:', ['class' => 'col-sm-1 col-sm-1-original col-sm-1-reducido control-label input-sm']); ?>

					<div class="col-sm-2">
						<?php echo Form::text('telefono_2', null, ['class' => 'form-control input-sm', 'readonly']); ?>

					</div>

					<?php echo Form::label('sisben', 'Sisben:', ['class' => 'col-sm-1 control-label input-sm']); ?>

					<div class="col-sm-2">
						<?php echo Form::text('sisben', null, ['class' => 'form-control input-sm', 'readonly']); ?>

					</div>

					<?php echo Form::label('edad_actual', 'Edad actual:', ['class' => 'col-sm-1 col-sm-1-original control-label input-sm']); ?>

					<div class="col-sm-3">
						<?php echo Form::text('edad_actual', null, ['class' => 'form-control input-sm', 'readonly']); ?>

					</div>

				</div>
			<?php echo Form::close(); ?>

		</div>
	</div>
<?php $__env->stopSection(); ?>

<?php $__env->startSection('content'); ?>
	<?php echo $__env->make('alerts.request', array_except(get_defined_vars(), array('__data', '__path')))->render(); ?>

	<?php if(isset($movimientos)): ?>
		<div id='row-respuesta' class="row">
			<?php if(count($movimientos)): ?>
				<table class="table table-bordered table-condensed table-hover">
					<thead>
						<th>Tipo</th>
						<th>Fecha / Hora (24h)</th>
						<th>Programa</th>
						<th>Responsable</th>
						<th>Operaciones</th>
					</thead>
					<tbody>
						<?php foreach($movimientos as $movimiento): ?>
							<tr class="
								<?php if($movimiento['deleted_at']): ?>
									bg-danger
								<?php elseif($movimiento['tipo'] == 'Seguimiento'): ?>
									bg-success
								<?php elseif($movimiento['tipo'] == 'Inscripción'): ?>
									bg-info
								<?php endif; ?>
							">
								<td>
									<?php echo e($movimiento['tipo']); ?>

									<?php if($movimiento['deleted_at'] && $movimiento['tipo'] == 'Inscripción'): ?>
										(inactiva)
									<?php elseif($movimiento['tipo'] == 'Inscripción'): ?>
										(activa)
									<?php endif; ?>
								</td>
								<td><?php echo e($movimiento['fecha_hora']); ?></td>
								<td><?php echo e($movimiento['programa']); ?></td>
								<td><?php echo e($movimiento['responsable']); ?></td>
								<td>
									<?php if($movimiento['tipo'] == 'Inscripción'): ?>
										<?php echo link_to('/mostrar-pdf-inscripcion/'.$movimiento['movimientoId'],
											$title = 'Imprimir',
											$attributes = ['class' => 'btn btn-success btn-xs', 'target' => '_blank']); ?>

									<?php elseif($movimiento['tipo'] == 'Seguimiento'): ?>
										<?php echo link_to('/mostrar-pdf/'.$movimiento['programaId'].'/'.$movimiento['movimientoId'],
											$title = 'Imprimir',
											$attributes = ['class' => 'btn btn-success btn-xs', 'target' => '_blank']); ?>

	<?php /* Modal impresion Medicamentos */ ?>
	<?php if($movimiento['cantidadDeMedicamentos']): ?>
		<a data-toggle="modal" data-target="#modal_medicamentosImpresion_<?php echo e($movimiento['movimientoId']); ?>_<?php echo e($movimiento['programaId']); ?>" class="btn btn-success btn-xs">Imp Med</a>

		<div id="modal_medicamentosImpresion_<?php echo e($movimiento['movimientoId']); ?>_<?php echo e($movimiento['programaId']); ?>" class="modal fade" tabindex="-1" role="dialog" aria-labelledby="myLargeModalLabel">
			<div class="modal-dialog modal-lg" role="document">
				<div class="modal-content">
					<div class="modal-header">
						<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
						<h4 class="modal-title" id="myModalLabel">Impresion de Medicamentos</h4>
					</div>
					<div class="modal-body">
						<div class="form-group form-group-sm">
							<hr>

								<div id="div_table_medicamentos_<?php echo e($movimiento['movimientoId']); ?>_<?php echo e($movimiento['programaId']); ?>" class="col xs 12 ">
									<table class="table table-striped table-bordered table-hover table-condensed">
										<thead>
											<tr>
												<th>Imp</th>
												<th>CUM</th>
												<th>COD</th>
												<th>Nombre</th>
												<th>Cantidad</th>
												<th>Posología</th>
												<th>Duración</th>
											</tr>
										</thead>
										<tbody id="tbody_medicamentos_<?php echo e($movimiento['movimientoId']); ?>_<?php echo e($movimiento['programaId']); ?>">
											<?php $valoresm=""; ?>

										<?php foreach($movimiento['medicamentos'] as $medicamento): ?>
														<tr><td><input type='checkbox' name='<?php echo e($movimiento['movimientoId']); ?>_<?php echo e($movimiento['programaId']); ?>checkboxvarm[]' id='checkboxvarm_<?php echo e($movimiento['movimientoId']); ?>_<?php echo e($movimiento['programaId']); ?>' onchange="cargaDatosM(<?php echo e($movimiento['movimientoId']); ?>,<?php echo e($movimiento['programaId']); ?>)" value=<?php echo e($medicamento->cod); ?> checked="checked"></input></td>
															<td><?php echo e($medicamento->cum); ?></td>
															<td><?php echo e($medicamento->cod); ?></td>
															<td><?php echo e($medicamento->nombre); ?></td>
															<td><?php echo e($medicamento->cantidad); ?></td>
															<td><?php echo e($medicamento->posologia); ?></td>
															<td><?php echo e($medicamento->duracion_tto); ?></td>
														</tr>
														<?php $valoresm=$valoresm.$medicamento->cod.","; ?>
										<?php endforeach; ?>
										</tbody>
									</table>
								</div>
						</div>
						<div class="modal-footer">
						<form method="get" action="<?php echo e(url('/mostrar-pdf-medicamentos')); ?>" target="_blank" id="form_medicamentos_<?php echo e($movimiento['movimientoId']); ?>_<?php echo e($movimiento['programaId']); ?>">
							<input type="hidden" name="programaId" id="programaId_<?php echo e($movimiento['movimientoId']); ?>_<?php echo e($movimiento['programaId']); ?>" value="<?php echo e($movimiento['programaId']); ?>">
							<input type="hidden" name="formularioId" id="formularioId_<?php echo e($movimiento['movimientoId']); ?>_<?php echo e($movimiento['programaId']); ?>" value="<?php echo e($movimiento['movimientoId']); ?>">
							<input type="hidden" name="medSelec" id="medSelec_<?php echo e($movimiento['movimientoId']); ?>_<?php echo e($movimiento['programaId']); ?>" value="<?php echo e($valoresm); ?>">
							<button id="btnMed_<?php echo e($movimiento['movimientoId']); ?>_<?php echo e($movimiento['programaId']); ?>" type="submit" class="btn btn-success btn-xs">Imprimir</button>
								<script>
								function cargaDatosM(movimiento,programa){
									var btn = document.getElementById("btnMed_"+movimiento+"_"+programa);
									var selected = new Array();
									var chk_arr =  document.getElementsByName(movimiento+"_"+programa+"checkboxvarm[]");
									var chklength = chk_arr.length ;
									for(k=0;k< chklength;k++)
									{
										if(chk_arr[k].checked){
											selected.push(chk_arr[k].value);
										}
									}
									if(selected.length<1){
										btn.setAttribute("disabled", "disabled");
									}else{
										// selected.forEach(function(element) {
										// 		console.log(element);
										// });
										document.getElementById("medSelec_"+movimiento+"_"+programa).value = selected.join();
										btn.removeAttribute("disabled");
									}
								}
							</script>
							<button type="button" class="btn btn-danger btn-xs" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">Cancelar</span></button>
							<p id="yamid"></p>
							</form>
						</div>
					</div>
				</div>
			</div>
		</div>
		<?php /* <?php echo link_to_action(
			'SeguimientoController@mostrarPdfmedicamentos',
			$title = 'Imp Proc',
			$parameters = [$movimiento['programaId'],  $movimiento['movimientoId']],
			$attributes = ['class' => 'btn btn-success btn-xs', 'target' => "_blank"]
		); ?> */ ?>
		<?php else: ?>
			<a data-toggle="modal" data-target="#modal-no-contiene-medicamentos" class="btn btn-warning btn-xs">Imp Med</a>
		<?php endif; ?>
		<?php /* Modal impresion procedimientos */ ?>
										<?php if($movimiento['cantidadDeProcedimientos']): ?>
											<a data-toggle="modal" data-target="#modal_procedimientosImpresion_<?php echo e($movimiento['movimientoId']); ?>_<?php echo e($movimiento['programaId']); ?>" class="btn btn-success btn-xs">Imp Proc</a>

											<div id="modal_procedimientosImpresion_<?php echo e($movimiento['movimientoId']); ?>_<?php echo e($movimiento['programaId']); ?>" class="modal fade" tabindex="-1" role="dialog" aria-labelledby="myLargeModalLabel">
												<div class="modal-dialog modal-lg" role="document">
													<div class="modal-content">
														<div class="modal-header">
															<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
															<h4 class="modal-title" id="myModalLabel">Impresion de Procedimientos</h4>
														</div>
														<div class="modal-body">
															<div class="form-group form-group-sm">
																<hr>

																	<div id="div_table_procedimientos_<?php echo e($movimiento['movimientoId']); ?>_<?php echo e($movimiento['programaId']); ?>" class="col xs 12 ">
																		<table class="table table-striped table-bordered table-hover table-condensed">
																			<thead>
																				<tr>
																					<th>Imprimir</th>
																					<th>CUPS</th>
																					<th>Nombre</th>
																					<th>Cantidad</th>
																					<th>Observaciones</th>
																				</tr>
																			</thead>
																			<tbody id="tbody_procedimientos_<?php echo e($movimiento['movimientoId']); ?>_<?php echo e($movimiento['programaId']); ?>">
																				<?php $valoresp=""; ?>

																			<?php foreach($movimiento['procedimientos'] as $procedimiento): ?>
																              <tr><td><input type='checkbox' name='<?php echo e($movimiento['movimientoId']); ?>_<?php echo e($movimiento['programaId']); ?>checkboxvar[]' id='checkboxvar_<?php echo e($movimiento['movimientoId']); ?>_<?php echo e($movimiento['programaId']); ?>' onchange="cargaDatos(<?php echo e($movimiento['movimientoId']); ?>,<?php echo e($movimiento['programaId']); ?>)" value=<?php echo e($procedimiento->id); ?> checked="checked"></input></td>
																                <td><?php echo e($procedimiento->cups); ?></td>
																                <td><?php echo e($procedimiento->nombre); ?></td>
																                <td><?php echo e($procedimiento->cantidad); ?></td>
																                <td><?php echo e($procedimiento->observaciones); ?></td>
																              </tr>
																							<?php $valoresp=$valoresp.$procedimiento->id.","; ?>
													            <?php endforeach; ?>
													            </tbody>
																		</table>
																	</div>
															</div>
															<div class="modal-footer">
															<form method="get" action="<?php echo e(url('/mostrar-pdf-procedimientos')); ?>" target="_blank" id="form_remisiones_<?php echo e($movimiento['movimientoId']); ?>_<?php echo e($movimiento['programaId']); ?>">
    														<input type="hidden" name="programaId" id="programaId_<?php echo e($movimiento['movimientoId']); ?>" value="<?php echo e($movimiento['programaId']); ?>">
																<input type="hidden" name="formularioId" id="formularioId_<?php echo e($movimiento['movimientoId']); ?>" value="<?php echo e($movimiento['movimientoId']); ?>">
																<input type="hidden" name="prodSelec" id="prodSelec_<?php echo e($movimiento['movimientoId']); ?>" value="<?php echo e($valoresp); ?>">
																<button id="btnProc_<?php echo e($movimiento['movimientoId']); ?>_<?php echo e($movimiento['programaId']); ?>" type="submit" class="btn btn-success btn-xs">Imprimir</button>
																	<!-- <?php echo link_to_action(
																		'SeguimientoController@mostrarPdfProcedimientos',
																		$title = 'Imp Proc',
																		$parameters = [$movimiento['programaId'],  $movimiento['movimientoId']],
																		$attributes = ['class' => 'btn btn-success btn-xs', 'target' => "_blank"]
																	); ?> -->
																	<script>
																	function cargaDatos(movimiento,programa){
																		var btn = document.getElementById("btnProc_"+movimiento+"_"+programa);
																		var selected = new Array();
																		var chk_arr =  document.getElementsByName(movimiento+"_"+programa+"checkboxvar[]");
																		var chklength = chk_arr.length ;
																		for(k=0;k< chklength;k++)
																		{
																			if(chk_arr[k].checked){
																				selected.push(chk_arr[k].value);
																			}
																		}
																		if(selected.length<1){
																			btn.setAttribute("disabled", "disabled");
																		}else{
																			// selected.forEach(function(element) {
  																		// 		console.log(element);
																			// });
																			document.getElementById("prodSelec_"+movimiento).value = selected.join();
																			btn.removeAttribute("disabled");
																		}
																	}
																</script>
																<button type="button" class="btn btn-danger btn-xs" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">Cancelar</span></button>
																<p id="yamid"></p>
																</form>
															</div>
														</div>
													</div>
												</div>
											</div>
											<?php /* <?php echo link_to_action(
												'SeguimientoController@mostrarPdfProcedimientos',
												$title = 'Imp Proc',
												$parameters = [$movimiento['programaId'],  $movimiento['movimientoId']],
												$attributes = ['class' => 'btn btn-success btn-xs', 'target' => "_blank"]
											); ?> */ ?>
											<?php else: ?>
												<a data-toggle="modal" data-target="#modal-no-contiene-procedimientos" class="btn btn-warning btn-xs">Imp Proc</a>
											<?php endif; ?>
      <!-- Remisiiones  -->
											<?php if($movimiento['cantidadDeRemisiones']): ?>
												<a data-toggle="modal" data-target="#modal_remisionesImpresion_<?php echo e($movimiento['movimientoId']); ?>_<?php echo e($movimiento['programaId']); ?>" class="btn btn-success btn-xs">Imp Rem</a>
												<?php /* Modal impresion remisiones */ ?>
												<div id="modal_remisionesImpresion_<?php echo e($movimiento['movimientoId']); ?>_<?php echo e($movimiento['programaId']); ?>" class="modal fade" tabindex="-1" role="dialog" aria-labelledby="myLargeModalLabel">
													<div class="modal-dialog modal-lg" role="document">

														<div class="modal-content">
															<div class="modal-header">
																<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
																<h4 class="modal-title" id="myModalLabel">Impresion de Remisiones</h4>
															</div>
															<div class="modal-body">
																<div class="form-group form-group-sm">
																	<hr>
																		<div id="div_table_remisiones_<?php echo e($movimiento['movimientoId']); ?>_<?php echo e($movimiento['programaId']); ?>" class="col xs 12 ">
																			<table class="table table-striped table-bordered table-hover table-condensed">
																				<thead>
																					<tr>
																						<th>Imprimir</th>
																						<th>Tipo</th>
																						<th>Destino</th>
																						<th>Especialidad</th>
																						<th>Servicio</th>
																						<th>Ordenamiento</th>
																					</tr>
																				</thead>
																				<tbody id="tbody_remisiones_<?php echo e($movimiento['movimientoId']); ?>_<?php echo e($movimiento['programaId']); ?>">
																					<?php $valoresr=""; ?>
																				<?php foreach($movimiento['remisiones'] as $remision): ?>
																	              <tr><td><input type='checkbox' name='<?php echo e($movimiento['movimientoId']); ?>_<?php echo e($movimiento['programaId']); ?>checkboxvarR[]' id='checkboxvarR_<?php echo e($movimiento['movimientoId']); ?>_<?php echo e($movimiento['programaId']); ?>' onchange="cargaDatosR(<?php echo e($movimiento['movimientoId']); ?>,<?php echo e($movimiento['programaId']); ?>)" value=<?php echo e($remision->id); ?> checked="checked"></input></td>
																									<td><?php echo e($remision->tipo); ?></td>
																	                <td><?php echo e($remision->destino); ?></td>
																	                <td><?php echo e($remision->especialidad); ?></td>
																	                <td><?php echo e($remision->servicio); ?></td>
																									<td><?php echo e($remision->ordenamiento); ?></td>
																	              </tr>
																								<?php $valoresr=$valoresr.$remision->id.","; ?>
														            <?php endforeach; ?>
														            </tbody>
																			</table>
																		</div>
																</div>
																<div class="modal-footer">
																<form method="get" action="<?php echo e(url('/mostrar-pdf-remisiones')); ?>" target="_blank" id="form_remisiones_<?php echo e($movimiento['movimientoId']); ?>_<?php echo e($movimiento['programaId']); ?>">
	    														<input type="hidden" name="programaId" id="programaId_<?php echo e($movimiento['movimientoId']); ?>" value="<?php echo e($movimiento['programaId']); ?>">
																	<input type="hidden" name="formularioId" id="formularioId_<?php echo e($movimiento['movimientoId']); ?>" value="<?php echo e($movimiento['movimientoId']); ?>">
																	<input type="hidden" name="remiSelec" id="remiSelec_<?php echo e($movimiento['movimientoId']); ?>" value="<?php echo e($valoresr); ?>">
																	<button id="btnRemi_<?php echo e($movimiento['movimientoId']); ?>_<?php echo e($movimiento['programaId']); ?>" type="submit" class="btn btn-success btn-xs">Imprimir</button>
																		<script>
																		function cargaDatosR(movimiento,programa){
																			var btn = document.getElementById("btnRemi_"+movimiento+"_"+programa);
																			var selected = new Array();
																			var chk_arr =  document.getElementsByName(movimiento+"_"+programa+"checkboxvarR[]");
																			var chklength = chk_arr.length;
																		//	console.log("a"+chk_arr);
																			for(k=0;k< chklength;k++)
																			{
																				if(chk_arr[k].checked){
																					selected.push(chk_arr[k].value);
																				}
																			}
																		//	console.log("b"+selected.length);
																			if(selected.length<1){
																				btn.setAttribute("disabled", "disabled");
																			}else{
																				// selected.forEach(function(element) {
	  																		// 		console.log(element);
																				// });
																				document.getElementById("remiSelec_"+movimiento).value = selected.join();
																				btn.removeAttribute("disabled");
																			}
																		}
																	</script>
																	<button type="button" class="btn btn-danger btn-xs" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">Cancelar</span></button>
																	<p id="yamid"></p>
																	</form>
																</div>
															</div>
														</div>
													</div>
												</div>
												<?php /* <?php echo link_to_action(
													'SeguimientoController@mostrarPdfProcedimientos',
													$title = 'Imp Proc',
													$parameters = [$movimiento['programaId'],  $movimiento['movimientoId']],
													$attributes = ['class' => 'btn btn-success btn-xs', 'target' => "_blank"]
												); ?> */ ?>
												<?php else: ?>
													<a data-toggle="modal" data-target="#modal-no-contiene-remisiones" class="btn btn-warning btn-xs">Imp Remi</a>
												<?php endif; ?>
									<?php endif; ?>
								</td>
							</tr>
						<?php endforeach; ?>
					</tbody>
				</table>
			<?php else: ?>
				<p>El paciente no se encuentra asociado a ningún formulario de inscripción o de seguimiento.</p>
			<?php endif; ?>
		</div>
	<?php endif; ?>

	<div id="modal-no-contiene-medicamentos" class="modal fade" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
	  <div class="modal-dialog modal-sm" role="document">
	    <div class="modal-content">
	        <div class="modal-header">
	            <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
	            <h4 class="modal-title" id="myModalLabel">Advertencia</h4>
	        </div>
	        <div class="modal-body">
	            Formulario sin prescripción de medicamentos.
	        </div>
	        <div class="modal-footer">
	            <button type="button" class="btn btn-default" data-dismiss="modal">Continuar</button>
	        </div>
	    </div>
	  </div>
	</div>

	<div id="modal-no-contiene-procedimientos" class="modal fade" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
	  <div class="modal-dialog modal-sm" role="document">
	    <div class="modal-content">
	        <div class="modal-header">
	            <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
	            <h4 class="modal-title" id="myModalLabel">Advertencia</h4>
	        </div>
	        <div class="modal-body">
	            Formulario sin prescripción de apoyo diagnóstico.
	        </div>
	        <div class="modal-footer">
	            <button type="button" class="btn btn-default" data-dismiss="modal">Continuar</button>
	        </div>
	    </div>
	  </div>
	</div>

<?php $__env->stopSection(); ?>

<?php $__env->startSection('scripts'); ?>
	<script type="text/javascript">
		$(document).ready(function(){
			<?php echo $__env->make('componentes.script-mostrar-modal-request', array_except(get_defined_vars(), array('__data', '__path')))->render(); ?>

			// Actualizar el input type text documento al seleccionar un paciente del select
			$('#id').change(function(){
				$('#documento').val($(this).val() != 0 ? $(this).val():'');
				limpiarFormulario();
			});

			// Actualizar el select al ingresar un documento en el input type text
			$('#documento').keyup(function(){
				if ($('option[value=' + $(this).val() + ']').length) {
					$('#id').val($(this).val());
				} else {
					$('#id').val(0);
				}
				limpiarFormulario();
			});

			function limpiarFormulario() {
				$(':text[readonly], select[readonly]').val('');
				$('#row-respuesta').html('');
			}
		});
	</script>
<?php $__env->stopSection(); ?>

<?php echo $__env->make('layouts.admin-bloqueo-vista', array_except(get_defined_vars(), array('__data', '__path')))->render(); ?>