Parcourir la source

added pros filter

= il y a 4 ans
Parent
commit
0537813b6d

+ 20 - 10
app/Http/Controllers/PracticeManagementController.php

@@ -857,26 +857,36 @@ class PracticeManagementController extends Controller
         return view('app.practice-management.shipments-multi-print', compact('shipments'));
     }
 
-    public function claimsReport(Request $request)
-    {
-        return view('app.practice-management.claims-report');
-    }
-
-    public function patientClaimSummary(Request $request)
+    public function patientClaimSummary(Request $request, $proUid)
     {
+        $performerPro = $this->performer->pro;
+        $allPros = [];
+        if ($performerPro->pro_type == 'ADMIN') {
+            $allPros = Pro::all();
+        } else {
+           $allPros = [$performerPro];
+        }
 
         //Patient | MCP | # Notes Total | # Notes without Billing Closed | # Notes without Claiming Closed
-        $patients = Client::where('is_dummy', '=', false)
+        $patientsQuery = Client::where('is_dummy', '=', false)
             ->select('id', 'uid', 'name_first', 'name_last', 'mcp_pro_id',
                 DB::raw("(SELECT name_first||' '||name_last FROM pro where pro.id = client.mcp_pro_id) as mcp"),
                 DB::raw("(SELECT uid FROM pro where pro.id = mcp_pro_id) as mcp_pro_uid"),
                 DB::raw("(SELECT COUNT(*) FROM note where note.client_id = client.id) as notes_total"),
                 DB::raw("(SELECT COUNT(*) FROM note where note.client_id = client.id AND is_bill_closed IS NOT true) as notes_without_billing_closed"),
                 DB::raw("(SELECT COUNT(*) FROM note where note.client_id = client.id AND is_claim_closed IS NOT true) as notes_without_claiming_closed")
-            )->orderBy('notes_without_claiming_closed', 'desc')
-            ->paginate(50);
+            )->orderBy('notes_without_claiming_closed', 'desc');
+
+            if($proUid){
+                $mcpPro = Pro::where('uid', $proUid)->first();
+                if($mcpPro){
+                    $patientsQuery->where('client.mcp_pro_id','=', $mcpPro->id);
+                }
+            }
+
+           $patients =  $patientsQuery->paginate(50);
 
-        return view('app.practice-management.patient-claim-summary', compact('patients'));
+        return view('app.practice-management.patient-claim-summary', compact('patients', 'proUid', 'allPros'));
     }
 
 }

+ 0 - 7
resources/views/app/practice-management/claims-report.blade.php

@@ -1,7 +0,0 @@
-@extends ('layouts/template')
-
-@section('content')
-    <div >
-        <iframe class="mt-5" src="/api/dev/view/claimsReport?sessionKey={{$performer->session_key}}" style="position:fixed; top:0; left:0; bottom:0; right:0; width:100%; height:100%; border:none; margin:0; padding:0; overflow:hidden;"/>
-    </div>
-@endsection

+ 13 - 3
resources/views/app/practice-management/patient-claim-summary.blade.php

@@ -6,13 +6,21 @@
         <div class="card">
 
             <div class="card-header px-3 py-2 d-flex align-items-center">
-                <strong class="mr-4">
+                <strong class="mr-4 d-inline-block">
                     <i class="fas fa-user-injured"></i>
                     Patient Claim Summary
                 </strong>
+                <select class="ml-auto max-width-300px form-control form-control-sm d-inline-block"
+                        onchange="fastLoad('/practice-management/patient-claim-summary/' + this.value, true, false, false)">
+                    <option value="" {{ $proUid === '' ? 'selected' : '' }}>All Pros</option>
+                    @foreach($allPros as $_pro)
+                        <option
+                            value="{{$_pro->uid}}" {{ $proUid === $_pro->uid ? 'selected' : '' }}>{{$_pro->displayName()}}</option>
+                    @endforeach
+                </select>
             </div>
             <div class="card-body p-0 border-0">
-{{--                Patient | MCP | # Notes Total | # Notes without Billing Closed | # Notes without Claiming Closed--}}
+                {{--                Patient | MCP | # Notes Total | # Notes without Billing Closed | # Notes without Claiming Closed--}}
                 <table class="table table-striped table-condensed table-sm">
                     <thead>
                     <tr>
@@ -26,7 +34,9 @@
                     <tbody>
                     @foreach($patients as  $patient)
                         <tr>
-                            <td><a href="{{route('patients.view.claims-resolver', $patient->uid)}}">{{$patient->name_first}} {{$patient->name_last}}</a></td>
+                            <td>
+                                <a href="{{route('patients.view.claims-resolver', $patient->uid)}}">{{$patient->name_first}} {{$patient->name_last}}</a>
+                            </td>
                             <td>{{$patient->mcp}}</td>
                             <td>{{$patient->notes_total}}</td>
                             <td>{{$patient->notes_without_billing_closed}}</td>

+ 0 - 2
resources/views/layouts/template.blade.php

@@ -116,8 +116,6 @@
 
                         <a class="dropdown-item" href="{{ route('practice-management.billingManager') }}">Billing Manager</a>
 
-                        <a class="dropdown-item" href="{{ route('practice-management.claimsReport') }}">Claims Report</a>
-
                         @if($pro && $pro->pro_type == 'ADMIN')
                             <a class="dropdown-item" href="{{ route('practice-management.processingBillMatrix') }}">Processing Bills</a>
                             <a class="dropdown-item" href="{{ route('practice-management.cellularMeasurements') }}">Cellular Measurements</a>

+ 1 - 2
routes/web.php

@@ -96,7 +96,7 @@ Route::middleware('pro.auth')->group(function () {
 
         Route::middleware('pro.auth.admin')->group(function(){
 
-            Route::get('patient-claim-summary', 'PracticeManagementController@patientClaimSummary')->name('patientClaimSummary');
+            Route::get('patient-claim-summary/{proUid?}', 'PracticeManagementController@patientClaimSummary')->name('patientClaimSummary');
 
             Route::get('cellular-measurements', 'PracticeManagementController@cellularMeasurements')->name('cellularMeasurements');
 
@@ -110,7 +110,6 @@ Route::middleware('pro.auth')->group(function () {
             Route::get('claims-download', 'PracticeManagementController@downloadClaims')->name('download-claims');
 
             Route::get('treatment-service-util', 'PracticeManagementController@treatmentServiceUtil')->name('treatmentServiceUtil');
-            Route::get('claims-report', 'PracticeManagementController@claimsReport')->name('claimsReport');
 
             // old supply-orders & shipments matrices
             // Route::get('supply-orders', 'PracticeManagementController@supplyOrders')->name('supply-orders');