Ver código fonte

Clients without default company location / pro payer

Vijayakrishnan 3 anos atrás
pai
commit
b9001bfdc8

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

@@ -3882,6 +3882,43 @@ ORDER BY c.name_last, c.name_first
         return view('app.notes-pending-physician-supervisor-stamping', compact('flaggedNotes', 'hideTitle'));
     }
 
+    public function clientsWithoutDefaultCompanyProPayer(Request $request){
+        $rows = \App\Models\Client::whereNull('shadow_pro_id')
+            ->where('is_active', true)
+            ->where(function ($q) {
+                $q->whereNull('client_engagement_status_category')
+                    ->orWhere('client_engagement_status_category', 'DUMMY');
+            })
+            ->whereRaw('(default_mcp_company_pro_payer_id IS NULL OR default_mcp_company_location_id IS NULL)')
+            ->orderBy('created_at', 'DESC')
+            ->paginate(25);
+        return view('app.clients-without-default-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 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 notesResolutionCenter(Request $request) {
 
         $columns = "(c.name_first || ' ' || c.name_last) as client_name,

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

@@ -0,0 +1,186 @@
+@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-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">
+                        <thead class="bg-light">
+                            <tr>
+                                <th class="border-0">Created At</th>
+                                <th class="border-0">Patient</th>
+                                <th class="border-0">Insurance</th>
+                                <th class="border-0">State</th>
+                                <th class="border-0">MCP</th>
+                                <th class="border-0">Def. MCP CP</th>
+                                <th class="border-0">Def. MCP<br>Company Pro Payer</th>
+                                <th class="border-0">Def. MCP<br>Company Location</th>
+                            </tr>
+                        </thead>
+                        <tbody>
+                            @foreach($rows as $row)
+                            <tr>
+                                <td>{{ friendly_date_time($row->created_at, true) }}</td>
+                                <td>
+                                    <a native href="/patients/view/{{ $row->uid }}">{{ $row->displayName() }}</a>
+                                </td>
+                                <td>
+                                    <?php $_cpc = $row->getPrimaryCoverage();?>
+                                    @if($_cpc && $row->getPrimaryCoverageStatus() === 'YES')
+                                        {{$_cpc->insuranceDisplayPayerName()}}
+                                    @else
+                                        No
+                                    @endif
+                                </td>
+                                <td>
+                                    {{$row->mailing_address_state}}
+                                </td>
+                                <td>{{ $row->mcp ? $row->mcp->displayName() : '-' }}</td>
+                                <td>
+                                    <div>
+                                        <b>{{$row->default_mcp_company_pro_id? $row->defaultMcpCompanyPro->company->name:'-'}}</b>
+                                        @if($row->default_mcp_company_pro_id)
+                                            <div moe bottom relative class="ml-1">
+                                                <a start show><i class="fa fa-times text-danger"></i></a>
+                                                <form url="/api/client/wipeDefaultMcpCompanyPro"
+                                                      class="mcp-theme-1 min-width-200px" right>
+                                                    <input type="hidden" name="uid" value="{{$row->uid}}">
+                                                    <p>Remove default MCP company pro?</p>
+                                                    <div>
+                                                        <button submit class="btn btn-sm btn-primary mr-1">Submit</button>
+                                                        <button cancel class="btn btn-sm btn-default border">Cancel</button>
+                                                    </div>
+                                                </form>
+                                            </div>
+                                        @elseif($row->mcp)
+                                            <div moe bottom relative class="ml-2">
+                                                <a start show>Edit</a>
+                                                <form url="/api/client/putDefaultMcpCompanyPro"
+                                                      class="mcp-theme-1  min-width-200px" right>
+                                                    <input type="hidden" name="uid" value="{{$row->uid}}">
+                                                    <div class="mb-2">
+                                                        <label class="text-sm text-secondary mb-1">Company</label>
+                                                        <select name="defaultMcpCompanyProUid" class="form-control form-control-sm">
+                                                            <option value="">-- select --</option>
+                                                            @foreach($row->mcp->companyPros as $companyPro)
+                                                                <option value="{{$companyPro->uid}}">{{$companyPro->company->name}}</option>
+                                                            @endforeach
+                                                        </select>
+                                                    </div>
+                                                    <div>
+                                                        <button submit class="btn btn-sm btn-primary mr-1">Submit</button>
+                                                        <button cancel class="btn btn-sm btn-default border">Cancel</button>
+                                                    </div>
+                                                </form>
+                                            </div>
+                                        @endif
+                                    </div>
+                                </td>
+                                <td>
+                                    @if($row->defaultMcpCompanyPro)
+                                        <div>
+                                            <b>{{$row->default_mcp_company_pro_payer_id? $row->defaultMcpCompanyProPayer->payer->name:'No'}}</b>
+                                            @if($row->default_mcp_company_pro_payer_id)
+                                                <div moe bottom relative class="ml-1">
+                                                    <a start show><i class="fa fa-times text-danger"></i></a>
+                                                    <form url="/api/client/wipeDefaultMcpCompanyProPayer"
+                                                          class="mcp-theme-1 min-width-200px" right>
+                                                        <input type="hidden" name="uid" value="{{$row->uid}}">
+                                                        <p>Remove default MCP company pro payer?</p>
+                                                        <div>
+                                                            <button submit class="btn btn-sm btn-primary mr-1">Submit</button>
+                                                            <button cancel class="btn btn-sm btn-default border">Cancel</button>
+                                                        </div>
+                                                    </form>
+                                                </div>
+                                            @else
+                                                <div moe bottom relative class="ml-2">
+                                                    <a start show>Edit</a>
+                                                    <form url="/api/client/putDefaultMcpCompanyProPayer"
+                                                          class="mcp-theme-1  min-width-200px" right>
+                                                        <input type="hidden" name="uid" value="{{$row->uid}}">
+                                                        <div class="mb-2">
+                                                            <label class="text-sm text-secondary mb-1">Payer</label>
+                                                            <select name="defaultMcpCompanyProPayerUid" class="form-control form-control-sm">
+                                                                <option value="">-- select --</option>
+                                                                @foreach($row->defaultMcpCompanyPro->companyProPayers as $companyProPayer)
+                                                                    <option value="{{$companyProPayer->uid}}">{{$companyProPayer->payer->name}}</option>
+                                                                @endforeach
+                                                            </select>
+                                                        </div>
+                                                        <div>
+                                                            <button submit class="btn btn-sm btn-primary mr-1">Submit</button>
+                                                            <button cancel class="btn btn-sm btn-default border">Cancel</button>
+                                                        </div>
+                                                    </form>
+                                                </div>
+                                            @endif
+                                        </div>
+                                    @endif
+                                </td>
+                                <td>
+                                    @if($row->defaultMcpCompanyPro)
+                                        <div>
+                                            <b>{{$row->default_mcp_company_location_id? implode(" ", [$row->defaultMcpCompanyLocation->line1, $row->defaultMcpCompanyLocation->city, $row->defaultMcpCompanyLocation->state]):'No'}}</b>
+                                            @if($row->default_mcp_company_location_id)
+                                                <div moe bottom relative class="ml-1">
+                                                    <a start show><i class="fa fa-times text-danger"></i></a>
+                                                    <form url="/api/client/wipeDefaultMcpCompanyLocation"
+                                                          class="mcp-theme-1 min-width-200px" right>
+                                                        <input type="hidden" name="uid" value="{{$row->uid}}">
+                                                        <p>Remove default MCP company location?</p>
+                                                        <div>
+                                                            <button submit class="btn btn-sm btn-primary mr-1">Submit</button>
+                                                            <button cancel class="btn btn-sm btn-default border">Cancel</button>
+                                                        </div>
+                                                    </form>
+                                                </div>
+                                            @else
+                                                <div moe bottom relative class="ml-2">
+                                                    <a start show>Edit</a>
+                                                    <form url="/api/client/putDefaultMcpCompanyLocation"
+                                                          class="mcp-theme-1  min-width-200px" right>
+                                                        <input type="hidden" name="uid" value="{{$row->uid}}">
+                                                        <div class="mb-2">
+                                                            <label class="text-sm text-secondary mb-1">Location</label>
+                                                            <select name="defaultCompanyLocationUid" class="form-control form-control-sm">
+                                                                <option value="">-- select --</option>
+                                                                @foreach($row->defaultMcpCompanyPro->company->locations as $location)
+                                                                    <option value="{{$location->uid}}">
+                                                                        {{implode(" ", [$location->line1, $location->city, $location->state])}}
+                                                                    </option>
+                                                                @endforeach
+                                                            </select>
+                                                        </div>
+                                                        <div>
+                                                            <button submit class="btn btn-sm btn-primary mr-1">Submit</button>
+                                                            <button cancel class="btn btn-sm btn-default border">Cancel</button>
+                                                        </div>
+                                                    </form>
+                                                </div>
+                                            @endif
+                                        </div>
+                                    @endif
+                                </td>
+                            </tr>
+                            @endforeach
+                        </tbody>
+                    </table>
+                </div>
+            </div>
+
+        </div>
+    </div>
+</div>
+@endsection

+ 41 - 4
resources/views/app/dashboard-admin.blade.php

@@ -129,13 +129,33 @@
                                                 $q->whereNull('client_engagement_status_category')
                                                     ->orWhere('client_engagement_status_category', 'DUMMY');
                                             })
