Browse Source

adding billing report

unknown 4 years ago
parent
commit
6eb1b8036e

+ 8 - 0
app/Http/Controllers/PracticeManagementController.php

@@ -3,6 +3,7 @@
 namespace App\Http\Controllers;
 
 use App\Models\AppSession;
+use App\Models\BillingReport;
 use App\Models\ClaimEDI;
 use App\Models\Measurement;
 use App\Models\Bill;
@@ -31,6 +32,13 @@ use Illuminate\Http\Request;
 
 class PracticeManagementController extends Controller
 {
+
+    public function billingReport(Request $request)
+    {
+        $rows = BillingReport::all();
+        return view('app.practice-management.billing-report', compact('rows'));
+    }
+
     public function dashboard(Request $request)
     {
         return view('app.practice-management.dashboard');

+ 34 - 0
app/Models/BillingReport.php

@@ -0,0 +1,34 @@
+<?php
+
+namespace App\Models;
+
+use Illuminate\Database\Eloquent\Relations\HasOne;
+use Illuminate\Support\Collection;
+
+# use Illuminate\Database\Eloquent\Model;
+
+class BillingReport extends Model
+{
+    protected $table = 'billing_report';
+
+    public function clientDisplayName()
+    {
+        return $this->client_last . ', ' . $this->client_first;
+    }
+
+    public function proDisplayName()
+    {
+        return $this->pro_last . ', ' . $this->pro_first;
+    }
+
+    public function note()
+    {
+        return $this->hasOne(Note::class, 'id', 'note_id');
+    }
+
+    public function client()
+    {
+        return $this->hasOne(Client::class, 'id', 'client_id');
+    }
+
+}

+ 84 - 0
resources/views/app/practice-management/billing-report.blade.php

@@ -0,0 +1,84 @@
+@extends ('layouts/template')
+
+@section('content')
+
+    <div id="practice-bills" class="p-3 mcp-theme-1">
+    <div class="card">
+
+        <div class="card-header px-3 py-2 d-flex align-items-center">
+            <strong class="mr-4">
+                <i class="fas fa-user-injured"></i>
+                Note Billing Report
+            </strong>
+        </div>
+        <div class="card-body p-0 border-0">
+            <table class="table table-sm table-condensed table-bordered border-0 p-0 m-0">
+                <thead class="bg-light">
+                <tr>
+                    <th>Note</th>
+                    <th>Pro</th>
+                    <th>Date</th>
+                    <th>New/FU</th>
+                    <th>Method</th>
+                    <th>Billing Closed?</th>
+                    <th>Claiming Closed?</th>
+                    <th>Bill Ct.</th>
+                    <th>Bills</th>
+                    <th>ICDs</th>
+                    <th>Claims</th>
+                </tr>
+                </thead>
+                <tbody>
+                @foreach ($rows as $row)
+                    <tr class="{{false ? 'bg-light' : ''}}">
+                        <td class="text-nowrap border-left-0">
+                            <a href="/patients/view/{{$row->client_uid}}">
+                                {{$row->clientDisplayName()}}
+                            </a>
+                        </td>
+                        <td class="text-nowrap border-left-0">
+                            <a href="{{$row->link}}">
+                                {{friendlier_date_time($row->note_date, false)}}
+                            </a>
+                        </td>
+                        <td class="text-nowrap border-left-0">
+                            {{$row->proDisplayName()}}
+                        </td>
+                        <td class="text-nowrap border-left-0">
+                            {{$row->note_date}}
+                        </td>
+                        <td class="text-nowrap border-left-0">
+                            {{$row->new_or_fu_or_na}}
+                        </td>
+                        <td class="text-nowrap border-left-0">
+                            {{$row->method}}
+                        </td>
+                        <td class="text-nowrap border-left-0">
+                            {{$row->is_billing_closed}}
+                        </td>
+                        <td class="text-nowrap border-left-0">
+                            {{$row->is_claiming_closed}}
+                        </td>
+                        <td class="text-nowrap border-left-0">
+                            {{$row->bill_count}}
+                        </td>
+                        <td class="text-nowrap border-left-0">
+                            {{$row->bills}}
+                        </td>
+                        <td class="text-nowrap border-left-0">
+                            {{$row->icds}}
+                        </td>
+                        <td class="text-nowrap border-left-0">
+                            {{$row->claim_lines}}
+                        </td>
+                    </tr>
+                @endforeach
+                </tbody>
+            </table>
+            <div>
+{{--                {{$bills->links()}}--}}
+            </div>
+        </div>
+    </div>
+    </div>
+@endsection

+ 3 - 0
routes/web.php

@@ -96,6 +96,9 @@ Route::middleware('pro.auth')->group(function () {
 
         Route::middleware('pro.auth.admin')->group(function(){
 
+            // BILLING REPORT
+            Route::get('billing-report', 'PracticeManagementController@billingReport')->name('billing-report');
+
             Route::get('patient-claim-summary/{proUid?}', 'PracticeManagementController@patientClaimSummary')->name('patientClaimSummary');
 
             Route::get('cellular-measurements', 'PracticeManagementController@cellularMeasurements')->name('cellularMeasurements');