Samson Mutunga %!s(int64=3) %!d(string=hai) anos
pai
achega
aa66fbffba

+ 9 - 27
app/Http/Controllers/SupervisingPhysicianController.php

@@ -2,35 +2,9 @@
 
 namespace App\Http\Controllers;
 
-use App\Lib\Backend;
-use App\Models\Appointment;
-use App\Models\AppointmentConfirmationDecision;
-use App\Models\AppSession;
-use App\Models\CareMonth;
-use App\Models\ClientMemo;
-use App\Models\ClientProChange;
-use App\Models\ClientSMS;
-use App\Models\Facility;
-use App\Models\IncomingReport;
-use App\Models\MBPayer;
-use App\Models\ProProAccess;
-use App\Models\SupplyOrder;
-use App\Models\Ticket;
-use DateTime;
 
-use App\Models\Client;
-use App\Models\Bill;
-use App\Models\Measurement;
-use App\Models\Note;
-use App\Models\Pro;
-use App\Models\ProTransaction;
-use GuzzleHttp\Cookie\CookieJar;
 use Illuminate\Http\Request;
-use Illuminate\Support\Facades\Cookie;
-use Illuminate\Support\Facades\DB;
-use Illuminate\Support\Facades\Http;
-use App\Models\OutgoingEmailTemplate;
-
+use App\Models\ClientReviewRequest;
 class SupervisingPhysicianController extends Controller
 {
 
@@ -42,4 +16,12 @@ class SupervisingPhysicianController extends Controller
         $milliseconds = strtotime(date('Y-m-d')) . '000'; //required by the calendar
         return view('app.ps.dashboard', compact( 'milliseconds'));
     }
+
+    public function clientReviewRequests(Request $request){
+        $hideTitle = $request->get('hideTitle');
+        $performer = $this->performer();
+        $pro = $performer->pro;
+        $reviewRequests = ClientReviewRequest::where('pro_id', $pro->id)->where('is_active', true)->orderBy('created_at', 'DESC')->paginate(50);
+        return view('app.ps.review-requests.list', compact('reviewRequests', 'hideTitle'));
+    }
 }

+ 2 - 2
app/Models/Pro.php

@@ -1359,8 +1359,8 @@ ORDER BY cm.created_at DESC
         })->count();
     }
 
-    public function clientReviewRequests()
+    public function activeClientReviewRequests()
     {
-        return $this->hasMany(ClientReviewRequest::class, 'pro_id');
+        return $this->hasMany(ClientReviewRequest::class, 'pro_id')->where('is_active', true);
     }
 }

+ 3 - 3
resources/views/app/ps/dashboard.blade.php

@@ -34,9 +34,9 @@
                             <table class="table table-sm mb-0">
                                 <tbody>
                                     <tr>
-                                        <th class="px-2 text-center">{{$pro->patientsCountAsDna()}}<th>  
+                                        <th class="px-2 text-center">{{$pro->activeClientReviewRequests->count()}}<th>  
                                         <th class="pl-2">
-                                            <a class="font-weight-normal" href="{{route('dna.my-patients')}}" native target="_blank" open-in-stag-popup popup-style="tall" title="Patients ">Charts Pending My Review </a>
+                                            <a class="font-weight-normal" href="{{route('ps.client-review-requests', ['hideTitle' => true])}}" native target="_blank" open-in-stag-popup popup-style="tall" title="Charts Pending My Review">Charts Pending My Review </a>
                                         </th>
                                     </tr>
                                     
@@ -93,7 +93,7 @@
                                     </strong>
                                 </div>
                                 <div class="card-body p-0">
-                                    @include('app.dna.dashboard.encounters_pending_my_review_dashboard')
+                                    @include('app.ps.dashboard.client-charts-pending-my-review')
                                 </div>
                             </div>
 

+ 62 - 0
resources/views/app/ps/dashboard/client-charts-pending-my-review.blade.php

@@ -0,0 +1,62 @@
+
+<?php 
+    $reviewRequests = $performer->pro->activeClientReviewRequests;
+?>
+@if(!count($reviewRequests))
+    <div class="mt-3 pl-2">
+        <p>No client review requests found.</p>
+    </div>
+@else
+<div class="table-responsive">
+    <table class="table table-striped table-sm table-bordered">
+        <thead class="bg-light">
+            <tr>
+                <th class="border-0 text-secondary text-nowrap">Created</th>
+                <th class="border-0 text-secondary">Chart #</th>
+                <th class="border-0 text-secondary">Scoped Month Start</th>
+                <th class="border-0 text-secondary">Access Start</th>
+                <th class="border-0 text-secondary">Access End</th>                
+                <th class="border-0 text-secondary">Is Active</th>
+                <th class="border-0 text-secondary">Status</th>
+            </tr>
+        </thead>
+        <tbody>
+            @foreach($reviewRequests as $rr)
+            <tr>
+                <td class="text-nowrap">{{ friendlier_date($rr->created_at) }}</td>
+                <td>
+                <a native target="_blank" href="{{route('patients.view.dashboard', $rr->client)}}">
+						{{$rr->client->chart_number}}
+					</a>
+                </td>
+                <td>{{ friendlier_date($rr->scoped_month_start_date) }}</td>
+                <td>{{ friendlier_date($rr->access_start_date) }}</td>
+                <td>{{ friendlier_date($rr->access_end_date) }}</td>                
+                <td>
+                    @if($rr->is_active)
+                    <span class="text-success mr-2">YES
+                        @if($rr->reactivation_memo)
+                        <i class="fas fa-info-circle text-muted" title="{{ $rr->reactivation_memo }}"></i>
+                        @endif
+                    </span>
+                    @else
+                    <span class="text-secondary mr-2">NO
+                        @if($rr->deactivation_memo)
+                        <i class="fas fa-info-circle text-muted" title="{{ $rr->deactivation_memo }}"></i>
+                        @endif
+                    </span>
+                    @endif
+                </td>
+                <td>
+                    <span class="mr-2">{{ $rr->status ?? '--' }}
+                        @if($rr->status_memo )
+                        <i class="fas fa-info-circle text-muted" title="{{ $rr->status_memo }}"></i>
+                        @endif
+                    </span>
+                </td>
+            </tr>
+            @endforeach
+        </tbody>
+    </table>
+</div>
+@endif

