Преглед на файлове

Stats + matrix for bills without cpro

Vijayakrishnan преди 3 години
родител
ревизия
9327d89c29

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

@@ -3900,32 +3900,44 @@ ORDER BY c.name_last, c.name_first
             ->where('is_core_note', false)
             ->where('is_signed_by_hcp', true)
             ->whereNull('hcp_company_pro_payer_id')
+            ->orderBy('created_at', 'DESC')
             ->paginate(25);
         return view('app.notes-without-hcp-company-pro-payer', compact('rows'));
     }
 
-    public function noteBillsWithoutHCPCompanyPro(Request $request){
-        $hideTitle = $request->get('hideTitle');
-        $pro = $this->performer->pro;
-        //All companyProIds that I am supervisor
-        $flaggedNotes = Note::where('is_stamped_by_supervising_physician', false)->where('is_flagged_for_supervising_physician_review', true)->whereHas('hcpCompanyPro', function($qry) use($pro){
-            return $qry->whereHas('supervisingPhysicianCompanyPro', function($qr) use($pro){
-                return $qr->where('pro_id', $pro->id);
-            });
-        })->get();
-        return view('app.notes-pending-physician-supervisor-stamping', compact('flaggedNotes', 'hideTitle'));
+    public function noteHcpBillsWithoutCompanyPro(Request $request){
+        $rows = \App\Models\Bill::where('bill_service_type', 'NOTE')
+            ->where('is_cancelled', false)
+            ->whereNotNull('hcp_pro_id')
+            ->whereNull('hcp_company_pro_id')
+            ->where('has_hcp_been_paid', false)
+            ->orderBy('created_at', 'DESC')
+            ->paginate(25);
+        return view('app.note-hcp-bills-without-company-pro', compact('rows'));
     }
 
-    public function rpmBillsWithoutGenericCompanyPro(Request $request){
-        $hideTitle = $request->get('hideTitle');
-        $pro = $this->performer->pro;
-        //All companyProIds that I am supervisor
-        $flaggedNotes = Note::where('is_stamped_by_supervising_physician', false)->where('is_flagged_for_supervising_physician_review', true)->whereHas('hcpCompanyPro', function($qry) use($pro){
-            return $qry->whereHas('supervisingPhysicianCompanyPro', function($qr) use($pro){
-                return $qr->where('pro_id', $pro->id);
-            });
-        })->get();
-        return view('app.notes-pending-physician-supervisor-stamping', compact('flaggedNotes', 'hideTitle'));
+    public function rpmMcpBillsWithoutCompanyPro(Request $request){
+        $rows = \App\Models\Bill::where('bill_service_type', 'GENERIC')
+            ->where('is_cancelled', false)
+            ->whereNotNull('generic_pro_id')
+            ->whereNull('generic_company_pro_id')
+            ->where('has_generic_pro_been_paid', false)
+            ->where('code', 'RM MCP')
+            ->orderBy('created_at', 'DESC')
+            ->paginate(25);
+        return view('app.rpm-mcp-bills-without-company-pro', compact('rows'));
+    }
+
+    public function rpmRmmBillsWithoutCompanyPro(Request $request){
+        $rows = \App\Models\Bill::where('bill_service_type', 'GENERIC')
+            ->where('is_cancelled', false)
+            ->whereNotNull('generic_pro_id')
+            ->whereNull('generic_company_pro_id')
+            ->where('has_generic_pro_been_paid', false)
+            ->where('code', 'RM RMM')
+            ->orderBy('created_at', 'DESC')
+            ->paginate(25);
+        return view('app.rpm-rmm-bills-without-company-pro', compact('rows'));
     }
 
     public function notesResolutionCenter(Request $request) {

+ 0 - 6
resources/views/app/clients-without-default-company-pro-payer.blade.php

@@ -7,12 +7,6 @@
         <div class="mcp-theme-1">
 
             <div class="card">
-                <div class="card-header px-3 py-2 d-flex align-items-center">
-                    <strong class="text-nowrap">
-                        <i class="fas fa-clipboard"></i>
-                        Clients Without Default Company Pro Payer
-                    </strong>
-                </div>
                 <div class="card-body p-0">
 
                     <table class="table table-sm table-striped p-0 m-0">

+ 29 - 6
resources/views/app/dashboard-admin.blade.php

@@ -138,8 +138,9 @@
                                         <a href="{{ route('practice-management.clients-without-default-company-pro-payer') }}"
                                            native target="_blank"
                                            open-in-stag-popup
-                                           popup-style=""
-                                           title="Clients without default company pro payer">
+                                           popup-style="overflow-visible"
+                                           update-parent=""
+                                           title="Clients without default company location / pro payer">
                                             Clients without default company location / pro payer
                                         </a>
                                     </th>
@@ -159,7 +160,8 @@
                                         <a href="{{ route('practice-management.notes-without-hcp-company-pro-payer') }}"
                                            native target="_blank"
                                            open-in-stag-popup
-                                           popup-style=""
+                                           popup-style="overflow-visible"
+                                           update-parent=""
                                            title="Notes without HCP company pro payer">
                                             Notes without HCP company pro payer
                                         </a>
@@ -178,7 +180,14 @@
                                         {{$count}}
                                     </th>
                                     <th class="pl-2 font-weight-normal">
-                                        Note HCP bills without company pro
+                                        <a href="{{ route('practice-management.note-hcp-bills-without-company-pro') }}"
+                                           native target="_blank"
+                                           open-in-stag-popup
+                                           popup-style="overflow-visible"
+                                           update-parent=""
+                                           title="Note HCP bills without company pro">
+                                            Note HCP bills without company pro
+                                        </a>
                                     </th>
                                 </tr>
                                 <tr>
@@ -195,7 +204,14 @@
                                         {{$count}}
                                     </th>
                                     <th class="pl-2 font-weight-normal">
-                                        RPM MCP bills without company pro
+                                        <a href="{{ route('practice-management.rpm-mcp-bills-without-company-pro') }}"
+                                           native target="_blank"
+                                           open-in-stag-popup
+                                           popup-style="overflow-visible"
+                                           update-parent=""
+                                           title="RPM MCP bills without company pro">
+                                            RPM MCP bills without company pro
+                                        </a>
                                     </th>
                                 </tr>
                                 <tr>
@@ -212,7 +228,14 @@
                                         {{$count}}
                                     </th>
                                     <th class="pl-2 font-weight-normal">
-                                        RPM RMM bills without company pro
+                                        <a href="{{ route('practice-management.rpm-rmm-bills-without-company-pro') }}"
+                                           native target="_blank"
+                                           open-in-stag-popup
+                                           popup-style="overflow-visible"
+                                           update-parent=""
+                                           title="RPM RMM bills without company pro">
+                                            RPM RMM bills without company pro
+                                        </a>
                                     </th>
                                 </tr>
 

+ 81 - 0
resources/views/app/note-hcp-bills-without-company-pro.blade.php

@@ -0,0 +1,81 @@
+@extends ('layouts/empty')
+
+@section('content')
+    <div class="mcp-theme-1">
+        <div class="card-body">
+
+            <div class="mcp-theme-1">
+
+                <div class="card">
+                    <div class="card-body p-0">
+
+                        <table class="table table-sm table-striped p-0 m-0">
+                            <thead class="bg-light">
+                            <tr>
+                                <th class="border-0">Date</th>
+                                <th class="border-0">Patient</th>
+                                <th class="border-0">Insurance</th>
+                                <th class="border-0">State</th>
+                                <th class="border-0">Note</th>
+                                <th class="border-0">HCP</th>
+                                <th class="border-0">Company Pro</th>
+                            </tr>
+                            </thead>
+                            <tbody>
+                            @foreach($rows as $row)
+                                <?php $note = \App\Models\Note::where('id', $row->note_id)->first(); ?>
+                                <tr>
+                                    <td>{{ friendly_date_time($row->created_at, true) }}</td>
+                                    <td>
+                                        <a native href="/patients/view/{{ $row->client->uid }}">{{ $row->client->displayName() }}</a>
+                                    </td>
+                                    <td>
+                                        <?php $_cpc = $row->client->getPrimaryCoverage();?>
+                                        @if($_cpc && $row->client->getPrimaryCoverageStatus() === 'YES')
+                                            {{$_cpc->insuranceDisplayPayerName()}}
+                                        @else
+                                            No
+                                        @endif
+                                    </td>
+                                    <td>
+                                        {{$row->client->mailing_address_state}}
+                                    </td>
+                                    <td>
+                                        <a native href="/patients/view/{{ $row->client->uid }}/notes/view/{{$note->uid}}">{{ $note->effective_dateest }}</a>
+                                    </td>
+                                    <td>{{ $note->hcpPro ? $note->hcpPro->displayName() : '-' }}</td>
+                                    <td>
+                                        <b>{{$row->hcpCompanyPro && $row->hcpCompanyPro->company ? $row->hcpCompanyPro->company->name : '-'}}</b>
+                                        <div moe class="ml-1">
+                                            <a class="text-primary" href="" show start>Edit</a>
+                                            <form url="/api/bill/swapHcpCompanyPro">
+                                                <input type="hidden" name="uid" value="{{$row->uid}}">
+                                                <div class="mb-2">
+                                                    <select name="hcpCompanyProUid" class="form-control form-control-sm">
+                                                        <option value="">-- select --</option>
+                                                        @foreach($row->hcp->companyPros as $companyPro)
+                                                            <option value="{{$companyPro->uid}}">{{$companyPro->company->name}}</option>
+                                                        @endforeach
+                                                    </select>
+                                                </div>
+                                                <div class="mb-0">
+                                                    <button class="btn btn-primary btn-sm" submit>Submit</button>
+                                                    <button class="btn btn-default border btn-sm" cancel>Cancel</button>
+                                                </div>
+                                            </form>
+                                        </div>
+                                    </td>
+                                </tr>
+                            @endforeach
+                            </tbody>
+                        </table>
+                        <div class="pt-3 px-3">
+                            {{ $rows->links() }}
+                        </div>
+                    </div>
+                </div>
+
+            </div>
+        </div>
+    </div>
+@endsection

+ 0 - 6
resources/views/app/notes-without-hcp-company-pro-payer.blade.php

@@ -7,12 +7,6 @@
             <div class="mcp-theme-1">
 
                 <div class="card">
-                    <div class="card-header px-3 py-2 d-flex align-items-center">
-                        <strong class="text-nowrap">
-                            <i class="fas fa-clipboard"></i>
-                            Notes without HCP company pro payer
-                        </strong>
-                    </div>
                     <div class="card-body p-0">
 
                         <table class="table table-sm table-striped p-0 m-0">

+ 81 - 0
resources/views/app/rpm-mcp-bills-without-company-pro.blade.php

@@ -0,0 +1,81 @@
+@extends ('layouts/empty')
+
+@section('content')
+    <div class="mcp-theme-1">
+        <div class="card-body">
+
+            <div class="mcp-theme-1">
+
+                <div class="card">
+                    <div class="card-body p-0">
+
+                        <table class="table table-sm table-striped p-0 m-0">
+                            <thead class="bg-light">
+                            <tr>
+                                <th class="border-0">Date</th>
+                                <th class="border-0">Patient</th>
+                                <th class="border-0">Insurance</th>
+                                <th class="border-0">State</th>
+                                <th class="border-0">Care Month</th>
+                                <th class="border-0">MCP</th>
+                                <th class="border-0">Company Pro</th>
+                            </tr>
+                            </thead>
+                            <tbody>
+                            @foreach($rows as $row)
+                                <?php $careMonth = \App\Models\CareMonth::where('id', $row->care_month_id)->first(); ?>
+                                <tr>
+                                    <td>{{ friendly_date_time($row->created_at, true) }}</td>
+                                    <td>
+                                        <a native href="/patients/view/{{ $row->client->uid }}">{{ $row->client->displayName() }}</a>
+                                    </td>
+                                    <td>
+                                        <?php $_cpc = $row->client->getPrimaryCoverage();?>
+                                        @if($_cpc && $row->client->getPrimaryCoverageStatus() === 'YES')
+                                            {{$_cpc->insuranceDisplayPayerName()}}
+                                        @else
+                                            No
+                                        @endif
+                                    </td>
+                                    <td>
+                                        {{$row->client->mailing_address_state}}
+                                    </td>
+                                    <td>
+                                        <a native href="/patients/view/{{ $row->client->uid }}/care-months/view/{{$careMonth->uid}}">{{ friendly_month($careMonth->start_date) }}</a>
+                                    </td>
+                                    <td>{{ $careMonth->mcp ? $careMonth->mcp->displayName() : '-' }}</td>
+                                    <td>
+                                        <b>{{$row->genericCompanyPro ? $row->genericCompanyPro->company->name : '-'}}</b>
+                                        <div moe class="">
+                                            <a class="text-primary" href="" show start>Edit</a>
+                                            <form url="/api/bill/swapGenericCompanyPro">
+                                                <input type="hidden" name="uid" value="{{$row->uid}}">
+                                                <div class="mb-2">
+                                                    <select name="genericCompanyProUid" class="form-control form-control-sm">
+                                                        <option value="">-- select --</option>
+                                                        @foreach($row->genericPro->companyPros as $companyPro)
+                                                            <option value="{{$companyPro->uid}}">{{$companyPro->pro->displayName() . ' / ' . $companyPro->company->name}}</option>
+                                                        @endforeach
+                                                    </select>
+                                                </div>
+                                                <div class="mb-0">
+                                                    <button class="btn btn-primary btn-sm" submit>Submit</button>
+                                                    <button class="btn btn-default border btn-sm" cancel>Cancel</button>
+                                                </div>
+                                            </form>
+                                        </div>
+                                    </td>
+                                </tr>
+                            @endforeach
+                            </tbody>
+                        </table>
+                        <div class="pt-3 px-3">
+                            {{ $rows->links() }}
+                        </div>
+                    </div>
+                </div>
+
+            </div>
+        </div>
+    </div>
+@endsection

+ 81 - 0
resources/views/app/rpm-rmm-bills-without-company-pro.blade.php

@@ -0,0 +1,81 @@
+@extends ('layouts/empty')
+
+@section('content')
+    <div class="mcp-theme-1">
+        <div class="card-body">
+
+            <div class="mcp-theme-1">
+
+                <div class="card">
+                    <div class="card-body p-0">
+
+                        <table class="table table-sm table-striped p-0 m-0">
+                            <thead class="bg-light">
+                            <tr>
+                                <th class="border-0">Date</th>
+                                <th class="border-0">Patient</th>
+                                <th class="border-0">Insurance</th>
+                                <th class="border-0">State</th>
+                                <th class="border-0">Care Month</th>
+                                <th class="border-0">RMM</th>
+                                <th class="border-0">Company Pro</th>
+                            </tr>
+                            </thead>
+                            <tbody>
+                            @foreach($rows as $row)
+                                <?php $careMonth = \App\Models\CareMonth::where('id', $row->care_month_id)->first(); ?>
+                                <tr>
+                                    <td>{{ friendly_date_time($row->created_at, true) }}</td>
+                                    <td>
+                                        <a native href="/patients/view/{{ $row->client->uid }}">{{ $row->client->displayName() }}</a>
+                                    </td>
+                                    <td>
+                                        <?php $_cpc = $row->client->getPrimaryCoverage();?>
+                                        @if($_cpc && $row->client->getPrimaryCoverageStatus() === 'YES')
+                                            {{$_cpc->insuranceDisplayPayerName()}}
+                                        @else
+                                            No
+                                        @endif
+                                    </td>
+                                    <td>
+                                        {{$row->client->mailing_address_state}}
+                                    </td>
+                                    <td>
+                                        <a native href="/patients/view/{{ $row->client->uid }}/care-months/view/{{$careMonth->uid}}">{{ friendly_month($careMonth->start_date) }}</a>
+                                    </td>
+                                    <td>{{ $careMonth->rmm ? $careMonth->rmm->displayName() : '-' }}</td>
+                                    <td>
+                                        <b>{{$row->genericCompanyPro ? $row->genericCompanyPro->company->name : '-'}}</b>
+                                        <div moe class="">
+                                            <a class="text-primary" href="" show start>Edit</a>
+                                            <form url="/api/bill/swapGenericCompanyPro">
+                                                <input type="hidden" name="uid" value="{{$row->uid}}">
+                                                <div class="mb-2">
+                                                    <select name="genericCompanyProUid" class="form-control form-control-sm">
+                                                        <option value="">-- select --</option>
+                                                        @foreach($row->genericPro->companyPros as $companyPro)
+                                                            <option value="{{$companyPro->uid}}">{{$companyPro->pro->displayName() . ' / ' . $companyPro->company->name}}</option>
+                                                        @endforeach
+                                                    </select>
+                                                </div>
+                                                <div class="mb-0">
+                                                    <button class="btn btn-primary btn-sm" submit>Submit</button>
+                                                    <button class="btn btn-default border btn-sm" cancel>Cancel</button>
+                                                </div>
+                                            </form>
+                                        </div>
+                                    </td>
+                                </tr>
+                            @endforeach
+                            </tbody>
+                        </table>
+                        <div class="pt-3 px-3">
+                            {{ $rows->links() }}
+                        </div>
+                    </div>
+                </div>
+
+            </div>
+        </div>
+    </div>
+@endsection

+ 3 - 0
routes/web.php

@@ -259,6 +259,9 @@ Route::middleware('pro.auth')->group(function () {
         // new
         Route::get('clients-without-default-company-pro-payer', 'PracticeManagementController@clientsWithoutDefaultCompanyProPayer')->name('clients-without-default-company-pro-payer');
         Route::get('notes-without-hcp-company-pro-payer', 'PracticeManagementController@notesWithoutHcpCompanyProPayer')->name('notes-without-hcp-company-pro-payer');
+        Route::get('note-hcp-bills-without-company-pro', 'PracticeManagementController@noteHcpBillsWithoutCompanyPro')->name('note-hcp-bills-without-company-pro');
+        Route::get('rpm-mcp-bills-without-company-pro', 'PracticeManagementController@rpmMcpBillsWithoutCompanyPro')->name('rpm-mcp-bills-without-company-pro');
+        Route::get('rpm-rmm-bills-without-company-pro', 'PracticeManagementController@rpmRmmBillsWithoutCompanyPro')->name('rpm-rmm-bills-without-company-pro');
 
         Route::get('rpm-matrix', 'PracticeManagementController@rpmMatrix')->name('rpmMatrix');
         Route::get('client-review-requests', 'PracticeManagementController@clientReviewRequests')->name('client-review-requests');