<div class="">
    @php
    $encountersInProgress = $performer->pro->encountersInProgressRecordsAsDna();
    @endphp
    <div class="card">
        <div class="card-body p-0">
            @if($encountersInProgress && count($encountersInProgress))
            <div class="table-responsive">
                <table class="table table-sm table-striped mb-0">
                    <thead class="bg-light">
                        <tr>
                            <th class="border-0">Chart #</th>
                            <th class="border-0">Name</th>
                            <th class="border-0">DOB</th>
                            <th class="border-0">Gender</th>
                            <th class="border-0">Insurance</th>
                            <th class="border-0">HCP</th>
                            <th class="border-0">Visit Date</th>
                        </tr>
                    </thead>
                    <tbody>
                        @foreach($encountersInProgress as $row)
                        <tr>
                            <td class="text-nowrap">
                                <a native target="_blank" href="{{ route('patients.view.notes.view.dashboard', ['patient' => $row->client, 'note' => $row]) }}">
                                  {{$row->client->chart_number}}
                                </a>
                            </td>
                            <td>
                                <a native target="_blank" href="{{ route('patients.view.notes.view.dashboard', ['patient' => $row->client, 'note' => $row]) }}">
                                    {{$row->client->displayName()}}
                                </a>
                            </td>
                            <td class="text-nowrap">
                                {{friendly_date($row->client->dob)}}
                            </td>
                            <td class="text-nowrap">
                                {{$row->client->sex}}
                            </td>
                            <td class="text-nowrap">
                                @include('app.patient.coverage_column_renderer', ['patient'=>$row->client])
                            </td>
                            <td class="text-nowrap">
                                {{$row->client->mcp->name_display ?? '' }}
                            </td>
                            <td class="text-nowrap">
                                {{friendly_date($row->effective_dateest)}}
                            </td>
                        </tr>
                        @endforeach
                    </tbody>
                </table>
            </div>
            @if($encountersInProgress->hasPages())
            <div class="m-2">
                {{ $encountersInProgress->onEachSide(0)->withQueryString()->links() }}
            </div>
            @endif
            @else
            <div class="p-3">
                No encounters in progress
            </div>
            @endif
        </div>
    </div>
</div>