+ 69 - 0
resources/views/app/ps/review-requests/list.blade.php

@@ -0,0 +1,69 @@
+@extends ('layouts.template')
+@section('content')
+<div class="p-3 mcp-theme-1">
+    <div class="">
+        @if(!$hideTitle)
+        <div class="d-flex align-items-center pb-2">
+            <h4 class="font-weight-bold mb-0 mr-3">Review Requests</h4>
+        </div>
+        @endif
+        <table class="table table-striped table-sm table-bordered">
+            <thead class="bg-light">
+                <tr>
+                    <th class="border-0 text-secondary text-nowrap">Created At</th>
+                    <th class="border-0 text-secondary text-nowrap">Chart #</th>
+                    <th class="border-0 text-secondary">Scoped Month Start Date</th>
+                    <th class="border-0 text-secondary">Access Start Date</th>
+                    <th class="border-0 text-secondary">Access End Date</th>
+                    <th class="border-0 text-secondary">Pro</th>
+                    <th class="border-0 text-secondary">Created By</th>
+                    <th class="border-0 text-secondary">Is Active</th>
+                    <th class="border-0 text-secondary">Status</th>
+                </tr>
+            </thead>
+            <tbody>
+                @foreach($reviewRequests as $rr)
+                <tr>
+                    <td class="text-nowrap">{{ friendly_date_time($rr->created_at) }}</td>
+                    <td>
+                    <a native target="_blank" href="{{route('patients.view.dashboard', $rr->client)}}">
+						{{$rr->client->chart_number}}
+					</a>
+                    </td>
+                    <td>{{ friendly_date($rr->scoped_month_start_date) }}</td>
+                    <td>{{ friendly_date($rr->access_start_date) }}</td>
+                    <td>{{ friendly_date($rr->access_end_date) }}</td>
+                    <td>{{ $rr->pro->displayName() }}</td>
+                    <td>{{ $rr->createdBySession->pro->displayName() }}</td>
+                    <td>
+                        @if($rr->is_active)
+                        <span class="text-success mr-2">YES
+                            @if($rr->reactivation_memo)
+                            <i class="fas fa-info-circle text-muted" title="{{ $rr->reactivation_memo }}"></i>
+                            @endif
+                        </span>
+                        @else
+                        <span class="text-secondary mr-2">NO
+                            @if($rr->deactivation_memo)
+                            <i class="fas fa-info-circle text-muted" title="{{ $rr->deactivation_memo }}"></i>
+                            @endif
+                        </span>
+                        @endif
+                    </td>
+                    <td>
+                        <span class="mr-2">{{ $rr->status ?? '--' }}
+                            @if($rr->status_memo )
+                            <i class="fas fa-info-circle text-muted" title="{{ $rr->status_memo }}"></i>
+                            @endif
+                        </span>
+                    </td>
+                </tr>
+                @endforeach
+            </tbody>
+        </table>
+        <div class="p-3">
+            {{$reviewRequests->withQueryString()->links()}}
+        </div>
+    </div>
+</div>
+@endsection

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

@@ -147,7 +147,7 @@
                             <a class="dropdown-item" href="{{ route('practice-management.my-flyers') }}">My Flyers</a>
                             <a class="dropdown-item" href="{{ route('practice-management.notes-pending-physician-supervisor-stamping') }}">Notes Pending Physician Supervisor Stamping</a>
                         @else 
-                            <a class="dropdown-item" href="{{ route('practice-management.myFavorites') }}">My Patient Chart Review Requests</a>
+                            <a class="dropdown-item" href="{{ route('ps.client-review-requests') }}">My Patient Chart Review Requests</a>
                             <a class="dropdown-item" href="{{ route('practice-management.myTickets') }}">My Bills</a>
                             <a class="dropdown-item" href="{{ route('practice-management.financialTransactions') }}">Financial Transactions</a>
                         @endif
@@ -183,7 +183,6 @@
                             <a class="dropdown-item" href="{{ route('dna.myBills') }}">My Bills</a>
                             <a class="dropdown-item" href="{{ route('dna.myClinicalTeams') }}">My Clinical Teams</a>
                         @endif
-                       
                     </div>
                 </li>
 

+ 2 - 0
routes/web.php

@@ -205,6 +205,8 @@ Route::middleware('pro.auth')->group(function () {
 
     Route::name('ps.')->prefix('ps')->group(function () {
         Route::get('dashboard', [SupervisingPhysicianController::class, 'dashboard'])->name('dashboard');
+        Route::get('client-review-requests', [SupervisingPhysicianController::class, 'clientReviewRequests'])->name('client-review-requests');
+        
 
     });