|
@@ -0,0 +1,350 @@
|
|
|
+<div class="table-responsive" style="height: calc(100vh - 190px)" id="admin-patients-list-extended">
|
|
|
+ <table class="table p-0 m-0 table-sm table-striped border-top border-bottom text-nowrap">
|
|
|
+ <thead class="bg-light">
|
|
|
+ <tr>
|
|
|
+ <th class="border-0 width-90px">#</th>
|
|
|
+ <th class="border-0">Name</th>
|
|
|
+ <th class="border-0">DOB</th>
|
|
|
+ <th class="border-0">Age</th>
|
|
|
+ <th class="border-0">Sex</th>
|
|
|
+ <th class="border-0">BMI</th>
|
|
|
+ <th class="border-0">Insurance</th>
|
|
|
+ <th class="border-0">Last Visit</th>
|
|
|
+ <th class="border-0">Next Appt.</th>
|
|
|
+ <th class="border-0">Notes</th>
|
|
|
+
|
|
|
+ <th class="border-0">BP</th>
|
|
|
+ <th class="border-0"><i class="fa fa-heartbeat"></i></th>
|
|
|
+ <th class="border-0">Pulse</th>
|
|
|
+ <th class="border-0">BP/Pulse Timestamp</th>
|
|
|
+ <th class="border-0">Weight</th>
|
|
|
+ <th class="border-0">Weight Timestamp</th>
|
|
|
+
|
|
|
+ {{-- <th>Scale <i class="fa fa-battery"></i></th>--}}
|
|
|
+ {{-- <th class="border-0">RPM</th>--}}
|
|
|
+ {{-- <th class="border-0">CCM</th>--}}
|
|
|
+ {{-- <th class="border-0 d-none">Last Weight-In</th>--}}
|
|
|
+ {{-- <th class="border-0 d-none">Last BP</th>--}}
|
|
|
+ <th class="border-0">Assigned On</th>
|
|
|
+
|
|
|
+ @if($pro->pro_type == 'ADMIN')
|
|
|
+ <th class="border-0">MCP</th>
|
|
|
+ <th class="border-0">Initiative</th>
|
|
|
+ @endif
|
|
|
+ </tr>
|
|
|
+ </thead>
|
|
|
+ <tbody>
|
|
|
+ @foreach($patients as $patient)
|
|
|
+ <tr>
|
|
|
+ <td>
|
|
|
+ <a native target="_blank" href="{{route('patients.view.dashboard', $patient)}}">
|
|
|
+ {{$patient->chart_number}}
|
|
|
+ </a>
|
|
|
+ <span class="on-hover-show left d-inline-block on-hover-opaque">
|
|
|
+ <i class="fa fa-info-circle ml-1"></i>
|
|
|
+ <div class="on-hover-content py-2 pl-3">
|
|
|
+ Created: <b class="m-0">{{friendly_date_time($patient->created_at)}}</b>
|
|
|
+ </div>
|
|
|
+ </span>
|
|
|
+ </td>
|
|
|
+ <td>
|
|
|
+ <div class="d-flex align-items-center flex-nowrap">
|
|
|
+ <span>{{$patient->displayName()}}</span>
|
|
|
+ </div>
|
|
|
+ </td>
|
|
|
+ <td>{{ friendly_date_time($patient->dob, false) }}</td>
|
|
|
+ <td>{{ $patient->age_in_years ? $patient->age_in_years : '-' }}</td>
|
|
|
+ <td>{{ $patient->sex }}</td>
|
|
|
+ <td>
|
|
|
+ <div class="d-none d-dflex flex-column">
|
|
|
+ @if($patient->usual_bmi_min && $patient->usual_bmi_max)
|
|
|
+ <small class="text-muted">BMI (Usual):
|
|
|
+ <b>{{ $patient->usual_bmi_min }}</b> {{ $patient->usual_bmi_min_category }} to
|
|
|
+ <b>{{ $patient->usual_bmi_max }}</b> {{ $patient->usual_bmi_max_category }}</small>
|
|
|
+ @endif
|
|
|
+ @if($patient->ideal_bmi)
|
|
|
+ <small class="text-muted">BMI (Ideal)
|
|
|
+ <b>{{ $patient->ideal_bmi }}</b> {{ $patient->ideal_bmi_category }}</small>
|
|
|
+ @endif
|
|
|
+ </div>
|
|
|
+ </td>
|
|
|
+ <td>
|
|
|
+ @include('app.patient.coverage_column_renderer', ['patient'=>$patient])
|
|
|
+ </td>
|
|
|
+ <td>
|
|
|
+ {{ friendly_date($patient->most_recent_completed_mcp_note_date) }}
|
|
|
+ {{-- {{$patient->lastMcpAppointment ? friendly_date_time($patient->lastMcpAppointment->raw_date.' '.$patient->lastMcpAppointment->raw_start_time) : '-'}}--}}
|
|
|
+ </td>
|
|
|
+ <td>{{$patient->nextMcpAppointment ? friendly_date_time($patient->nextMcpAppointment->raw_date.' '.$patient->nextMcpAppointment->raw_start_time) : '-'}}
|
|
|
+ <br>
|
|
|
+ {{$patient->nextMcpAppointment ? $patient->nextMcpAppointment->status : '-'}}
|
|
|
+ </td>
|
|
|
+
|
|
|
+ <td class="p-0 pb-1">
|
|
|
+ @if(count($patient->activeNotes))
|
|
|
+ <?php $noteIndex = 0; ?>
|
|
|
+ @foreach ($patient->activeNotes as $note)
|
|
|
+ <?php $noteIndex++; ?>
|
|
|
+ <div class="mt-1 bg-white border p-2">
|
|
|
+ <div class="d-flex align-items-baseline">
|
|
|
+ <span class="mr-2 font-weight-bold text-secondary">{{$noteIndex}}.</span>
|
|
|
+ <a native target="_blank"
|
|
|
+ href="/patients/view/{{ $patient->uid }}/notes/view/{{ $note->uid }}">
|
|
|
+ <b>{{ friendly_date_time($note->effective_dateest, false) }}</b>
|
|
|
+ </a>
|
|
|
+ <span class="mx-2 text-sm">/</span>
|
|
|
+ <span>{{ $note->new_or_fu_or_na === 'NEW' ? 'New' : 'Follow-up' }}</span>
|
|
|
+ <span class="mx-2 text-sm">/</span>
|
|
|
+ <span>{{$note->hcpPro ? $note->hcpPro->name_display: '-'}}</span>
|
|
|
+ <span class="mx-2 text-sm">/</span>
|
|
|
+ <span>{{ noteMethodDisplay($note->method) }}</span>
|
|
|
+ @if($note->hcpPro && $note->is_signed_by_hcp)
|
|
|
+ <span class="mx-2 text-sm">/</span>
|
|
|
+ <span class="text-success">Signed</span>
|
|
|
+ @endif
|
|
|
+ </div>
|
|
|
+ <?php
|
|
|
+ $bills = \App\Models\Bill::where('note_id', $note->id)
|
|
|
+ ->where('bill_service_type', '<>', 'GENERIC')
|
|
|
+ ->where('is_cancelled', false)
|
|
|
+ ->orderBy('id', 'desc')
|
|
|
+ ->get();
|
|
|
+ ?>
|
|
|
+ @if(count($bills))
|
|
|
+ <hr class="my-2">
|
|
|
+ <div class="d-flex align-items-start text-sm">
|
|
|
+ <b class="text-secondary width-60px">Bills:</b>
|
|
|
+ <div class="ml-2 flex-grow-1">
|
|
|
+ @foreach ($bills as $bill)
|
|
|
+ <div class="border border-info bg-aliceblue p-1 mb-1">
|
|
|
+ <div class="d-flex align-items-baseline">
|
|
|
+ <span class="text-nowrap">{{friendlier_date_time($bill->effective_date, false)}}</span>
|
|
|
+ <span class="mx-2 text-sm">/</span>
|
|
|
+ <span>{{$bill->code}}</span>
|
|
|
+ <span class="mx-2 text-sm">/</span>
|
|
|
+ <span>
|
|
|
+ @if(strpos(strtolower($bill->code), 'treatment services') !== FALSE)
|
|
|
+ <?php
|
|
|
+ $totalSeconds = $bill->number_of_units * 3600;
|
|
|
+ $remainder = $totalSeconds % 60;
|
|
|
+ if ($remainder !== 0) {
|
|
|
+ if ($remainder < 30) {
|
|
|
+ $totalSeconds = $totalSeconds - $remainder;
|
|
|
+ } else {
|
|
|
+ $totalSeconds = $totalSeconds + (60 - $remainder);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ ?>
|
|
|
+ {{ time_in_hrminsec($totalSeconds) }}
|
|
|
+ @else
|
|
|
+ @if(!!$bill->number_of_units)
|
|
|
+ {{ $bill->number_of_units }} unit(s)
|
|
|
+ @else
|
|
|
+ -
|
|
|
+ @endif
|
|
|
+ @endif
|
|
|
+ </span>
|
|
|
+ <span class="mx-2 text-sm">/</span>
|
|
|
+ <span>{{ $bill->hcp->displayName() }}</span>
|
|
|
+ </div>
|
|
|
+ <div class="d-flex align-items-baseline">
|
|
|
+ @if($bill->is_signed_by_hcp)
|
|
|
+ <span class="d-block text-nowrap">
|
|
|
+ <i class="fa fa-check"></i>
|
|
|
+ Signed
|
|
|
+ </span>
|
|
|
+ <span class="mx-2 text-sm">/</span>
|
|
|
+ @endif
|
|
|
+ @if($bill->is_verified)
|
|
|
+ <span class="d-block text-nowrap">
|
|
|
+ <i class="fa fa-check"></i>
|
|
|
+ Verified
|
|
|
+ </span>
|
|
|
+ <span class="mx-2 text-sm">/</span>
|
|
|
+ @endif
|
|
|
+ @if(!$bill->has_hcp_been_paid)
|
|
|
+ <div class="text-nowrap mt-1 screen-only">
|
|
|
+ <span class="">Expected: </span>
|
|
|
+ <span class="font-weight-bold">${{ $bill->hcp_expected_payment_amount }}</span>
|
|
|
+ </div>
|
|
|
+ @else
|
|
|
+ <div class="text-nowrap mt-1 screen-only">
|
|
|
+ <span class="">Paid: </span>
|
|
|
+ <span class="font-weight-bold">${{ $bill->hcp_payment_amount }}</span>
|
|
|
+ </div>
|
|
|
+ @endif
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ @endforeach
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ @endif
|
|
|
+ <?php
|
|
|
+ $claims = \App\Models\Claim::where('note_id', $note->id)
|
|
|
+ ->where('is_cancelled', false)
|
|
|
+ ->orderBy('id', 'desc')
|
|
|
+ ->get();
|
|
|
+ ?>
|
|
|
+ @if(count($claims))
|
|
|
+ <hr class="my-2">
|
|
|
+ <div class="d-flex align-items-start text-sm">
|
|
|
+ <b class="text-secondary width-60px">Claims:</b>
|
|
|
+ <div class="ml-2 flex-grow-1 border border-success">
|
|
|
+ <table class="table table-sm tabe-striped mb-0 border-0">
|
|
|
+ <tbody>
|
|
|
+ @foreach ($claims as $claim)
|
|
|
+ @if($claim->status !== 'CANCELLED' || request('claims-filter') === 'all')
|
|
|
+ <tr class="{{ $claim->status === 'CANCELLED' ? 'text-secondary bg-light on-hover-opaque' : '' }}">
|
|
|
+ <td class="p-0 border-left border-right">
|
|
|
+ @if($claim->lines->count())
|
|
|
+ <table class="table table-sm table-condensed border-0 mb-0">
|
|
|
+ <thead>
|
|
|
+ <tr class="bg-light">
|
|
|
+ <th class="border-0">CPT</th>
|
|
|
+ <th class="border-0">DOS</th>
|
|
|
+ <th class="border-0">ICDs</th>
|
|
|
+ </tr>
|
|
|
+ </thead>
|
|
|
+ <tbody class="">
|
|
|
+ @foreach($claim->lines as $line)
|
|
|
+ <tr class="claim-line">
|
|
|
+ <td>{{$line->cpt}}
|
|
|
+ <div>Units: <b>{{!@$line->units ? 1 : $line->units}}</b></div>
|
|
|
+ </td>
|
|
|
+ <td class="text-nowrap">{{friendlier_date($line->date_of_service)}}</td>
|
|
|
+ <td>
|
|
|
+ @if(count($line->claimLineIcds))
|
|
|
+ @foreach($line->claimLineIcds as $icd)
|
|
|
+ <div>
|
|
|
+ <b class="c-pointer border-secondary border-bottom" title="{{$icd->description}}">{{$icd->code}}</b>
|
|
|
+ </div>
|
|
|
+ @endforeach
|
|
|
+ @else
|
|
|
+ <p>No ICDs set</p>
|
|
|
+ @endif
|
|
|
+ </td>
|
|
|
+ </tr>
|
|
|
+ @endforeach
|
|
|
+ </tbody>
|
|
|
+ </table>
|
|
|
+ @else
|
|
|
+ <p>No lines for this claim</p>
|
|
|
+ @endif
|
|
|
+ </td>
|
|
|
+ <td class="border-right p-0">
|
|
|
+
|
|
|
+ <!-- payer, company, location -->
|
|
|
+ <div class="p-1">
|
|
|
+ <div class="mt-1">
|
|
|
+ <div>
|
|
|
+ <b>{{$claim->primaryPayer ? $claim->primaryPayer->name : '-'}}</b>
|
|
|
+ /
|
|
|
+ {{$claim->status ? $claim->status : 'Status not set'}}
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <div class="mt-1">
|
|
|
+ {{$claim->companyPro && $claim->companyPro->company ? $claim->companyPro->company->name : '-'}}
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <div class="mt-1">
|
|
|
+ {{$claim->companyLocation ? $claim->companyLocation->line1 . ', ' . $claim->companyLocation->city : '-'}}
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </td>
|
|
|
+ </tr>
|
|
|
+ @endif
|
|
|
+ @endforeach
|
|
|
+ </tbody>
|
|
|
+ </table>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ @endif
|
|
|
+ </div>
|
|
|
+ @endforeach
|
|
|
+ @endif
|
|
|
+ </td>
|
|
|
+
|
|
|
+ <td>
|
|
|
+ @if($patient->most_recent_cellular_bp_measurement_at)
|
|
|
+ {{ $patient->most_recent_cellular_bp_sbp_mm_hg }}
|
|
|
+ / {{ $patient->most_recent_cellular_bp_dbp_mm_hg }}
|
|
|
+ @endif
|
|
|
+ </td>
|
|
|
+
|
|
|
+ <td><?= $patient->most_recent_cellular_bp_value_irregular ? '<i class="fa fa-heartbeat"></i>' : '' ?></td>
|
|
|
+
|
|
|
+ <td>{{ $patient->most_recent_cellular_bp_value_pulse }}</td>
|
|
|
+
|
|
|
+ <td>{{ friendlier_date_time($patient->most_recent_cellular_bp_measurement_at, false) }}</td>
|
|
|
+
|
|
|
+ <td>{{ $patient->most_recent_cellular_weight_value ? round($patient->most_recent_cellular_weight_value, 2) : '--' }}</td>
|
|
|
+
|
|
|
+ <td>{{ friendlier_date_time($patient->most_recent_cellular_weight_measurement_at, false) }}</td>
|
|
|
+
|
|
|
+ {{-- <td>{{$patient->is_enrolled_in_cm ? 'Yes' : 'No'}}</td>--}}
|
|
|
+ {{-- <td>{{$patient->is_enrolled_in_rm ? 'Yes' : 'No'}}</td>--}}
|
|
|
+ <td class="d-none text-nowrap">
|
|
|
+ <?php $m = $patient->lastMeasurementOfType('Wt. (lbs.)'); ?>
|
|
|
+ {{$m && $m->value ? round($m->value, 2) : '-'}}
|
|
|
+ </td>
|
|
|
+ <td class="d-none text-nowrap">
|
|
|
+ <?php $m = $patient->lastMeasurementOfType('BP'); ?>
|
|
|
+ {{$m && $m->value ? $m->value : '-'}}
|
|
|
+ </td>
|
|
|
+ <td>{{$patient->getMcpAssignedOn()}}</td>
|
|
|
+ @if($pro->pro_type == 'ADMIN')
|
|
|
+ <td>{{@$patient->mcp ? $patient->mcp->displayName() : '--'}}</td>
|
|
|
+ <td>{{$patient->initiative}}</td>
|
|
|
+ @endif
|
|
|
+ </tr>
|
|
|
+ @endforeach
|
|
|
+
|
|
|
+ @if(count($patients) === 0)
|
|
|
+ <tr>
|
|
|
+ <td colspan="24">No records found!</td>
|
|
|
+ </tr>
|
|
|
+ @endif
|
|
|
+ </tbody>
|
|
|
+
|
|
|
+ </table>
|
|
|
+</div>
|
|
|
+<div class="px-3 pt-3">
|
|
|
+ {{$patients->withQueryString()->links()}}
|
|
|
+</div>
|
|
|
+
|
|
|
+<script>
|
|
|
+ (function () {
|
|
|
+ function init() {
|
|
|
+ let panning = false, prevX = false, prevY = false;
|
|
|
+ $('#admin-patients-list-extended')
|
|
|
+ .off('mousedown.pan')
|
|
|
+ .on('mousedown.pan', function (_e) {
|
|
|
+ if (panning && panning.length) return false;
|
|
|
+ if (_e.ctrlKey) {
|
|
|
+ prevX = _e.screenX;
|
|
|
+ prevY = _e.screenY;
|
|
|
+ panning = $(this);
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ });
|
|
|
+ $(document)
|
|
|
+ .off('mousemove.pan')
|
|
|
+ .on('mousemove.pan', function (_e) {
|
|
|
+ if (!panning || !panning.length) return;
|
|
|
+ let deltaX = _e.screenX - prevX, deltaY = _e.screenY - prevY;
|
|
|
+ panning.scrollTop(panning.scrollTop() - deltaY);
|
|
|
+ panning.scrollLeft(panning.scrollLeft() - deltaX);
|
|
|
+ prevX = _e.screenX;
|
|
|
+ prevY = _e.screenY;
|
|
|
+ });
|
|
|
+ $(document)
|
|
|
+ .off('mouseup.pan')
|
|
|
+ .on('mouseup.pan', function (_e) {
|
|
|
+ panning = false;
|
|
|
+ });
|
|
|
+ }
|
|
|
+
|
|
|
+ addMCInitializer('admin-patients-list-extended', init, '#admin-patients-list-extended');
|
|
|
+ }).call(window);
|
|
|
+</script>
|