-                                            ->whereNull('default_mcp_company_pro_payer_id')
+                                            ->whereRaw('(default_mcp_company_pro_payer_id IS NULL OR default_mcp_company_location_id IS NULL)')
                                             ->count();
                                         ?>
                                         {{$count}}
                                     </th>
                                     <th class="pl-2 font-weight-normal">
-                                        Clients without default company pro payer
+                                        <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">
+                                            Clients without default company location / pro payer
+                                        </a>
+                                    </th>
+                                </tr>
+                                <tr>
+                                    <th class="px-2 text-center">
+                                        <?php
+                                        $count = \App\Models\Note::where('is_cancelled', false)
+                                            ->where('is_signed_by_hcp', true)
+                                            ->whereNull('hcp_company_pro_payer_id')
+                                            ->count();
+                                        ?>
+                                        {{$count}}
+                                    </th>
+                                    <th class="pl-2 font-weight-normal">
+                                        Notes without hcp company pro payer
                                     </th>
                                 </tr>
                                 <tr>
@@ -151,7 +171,7 @@
                                         {{$count}}
                                     </th>
                                     <th class="pl-2 font-weight-normal">
-                                        Note bills without CPP
+                                        Note HCP bills without company pro
                                     </th>
                                 </tr>
                                 <tr>
