Переглянути джерело

DNA - db stat - pending notes to sign (by mcp)

Vijayakrishnan 3 роки тому
батько
коміт
7d56e622f1

+ 17 - 7
app/Http/Controllers/HomeController.php

@@ -232,13 +232,23 @@ class HomeController extends Controller
 
         $keyNumbers['pendingBillsToSign'] = $pendingBillsToSign;
 
-        $pendingNotesToSign = Note::where(function ($query) use ($performerProID) {
-            $query->where('hcp_pro_id', $performerProID)->where('is_signed_by_hcp', false)->where('is_cancelled', false);;
-        })
+        $pendingNotesToSign = Note
+            ::where(function ($query) use ($performerProID) {
+                $query->where('hcp_pro_id', $performerProID)->where('is_signed_by_hcp', false)->where('is_cancelled', false);
+            })
             ->orWhere(function ($query) use ($performerProID) {
-                $query->where('ally_pro_id', $performerProID)->where('is_signed_by_ally', false)->where('is_cancelled', false);;
-            })->count();
-            $keyNumbers['pendingNotesToSign'] = $pendingNotesToSign;
+                $query->where('ally_pro_id', $performerProID)->where('is_signed_by_ally', false)->where('is_cancelled', false);
+            })
+            ->count();
+        $keyNumbers['pendingNotesToSign'] = $pendingNotesToSign;
+
+        // notes pending mcp sign (applicable to dnas only)
+        $pendingNotesToSignMCP = Note
+            ::where(function ($query) use ($performerProID) {
+                $query->where('ally_pro_id', $performerProID)->where('is_signed_by_hcp', false)->where('is_cancelled', false);
+            })
+            ->count();
+        $keyNumbers['$pendingNotesToSignMCP'] = $pendingNotesToSignMCP;
 
         $pendingNotesToSignAllySigned = Note::where(function ($query) use ($performerProID) {
             $query->where('hcp_pro_id', $performerProID)->where('is_signed_by_hcp', false)->where('is_signed_by_ally', true)->where('is_cancelled', false);;
@@ -247,7 +257,7 @@ class HomeController extends Controller
 
 
         $signedNotesWithoutBills = Note::where(function ($query) use ($performerProID) {
-            $query->where('hcp_pro_id', $performerProID)->where('is_signed_by_hcp', true)->where('is_cancelled', false);;
+            $query->where('hcp_pro_id', $performerProID)->where('is_signed_by_hcp', true)->where('is_cancelled', false);
         })->whereDoesntHave('bills')->count();
 
         $keyNumbers['signedNotesWithoutBills'] = $signedNotesWithoutBills;

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

@@ -182,6 +182,17 @@ class PracticeManagementController extends Controller
         return view('app.practice-management.notes', compact('notes', 'filter'));
     }
 
+    public function dnaNotesPendingMcpSign(Request $request)
+    {
+        $proID = $this->performer()->pro->id;
+        $notes = Note::where('ally_pro_id', $proID)
+            ->where('is_signed_by_hcp', false)
+            ->where('is_cancelled', false)
+            ->orderBy('created_at', 'desc')
+            ->get();
+        return view('app.practice-management.dna-notes-pending-mcp-sign', compact('notes'));
+    }
+
     public function naBillableSignedNotes(Request $request)
     {
 

+ 7 - 0
resources/views/app/dashboard.blade.php

@@ -33,10 +33,17 @@
                                     <th class="px-2 text-center">{{$keyNumbers['signedNotesWithoutBills']}}</th>
                                     <th class="pl-2"><a href="/practice-management/notes/without-bills">Signed notes without bills</a></th>
                                 </tr>
+                                @if(!$pro->isDefaultNA())
                                 <tr>
                                     <th class="px-2 text-center">{{$keyNumbers['pendingNotesToSign']}}</th>
                                     <th class="pl-2"><a href="/practice-management/notes/not-yet-signed">Pending notes to sign</a></th>
                                 </tr>
+                                @else
+                                <tr>
+                                    <th class="px-2 text-center">{{$keyNumbers['$pendingNotesToSignMCP']}}</th>
+                                    <th class="pl-2"><a href="/practice-management/dna-notes-pending-mcp-sign">Pending notes to sign (MCP)</a></th>
+                                </tr>
+                                @endif
                                 @if(!!$keyNumbers['pendingNotesToSignAllySigned'])
                                 <tr>
                                     <th class="px-2 text-center">{{$keyNumbers['pendingNotesToSignAllySigned']}}</th>

+ 61 - 0
resources/views/app/practice-management/dna-notes-pending-mcp-sign.blade.php

@@ -0,0 +1,61 @@
+@extends ('layouts/template')
+
+@section('content')
+
+    <div 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>
+                Notes Pending MCP Sign
+            </strong>
+        </div>
+        <div class="card-body p-0">
+
+            <table class="table table-sm table-condensed p-0 m-0">
+                <thead class="bg-light">
+                <tr>
+                    <th class="px-3 border-0">Created</th>
+                    <th class="border-0">Effective Date</th>
+                    <th class="border-0">Patient</th>
+                    <th class="border-0">HCP</th>
+                    <th class="border-0 w-50">Content</th>
+                </tr>
+                </thead>
+                <tbody>
+                @foreach ($notes as $note)
+                    <tr class="{{ $note->is_cancelled ? 'cancelled-item always-clickable' : '' }}">
+                        <td class="px-3">
+                            {{ friendly_date_time($note->created_at, true) }}
+                        </td>
+                        <td class="">
+                            <a href="/patients/view/{{ $note->client->uid }}/notes/view/{{ $note->uid }}" class="font-weight-bold">
+                                {{ friendly_date_time($note->effective_dateest, false) }}
+                            </a>
+                            <span class="ml-1">{{ $note->is_cancelled ? '[cancelled]' : '' }}</span>
+                        </td>
+                        <td class="">
+                            <a href="/patients/view/{{ $note->client->uid }}">{{ $note->client->displayName() }}</a>
+                        </td>
+                        <td class="">
+                            {{$note->hcpPro->displayName()}}
+                        </td>
+                        <td class="">
+                            <?php
+                            $textContent = strip_tags($note->free_text_html);
+                            if(strlen($textContent) > 200) {
+                                $textContent = substr($textContent, 0, 200) . '…';
+                            }
+                            ?>
+                            {!! empty($textContent) ? '-' : $textContent !!}
+                        </td>
+                    </tr>
+                @endforeach
+                </tbody>
+            </table>
+        </div>
+    </div>
+    </div>
+
+@endsection

+ 1 - 0
routes/web.php

@@ -85,6 +85,7 @@ Route::middleware('pro.auth')->group(function () {
         Route::get('w9', 'PracticeManagementController@w9')->name('w9');
         Route::get('contract', 'PracticeManagementController@contract')->name('contract');
         Route::get('notes/{filter?}', 'PracticeManagementController@notes')->name('notes');
+        Route::get('dna-notes-pending-mcp-sign', 'PracticeManagementController@dnaNotesPendingMcpSign')->name('dna-notes-pending-mcp-sign');
         Route::get('na-billable-signed-notes/{filter?}', 'PracticeManagementController@naBillableSignedNotes')->name('na-billable-signed-notes');
         Route::get('bills/{filter?}', 'PracticeManagementController@bills')->name('bills');
         Route::get('rm-bills-to-sign', 'PracticeManagementController@rmBillsToSign')->name('rm-bills-to-sign');