@extends ('layouts/template')

@section('content')
<div class="p-3 mcp-theme-1" id="patients-list">
	<div class="card border-bottom-0">

		<div class="card-header px-3 py-2 d-flex align-items-center">
			<strong class="mr-4">
				<i class="fas fa-users"></i>
				Patients Missing Default Settings
			</strong>
		</div>
		<div class="p-3">
			@include('app.admin.patients_missing_defsult_settings_filters')
		</div>
		<table class="table table-striped p-0 m-0 table-sm border-top border-bottom ">
			<thead class="bg-light">
				<tr>
					<th class="border-0">Chart #</th>
					<th class="border-0">Patient</th>
					<th class="border-0">MCP</th>
					<th class="border-0">Default MCP Company Pro</th>
					<th class="border-0">Default MCP Company Pro Payer</th>
					<th class="border-0">Default MCP Company Location</th>
					<th class="border-0">Insurance</th>
				</tr>
			</thead>
			<tbody>
				@foreach($patients as $patient)
				<tr>
					<td>
						<a href="{{route('patients.view.settings', $patient)}}">
							{{$patient->chart_number}}
						</a>
					</td>
					<td>
						<a href="{{route('patients.view.settings', $patient)}}">
							{{$patient->displayName()}}
						</a>
					</td>
					<td>{{ $patient->mcp ? $patient->mcp->displayName() : 'NO' }}</td>
					<td>{{ $patient->defaultMcpCompanyPro ? $patient->defaultMcpCompanyPro->company->name : 'NO' }}</td>
					<td>{{ $patient->defaultMcpCompanyProPayer ? $patient->defaultMcpCompanyProPayer->payer->name : 'NO' }}</td>
					<td>{{$patient->default_mcp_company_location_id? implode(" ", [$patient->defaultMcpCompanyLocation->line1, $patient->defaultMcpCompanyLocation->city, $patient->defaultMcpCompanyLocation->state]):'NO'}}</td>
					<td>
						@include('app.patient.coverage_column_renderer', ['patient'=>$patient])
					</td>
				</tr>
				@endforeach

				@if(count($patients) === 0)
				<tr>
					<td colspan="7">No records found!</td>
				</tr>
				@endif
			</tbody>

		</table>
	</div>
	<div class="p-3">
		{{$patients->withQueryString()->links()}}
	</div>

</div>
</div>
</div>
@endsection