@@ -168,7 +188,24 @@
                                         {{$count}}
                                     </th>
                                     <th class="pl-2 font-weight-normal">
-                                        RPM bills without CPP
+                                        RPM MCP bills without company pro
+                                    </th>
+                                </tr>
+                                <tr>
+                                    <th class="px-2 text-center">
+                                        <?php
+                                        $count = \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')
+                                            ->count();
+                                        ?>
+                                        {{$count}}
+                                    </th>
+                                    <th class="pl-2 font-weight-normal">
+                                        RPM RMM bills without company pro
                                     </th>
                                 </tr>
 

+ 1 - 1
resources/views/app/notes-pending-physician-supervisor-stamping.blade.php

@@ -1,4 +1,4 @@
-@extends ('layouts/template')
+@extends ('layouts/empty')
 
 @section('content')
 <div class="mcp-theme-1">

+ 3 - 0
routes/web.php

@@ -256,6 +256,9 @@ Route::middleware('pro.auth')->group(function () {
         Route::get('my-flyers', 'PracticeManagementController@myFlyers')->name('my-flyers');
         Route::get('notes-pending-physician-supervisor-stamping', 'PracticeManagementController@notesPendingPhysicianSupervisorStamping')->name('notes-pending-physician-supervisor-stamping');
 
+        // new
+        Route::get('clients-without-default-company-pro-payer', 'PracticeManagementController@clientsWithoutDefaultCompanyProPayer')->name('clients-without-default-company-pro-payer');
+
         Route::get('rpm-matrix', 'PracticeManagementController@rpmMatrix')->name('rpmMatrix');
         Route::get('client-review-requests', 'PracticeManagementController@clientReviewRequests')->name('client-review-requests');