فهرست منبع

Coverage history table

Samson Mutunga 3 سال پیش
والد
کامیت
fd8a722805

+ 5 - 0
app/Http/Controllers/PatientController.php

@@ -671,4 +671,9 @@ class PatientController extends Controller
 
         return view('app.patient.client-documents', compact('templates', 'companyPros', 'patient'));
     }
+
+    public function insuranceCoverageHistory(Request $request, Client $patient){
+        $insuranceCoverageHistory = ClientPrimaryCoverage::where('client_id', $patient->id)->orderBy('created_at', 'DESC')->get();
+        return view('app.patient.insurance-coverage-history', compact('patient', 'insuranceCoverageHistory'));
+    }
 }

+ 50 - 0
resources/views/app/patient/insurance-coverage-history.blade.php

@@ -0,0 +1,50 @@
+@extends ('layouts.patient')
+
+@section('inner-content')
+
+<style>
+    .eligible-table td {
+        white-space: nowrap;
+    }
+</style>
+
+<div>
+    <div class="d-flex align-items-center">
+        <h4 class="font-weight-bold m-0 font-size-16">Insurance Coverage History</h4>
+    </div>
+
+    <table class="table table-sm table-striped table-bordered mt-3 mb-0">
+        <thead>
+            <tr>
+                <th class="border-0">Created At</th>
+                <th class="border-0">Plan Type</th>
+                <th class="border-0">Creation Strategy</th>
+                <th class="border-0">Is Covered</th>
+                <th class="border-0">Is Manually Determined</th>
+                <th class="border-0"></th>
+            </tr>
+        </thead>
+        <tbody>
+            @foreach($insuranceCoverageHistory as $coverage)
+            <tr>
+                <td>{{ friendly_date($coverage->created_at) }}</td>
+                <td>{{ $coverage->plan_type }}</td>
+                <td>{{ $coverage->creation_strategy }}</td>
+                <td>{{ $coverage->is_covered ? 'YES':'NO' }}</td>
+                <td>{{ $coverage->is_manually_determined ? 'YES':'NO' }}</td>
+                <td>
+                    <div moe relative wide class="ml-2 hide-inside-popup">
+                        <a start show>
+                        <i class="fa fa-info-circle on-hover-opaque"></i>
+                        </a>
+                        <form url="" class="mcp-theme-1" right>
+                        @include('app.patient.partials.display-coverage-details', ['displayCoverage' => $coverage ])
+                        </form>
+                    </div>
+                </td>
+            </tr>
+            @endforeach
+        </tbody>
+    </table>
+</div>
+@endsection

+ 1 - 34
resources/views/app/patient/insurance-coverage.blade.php

@@ -1,40 +1,7 @@
 @extends ('layouts.patient')
 
 @section('inner-content')
-<?php
-function toHumanReadable($name)
-{
-    return ucwords(preg_replace("/[^0-9a-z]/i", " ", $name));
-}
-function parseRender($_data)
-{
-    if ($_data) {
-        $type = gettype($_data);
-        if (is_string($_data) || is_numeric($_data)) {
-            echo $_data;
-        } else {
-            echo "<table class='table table-sm border w-100'>";
-            foreach ($_data as $k => $v) {
-                echo "<tr>";
-                echo "<td><b class='text-secondary'>" . toHumanReadable($k) . "</b></td>";
-                echo "<td>";
-                if (is_object($v)) {
-                    parseRender($v);
-                } elseif (is_array($v)) {
-                    foreach ($v as $k2 => $v2) {
-                        parseRender($v2);
-                    }
-                } else {
-                    echo $v;
-                }
-                echo "</td>";
-                echo "</tr>";
-            }
-            echo "</table>";
-        }
-    }
-}
-?>
+
 <style>
     .eligible-table td {
         white-space: nowrap;

+ 1 - 1
resources/views/layouts/patient.blade.php

@@ -240,7 +240,7 @@ $isOldClient = (date_diff(date_create(config('app.point_impl_date')), date_creat
 						<a class="nav-link {{ strpos($routeName, 'patients.view.eligible-refreshes') === 0 ? 'active' : '' }}" href="{{ route('patients.view.eligible-refreshes', $patient) }}">Eligible Refreshes</a>
 					</li>
 					<li class="nav-item">
-						<a class="nav-link {{ strpos($routeName, 'patients.view.insurance-coverage') === 0 ? 'active' : '' }}" href="{{ route('patients.view.insurance-coverage', $patient) }}">Insurance Coverage</a>
+						<a class="nav-link {{ strpos($routeName, 'patients.view.insurance-coverage') === 0 ? 'active' : '' }}" href="{{ route('patients.view.insurance-coverage-history', $patient) }}">Insurance Coverage History</a>
 					</li>
 
 					<li class="nav-item">

+ 1 - 0
routes/web.php

@@ -536,6 +536,7 @@ Route::middleware('pro.auth')->group(function () {
             Route::get('documents', 'PatientController@documents')->name('documents');
             Route::get('incoming-reports/{currentReport?}', 'PatientController@incomingReports')->name('incoming-reports');
             Route::get('education', 'PatientController@education')->name('education');
+            Route::get('insurance-coverage-history', 'PatientController@insuranceCoverageHistory')->name('insurance-coverage-history');
             Route::get('messaging', 'PatientController@messaging')->name('messaging');
             Route::get('duplicate', 'PatientController@duplicate')->name('duplicate');
             Route::get('care-months', 'PatientController@careMonths')->name('care-months');